@atlaskit/editor-plugin-block-menu 29.0.2 → 29.0.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,20 @@
1
1
  # @atlaskit/editor-plugin-block-menu
2
2
 
3
+ ## 29.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c5b599e3bc90a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c5b599e3bc90a) -
8
+ Remove unused internal code and replace loose plugin state return types with PluginState. No
9
+ behaviour change.
10
+ - Updated dependencies
11
+
12
+ ## 29.0.3
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 29.0.2
4
19
 
5
20
  ### Patch Changes
@@ -3,9 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.BLOCK_MENU_LABEL = exports.BLOCK_MENU_ITEM_NAME = void 0;
7
- var BLOCK_MENU_LABEL = exports.BLOCK_MENU_LABEL = 'Editor Block Menu';
8
-
6
+ exports.BLOCK_MENU_ITEM_NAME = void 0;
9
7
  /**
10
8
  * Constants for block menu analytics menu item names
11
9
  */
@@ -1,5 +1,3 @@
1
- export const BLOCK_MENU_LABEL = 'Editor Block Menu';
2
-
3
1
  /**
4
2
  * Constants for block menu analytics menu item names
5
3
  */
@@ -1,5 +1,3 @@
1
- export var BLOCK_MENU_LABEL = 'Editor Block Menu';
2
-
3
1
  /**
4
2
  * Constants for block menu analytics menu item names
5
3
  */
@@ -1,4 +1,3 @@
1
- export declare const BLOCK_MENU_LABEL = "Editor Block Menu";
2
1
  /**
3
2
  * Constants for block menu analytics menu item names
4
3
  */
@@ -33,7 +33,6 @@ export declare const BLOCK_MENU_NODE_TYPES: {
33
33
  readonly TABLE: NodeTypeName;
34
34
  readonly TASK_LIST: NodeTypeName;
35
35
  };
36
- export type BlockMenuNodeType = (typeof BLOCK_MENU_NODE_TYPES)[keyof typeof BLOCK_MENU_NODE_TYPES];
37
36
  export type SuggestedItemsRankMap = {
38
37
  [nodeType: string]: {
39
38
  [menuItemKey: string]: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "29.0.2",
3
+ "version": "29.0.4",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,14 +42,14 @@
42
42
  "@atlaskit/platform-feature-flags": "^2.2.0",
43
43
  "@atlaskit/primitives": "^22.6.0",
44
44
  "@atlaskit/prosemirror-history": "^1.3.0",
45
- "@atlaskit/tmp-editor-statsig": "^247.0.0",
45
+ "@atlaskit/tmp-editor-statsig": "^248.0.0",
46
46
  "@atlaskit/tokens": "^20.8.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "bind-event-listener": "^3.0.0",
49
49
  "memoize-one": "^6.0.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@atlaskit/editor-common": "^134.0.0",
52
+ "@atlaskit/editor-common": "^134.1.0",
53
53
  "react": "^18.2.0 || ^19.2.0",
54
54
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
55
55
  },
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.setSelectionAfterTransform = void 0;
7
- var _state = require("@atlaskit/editor-prosemirror/state");
8
- var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
9
- /**
10
- * Sets the appropriate selection after transforming a node to a target type
11
- * @param newTr - The transaction containing the transformed node
12
- * @param nodePos - The position of the transformed node
13
- * @param targetType - The target type the node was transformed to
14
- * @returns The transaction with the updated selection, or the original transaction if no selection change needed
15
- */
16
- var setSelectionAfterTransform = exports.setSelectionAfterTransform = function setSelectionAfterTransform(newTr, nodePos, targetType) {
17
- // Find the actual node that was transformed to get its positioning
18
- var transformedNodePos = newTr.doc.resolve(nodePos);
19
- var transformedNode = transformedNodePos.nodeAfter;
20
- if (!transformedNode) {
21
- return newTr;
22
- }
23
-
24
- // Check if target type is other than list, text, heading, blockquotes
25
- var isListNode = targetType === 'bulletList' || targetType === 'orderedList' || targetType === 'taskList';
26
- var isBlockquote = targetType === 'blockquote';
27
- var isContainer = (0, _expValEquals.expValEquals)('platform_editor_nest_table_in_panel', 'isEnabled', true) ? ['panel', 'panel_c1', 'expand', 'codeBlock', 'layoutSection'].includes(targetType) : ['panel', 'expand', 'codeBlock', 'layoutSection'].includes(targetType);
28
- if (isListNode || isBlockquote) {
29
- // For taskList, select all content within the list
30
- var textStart = transformedNodePos.pos + 1; // Inside the taskList
31
- var textEnd = transformedNodePos.pos + transformedNode.nodeSize - 1; // End of taskList content
32
- var textSelection = _state.TextSelection.between(newTr.doc.resolve(textStart), newTr.doc.resolve(textEnd));
33
- return newTr.setSelection(textSelection);
34
- } else if (isContainer) {
35
- // Use NodeSelection for types other than list, text, heading, blockquotes
36
- var nodeSelection = _state.NodeSelection.create(newTr.doc, transformedNodePos.pos);
37
- return newTr.setSelection(nodeSelection);
38
- }
39
- return newTr;
40
- };
@@ -1,34 +0,0 @@
1
- import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
- /**
4
- * Sets the appropriate selection after transforming a node to a target type
5
- * @param newTr - The transaction containing the transformed node
6
- * @param nodePos - The position of the transformed node
7
- * @param targetType - The target type the node was transformed to
8
- * @returns The transaction with the updated selection, or the original transaction if no selection change needed
9
- */
10
- export const setSelectionAfterTransform = (newTr, nodePos, targetType) => {
11
- // Find the actual node that was transformed to get its positioning
12
- const transformedNodePos = newTr.doc.resolve(nodePos);
13
- const transformedNode = transformedNodePos.nodeAfter;
14
- if (!transformedNode) {
15
- return newTr;
16
- }
17
-
18
- // Check if target type is other than list, text, heading, blockquotes
19
- const isListNode = targetType === 'bulletList' || targetType === 'orderedList' || targetType === 'taskList';
20
- const isBlockquote = targetType === 'blockquote';
21
- const isContainer = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? ['panel', 'panel_c1', 'expand', 'codeBlock', 'layoutSection'].includes(targetType) : ['panel', 'expand', 'codeBlock', 'layoutSection'].includes(targetType);
22
- if (isListNode || isBlockquote) {
23
- // For taskList, select all content within the list
24
- const textStart = transformedNodePos.pos + 1; // Inside the taskList
25
- const textEnd = transformedNodePos.pos + transformedNode.nodeSize - 1; // End of taskList content
26
- const textSelection = TextSelection.between(newTr.doc.resolve(textStart), newTr.doc.resolve(textEnd));
27
- return newTr.setSelection(textSelection);
28
- } else if (isContainer) {
29
- // Use NodeSelection for types other than list, text, heading, blockquotes
30
- const nodeSelection = NodeSelection.create(newTr.doc, transformedNodePos.pos);
31
- return newTr.setSelection(nodeSelection);
32
- }
33
- return newTr;
34
- };
@@ -1,34 +0,0 @@
1
- import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
2
- import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
3
- /**
4
- * Sets the appropriate selection after transforming a node to a target type
5
- * @param newTr - The transaction containing the transformed node
6
- * @param nodePos - The position of the transformed node
7
- * @param targetType - The target type the node was transformed to
8
- * @returns The transaction with the updated selection, or the original transaction if no selection change needed
9
- */
10
- export var setSelectionAfterTransform = function setSelectionAfterTransform(newTr, nodePos, targetType) {
11
- // Find the actual node that was transformed to get its positioning
12
- var transformedNodePos = newTr.doc.resolve(nodePos);
13
- var transformedNode = transformedNodePos.nodeAfter;
14
- if (!transformedNode) {
15
- return newTr;
16
- }
17
-
18
- // Check if target type is other than list, text, heading, blockquotes
19
- var isListNode = targetType === 'bulletList' || targetType === 'orderedList' || targetType === 'taskList';
20
- var isBlockquote = targetType === 'blockquote';
21
- var isContainer = expValEquals('platform_editor_nest_table_in_panel', 'isEnabled', true) ? ['panel', 'panel_c1', 'expand', 'codeBlock', 'layoutSection'].includes(targetType) : ['panel', 'expand', 'codeBlock', 'layoutSection'].includes(targetType);
22
- if (isListNode || isBlockquote) {
23
- // For taskList, select all content within the list
24
- var textStart = transformedNodePos.pos + 1; // Inside the taskList
25
- var textEnd = transformedNodePos.pos + transformedNode.nodeSize - 1; // End of taskList content
26
- var textSelection = TextSelection.between(newTr.doc.resolve(textStart), newTr.doc.resolve(textEnd));
27
- return newTr.setSelection(textSelection);
28
- } else if (isContainer) {
29
- // Use NodeSelection for types other than list, text, heading, blockquotes
30
- var nodeSelection = NodeSelection.create(newTr.doc, transformedNodePos.pos);
31
- return newTr.setSelection(nodeSelection);
32
- }
33
- return newTr;
34
- };
@@ -1,10 +0,0 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { TransfromNodeTargetType } from './types';
3
- /**
4
- * Sets the appropriate selection after transforming a node to a target type
5
- * @param newTr - The transaction containing the transformed node
6
- * @param nodePos - The position of the transformed node
7
- * @param targetType - The target type the node was transformed to
8
- * @returns The transaction with the updated selection, or the original transaction if no selection change needed
9
- */
10
- export declare const setSelectionAfterTransform: (newTr: Transaction, nodePos: number, targetType: TransfromNodeTargetType) => Transaction;