@atlaskit/editor-plugin-block-controls 17.2.4 → 17.3.0

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.
Files changed (113) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/blockControlsPlugin.js +28 -8
  3. package/dist/cjs/editor-commands/move-node-with-block-menu.js +2 -2
  4. package/dist/cjs/editor-commands/move-node.js +6 -6
  5. package/dist/cjs/editor-commands/utils/move-node-utils.js +4 -4
  6. package/dist/cjs/pm-plugins/decorations-anchor.js +4 -4
  7. package/dist/cjs/pm-plugins/decorations-drag-handle.js +3 -3
  8. package/dist/cjs/pm-plugins/decorations-drop-target-active.js +2 -2
  9. package/dist/cjs/pm-plugins/decorations-drop-target.js +2 -2
  10. package/dist/cjs/pm-plugins/decorations-quick-insert-button.js +2 -2
  11. package/dist/cjs/pm-plugins/handle-mouse-down.js +3 -3
  12. package/dist/cjs/pm-plugins/handle-mouse-over.js +7 -7
  13. package/dist/cjs/pm-plugins/interaction-tracking/pm-plugin.js +3 -3
  14. package/dist/cjs/pm-plugins/main.js +23 -21
  15. package/dist/cjs/pm-plugins/react-root-registry.js +7 -7
  16. package/dist/cjs/pm-plugins/utils/active-anchor-tracker.js +2 -2
  17. package/dist/cjs/pm-plugins/utils/consts.js +2 -2
  18. package/dist/cjs/pm-plugins/utils/drag-handle-positions.js +6 -6
  19. package/dist/cjs/pm-plugins/utils/expand-and-update-selection.js +2 -2
  20. package/dist/cjs/pm-plugins/utils/getSelection.js +5 -5
  21. package/dist/cjs/pm-plugins/utils/inline-drop-target.js +2 -2
  22. package/dist/cjs/pm-plugins/utils/remove-from-source.js +2 -2
  23. package/dist/cjs/pm-plugins/utils/surface-node-positions.js +45 -19
  24. package/dist/cjs/pm-plugins/utils/validation.js +2 -2
  25. package/dist/cjs/ui/block-controls-left-surfaces.js +5 -4
  26. package/dist/cjs/ui/block-controls-right-surface.compiled.css +4 -0
  27. package/dist/cjs/ui/block-controls-right-surface.js +45 -0
  28. package/dist/cjs/ui/block-controls-right-surfaces.js +222 -0
  29. package/dist/{esm/ui/block-controls-left-surface-targets.js → cjs/ui/block-controls-surface-targets.js} +14 -2
  30. package/dist/cjs/ui/consts.js +4 -4
  31. package/dist/cjs/ui/drag-handle.js +20 -19
  32. package/dist/cjs/ui/drop-target.js +2 -2
  33. package/dist/cjs/ui/global-styles.js +5 -5
  34. package/dist/cjs/ui/utils/get-surface-placement.js +20 -6
  35. package/dist/cjs/ui/visibility-container.js +2 -2
  36. package/dist/es2019/blockControlsPlugin.js +28 -4
  37. package/dist/es2019/editor-commands/move-node-with-block-menu.js +1 -1
  38. package/dist/es2019/editor-commands/move-node.js +1 -1
  39. package/dist/es2019/editor-commands/utils/move-node-utils.js +1 -1
  40. package/dist/es2019/pm-plugins/decorations-anchor.js +1 -1
  41. package/dist/es2019/pm-plugins/decorations-drag-handle.js +1 -1
  42. package/dist/es2019/pm-plugins/decorations-drop-target-active.js +1 -1
  43. package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -1
  44. package/dist/es2019/pm-plugins/decorations-quick-insert-button.js +1 -1
  45. package/dist/es2019/pm-plugins/handle-mouse-down.js +1 -1
  46. package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
  47. package/dist/es2019/pm-plugins/interaction-tracking/pm-plugin.js +1 -1
  48. package/dist/es2019/pm-plugins/main.js +10 -10
  49. package/dist/es2019/pm-plugins/react-root-registry.js +7 -7
  50. package/dist/es2019/pm-plugins/utils/active-anchor-tracker.js +1 -1
  51. package/dist/es2019/pm-plugins/utils/consts.js +1 -1
  52. package/dist/es2019/pm-plugins/utils/drag-handle-positions.js +1 -1
  53. package/dist/es2019/pm-plugins/utils/expand-and-update-selection.js +1 -1
  54. package/dist/es2019/pm-plugins/utils/getSelection.js +1 -1
  55. package/dist/es2019/pm-plugins/utils/inline-drop-target.js +1 -1
  56. package/dist/es2019/pm-plugins/utils/remove-from-source.js +1 -1
  57. package/dist/es2019/pm-plugins/utils/surface-node-positions.js +34 -15
  58. package/dist/es2019/pm-plugins/utils/validation.js +1 -1
  59. package/dist/es2019/ui/block-controls-left-surfaces.js +5 -4
  60. package/dist/es2019/ui/block-controls-right-surface.compiled.css +4 -0
  61. package/dist/es2019/ui/block-controls-right-surface.js +39 -0
  62. package/dist/es2019/ui/block-controls-right-surfaces.js +187 -0
  63. package/dist/es2019/ui/{block-controls-left-surface-targets.js → block-controls-surface-targets.js} +8 -2
  64. package/dist/es2019/ui/consts.js +1 -1
  65. package/dist/es2019/ui/drag-handle.js +4 -3
  66. package/dist/es2019/ui/drop-target.js +1 -1
  67. package/dist/es2019/ui/global-styles.js +1 -1
  68. package/dist/es2019/ui/utils/get-surface-placement.js +20 -6
  69. package/dist/es2019/ui/visibility-container.js +1 -1
  70. package/dist/esm/blockControlsPlugin.js +24 -4
  71. package/dist/esm/editor-commands/move-node-with-block-menu.js +1 -1
  72. package/dist/esm/editor-commands/move-node.js +1 -1
  73. package/dist/esm/editor-commands/utils/move-node-utils.js +1 -1
  74. package/dist/esm/pm-plugins/decorations-anchor.js +1 -1
  75. package/dist/esm/pm-plugins/decorations-drag-handle.js +1 -1
  76. package/dist/esm/pm-plugins/decorations-drop-target-active.js +1 -1
  77. package/dist/esm/pm-plugins/decorations-drop-target.js +1 -1
  78. package/dist/esm/pm-plugins/decorations-quick-insert-button.js +1 -1
  79. package/dist/esm/pm-plugins/handle-mouse-down.js +1 -1
  80. package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
  81. package/dist/esm/pm-plugins/interaction-tracking/pm-plugin.js +1 -1
  82. package/dist/esm/pm-plugins/main.js +11 -9
  83. package/dist/esm/pm-plugins/react-root-registry.js +7 -7
  84. package/dist/esm/pm-plugins/utils/active-anchor-tracker.js +1 -1
  85. package/dist/esm/pm-plugins/utils/consts.js +1 -1
  86. package/dist/esm/pm-plugins/utils/drag-handle-positions.js +1 -1
  87. package/dist/esm/pm-plugins/utils/expand-and-update-selection.js +1 -1
  88. package/dist/esm/pm-plugins/utils/getSelection.js +1 -1
  89. package/dist/esm/pm-plugins/utils/inline-drop-target.js +1 -1
  90. package/dist/esm/pm-plugins/utils/remove-from-source.js +1 -1
  91. package/dist/esm/pm-plugins/utils/surface-node-positions.js +45 -19
  92. package/dist/esm/pm-plugins/utils/validation.js +1 -1
  93. package/dist/esm/ui/block-controls-left-surfaces.js +5 -4
  94. package/dist/esm/ui/block-controls-right-surface.compiled.css +4 -0
  95. package/dist/esm/ui/block-controls-right-surface.js +38 -0
  96. package/dist/esm/ui/block-controls-right-surfaces.js +213 -0
  97. package/dist/{cjs/ui/block-controls-left-surface-targets.js → esm/ui/block-controls-surface-targets.js} +8 -8
  98. package/dist/esm/ui/consts.js +1 -1
  99. package/dist/esm/ui/drag-handle.js +4 -3
  100. package/dist/esm/ui/drop-target.js +1 -1
  101. package/dist/esm/ui/global-styles.js +1 -1
  102. package/dist/esm/ui/utils/get-surface-placement.js +20 -6
  103. package/dist/esm/ui/visibility-container.js +1 -1
  104. package/dist/types/pm-plugins/main.d.ts +2 -2
  105. package/dist/types/pm-plugins/react-root-registry.d.ts +4 -4
  106. package/dist/types/pm-plugins/utils/surface-node-positions.d.ts +3 -3
  107. package/dist/types/ui/block-controls-left-surface.d.ts +2 -2
  108. package/dist/types/ui/block-controls-right-surface.d.ts +23 -0
  109. package/dist/types/ui/block-controls-right-surfaces.d.ts +20 -0
  110. package/dist/types/ui/block-controls-surface-targets.d.ts +13 -0
  111. package/dist/types/ui/utils/get-surface-placement.d.ts +12 -4
  112. package/package.json +23 -26
  113. package/dist/types/ui/block-controls-left-surface-targets.d.ts +0 -7
@@ -15,25 +15,39 @@ export var getAbsoluteSurfacePlacement = function getAbsoluteSurfacePlacement(_r
15
15
  };
16
16
 
17
17
  /**
18
- * Positions the Task 1 left surface beside the legacy drag-handle slot.
19
- * The surface's own width is handled by the transform, so later controls do not require measuring it.
18
+ * Positions the surface beside the legacy drag-handle slot, on either the left or right edge
19
+ * of the target node. Node-type-specific gap/top-adjustment maths (layouts, tables, media, cards,
20
+ * extensions, etc.) live in one place so left/right edge cases can't drift out of sync.
21
+ *
22
+ * The left side grows away from the node without knowing its own width, so it needs
23
+ * `translateX(-100%)` to anchor its right edge at `nodeRect.left` and extend backward. The right
24
+ * side grows in the normal box-flow direction (away from the node, into the margin), so the gap
25
+ * can be folded straight into `left` with no transform needed.
20
26
  */
21
27
  export var getSurfacePlacement = function getSurfacePlacement(_ref2) {
22
28
  var layout = _ref2.layout,
23
29
  nodeRect = _ref2.nodeRect,
24
30
  nodeType = _ref2.nodeType,
25
31
  nodeTypeWithLevel = _ref2.nodeTypeWithLevel,
26
- parentNodeType = _ref2.parentNodeType;
32
+ parentNodeType = _ref2.parentNodeType,
33
+ side = _ref2.side;
27
34
  if (nodeType === 'layoutColumn') {
35
+ // nodeRect.left + width/2 === nodeRect.right - width/2 — side-independent.
28
36
  return {
29
37
  left: nodeRect.left + nodeRect.width / 2,
30
38
  top: nodeRect.top,
31
39
  transform: 'translate(-50%, -50%)'
32
40
  };
33
41
  }
34
- return {
42
+ var gap = dragHandleGap(nodeType, parentNodeType);
43
+ var top = nodeRect.top + topPositionAdjustment(nodeTypeWithLevel, layout);
44
+ return side === 'right' ? {
45
+ left: nodeRect.right + gap,
46
+ top: top,
47
+ transform: ''
48
+ } : {
35
49
  left: nodeRect.left,
36
- top: nodeRect.top + topPositionAdjustment(nodeTypeWithLevel, layout),
37
- transform: "translateX(calc(-100% - ".concat(dragHandleGap(nodeType, parentNodeType), "px))")
50
+ top: top,
51
+ transform: "translateX(calc(-100% - ".concat(gap, "px))")
38
52
  };
39
53
  };
@@ -13,7 +13,7 @@ import { akEditorFullPageNarrowBreakout } from '@atlaskit/editor-shared-styles';
13
13
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
14
14
  import { Box, xcss } from '@atlaskit/primitives';
15
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
16
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
17
17
  var RIGHT_CONTROL_HIDE_DELAY_MS = 150;
18
18
  var baseStyles = xcss({
19
19
  transition: 'opacity 0.1s ease-in-out, visibility 0.1s ease-in-out'
@@ -19,7 +19,7 @@ export interface FlagType {
19
19
  toolbarFlagsEnabled: boolean;
20
20
  }
21
21
  export declare const getDecorations: (state: EditorState) => DecorationSet | undefined;
22
- export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null, resolvedSurface?: ResolvedSurface) => PluginState | {
22
+ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, formatMessage: IntlShape['formatMessage'], tr: ReadonlyTransaction, currentState: PluginState, newState: EditorState, flags: FlagType, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, anchorRectCache?: AnchorRectCache, resizeObserverWidth?: ResizeObserver, pragmaticCleanup?: (() => void) | null, resolvedSurfaces?: readonly ResolvedSurface[]) => PluginState | {
23
23
  activeDropTargetNode: ActiveDropTargetNode | undefined;
24
24
  activeNode: any;
25
25
  blockMenuOptions: {
@@ -44,7 +44,7 @@ export declare const apply: (api: ExtractInjectionAPI<BlockControlsPlugin> | und
44
44
  multiSelectDnD: MultiSelectDnD | undefined;
45
45
  surfaceNodePositions: number[];
46
46
  };
47
- export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, legacyDragHandleEnabled?: boolean, surfaceNodePositionsEnabled?: boolean) => SafePlugin<PluginState | {
47
+ export declare const createPlugin: (api: ExtractInjectionAPI<BlockControlsPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, nodeDecorationRegistry: NodeDecorationFactory[], rightSideControlsEnabled?: boolean, quickInsertButtonEnabled?: boolean, legacyDragHandleEnabled?: boolean, surfaceNodePositionsEnabled?: boolean, rightSurfaceEnabled?: boolean) => SafePlugin<PluginState | {
48
48
  activeDropTargetNode: ActiveDropTargetNode | undefined;
49
49
  activeNode: any;
50
50
  blockMenuOptions: {
@@ -2,21 +2,21 @@ import type { ReactElement } from 'react';
2
2
  /**
3
3
  * Mounts `element` into `mountPoint`.
4
4
  *
5
- * When `nike_r19_render_unmount` is **on**, uses the React 18/19 `createRoot`
5
+ * When `platform_editor_react19_migration` is **on**, uses the React 18/19 `createRoot`
6
6
  * API wrapped in `flushSync` so the render is synchronous – matching the
7
7
  * legacy `ReactDOM.render` timing that ProseMirror decoration widgets depend
8
8
  * on (focus management, anchor positioning, block-menu visibility all read
9
9
  * the rendered DOM immediately after the callback returns).
10
10
  *
11
- * When the gate is **off**, falls back to the legacy `ReactDOM.render` path.
11
+ * Otherwise, falls back to the legacy `ReactDOM.render` path.
12
12
  */
13
13
  export declare const renderToMountPoint: (element: ReactElement, mountPoint: Element) => void;
14
14
  /**
15
15
  * Unmounts the React tree at `mountPoint`.
16
16
  *
17
- * When `nike_r19_render_unmount` is **on**, looks up the root in the shared
17
+ * When `platform_editor_react19_migration` is **on**, looks up the root in the shared
18
18
  * registry, calls `root.unmount()`, and removes the entry.
19
19
  *
20
- * When the gate is **off**, falls back to `ReactDOM.unmountComponentAtNode`.
20
+ * Otherwise, falls back to `ReactDOM.unmountComponentAtNode`.
21
21
  */
22
22
  export declare const unmountFromMountPoint: (mountPoint: Element) => void;
@@ -1,14 +1,14 @@
1
1
  import type { EditorState, ReadonlyTransaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { ResolvedSurface } from '@atlaskit/editor-ui-control-model/surface-renderer/types';
3
3
  import type { ActiveNode } from '../../blockControlsPluginType';
4
- export declare const getSurfaceNodePositions: (state: EditorState, resolvedSurface: ResolvedSurface, activeNode?: ActiveNode, from?: number, to?: number) => number[];
5
- export declare const updateSurfaceNodePositions: ({ activeNode, currentPositions, from, newState, previousActiveNode, resolvedSurface, to, tr, }: {
4
+ export declare const getSurfaceNodePositions: (state: EditorState, resolvedSurfaces: readonly ResolvedSurface[], activeNode?: ActiveNode, from?: number, to?: number) => number[];
5
+ export declare const updateSurfaceNodePositions: ({ activeNode, currentPositions, from, newState, previousActiveNode, resolvedSurfaces, to, tr, }: {
6
6
  activeNode: ActiveNode | null | undefined;
7
7
  currentPositions: number[];
8
8
  from: number;
9
9
  newState: EditorState;
10
10
  previousActiveNode: ActiveNode | null | undefined;
11
- resolvedSurface: ResolvedSurface;
11
+ resolvedSurfaces: readonly ResolvedSurface[];
12
12
  to: number;
13
13
  tr: ReadonlyTransaction;
14
14
  }) => number[];
@@ -8,14 +8,14 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
8
  import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model/surface-renderer';
9
9
  import type { SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
10
10
  import type { BlockControlsPlugin } from '../blockControlsPluginType';
11
- import type { BlockControlsLeftSurfaceTarget } from './block-controls-left-surface-targets';
11
+ import type { BlockControlsSurfaceTarget } from './block-controls-surface-targets';
12
12
  import type { SurfacePlacement } from './utils/get-surface-placement';
13
13
  type BlockControlsLeftSurfaceProps = {
14
14
  api: ExtractInjectionAPI<BlockControlsPlugin>;
15
15
  components: React.ComponentProps<typeof SurfaceRenderer>['components'];
16
16
  forceVisibleOnMouseOut: boolean;
17
17
  placement: SurfacePlacement | undefined;
18
- source: BlockControlsLeftSurfaceTarget['source'];
18
+ source: BlockControlsSurfaceTarget['source'];
19
19
  surfaceContext: SurfaceContext;
20
20
  };
21
21
  /** Renders one left block-controls surface at a document position. */
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ * @jsxFrag React.Fragment
5
+ */
6
+ import React from 'react';
7
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model/surface-renderer';
9
+ import type { SurfaceContext } from '@atlaskit/editor-ui-control-model/types';
10
+ import type { BlockControlsPlugin } from '../blockControlsPluginType';
11
+ import type { BlockControlsSurfaceTarget } from './block-controls-surface-targets';
12
+ import type { SurfacePlacement } from './utils/get-surface-placement';
13
+ type BlockControlsRightSurfaceProps = {
14
+ api: ExtractInjectionAPI<BlockControlsPlugin>;
15
+ components: React.ComponentProps<typeof SurfaceRenderer>['components'];
16
+ forceVisibleOnMouseOut: boolean;
17
+ placement: SurfacePlacement | undefined;
18
+ source: BlockControlsSurfaceTarget['source'];
19
+ surfaceContext: SurfaceContext;
20
+ };
21
+ /** Renders one right block-controls surface at a document position. */
22
+ export declare const BlockControlsRightSurface: ({ api, components, forceVisibleOnMouseOut, placement, source, surfaceContext, }: BlockControlsRightSurfaceProps) => React.JSX.Element | null;
23
+ export {};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ * @jsxFrag React.Fragment
5
+ */
6
+ import React from 'react';
7
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
+ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
+ import type { BlockControlsPlugin } from '../blockControlsPluginType';
10
+ type Props = {
11
+ api: ExtractInjectionAPI<BlockControlsPlugin>;
12
+ editorView: EditorView;
13
+ };
14
+ /**
15
+ * Registry-backed right surface tree. Mirrors the left surface's single-tree, measured-placement
16
+ * approach, but keeps its own components lookup, targets, placements and measurement lifecycle so
17
+ * the right surface never depends on the left surface's render pass.
18
+ */
19
+ export declare const BlockControlsRightSurfaces: ({ api, editorView, }: Props) => React.JSX.Element | null;
20
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ActiveNode } from '../blockControlsPluginType';
2
+ export type BlockControlsSurfaceTarget = {
3
+ position: number;
4
+ source: 'active' | 'root' | 'stored';
5
+ };
6
+ /**
7
+ * Combines hover-driven and stored surface positions into one deduplicated list.
8
+ * Shared by both the left and right surfaces: this is pure position bookkeeping with no
9
+ * surface-specific behavior, so there's nothing to keep independent between them. What *is*
10
+ * kept independent is each surface's own React tree (component lookup, measurement effects,
11
+ * observers) — see block-controls-left-surfaces.tsx / block-controls-right-surfaces.tsx.
12
+ */
13
+ export declare const getBlockControlsSurfaceTargets: (activeNode: ActiveNode | undefined, storedPositions: readonly number[]) => readonly BlockControlsSurfaceTarget[];
@@ -3,12 +3,14 @@ export type SurfacePlacement = {
3
3
  top: number;
4
4
  transform: string;
5
5
  };
6
+ export type SurfaceSide = 'left' | 'right';
6
7
  export type SurfacePlacementOptions = {
7
8
  layout: string;
8
- nodeRect: Pick<DOMRect, 'left' | 'top' | 'width'>;
9
+ nodeRect: Pick<DOMRect, 'left' | 'right' | 'top' | 'width'>;
9
10
  nodeType: string;
10
11
  nodeTypeWithLevel: string;
11
12
  parentNodeType?: string;
13
+ side: SurfaceSide;
12
14
  };
13
15
  export declare const getAbsoluteSurfacePlacement: ({ offsetParentRect, offsetParentScrollLeft, offsetParentScrollTop, placement, }: {
14
16
  offsetParentRect?: Pick<DOMRect, 'left' | 'top'>;
@@ -17,7 +19,13 @@ export declare const getAbsoluteSurfacePlacement: ({ offsetParentRect, offsetPar
17
19
  placement: SurfacePlacement;
18
20
  }) => SurfacePlacement;
19
21
  /**
20
- * Positions the Task 1 left surface beside the legacy drag-handle slot.
21
- * The surface's own width is handled by the transform, so later controls do not require measuring it.
22
+ * Positions the surface beside the legacy drag-handle slot, on either the left or right edge
23
+ * of the target node. Node-type-specific gap/top-adjustment maths (layouts, tables, media, cards,
24
+ * extensions, etc.) live in one place so left/right edge cases can't drift out of sync.
25
+ *
26
+ * The left side grows away from the node without knowing its own width, so it needs
27
+ * `translateX(-100%)` to anchor its right edge at `nodeRect.left` and extend backward. The right
28
+ * side grows in the normal box-flow direction (away from the node, into the margin), so the gap
29
+ * can be folded straight into `left` with no transform needed.
22
30
  */
23
- export declare const getSurfacePlacement: ({ layout, nodeRect, nodeType, nodeTypeWithLevel, parentNodeType, }: SurfacePlacementOptions) => SurfacePlacement;
31
+ export declare const getSurfacePlacement: ({ layout, nodeRect, nodeType, nodeTypeWithLevel, parentNodeType, side, }: SurfacePlacementOptions) => SurfacePlacement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "17.2.4",
3
+ "version": "17.3.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -21,43 +21,43 @@
21
21
  "atlaskit:src": "src/index.ts",
22
22
  "dependencies": {
23
23
  "@atlaskit/browser-apis": "^1.2.0",
24
- "@atlaskit/button": "^25.2.0",
24
+ "@atlaskit/button": "^25.3.0",
25
25
  "@atlaskit/css": "^1.1.0",
26
26
  "@atlaskit/docs": "^12.2.0",
27
27
  "@atlaskit/editor-plugin-accessibility-utils": "^16.0.0",
28
- "@atlaskit/editor-plugin-analytics": "^16.0.0",
29
- "@atlaskit/editor-plugin-editor-disabled": "^16.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^16.1.0",
29
+ "@atlaskit/editor-plugin-editor-disabled": "^16.1.0",
30
30
  "@atlaskit/editor-plugin-editor-viewmode": "^18.0.0",
31
- "@atlaskit/editor-plugin-feature-flags": "^15.0.0",
31
+ "@atlaskit/editor-plugin-feature-flags": "^15.1.0",
32
32
  "@atlaskit/editor-plugin-interaction": "^27.0.0",
33
33
  "@atlaskit/editor-plugin-limited-mode": "^13.0.0",
34
34
  "@atlaskit/editor-plugin-metrics": "^17.0.0",
35
- "@atlaskit/editor-plugin-quick-insert": "^16.1.0",
36
- "@atlaskit/editor-plugin-selection": "^16.0.0",
35
+ "@atlaskit/editor-plugin-quick-insert": "^16.2.0",
36
+ "@atlaskit/editor-plugin-selection": "^16.1.0",
37
37
  "@atlaskit/editor-plugin-show-diff": "^14.2.0",
38
38
  "@atlaskit/editor-plugin-toolbar": "^13.0.0",
39
- "@atlaskit/editor-plugin-type-ahead": "^17.0.0",
39
+ "@atlaskit/editor-plugin-type-ahead": "^17.1.0",
40
40
  "@atlaskit/editor-plugin-ui-control-registry": "^10.0.0",
41
41
  "@atlaskit/editor-plugin-user-intent": "^14.0.0",
42
- "@atlaskit/editor-plugin-width": "^17.0.0",
42
+ "@atlaskit/editor-plugin-width": "^17.1.0",
43
43
  "@atlaskit/editor-prosemirror": "^8.0.0",
44
- "@atlaskit/editor-shared-styles": "^4.0.0",
45
- "@atlaskit/editor-tables": "^3.0.0",
44
+ "@atlaskit/editor-shared-styles": "^4.1.0",
45
+ "@atlaskit/editor-tables": "^3.1.0",
46
46
  "@atlaskit/editor-ui-control-model": "^2.9.0",
47
- "@atlaskit/icon": "^37.5.0",
47
+ "@atlaskit/icon": "^37.6.0",
48
48
  "@atlaskit/icon-lab": "^7.7.0",
49
49
  "@atlaskit/link": "^5.1.0",
50
50
  "@atlaskit/platform-feature-experiments": "^0.3.0",
51
- "@atlaskit/platform-feature-flags": "^2.1.0",
52
- "@atlaskit/pragmatic-drag-and-drop": "^3.0.0",
53
- "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.1.0",
54
- "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.1.0",
55
- "@atlaskit/primitives": "^22.4.0",
56
- "@atlaskit/section-message": "^10.1.0",
57
- "@atlaskit/theme": "^28.1.0",
58
- "@atlaskit/tmp-editor-statsig": "^167.0.0",
59
- "@atlaskit/tokens": "^16.9.0",
60
- "@atlaskit/tooltip": "^24.2.0",
51
+ "@atlaskit/platform-feature-flags": "^2.2.0",
52
+ "@atlaskit/pragmatic-drag-and-drop": "^3.1.0",
53
+ "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
54
+ "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^4.2.0",
55
+ "@atlaskit/primitives": "^22.5.0",
56
+ "@atlaskit/section-message": "^10.2.0",
57
+ "@atlaskit/theme": "^28.2.0",
58
+ "@atlaskit/tmp-editor-statsig": "^168.0.0",
59
+ "@atlaskit/tokens": "^16.10.0",
60
+ "@atlaskit/tooltip": "^24.3.0",
61
61
  "@babel/runtime": "^7.0.0",
62
62
  "@compiled/react": "^1.0.2",
63
63
  "@emotion/react": "^11.7.1",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^120.7.0",
70
+ "@atlaskit/editor-common": "^120.10.0",
71
71
  "react": "^18.2.0 || ^19.2.0",
72
72
  "react-dom": "^18.2.0 || ^19.2.0",
73
73
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
@@ -139,9 +139,6 @@
139
139
  "platform-dst-top-layer-tooltip": {
140
140
  "type": "boolean",
141
141
  "referenceOnly": true
142
- },
143
- "nike_r19_render_unmount": {
144
- "type": "boolean"
145
142
  }
146
143
  },
147
144
  "devDependencies": {
@@ -1,7 +0,0 @@
1
- import type { ActiveNode } from '../blockControlsPluginType';
2
- export type BlockControlsLeftSurfaceTarget = {
3
- position: number;
4
- source: 'active' | 'root' | 'stored';
5
- };
6
- /** Combines hover-driven and stored surface positions into one deduplicated list. */
7
- export declare const getBlockControlsLeftSurfaceTargets: (activeNode: ActiveNode | undefined, storedPositions: readonly number[]) => readonly BlockControlsLeftSurfaceTarget[];