@atlaskit/editor-plugin-selection 6.1.5 → 6.1.7

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,19 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 6.1.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`55920a92e882a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/55920a92e882a) -
8
+ tsignores added for help-center local consumpton removed
9
+ - Updated dependencies
10
+
11
+ ## 6.1.6
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 6.1.5
4
18
 
5
19
  ### Patch Changes
@@ -12,18 +12,12 @@ var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandS
12
12
  return new _safePlugin.SafePlugin({
13
13
  key: _autoExpandSelectionRangeOnInlineNodeKey.autoExpandSelectionRangeOnInlineNodePluginKey,
14
14
  props: {
15
- // @ts-ignore - Workaround for help-center local consumption
16
-
17
15
  handleDOMEvents: {
18
- // @ts-ignore - Workaround for help-center local consumption
19
-
20
16
  mousedown: function mousedown(_view, event) {
21
17
  // Ignored via go/ees005
22
18
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
23
19
  mouseDownElement = event.target;
24
20
  },
25
- // @ts-ignore - Workaround for help-center local consumption
26
-
27
21
  mouseup: function mouseup(view, event) {
28
22
  // Ignored via go/ees005
29
23
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -69,9 +63,7 @@ var createAutoExpandSelectionRangeOnInlineNodePlugin = exports.createAutoExpandS
69
63
  };
70
64
  var isMouseUpOnSupportedNode = function isMouseUpOnSupportedNode(mouseUpElement) {
71
65
  var supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
72
- var supportedNodeViewContentClassNamesList = supportedNodes
73
- // @ts-ignore - Workaround for help-center local consumption
74
- .map(function (nodeType) {
66
+ var supportedNodeViewContentClassNamesList = supportedNodes.map(function (nodeType) {
75
67
  return ".".concat(nodeType, "View-content-wrap");
76
68
  }).join(', ');
77
69
  return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
@@ -26,8 +26,6 @@ var plugin = new _safePlugin.SafePlugin({
26
26
  hideCursor: false
27
27
  };
28
28
  },
29
- // @ts-ignore - Workaround for help-center local consumption
30
-
31
29
  apply: function apply(tr, pluginState, _oldState, newState) {
32
30
  var _meta$displayGapCurso, _selectionMeta$hideCu;
33
31
  var meta = tr.getMeta(_gapCursorPluginKey.gapCursorPluginKey);
@@ -42,8 +40,6 @@ var plugin = new _safePlugin.SafePlugin({
42
40
  };
43
41
  }
44
42
  },
45
- // @ts-ignore - Workaround for help-center local consumption
46
-
47
43
  view: function view(_view) {
48
44
  /**
49
45
  * If the selection is at the beginning of a document and is a NodeSelection,
@@ -57,7 +53,6 @@ var plugin = new _safePlugin.SafePlugin({
57
53
  });
58
54
  }
59
55
  return {
60
- // @ts-ignore - Workaround for help-center local consumption
61
56
  update: function update(view) {
62
57
  var _gapCursorPluginKey$g = _gapCursorPluginKey.gapCursorPluginKey.getState(view.state),
63
58
  selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
@@ -107,7 +102,6 @@ var plugin = new _safePlugin.SafePlugin({
107
102
  return null;
108
103
  },
109
104
  // render gap cursor only when its valid
110
- // @ts-ignore - Workaround for help-center local consumption
111
105
  createSelectionBetween: function createSelectionBetween(view, $anchor, $head) {
112
106
  if (view && view.state && view.state.selection instanceof _cellSelection.CellSelection) {
113
107
  // Do not show GapCursor when there is a CellSection happening
@@ -118,7 +112,6 @@ var plugin = new _safePlugin.SafePlugin({
118
112
  }
119
113
  return null;
120
114
  },
121
- // @ts-ignore - Workaround for help-center local consumption
122
115
  handleClick: function handleClick(view, nodePos, event) {
123
116
  var _$pos$parent;
124
117
  var posAtCoords = view.posAtCoords({
@@ -152,8 +145,6 @@ var plugin = new _safePlugin.SafePlugin({
152
145
  }
153
146
  return (0, _selection.setGapCursorAtPos)(nodePos, side)(view.state, view.dispatch);
154
147
  },
155
- // @ts-ignore - Workaround for help-center local consumption
156
-
157
148
  handleDOMEvents: {
158
149
  /**
159
150
  * Android composition events aren't handled well by Prosemirror
@@ -162,7 +153,6 @@ var plugin = new _safePlugin.SafePlugin({
162
153
  * @see https://github.com/ProseMirror/prosemirror/issues/543
163
154
  */
164
155
  // Ignored via go/ees005
165
- // @ts-ignore - Workaround for help-center local consumption
166
156
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
167
157
  beforeinput: function beforeinput(view, event) {
168
158
  if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof _selection.GapCursorSelection) {
@@ -18,7 +18,6 @@ var createMarkBoundaryCursorPlugin = exports.createMarkBoundaryCursorPlugin = fu
18
18
  decorations: _view.DecorationSet.empty
19
19
  };
20
20
  },
21
- // @ts-ignore - Workaround for help-center local consumption
22
21
  apply: function apply(tr, currentState) {
23
22
  var selection = tr.selection,
24
23
  storedMarks = tr.storedMarks,
@@ -29,7 +29,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
29
29
  return new _safePlugin.SafePlugin({
30
30
  key: _types.selectionPluginKey,
31
31
  state: (0, _pluginFactory.createPluginState)(dispatch, getInitialState),
32
- // @ts-ignore - Workaround for help-center local consumption
33
32
  appendTransaction: function appendTransaction(transactions, oldEditorState, newEditorState) {
34
33
  var tr = newEditorState.tr;
35
34
  var manualSelection;
@@ -67,7 +66,6 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
67
66
  });
68
67
  return tr;
69
68
  },
70
- // @ts-ignore - Workaround for help-center local consumption
71
69
  filterTransaction: function filterTransaction(tr, state) {
72
70
  // Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
73
71
  if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof _state.NodeSelection && !tr.getMeta(_types.selectionPluginKey)) {
@@ -83,10 +81,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
83
81
  return true;
84
82
  },
85
83
  props: {
86
- // @ts-ignore - Workaround for help-center local consumption
87
-
88
84
  createSelectionBetween: _createSelectionBetween.onCreateSelectionBetween,
89
- // @ts-ignore - Workaround for help-center local consumption
90
85
  decorations: function decorations(state) {
91
86
  var _api$interaction;
92
87
  var interactionState = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.interactionState;
@@ -99,11 +94,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, dispatch, d
99
94
  }
100
95
  return (0, _pluginFactory.getPluginState)(state).decorationSet;
101
96
  },
102
- // @ts-ignore - Workaround for help-center local consumption
103
-
104
97
  handleDOMEvents: {
105
- // @ts-ignore - Workaround for help-center local consumption
106
-
107
98
  keydown: (0, _keydown.createOnKeydown)({
108
99
  __livePage: options.__livePage
109
100
  }),
@@ -6,18 +6,12 @@ export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
6
6
  return new SafePlugin({
7
7
  key: autoExpandSelectionRangeOnInlineNodePluginKey,
8
8
  props: {
9
- // @ts-ignore - Workaround for help-center local consumption
10
-
11
9
  handleDOMEvents: {
12
- // @ts-ignore - Workaround for help-center local consumption
13
-
14
10
  mousedown: (_view, event) => {
15
11
  // Ignored via go/ees005
16
12
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
17
13
  mouseDownElement = event.target;
18
14
  },
19
- // @ts-ignore - Workaround for help-center local consumption
20
-
21
15
  mouseup: (view, event) => {
22
16
  // Ignored via go/ees005
23
17
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -67,8 +61,6 @@ export const createAutoExpandSelectionRangeOnInlineNodePlugin = () => {
67
61
  };
68
62
  const isMouseUpOnSupportedNode = mouseUpElement => {
69
63
  const supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
70
- const supportedNodeViewContentClassNamesList = supportedNodes
71
- // @ts-ignore - Workaround for help-center local consumption
72
- .map(nodeType => `.${nodeType}View-content-wrap`).join(', ');
64
+ const supportedNodeViewContentClassNamesList = supportedNodes.map(nodeType => `.${nodeType}View-content-wrap`).join(', ');
73
65
  return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
74
66
  };
@@ -18,8 +18,6 @@ const plugin = new SafePlugin({
18
18
  displayGapCursor: true,
19
19
  hideCursor: false
20
20
  }),
21
- // @ts-ignore - Workaround for help-center local consumption
22
-
23
21
  apply: (tr, pluginState, _oldState, newState) => {
24
22
  var _meta$displayGapCurso, _selectionMeta$hideCu;
25
23
  const meta = tr.getMeta(gapCursorPluginKey);
@@ -34,8 +32,6 @@ const plugin = new SafePlugin({
34
32
  };
35
33
  }
36
34
  },
37
- // @ts-ignore - Workaround for help-center local consumption
38
-
39
35
  view: view => {
40
36
  /**
41
37
  * If the selection is at the beginning of a document and is a NodeSelection,
@@ -49,8 +45,6 @@ const plugin = new SafePlugin({
49
45
  });
50
46
  }
51
47
  return {
52
- // @ts-ignore - Workaround for help-center local consumption
53
-
54
48
  update(view) {
55
49
  const {
56
50
  selectionIsGapCursor
@@ -106,8 +100,6 @@ const plugin = new SafePlugin({
106
100
  return null;
107
101
  },
108
102
  // render gap cursor only when its valid
109
- // @ts-ignore - Workaround for help-center local consumption
110
-
111
103
  createSelectionBetween(view, $anchor, $head) {
112
104
  if (view && view.state && view.state.selection instanceof CellSelection) {
113
105
  // Do not show GapCursor when there is a CellSection happening
@@ -118,8 +110,6 @@ const plugin = new SafePlugin({
118
110
  }
119
111
  return null;
120
112
  },
121
- // @ts-ignore - Workaround for help-center local consumption
122
-
123
113
  handleClick(view, nodePos, event) {
124
114
  var _$pos$parent;
125
115
  const posAtCoords = view.posAtCoords({
@@ -153,8 +143,6 @@ const plugin = new SafePlugin({
153
143
  }
154
144
  return setGapCursorAtPos(nodePos, side)(view.state, view.dispatch);
155
145
  },
156
- // @ts-ignore - Workaround for help-center local consumption
157
-
158
146
  handleDOMEvents: {
159
147
  /**
160
148
  * Android composition events aren't handled well by Prosemirror
@@ -163,7 +151,6 @@ const plugin = new SafePlugin({
163
151
  * @see https://github.com/ProseMirror/prosemirror/issues/543
164
152
  */
165
153
  // Ignored via go/ees005
166
- // @ts-ignore - Workaround for help-center local consumption
167
154
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
168
155
  beforeinput: (view, event) => {
169
156
  if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof GapCursorSelection) {
@@ -10,8 +10,6 @@ export const createMarkBoundaryCursorPlugin = () => {
10
10
  init: () => ({
11
11
  decorations: DecorationSet.empty
12
12
  }),
13
- // @ts-ignore - Workaround for help-center local consumption
14
-
15
13
  apply(tr, currentState) {
16
14
  const {
17
15
  selection,
@@ -20,8 +20,6 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
20
20
  return new SafePlugin({
21
21
  key: selectionPluginKey,
22
22
  state: createPluginState(dispatch, getInitialState),
23
- // @ts-ignore - Workaround for help-center local consumption
24
-
25
23
  appendTransaction(transactions, oldEditorState, newEditorState) {
26
24
  const {
27
25
  tr
@@ -61,8 +59,6 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
61
59
  });
62
60
  return tr;
63
61
  },
64
- // @ts-ignore - Workaround for help-center local consumption
65
-
66
62
  filterTransaction(tr, state) {
67
63
  // Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
68
64
  if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof NodeSelection && !tr.getMeta(selectionPluginKey)) {
@@ -78,11 +74,7 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
78
74
  return true;
79
75
  },
80
76
  props: {
81
- // @ts-ignore - Workaround for help-center local consumption
82
-
83
77
  createSelectionBetween: onCreateSelectionBetween,
84
- // @ts-ignore - Workaround for help-center local consumption
85
-
86
78
  decorations(state) {
87
79
  var _api$interaction, _api$interaction$shar;
88
80
  const interactionState = api === null || api === void 0 ? void 0 : (_api$interaction = api.interaction) === null || _api$interaction === void 0 ? void 0 : (_api$interaction$shar = _api$interaction.sharedState.currentState()) === null || _api$interaction$shar === void 0 ? void 0 : _api$interaction$shar.interactionState;
@@ -95,11 +87,7 @@ export const createPlugin = (api, dispatch, dispatchAnalyticsEvent, options = {}
95
87
  }
96
88
  return getPluginState(state).decorationSet;
97
89
  },
98
- // @ts-ignore - Workaround for help-center local consumption
99
-
100
90
  handleDOMEvents: {
101
- // @ts-ignore - Workaround for help-center local consumption
102
-
103
91
  keydown: createOnKeydown({
104
92
  __livePage: options.__livePage
105
93
  }),
@@ -6,18 +6,12 @@ export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAut
6
6
  return new SafePlugin({
7
7
  key: autoExpandSelectionRangeOnInlineNodePluginKey,
8
8
  props: {
9
- // @ts-ignore - Workaround for help-center local consumption
10
-
11
9
  handleDOMEvents: {
12
- // @ts-ignore - Workaround for help-center local consumption
13
-
14
10
  mousedown: function mousedown(_view, event) {
15
11
  // Ignored via go/ees005
16
12
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
17
13
  mouseDownElement = event.target;
18
14
  },
19
- // @ts-ignore - Workaround for help-center local consumption
20
-
21
15
  mouseup: function mouseup(view, event) {
22
16
  // Ignored via go/ees005
23
17
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -63,9 +57,7 @@ export var createAutoExpandSelectionRangeOnInlineNodePlugin = function createAut
63
57
  };
64
58
  var isMouseUpOnSupportedNode = function isMouseUpOnSupportedNode(mouseUpElement) {
65
59
  var supportedNodes = ['emoji', 'status', 'date', 'mention', 'inlineCard'];
66
- var supportedNodeViewContentClassNamesList = supportedNodes
67
- // @ts-ignore - Workaround for help-center local consumption
68
- .map(function (nodeType) {
60
+ var supportedNodeViewContentClassNamesList = supportedNodes.map(function (nodeType) {
69
61
  return ".".concat(nodeType, "View-content-wrap");
70
62
  }).join(', ');
71
63
  return !!mouseUpElement.closest(supportedNodeViewContentClassNamesList);
@@ -20,8 +20,6 @@ var plugin = new SafePlugin({
20
20
  hideCursor: false
21
21
  };
22
22
  },
23
- // @ts-ignore - Workaround for help-center local consumption
24
-
25
23
  apply: function apply(tr, pluginState, _oldState, newState) {
26
24
  var _meta$displayGapCurso, _selectionMeta$hideCu;
27
25
  var meta = tr.getMeta(gapCursorPluginKey);
@@ -36,8 +34,6 @@ var plugin = new SafePlugin({
36
34
  };
37
35
  }
38
36
  },
39
- // @ts-ignore - Workaround for help-center local consumption
40
-
41
37
  view: function view(_view) {
42
38
  /**
43
39
  * If the selection is at the beginning of a document and is a NodeSelection,
@@ -51,7 +47,6 @@ var plugin = new SafePlugin({
51
47
  });
52
48
  }
53
49
  return {
54
- // @ts-ignore - Workaround for help-center local consumption
55
50
  update: function update(view) {
56
51
  var _gapCursorPluginKey$g = gapCursorPluginKey.getState(view.state),
57
52
  selectionIsGapCursor = _gapCursorPluginKey$g.selectionIsGapCursor;
@@ -101,7 +96,6 @@ var plugin = new SafePlugin({
101
96
  return null;
102
97
  },
103
98
  // render gap cursor only when its valid
104
- // @ts-ignore - Workaround for help-center local consumption
105
99
  createSelectionBetween: function createSelectionBetween(view, $anchor, $head) {
106
100
  if (view && view.state && view.state.selection instanceof CellSelection) {
107
101
  // Do not show GapCursor when there is a CellSection happening
@@ -112,7 +106,6 @@ var plugin = new SafePlugin({
112
106
  }
113
107
  return null;
114
108
  },
115
- // @ts-ignore - Workaround for help-center local consumption
116
109
  handleClick: function handleClick(view, nodePos, event) {
117
110
  var _$pos$parent;
118
111
  var posAtCoords = view.posAtCoords({
@@ -146,8 +139,6 @@ var plugin = new SafePlugin({
146
139
  }
147
140
  return setGapCursorAtPos(nodePos, side)(view.state, view.dispatch);
148
141
  },
149
- // @ts-ignore - Workaround for help-center local consumption
150
-
151
142
  handleDOMEvents: {
152
143
  /**
153
144
  * Android composition events aren't handled well by Prosemirror
@@ -156,7 +147,6 @@ var plugin = new SafePlugin({
156
147
  * @see https://github.com/ProseMirror/prosemirror/issues/543
157
148
  */
158
149
  // Ignored via go/ees005
159
- // @ts-ignore - Workaround for help-center local consumption
160
150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
161
151
  beforeinput: function beforeinput(view, event) {
162
152
  if (event.inputType === 'deleteContentBackward' && view.state.selection instanceof GapCursorSelection) {
@@ -12,7 +12,6 @@ export var createMarkBoundaryCursorPlugin = function createMarkBoundaryCursorPlu
12
12
  decorations: DecorationSet.empty
13
13
  };
14
14
  },
15
- // @ts-ignore - Workaround for help-center local consumption
16
15
  apply: function apply(tr, currentState) {
17
16
  var selection = tr.selection,
18
17
  storedMarks = tr.storedMarks,
@@ -23,7 +23,6 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
23
23
  return new SafePlugin({
24
24
  key: selectionPluginKey,
25
25
  state: createPluginState(dispatch, getInitialState),
26
- // @ts-ignore - Workaround for help-center local consumption
27
26
  appendTransaction: function appendTransaction(transactions, oldEditorState, newEditorState) {
28
27
  var tr = newEditorState.tr;
29
28
  var manualSelection;
@@ -61,7 +60,6 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
61
60
  });
62
61
  return tr;
63
62
  },
64
- // @ts-ignore - Workaround for help-center local consumption
65
63
  filterTransaction: function filterTransaction(tr, state) {
66
64
  // Prevent single click selecting atom nodes on mobile (we want to select with long press gesture instead)
67
65
  if (options.useLongPressSelection && tr.selectionSet && tr.selection instanceof NodeSelection && !tr.getMeta(selectionPluginKey)) {
@@ -77,10 +75,7 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
77
75
  return true;
78
76
  },
79
77
  props: {
80
- // @ts-ignore - Workaround for help-center local consumption
81
-
82
78
  createSelectionBetween: onCreateSelectionBetween,
83
- // @ts-ignore - Workaround for help-center local consumption
84
79
  decorations: function decorations(state) {
85
80
  var _api$interaction;
86
81
  var interactionState = api === null || api === void 0 || (_api$interaction = api.interaction) === null || _api$interaction === void 0 || (_api$interaction = _api$interaction.sharedState.currentState()) === null || _api$interaction === void 0 ? void 0 : _api$interaction.interactionState;
@@ -93,11 +88,7 @@ export var createPlugin = function createPlugin(api, dispatch, dispatchAnalytics
93
88
  }
94
89
  return getPluginState(state).decorationSet;
95
90
  },
96
- // @ts-ignore - Workaround for help-center local consumption
97
-
98
91
  handleDOMEvents: {
99
- // @ts-ignore - Workaround for help-center local consumption
100
-
101
92
  keydown: createOnKeydown({
102
93
  __livePage: options.__livePage
103
94
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "6.1.5",
3
+ "version": "6.1.7",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,12 +25,12 @@
25
25
  "@atlaskit/editor-shared-styles": "^3.10.0",
26
26
  "@atlaskit/editor-tables": "^2.9.0",
27
27
  "@atlaskit/platform-feature-flags": "^1.1.0",
28
- "@atlaskit/tmp-editor-statsig": "^13.42.0",
29
- "@atlaskit/tokens": "^8.3.0",
28
+ "@atlaskit/tmp-editor-statsig": "^14.2.0",
29
+ "@atlaskit/tokens": "^8.4.0",
30
30
  "@babel/runtime": "^7.0.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@atlaskit/editor-common": "^110.34.0",
33
+ "@atlaskit/editor-common": "^110.36.0",
34
34
  "react": "^18.2.0"
35
35
  },
36
36
  "techstack": {