@atlaskit/smart-card 45.13.5 → 45.15.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 +20 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/EmbedModal/utils.js +32 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedModal/utils.js +32 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/EmbedModal/utils.js +32 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 45.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`4fd26afe1912d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4fd26afe1912d) -
|
|
8
|
+
Update i18n NPM package versions for linking-platform,smart-experiences (Group 15)
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 45.14.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`85087b263ce43`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85087b263ce43) -
|
|
19
|
+
Migrate react-dom render/unmountComponentAtNode to the React 18/19 createRoot API behind the
|
|
20
|
+
nike_r19_render_unmount feature gate. The legacy react-dom path is preserved on the gate-off
|
|
21
|
+
branch for rollback.
|
|
22
|
+
|
|
3
23
|
## 45.13.5
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
11
11
|
var context = exports.context = {
|
|
12
12
|
componentName: 'smart-cards',
|
|
13
13
|
packageName: "@atlaskit/smart-card" || '',
|
|
14
|
-
packageVersion: "45.
|
|
14
|
+
packageVersion: "45.14.0" || ''
|
|
15
15
|
};
|
|
16
16
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
17
17
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -12,9 +12,39 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
12
12
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
15
|
+
var _client = require("react-dom/client");
|
|
15
16
|
var _reactIntl = require("react-intl");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
18
|
var _excluded = ["onClose"];
|
|
17
19
|
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); }
|
|
20
|
+
var reactRoots = new WeakMap();
|
|
21
|
+
|
|
22
|
+
/** Mounts `element` into `mountPoint`: uses the React 18/19 `createRoot` API when `nike_r19_render_unmount` is on, else the legacy render path. */
|
|
23
|
+
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
24
|
+
if ((0, _platformFeatureFlags.fg)('nike_r19_render_unmount')) {
|
|
25
|
+
var root = reactRoots.get(mountPoint);
|
|
26
|
+
if (!root) {
|
|
27
|
+
root = (0, _client.createRoot)(mountPoint);
|
|
28
|
+
reactRoots.set(mountPoint, root);
|
|
29
|
+
}
|
|
30
|
+
root.render(element);
|
|
31
|
+
} else {
|
|
32
|
+
_reactDom.default.render(element, mountPoint);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** Unmounts the tree at `mountPoint`: uses `root.unmount()` when `nike_r19_render_unmount` is on, else the legacy unmount path. */
|
|
37
|
+
var unmountFromMountPoint = function unmountFromMountPoint(mountPoint) {
|
|
38
|
+
if ((0, _platformFeatureFlags.fg)('nike_r19_render_unmount')) {
|
|
39
|
+
var root = reactRoots.get(mountPoint);
|
|
40
|
+
if (root) {
|
|
41
|
+
root.unmount();
|
|
42
|
+
reactRoots.delete(mountPoint);
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
_reactDom.default.unmountComponentAtNode(mountPoint);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
18
48
|
var IFRAME_NAME = 'twp-editor-preview-iframe';
|
|
19
49
|
var POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
|
|
20
50
|
|
|
@@ -61,13 +91,13 @@ function _openEmbedModal() {
|
|
|
61
91
|
});
|
|
62
92
|
case 1:
|
|
63
93
|
Modal = _context2.sent;
|
|
64
|
-
|
|
94
|
+
renderToMountPoint( /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
65
95
|
locale: "en"
|
|
66
96
|
}, /*#__PURE__*/_react.default.createElement(Modal.default, (0, _extends2.default)({}, props, {
|
|
67
97
|
iframeName: IFRAME_NAME,
|
|
68
98
|
onClose: function onClose(_context) {
|
|
69
99
|
if (popupMountPoint) {
|
|
70
|
-
|
|
100
|
+
unmountFromMountPoint(popupMountPoint);
|
|
71
101
|
}
|
|
72
102
|
if (_onClose) {
|
|
73
103
|
_onClose(_context);
|
|
@@ -19,7 +19,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
|
|
|
19
19
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
20
20
|
var PACKAGE_DATA = {
|
|
21
21
|
packageName: "@atlaskit/smart-card",
|
|
22
|
-
packageVersion: "45.
|
|
22
|
+
packageVersion: "45.14.0",
|
|
23
23
|
componentName: 'linkUrl'
|
|
24
24
|
};
|
|
25
25
|
var LinkUrl = function LinkUrl(_ref) {
|
|
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const context = {
|
|
3
3
|
componentName: 'smart-cards',
|
|
4
4
|
packageName: "@atlaskit/smart-card" || '',
|
|
5
|
-
packageVersion: "45.
|
|
5
|
+
packageVersion: "45.14.0" || ''
|
|
6
6
|
};
|
|
7
7
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
8
8
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import ReactDOM from 'react-dom';
|
|
4
|
+
import { createRoot } from 'react-dom/client';
|
|
4
5
|
import { IntlProvider } from 'react-intl';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
let reactRoots = new WeakMap();
|
|
8
|
+
|
|
9
|
+
/** Mounts `element` into `mountPoint`: uses the React 18/19 `createRoot` API when `nike_r19_render_unmount` is on, else the legacy render path. */
|
|
10
|
+
const renderToMountPoint = (element, mountPoint) => {
|
|
11
|
+
if (fg('nike_r19_render_unmount')) {
|
|
12
|
+
let root = reactRoots.get(mountPoint);
|
|
13
|
+
if (!root) {
|
|
14
|
+
root = createRoot(mountPoint);
|
|
15
|
+
reactRoots.set(mountPoint, root);
|
|
16
|
+
}
|
|
17
|
+
root.render(element);
|
|
18
|
+
} else {
|
|
19
|
+
ReactDOM.render(element, mountPoint);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Unmounts the tree at `mountPoint`: uses `root.unmount()` when `nike_r19_render_unmount` is on, else the legacy unmount path. */
|
|
24
|
+
const unmountFromMountPoint = mountPoint => {
|
|
25
|
+
if (fg('nike_r19_render_unmount')) {
|
|
26
|
+
const root = reactRoots.get(mountPoint);
|
|
27
|
+
if (root) {
|
|
28
|
+
root.unmount();
|
|
29
|
+
reactRoots.delete(mountPoint);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
ReactDOM.unmountComponentAtNode(mountPoint);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
5
35
|
const IFRAME_NAME = 'twp-editor-preview-iframe';
|
|
6
36
|
const POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
|
|
7
37
|
|
|
@@ -31,13 +61,13 @@ export async function openEmbedModal({
|
|
|
31
61
|
document.body.appendChild(popupMountPoint);
|
|
32
62
|
}
|
|
33
63
|
let Modal = await import('./index');
|
|
34
|
-
|
|
64
|
+
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
35
65
|
locale: "en"
|
|
36
66
|
}, /*#__PURE__*/React.createElement(Modal.default, _extends({}, props, {
|
|
37
67
|
iframeName: IFRAME_NAME,
|
|
38
68
|
onClose: _context => {
|
|
39
69
|
if (popupMountPoint) {
|
|
40
|
-
|
|
70
|
+
unmountFromMountPoint(popupMountPoint);
|
|
41
71
|
}
|
|
42
72
|
if (onClose) {
|
|
43
73
|
onClose(_context);
|
|
@@ -9,7 +9,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
9
9
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
10
10
|
const PACKAGE_DATA = {
|
|
11
11
|
packageName: "@atlaskit/smart-card",
|
|
12
|
-
packageVersion: "45.
|
|
12
|
+
packageVersion: "45.14.0",
|
|
13
13
|
componentName: 'linkUrl'
|
|
14
14
|
};
|
|
15
15
|
const LinkUrl = ({
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card" || '',
|
|
7
|
-
packageVersion: "45.
|
|
7
|
+
packageVersion: "45.14.0" || ''
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,7 +5,37 @@ var _excluded = ["onClose"];
|
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import ReactDOM from 'react-dom';
|
|
8
|
+
import { createRoot } from 'react-dom/client';
|
|
8
9
|
import { IntlProvider } from 'react-intl';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
var reactRoots = new WeakMap();
|
|
12
|
+
|
|
13
|
+
/** Mounts `element` into `mountPoint`: uses the React 18/19 `createRoot` API when `nike_r19_render_unmount` is on, else the legacy render path. */
|
|
14
|
+
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
15
|
+
if (fg('nike_r19_render_unmount')) {
|
|
16
|
+
var root = reactRoots.get(mountPoint);
|
|
17
|
+
if (!root) {
|
|
18
|
+
root = createRoot(mountPoint);
|
|
19
|
+
reactRoots.set(mountPoint, root);
|
|
20
|
+
}
|
|
21
|
+
root.render(element);
|
|
22
|
+
} else {
|
|
23
|
+
ReactDOM.render(element, mountPoint);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** Unmounts the tree at `mountPoint`: uses `root.unmount()` when `nike_r19_render_unmount` is on, else the legacy unmount path. */
|
|
28
|
+
var unmountFromMountPoint = function unmountFromMountPoint(mountPoint) {
|
|
29
|
+
if (fg('nike_r19_render_unmount')) {
|
|
30
|
+
var root = reactRoots.get(mountPoint);
|
|
31
|
+
if (root) {
|
|
32
|
+
root.unmount();
|
|
33
|
+
reactRoots.delete(mountPoint);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
ReactDOM.unmountComponentAtNode(mountPoint);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
9
39
|
var IFRAME_NAME = 'twp-editor-preview-iframe';
|
|
10
40
|
var POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
|
|
11
41
|
|
|
@@ -50,13 +80,13 @@ function _openEmbedModal() {
|
|
|
50
80
|
return import('./index');
|
|
51
81
|
case 1:
|
|
52
82
|
Modal = _context2.sent;
|
|
53
|
-
|
|
83
|
+
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
54
84
|
locale: "en"
|
|
55
85
|
}, /*#__PURE__*/React.createElement(Modal.default, _extends({}, props, {
|
|
56
86
|
iframeName: IFRAME_NAME,
|
|
57
87
|
onClose: function onClose(_context) {
|
|
58
88
|
if (popupMountPoint) {
|
|
59
|
-
|
|
89
|
+
unmountFromMountPoint(popupMountPoint);
|
|
60
90
|
}
|
|
61
91
|
if (_onClose) {
|
|
62
92
|
_onClose(_context);
|
|
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
12
12
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
13
13
|
var PACKAGE_DATA = {
|
|
14
14
|
packageName: "@atlaskit/smart-card",
|
|
15
|
-
packageVersion: "45.
|
|
15
|
+
packageVersion: "45.14.0",
|
|
16
16
|
componentName: 'linkUrl'
|
|
17
17
|
};
|
|
18
18
|
var LinkUrl = function LinkUrl(_ref) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.15.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/adf-utils": "^20.3.0",
|
|
39
|
-
"@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.
|
|
39
|
+
"@atlaskit/afm-i18n-platform-linking-platform-smart-card": "2.201.0",
|
|
40
40
|
"@atlaskit/analytics-cross-product": "^2.1.0",
|
|
41
41
|
"@atlaskit/analytics-gas-types": "^6.0.0",
|
|
42
42
|
"@atlaskit/analytics-next": "^12.3.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@atlaskit/textfield": "^9.1.0",
|
|
89
89
|
"@atlaskit/theme": "^26.1.0",
|
|
90
90
|
"@atlaskit/tile": "^2.3.0",
|
|
91
|
-
"@atlaskit/tmp-editor-statsig": "^135.
|
|
91
|
+
"@atlaskit/tmp-editor-statsig": "^135.6.0",
|
|
92
92
|
"@atlaskit/tokens": "^16.3.0",
|
|
93
93
|
"@atlaskit/tooltip": "^23.2.0",
|
|
94
94
|
"@atlaskit/ufo": "^1.0.0",
|
|
@@ -281,6 +281,9 @@
|
|
|
281
281
|
},
|
|
282
282
|
"navx-5343-sl-action-block-styling-fixes": {
|
|
283
283
|
"type": "boolean"
|
|
284
|
+
},
|
|
285
|
+
"nike_r19_render_unmount": {
|
|
286
|
+
"type": "boolean"
|
|
284
287
|
}
|
|
285
288
|
},
|
|
286
289
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/f74ef1bc-7240-4aac-9dc8-9dc43b502089"
|