@atlaskit/editor-plugin-hyperlink 22.0.0 → 23.0.0

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,18 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 23.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2b25e6e39edbf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2b25e6e39edbf) -
8
+ Cleanup `feature_gate` `platform_editor_middle_click_no_link_toolbar`. Middle-clicking a link now
9
+ always opens it in a new tab and leaves the selection alone, so the link toolbar no longer opens
10
+ behind the new tab.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 22.0.0
4
17
 
5
18
  ### Patch Changes
@@ -12,7 +12,6 @@ var _link3 = require("@atlaskit/editor-common/link");
12
12
  var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
13
13
  var _utils = require("@atlaskit/editor-common/utils");
14
14
  var _state = require("@atlaskit/editor-prosemirror/state");
15
- var _fg = require("@atlaskit/platform-feature-flags/fg");
16
15
  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; }
17
16
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
18
17
  var mapTransactionToState = function mapTransactionToState(state, tr) {
@@ -222,9 +221,6 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
222
221
  if (!href || !(0, _isSafeUrl.isSafeUrl)(href)) {
223
222
  return false;
224
223
  }
225
- if (!(0, _fg.fg)('platform_editor_middle_click_no_link_toolbar')) {
226
- return false;
227
- }
228
224
  window.open(href, '_blank', 'noopener,noreferrer');
229
225
  return true;
230
226
  },
@@ -235,7 +231,7 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
235
231
  // link state will be update on slection change which happens on mousedown
236
232
  if (isLinkDirectTarget(event)) {
237
233
  // Leave middle-click alone so the browser can still open the link in a new tab.
238
- if (event.button === 1 && (0, _fg.fg)('platform_editor_middle_click_no_link_toolbar')) {
234
+ if (event.button === 1) {
239
235
  return false;
240
236
  }
241
237
  event.preventDefault();
@@ -250,7 +246,7 @@ var plugin = exports.plugin = function plugin(dispatch, intl, editorAppearance,
250
246
  // the selection into the link or select the card node, which is what opens
251
247
  // the toolbar.
252
248
  var middleClickAnchor = event.button === 1 ? getLinkAnchor(event) : null;
253
- if (middleClickAnchor && (0, _fg.fg)('platform_editor_middle_click_no_link_toolbar')) {
249
+ if (middleClickAnchor) {
254
250
  // Returning true only stops ProseMirror. The browser still places a caret
255
251
  // at the click point inside contenteditable, and a caret inside the link is
256
252
  // itself enough to open the toolbar, so the default has to be suppressed
@@ -5,7 +5,6 @@ import { InsertStatus, LinkAction, getActiveLinkMark } from '@atlaskit/editor-co
5
5
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
6
6
  import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
7
7
  import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
- import { fg } from '@atlaskit/platform-feature-flags/fg';
9
8
  const mapTransactionToState = (state, tr) => {
10
9
  if (!state) {
11
10
  return undefined;
@@ -221,9 +220,6 @@ export const plugin = (dispatch, intl, editorAppearance, _pluginInjectionApi, _o
221
220
  if (!href || !isSafeUrl(href)) {
222
221
  return false;
223
222
  }
224
- if (!fg('platform_editor_middle_click_no_link_toolbar')) {
225
- return false;
226
- }
227
223
  window.open(href, '_blank', 'noopener,noreferrer');
228
224
  return true;
229
225
  },
@@ -234,7 +230,7 @@ export const plugin = (dispatch, intl, editorAppearance, _pluginInjectionApi, _o
234
230
  // link state will be update on slection change which happens on mousedown
235
231
  if (isLinkDirectTarget(event)) {
236
232
  // Leave middle-click alone so the browser can still open the link in a new tab.
237
- if (event.button === 1 && fg('platform_editor_middle_click_no_link_toolbar')) {
233
+ if (event.button === 1) {
238
234
  return false;
239
235
  }
240
236
  event.preventDefault();
@@ -249,7 +245,7 @@ export const plugin = (dispatch, intl, editorAppearance, _pluginInjectionApi, _o
249
245
  // the selection into the link or select the card node, which is what opens
250
246
  // the toolbar.
251
247
  const middleClickAnchor = event.button === 1 ? getLinkAnchor(event) : null;
252
- if (middleClickAnchor && fg('platform_editor_middle_click_no_link_toolbar')) {
248
+ if (middleClickAnchor) {
253
249
  // Returning true only stops ProseMirror. The browser still places a caret
254
250
  // at the click point inside contenteditable, and a caret inside the link is
255
251
  // itself enough to open the toolbar, so the default has to be suppressed
@@ -8,7 +8,6 @@ import { InsertStatus, LinkAction, getActiveLinkMark } from '@atlaskit/editor-co
8
8
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
9
9
  import { canLinkBeCreatedInRange, shallowEqual } from '@atlaskit/editor-common/utils';
10
10
  import { PluginKey, TextSelection } from '@atlaskit/editor-prosemirror/state';
11
- import { fg } from '@atlaskit/platform-feature-flags/fg';
12
11
  var mapTransactionToState = function mapTransactionToState(state, tr) {
13
12
  if (!state) {
14
13
  return undefined;
@@ -216,9 +215,6 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, _pluginInj
216
215
  if (!href || !isSafeUrl(href)) {
217
216
  return false;
218
217
  }
219
- if (!fg('platform_editor_middle_click_no_link_toolbar')) {
220
- return false;
221
- }
222
218
  window.open(href, '_blank', 'noopener,noreferrer');
223
219
  return true;
224
220
  },
@@ -229,7 +225,7 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, _pluginInj
229
225
  // link state will be update on slection change which happens on mousedown
230
226
  if (isLinkDirectTarget(event)) {
231
227
  // Leave middle-click alone so the browser can still open the link in a new tab.
232
- if (event.button === 1 && fg('platform_editor_middle_click_no_link_toolbar')) {
228
+ if (event.button === 1) {
233
229
  return false;
234
230
  }
235
231
  event.preventDefault();
@@ -244,7 +240,7 @@ export var plugin = function plugin(dispatch, intl, editorAppearance, _pluginInj
244
240
  // the selection into the link or select the card node, which is what opens
245
241
  // the toolbar.
246
242
  var middleClickAnchor = event.button === 1 ? getLinkAnchor(event) : null;
247
- if (middleClickAnchor && fg('platform_editor_middle_click_no_link_toolbar')) {
243
+ if (middleClickAnchor) {
248
244
  // Returning true only stops ProseMirror. The browser still places a caret
249
245
  // at the click point inside contenteditable, and a caret inside the link is
250
246
  // itself enough to open the toolbar, so the default has to be suppressed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "22.0.0",
3
+ "version": "23.0.0",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -23,20 +23,20 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/adf-schema": "^57.6.0",
25
25
  "@atlaskit/analytics-next": "^12.5.0",
26
- "@atlaskit/editor-plugin-analytics": "^20.0.0",
27
- "@atlaskit/editor-plugin-card": "^26.0.0",
28
- "@atlaskit/editor-plugin-connectivity": "^20.0.0",
29
- "@atlaskit/editor-plugin-editor-viewmode": "^22.0.0",
30
- "@atlaskit/editor-plugin-primary-toolbar": "^21.0.0",
31
- "@atlaskit/editor-plugin-selection-toolbar": "^21.0.0",
32
- "@atlaskit/editor-plugin-toolbar": "^17.0.0",
33
- "@atlaskit/editor-plugin-ui-control-registry": "^14.0.0",
34
- "@atlaskit/editor-plugin-user-intent": "^18.0.0",
26
+ "@atlaskit/editor-plugin-analytics": "^21.0.0",
27
+ "@atlaskit/editor-plugin-card": "^27.0.0",
28
+ "@atlaskit/editor-plugin-connectivity": "^21.0.0",
29
+ "@atlaskit/editor-plugin-editor-viewmode": "^23.0.0",
30
+ "@atlaskit/editor-plugin-primary-toolbar": "^22.0.0",
31
+ "@atlaskit/editor-plugin-selection-toolbar": "^22.0.0",
32
+ "@atlaskit/editor-plugin-toolbar": "^18.0.0",
33
+ "@atlaskit/editor-plugin-ui-control-registry": "^15.0.0",
34
+ "@atlaskit/editor-plugin-user-intent": "^19.0.0",
35
35
  "@atlaskit/editor-prosemirror": "^9.0.0",
36
36
  "@atlaskit/editor-toolbar": "^2.7.0",
37
37
  "@atlaskit/editor-toolbar-model": "^1.2.0",
38
38
  "@atlaskit/editor-ui-control-model": "^2.10.0",
39
- "@atlaskit/icon": "^37.7.0",
39
+ "@atlaskit/icon": "^38.0.0",
40
40
  "@atlaskit/platform-feature-experiments": "^0.3.0",
41
41
  "@atlaskit/platform-feature-flags": "^2.2.0",
42
42
  "@atlaskit/prosemirror-input-rules": "^4.1.0",
@@ -46,7 +46,7 @@
46
46
  "uuid": "^11.1.1"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^124.0.0",
49
+ "@atlaskit/editor-common": "^125.0.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"
@@ -58,10 +58,5 @@
58
58
  "react-dom": "^19.2.0",
59
59
  "react-intl": "^7.0.0",
60
60
  "wait-for-expect": "^1.2.0"
61
- },
62
- "platform-feature-flags": {
63
- "platform_editor_middle_click_no_link_toolbar": {
64
- "type": "boolean"
65
- }
66
61
  }
67
62
  }