@atlaskit/editor-plugin-expand 0.4.3 → 0.4.4

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,11 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 0.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#67238](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67238) [`40533849b2ec`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/40533849b2ec) - [ED-21835] Change EditorAPI type to always union with undefined
8
+
3
9
  ## 0.4.3
4
10
 
5
11
  ### Patch Changes
@@ -21,11 +21,12 @@ var isExpandSelected = function isExpandSelected(selection) {
21
21
  function expandKeymap(api) {
22
22
  var list = {};
23
23
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.moveRight.common, function (state, dispatch, editorView) {
24
+ var _api$selection;
24
25
  if (!editorView) {
25
26
  return false;
26
27
  }
27
28
  var selection = state.selection;
28
- var selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
29
+ var selectionSharedState = (api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.sharedState.currentState()) || {};
29
30
  var selectionRelativeToNode = selectionSharedState.selectionRelativeToNode;
30
31
  if (isExpandSelected(selection) && selectionRelativeToNode === _selection.RelativeSelectionPos.Start) {
31
32
  return (0, _commands.focusTitle)(selection.from + 1)(state, dispatch, editorView);
@@ -33,11 +34,12 @@ function expandKeymap(api) {
33
34
  return false;
34
35
  }, list);
35
36
  (0, _keymaps.bindKeymapWithCommand)(_keymaps.moveLeft.common, function (state, dispatch, editorView) {
37
+ var _api$selection2;
36
38
  if (!editorView) {
37
39
  return false;
38
40
  }
39
41
  var selection = state.selection;
40
- var selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
42
+ var selectionSharedState = (api === null || api === void 0 || (_api$selection2 = api.selection) === null || _api$selection2 === void 0 ? void 0 : _api$selection2.sharedState.currentState()) || {};
41
43
  var selectionRelativeToNode = selectionSharedState.selectionRelativeToNode;
42
44
  if (isExpandSelected(selection) && (selectionRelativeToNode === undefined || selectionRelativeToNode === _selection.RelativeSelectionPos.End)) {
43
45
  return (0, _commands.focusTitle)(selection.from + 1)(state, dispatch, editorView);
@@ -14,13 +14,14 @@ const isExpandSelected = selection => selection instanceof NodeSelection && isEx
14
14
  export function expandKeymap(api) {
15
15
  const list = {};
16
16
  bindKeymapWithCommand(moveRight.common, (state, dispatch, editorView) => {
17
+ var _api$selection;
17
18
  if (!editorView) {
18
19
  return false;
19
20
  }
20
21
  const {
21
22
  selection
22
23
  } = state;
23
- const selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
24
+ const selectionSharedState = (api === null || api === void 0 ? void 0 : (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.sharedState.currentState()) || {};
24
25
  const {
25
26
  selectionRelativeToNode
26
27
  } = selectionSharedState;
@@ -30,13 +31,14 @@ export function expandKeymap(api) {
30
31
  return false;
31
32
  }, list);
32
33
  bindKeymapWithCommand(moveLeft.common, (state, dispatch, editorView) => {
34
+ var _api$selection2;
33
35
  if (!editorView) {
34
36
  return false;
35
37
  }
36
38
  const {
37
39
  selection
38
40
  } = state;
39
- const selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
41
+ const selectionSharedState = (api === null || api === void 0 ? void 0 : (_api$selection2 = api.selection) === null || _api$selection2 === void 0 ? void 0 : _api$selection2.sharedState.currentState()) || {};
40
42
  const {
41
43
  selectionRelativeToNode
42
44
  } = selectionSharedState;
@@ -16,11 +16,12 @@ var isExpandSelected = function isExpandSelected(selection) {
16
16
  export function expandKeymap(api) {
17
17
  var list = {};
18
18
  bindKeymapWithCommand(moveRight.common, function (state, dispatch, editorView) {
19
+ var _api$selection;
19
20
  if (!editorView) {
20
21
  return false;
21
22
  }
22
23
  var selection = state.selection;
23
- var selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
24
+ var selectionSharedState = (api === null || api === void 0 || (_api$selection = api.selection) === null || _api$selection === void 0 ? void 0 : _api$selection.sharedState.currentState()) || {};
24
25
  var selectionRelativeToNode = selectionSharedState.selectionRelativeToNode;
25
26
  if (isExpandSelected(selection) && selectionRelativeToNode === RelativeSelectionPos.Start) {
26
27
  return focusTitle(selection.from + 1)(state, dispatch, editorView);
@@ -28,11 +29,12 @@ export function expandKeymap(api) {
28
29
  return false;
29
30
  }, list);
30
31
  bindKeymapWithCommand(moveLeft.common, function (state, dispatch, editorView) {
32
+ var _api$selection2;
31
33
  if (!editorView) {
32
34
  return false;
33
35
  }
34
36
  var selection = state.selection;
35
- var selectionSharedState = (api === null || api === void 0 ? void 0 : api.selection.sharedState.currentState()) || {};
37
+ var selectionSharedState = (api === null || api === void 0 || (_api$selection2 = api.selection) === null || _api$selection2 === void 0 ? void 0 : _api$selection2.sharedState.currentState()) || {};
36
38
  var selectionRelativeToNode = selectionSharedState.selectionRelativeToNode;
37
39
  if (isExpandSelected(selection) && (selectionRelativeToNode === undefined || selectionRelativeToNode === RelativeSelectionPos.End)) {
38
40
  return focusTitle(selection.from + 1)(state, dispatch, editorView);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "releaseModel": "continuous",
15
15
  "runReact18": false
16
16
  },
17
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
18
  "main": "dist/cjs/index.js",
19
19
  "module": "dist/esm/index.js",
20
20
  "module:es2019": "dist/es2019/index.js",