@atlaskit/editor-plugin-selection 6.1.9 → 6.1.10

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,12 @@
1
1
  # @atlaskit/editor-plugin-selection
2
2
 
3
+ ## 6.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b2d4f27035ac9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2d4f27035ac9) -
8
+ [ux] [EDITOR-3095] Follow up bug fix to cleanup platform_editor_fix_list_item_nav_bug_in_layout fg
9
+
3
10
  ## 6.1.9
4
11
 
5
12
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.isSelectionAtStartOfParentNode = exports.isSelectionAtEndOfParentNode = exports.isSelectionAtEndOfLayoutColumn = exports.isSelectableContainerNode = exports.isSelectableChildNode = exports.isListItemWithinContainerNotAtEnd = exports.isLayoutColumnNode = exports.isContainerNode = exports.getNodesToDecorateFromSelection = exports.getDecorations = exports.findTopLevelList = exports.findSelectableContainerParent = exports.findSelectableContainerBefore = exports.findSelectableContainerAfter = exports.findLastChildNodeToSelect = exports.findFirstChildNodeToSelect = void 0;
7
+ exports.isSelectionAtStartOfParentNode = exports.isSelectionAtEndOfParentNode = exports.isSelectionAtEndOfLayoutColumn = exports.isSelectableContainerNode = exports.isSelectableChildNode = exports.isPanelOrExpandNode = exports.isListItemWithinContainerNotAtEnd = exports.isLayoutColumnNode = exports.isContainerNode = exports.getNodesToDecorateFromSelection = exports.getDecorations = exports.findTopLevelList = exports.findSelectableContainerParent = exports.findSelectableContainerBefore = exports.findSelectableContainerAfter = exports.findLastChildNodeToSelect = exports.findFirstChildNodeToSelect = void 0;
8
8
  exports.shouldRecalcDecorations = shouldRecalcDecorations;
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _selection = require("@atlaskit/editor-common/selection");
@@ -362,6 +362,10 @@ var isSelectionAtEndOfLayoutColumn = exports.isSelectionAtEndOfLayoutColumn = fu
362
362
  if (!layoutColumnParent) {
363
363
  return false;
364
364
  }
365
+ var panelOrExpandParent = (0, _utils2.findParentNodeClosestToPos)($pos, isPanelOrExpandNode);
366
+ if (panelOrExpandParent && panelOrExpandParent.pos > layoutColumnParent.pos && (0, _platformFeatureFlags.fg)('platform_editor_fix_list_item_nav_bug_in_layout')) {
367
+ return false;
368
+ }
365
369
  var grandParentDepth = $pos.depth - 1;
366
370
  if (grandParentDepth < 0) {
367
371
  return false;
@@ -384,4 +388,11 @@ var isLayoutColumnNode = exports.isLayoutColumnNode = function isLayoutColumnNod
384
388
  var _ref4 = (node === null || node === void 0 || (_node$type2 = node.type) === null || _node$type2 === void 0 || (_node$type2 = _node$type2.schema) === null || _node$type2 === void 0 ? void 0 : _node$type2.nodes) || {},
385
389
  layoutColumn = _ref4.layoutColumn;
386
390
  return Boolean(node && node.type && node.type === layoutColumn);
391
+ };
392
+ var isPanelOrExpandNode = exports.isPanelOrExpandNode = function isPanelOrExpandNode(node) {
393
+ var _node$type3;
394
+ var _ref5 = (node === null || node === void 0 || (_node$type3 = node.type) === null || _node$type3 === void 0 || (_node$type3 = _node$type3.schema) === null || _node$type3 === void 0 ? void 0 : _node$type3.nodes) || {},
395
+ panel = _ref5.panel,
396
+ expand = _ref5.expand;
397
+ return Boolean(node && node.type && (node.type === panel || node.type === expand));
387
398
  };
@@ -351,6 +351,10 @@ export const isSelectionAtEndOfLayoutColumn = $pos => {
351
351
  if (!layoutColumnParent) {
352
352
  return false;
353
353
  }
354
+ const panelOrExpandParent = findParentNodeClosestToPos($pos, isPanelOrExpandNode);
355
+ if (panelOrExpandParent && panelOrExpandParent.pos > layoutColumnParent.pos && fg('platform_editor_fix_list_item_nav_bug_in_layout')) {
356
+ return false;
357
+ }
354
358
  const grandParentDepth = $pos.depth - 1;
355
359
  if (grandParentDepth < 0) {
356
360
  return false;
@@ -376,4 +380,12 @@ export const isLayoutColumnNode = node => {
376
380
  layoutColumn
377
381
  } = (node === null || node === void 0 ? void 0 : (_node$type2 = node.type) === null || _node$type2 === void 0 ? void 0 : (_node$type2$schema = _node$type2.schema) === null || _node$type2$schema === void 0 ? void 0 : _node$type2$schema.nodes) || {};
378
382
  return Boolean(node && node.type && node.type === layoutColumn);
383
+ };
384
+ export const isPanelOrExpandNode = node => {
385
+ var _node$type3, _node$type3$schema;
386
+ const {
387
+ panel,
388
+ expand
389
+ } = (node === null || node === void 0 ? void 0 : (_node$type3 = node.type) === null || _node$type3 === void 0 ? void 0 : (_node$type3$schema = _node$type3.schema) === null || _node$type3$schema === void 0 ? void 0 : _node$type3$schema.nodes) || {};
390
+ return Boolean(node && node.type && (node.type === panel || node.type === expand));
379
391
  };
@@ -354,6 +354,10 @@ export var isSelectionAtEndOfLayoutColumn = function isSelectionAtEndOfLayoutCol
354
354
  if (!layoutColumnParent) {
355
355
  return false;
356
356
  }
357
+ var panelOrExpandParent = findParentNodeClosestToPos($pos, isPanelOrExpandNode);
358
+ if (panelOrExpandParent && panelOrExpandParent.pos > layoutColumnParent.pos && fg('platform_editor_fix_list_item_nav_bug_in_layout')) {
359
+ return false;
360
+ }
357
361
  var grandParentDepth = $pos.depth - 1;
358
362
  if (grandParentDepth < 0) {
359
363
  return false;
@@ -376,4 +380,11 @@ export var isLayoutColumnNode = function isLayoutColumnNode(node) {
376
380
  var _ref4 = (node === null || node === void 0 || (_node$type2 = node.type) === null || _node$type2 === void 0 || (_node$type2 = _node$type2.schema) === null || _node$type2 === void 0 ? void 0 : _node$type2.nodes) || {},
377
381
  layoutColumn = _ref4.layoutColumn;
378
382
  return Boolean(node && node.type && node.type === layoutColumn);
383
+ };
384
+ export var isPanelOrExpandNode = function isPanelOrExpandNode(node) {
385
+ var _node$type3;
386
+ var _ref5 = (node === null || node === void 0 || (_node$type3 = node.type) === null || _node$type3 === void 0 || (_node$type3 = _node$type3.schema) === null || _node$type3 === void 0 ? void 0 : _node$type3.nodes) || {},
387
+ panel = _ref5.panel,
388
+ expand = _ref5.expand;
389
+ return Boolean(node && node.type && (node.type === panel || node.type === expand));
379
390
  };
@@ -84,3 +84,4 @@ export declare const isSelectionAtEndOfLayoutColumn: ($pos: ResolvedPos) => bool
84
84
  * Determines if the given node is a LayoutColumn node.
85
85
  */
86
86
  export declare const isLayoutColumnNode: (node: PmNode | null | undefined) => boolean;
87
+ export declare const isPanelOrExpandNode: (node: PmNode | null | undefined) => boolean;
@@ -84,3 +84,4 @@ export declare const isSelectionAtEndOfLayoutColumn: ($pos: ResolvedPos) => bool
84
84
  * Determines if the given node is a LayoutColumn node.
85
85
  */
86
86
  export declare const isLayoutColumnNode: (node: PmNode | null | undefined) => boolean;
87
+ export declare const isPanelOrExpandNode: (node: PmNode | null | undefined) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-selection",
3
- "version": "6.1.9",
3
+ "version": "6.1.10",
4
4
  "description": "Selection plugin for @atlaskit/editor-core",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,7 +30,7 @@
30
30
  "@babel/runtime": "^7.0.0"
31
31
  },
32
32
  "peerDependencies": {
33
- "@atlaskit/editor-common": "^110.38.0",
33
+ "@atlaskit/editor-common": "^110.39.0",
34
34
  "react": "^18.2.0"
35
35
  },
36
36
  "techstack": {