@atlaskit/editor-plugin-hyperlink 6.0.2 → 6.0.4

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,21 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 6.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a8630c1107c3d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a8630c1107c3d) -
8
+ [ED-28781] Hide inline text toolbar when other popups are open
9
+ - Updated dependencies
10
+
11
+ ## 6.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`db97eb262cc5a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db97eb262cc5a) -
16
+ replace platform_editor_toolbar_aifc with separate experiements for jira and confluence
17
+ - Updated dependencies
18
+
3
19
  ## 6.0.2
4
20
 
5
21
  ### Patch Changes
@@ -17,7 +17,6 @@ var _quickInsert = require("@atlaskit/editor-common/quick-insert");
17
17
  var _utils = require("@atlaskit/editor-common/utils");
18
18
  var _linkEditorLink = _interopRequireDefault(require("@atlaskit/icon/core/migration/link--editor-link"));
19
19
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
21
20
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
21
  var _commands = require("./editor-commands/commands");
23
22
  var _fakeCursorForToolbar = _interopRequireDefault(require("./pm-plugins/fake-cursor-for-toolbar"));
@@ -52,7 +51,10 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
52
51
  options = _ref$config === void 0 ? {} : _ref$config,
53
52
  api = _ref.api;
54
53
  var primaryToolbarComponent;
55
- if ((0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true)) {
54
+ var isToolbarAIFCEnabled = (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
55
+ exposure: true
56
+ });
57
+ if (isToolbarAIFCEnabled) {
56
58
  var _api$toolbar;
57
59
  api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents((0, _toolbarComponents.getToolbarComponents)(api));
58
60
  }
@@ -183,7 +185,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
183
185
  }];
184
186
  },
185
187
  floatingToolbar: (0, _Toolbar.getToolbarConfig)(options, api)
186
- }, !(0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true) && {
188
+ }, !isToolbarAIFCEnabled && {
187
189
  selectionToolbar: function selectionToolbar(state, _ref5) {
188
190
  var _api$userPreferences, _api$selectionToolbar;
189
191
  var formatMessage = _ref5.formatMessage;
@@ -220,7 +222,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
220
222
  return undefined;
221
223
  }
222
224
  }
223
- }), !(0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc', 'isEnabled', true) && {
225
+ }), !isToolbarAIFCEnabled && {
224
226
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
225
227
  exposure: true
226
228
  }) ? primaryToolbarComponent : undefined
@@ -18,6 +18,7 @@ var _link2 = require("@atlaskit/editor-common/link");
18
18
  var _messages = require("@atlaskit/editor-common/messages");
19
19
  var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
20
20
  var _ui = require("@atlaskit/editor-common/ui");
21
+ var _userIntent = require("@atlaskit/editor-common/user-intent");
21
22
  var _utils = require("@atlaskit/editor-common/utils");
22
23
  var _state = require("@atlaskit/editor-prosemirror/state");
23
24
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
@@ -25,6 +26,7 @@ var _edit = _interopRequireDefault(require("@atlaskit/icon/core/edit"));
25
26
  var _linkBrokenEditorUnlink = _interopRequireDefault(require("@atlaskit/icon/core/migration/link-broken--editor-unlink"));
26
27
  var _linkExternalShortcut = _interopRequireDefault(require("@atlaskit/icon/core/migration/link-external--shortcut"));
27
28
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
29
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
28
30
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
29
31
  var _commands = require("../../editor-commands/commands");
30
32
  var _main = require("../../pm-plugins/main");
@@ -260,7 +262,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
260
262
  if (!view) {
261
263
  return null;
262
264
  }
263
- return /*#__PURE__*/_react.default.createElement(HyperlinkAddToolbarWithState, {
265
+ var Toolbar = /*#__PURE__*/_react.default.createElement(HyperlinkAddToolbarWithState, {
264
266
  pluginInjectionApi: pluginInjectionApi,
265
267
  view: view,
266
268
  key: idx,
@@ -292,6 +294,9 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
292
294
  view.focus();
293
295
  }
294
296
  });
297
+ return (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true) && (0, _expValEquals.expValEquals)('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? /*#__PURE__*/_react.default.createElement(_userIntent.UserIntentPopupWrapper, {
298
+ api: pluginInjectionApi
299
+ }, Toolbar) : Toolbar;
295
300
  }
296
301
  }]
297
302
  });
@@ -9,7 +9,6 @@ import { IconLink } from '@atlaskit/editor-common/quick-insert';
9
9
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
10
10
  import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
13
12
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
15
14
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
@@ -42,7 +41,10 @@ export const hyperlinkPlugin = ({
42
41
  api
43
42
  }) => {
44
43
  let primaryToolbarComponent;
45
- if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
44
+ const isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
45
+ exposure: true
46
+ });
47
+ if (isToolbarAIFCEnabled) {
46
48
  var _api$toolbar;
47
49
  api === null || api === void 0 ? void 0 : (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 ? void 0 : _api$toolbar.actions.registerComponents(getToolbarComponents(api));
48
50
  }
@@ -160,7 +162,7 @@ export const hyperlinkPlugin = ({
160
162
  }
161
163
  }],
162
164
  floatingToolbar: getToolbarConfig(options, api),
163
- ...(!expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true) && {
165
+ ...(!isToolbarAIFCEnabled && {
164
166
  selectionToolbar: (state, {
165
167
  formatMessage
166
168
  }) => {
@@ -200,7 +202,7 @@ export const hyperlinkPlugin = ({
200
202
  }
201
203
  }
202
204
  }),
203
- ...(!expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true) && {
205
+ ...(!isToolbarAIFCEnabled && {
204
206
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && editorExperiment('platform_editor_controls', 'variant1', {
205
207
  exposure: true
206
208
  }) ? primaryToolbarComponent : undefined
@@ -7,6 +7,7 @@ import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
7
7
  import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
8
8
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
9
9
  import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
10
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
10
11
  import { normalizeUrl } from '@atlaskit/editor-common/utils';
11
12
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
12
13
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
@@ -14,6 +15,7 @@ import EditIcon from '@atlaskit/icon/core/edit';
14
15
  import LinkBrokenIcon from '@atlaskit/icon/core/migration/link-broken--editor-unlink';
15
16
  import LinkExternalIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
16
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
17
19
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
20
  import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from '../../editor-commands/commands';
19
21
  import { stateKey } from '../../pm-plugins/main';
@@ -245,7 +247,7 @@ export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, p
245
247
  if (!view) {
246
248
  return null;
247
249
  }
248
- return /*#__PURE__*/React.createElement(HyperlinkAddToolbarWithState, {
250
+ const Toolbar = /*#__PURE__*/React.createElement(HyperlinkAddToolbarWithState, {
249
251
  pluginInjectionApi: pluginInjectionApi,
250
252
  view: view,
251
253
  key: idx,
@@ -271,6 +273,9 @@ export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, p
271
273
  view.focus();
272
274
  }
273
275
  });
276
+ return editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? /*#__PURE__*/React.createElement(UserIntentPopupWrapper, {
277
+ api: pluginInjectionApi
278
+ }, Toolbar) : Toolbar;
274
279
  }
275
280
  }]
276
281
  };
@@ -12,7 +12,6 @@ import { IconLink } from '@atlaskit/editor-common/quick-insert';
12
12
  import { canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
13
13
  import LinkIcon from '@atlaskit/icon/core/migration/link--editor-link';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
15
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
16
  import { hideLinkToolbarSetMeta, insertLinkWithAnalytics, removeLinkEditorCommand, showLinkToolbar as _showLinkToolbar, updateLink, updateLinkEditorCommand } from './editor-commands/commands';
18
17
  import fakeCursorToolbarPlugin from './pm-plugins/fake-cursor-for-toolbar';
@@ -45,7 +44,10 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
45
44
  options = _ref$config === void 0 ? {} : _ref$config,
46
45
  api = _ref.api;
47
46
  var primaryToolbarComponent;
48
- if (expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true)) {
47
+ var isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
48
+ exposure: true
49
+ });
50
+ if (isToolbarAIFCEnabled) {
49
51
  var _api$toolbar;
50
52
  api === null || api === void 0 || (_api$toolbar = api.toolbar) === null || _api$toolbar === void 0 || _api$toolbar.actions.registerComponents(getToolbarComponents(api));
51
53
  }
@@ -176,7 +178,7 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
176
178
  }];
177
179
  },
178
180
  floatingToolbar: getToolbarConfig(options, api)
179
- }, !expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true) && {
181
+ }, !isToolbarAIFCEnabled && {
180
182
  selectionToolbar: function selectionToolbar(state, _ref5) {
181
183
  var _api$userPreferences, _api$selectionToolbar;
182
184
  var formatMessage = _ref5.formatMessage;
@@ -213,7 +215,7 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
213
215
  return undefined;
214
216
  }
215
217
  }
216
- }), !expValEquals('platform_editor_toolbar_aifc', 'isEnabled', true) && {
218
+ }), !isToolbarAIFCEnabled && {
217
219
  primaryToolbarComponent: !(api !== null && api !== void 0 && api.primaryToolbar) && editorExperiment('platform_editor_controls', 'variant1', {
218
220
  exposure: true
219
221
  }) ? primaryToolbarComponent : undefined
@@ -11,6 +11,7 @@ import { HyperlinkAddToolbar } from '@atlaskit/editor-common/link';
11
11
  import { linkMessages, linkToolbarMessages as linkToolbarCommonMessages } from '@atlaskit/editor-common/messages';
12
12
  import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
13
13
  import { LINKPICKER_HEIGHT_IN_PX, RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
14
+ import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
14
15
  import { normalizeUrl } from '@atlaskit/editor-common/utils';
15
16
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
16
17
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
@@ -18,6 +19,7 @@ import EditIcon from '@atlaskit/icon/core/edit';
18
19
  import LinkBrokenIcon from '@atlaskit/icon/core/migration/link-broken--editor-unlink';
19
20
  import LinkExternalIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
20
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
+ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
23
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
24
  import { editInsertedLink, insertLinkWithAnalytics, onClickAwayCallback, onEscapeCallback, removeLink, updateLink } from '../../editor-commands/commands';
23
25
  import { stateKey } from '../../pm-plugins/main';
@@ -251,7 +253,7 @@ export var getToolbarConfig = function getToolbarConfig(options, pluginInjection
251
253
  if (!view) {
252
254
  return null;
253
255
  }
254
- return /*#__PURE__*/React.createElement(HyperlinkAddToolbarWithState, {
256
+ var Toolbar = /*#__PURE__*/React.createElement(HyperlinkAddToolbarWithState, {
255
257
  pluginInjectionApi: pluginInjectionApi,
256
258
  view: view,
257
259
  key: idx,
@@ -283,6 +285,9 @@ export var getToolbarConfig = function getToolbarConfig(options, pluginInjection
283
285
  view.focus();
284
286
  }
285
287
  });
288
+ return editorExperiment('platform_editor_toolbar_aifc', true) && expValEquals('platform_editor_toolbar_aifc_patch_2', 'isEnabled', true) ? /*#__PURE__*/React.createElement(UserIntentPopupWrapper, {
289
+ api: pluginInjectionApi
290
+ }, Toolbar) : Toolbar;
286
291
  }
287
292
  }]
288
293
  });
@@ -7,6 +7,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
7
7
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
8
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
9
9
  import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
10
+ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
10
11
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
11
12
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './editor-commands/commands';
12
13
  type HyperlinkPluginCommands = {
@@ -55,7 +56,8 @@ export type HyperlinkPluginDependencies = [
55
56
  OptionalPlugin<PrimaryToolbarPlugin>,
56
57
  OptionalPlugin<SelectionToolbarPlugin>,
57
58
  OptionalPlugin<UserPreferencesPlugin>,
58
- OptionalPlugin<ToolbarPlugin>
59
+ OptionalPlugin<ToolbarPlugin>,
60
+ OptionalPlugin<UserIntentPlugin>
59
61
  ];
60
62
  export type HyperlinkPluginActions = {
61
63
  hideLinkToolbar: HideLinkToolbar;
@@ -7,6 +7,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
7
7
  import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
8
8
  import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
9
9
  import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
10
+ import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
10
11
  import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
11
12
  import type { HideLinkToolbar, InsertLink, ShowLinkToolbar, UpdateLink } from './editor-commands/commands';
12
13
  type HyperlinkPluginCommands = {
@@ -55,7 +56,8 @@ export type HyperlinkPluginDependencies = [
55
56
  OptionalPlugin<PrimaryToolbarPlugin>,
56
57
  OptionalPlugin<SelectionToolbarPlugin>,
57
58
  OptionalPlugin<UserPreferencesPlugin>,
58
- OptionalPlugin<ToolbarPlugin>
59
+ OptionalPlugin<ToolbarPlugin>,
60
+ OptionalPlugin<UserIntentPlugin>
59
61
  ];
60
62
  export type HyperlinkPluginActions = {
61
63
  hideLinkToolbar: HideLinkToolbar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,19 +38,20 @@
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^5.0.0",
39
39
  "@atlaskit/editor-plugin-selection-toolbar": "^5.0.0",
40
40
  "@atlaskit/editor-plugin-toolbar": "^1.1.0",
41
+ "@atlaskit/editor-plugin-user-intent": "^2.0.0",
41
42
  "@atlaskit/editor-prosemirror": "7.0.0",
42
43
  "@atlaskit/editor-toolbar": "^0.8.0",
43
44
  "@atlaskit/editor-toolbar-model": "^0.2.0",
44
45
  "@atlaskit/icon": "^28.1.0",
45
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
46
47
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
47
- "@atlaskit/tmp-editor-statsig": "^12.4.0",
48
+ "@atlaskit/tmp-editor-statsig": "^12.5.0",
48
49
  "@babel/runtime": "^7.0.0",
49
50
  "@emotion/react": "^11.7.1",
50
51
  "uuid": "^3.1.0"
51
52
  },
52
53
  "peerDependencies": {
53
- "@atlaskit/editor-common": "^108.2.0",
54
+ "@atlaskit/editor-common": "^108.5.0",
54
55
  "react": "^18.2.0",
55
56
  "react-dom": "^18.2.0",
56
57
  "react-intl-next": "npm:react-intl@^5.18.1"