@atlaskit/editor-plugin-layout 10.3.2 → 10.3.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 +14 -0
- package/dist/cjs/layoutPlugin.js +5 -1
- package/dist/cjs/pm-plugins/actions.js +30 -5
- package/dist/cjs/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +40 -0
- package/dist/cjs/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +39 -0
- package/dist/cjs/ui/LayoutColumnMenu/components.js +59 -22
- package/dist/cjs/ui/LayoutColumnMenu/index.js +23 -4
- package/dist/cjs/ui/LayoutColumnMenu/keys.js +58 -0
- package/dist/cjs/ui/LayoutColumnMenu/useCurrentLayoutColumnValign.js +22 -0
- package/dist/cjs/ui/LayoutColumnMenu/verticalAlignIcons.js +18 -0
- package/dist/es2019/layoutPlugin.js +7 -3
- package/dist/es2019/pm-plugins/actions.js +27 -0
- package/dist/es2019/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +35 -0
- package/dist/es2019/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +35 -0
- package/dist/es2019/ui/LayoutColumnMenu/components.js +54 -18
- package/dist/es2019/ui/LayoutColumnMenu/index.js +24 -5
- package/dist/es2019/ui/LayoutColumnMenu/keys.js +61 -0
- package/dist/es2019/ui/LayoutColumnMenu/useCurrentLayoutColumnValign.js +14 -0
- package/dist/es2019/ui/LayoutColumnMenu/verticalAlignIcons.js +11 -0
- package/dist/esm/layoutPlugin.js +7 -3
- package/dist/esm/pm-plugins/actions.js +29 -4
- package/dist/esm/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +32 -0
- package/dist/esm/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +32 -0
- package/dist/esm/ui/LayoutColumnMenu/components.js +51 -14
- package/dist/esm/ui/LayoutColumnMenu/index.js +24 -5
- package/dist/esm/ui/LayoutColumnMenu/keys.js +51 -0
- package/dist/esm/ui/LayoutColumnMenu/useCurrentLayoutColumnValign.js +16 -0
- package/dist/esm/ui/LayoutColumnMenu/verticalAlignIcons.js +11 -0
- package/dist/types/layoutPluginType.d.ts +2 -1
- package/dist/types/pm-plugins/actions.d.ts +2 -0
- package/dist/types/ui/LayoutColumnMenu/VerticalAlignDropdownItem.d.ts +14 -0
- package/dist/types/ui/LayoutColumnMenu/VerticalAlignNestedMenu.d.ts +8 -0
- package/dist/types/ui/LayoutColumnMenu/components.d.ts +0 -4
- package/dist/types/ui/LayoutColumnMenu/keys.d.ts +13 -0
- package/dist/types/ui/LayoutColumnMenu/useCurrentLayoutColumnValign.d.ts +11 -0
- package/dist/types/ui/LayoutColumnMenu/verticalAlignIcons.d.ts +5 -0
- package/dist/types-ts4.5/layoutPluginType.d.ts +2 -1
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +2 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/VerticalAlignDropdownItem.d.ts +14 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/VerticalAlignNestedMenu.d.ts +8 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/components.d.ts +0 -4
- package/dist/types-ts4.5/ui/LayoutColumnMenu/keys.d.ts +13 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/useCurrentLayoutColumnValign.d.ts +11 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/verticalAlignIcons.d.ts +5 -0
- package/package.json +6 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Command, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
4
5
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
import type { Change, PresetLayout } from '../types';
|
|
@@ -26,6 +27,7 @@ export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI |
|
|
|
26
27
|
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
27
28
|
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
28
29
|
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD.FLOATING_TB) => Command;
|
|
30
|
+
export declare const setLayoutColumnValign: (valign: Valign) => EditorCommand;
|
|
29
31
|
export declare const toggleLayoutColumnMenu: ({ isOpen }: {
|
|
30
32
|
isOpen?: boolean;
|
|
31
33
|
}) => EditorCommand;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MessageDescriptor } from 'react-intl';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
5
|
+
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
6
|
+
export type VerticalAlignOption = {
|
|
7
|
+
label: MessageDescriptor;
|
|
8
|
+
value: Valign;
|
|
9
|
+
};
|
|
10
|
+
type VerticalAlignDropdownItemProps = VerticalAlignOption & {
|
|
11
|
+
api: ExtractInjectionAPI<LayoutPlugin> | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const VerticalAlignDropdownItem: ({ api, label, value, }: VerticalAlignDropdownItemProps) => React.JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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,10 +1,6 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { RegisterComponent, SurfaceFallbacks } from '@atlaskit/editor-ui-control-model';
|
|
3
3
|
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
4
|
-
export declare const LAYOUT_COLUMN_MENU: {
|
|
5
|
-
key: string;
|
|
6
|
-
type: "menu";
|
|
7
|
-
};
|
|
8
4
|
export declare const LAYOUT_COLUMN_MENU_FALLBACKS: SurfaceFallbacks;
|
|
9
5
|
export declare const getLayoutColumnMenuComponents: ({ api, }: {
|
|
10
6
|
api: ExtractInjectionAPI<LayoutPlugin> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
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_MENU_RANK: Record<string, number>;
|
|
6
|
+
export declare const VERTICAL_ALIGN_MENU: NestedMenuType;
|
|
7
|
+
export declare const DISTRIBUTE_COLUMNS_MENU_ITEM: MenuItemType;
|
|
8
|
+
export declare const VERTICAL_ALIGN_TOP_MENU_ITEM: MenuItemType;
|
|
9
|
+
export declare const VERTICAL_ALIGN_MIDDLE_MENU_ITEM: MenuItemType;
|
|
10
|
+
export declare const VERTICAL_ALIGN_BOTTOM_MENU_ITEM: MenuItemType;
|
|
11
|
+
export declare const LAYOUT_COLUMN_MENU_SECTION_RANK: Record<string, number>;
|
|
12
|
+
export declare const VERTICAL_ALIGN_MENU_RANK: Record<string, number>;
|
|
13
|
+
export declare const VERTICAL_ALIGN_MENU_SECTION_RANK: Record<string, number>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
3
|
+
import type { Node as ProsemirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
6
|
+
export type CurrentLayoutColumnValignState = {
|
|
7
|
+
currentValign: Valign | undefined;
|
|
8
|
+
selectedColumn: ProsemirrorNode | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare const getCurrentLayoutColumnValign: (selection: Selection | undefined) => CurrentLayoutColumnValignState;
|
|
11
|
+
export declare const useCurrentLayoutColumnValign: (api: ExtractInjectionAPI<LayoutPlugin> | undefined) => CurrentLayoutColumnValignState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
2
|
+
import AlignContentTopIcon from '@atlaskit/icon-lab/core/align-content-top';
|
|
3
|
+
type VerticalAlignIcon = typeof AlignContentTopIcon;
|
|
4
|
+
export declare const VERTICAL_ALIGN_ICONS: Record<Valign, VerticalAlignIcon>;
|
|
5
|
+
export {};
|
|
@@ -9,7 +9,7 @@ import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
|
9
9
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
10
10
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
11
11
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
12
|
-
import type { insertLayoutColumnsWithAnalytics, toggleLayoutColumnMenu } from './pm-plugins/actions';
|
|
12
|
+
import type { insertLayoutColumnsWithAnalytics, setLayoutColumnValign, toggleLayoutColumnMenu } from './pm-plugins/actions';
|
|
13
13
|
import type { LayoutState } from './pm-plugins/types';
|
|
14
14
|
import type { LayoutPluginOptions } from './types';
|
|
15
15
|
export type LayoutPluginDependencies = [
|
|
@@ -29,6 +29,7 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
|
29
29
|
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
30
30
|
};
|
|
31
31
|
commands: {
|
|
32
|
+
setLayoutColumnValign: typeof setLayoutColumnValign;
|
|
32
33
|
toggleLayoutColumnMenu: typeof toggleLayoutColumnMenu;
|
|
33
34
|
};
|
|
34
35
|
dependencies: LayoutPluginDependencies;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import type { Command, EditorCommand, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
4
5
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
5
6
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
import type { Change, PresetLayout } from '../types';
|
|
@@ -26,6 +27,7 @@ export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI |
|
|
|
26
27
|
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
27
28
|
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
28
29
|
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, inputMethod?: INPUT_METHOD.FLOATING_TB) => Command;
|
|
30
|
+
export declare const setLayoutColumnValign: (valign: Valign) => EditorCommand;
|
|
29
31
|
export declare const toggleLayoutColumnMenu: ({ isOpen }: {
|
|
30
32
|
isOpen?: boolean;
|
|
31
33
|
}) => EditorCommand;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MessageDescriptor } from 'react-intl';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
5
|
+
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
6
|
+
export type VerticalAlignOption = {
|
|
7
|
+
label: MessageDescriptor;
|
|
8
|
+
value: Valign;
|
|
9
|
+
};
|
|
10
|
+
type VerticalAlignDropdownItemProps = VerticalAlignOption & {
|
|
11
|
+
api: ExtractInjectionAPI<LayoutPlugin> | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const VerticalAlignDropdownItem: ({ api, label, value, }: VerticalAlignDropdownItemProps) => React.JSX.Element | null;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
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,10 +1,6 @@
|
|
|
1
1
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { RegisterComponent, SurfaceFallbacks } from '@atlaskit/editor-ui-control-model';
|
|
3
3
|
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
4
|
-
export declare const LAYOUT_COLUMN_MENU: {
|
|
5
|
-
key: string;
|
|
6
|
-
type: "menu";
|
|
7
|
-
};
|
|
8
4
|
export declare const LAYOUT_COLUMN_MENU_FALLBACKS: SurfaceFallbacks;
|
|
9
5
|
export declare const getLayoutColumnMenuComponents: ({ api, }: {
|
|
10
6
|
api: ExtractInjectionAPI<LayoutPlugin> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
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_MENU_RANK: Record<string, number>;
|
|
6
|
+
export declare const VERTICAL_ALIGN_MENU: NestedMenuType;
|
|
7
|
+
export declare const DISTRIBUTE_COLUMNS_MENU_ITEM: MenuItemType;
|
|
8
|
+
export declare const VERTICAL_ALIGN_TOP_MENU_ITEM: MenuItemType;
|
|
9
|
+
export declare const VERTICAL_ALIGN_MIDDLE_MENU_ITEM: MenuItemType;
|
|
10
|
+
export declare const VERTICAL_ALIGN_BOTTOM_MENU_ITEM: MenuItemType;
|
|
11
|
+
export declare const LAYOUT_COLUMN_MENU_SECTION_RANK: Record<string, number>;
|
|
12
|
+
export declare const VERTICAL_ALIGN_MENU_RANK: Record<string, number>;
|
|
13
|
+
export declare const VERTICAL_ALIGN_MENU_SECTION_RANK: Record<string, number>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
3
|
+
import type { Node as ProsemirrorNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import type { LayoutPlugin } from '../../layoutPluginType';
|
|
6
|
+
export type CurrentLayoutColumnValignState = {
|
|
7
|
+
currentValign: Valign | undefined;
|
|
8
|
+
selectedColumn: ProsemirrorNode | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare const getCurrentLayoutColumnValign: (selection: Selection | undefined) => CurrentLayoutColumnValignState;
|
|
11
|
+
export declare const useCurrentLayoutColumnValign: (api: ExtractInjectionAPI<LayoutPlugin> | undefined) => CurrentLayoutColumnValignState;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Valign } from '@atlaskit/editor-common/types/valign';
|
|
2
|
+
import AlignContentTopIcon from '@atlaskit/icon-lab/core/align-content-top';
|
|
3
|
+
type VerticalAlignIcon = typeof AlignContentTopIcon;
|
|
4
|
+
export declare const VERTICAL_ALIGN_ICONS: Record<Valign, VerticalAlignIcon>;
|
|
5
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.4",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/adf-schema": "^52.
|
|
32
|
+
"@atlaskit/adf-schema": "^52.13.0",
|
|
33
33
|
"@atlaskit/css": "^0.19.0",
|
|
34
34
|
"@atlaskit/editor-plugin-analytics": "^10.1.0",
|
|
35
35
|
"@atlaskit/editor-plugin-block-menu": "^9.2.0",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"@atlaskit/editor-plugin-width": "^11.1.0",
|
|
44
44
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
45
45
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
46
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
46
|
+
"@atlaskit/editor-toolbar": "^1.6.0",
|
|
47
47
|
"@atlaskit/editor-ui-control-model": "^1.2.0",
|
|
48
|
-
"@atlaskit/icon": "^
|
|
48
|
+
"@atlaskit/icon": "^35.0.0",
|
|
49
49
|
"@atlaskit/icon-lab": "^6.9.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^82.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.0.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1",
|
|
55
55
|
"bind-event-listener": "^3.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^114.
|
|
58
|
+
"@atlaskit/editor-common": "^114.36.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
61
61
|
},
|