Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

terra-disclosure-manager

Package Overview
Dependencies
Maintainers
9
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

terra-disclosure-manager - npm Package Compare versions

Comparing version 4.6.0 to 4.7.0

5

CHANGELOG.md

@@ -7,2 +7,7 @@ ChangeLog

4.7.0 - (April 2, 2019)
------------------
### Changed
* Doc Updates
4.6.0 - (March 26, 2019)

@@ -9,0 +14,0 @@ ------------------

6

docs/DEPENDENCIES.md

@@ -7,3 +7,3 @@ # Dependency Information

| prop-types | ^15.5.8 | -- | Runtime type checking for React props and similar objects. |
| terra-doc-template | ^2.2.0 | ^16.4.2 | Provides an adjustable template for documentation pages. |
| terra-doc-template | ^2.2.0 | ^16.8.5 | Provides an adjustable template for documentation pages. |

@@ -13,3 +13,3 @@ ## peerDependencies

|-|-|-|-|
| react | ^16.4.2 | -- | React is a JavaScript library for building user interfaces. |
| react-dom | ^16.4.2 | ^16.0.0 | React package for working with the DOM. |
| react | ^16.8.5 | -- | React is a JavaScript library for building user interfaces. |
| react-dom | ^16.8.5 | ^16.0.0 | React package for working with the DOM. |

@@ -13,94 +13,59 @@ # Upgrade Guide - v2 to v3

## v2
```jsx
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
import AppDelegate from 'terra-app-delegate';
const MyDisclosureComponent = ({ app }) => (
<Button
text="Close Modal"
onClick={() => {
app.closeDisclosure();
}}
/>
);
```diff
/**
* v2.x to v3.x
*/
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
- import AppDelegate from 'terra-app-delegate';
+ import { withDisclosureManager, disclosureManagerShape } from 'terra-disclosure-manager';
MyDisclosureComponent.propType = {
app: AppDelegate.propType,
}
- const MyDisclosureComponent = ({ app }) => (
+ const MyDisclosureComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Close Modal"
onClick={() => {
- app.closeDisclosure();
+ disclosureManager.closeDisclosure();
}}
/>
- );
+ ));
const MyComponent = ({ app }) => (
<Button
text="Launch Modal"
onClick={() => {
app.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
);
MyDisclosureComponent.propType = {
- app: AppDelegate.propType,
+ disclosureManager: disclosureManagerShape,
};
MyComponent.propType = {
app: AppDelegate.propType,
}
- const MyComponent = ({ app }) => (
+ const MyComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Launch Modal"
onClick={() => {
- app.disclose({
+ disclosureManager.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
- );
+ ));
MyComponent.propType = {
- app: AppDelegate.propType,
+ disclosureManager: disclosureManagerShape,
};
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
)
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
);
```
### v3
```jsx
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
import { withDisclosureManager, disclosureManagerShape } from 'terra-disclosure-manager';
const MyDisclosureComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Close Modal"
onClick={() => {
disclosureManager.closeDisclosure();
}}
/>
));
MyDisclosureComponent.propTypes = {
disclosureManager: disclosureManagerShape,
}
const MyComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Launch Modal"
onClick={() => {
disclosureManager.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
));
MyComponent.propTypes = {
disclosureManager: disclosureManagerShape,
}
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
)
```
{
"name": "terra-disclosure-manager",
"main": "lib/DisclosureManager.js",
"version": "4.6.0",
"version": "4.7.0",
"description": "A stateful component used to manage disclosure presentation.",

@@ -6,0 +6,0 @@ "repository": {

@@ -13,94 +13,59 @@ # Upgrade Guide - v2 to v3

## v2
```jsx
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
import AppDelegate from 'terra-app-delegate';
const MyDisclosureComponent = ({ app }) => (
<Button
text="Close Modal"
onClick={() => {
app.closeDisclosure();
}}
/>
);
```diff
/**
* v2.x to v3.x
*/
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
- import AppDelegate from 'terra-app-delegate';
+ import { withDisclosureManager, disclosureManagerShape } from 'terra-disclosure-manager';
MyDisclosureComponent.propType = {
app: AppDelegate.propType,
}
- const MyDisclosureComponent = ({ app }) => (
+ const MyDisclosureComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Close Modal"
onClick={() => {
- app.closeDisclosure();
+ disclosureManager.closeDisclosure();
}}
/>
- );
+ ));
const MyComponent = ({ app }) => (
<Button
text="Launch Modal"
onClick={() => {
app.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
);
MyDisclosureComponent.propType = {
- app: AppDelegate.propType,
+ disclosureManager: disclosureManagerShape,
};
MyComponent.propType = {
app: AppDelegate.propType,
}
- const MyComponent = ({ app }) => (
+ const MyComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Launch Modal"
onClick={() => {
- app.disclose({
+ disclosureManager.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
- );
+ ));
MyComponent.propType = {
- app: AppDelegate.propType,
+ disclosureManager: disclosureManagerShape,
};
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
)
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
);
```
### v3
```jsx
import Base from 'terra-base';
import ModalManager from 'terra-modal-manager';
import { withDisclosureManager, disclosureManagerShape } from 'terra-disclosure-manager';
const MyDisclosureComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Close Modal"
onClick={() => {
disclosureManager.closeDisclosure();
}}
/>
));
MyDisclosureComponent.propTypes = {
disclosureManager: disclosureManagerShape,
}
const MyComponent = withDisclosureManager(({ disclosureManager }) => (
<Button
text="Launch Modal"
onClick={() => {
disclosureManager.disclose({
preferredType: 'modal',
content: {
key: 'MY-MODAL-DISCLOSURE',
component: <MyDisclosureComponent />,
}
});
}}
/>
));
MyComponent.propTypes = {
disclosureManager: disclosureManagerShape,
}
const MyApp = () => (
<Base locale="en">
<ModalManager>
<MyComponent />
</ModalManager>
</Base>
)
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc