@atlaskit/editor-plugin-hyperlink 18.0.6 → 18.0.8

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,19 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 18.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6304662fbdf4a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6304662fbdf4a) -
8
+ Use the supported `createRoot` API when `platform_editor_react19_migration` is enabled.
9
+ - Updated dependencies
10
+
11
+ ## 18.0.7
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 18.0.6
4
18
 
5
19
  ### Patch Changes
@@ -19,7 +19,7 @@ var _link2 = _interopRequireDefault(require("@atlaskit/icon/core/link"));
19
19
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
20
20
  var _fg = require("@atlaskit/platform-feature-flags/fg");
21
21
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
22
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
+ var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
23
23
  var _commands = require("./editor-commands/commands");
24
24
  var _fakeCursorForToolbar = _interopRequireDefault(require("./pm-plugins/fake-cursor-for-toolbar"));
25
25
  var _inputRule = require("./pm-plugins/input-rule");
@@ -199,7 +199,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
199
199
  var _api$userPreferences, _api$selectionToolbar;
200
200
  var formatMessage = _ref5.formatMessage;
201
201
  var toolbarDocking = (0, _fg.fg)('platform_editor_use_preferences_plugin') ? api === null || api === void 0 || (_api$userPreferences = api.userPreferences) === null || _api$userPreferences === void 0 || (_api$userPreferences = _api$userPreferences.sharedState.currentState()) === null || _api$userPreferences === void 0 ? void 0 : _api$userPreferences.preferences.toolbarDockingPosition : api === null || api === void 0 || (_api$selectionToolbar = api.selectionToolbar) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.sharedState) === null || _api$selectionToolbar === void 0 || (_api$selectionToolbar = _api$selectionToolbar.currentState()) === null || _api$selectionToolbar === void 0 ? void 0 : _api$selectionToolbar.toolbarDocking;
202
- if (toolbarDocking === 'none' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
202
+ if (toolbarDocking === 'none' && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
203
203
  exposure: true
204
204
  })) {
205
205
  var toolbarButton = function toolbarButton() {
@@ -232,7 +232,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
232
232
  }
233
233
  }
234
234
  }), !isToolbarAIFCEnabled && {
235
- primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
235
+ primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1', {
236
236
  exposure: true
237
237
  }) ? primaryToolbarComponent : undefined
238
238
  })
@@ -10,12 +10,12 @@ var _reactDom = require("react-dom");
10
10
  var _client = require("react-dom/client");
11
11
  var _reactIntl = require("react-intl");
12
12
  var _link = require("@atlaskit/editor-common/link");
13
- var _fg = require("@atlaskit/platform-feature-flags/fg");
13
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
14
14
  var reactRoots = new WeakMap();
15
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. */
16
+ /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
17
17
  var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
18
- if ((0, _fg.fg)('nike_r19_render_unmount')) {
18
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_react19_migration')) {
19
19
  var root = reactRoots.get(mountPoint);
20
20
  if (!root) {
21
21
  root = (0, _client.createRoot)(mountPoint);
@@ -26,7 +26,7 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
26
26
  var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
27
27
  var _linkBroken = _interopRequireDefault(require("@atlaskit/icon/core/link-broken"));
28
28
  var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
29
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
29
+ var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
30
30
  var _commands = require("../../editor-commands/commands");
31
31
  var _main = require("../../pm-plugins/main");
32
32
  var _toolbarButtons = require("../../pm-plugins/toolbar-buttons");
@@ -128,7 +128,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
128
128
 
129
129
  // If range selection, we don't show hyperlink floating toolbar.
130
130
  // Text Formattting toolbar is shown instaed.
131
- if (state.selection instanceof _state.TextSelection && state.selection.to !== state.selection.from && (activeLinkMark === null || activeLinkMark === void 0 ? void 0 : activeLinkMark.type) === 'EDIT' && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
131
+ if (state.selection instanceof _state.TextSelection && state.selection.to !== state.selection.from && (activeLinkMark === null || activeLinkMark === void 0 ? void 0 : activeLinkMark.type) === 'EDIT' && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
132
132
  return;
133
133
  }
134
134
  var formatMessage = intl.formatMessage;
@@ -147,7 +147,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
147
147
  // getDomRef by default uses view.state.selection.from to position the toolbar.
148
148
  // However, when the user clicks in right after the link the view.state.selection.from references to the dom after the selection.
149
149
  // So instead we want to use the activeLinkMark.pos which has been calculated as the position before the click so that would be the link node
150
- getDomRef: activeLinkMark && (activeLinkMark.type === 'EDIT_INSERTED' || activeLinkMark.type === 'EDIT') && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
150
+ getDomRef: activeLinkMark && (activeLinkMark.type === 'EDIT_INSERTED' || activeLinkMark.type === 'EDIT') && (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? function (view) {
151
151
  var domRef = (0, _utils2.findDomRefAtPos)(activeLinkMark.pos, view.domAtPos.bind(view));
152
152
  return domRef instanceof HTMLElement ? domRef : undefined;
153
153
  } : undefined
@@ -11,7 +11,7 @@ import LinkIcon from '@atlaskit/icon/core/link';
11
11
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
12
12
  import { fg } from '@atlaskit/platform-feature-flags/fg';
13
13
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
15
15
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
16
16
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
17
17
  import { createInputRulePlugin } from './pm-plugins/input-rule';
@@ -3,12 +3,12 @@ import { render } from 'react-dom';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import { IntlProvider } from 'react-intl';
5
5
  import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
6
- import { fg } from '@atlaskit/platform-feature-flags/fg';
6
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
7
  const reactRoots = new WeakMap();
8
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. */
9
+ /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
10
10
  const renderToMountPoint = (element, mountPoint) => {
11
- if (fg('nike_r19_render_unmount')) {
11
+ if (isExperimentEnabled('platform_editor_react19_migration')) {
12
12
  let root = reactRoots.get(mountPoint);
13
13
  if (!root) {
14
14
  root = createRoot(mountPoint);
@@ -15,7 +15,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
15
15
  import EditIcon from '@atlaskit/icon/core/edit';
16
16
  import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
17
17
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
18
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
19
19
  import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from '../../editor-commands/commands';
20
20
  import { stateKey } from '../../pm-plugins/main';
21
21
  import { toolbarKey } from '../../pm-plugins/toolbar-buttons';
@@ -14,7 +14,7 @@ import LinkIcon from '@atlaskit/icon/core/link';
14
14
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
15
15
  import { fg } from '@atlaskit/platform-feature-flags/fg';
16
16
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
18
18
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar as _showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
19
19
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
20
20
  import { createInputRulePlugin } from './pm-plugins/input-rule';
@@ -3,12 +3,12 @@ import { render } from 'react-dom';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import { IntlProvider } from 'react-intl';
5
5
  import { LinkAction, OverlayButton } from '@atlaskit/editor-common/link';
6
- import { fg } from '@atlaskit/platform-feature-flags/fg';
6
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
7
7
  var reactRoots = new WeakMap();
8
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. */
9
+ /** Mounts `element` into `mountPoint` using `createRoot` when the migration experiment is on. */
10
10
  var renderToMountPoint = function renderToMountPoint(element, mountPoint) {
11
- if (fg('nike_r19_render_unmount')) {
11
+ if (isExperimentEnabled('platform_editor_react19_migration')) {
12
12
  var root = reactRoots.get(mountPoint);
13
13
  if (!root) {
14
14
  root = createRoot(mountPoint);
@@ -19,7 +19,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
19
19
  import EditIcon from '@atlaskit/icon/core/edit';
20
20
  import LinkBrokenIcon from '@atlaskit/icon/core/link-broken';
21
21
  import LinkExternalIcon from '@atlaskit/icon/core/link-external';
22
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
23
23
  import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from '../../editor-commands/commands';
24
24
  import { stateKey } from '../../pm-plugins/main';
25
25
  import { toolbarKey } from '../../pm-plugins/toolbar-buttons';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "18.0.6",
3
+ "version": "18.0.8",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -40,13 +40,13 @@
40
40
  "@atlaskit/platform-feature-experiments": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.1.0",
42
42
  "@atlaskit/prosemirror-input-rules": "^4.0.0",
43
- "@atlaskit/tmp-editor-statsig": "^166.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^168.0.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@emotion/react": "^11.7.1",
46
46
  "uuid": "^3.1.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^120.6.0",
49
+ "@atlaskit/editor-common": "^120.7.0",
50
50
  "react": "^18.2.0 || ^19.2.0",
51
51
  "react-dom": "^18.2.0 || ^19.2.0",
52
52
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -95,9 +95,6 @@
95
95
  "platform-feature-flags": {
96
96
  "platform_editor_use_preferences_plugin": {
97
97
  "type": "boolean"
98
- },
99
- "nike_r19_render_unmount": {
100
- "type": "boolean"
101
98
  }
102
99
  }
103
100
  }