@atlaskit/editor-plugin-hyperlink 0.5.4 → 0.5.6

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,17 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42848](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42848) [`f2f8428f703`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f2f8428f703) - Abandons feature flag lp-link-picker-focus-trap as it was not successfully rolled out. Will re-introduce as platform feature flag as/when necessary.
8
+
9
+ ## 0.5.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [#42680](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42680) [`1174ff1745b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1174ff1745b) - Cleans up ff platform.linking-platform.editor.fix-link-insert-analytics. No expected functional changes.
14
+
3
15
  ## 0.5.4
4
16
 
5
17
  ### Patch Changes
@@ -115,14 +115,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
115
115
  var formatMessage = intl.formatMessage;
116
116
  var linkState = _main.stateKey.getState(state);
117
117
  var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
118
-
119
- /**
120
- * Enable focus trap only if feature flag is enabled AND for the new version of the picker
121
- */
122
118
  var lpLinkPicker = featureFlags.lpLinkPicker,
123
- lpLinkPickerFocusTrap = featureFlags.lpLinkPickerFocusTrap,
124
119
  preventPopupOverflow = featureFlags.preventPopupOverflow;
125
- var shouldEnableFocusTrap = Boolean(lpLinkPicker && lpLinkPickerFocusTrap);
126
120
  if (linkState && linkState.activeLinkMark) {
127
121
  var activeLinkMark = linkState.activeLinkMark;
128
122
  var hyperLinkToolbar = {
@@ -223,7 +217,6 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
223
217
  preventPopupOverflow: preventPopupOverflow,
224
218
  height: popupHeight,
225
219
  width: _ui.RECENT_SEARCH_WIDTH_IN_PX,
226
- focusTrap: shouldEnableFocusTrap,
227
220
  items: [{
228
221
  type: 'custom',
229
222
  fallback: [],
@@ -244,9 +237,6 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
244
237
  onCancel: function onCancel() {
245
238
  return view.focus();
246
239
  },
247
- onClose: lpLinkPickerFocusTrap ? function () {
248
- return view.focus();
249
- } : undefined,
250
240
  onEscapeCallback: _commands.onEscapeCallback,
251
241
  onClickAwayCallback: _commands.onClickAwayCallback,
252
242
  onSubmit: function onSubmit(href) {
@@ -263,9 +253,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(opti
263
253
  sourceEvent: analytic
264
254
  }) : (0, _commands.insertLinkWithAnalytics)(inputMethod, activeLinkMark.from, activeLinkMark.to, href, editorAnalyticsApi, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider), analytic);
265
255
  command(view.state, view.dispatch, view);
266
- if (!lpLinkPickerFocusTrap) {
267
- view.focus();
268
- }
256
+ view.focus();
269
257
  }
270
258
  });
271
259
  }
@@ -20,7 +20,6 @@ var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
20
20
  var _link = require("@atlaskit/editor-common/link");
21
21
  var _utils = require("@atlaskit/editor-common/utils");
22
22
  var _state = require("@atlaskit/editor-prosemirror/state");
23
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
23
  var _main = require("./pm-plugins/main");
25
24
  var _toolbarButtons = require("./pm-plugins/toolbar-buttons");
26
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
@@ -125,7 +124,7 @@ function insertLink(from, to, incomingHref, incomingTitle, displayText, source,
125
124
  sourceEvent: sourceEvent
126
125
  });
127
126
  }
128
- } else if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.editor.fix-link-insert-analytics')) {
127
+ } else {
129
128
  /**
130
129
  * Add link metadata because queue cards would have otherwise handled this for us
131
130
  */
@@ -103,16 +103,10 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
103
103
  } = intl;
104
104
  const linkState = stateKey.getState(state);
105
105
  const editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
106
-
107
- /**
108
- * Enable focus trap only if feature flag is enabled AND for the new version of the picker
109
- */
110
106
  const {
111
107
  lpLinkPicker,
112
- lpLinkPickerFocusTrap,
113
108
  preventPopupOverflow
114
109
  } = featureFlags;
115
- const shouldEnableFocusTrap = Boolean(lpLinkPicker && lpLinkPickerFocusTrap);
116
110
  if (linkState && linkState.activeLinkMark) {
117
111
  const {
118
112
  activeLinkMark
@@ -213,7 +207,6 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
213
207
  preventPopupOverflow,
214
208
  height: popupHeight,
215
209
  width: RECENT_SEARCH_WIDTH_IN_PX,
216
- focusTrap: shouldEnableFocusTrap,
217
210
  items: [{
218
211
  type: 'custom',
219
212
  fallback: [],
@@ -232,7 +225,6 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
232
225
  displayText: displayText || '',
233
226
  providerFactory: providerFactory,
234
227
  onCancel: () => view.focus(),
235
- onClose: lpLinkPickerFocusTrap ? () => view.focus() : undefined,
236
228
  onEscapeCallback: onEscapeCallback,
237
229
  onClickAwayCallback: onClickAwayCallback,
238
230
  onSubmit: (href, title = '', displayText, inputMethod, analytic) => {
@@ -245,9 +237,7 @@ export const getToolbarConfig = (options, featureFlags, pluginInjectionApi) => (
245
237
  sourceEvent: analytic
246
238
  }) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, editorAnalyticsApi, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider), analytic);
247
239
  command(view.state, view.dispatch, view);
248
- if (!lpLinkPickerFocusTrap) {
249
- view.focus();
250
- }
240
+ view.focus();
251
241
  }
252
242
  });
253
243
  }
@@ -4,7 +4,6 @@ import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
4
4
  import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
5
5
  import { filterCommand as filter, getLinkCreationAnalyticsEvent, normalizeUrl } from '@atlaskit/editor-common/utils';
6
6
  import { Selection } from '@atlaskit/editor-prosemirror/state';
7
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
7
  import { stateKey } from './pm-plugins/main';
9
8
  import { toolbarKey } from './pm-plugins/toolbar-buttons';
10
9
  export function setLinkHref(href, pos, editorAnalyticsApi, to, isTabPressed) {
@@ -111,7 +110,7 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
111
110
  sourceEvent
112
111
  });
113
112
  }
114
- } else if (getBooleanFF('platform.linking-platform.editor.fix-link-insert-analytics')) {
113
+ } else {
115
114
  /**
116
115
  * Add link metadata because queue cards would have otherwise handled this for us
117
116
  */
@@ -107,14 +107,8 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
107
107
  var formatMessage = intl.formatMessage;
108
108
  var linkState = stateKey.getState(state);
109
109
  var editorAnalyticsApi = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
110
-
111
- /**
112
- * Enable focus trap only if feature flag is enabled AND for the new version of the picker
113
- */
114
110
  var lpLinkPicker = featureFlags.lpLinkPicker,
115
- lpLinkPickerFocusTrap = featureFlags.lpLinkPickerFocusTrap,
116
111
  preventPopupOverflow = featureFlags.preventPopupOverflow;
117
- var shouldEnableFocusTrap = Boolean(lpLinkPicker && lpLinkPickerFocusTrap);
118
112
  if (linkState && linkState.activeLinkMark) {
119
113
  var activeLinkMark = linkState.activeLinkMark;
120
114
  var hyperLinkToolbar = {
@@ -215,7 +209,6 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
215
209
  preventPopupOverflow: preventPopupOverflow,
216
210
  height: popupHeight,
217
211
  width: RECENT_SEARCH_WIDTH_IN_PX,
218
- focusTrap: shouldEnableFocusTrap,
219
212
  items: [{
220
213
  type: 'custom',
221
214
  fallback: [],
@@ -236,9 +229,6 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
236
229
  onCancel: function onCancel() {
237
230
  return view.focus();
238
231
  },
239
- onClose: lpLinkPickerFocusTrap ? function () {
240
- return view.focus();
241
- } : undefined,
242
232
  onEscapeCallback: onEscapeCallback,
243
233
  onClickAwayCallback: onClickAwayCallback,
244
234
  onSubmit: function onSubmit(href) {
@@ -255,9 +245,7 @@ export var getToolbarConfig = function getToolbarConfig(options, featureFlags, p
255
245
  sourceEvent: analytic
256
246
  }) : insertLinkWithAnalytics(inputMethod, activeLinkMark.from, activeLinkMark.to, href, editorAnalyticsApi, title, displayText, !!(options !== null && options !== void 0 && (_options$cardOptions = options.cardOptions) !== null && _options$cardOptions !== void 0 && _options$cardOptions.provider), analytic);
257
247
  command(view.state, view.dispatch, view);
258
- if (!lpLinkPickerFocusTrap) {
259
- view.focus();
260
- }
248
+ view.focus();
261
249
  }
262
250
  });
263
251
  }
@@ -7,7 +7,6 @@ import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
7
7
  import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
8
8
  import { filterCommand as filter, getLinkCreationAnalyticsEvent, normalizeUrl } from '@atlaskit/editor-common/utils';
9
9
  import { Selection } from '@atlaskit/editor-prosemirror/state';
10
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
10
  import { stateKey } from './pm-plugins/main';
12
11
  import { toolbarKey } from './pm-plugins/toolbar-buttons';
13
12
  export function setLinkHref(href, pos, editorAnalyticsApi, to, isTabPressed) {
@@ -110,7 +109,7 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
110
109
  sourceEvent: sourceEvent
111
110
  });
112
111
  }
113
- } else if (getBooleanFF('platform.linking-platform.editor.fix-link-insert-analytics')) {
112
+ } else {
114
113
  /**
115
114
  * Add link metadata because queue cards would have otherwise handled this for us
116
115
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -33,12 +33,11 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^32.0.0",
35
35
  "@atlaskit/analytics-next": "^9.1.0",
36
- "@atlaskit/editor-common": "^76.17.0",
36
+ "@atlaskit/editor-common": "^76.18.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^0.3.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.0.0",
39
39
  "@atlaskit/editor-prosemirror": "1.1.0",
40
40
  "@atlaskit/icon": "^21.12.0",
41
- "@atlaskit/platform-feature-flags": "^0.2.0",
42
41
  "@atlaskit/prosemirror-input-rules": "^2.4.0",
43
42
  "@babel/runtime": "^7.0.0",
44
43
  "uuid": "^3.1.0"
@@ -95,9 +94,5 @@
95
94
  }
96
95
  },
97
96
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
98
- "platform-feature-flags": {
99
- "platform.linking-platform.editor.fix-link-insert-analytics": {
100
- "type": "boolean"
101
- }
102
- }
97
+ "platform-feature-flags": {}
103
98
  }