@atlaskit/editor-plugin-expand 7.4.13 → 7.4.15

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-expand
2
2
 
3
+ ## 7.4.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.4.14
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f1f7fc05afab1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1f7fc05afab1) -
14
+ [ux] EDITOR-2461 Set selection in expand title when using arrow key to navigate into expand
15
+ - Updated dependencies
16
+
3
17
  ## 7.4.13
4
18
 
5
19
  ### Patch Changes
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expandKeymap = expandKeymap;
7
+ var _expand2 = require("@atlaskit/editor-common/expand");
7
8
  var _keymaps = require("@atlaskit/editor-common/keymaps");
8
9
  var _selection = require("@atlaskit/editor-common/selection");
9
10
  var _transforms = require("@atlaskit/editor-common/transforms");
@@ -11,6 +12,7 @@ var _utils = require("@atlaskit/editor-common/utils");
11
12
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
12
13
  var _state = require("@atlaskit/editor-prosemirror/state");
13
14
  var _utils2 = require("@atlaskit/editor-tables/utils");
15
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
14
16
  var _commands = require("../commands");
15
17
  var isExpandNode = function isExpandNode(node) {
16
18
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -143,6 +145,12 @@ function expandKeymap(api, options) {
143
145
  var $from = selection.$from;
144
146
  return (0, _commands.focusTitle)($from.pos + 1)(state, dispatch, editorView);
145
147
  }
148
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
149
+ var nextExpandPos = (0, _expand2.getNextNodeExpandPos)(editorView, selection);
150
+ if (nextExpandPos !== undefined) {
151
+ return (0, _commands.focusTitle)(nextExpandPos)(state, dispatch, editorView);
152
+ }
153
+ }
146
154
  if (editorView.endOfTextblock('down')) {
147
155
  var _$from2 = state.selection.$from;
148
156
  if (_$from2.depth === 0) {
@@ -73,9 +73,7 @@ var expandPlugin = exports.expandPlugin = function expandPlugin(_ref) {
73
73
  }, {
74
74
  name: 'expandKeymap',
75
75
  plugin: function plugin() {
76
- return (0, _keymap.expandKeymap)(api, {
77
- __livePage: options.__livePage
78
- });
76
+ return (0, _keymap.expandKeymap)(api);
79
77
  }
80
78
  }];
81
79
  },
@@ -12,6 +12,7 @@ var _utils = require("@atlaskit/editor-common/utils");
12
12
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
13
13
  var _state = require("@atlaskit/editor-prosemirror/state");
14
14
  var _utils2 = require("@atlaskit/editor-tables/utils");
15
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
15
16
  var _commands = require("../commands");
16
17
  var isExpandNode = function isExpandNode(node) {
17
18
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -19,7 +20,7 @@ var isExpandNode = function isExpandNode(node) {
19
20
  var isExpandSelected = function isExpandSelected(selection) {
20
21
  return selection instanceof _state.NodeSelection && isExpandNode(selection.node);
21
22
  };
22
- function expandKeymap(api, options) {
23
+ function expandKeymap(api) {
23
24
  var list = {};
24
25
  (0, _keymaps.bindKeymapWithCommand)(
25
26
  // Ignored via go/ees005
@@ -144,6 +145,12 @@ function expandKeymap(api, options) {
144
145
  var $from = selection.$from;
145
146
  return (0, _commands.focusTitle)($from.pos + 1)(state, dispatch, editorView);
146
147
  }
148
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
149
+ var nextExpandPos = (0, _expand2.getNextNodeExpandPos)(editorView, selection);
150
+ if (nextExpandPos !== undefined) {
151
+ return (0, _commands.focusTitle)(nextExpandPos)(state, dispatch, editorView);
152
+ }
153
+ }
147
154
  if (editorView.endOfTextblock('down')) {
148
155
  var _$from2 = state.selection.$from;
149
156
  if (_$from2.depth === 0) {
@@ -1,3 +1,4 @@
1
+ import { getNextNodeExpandPos } from '@atlaskit/editor-common/expand';
1
2
  import { backspace, bindKeymapWithCommand, moveDown, moveLeft, moveRight, moveUp, tab } from '@atlaskit/editor-common/keymaps';
2
3
  import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
3
4
  import { findExpand } from '@atlaskit/editor-common/transforms';
@@ -5,6 +6,7 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
5
6
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
7
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
8
  import { isInTable } from '@atlaskit/editor-tables/utils';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
8
10
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
9
11
  const isExpandNode = node => {
10
12
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -160,6 +162,12 @@ export function expandKeymap(api, options) {
160
162
  } = selection;
161
163
  return focusTitle($from.pos + 1)(state, dispatch, editorView);
162
164
  }
165
+ if (expValEqualsNoExposure('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
166
+ const nextExpandPos = getNextNodeExpandPos(editorView, selection);
167
+ if (nextExpandPos !== undefined) {
168
+ return focusTitle(nextExpandPos)(state, dispatch, editorView);
169
+ }
170
+ }
163
171
  if (editorView.endOfTextblock('down')) {
164
172
  const {
165
173
  $from
@@ -65,9 +65,7 @@ export let expandPlugin = ({
65
65
  }
66
66
  }, {
67
67
  name: 'expandKeymap',
68
- plugin: () => expandKeymap(api, {
69
- __livePage: options.__livePage
70
- })
68
+ plugin: () => expandKeymap(api)
71
69
  }];
72
70
  },
73
71
  pluginsOptions: {
@@ -1,4 +1,4 @@
1
- import { isExpandCollapsed } from '@atlaskit/editor-common/expand';
1
+ import { getNextNodeExpandPos, isExpandCollapsed } from '@atlaskit/editor-common/expand';
2
2
  import { backspace, bindKeymapWithCommand, moveDown, moveLeft, moveRight, moveUp, tab } from '@atlaskit/editor-common/keymaps';
3
3
  import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
4
4
  import { findExpand } from '@atlaskit/editor-common/transforms';
@@ -6,12 +6,13 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
6
6
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
7
7
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { isInTable } from '@atlaskit/editor-tables/utils';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
10
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
10
11
  const isExpandNode = node => {
11
12
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
12
13
  };
13
14
  const isExpandSelected = selection => selection instanceof NodeSelection && isExpandNode(selection.node);
14
- export function expandKeymap(api, options) {
15
+ export function expandKeymap(api) {
15
16
  const list = {};
16
17
  bindKeymapWithCommand(
17
18
  // Ignored via go/ees005
@@ -161,6 +162,12 @@ export function expandKeymap(api, options) {
161
162
  } = selection;
162
163
  return focusTitle($from.pos + 1)(state, dispatch, editorView);
163
164
  }
165
+ if (expValEqualsNoExposure('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
166
+ const nextExpandPos = getNextNodeExpandPos(editorView, selection);
167
+ if (nextExpandPos !== undefined) {
168
+ return focusTitle(nextExpandPos)(state, dispatch, editorView);
169
+ }
170
+ }
164
171
  if (editorView.endOfTextblock('down')) {
165
172
  const {
166
173
  $from
@@ -1,3 +1,4 @@
1
+ import { getNextNodeExpandPos } from '@atlaskit/editor-common/expand';
1
2
  import { backspace, bindKeymapWithCommand, moveDown, moveLeft, moveRight, moveUp, tab } from '@atlaskit/editor-common/keymaps';
2
3
  import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
3
4
  import { findExpand } from '@atlaskit/editor-common/transforms';
@@ -5,6 +6,7 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
5
6
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
7
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
8
  import { isInTable } from '@atlaskit/editor-tables/utils';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
8
10
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
9
11
  var isExpandNode = function isExpandNode(node) {
10
12
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -137,6 +139,12 @@ export function expandKeymap(api, options) {
137
139
  var $from = selection.$from;
138
140
  return focusTitle($from.pos + 1)(state, dispatch, editorView);
139
141
  }
142
+ if (expValEqualsNoExposure('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
143
+ var nextExpandPos = getNextNodeExpandPos(editorView, selection);
144
+ if (nextExpandPos !== undefined) {
145
+ return focusTitle(nextExpandPos)(state, dispatch, editorView);
146
+ }
147
+ }
140
148
  if (editorView.endOfTextblock('down')) {
141
149
  var _$from2 = state.selection.$from;
142
150
  if (_$from2.depth === 0) {
@@ -67,9 +67,7 @@ export var expandPlugin = function expandPlugin(_ref) {
67
67
  }, {
68
68
  name: 'expandKeymap',
69
69
  plugin: function plugin() {
70
- return expandKeymap(api, {
71
- __livePage: options.__livePage
72
- });
70
+ return expandKeymap(api);
73
71
  }
74
72
  }];
75
73
  },
@@ -1,4 +1,4 @@
1
- import { isExpandCollapsed } from '@atlaskit/editor-common/expand';
1
+ import { getNextNodeExpandPos, isExpandCollapsed } from '@atlaskit/editor-common/expand';
2
2
  import { backspace, bindKeymapWithCommand, moveDown, moveLeft, moveRight, moveUp, tab } from '@atlaskit/editor-common/keymaps';
3
3
  import { GapCursorSelection, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
4
4
  import { findExpand } from '@atlaskit/editor-common/transforms';
@@ -6,6 +6,7 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
6
6
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
7
7
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
8
8
  import { isInTable } from '@atlaskit/editor-tables/utils';
9
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
10
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
10
11
  var isExpandNode = function isExpandNode(node) {
11
12
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -13,7 +14,7 @@ var isExpandNode = function isExpandNode(node) {
13
14
  var isExpandSelected = function isExpandSelected(selection) {
14
15
  return selection instanceof NodeSelection && isExpandNode(selection.node);
15
16
  };
16
- export function expandKeymap(api, options) {
17
+ export function expandKeymap(api) {
17
18
  var list = {};
18
19
  bindKeymapWithCommand(
19
20
  // Ignored via go/ees005
@@ -138,6 +139,12 @@ export function expandKeymap(api, options) {
138
139
  var $from = selection.$from;
139
140
  return focusTitle($from.pos + 1)(state, dispatch, editorView);
140
141
  }
142
+ if (expValEqualsNoExposure('platform_editor_lovability_navigation_fixes', 'isEnabled', true)) {
143
+ var nextExpandPos = getNextNodeExpandPos(editorView, selection);
144
+ if (nextExpandPos !== undefined) {
145
+ return focusTitle(nextExpandPos)(state, dispatch, editorView);
146
+ }
147
+ }
141
148
  if (editorView.endOfTextblock('down')) {
142
149
  var _$from2 = state.selection.$from;
143
150
  if (_$from2.depth === 0) {
@@ -1,6 +1,4 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { ExpandPlugin } from '../../types';
4
- export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined, options: {
5
- __livePage?: boolean;
6
- }): SafePlugin;
4
+ export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined): SafePlugin;
@@ -1,6 +1,4 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
3
  import type { ExpandPlugin } from '../../types';
4
- export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined, options: {
5
- __livePage?: boolean;
6
- }): SafePlugin;
4
+ export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined): SafePlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "7.4.13",
3
+ "version": "7.4.15",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -48,16 +48,16 @@
48
48
  "@atlaskit/icon-lab": "^5.12.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/prosemirror-history": "^0.2.0",
51
- "@atlaskit/tmp-editor-statsig": "^14.5.0",
51
+ "@atlaskit/tmp-editor-statsig": "^15.0.0",
52
52
  "@atlaskit/tokens": "^8.4.0",
53
- "@atlaskit/tooltip": "^20.10.0",
53
+ "@atlaskit/tooltip": "^20.11.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
56
56
  "uuid": "^3.1.0",
57
57
  "w3c-keyname": "^2.1.8"
58
58
  },
59
59
  "peerDependencies": {
60
- "@atlaskit/editor-common": "^110.38.0",
60
+ "@atlaskit/editor-common": "^110.40.0",
61
61
  "react": "^18.2.0",
62
62
  "react-dom": "^18.2.0",
63
63
  "react-intl-next": "npm:react-intl@^5.18.1"