@atlaskit/portal 5.2.2 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/internal/components/internal-portal-new.js +1 -2
- package/dist/cjs/internal/components/internal-portal.js +1 -2
- package/dist/es2019/internal/components/internal-portal-new.js +1 -2
- package/dist/es2019/internal/components/internal-portal.js +1 -2
- package/dist/esm/internal/components/internal-portal-new.js +1 -2
- package/dist/esm/internal/components/internal-portal.js +1 -2
- package/package.json +11 -13
- package/portal.docs.tsx +46 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/portal
|
|
2
2
|
|
|
3
|
+
## 5.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1fab6967bb305`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1fab6967bb305) -
|
|
8
|
+
Tidied feature flag `platform_dst_subtree_theming` which enables sub-tree theming capabilities
|
|
9
|
+
within `@atlaskit/app-provider`
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 5.2.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _reactDom = require("react-dom");
|
|
12
12
|
var _appProvider = require("@atlaskit/app-provider");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _useIsomorphicLayoutEffect = require("../hooks/use-isomorphic-layout-effect");
|
|
15
14
|
var _portalDomUtils = require("../utils/portal-dom-utils");
|
|
16
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
@@ -45,7 +44,7 @@ function InternalPortalNew(props) {
|
|
|
45
44
|
*/
|
|
46
45
|
var suspendedChildren = /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
47
46
|
fallback: null
|
|
48
|
-
}, colorMode
|
|
47
|
+
}, colorMode ? /*#__PURE__*/_react.default.createElement(_appProvider.ThemeProvider, {
|
|
49
48
|
defaultColorMode: colorMode
|
|
50
49
|
}, children) : children);
|
|
51
50
|
return atlaskitPortal ? /*#__PURE__*/(0, _reactDom.createPortal)(suspendedChildren, atlaskitPortal) : null;
|
|
@@ -8,7 +8,6 @@ exports.default = InternalPortal;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reactDom = require("react-dom");
|
|
10
10
|
var _appProvider = require("@atlaskit/app-provider");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _portalDomUtils = require("../utils/portal-dom-utils");
|
|
13
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
13
|
function InternalPortal(props) {
|
|
@@ -29,7 +28,7 @@ function InternalPortal(props) {
|
|
|
29
28
|
(0, _portalDomUtils.removePortalContainer)(container);
|
|
30
29
|
};
|
|
31
30
|
}, [container]);
|
|
32
|
-
return /*#__PURE__*/(0, _reactDom.createPortal)(colorMode
|
|
31
|
+
return /*#__PURE__*/(0, _reactDom.createPortal)(colorMode ? /*#__PURE__*/_react.default.createElement(_appProvider.ThemeProvider, {
|
|
33
32
|
defaultColorMode: colorMode
|
|
34
33
|
}, children) : children, container);
|
|
35
34
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { Suspense, useState } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { ThemeProvider, useColorMode } from '@atlaskit/app-provider';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect';
|
|
6
5
|
import { createAtlaskitPortal, createPortalParent } from '../utils/portal-dom-utils';
|
|
7
6
|
export default function InternalPortalNew(props) {
|
|
@@ -34,7 +33,7 @@ export default function InternalPortalNew(props) {
|
|
|
34
33
|
*/
|
|
35
34
|
const suspendedChildren = /*#__PURE__*/React.createElement(Suspense, {
|
|
36
35
|
fallback: null
|
|
37
|
-
}, colorMode
|
|
36
|
+
}, colorMode ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
38
37
|
defaultColorMode: colorMode
|
|
39
38
|
}, children) : children);
|
|
40
39
|
return atlaskitPortal ? /*#__PURE__*/createPortal(suspendedChildren, atlaskitPortal) : null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { ThemeProvider, useColorMode } from '@atlaskit/app-provider';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { appendPortalContainerIfNotAppended, createContainer, removePortalContainer } from '../utils/portal-dom-utils';
|
|
6
5
|
export default function InternalPortal(props) {
|
|
7
6
|
const {
|
|
@@ -21,7 +20,7 @@ export default function InternalPortal(props) {
|
|
|
21
20
|
removePortalContainer(container);
|
|
22
21
|
};
|
|
23
22
|
}, [container]);
|
|
24
|
-
return /*#__PURE__*/createPortal(colorMode
|
|
23
|
+
return /*#__PURE__*/createPortal(colorMode ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
25
24
|
defaultColorMode: colorMode
|
|
26
25
|
}, children) : children, container);
|
|
27
26
|
}
|
|
@@ -2,7 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { Suspense, useState } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { ThemeProvider, useColorMode } from '@atlaskit/app-provider';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { useIsomorphicLayoutEffect } from '../hooks/use-isomorphic-layout-effect';
|
|
7
6
|
import { createAtlaskitPortal, createPortalParent } from '../utils/portal-dom-utils';
|
|
8
7
|
export default function InternalPortalNew(props) {
|
|
@@ -36,7 +35,7 @@ export default function InternalPortalNew(props) {
|
|
|
36
35
|
*/
|
|
37
36
|
var suspendedChildren = /*#__PURE__*/React.createElement(Suspense, {
|
|
38
37
|
fallback: null
|
|
39
|
-
}, colorMode
|
|
38
|
+
}, colorMode ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
40
39
|
defaultColorMode: colorMode
|
|
41
40
|
}, children) : children);
|
|
42
41
|
return atlaskitPortal ? /*#__PURE__*/createPortal(suspendedChildren, atlaskitPortal) : null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { ThemeProvider, useColorMode } from '@atlaskit/app-provider';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { appendPortalContainerIfNotAppended, createContainer, removePortalContainer } from '../utils/portal-dom-utils';
|
|
6
5
|
export default function InternalPortal(props) {
|
|
7
6
|
var zIndex = props.zIndex,
|
|
@@ -21,7 +20,7 @@ export default function InternalPortal(props) {
|
|
|
21
20
|
removePortalContainer(container);
|
|
22
21
|
};
|
|
23
22
|
}, [container]);
|
|
24
|
-
return /*#__PURE__*/createPortal(colorMode
|
|
23
|
+
return /*#__PURE__*/createPortal(colorMode ? /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
25
24
|
defaultColorMode: colorMode
|
|
26
25
|
}, children) : children, container);
|
|
27
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/portal",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "A wrapper for rendering components in React portals.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/app-provider": "^4.
|
|
35
|
+
"@atlaskit/app-provider": "^4.2.0",
|
|
36
36
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
37
|
"@atlaskit/theme": "^22.0.0",
|
|
38
38
|
"@babel/runtime": "^7.0.0"
|
|
@@ -48,20 +48,21 @@
|
|
|
48
48
|
"@atlaskit/button": "^23.10.0",
|
|
49
49
|
"@atlaskit/code": "^17.4.0",
|
|
50
50
|
"@atlaskit/css": "^0.19.0",
|
|
51
|
-
"@atlaskit/docs": "^11.
|
|
52
|
-
"@atlaskit/flag": "^17.
|
|
53
|
-
"@atlaskit/icon": "^
|
|
51
|
+
"@atlaskit/docs": "^11.7.0",
|
|
52
|
+
"@atlaskit/flag": "^17.9.0",
|
|
53
|
+
"@atlaskit/icon": "^33.1.0",
|
|
54
54
|
"@atlaskit/inline-dialog": "^18.0.0",
|
|
55
55
|
"@atlaskit/link": "^3.3.0",
|
|
56
|
-
"@atlaskit/modal-dialog": "^14.
|
|
56
|
+
"@atlaskit/modal-dialog": "^14.13.0",
|
|
57
57
|
"@atlaskit/onboarding": "^14.5.0",
|
|
58
|
-
"@atlaskit/primitives": "^18.
|
|
58
|
+
"@atlaskit/primitives": "^18.1.0",
|
|
59
59
|
"@atlaskit/section-message": "^8.12.0",
|
|
60
|
-
"@atlaskit/tokens": "^11.
|
|
61
|
-
"@atlaskit/tooltip": "^
|
|
60
|
+
"@atlaskit/tokens": "^11.4.0",
|
|
61
|
+
"@atlaskit/tooltip": "^21.0.0",
|
|
62
62
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
63
63
|
"@atlassian/ssr-tests": "workspace:^",
|
|
64
|
-
"@
|
|
64
|
+
"@atlassian/structured-docs-types": "workspace:^",
|
|
65
|
+
"@compiled/react": "^0.20.0",
|
|
65
66
|
"@testing-library/react": "^16.3.0",
|
|
66
67
|
"bind-event-listener": "^3.0.0",
|
|
67
68
|
"raf-stub": "^2.0.1"
|
|
@@ -95,9 +96,6 @@
|
|
|
95
96
|
"platform-feature-flags": {
|
|
96
97
|
"platform_design_system_team_portal_logic_r18_fix": {
|
|
97
98
|
"type": "boolean"
|
|
98
|
-
},
|
|
99
|
-
"platform_dst_subtree_theming": {
|
|
100
|
-
"type": "boolean"
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
}
|
package/portal.docs.tsx
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
|
|
3
|
+
import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
|
|
4
|
+
|
|
5
|
+
const documentation: ComponentStructuredContentSource[] = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Portal',
|
|
8
|
+
description: 'A component for rendering content outside the normal DOM hierarchy.',
|
|
9
|
+
status: 'general-availability',
|
|
10
|
+
import: {
|
|
11
|
+
name: 'Portal',
|
|
12
|
+
package: '@atlaskit/portal',
|
|
13
|
+
type: 'default',
|
|
14
|
+
packagePath: path.resolve(__dirname),
|
|
15
|
+
packageJson: require('./package.json'),
|
|
16
|
+
},
|
|
17
|
+
usageGuidelines: [
|
|
18
|
+
'Use for rendering content outside normal DOM',
|
|
19
|
+
'Consider z-index and positioning',
|
|
20
|
+
'Handle focus management appropriately',
|
|
21
|
+
'Use for modals and overlays',
|
|
22
|
+
],
|
|
23
|
+
contentGuidelines: [
|
|
24
|
+
'Ensure portaled content is accessible',
|
|
25
|
+
'Consider content context and purpose',
|
|
26
|
+
'Use appropriate portal placement',
|
|
27
|
+
],
|
|
28
|
+
accessibilityGuidelines: [
|
|
29
|
+
'Ensure proper focus management',
|
|
30
|
+
'Consider screen reader accessibility',
|
|
31
|
+
'Use appropriate ARIA attributes',
|
|
32
|
+
'Handle keyboard navigation',
|
|
33
|
+
],
|
|
34
|
+
examples: [
|
|
35
|
+
{
|
|
36
|
+
name: 'Portal',
|
|
37
|
+
description: 'Portal example',
|
|
38
|
+
source: path.resolve(__dirname, './examples/ai/portal.tsx'),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
keywords: ['portal', 'render', 'dom', 'mount', 'teleport'],
|
|
42
|
+
categories: ['utility'],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
export default documentation;
|