@atlaskit/editor-plugin-layout 12.0.3 → 12.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/layout-plugin/package.json +1 -8
  3. package/layout-plugin-type/package.json +1 -8
  4. package/package.json +2 -2
  5. package/types/package.json +1 -8
  6. package/dist/types-ts4.5/entry-points/layout-plugin-type.d.ts +0 -1
  7. package/dist/types-ts4.5/entry-points/layout-plugin.d.ts +0 -1
  8. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  9. package/dist/types-ts4.5/index.d.ts +0 -3
  10. package/dist/types-ts4.5/layoutPlugin.d.ts +0 -11
  11. package/dist/types-ts4.5/layoutPluginType.d.ts +0 -46
  12. package/dist/types-ts4.5/nodeviews/index.d.ts +0 -88
  13. package/dist/types-ts4.5/pm-plugins/actions.d.ts +0 -71
  14. package/dist/types-ts4.5/pm-plugins/column-resize-divider.d.ts +0 -9
  15. package/dist/types-ts4.5/pm-plugins/consts.d.ts +0 -8
  16. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -10
  17. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -7
  18. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -3
  19. package/dist/types-ts4.5/pm-plugins/resizing.d.ts +0 -11
  20. package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -19
  21. package/dist/types-ts4.5/pm-plugins/utils/index.d.ts +0 -13
  22. package/dist/types-ts4.5/pm-plugins/utils/layout-column-distribution.d.ts +0 -16
  23. package/dist/types-ts4.5/pm-plugins/utils/layout-column-selection.d.ts +0 -20
  24. package/dist/types-ts4.5/types/index.d.ts +0 -19
  25. package/dist/types-ts4.5/ui/LayoutBlockMenuItem.d.ts +0 -8
  26. package/dist/types-ts4.5/ui/LayoutColumnMenu/DeleteColumnDropdownItem.d.ts +0 -8
  27. package/dist/types-ts4.5/ui/LayoutColumnMenu/DistributeColumnsDropdownItem.d.ts +0 -8
  28. package/dist/types-ts4.5/ui/LayoutColumnMenu/InsertColumnDropdownItem.d.ts +0 -10
  29. package/dist/types-ts4.5/ui/LayoutColumnMenu/VerticalAlignDropdownItem.d.ts +0 -12
  30. package/dist/types-ts4.5/ui/LayoutColumnMenu/VerticalAlignNestedMenu.d.ts +0 -8
  31. package/dist/types-ts4.5/ui/LayoutColumnMenu/components.d.ts +0 -7
  32. package/dist/types-ts4.5/ui/LayoutColumnMenu/index.d.ts +0 -13
  33. package/dist/types-ts4.5/ui/LayoutColumnMenu/keys.d.ts +0 -18
  34. package/dist/types-ts4.5/ui/LayoutColumnMenu/useSelectedLayoutColumns.d.ts +0 -4
  35. package/dist/types-ts4.5/ui/LayoutColumnMenu/utils.d.ts +0 -13
  36. package/dist/types-ts4.5/ui/LayoutColumnMenu/verticalAlignIcons.d.ts +0 -5
  37. package/dist/types-ts4.5/ui/LayoutSSRReactContextsProvider.d.ts +0 -19
  38. package/dist/types-ts4.5/ui/global-styles.d.ts +0 -2
  39. package/dist/types-ts4.5/ui/icons/LayoutColumnsIcon.d.ts +0 -3
  40. package/dist/types-ts4.5/ui/icons/LayoutThreeWithLeftSidebars.d.ts +0 -3
  41. package/dist/types-ts4.5/ui/icons/LayoutThreeWithRightSidebars.d.ts +0 -3
  42. package/dist/types-ts4.5/ui/toolbar.d.ts +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 12.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 12.0.3
4
10
 
5
11
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/layout-plugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/layout-plugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/layout-plugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/layout-plugin-type.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/layout-plugin-type.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/layout-plugin-type.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "12.0.3",
3
+ "version": "12.0.4",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/icon": "^35.4.0",
51
51
  "@atlaskit/icon-lab": "^6.14.0",
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
- "@atlaskit/tmp-editor-statsig": "^102.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
54
54
  "@atlaskit/tokens": "^13.4.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@emotion/react": "^11.7.1",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1 +0,0 @@
1
- export type { LayoutPlugin, LayoutPluginDependencies } from '../layoutPluginType';
@@ -1 +0,0 @@
1
- export { layoutPlugin } from '../layoutPlugin';
@@ -1 +0,0 @@
1
- export type { LayoutPluginOptions } from '../types/index';
@@ -1,3 +0,0 @@
1
- export { layoutPlugin } from './layoutPlugin';
2
- export type { LayoutPlugin, LayoutPluginDependencies } from './layoutPluginType';
3
- export type { LayoutPluginOptions } from './types';
@@ -1,11 +0,0 @@
1
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { LayoutPlugin } from './layoutPluginType';
3
- /**
4
- * This function is used to set the selection into
5
- * the first paragraph of the first column of a layout section.
6
- * This function is only intended to be used after inserting a new layout section.
7
- * @param tr - transaction
8
- * @returns - transaction with the selection set to the first paragraph of the first column
9
- */
10
- export declare const selectIntoLayoutSection: (tr: Transaction) => Transaction;
11
- export declare const layoutPlugin: LayoutPlugin;
@@ -1,46 +0,0 @@
1
- import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
4
- import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
5
- import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
6
- import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
7
- import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
8
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
9
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
10
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
11
- import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
12
- import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
13
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
14
- import type { DeleteLayoutColumnOptions, DistributeLayoutColumnsOptions, InsertLayoutColumnOptions, InsertLayoutColumnsInputMethod, SetLayoutColumnValignOptions, ToggleLayoutColumnMenuOptions } from './pm-plugins/actions';
15
- import type { LayoutState } from './pm-plugins/types';
16
- import type { LayoutPluginOptions } from './types';
17
- export type LayoutPluginDependencies = [
18
- DecorationsPlugin,
19
- SelectionPlugin,
20
- OptionalPlugin<AnalyticsPlugin>,
21
- OptionalPlugin<WidthPlugin>,
22
- OptionalPlugin<EditorDisabledPlugin>,
23
- OptionalPlugin<GuidelinePlugin>,
24
- OptionalPlugin<InteractionPlugin>,
25
- OptionalPlugin<BlockControlsPlugin>,
26
- OptionalPlugin<BlockMenuPlugin>,
27
- OptionalPlugin<ToolbarPlugin>,
28
- OptionalPlugin<UiControlRegistryPlugin>,
29
- OptionalPlugin<UserIntentPlugin>
30
- ];
31
- export type LayoutPlugin = NextEditorPlugin<'layout', {
32
- actions: {
33
- insertLayoutColumns: (inputMethod: InsertLayoutColumnsInputMethod) => Command;
34
- };
35
- commands: {
36
- deleteLayoutColumn: (options?: DeleteLayoutColumnOptions) => EditorCommand;
37
- distributeLayoutColumns: (options?: DistributeLayoutColumnsOptions) => EditorCommand;
38
- insertLayoutColumn: (options: InsertLayoutColumnOptions) => EditorCommand;
39
- setLayoutColumnDangerPreview: (show: boolean) => EditorCommand;
40
- setLayoutColumnValign: (options: SetLayoutColumnValignOptions) => EditorCommand;
41
- toggleLayoutColumnMenu: (options: ToggleLayoutColumnMenuOptions) => EditorCommand;
42
- };
43
- dependencies: LayoutPluginDependencies;
44
- pluginConfiguration: LayoutPluginOptions | undefined;
45
- sharedState: LayoutState | undefined;
46
- }>;
@@ -1,88 +0,0 @@
1
- import React from 'react';
2
- import type { IntlShape } from 'react-intl';
3
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
5
- import ReactNodeView from '@atlaskit/editor-common/react-node-view';
6
- import type { ExtractInjectionAPI, getPosHandlerNode } from '@atlaskit/editor-common/types';
7
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
8
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
- import type { LayoutPlugin } from '../layoutPluginType';
10
- import type { LayoutPluginOptions } from '../types';
11
- type LayoutSectionViewProps = {
12
- eventDispatcher: EventDispatcher;
13
- getPos: getPosHandlerNode;
14
- intl?: IntlShape;
15
- node: PMNode;
16
- options: LayoutPluginOptions;
17
- pluginInjectionApi?: ExtractInjectionAPI<LayoutPlugin>;
18
- portalProviderAPI: PortalProviderAPI;
19
- view: EditorView;
20
- };
21
- type ForwardRef = (ref: HTMLElement | null) => void;
22
- /**
23
- *
24
- */
25
- export declare class LayoutSectionView extends ReactNodeView<LayoutSectionViewProps> {
26
- options: LayoutPluginOptions;
27
- layoutDOM?: HTMLElement;
28
- isEmpty?: boolean;
29
- private intl?;
30
- /**
31
- * constructor
32
- * @param props
33
- * @param props.node
34
- * @param props.view
35
- * @param props.getPos
36
- * @param props.portalProviderAPI
37
- * @param props.eventDispatcher
38
- * @param props.pluginInjectionApi
39
- * @param props.options
40
- * @param props.intl
41
- * @example
42
- */
43
- constructor(props: {
44
- eventDispatcher: EventDispatcher;
45
- getPos: getPosHandlerNode;
46
- intl?: IntlShape;
47
- node: PMNode;
48
- options: LayoutPluginOptions;
49
- pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>;
50
- portalProviderAPI: PortalProviderAPI;
51
- view: EditorView;
52
- });
53
- /**
54
- * getContentDOM
55
- * @example
56
- * @returns
57
- */
58
- getContentDOM(): {
59
- contentDOM: HTMLElement | undefined;
60
- dom: HTMLElement;
61
- };
62
- /**
63
- * setDomAttrs
64
- * @param node
65
- * @param element
66
- * @example
67
- */
68
- setDomAttrs(node: PMNode, _element: HTMLElement): void;
69
- /**
70
- * render
71
- * @param props
72
- * @param forwardRef
73
- * @example
74
- * @returns
75
- */
76
- render(props: LayoutSectionViewProps, forwardRef: ForwardRef): React.JSX.Element | null;
77
- /**
78
- * ignoreMutation
79
- * @param mutation
80
- * @example
81
- * @returns
82
- */
83
- ignoreMutation(mutation: MutationRecord | {
84
- target: Node;
85
- type: 'selection';
86
- }): boolean;
87
- }
88
- export {};
@@ -1,71 +0,0 @@
1
- import type { Valign } from '@atlaskit/adf-schema/layout-column';
2
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
3
- import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
4
- import type { Command, EditorCommand, ExtractInjectionAPI, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
5
- import type { Node } from '@atlaskit/editor-prosemirror/model';
6
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
7
- import type { LayoutPlugin } from '../layoutPluginType';
8
- import type { Change, PresetLayout } from '../types';
9
- export declare const ONE_COL_LAYOUTS: PresetLayout[];
10
- export declare const TWO_COL_LAYOUTS: PresetLayout[];
11
- export declare const THREE_COL_LAYOUTS: PresetLayout[];
12
- /**
13
- * Finds layout preset based on the width attrs of all the layoutColumn nodes
14
- * inside the layoutSection node
15
- */
16
- export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
17
- export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
18
- export declare const createMultiColumnLayoutSection: (state: EditorState, numberOfColumns?: number) => Node;
19
- export declare const createDefaultLayoutSection: (state: EditorState) => Node;
20
- export declare const insertLayoutColumns: Command;
21
- export type InsertLayoutColumnsInputMethod = TOOLBAR_MENU_TYPE | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.ELEMENT_BROWSER;
22
- export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InsertLayoutColumnsInputMethod) => Command;
23
- /**
24
- * Forces a layout section node to match the given preset layout by adjusting
25
- * its column structure and widths, then restoring the original selection.
26
- */
27
- export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
28
- export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
29
- export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
30
- export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
31
- export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD.FLOATING_TB) => Command;
32
- export type InsertLayoutColumnSide = 'left' | 'right';
33
- export declare const LAYOUT_COLUMN_INSERT_META = "layoutColumnInsert";
34
- export type LayoutColumnInsertMeta = {
35
- insertedColumnNodeSize: number;
36
- insertedColumnPos: number;
37
- side: InsertLayoutColumnSide;
38
- };
39
- type LayoutPluginAPI = ExtractInjectionAPI<LayoutPlugin> | undefined;
40
- export type LayoutColumnActionInputMethod = INPUT_METHOD.LAYOUT_COLUMN_MENU | INPUT_METHOD.SHORTCUT;
41
- /**
42
- * Returns the active maximum layout column count for the current advanced layouts experiment state.
43
- */
44
- export declare function getEffectiveMaxLayoutColumns(): number;
45
- export type InsertLayoutColumnOptions = {
46
- inputMethod?: LayoutColumnActionInputMethod;
47
- side: InsertLayoutColumnSide;
48
- };
49
- export declare const insertLayoutColumn: ({ side, inputMethod }: InsertLayoutColumnOptions, editorAnalyticsAPI?: EditorAnalyticsAPI, api?: LayoutPluginAPI) => EditorCommand;
50
- export type SetLayoutColumnValignOptions = {
51
- inputMethod?: INPUT_METHOD.LAYOUT_COLUMN_MENU;
52
- valign: Valign;
53
- };
54
- export declare const setLayoutColumnValign: ({ valign, inputMethod }: SetLayoutColumnValignOptions, editorAnalyticsAPI?: EditorAnalyticsAPI, api?: LayoutPluginAPI) => EditorCommand;
55
- export type DistributeLayoutColumnsOptions = {
56
- inputMethod?: INPUT_METHOD.LAYOUT_COLUMN_MENU | INPUT_METHOD.FLOATING_TB;
57
- target?: 'selectedColumns' | 'allColumns';
58
- };
59
- export declare const distributeLayoutColumns: (editorAnalyticsAPI?: EditorAnalyticsAPI, api?: LayoutPluginAPI) => ({ inputMethod, target, }?: DistributeLayoutColumnsOptions) => EditorCommand;
60
- export type ToggleLayoutColumnMenuOptions = {
61
- anchorPos?: number;
62
- isOpen?: boolean;
63
- openedViaKeyboard?: boolean;
64
- };
65
- export declare const toggleLayoutColumnMenu: ({ anchorPos, isOpen, openedViaKeyboard }: ToggleLayoutColumnMenuOptions) => EditorCommand;
66
- export declare const setLayoutColumnDangerPreview: (show: boolean) => EditorCommand;
67
- export type DeleteLayoutColumnOptions = {
68
- inputMethod?: LayoutColumnActionInputMethod;
69
- };
70
- export declare const deleteLayoutColumn: ({ inputMethod }?: DeleteLayoutColumnOptions, editorAnalyticsAPI?: EditorAnalyticsAPI, api?: LayoutPluginAPI) => EditorCommand;
71
- export {};
@@ -1,9 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import { Decoration } from '@atlaskit/editor-prosemirror/view';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- /**
6
- * Returns ProseMirror Decoration widgets for column dividers between layout columns.
7
- * Each divider supports drag-to-resize interaction for the adjacent columns.
8
- */
9
- export declare const getColumnDividerDecorations: (state: EditorState, view?: EditorView, editorAnalyticsAPI?: EditorAnalyticsAPI) => Decoration[];
@@ -1,8 +0,0 @@
1
- import type { Valign } from '@atlaskit/adf-schema/layout-column';
2
- export declare const MAX_STANDARD_LAYOUT_COLUMNS = 3;
3
- export declare const MAX_LAYOUT_COLUMNS = 5;
4
- export declare const MIN_LAYOUT_COLUMN_WIDTH_PERCENT = 5;
5
- export declare const DEFAULT_LAYOUT_COLUMN_VALIGN: Valign;
6
- export declare const EVEN_DISTRIBUTED_COL_WIDTHS: {
7
- [key: number]: number;
8
- };
@@ -1,10 +0,0 @@
1
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { LayoutPlugin } from '../layoutPluginType';
4
- /**
5
- * Creates shortcut handlers for layout column actions.
6
- */
7
- declare function keymapPlugin({ api }: {
8
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
9
- }): SafePlugin;
10
- export default keymapPlugin;
@@ -1,7 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { LayoutPluginOptions } from '../types';
4
- import type { LayoutState } from './types';
5
- export declare const DEFAULT_LAYOUT = "two_equal";
6
- declare const _default: (options: LayoutPluginOptions, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<LayoutState>;
7
- export default _default;
@@ -1,3 +0,0 @@
1
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
- import type { LayoutState } from './types';
3
- export declare const pluginKey: PluginKey<LayoutState>;
@@ -1,11 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
3
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
4
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
7
- import type { LayoutPlugin } from '../layoutPluginType';
8
- import type { LayoutPluginOptions } from '../types';
9
- export declare const pluginKey: PluginKey;
10
- declare const _default: (options: LayoutPluginOptions, pluginInjectionApi: ExtractInjectionAPI<LayoutPlugin>, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, intl?: IntlShape) => SafePlugin<undefined>;
11
- export default _default;
@@ -1,19 +0,0 @@
1
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { PresetLayout } from '../types';
3
- export type LayoutState = {
4
- addSidebarLayouts: boolean;
5
- allowBreakout: boolean;
6
- allowSingleColumnLayout: boolean;
7
- dangerPreviewLayoutColumnPositions: number[] | undefined;
8
- isLayoutColumnMenuOpen: boolean;
9
- isResizing: boolean;
10
- layoutColumnMenuAnchorPos: number | undefined;
11
- layoutColumnMenuOpenedViaKeyboard: boolean;
12
- pos: number | null;
13
- selectedLayout: PresetLayout | undefined;
14
- };
15
- export type Change = {
16
- from: number;
17
- slice: Slice;
18
- to: number;
19
- };
@@ -1,13 +0,0 @@
1
- import { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- export declare const getMaybeLayoutSection: (state: EditorState) => ContentNodeWithPos | undefined;
6
- /**
7
- * This helper function is used to select a position inside a layout section.
8
- * @param view editor view instance
9
- * @param posOfLayout the starting position of the layout
10
- * @param childIndex the index of the child node in the layout section
11
- * @returns Transaction or undefined
12
- */
13
- export declare const selectIntoLayout: (view: EditorView, posOfLayout: number, childIndex?: number) => Transaction | undefined;
@@ -1,16 +0,0 @@
1
- /**
2
- * Returns true when the given selected columns already reflect the distribution that
3
- * `distributeLayoutColumns` would produce — i.e. the first N-1 cols each hold
4
- * `equalWidth` (rounded to 2 dp) and the last col absorbs the rounding remainder.
5
- *
6
- * This mirrors the action's "last col absorbs remainder" logic so that the UI can
7
- * disable the option when it would be a no-op, avoiding spurious undo entries.
8
- */
9
- export type Distribution = {
10
- equalWidth: number;
11
- selectedTotal: number;
12
- };
13
- export declare const calculateDistribution: (selectedWidths: number[]) => Distribution | undefined;
14
- export declare function isDistributedUniformly(selectedWidths: number[], distribution?: Distribution | undefined): boolean;
15
- export declare const redistributeAfterDeletion: (currentWidths: number[], removeIndex: number, minWidth: number) => number[];
16
- export declare const redistributeProportionally: (currentWidths: number[], insertIndex: number, maxColumns: number, minWidth: number) => number[];
@@ -1,20 +0,0 @@
1
- import type { Valign } from '@atlaskit/adf-schema/layout-column';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import { type Selection } from '@atlaskit/editor-prosemirror/state';
4
- type FoundNode = {
5
- node: PMNode;
6
- pos: number;
7
- };
8
- export type SelectedLayoutColumns = {
9
- endIndex: number;
10
- layoutSectionNode: PMNode;
11
- layoutSectionPos: number;
12
- selectedLayoutColumns: FoundNode[];
13
- startIndex: number;
14
- };
15
- export declare const getSelectedLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
16
- export declare const getLayoutColumnsFromContentSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
17
- export declare const getAllLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
18
- export declare const getLayoutColumnValign: (layoutColumn: PMNode | undefined) => Valign | undefined;
19
- export declare const getLayoutColumnMenuAnchorPos: (selection: Selection, anchorPosFromHandle?: number) => number | undefined;
20
- export {};
@@ -1,19 +0,0 @@
1
- import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
- import type { Slice } from '@atlaskit/editor-prosemirror/model';
3
- export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
4
- allowBreakout?: boolean;
5
- editorAppearance?: EditorAppearance;
6
- UNSAFE_addSidebarLayouts?: boolean;
7
- /**
8
- * @private
9
- * @deprecated
10
- * @see https://product-fabric.atlassian.net/browse/ED-26662
11
- */
12
- UNSAFE_allowSingleColumnLayout?: boolean;
13
- }
14
- export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars' | 'three_left_sidebars' | 'three_right_sidebars' | 'four_equal' | 'five_equal';
15
- export interface Change {
16
- from: number;
17
- slice: Slice;
18
- to: number;
19
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
- import type { LayoutPlugin } from '../layoutPluginType';
8
- export declare const createLayoutBlockMenuItem: (api: ExtractInjectionAPI<LayoutPlugin> | undefined) => () => React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { LayoutPlugin } from '../../layoutPluginType';
4
- type DeleteColumnDropdownItemProps = {
5
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
6
- };
7
- declare const DeleteColumnDropdownItem: ({ api, }: DeleteColumnDropdownItemProps) => React.JSX.Element | null;
8
- export { DeleteColumnDropdownItem };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { LayoutPlugin } from '../../layoutPluginType';
4
- type DistributeColumnsDropdownItemProps = {
5
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
6
- };
7
- export declare const DistributeColumnsDropdownItem: ({ api, }: DistributeColumnsDropdownItemProps) => React.JSX.Element | null;
8
- export {};
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { LayoutPlugin } from '../../layoutPluginType';
4
- import { type InsertLayoutColumnSide } from '../../pm-plugins/actions';
5
- type InsertColumnDropdownItemProps = {
6
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
7
- side: InsertLayoutColumnSide;
8
- };
9
- export declare const InsertColumnDropdownItem: ({ api, side, }: InsertColumnDropdownItemProps) => React.JSX.Element | null;
10
- export {};
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { type MessageDescriptor } from 'react-intl';
3
- import type { Valign } from '@atlaskit/adf-schema/layout-column';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import type { LayoutPlugin } from '../../layoutPluginType';
6
- type VerticalAlignDropdownItemProps = {
7
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
8
- label: MessageDescriptor;
9
- value: Valign;
10
- };
11
- export declare const VerticalAlignDropdownItem: ({ api, label, value, }: VerticalAlignDropdownItemProps) => React.JSX.Element;
12
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { LayoutPlugin } from '../../layoutPluginType';
4
- export type VerticalAlignNestedMenuProps = {
5
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
6
- children?: React.ReactNode;
7
- };
8
- export declare const VerticalAlignNestedMenu: ({ api, children, }: VerticalAlignNestedMenuProps) => React.JSX.Element | null;
@@ -1,7 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { RegisterComponent, SurfaceFallbacks } from '@atlaskit/editor-ui-control-model';
3
- import type { LayoutPlugin } from '../../layoutPluginType';
4
- export declare const LAYOUT_COLUMN_MENU_FALLBACKS: SurfaceFallbacks;
5
- export declare const getLayoutColumnMenuComponents: ({ api, }: {
6
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
7
- }) => RegisterComponent[];
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { LayoutPlugin } from '../../layoutPluginType';
5
- type LayoutColumnMenuProps = {
6
- api: ExtractInjectionAPI<LayoutPlugin> | undefined;
7
- boundariesElement?: HTMLElement;
8
- editorView: EditorView;
9
- mountTo?: HTMLElement;
10
- scrollableElement?: HTMLElement;
11
- };
12
- export declare const LayoutColumnMenu: React.NamedExoticComponent<LayoutColumnMenuProps>;
13
- export {};
@@ -1,18 +0,0 @@
1
- import type { MenuItemType, MenuSectionType, MenuType, NestedMenuType } from '@atlaskit/editor-ui-control-model';
2
- export declare const LAYOUT_COLUMN_MENU: MenuType;
3
- export declare const LAYOUT_COLUMN_MENU_SECTION: MenuSectionType;
4
- export declare const LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION: MenuSectionType;
5
- export declare const LAYOUT_COLUMN_DANGER_SECTION: MenuSectionType;
6
- export declare const LAYOUT_COLUMN_MENU_RANK: Record<string, number>;
7
- export declare const VERTICAL_ALIGN_MENU: NestedMenuType;
8
- export declare const INSERT_COLUMN_LEFT_MENU_ITEM: MenuItemType;
9
- export declare const INSERT_COLUMN_RIGHT_MENU_ITEM: MenuItemType;
10
- export declare const DISTRIBUTE_COLUMNS_MENU_ITEM: MenuItemType;
11
- export declare const VERTICAL_ALIGN_TOP_MENU_ITEM: MenuItemType;
12
- export declare const VERTICAL_ALIGN_MIDDLE_MENU_ITEM: MenuItemType;
13
- export declare const VERTICAL_ALIGN_BOTTOM_MENU_ITEM: MenuItemType;
14
- export declare const DELETE_COLUMN_MENU_ITEM: MenuItemType;
15
- export declare const LAYOUT_COLUMN_MENU_SECTION_RANK: Record<string, number>;
16
- export declare const LAYOUT_COLUMN_DANGER_SECTION_RANK: Record<string, number>;
17
- export declare const VERTICAL_ALIGN_MENU_RANK: Record<string, number>;
18
- export declare const VERTICAL_ALIGN_MENU_SECTION_RANK: Record<string, number>;
@@ -1,4 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { LayoutPlugin } from '../../layoutPluginType';
3
- import { type SelectedLayoutColumns } from '../../pm-plugins/utils/layout-column-selection';
4
- export declare const useSelectedLayoutColumns: (api: ExtractInjectionAPI<LayoutPlugin> | undefined) => SelectedLayoutColumns | undefined;
@@ -1,13 +0,0 @@
1
- import { type PopupPosition } from '@atlaskit/editor-common/ui';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export declare const LAYOUT_COLUMN_MENU_POPUP_OFFSET: [
4
- number,
5
- number
6
- ];
7
- export declare const shouldOpenLayoutColumnMenuBelow: ({ editorView, popup, scrollableElement, target, }: {
8
- editorView: EditorView;
9
- popup: HTMLElement;
10
- scrollableElement?: HTMLElement;
11
- target: HTMLElement;
12
- }) => boolean;
13
- export declare const calculateFallbackBottomPosition: (position: PopupPosition, target: HTMLElement, popup: HTMLElement) => PopupPosition;
@@ -1,5 +0,0 @@
1
- import type { Valign } from '@atlaskit/adf-schema/layout-column';
2
- import AlignPositionTopIcon from '@atlaskit/icon-lab/core/align-position-top';
3
- type VerticalAlignIcon = typeof AlignPositionTopIcon;
4
- export declare const VERTICAL_ALIGN_ICONS: Record<Valign, VerticalAlignIcon>;
5
- export {};
@@ -1,19 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { type IntlShape } from 'react-intl';
3
- interface Props {
4
- children: ReactNode;
5
- intl: IntlShape | undefined;
6
- }
7
- /**
8
- * Wraps the layout section nodeview children with the editor's actual
9
- * IntlProvider during SSR streaming (renderToStaticMarkup). This ensures any
10
- * descendants that call `useIntl()` (e.g. `BreakoutResizer`'s ARIA labels)
11
- * have a valid intl context and do not throw during the static render pass.
12
- *
13
- * Outside of SSR streaming this is a no-op passthrough.
14
- *
15
- * Follows the same pattern as `MediaSSRReactContextsProvider` and
16
- * `SyncBlockSSRReactContextsProvider`.
17
- */
18
- export declare function LayoutSSRReactContextsProvider({ children, intl }: Props): ReactNode;
19
- export {};
@@ -1,2 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- export declare const GlobalStylesWrapper: () => jsx.JSX.Element;
@@ -1,3 +0,0 @@
1
- import { jsx } from '@emotion/react';
2
- export declare const EditorLayoutFiveColumnsIcon: () => jsx.JSX.Element;
3
- export declare const EditorLayoutFourColumnsIcon: () => jsx.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { IconProps } from '@atlaskit/icon';
3
- export declare const LayoutThreeWithLeftSidebarsIcon: (props: Omit<IconProps, "glyph" | "size">) => React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { IconProps } from '@atlaskit/icon';
3
- export declare const LayoutThreeWithRightSidebarsIcon: (props: Omit<IconProps, "glyph" | "size">) => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { ExtractInjectionAPI, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
- import type { LayoutPlugin } from '../index';
5
- export declare const layoutToolbarTitle = "Layout floating controls";
6
- export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, allowAdvancedSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;