@atlaskit/editor-plugin-extension 5.0.1 → 5.0.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,14 @@
1
1
  # @atlaskit/editor-plugin-extension
2
2
 
3
+ ## 5.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#123345](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/123345)
8
+ [`31b02e82858e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/31b02e82858e5) -
9
+ NO-ISSUE: Update usages of selection utils
10
+ - Updated dependencies
11
+
3
12
  ## 5.0.1
4
13
 
5
14
  ### Patch Changes
@@ -227,7 +227,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
227
227
  var maybeBodiedExtension = selection instanceof _state.TextSelection ? (0, _utils.findParentNodeOfTypeClosestToPos)($head, bodiedExtension) : (0, _utils.findSelectedNodeOfType)(bodiedExtension)(selection);
228
228
  if (maybeBodiedExtension) {
229
229
  var end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
230
- if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && (0, _selection2.isSelectionAtStartOfNode)($head, maybeBodiedExtension)) {
230
+ if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && (0, _selection2.isSelectionAtStartOfNode)($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
231
231
  var anchor = end + 1;
232
232
 
233
233
  // an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
@@ -237,7 +237,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
237
237
  view.dispatch(tr.setSelection(newSelection));
238
238
  return true;
239
239
  }
240
- if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && (0, _selection2.isSelectionAtEndOfNode)($head, maybeBodiedExtension)) {
240
+ if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && (0, _selection2.isSelectionAtEndOfNode)($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
241
241
  var _anchor = maybeBodiedExtension.pos - 1;
242
242
  var _head = end + 1;
243
243
  var _newSelection = _state.TextSelection.create(doc, Math.min(_anchor, selection.anchor), _head);
@@ -176,7 +176,7 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
176
176
  const maybeBodiedExtension = selection instanceof TextSelection ? findParentNodeOfTypeClosestToPos($head, bodiedExtension) : findSelectedNodeOfType(bodiedExtension)(selection);
177
177
  if (maybeBodiedExtension) {
178
178
  const end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
179
- if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension)) {
179
+ if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
180
180
  const anchor = end + 1;
181
181
 
182
182
  // an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
@@ -186,7 +186,7 @@ export const createPlugin = (dispatch, providerFactory, extensionHandlers, porta
186
186
  view.dispatch(tr.setSelection(newSelection));
187
187
  return true;
188
188
  }
189
- if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension)) {
189
+ if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
190
190
  const anchor = maybeBodiedExtension.pos - 1;
191
191
  const head = end + 1;
192
192
  const newSelection = TextSelection.create(doc, Math.min(anchor, selection.anchor), head);
@@ -220,7 +220,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
220
220
  var maybeBodiedExtension = selection instanceof TextSelection ? findParentNodeOfTypeClosestToPos($head, bodiedExtension) : findSelectedNodeOfType(bodiedExtension)(selection);
221
221
  if (maybeBodiedExtension) {
222
222
  var end = maybeBodiedExtension.pos + maybeBodiedExtension.node.nodeSize;
223
- if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension)) {
223
+ if (event.key === 'ArrowUp' || event.key === 'ArrowLeft' && isSelectionAtStartOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
224
224
  var anchor = end + 1;
225
225
 
226
226
  // an offset is used here so that left arrow selects the first character before the node (consistent with arrow right)
@@ -230,7 +230,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, exten
230
230
  view.dispatch(tr.setSelection(newSelection));
231
231
  return true;
232
232
  }
233
- if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension)) {
233
+ if (event.key === 'ArrowDown' || event.key === 'ArrowRight' && isSelectionAtEndOfNode($head, maybeBodiedExtension === null || maybeBodiedExtension === void 0 ? void 0 : maybeBodiedExtension.node)) {
234
234
  var _anchor = maybeBodiedExtension.pos - 1;
235
235
  var _head = end + 1;
236
236
  var _newSelection = TextSelection.create(doc, Math.min(_anchor, selection.anchor), _head);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  "@atlaskit/button": "^21.1.0",
33
33
  "@atlaskit/checkbox": "^17.0.0",
34
34
  "@atlaskit/datetime-picker": "^16.1.0",
35
- "@atlaskit/editor-common": "^101.1.0",
35
+ "@atlaskit/editor-common": "^102.0.0",
36
36
  "@atlaskit/editor-json-transformer": "^8.24.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
38
38
  "@atlaskit/editor-plugin-context-identifier": "^2.0.0",
@@ -45,7 +45,7 @@
45
45
  "@atlaskit/editor-tables": "^2.9.0",
46
46
  "@atlaskit/empty-state": "^9.0.0",
47
47
  "@atlaskit/form": "^12.0.0",
48
- "@atlaskit/heading": "5.1.0",
48
+ "@atlaskit/heading": "^5.1.0",
49
49
  "@atlaskit/icon": "^24.1.0",
50
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
51
  "@atlaskit/primitives": "^14.1.0",