@atlaskit/editor-plugin-selection 1.6.22 → 1.6.24

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,20 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 1.6.24
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.6.23
10
+
11
+ ### Patch Changes
12
+
13
+ - [#106320](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106320)
14
+ [`38b6601dfeb85`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/38b6601dfeb85) -
15
+ Tidying platform_editor_mark_boundary_cursor
16
+ - Updated dependencies
17
+
3
18
  ## 1.6.22
4
19
 
5
20
  ### Patch Changes
@@ -234,10 +234,7 @@ var setSelectionInsideAtNodeStart = function setSelectionInsideAtNodeStart(selec
234
234
  return false;
235
235
  };
236
236
  };
237
- var setSelectionInsideAtNodeEnd = exports.setSelectionInsideAtNodeEnd = function setSelectionInsideAtNodeEnd(selectionRelativeToNode, node, from, to
238
- // Ignored via go/ees005
239
- // eslint-disable-next-line @typescript-eslint/max-params
240
- ) {
237
+ var setSelectionInsideAtNodeEnd = exports.setSelectionInsideAtNodeEnd = function setSelectionInsideAtNodeEnd(selectionRelativeToNode, node, from, to) {
241
238
  return function (state, dispatch) {
242
239
  if ((0, _utils.isNodeEmpty)(node)) {
243
240
  return findAndSetTextSelection(selectionRelativeToNode, state.doc.resolve(to), _types.SelectionDirection.Before)(state, dispatch);
@@ -55,9 +55,7 @@ var isProblematicNode = function isProblematicNode(node, _ref2) {
55
55
  __livePage: __livePage
56
56
  }) || isBodiedExtension(node) || isTable(node);
57
57
  };
58
- var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction, _ref3 // Ignored via go/ees005
59
- // eslint-disable-next-line @typescript-eslint/max-params
60
- ) {
58
+ var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction, _ref3) {
61
59
  var __livePage = _ref3.__livePage;
62
60
  if ($head.pos === 0 || $head.depth === 0) {
63
61
  return null;
@@ -175,10 +175,7 @@ var deleteNode = exports.deleteNode = function deleteNode(dir) {
175
175
 
176
176
  // This function captures clicks outside of the ProseMirror contentEditable area
177
177
  // see also description of "handleClick" in gap-cursor pm-plugin
178
- var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr
179
- // Ignored via go/ees005
180
- // eslint-disable-next-line @typescript-eslint/max-params
181
- ) {
178
+ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr) {
182
179
  var rect = editorRef.getBoundingClientRect();
183
180
 
184
181
  // capture clicks before the first block element
@@ -215,10 +212,7 @@ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCo
215
212
  }
216
213
  return null;
217
214
  };
218
- var setSelectionTopLevelBlocks = exports.setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused
219
- // Ignored via go/ees005
220
- // eslint-disable-next-line @typescript-eslint/max-params
221
- ) {
215
+ var setSelectionTopLevelBlocks = exports.setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused) {
222
216
  var cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
223
217
  if (!cursorCoords) {
224
218
  return;
@@ -248,10 +242,7 @@ var setSelectionTopLevelBlocks = exports.setSelectionTopLevelBlocks = function s
248
242
  }
249
243
  }
250
244
  };
251
- var setCursorForTopLevelBlocks = exports.setCursorForTopLevelBlocks = function setCursorForTopLevelBlocks(event, editorRef, posAtCoords, editorFocused
252
- // Ignored via go/ees005
253
- // eslint-disable-next-line @typescript-eslint/max-params
254
- ) {
245
+ var setCursorForTopLevelBlocks = exports.setCursorForTopLevelBlocks = function setCursorForTopLevelBlocks(event, editorRef, posAtCoords, editorFocused) {
255
246
  return function (state, dispatch) {
256
247
  var tr = state.tr;
257
248
  setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused);
@@ -14,9 +14,6 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
14
14
  var isLeftCursor = exports.isLeftCursor = function isLeftCursor(side) {
15
15
  return side === _selection.Side.LEFT;
16
16
  };
17
-
18
- // Ignored via go/ees005
19
- // eslint-disable-next-line @typescript-eslint/max-params
20
17
  function getMediaNearPos(doc, $pos, schema) {
21
18
  var dir = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
22
19
  var $currentPos = $pos;
@@ -40,9 +37,6 @@ function getMediaNearPos(doc, $pos, schema) {
40
37
  } while ($currentPos.depth > 0);
41
38
  return null;
42
39
  }
43
-
44
- // Ignored via go/ees005
45
- // eslint-disable-next-line @typescript-eslint/max-params
46
40
  var isTextBlockNearPos = exports.isTextBlockNearPos = function isTextBlockNearPos(doc, schema, $pos, dir) {
47
41
  var $currentPos = $pos;
48
42
  var currentNode = dir === -1 ? $currentPos.nodeBefore : $currentPos.nodeAfter;
@@ -24,8 +24,6 @@ var plugin = new _safePlugin.SafePlugin({
24
24
  displayGapCursor: true
25
25
  };
26
26
  },
27
- // Ignored via go/ees005
28
- // eslint-disable-next-line @typescript-eslint/max-params
29
27
  apply: function apply(tr, pluginState, _oldState, newState) {
30
28
  var _meta$displayGapCurso;
31
29
  var meta = tr.getMeta(_gapCursorPluginKey.gapCursorPluginKey);
@@ -8,12 +8,13 @@ var _view = require("@atlaskit/editor-prosemirror/view");
8
8
  var containerStyle = "\n\tposition: relative;\n";
9
9
  var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #172B4D)", ";\n");
10
10
  var toDOM = function toDOM() {
11
+ var _caret$animate;
11
12
  var container = document.createElement('span');
12
13
  container.className = 'ProseMirror-mark-boundary-cursor';
13
14
  container.setAttribute('style', containerStyle);
14
15
  var caret = document.createElement('div');
15
16
  caret.setAttribute('style', caretStyle);
16
- caret.animate([{
17
+ (_caret$animate = caret.animate) === null || _caret$animate === void 0 || _caret$animate.call(caret, [{
17
18
  opacity: 1
18
19
  }, {
19
20
  opacity: 1,
@@ -73,12 +73,12 @@ var selectionPlugin = exports.selectionPlugin = function selectionPlugin(_ref2)
73
73
  plugin: function plugin() {
74
74
  return _gapCursorMain.default;
75
75
  }
76
- }].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_mark_boundary_cursor') ? [{
76
+ }, {
77
77
  name: 'markBoundaryCursor',
78
78
  plugin: function plugin() {
79
79
  return (0, _markBoundaryCursorMain.createMarkBoundaryCursorPlugin)();
80
80
  }
81
- }] : []), (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('editor_auto_expand_selection_on_inline_node') ? [{
81
+ }].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('editor_auto_expand_selection_on_inline_node') ? [{
82
82
  name: 'autoExpandSelectionRangeOnInlineNode',
83
83
  plugin: function plugin() {
84
84
  return (0, _autoExpandSelectionRangeOnInlineNodeMain.createAutoExpandSelectionRangeOnInlineNodePlugin)();
@@ -226,10 +226,7 @@ const setSelectionInsideAtNodeStart = (selectionRelativeToNode, node, pos) => (s
226
226
  }
227
227
  return false;
228
228
  };
229
- export const setSelectionInsideAtNodeEnd = (selectionRelativeToNode, node, from, to
230
- // Ignored via go/ees005
231
- // eslint-disable-next-line @typescript-eslint/max-params
232
- ) => (state, dispatch) => {
229
+ export const setSelectionInsideAtNodeEnd = (selectionRelativeToNode, node, from, to) => (state, dispatch) => {
233
230
  if (isNodeEmpty(node)) {
234
231
  return findAndSetTextSelection(selectionRelativeToNode, state.doc.resolve(to), SelectionDirection.Before)(state, dispatch);
235
232
  }
@@ -54,10 +54,7 @@ const isProblematicNode = (node, {
54
54
  };
55
55
  const findFixedProblematicNodePosition = (doc, $head, direction, {
56
56
  __livePage
57
- }
58
- // Ignored via go/ees005
59
- // eslint-disable-next-line @typescript-eslint/max-params
60
- ) => {
57
+ }) => {
61
58
  if ($head.pos === 0 || $head.depth === 0) {
62
59
  return null;
63
60
  }
@@ -176,10 +176,7 @@ export const deleteNode = dir => (state, dispatch) => {
176
176
 
177
177
  // This function captures clicks outside of the ProseMirror contentEditable area
178
178
  // see also description of "handleClick" in gap-cursor pm-plugin
179
- const captureCursorCoords = (event, editorRef, posAtCoords, tr
180
- // Ignored via go/ees005
181
- // eslint-disable-next-line @typescript-eslint/max-params
182
- ) => {
179
+ const captureCursorCoords = (event, editorRef, posAtCoords, tr) => {
183
180
  const rect = editorRef.getBoundingClientRect();
184
181
 
185
182
  // capture clicks before the first block element
@@ -216,10 +213,7 @@ const captureCursorCoords = (event, editorRef, posAtCoords, tr
216
213
  }
217
214
  return null;
218
215
  };
219
- export const setSelectionTopLevelBlocks = (tr, event, editorRef, posAtCoords, editorFocused
220
- // Ignored via go/ees005
221
- // eslint-disable-next-line @typescript-eslint/max-params
222
- ) => {
216
+ export const setSelectionTopLevelBlocks = (tr, event, editorRef, posAtCoords, editorFocused) => {
223
217
  const cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
224
218
  if (!cursorCoords) {
225
219
  return;
@@ -249,10 +243,7 @@ export const setSelectionTopLevelBlocks = (tr, event, editorRef, posAtCoords, ed
249
243
  }
250
244
  }
251
245
  };
252
- export const setCursorForTopLevelBlocks = (event, editorRef, posAtCoords, editorFocused
253
- // Ignored via go/ees005
254
- // eslint-disable-next-line @typescript-eslint/max-params
255
- ) => (state, dispatch) => {
246
+ export const setCursorForTopLevelBlocks = (event, editorRef, posAtCoords, editorFocused) => (state, dispatch) => {
256
247
  const {
257
248
  tr
258
249
  } = state;
@@ -3,9 +3,6 @@ import { Side } from '@atlaskit/editor-common/selection';
3
3
  import { TableSharedCssClassName, UnsupportedSharedCssClassName } from '@atlaskit/editor-common/styles';
4
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  export const isLeftCursor = side => side === Side.LEFT;
6
-
7
- // Ignored via go/ees005
8
- // eslint-disable-next-line @typescript-eslint/max-params
9
6
  export function getMediaNearPos(doc, $pos, schema, dir = -1) {
10
7
  let $currentPos = $pos;
11
8
  let currentNode = null;
@@ -29,9 +26,6 @@ export function getMediaNearPos(doc, $pos, schema, dir = -1) {
29
26
  } while ($currentPos.depth > 0);
30
27
  return null;
31
28
  }
32
-
33
- // Ignored via go/ees005
34
- // eslint-disable-next-line @typescript-eslint/max-params
35
29
  export const isTextBlockNearPos = (doc, schema, $pos, dir) => {
36
30
  let $currentPos = $pos;
37
31
  let currentNode = dir === -1 ? $currentPos.nodeBefore : $currentPos.nodeAfter;
@@ -16,8 +16,6 @@ const plugin = new SafePlugin({
16
16
  selectionIsGapCursor: false,
17
17
  displayGapCursor: true
18
18
  }),
19
- // Ignored via go/ees005
20
- // eslint-disable-next-line @typescript-eslint/max-params
21
19
  apply: (tr, pluginState, _oldState, newState) => {
22
20
  var _meta$displayGapCurso;
23
21
  const meta = tr.getMeta(gapCursorPluginKey);
@@ -11,12 +11,13 @@ const caretStyle = `
11
11
  background-color: ${"var(--ds-text, #172B4D)"};
12
12
  `;
13
13
  const toDOM = () => {
14
+ var _caret$animate;
14
15
  const container = document.createElement('span');
15
16
  container.className = 'ProseMirror-mark-boundary-cursor';
16
17
  container.setAttribute('style', containerStyle);
17
18
  const caret = document.createElement('div');
18
19
  caret.setAttribute('style', caretStyle);
19
- caret.animate([{
20
+ (_caret$animate = caret.animate) === null || _caret$animate === void 0 ? void 0 : _caret$animate.call(caret, [{
20
21
  opacity: 1
21
22
  }, {
22
23
  opacity: 1,
@@ -58,10 +58,10 @@ export const selectionPlugin = ({
58
58
  }, {
59
59
  name: 'gapCursor',
60
60
  plugin: () => gapCursorPlugin
61
- }, ...(fg('platform_editor_mark_boundary_cursor') ? [{
61
+ }, {
62
62
  name: 'markBoundaryCursor',
63
63
  plugin: () => createMarkBoundaryCursorPlugin()
64
- }] : []), ...(fg('editor_auto_expand_selection_on_inline_node') ? [{
64
+ }, ...(fg('editor_auto_expand_selection_on_inline_node') ? [{
65
65
  name: 'autoExpandSelectionRangeOnInlineNode',
66
66
  plugin: () => createAutoExpandSelectionRangeOnInlineNodePlugin()
67
67
  }] : [])];
@@ -227,10 +227,7 @@ var setSelectionInsideAtNodeStart = function setSelectionInsideAtNodeStart(selec
227
227
  return false;
228
228
  };
229
229
  };
230
- export var setSelectionInsideAtNodeEnd = function setSelectionInsideAtNodeEnd(selectionRelativeToNode, node, from, to
231
- // Ignored via go/ees005
232
- // eslint-disable-next-line @typescript-eslint/max-params
233
- ) {
230
+ export var setSelectionInsideAtNodeEnd = function setSelectionInsideAtNodeEnd(selectionRelativeToNode, node, from, to) {
234
231
  return function (state, dispatch) {
235
232
  if (isNodeEmpty(node)) {
236
233
  return findAndSetTextSelection(selectionRelativeToNode, state.doc.resolve(to), SelectionDirection.Before)(state, dispatch);
@@ -50,9 +50,7 @@ var isProblematicNode = function isProblematicNode(node, _ref2) {
50
50
  __livePage: __livePage
51
51
  }) || isBodiedExtension(node) || isTable(node);
52
52
  };
53
- var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction, _ref3 // Ignored via go/ees005
54
- // eslint-disable-next-line @typescript-eslint/max-params
55
- ) {
53
+ var findFixedProblematicNodePosition = function findFixedProblematicNodePosition(doc, $head, direction, _ref3) {
56
54
  var __livePage = _ref3.__livePage;
57
55
  if ($head.pos === 0 || $head.depth === 0) {
58
56
  return null;
@@ -169,10 +169,7 @@ export var deleteNode = function deleteNode(dir) {
169
169
 
170
170
  // This function captures clicks outside of the ProseMirror contentEditable area
171
171
  // see also description of "handleClick" in gap-cursor pm-plugin
172
- var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr
173
- // Ignored via go/ees005
174
- // eslint-disable-next-line @typescript-eslint/max-params
175
- ) {
172
+ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCoords, tr) {
176
173
  var rect = editorRef.getBoundingClientRect();
177
174
 
178
175
  // capture clicks before the first block element
@@ -209,10 +206,7 @@ var captureCursorCoords = function captureCursorCoords(event, editorRef, posAtCo
209
206
  }
210
207
  return null;
211
208
  };
212
- export var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused
213
- // Ignored via go/ees005
214
- // eslint-disable-next-line @typescript-eslint/max-params
215
- ) {
209
+ export var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused) {
216
210
  var cursorCoords = captureCursorCoords(event, editorRef, posAtCoords, tr);
217
211
  if (!cursorCoords) {
218
212
  return;
@@ -242,10 +236,7 @@ export var setSelectionTopLevelBlocks = function setSelectionTopLevelBlocks(tr,
242
236
  }
243
237
  }
244
238
  };
245
- export var setCursorForTopLevelBlocks = function setCursorForTopLevelBlocks(event, editorRef, posAtCoords, editorFocused
246
- // Ignored via go/ees005
247
- // eslint-disable-next-line @typescript-eslint/max-params
248
- ) {
239
+ export var setCursorForTopLevelBlocks = function setCursorForTopLevelBlocks(event, editorRef, posAtCoords, editorFocused) {
249
240
  return function (state, dispatch) {
250
241
  var tr = state.tr;
251
242
  setSelectionTopLevelBlocks(tr, event, editorRef, posAtCoords, editorFocused);
@@ -5,9 +5,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  export var isLeftCursor = function isLeftCursor(side) {
6
6
  return side === Side.LEFT;
7
7
  };
8
-
9
- // Ignored via go/ees005
10
- // eslint-disable-next-line @typescript-eslint/max-params
11
8
  export function getMediaNearPos(doc, $pos, schema) {
12
9
  var dir = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
13
10
  var $currentPos = $pos;
@@ -31,9 +28,6 @@ export function getMediaNearPos(doc, $pos, schema) {
31
28
  } while ($currentPos.depth > 0);
32
29
  return null;
33
30
  }
34
-
35
- // Ignored via go/ees005
36
- // eslint-disable-next-line @typescript-eslint/max-params
37
31
  export var isTextBlockNearPos = function isTextBlockNearPos(doc, schema, $pos, dir) {
38
32
  var $currentPos = $pos;
39
33
  var currentNode = dir === -1 ? $currentPos.nodeBefore : $currentPos.nodeAfter;
@@ -18,8 +18,6 @@ var plugin = new SafePlugin({
18
18
  displayGapCursor: true
19
19
  };
20
20
  },
21
- // Ignored via go/ees005
22
- // eslint-disable-next-line @typescript-eslint/max-params
23
21
  apply: function apply(tr, pluginState, _oldState, newState) {
24
22
  var _meta$displayGapCurso;
25
23
  var meta = tr.getMeta(gapCursorPluginKey);
@@ -2,12 +2,13 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
2
  var containerStyle = "\n\tposition: relative;\n";
3
3
  var caretStyle = "\n\tposition: absolute;\n\theight: 100%;\n\twidth: 1px;\n\tleft: -0.5px;\n\tbottom: 0;\n\tbackground-color: ".concat("var(--ds-text, #172B4D)", ";\n");
4
4
  var toDOM = function toDOM() {
5
+ var _caret$animate;
5
6
  var container = document.createElement('span');
6
7
  container.className = 'ProseMirror-mark-boundary-cursor';
7
8
  container.setAttribute('style', containerStyle);
8
9
  var caret = document.createElement('div');
9
10
  caret.setAttribute('style', caretStyle);
10
- caret.animate([{
11
+ (_caret$animate = caret.animate) === null || _caret$animate === void 0 || _caret$animate.call(caret, [{
11
12
  opacity: 1
12
13
  }, {
13
14
  opacity: 1,
@@ -66,12 +66,12 @@ export var selectionPlugin = function selectionPlugin(_ref2) {
66
66
  plugin: function plugin() {
67
67
  return gapCursorPlugin;
68
68
  }
69
- }].concat(_toConsumableArray(fg('platform_editor_mark_boundary_cursor') ? [{
69
+ }, {
70
70
  name: 'markBoundaryCursor',
71
71
  plugin: function plugin() {
72
72
  return createMarkBoundaryCursorPlugin();
73
73
  }
74
- }] : []), _toConsumableArray(fg('editor_auto_expand_selection_on_inline_node') ? [{
74
+ }].concat(_toConsumableArray(fg('editor_auto_expand_selection_on_inline_node') ? [{
75
75
  name: 'autoExpandSelectionRangeOnInlineNode',
76
76
  plugin: function plugin() {
77
77
  return createAutoExpandSelectionRangeOnInlineNodePlugin();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "1.6.22",
3
+ "version": "1.6.24",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,7 +25,7 @@
25
25
  "@atlaskit/editor-shared-styles": "^3.2.0",
26
26
  "@atlaskit/editor-tables": "^2.8.0",
27
27
  "@atlaskit/platform-feature-flags": "^0.3.0",
28
- "@atlaskit/tmp-editor-statsig": "2.40.0",
28
+ "@atlaskit/tmp-editor-statsig": "2.41.0",
29
29
  "@atlaskit/tokens": "^3.2.0",
30
30
  "@babel/runtime": "^7.0.0"
31
31
  },
@@ -84,9 +84,6 @@
84
84
  "platform-editor-single-player-expand": {
85
85
  "type": "boolean"
86
86
  },
87
- "platform_editor_mark_boundary_cursor": {
88
- "type": "boolean"
89
- },
90
87
  "platform_editor_fix_drag_and_drop_lists": {
91
88
  "type": "boolean"
92
89
  },