@atlaskit/editor-plugin-block-controls 11.0.0 → 11.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,21 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 11.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`140f356e0c8c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/140f356e0c8c5) -
8
+ Fix RangeError: Position -1 outside of fragment when activeNode.rootPos is undefined
9
+ (keyboard-triggered drag handle). Guarded behind platform_editor_block_menu_jira_patch_1 feature
10
+ gate.
11
+ - Updated dependencies
12
+
13
+ ## 11.0.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 11.0.0
4
20
 
5
21
  ### Major Changes
@@ -398,7 +398,10 @@ var _apply = exports.apply = function apply(api, formatMessage, tr, currentState
398
398
  } else {
399
399
  if (latestActiveNode && (!isActiveNodeDeleted || isReplacedWithSameSize)) {
400
400
  var _nodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.pos, to);
401
- var rootNodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
401
+ // Guard against rootPos being undefined (keyboard-triggered handles do not set it),
402
+ // which would cause a RangeError in ProseMirror. When the gate is off, the original
403
+ // behaviour is preserved for safe incremental rollout.
404
+ var rootNodeDecAtActivePos = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_jira_patch_1') ? latestActiveNode.rootPos !== undefined ? getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to) : undefined : getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
402
405
  if (_nodeDecAtActivePos || rootNodeDecAtActivePos) {
403
406
  isActiveNodeModified = true;
404
407
  }
@@ -387,7 +387,10 @@ export const apply = (api, formatMessage, tr, currentState, newState, flags, nod
387
387
  } else {
388
388
  if (latestActiveNode && (!isActiveNodeDeleted || isReplacedWithSameSize)) {
389
389
  const nodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.pos, to);
390
- const rootNodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
390
+ // Guard against rootPos being undefined (keyboard-triggered handles do not set it),
391
+ // which would cause a RangeError in ProseMirror. When the gate is off, the original
392
+ // behaviour is preserved for safe incremental rollout.
393
+ const rootNodeDecAtActivePos = fg('platform_editor_block_menu_jira_patch_1') ? latestActiveNode.rootPos !== undefined ? getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to) : undefined : getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
391
394
  if (nodeDecAtActivePos || rootNodeDecAtActivePos) {
392
395
  isActiveNodeModified = true;
393
396
  }
@@ -391,7 +391,10 @@ var _apply = function apply(api, formatMessage, tr, currentState, newState, flag
391
391
  } else {
392
392
  if (latestActiveNode && (!isActiveNodeDeleted || isReplacedWithSameSize)) {
393
393
  var _nodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.pos, to);
394
- var rootNodeDecAtActivePos = getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
394
+ // Guard against rootPos being undefined (keyboard-triggered handles do not set it),
395
+ // which would cause a RangeError in ProseMirror. When the gate is off, the original
396
+ // behaviour is preserved for safe incremental rollout.
397
+ var rootNodeDecAtActivePos = fg('platform_editor_block_menu_jira_patch_1') ? latestActiveNode.rootPos !== undefined ? getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to) : undefined : getDecorationAtPos(newState, decorations, latestActiveNode.rootPos, to);
395
398
  if (_nodeDecAtActivePos || rootNodeDecAtActivePos) {
396
399
  isActiveNodeModified = true;
397
400
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -51,12 +51,12 @@
51
51
  "@atlaskit/icon-lab": "^6.5.0",
52
52
  "@atlaskit/link": "^3.4.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
- "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
54
+ "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
56
56
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
57
57
  "@atlaskit/primitives": "^19.0.0",
58
58
  "@atlaskit/theme": "^23.1.0",
59
- "@atlaskit/tmp-editor-statsig": "^62.4.0",
59
+ "@atlaskit/tmp-editor-statsig": "^63.0.0",
60
60
  "@atlaskit/tokens": "^13.0.0",
61
61
  "@atlaskit/tooltip": "^21.1.0",
62
62
  "@babel/runtime": "^7.0.0",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^114.0.0",
70
+ "@atlaskit/editor-common": "^114.3.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"