@atlaskit/editor-plugin-block-menu 6.0.27 → 6.0.28

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.
@@ -0,0 +1,62 @@
1
+ import { type ExperienceCheckResult } from '@atlaskit/editor-common/experiences';
2
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
+ /**
4
+ * Checks if the given element or any of its ancestors is a drag handle element.
5
+ *
6
+ * @param element - The DOM element to check.
7
+ * @returns True if the element is a drag handle, false otherwise.
8
+ */
9
+ export declare const isDragHandleElement: (element: Element | null) => boolean;
10
+ /**
11
+ * Checks if the block menu is currently visible within the provided popups target element.
12
+ *
13
+ * @param popupsTarget - The container element for popups.
14
+ * @returns True if the block menu is visible, false otherwise.
15
+ */
16
+ export declare const isBlockMenuVisible: (popupsTarget: HTMLElement | undefined) => boolean;
17
+ /**
18
+ * Gets the parent DOM element at the starting position of the current selection
19
+ * from the provided editor view.
20
+ *
21
+ * @param editorView - The editor view from which to get the parent DOM element
22
+ * @returns The parent HTMLElement at the selection start, or null if not found
23
+ */
24
+ export declare const getParentDOMAtSelection: (editorView?: EditorView) => HTMLElement | null;
25
+ /**
26
+ * Handles DOM mutations to determine if the block menu was opened
27
+ *
28
+ * This function looks for mutations that indicate the block menu
29
+ * has been added to the DOM.
30
+ *
31
+ * @param mutations - The list of DOM mutations to evaluate
32
+ * @returns An ExperienceCheckResult indicating success if the menu was opened, otherwise undefined
33
+ */
34
+ export declare const handleMenuOpenDomMutation: ({ mutations, }: {
35
+ mutations: MutationRecord[];
36
+ }) => ExperienceCheckResult | undefined;
37
+ /**
38
+ * Handles DOM mutations to determine if a move action was performed
39
+ *
40
+ * Move actions typically produce two mutations: one where nodes are removed
41
+ * from their original location, and another where the same number of nodes are
42
+ * added to a new location. This function checks for that pattern.
43
+ *
44
+ * @param mutations - The list of DOM mutations to evaluate
45
+ * @returns An ExperienceCheckResult indicating success if a move was detected, otherwise undefined
46
+ */
47
+ export declare const handleMoveDomMutation: ({ mutations, }: {
48
+ mutations: MutationRecord[];
49
+ }) => ExperienceCheckResult | undefined;
50
+ /**
51
+ * Handles DOM mutations to determine if a delete action was performed
52
+ *
53
+ * Delete actions typically produce a single mutation where nodes are removed
54
+ * from the DOM without any corresponding additions. This function checks for
55
+ * that specific pattern.
56
+ *
57
+ * @param mutations - The list of DOM mutations to evaluate
58
+ * @returns An ExperienceCheckResult indicating success if a delete was detected, otherwise undefined
59
+ */
60
+ export declare const handleDeleteDomMutation: ({ mutations, }: {
61
+ mutations: MutationRecord[];
62
+ }) => ExperienceCheckResult | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-menu",
3
- "version": "6.0.27",
3
+ "version": "6.0.28",
4
4
  "description": "BlockMenu plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/platform-feature-flags-react": "^0.4.0",
47
47
  "@atlaskit/primitives": "^17.1.0",
48
48
  "@atlaskit/prosemirror-history": "^0.2.0",
49
- "@atlaskit/tmp-editor-statsig": "^17.2.0",
49
+ "@atlaskit/tmp-editor-statsig": "^17.4.0",
50
50
  "@atlaskit/tokens": "^10.1.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "bind-event-listener": "^3.0.0"