@atlaskit/editor-plugin-hyperlink 4.4.1 → 4.4.2

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,13 @@
1
1
  # @atlaskit/editor-plugin-hyperlink
2
2
 
3
+ ## 4.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#150122](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150122)
8
+ [`92cc72b849cd4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/92cc72b849cd4) -
9
+ EDITOR-705 - cleanup FG platform_editor_update_insert_link_mark_end_pos
10
+
3
11
  ## 4.4.1
4
12
 
5
13
  ### Patch Changes
@@ -23,7 +23,6 @@ var _link = require("@atlaskit/editor-common/link");
23
23
  var _preset = require("@atlaskit/editor-common/preset");
24
24
  var _utils = require("@atlaskit/editor-common/utils");
25
25
  var _state = require("@atlaskit/editor-prosemirror/state");
26
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
26
  var _main = require("../pm-plugins/main");
28
27
  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; }
29
28
  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; }
@@ -113,20 +112,12 @@ function insertLink(from, to, incomingHref, incomingTitle, displayText, source,
113
112
  var _text = displayText || incomingTitle || incomingHref;
114
113
  if (!displayText || displayText !== currentText) {
115
114
  tr.insertText(_text, from, to);
116
- if ((0, _platformFeatureFlags.fg)('platform_editor_update_insert_link_mark_end_pos')) {
117
- // new block created to wrap the link
118
- if (tr.mapping.map(from) === from + _text.length + 2) {
119
- // +1 is for the block's opening tag
120
- markEnd = from + _text.length + 1;
121
- } else {
122
- markEnd = from + _text.length;
123
- }
115
+ // new block created to wrap the link
116
+ if (tr.mapping.map(from) === from + _text.length + 2) {
117
+ // +1 is for the block's opening tag
118
+ markEnd = from + _text.length + 1;
124
119
  } else {
125
- if (!(0, _link.isTextAtPos)(from)(state)) {
126
- markEnd = from + _text.length + 1;
127
- } else {
128
- markEnd = from + _text.length;
129
- }
120
+ markEnd = from + _text.length;
130
121
  }
131
122
  }
132
123
  tr.addMark(from, markEnd, link.create({
@@ -5,7 +5,6 @@ import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
5
5
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
6
6
  import { getLinkCreationAnalyticsEvent, normalizeUrl } from '@atlaskit/editor-common/utils';
7
7
  import { Selection } from '@atlaskit/editor-prosemirror/state';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { stateKey } from '../pm-plugins/main';
10
9
  function setLinkHrefEditorCommand(href, pos, editorAnalyticsApi, to, isTabPressed) {
11
10
  return ({
@@ -97,20 +96,12 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
97
96
  const text = displayText || incomingTitle || incomingHref;
98
97
  if (!displayText || displayText !== currentText) {
99
98
  tr.insertText(text, from, to);
100
- if (fg('platform_editor_update_insert_link_mark_end_pos')) {
101
- // new block created to wrap the link
102
- if (tr.mapping.map(from) === from + text.length + 2) {
103
- // +1 is for the block's opening tag
104
- markEnd = from + text.length + 1;
105
- } else {
106
- markEnd = from + text.length;
107
- }
99
+ // new block created to wrap the link
100
+ if (tr.mapping.map(from) === from + text.length + 2) {
101
+ // +1 is for the block's opening tag
102
+ markEnd = from + text.length + 1;
108
103
  } else {
109
- if (!isTextAtPos(from)(state)) {
110
- markEnd = from + text.length + 1;
111
- } else {
112
- markEnd = from + text.length;
113
- }
104
+ markEnd = from + text.length;
114
105
  }
115
106
  }
116
107
  tr.addMark(from, markEnd, link.create({
@@ -8,7 +8,6 @@ import { isTextAtPos, LinkAction } from '@atlaskit/editor-common/link';
8
8
  import { editorCommandToPMCommand } from '@atlaskit/editor-common/preset';
9
9
  import { getLinkCreationAnalyticsEvent, normalizeUrl } from '@atlaskit/editor-common/utils';
10
10
  import { Selection } from '@atlaskit/editor-prosemirror/state';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { stateKey } from '../pm-plugins/main';
13
12
  function setLinkHrefEditorCommand(href, pos, editorAnalyticsApi, to, isTabPressed) {
14
13
  return function (_ref) {
@@ -96,20 +95,12 @@ export function insertLink(from, to, incomingHref, incomingTitle, displayText, s
96
95
  var _text = displayText || incomingTitle || incomingHref;
97
96
  if (!displayText || displayText !== currentText) {
98
97
  tr.insertText(_text, from, to);
99
- if (fg('platform_editor_update_insert_link_mark_end_pos')) {
100
- // new block created to wrap the link
101
- if (tr.mapping.map(from) === from + _text.length + 2) {
102
- // +1 is for the block's opening tag
103
- markEnd = from + _text.length + 1;
104
- } else {
105
- markEnd = from + _text.length;
106
- }
98
+ // new block created to wrap the link
99
+ if (tr.mapping.map(from) === from + _text.length + 2) {
100
+ // +1 is for the block's opening tag
101
+ markEnd = from + _text.length + 1;
107
102
  } else {
108
- if (!isTextAtPos(from)(state)) {
109
- markEnd = from + _text.length + 1;
110
- } else {
111
- markEnd = from + _text.length;
112
- }
103
+ markEnd = from + _text.length;
113
104
  }
114
105
  }
115
106
  tr.addMark(from, markEnd, link.create({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-hyperlink",
3
- "version": "4.4.1",
3
+ "version": "4.4.2",
4
4
  "description": "Hyperlink plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,18 +35,18 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
37
  "@atlaskit/analytics-next": "^11.0.0",
38
- "@atlaskit/editor-common": "^104.0.0",
38
+ "@atlaskit/editor-common": "^104.1.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
40
40
  "@atlaskit/editor-plugin-card": "^5.4.0",
41
41
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
42
42
  "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
43
43
  "@atlaskit/editor-plugin-primary-toolbar": "^3.2.0",
44
- "@atlaskit/editor-plugin-selection-toolbar": "^3.5.0",
44
+ "@atlaskit/editor-plugin-selection-toolbar": "^3.6.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
- "@atlaskit/icon": "^25.6.0",
46
+ "@atlaskit/icon": "^25.7.0",
47
47
  "@atlaskit/platform-feature-flags": "^1.1.0",
48
48
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
49
- "@atlaskit/tmp-editor-statsig": "^4.16.0",
49
+ "@atlaskit/tmp-editor-statsig": "^4.18.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "uuid": "^3.1.0"
@@ -102,9 +102,6 @@
102
102
  }
103
103
  },
104
104
  "platform-feature-flags": {
105
- "platform_editor_update_insert_link_mark_end_pos": {
106
- "type": "boolean"
107
- },
108
105
  "linking_platform_smart_links_in_live_pages": {
109
106
  "type": "boolean"
110
107
  },