@atlaskit/editor-plugin-block-controls 18.2.6 → 18.2.7

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,14 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 18.2.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e8d06b88688a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8d06b88688a5) -
8
+ Use the React root API when `platform_editor_react19_migration` is enabled or the legacy ReactDOM
9
+ API is unavailable.
10
+ - Updated dependencies
11
+
3
12
  ## 18.2.6
4
13
 
5
14
  ### Patch Changes
@@ -27,10 +27,12 @@ var reactRoots = new WeakMap();
27
27
  * on (focus management, anchor positioning, block-menu visibility all read
28
28
  * the rendered DOM immediately after the callback returns).
29
29
  *
30
- * Otherwise, falls back to the legacy `ReactDOM.render` path.
30
+ * Otherwise, falls back to the legacy `ReactDOM.render` path. The API is not
31
+ * available in React 19, so the root path is also selected when the legacy
32
+ * method has been removed.
31
33
  */
32
34
  var renderToMountPoint = exports.renderToMountPoint = function renderToMountPoint(element, mountPoint) {
33
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration')) {
35
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration') || typeof _reactDom.default.render !== 'function') {
34
36
  var root = reactRoots.get(mountPoint);
35
37
  if (!root) {
36
38
  root = (0, _client.createRoot)(mountPoint);
@@ -57,7 +59,7 @@ var renderToMountPoint = exports.renderToMountPoint = function renderToMountPoin
57
59
  * Otherwise, falls back to `ReactDOM.unmountComponentAtNode`.
58
60
  */
59
61
  var unmountFromMountPoint = exports.unmountFromMountPoint = function unmountFromMountPoint(mountPoint) {
60
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration')) {
62
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration') || typeof _reactDom.default.render !== 'function') {
61
63
  var root = reactRoots.get(mountPoint);
62
64
  if (root) {
63
65
  root.unmount();
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1,4 +1,4 @@
1
- /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  "use strict";
3
3
 
4
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -20,10 +20,12 @@ const reactRoots = new WeakMap();
20
20
  * on (focus management, anchor positioning, block-menu visibility all read
21
21
  * the rendered DOM immediately after the callback returns).
22
22
  *
23
- * Otherwise, falls back to the legacy `ReactDOM.render` path.
23
+ * Otherwise, falls back to the legacy `ReactDOM.render` path. The API is not
24
+ * available in React 19, so the root path is also selected when the legacy
25
+ * method has been removed.
24
26
  */
25
27
  export const renderToMountPoint = (element, mountPoint) => {
26
- if (isExperimentEnabled('platform_editor_react19_migration')) {
28
+ if (isExperimentEnabled('platform_editor_react19_migration') || typeof ReactDOM.render !== 'function') {
27
29
  let root = reactRoots.get(mountPoint);
28
30
  if (!root) {
29
31
  root = createRoot(mountPoint);
@@ -48,7 +50,7 @@ export const renderToMountPoint = (element, mountPoint) => {
48
50
  * Otherwise, falls back to `ReactDOM.unmountComponentAtNode`.
49
51
  */
50
52
  export const unmountFromMountPoint = mountPoint => {
51
- if (isExperimentEnabled('platform_editor_react19_migration')) {
53
+ if (isExperimentEnabled('platform_editor_react19_migration') || typeof ReactDOM.render !== 'function') {
52
54
  const root = reactRoots.get(mountPoint);
53
55
  if (root) {
54
56
  root.unmount();
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./block-controls-left-surface.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import { ax, ix } from "@compiled/react/runtime";
3
3
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
4
4
  import { bind } from 'bind-event-listener';
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./block-controls-right-surface.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import { ax, ix } from "@compiled/react/runtime";
3
3
  import React, { useLayoutEffect, useMemo, useRef, useState } from 'react';
4
4
  import { bind } from 'bind-event-listener';
@@ -1,4 +1,4 @@
1
- /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./block-controls-surface-drag-handle.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -20,10 +20,12 @@ var reactRoots = new WeakMap();
20
20
  * on (focus management, anchor positioning, block-menu visibility all read
21
21
  * the rendered DOM immediately after the callback returns).
22
22
  *
23
- * Otherwise, falls back to the legacy `ReactDOM.render` path.
23
+ * Otherwise, falls back to the legacy `ReactDOM.render` path. The API is not
24
+ * available in React 19, so the root path is also selected when the legacy
25
+ * method has been removed.
24
26
  */
25
27
  export var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
26
- if (isExperimentEnabled('platform_editor_react19_migration')) {
28
+ if (isExperimentEnabled('platform_editor_react19_migration') || typeof ReactDOM.render !== 'function') {
27
29
  var root = reactRoots.get(mountPoint);
28
30
  if (!root) {
29
31
  root = createRoot(mountPoint);
@@ -50,7 +52,7 @@ export var renderToMountPoint = function renderToMountPoint(element, mountPoint)
50
52
  * Otherwise, falls back to `ReactDOM.unmountComponentAtNode`.
51
53
  */
52
54
  export var unmountFromMountPoint = function unmountFromMountPoint(mountPoint) {
53
- if (isExperimentEnabled('platform_editor_react19_migration')) {
55
+ if (isExperimentEnabled('platform_editor_react19_migration') || typeof ReactDOM.render !== 'function') {
54
56
  var root = reactRoots.get(mountPoint);
55
57
  if (root) {
56
58
  root.unmount();
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./block-controls-left-surface.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-left-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surface.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import "./block-controls-right-surface.compiled.css";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React from 'react';
@@ -1,4 +1,4 @@
1
- /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-right-surfaces.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { ax, ix } from "@compiled/react/runtime";
@@ -1,4 +1,4 @@
1
- /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v2.0.0 */
1
+ /* block-controls-surface-drag-handle.tsx generated by @compiled/babel-plugin v3.0.1 */
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
3
  import "./block-controls-surface-drag-handle.compiled.css";
4
4
  import * as React from 'react';
@@ -8,7 +8,9 @@ import type { ReactElement } from 'react';
8
8
  * on (focus management, anchor positioning, block-menu visibility all read
9
9
  * the rendered DOM immediately after the callback returns).
10
10
  *
11
- * Otherwise, falls back to the legacy `ReactDOM.render` path.
11
+ * Otherwise, falls back to the legacy `ReactDOM.render` path. The API is not
12
+ * available in React 19, so the root path is also selected when the legacy
13
+ * method has been removed.
12
14
  */
13
15
  export declare const renderToMountPoint: (element: ReactElement, mountPoint: Element) => void;
14
16
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "18.2.6",
3
+ "version": "18.2.7",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/primitives": "^22.5.0",
57
57
  "@atlaskit/section-message": "^10.2.0",
58
58
  "@atlaskit/theme": "^28.2.0",
59
- "@atlaskit/tmp-editor-statsig": "^184.0.0",
59
+ "@atlaskit/tmp-editor-statsig": "^185.0.0",
60
60
  "@atlaskit/tokens": "^16.11.0",
61
61
  "@atlaskit/tooltip": "^24.3.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -68,7 +68,7 @@
68
68
  "uuid": "^11.1.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "@atlaskit/editor-common": "^121.2.0",
71
+ "@atlaskit/editor-common": "^121.3.0",
72
72
  "react": "^18.2.0 || ^19.2.0",
73
73
  "react-dom": "^18.2.0 || ^19.2.0",
74
74
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"