@atlaskit/editor-plugin-selection-extension 3.1.1 → 3.2.1

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,26 @@
1
1
  # @atlaskit/editor-plugin-selection-extension
2
2
 
3
+ ## 3.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#189233](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/189233)
8
+ [`0fe3ab9a767d5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fe3ab9a767d5) -
9
+ FG cleanup for platform_editor_fix_get_selection_state_mismatch
10
+ - Updated dependencies
11
+
12
+ ## 3.2.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#189314](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/189314)
17
+ [`22c6251496010`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22c6251496010) -
18
+ Exported missing types that were already being inferred from existing exports
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 3.1.1
4
25
 
5
26
  ### Patch Changes
@@ -21,9 +21,6 @@ var insertSmartLinks = exports.insertSmartLinks = function insertSmartLinks(link
21
21
  var _selectionExtensionPl;
22
22
  var tr = state.tr,
23
23
  schema = state.schema;
24
- if (!Array.isArray(linkInsertionOption)) {
25
- linkInsertionOption = [linkInsertionOption];
26
- }
27
24
  if (linkInsertionOption.length === 0) {
28
25
  return {
29
26
  status: 'error',
@@ -130,8 +130,7 @@ var selectionExtensionPlugin = exports.selectionExtensionPlugin = function selec
130
130
  var currentSelection = view.state.selection;
131
131
  var from = currentSelection.from,
132
132
  to = currentSelection.to;
133
- var currentState = (0, _platformFeatureFlags.fg)('platform_editor_fix_get_selection_state_mismatch') ? view.state : state;
134
- var text = currentState.doc.textBetween(from, to, '\n');
133
+ var text = view.state.doc.textBetween(from, to, '\n');
135
134
  var coords = (0, _getBoundingBoxFromSelection.getBoundingBoxFromSelection)(view, from, to);
136
135
  return {
137
136
  text: text,
@@ -16,9 +16,6 @@ export const insertSmartLinks = (linkInsertionOption, selectedNodeAdf) => (state
16
16
  tr,
17
17
  schema
18
18
  } = state;
19
- if (!Array.isArray(linkInsertionOption)) {
20
- linkInsertionOption = [linkInsertionOption];
21
- }
22
19
  if (linkInsertionOption.length === 0) {
23
20
  return {
24
21
  status: 'error',
@@ -129,8 +129,7 @@ export const selectionExtensionPlugin = ({
129
129
  from,
130
130
  to
131
131
  } = currentSelection;
132
- const currentState = fg('platform_editor_fix_get_selection_state_mismatch') ? view.state : state;
133
- const text = currentState.doc.textBetween(from, to, '\n');
132
+ const text = view.state.doc.textBetween(from, to, '\n');
134
133
  const coords = getBoundingBoxFromSelection(view, from, to);
135
134
  return {
136
135
  text,
@@ -15,9 +15,6 @@ export var insertSmartLinks = function insertSmartLinks(linkInsertionOption, sel
15
15
  var _selectionExtensionPl;
16
16
  var tr = state.tr,
17
17
  schema = state.schema;
18
- if (!Array.isArray(linkInsertionOption)) {
19
- linkInsertionOption = [linkInsertionOption];
20
- }
21
18
  if (linkInsertionOption.length === 0) {
22
19
  return {
23
20
  status: 'error',
@@ -123,8 +123,7 @@ export var selectionExtensionPlugin = function selectionExtensionPlugin(_ref) {
123
123
  var currentSelection = view.state.selection;
124
124
  var from = currentSelection.from,
125
125
  to = currentSelection.to;
126
- var currentState = fg('platform_editor_fix_get_selection_state_mismatch') ? view.state : state;
127
- var text = currentState.doc.textBetween(from, to, '\n');
126
+ var text = view.state.doc.textBetween(from, to, '\n');
128
127
  var coords = getBoundingBoxFromSelection(view, from, to);
129
128
  return {
130
129
  text: text,
@@ -1,3 +1,3 @@
1
1
  export { selectionExtensionPlugin } from './selectionExtensionPlugin';
2
2
  export type { SelectionExtensionPlugin } from './selectionExtensionPluginType';
3
- export type { SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtension, } from './types';
3
+ export type { SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtension, LinkInsertionOption, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, } from './types';
@@ -2,7 +2,7 @@ import { type ADFEntity } from '@atlaskit/adf-utils/types';
2
2
  import type { CommandDispatch } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import { type LinkInsertionOption } from '../types';
5
- export declare const insertSmartLinks: (linkInsertionOption: LinkInsertionOption | LinkInsertionOption[], selectedNodeAdf: ADFEntity) => (state: EditorState, dispatch: CommandDispatch) => {
5
+ export declare const insertSmartLinks: (linkInsertionOption: LinkInsertionOption[], selectedNodeAdf: ADFEntity) => (state: EditorState, dispatch: CommandDispatch) => {
6
6
  status: 'success' | 'error';
7
7
  message?: string;
8
8
  };
@@ -20,7 +20,7 @@ export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
20
20
  clearActiveExtension: () => EditorCommand;
21
21
  };
22
22
  actions: {
23
- insertSmartLinks: (linkInsertionOption: LinkInsertionOption | LinkInsertionOption[], selectedNodeAdf: ADFEntity) => {
23
+ insertSmartLinks: (linkInsertionOption: LinkInsertionOption[], selectedNodeAdf: ADFEntity) => {
24
24
  status: 'success' | 'error';
25
25
  message?: string;
26
26
  };
@@ -1,3 +1,3 @@
1
1
  export { selectionExtensionPlugin } from './selectionExtensionPlugin';
2
2
  export type { SelectionExtensionPlugin } from './selectionExtensionPluginType';
3
- export type { SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtension, } from './types';
3
+ export type { SelectionExtensionComponentProps, SelectionExtensionPluginOptions, SelectionExtension, LinkInsertionOption, SelectionExtensionPluginState, SelectionExtensionSelectionInfo, } from './types';
@@ -2,7 +2,7 @@ import { type ADFEntity } from '@atlaskit/adf-utils/types';
2
2
  import type { CommandDispatch } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  import { type LinkInsertionOption } from '../types';
5
- export declare const insertSmartLinks: (linkInsertionOption: LinkInsertionOption | LinkInsertionOption[], selectedNodeAdf: ADFEntity) => (state: EditorState, dispatch: CommandDispatch) => {
5
+ export declare const insertSmartLinks: (linkInsertionOption: LinkInsertionOption[], selectedNodeAdf: ADFEntity) => (state: EditorState, dispatch: CommandDispatch) => {
6
6
  status: 'success' | 'error';
7
7
  message?: string;
8
8
  };
@@ -20,7 +20,7 @@ export type SelectionExtensionPlugin = NextEditorPlugin<'selectionExtension', {
20
20
  clearActiveExtension: () => EditorCommand;
21
21
  };
22
22
  actions: {
23
- insertSmartLinks: (linkInsertionOption: LinkInsertionOption | LinkInsertionOption[], selectedNodeAdf: ADFEntity) => {
23
+ insertSmartLinks: (linkInsertionOption: LinkInsertionOption[], selectedNodeAdf: ADFEntity) => {
24
24
  status: 'success' | 'error';
25
25
  message?: string;
26
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection-extension",
3
- "version": "3.1.1",
3
+ "version": "3.2.1",
4
4
  "description": "editor-plugin-selection-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,20 +39,20 @@
39
39
  "@atlaskit/editor-json-transformer": "^8.24.0",
40
40
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
41
41
  "@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
42
- "@atlaskit/editor-plugin-selection-toolbar": "^4.0.0",
42
+ "@atlaskit/editor-plugin-selection-toolbar": "^4.2.0",
43
43
  "@atlaskit/editor-prosemirror": "7.0.0",
44
44
  "@atlaskit/editor-tables": "^2.9.0",
45
- "@atlaskit/icon": "^27.3.0",
45
+ "@atlaskit/icon": "^27.5.0",
46
46
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
47
  "@atlaskit/primitives": "^14.10.0",
48
- "@atlaskit/tmp-editor-statsig": "^9.1.0",
48
+ "@atlaskit/tmp-editor-statsig": "^9.9.0",
49
49
  "@babel/runtime": "^7.0.0",
50
50
  "lodash": "^4.17.21",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1",
52
52
  "uuid": "^3.1.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^107.7.0",
55
+ "@atlaskit/editor-common": "^107.9.0",
56
56
  "react": "^18.2.0"
57
57
  },
58
58
  "devDependencies": {
@@ -106,9 +106,6 @@
106
106
  "platform-feature-flags": {
107
107
  "platform_editor_selection_extension_api_v2": {
108
108
  "type": "boolean"
109
- },
110
- "platform_editor_fix_get_selection_state_mismatch": {
111
- "type": "boolean"
112
109
  }
113
110
  }
114
111
  }