@atlaskit/editor-plugin-hyperlink 6.0.4 → 6.0.5

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,15 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 6.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
8
+ [ux] ED-29120 add a new config option for default editor preset
9
+ (`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
10
+ for editors that can't be excluded at the experiment level.
11
+ - Updated dependencies
12
+
3
13
  ## 6.0.4
4
14
 
5
15
  ### Patch Changes
@@ -51,7 +51,7 @@ var hyperlinkPlugin = exports.hyperlinkPlugin = function hyperlinkPlugin(_ref) {
51
51
  options = _ref$config === void 0 ? {} : _ref$config,
52
52
  api = _ref.api;
53
53
  var primaryToolbarComponent;
54
- var isToolbarAIFCEnabled = (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
54
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && (0, _experiments.editorExperiment)('platform_editor_toolbar_aifc', true, {
55
55
  exposure: true
56
56
  });
57
57
  if (isToolbarAIFCEnabled) {
@@ -174,17 +174,17 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
174
174
  if (activeLinkMark.node.text) {
175
175
  metadata.title = activeLinkMark.node.text;
176
176
  }
177
- var isNewEditorToolbarEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)();
177
+ var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
178
178
  var cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions;
179
- var startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, (0, _commands.editInsertedLink)(editorAnalyticsApi), metadata, isNewEditorToolbarEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
179
+ var startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, (0, _commands.editInsertedLink)(editorAnalyticsApi), metadata, areAnyNewToolbarFlagsEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
180
180
  id: 'editor.link.edit',
181
181
  testId: 'editor.link.edit',
182
182
  type: 'button',
183
183
  onClick: (0, _commands.editInsertedLink)(editorAnalyticsApi),
184
184
  title: editLink,
185
- showTitle: isNewEditorToolbarEnabled ? false : true,
185
+ showTitle: areAnyNewToolbarFlagsEnabled ? false : true,
186
186
  metadata: metadata,
187
- icon: isNewEditorToolbarEnabled ? _edit.default : undefined
187
+ icon: areAnyNewToolbarFlagsEnabled ? _edit.default : undefined
188
188
  }, {
189
189
  type: 'separator'
190
190
  }];
@@ -213,7 +213,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
213
213
  icon: _linkBrokenEditorUnlink.default,
214
214
  tabIndex: null
215
215
  };
216
- var items = [].concat((0, _toConsumableArray2.default)(startingToolbarItems), (0, _toConsumableArray2.default)(isNewEditorToolbarEnabled && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [unlinkButton, {
216
+ var items = [].concat((0, _toConsumableArray2.default)(startingToolbarItems), (0, _toConsumableArray2.default)(areAnyNewToolbarFlagsEnabled && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [unlinkButton, {
217
217
  type: 'separator',
218
218
  fullHeight: true
219
219
  }, openLinkButton, {
@@ -41,7 +41,7 @@ export const hyperlinkPlugin = ({
41
41
  api
42
42
  }) => {
43
43
  let primaryToolbarComponent;
44
- const isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
44
+ const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true, {
45
45
  exposure: true
46
46
  });
47
47
  if (isToolbarAIFCEnabled) {
@@ -159,17 +159,17 @@ export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, p
159
159
  if (activeLinkMark.node.text) {
160
160
  metadata.title = activeLinkMark.node.text;
161
161
  }
162
- const isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
162
+ const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
163
163
  const cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c4 = pluginInjectionApi.card) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.actions;
164
- const startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, editInsertedLink(editorAnalyticsApi), metadata, isNewEditorToolbarEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
164
+ const startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, editInsertedLink(editorAnalyticsApi), metadata, areAnyNewToolbarFlagsEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
165
165
  id: 'editor.link.edit',
166
166
  testId: 'editor.link.edit',
167
167
  type: 'button',
168
168
  onClick: editInsertedLink(editorAnalyticsApi),
169
169
  title: editLink,
170
- showTitle: isNewEditorToolbarEnabled ? false : true,
170
+ showTitle: areAnyNewToolbarFlagsEnabled ? false : true,
171
171
  metadata: metadata,
172
- icon: isNewEditorToolbarEnabled ? EditIcon : undefined
172
+ icon: areAnyNewToolbarFlagsEnabled ? EditIcon : undefined
173
173
  }, {
174
174
  type: 'separator'
175
175
  }];
@@ -198,7 +198,7 @@ export const getToolbarConfig = (options, pluginInjectionApi) => (state, intl, p
198
198
  icon: LinkBrokenIcon,
199
199
  tabIndex: null
200
200
  };
201
- const items = [...startingToolbarItems, ...(isNewEditorToolbarEnabled && fg('platform_editor_controls_patch_15') ? [unlinkButton, {
201
+ const items = [...startingToolbarItems, ...(areAnyNewToolbarFlagsEnabled && fg('platform_editor_controls_patch_15') ? [unlinkButton, {
202
202
  type: 'separator',
203
203
  fullHeight: true
204
204
  }, openLinkButton, {
@@ -44,7 +44,7 @@ export var hyperlinkPlugin = function hyperlinkPlugin(_ref) {
44
44
  options = _ref$config === void 0 ? {} : _ref$config,
45
45
  api = _ref.api;
46
46
  var primaryToolbarComponent;
47
- var isToolbarAIFCEnabled = editorExperiment('platform_editor_toolbar_aifc', true, {
47
+ var isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true, {
48
48
  exposure: true
49
49
  });
50
50
  if (isToolbarAIFCEnabled) {
@@ -165,17 +165,17 @@ export var getToolbarConfig = function getToolbarConfig(options, pluginInjection
165
165
  if (activeLinkMark.node.text) {
166
166
  metadata.title = activeLinkMark.node.text;
167
167
  }
168
- var isNewEditorToolbarEnabled = areToolbarFlagsEnabled();
168
+ var areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
169
169
  var cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c3 = pluginInjectionApi.card) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : _pluginInjectionApi$c3.actions;
170
- var startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, editInsertedLink(editorAnalyticsApi), metadata, isNewEditorToolbarEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
170
+ var startingToolbarItems = (_cardActions$getStart = cardActions === null || cardActions === void 0 ? void 0 : cardActions.getStartingToolbarItems(intl, link, editInsertedLink(editorAnalyticsApi), metadata, areAnyNewToolbarFlagsEnabled ? state : undefined)) !== null && _cardActions$getStart !== void 0 ? _cardActions$getStart : [{
171
171
  id: 'editor.link.edit',
172
172
  testId: 'editor.link.edit',
173
173
  type: 'button',
174
174
  onClick: editInsertedLink(editorAnalyticsApi),
175
175
  title: editLink,
176
- showTitle: isNewEditorToolbarEnabled ? false : true,
176
+ showTitle: areAnyNewToolbarFlagsEnabled ? false : true,
177
177
  metadata: metadata,
178
- icon: isNewEditorToolbarEnabled ? EditIcon : undefined
178
+ icon: areAnyNewToolbarFlagsEnabled ? EditIcon : undefined
179
179
  }, {
180
180
  type: 'separator'
181
181
  }];
@@ -204,7 +204,7 @@ export var getToolbarConfig = function getToolbarConfig(options, pluginInjection
204
204
  icon: LinkBrokenIcon,
205
205
  tabIndex: null
206
206
  };
207
- var items = [].concat(_toConsumableArray(startingToolbarItems), _toConsumableArray(isNewEditorToolbarEnabled && fg('platform_editor_controls_patch_15') ? [unlinkButton, {
207
+ var items = [].concat(_toConsumableArray(startingToolbarItems), _toConsumableArray(areAnyNewToolbarFlagsEnabled && fg('platform_editor_controls_patch_15') ? [unlinkButton, {
208
208
  type: 'separator',
209
209
  fullHeight: true
210
210
  }, openLinkButton, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "6.0.4",
3
+ "version": "6.0.5",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,12 +32,12 @@
32
32
  "@atlaskit/adf-schema": "^50.2.3",
33
33
  "@atlaskit/analytics-next": "^11.1.0",
34
34
  "@atlaskit/editor-plugin-analytics": "^4.0.0",
35
- "@atlaskit/editor-plugin-card": "^8.0.0",
35
+ "@atlaskit/editor-plugin-card": "^8.1.0",
36
36
  "@atlaskit/editor-plugin-connectivity": "^4.0.0",
37
37
  "@atlaskit/editor-plugin-editor-viewmode": "^6.0.0",
38
38
  "@atlaskit/editor-plugin-primary-toolbar": "^5.0.0",
39
39
  "@atlaskit/editor-plugin-selection-toolbar": "^5.0.0",
40
- "@atlaskit/editor-plugin-toolbar": "^1.1.0",
40
+ "@atlaskit/editor-plugin-toolbar": "^1.2.0",
41
41
  "@atlaskit/editor-plugin-user-intent": "^2.0.0",
42
42
  "@atlaskit/editor-prosemirror": "7.0.0",
43
43
  "@atlaskit/editor-toolbar": "^0.8.0",
@@ -45,13 +45,13 @@
45
45
  "@atlaskit/icon": "^28.1.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
48
- "@atlaskit/tmp-editor-statsig": "^12.5.0",
48
+ "@atlaskit/tmp-editor-statsig": "^12.8.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "@emotion/react": "^11.7.1",
51
51
  "uuid": "^3.1.0"
52
52
  },
53
53
  "peerDependencies": {
54
- "@atlaskit/editor-common": "^108.5.0",
54
+ "@atlaskit/editor-common": "^108.6.0",
55
55
  "react": "^18.2.0",
56
56
  "react-dom": "^18.2.0",
57
57
  "react-intl-next": "npm:react-intl@^5.18.1"