@atlaskit/editor-plugin-hyperlink 14.0.34 → 14.1.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
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-hyperlink
|
|
2
2
|
|
|
3
|
+
## 14.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`85087b263ce43`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/85087b263ce43) -
|
|
8
|
+
Migrate react-dom render/unmountComponentAtNode to the React 18/19 createRoot API behind the
|
|
9
|
+
nike_r19_render_unmount feature gate. The legacy react-dom path is preserved on the gate-off
|
|
10
|
+
branch for rollback.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 14.0.34
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -7,8 +7,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ButtonWrapper = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactDom = require("react-dom");
|
|
10
|
+
var _client = require("react-dom/client");
|
|
10
11
|
var _reactIntl = require("react-intl");
|
|
11
12
|
var _link = require("@atlaskit/editor-common/link");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var reactRoots = new WeakMap();
|
|
15
|
+
|
|
16
|
+
/** Mounts `element` into `mountPoint`: uses the React 18/19 `createRoot` API when `nike_r19_render_unmount` is on, else the legacy render path. */
|
|
17
|
+
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
18
|
+
if ((0, _platformFeatureFlags.fg)('nike_r19_render_unmount')) {
|
|
19
|
+
var root = reactRoots.get(mountPoint);
|
|
20
|
+
if (!root) {
|
|
21
|
+
root = (0, _client.createRoot)(mountPoint);
|
|
22
|
+
reactRoots.set(mountPoint, root);
|
|
23
|
+
}
|
|
24
|
+
root.render(element);
|
|
25
|
+
} else {
|
|
26
|
+
(0, _reactDom.render)(element, mountPoint);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
12
29
|
var ButtonWrapper = exports.ButtonWrapper = function ButtonWrapper(_ref) {
|
|
13
30
|
var editorView = _ref.editorView,
|
|
14
31
|
pos = _ref.pos,
|
|
@@ -24,7 +41,7 @@ var ButtonWrapper = exports.ButtonWrapper = function ButtonWrapper(_ref) {
|
|
|
24
41
|
isOpen: isOpen
|
|
25
42
|
}));
|
|
26
43
|
};
|
|
27
|
-
(
|
|
44
|
+
renderToMountPoint( /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
28
45
|
locale: intl.locale || 'en',
|
|
29
46
|
messages: intl.messages,
|
|
30
47
|
formats: intl.formats
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from 'react-dom';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
3
4
|
import { IntlProvider } from 'react-intl';
|
|
4
5
|
import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
const 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
|
+
render(element, mountPoint);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
5
22
|
export const ButtonWrapper = ({
|
|
6
23
|
editorView,
|
|
7
24
|
pos,
|
|
@@ -18,7 +35,7 @@ export const ButtonWrapper = ({
|
|
|
18
35
|
isOpen
|
|
19
36
|
}));
|
|
20
37
|
};
|
|
21
|
-
|
|
38
|
+
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
22
39
|
locale: intl.locale || 'en',
|
|
23
40
|
messages: intl.messages,
|
|
24
41
|
formats: intl.formats
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from 'react-dom';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
3
4
|
import { IntlProvider } from 'react-intl';
|
|
4
5
|
import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
var 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
|
+
var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
|
|
11
|
+
if (fg('nike_r19_render_unmount')) {
|
|
12
|
+
var root = reactRoots.get(mountPoint);
|
|
13
|
+
if (!root) {
|
|
14
|
+
root = createRoot(mountPoint);
|
|
15
|
+
reactRoots.set(mountPoint, root);
|
|
16
|
+
}
|
|
17
|
+
root.render(element);
|
|
18
|
+
} else {
|
|
19
|
+
render(element, mountPoint);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
5
22
|
export var ButtonWrapper = function ButtonWrapper(_ref) {
|
|
6
23
|
var editorView = _ref.editorView,
|
|
7
24
|
pos = _ref.pos,
|
|
@@ -17,7 +34,7 @@ export var ButtonWrapper = function ButtonWrapper(_ref) {
|
|
|
17
34
|
isOpen: isOpen
|
|
18
35
|
}));
|
|
19
36
|
};
|
|
20
|
-
|
|
37
|
+
renderToMountPoint( /*#__PURE__*/React.createElement(IntlProvider, {
|
|
21
38
|
locale: intl.locale || 'en',
|
|
22
39
|
messages: intl.messages,
|
|
23
40
|
formats: intl.formats
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-hyperlink",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
4
4
|
"description": "Hyperlink plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@atlaskit/icon": "^37.2.0",
|
|
38
38
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
39
39
|
"@atlaskit/prosemirror-input-rules": "^4.0.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^135.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^135.5.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@emotion/react": "^11.7.1",
|
|
43
43
|
"uuid": "^3.1.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@atlaskit/editor-common": "^116.
|
|
46
|
+
"@atlaskit/editor-common": "^116.44.0",
|
|
47
47
|
"react": "^18.2.0",
|
|
48
48
|
"react-dom": "^18.2.0",
|
|
49
49
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
@@ -92,6 +92,9 @@
|
|
|
92
92
|
"platform-feature-flags": {
|
|
93
93
|
"platform_editor_use_preferences_plugin": {
|
|
94
94
|
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"nike_r19_render_unmount": {
|
|
97
|
+
"type": "boolean"
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}
|