@atlaskit/editor-plugin-layout 0.1.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 (46) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +13 -0
  3. package/README.md +30 -0
  4. package/dist/cjs/actions.js +345 -0
  5. package/dist/cjs/index.js +12 -0
  6. package/dist/cjs/plugin.js +91 -0
  7. package/dist/cjs/pm-plugins/main.js +148 -0
  8. package/dist/cjs/pm-plugins/plugin-key.js +8 -0
  9. package/dist/cjs/pm-plugins/types.js +5 -0
  10. package/dist/cjs/toolbar.js +118 -0
  11. package/dist/cjs/types.js +5 -0
  12. package/dist/es2019/actions.js +328 -0
  13. package/dist/es2019/index.js +1 -0
  14. package/dist/es2019/plugin.js +75 -0
  15. package/dist/es2019/pm-plugins/main.js +142 -0
  16. package/dist/es2019/pm-plugins/plugin-key.js +2 -0
  17. package/dist/es2019/pm-plugins/types.js +1 -0
  18. package/dist/es2019/toolbar.js +100 -0
  19. package/dist/es2019/types.js +1 -0
  20. package/dist/esm/actions.js +336 -0
  21. package/dist/esm/index.js +1 -0
  22. package/dist/esm/plugin.js +79 -0
  23. package/dist/esm/pm-plugins/main.js +141 -0
  24. package/dist/esm/pm-plugins/plugin-key.js +2 -0
  25. package/dist/esm/pm-plugins/types.js +1 -0
  26. package/dist/esm/toolbar.js +108 -0
  27. package/dist/esm/types.js +1 -0
  28. package/dist/types/actions.d.ts +22 -0
  29. package/dist/types/index.d.ts +3 -0
  30. package/dist/types/plugin.d.ts +15 -0
  31. package/dist/types/pm-plugins/main.d.ts +6 -0
  32. package/dist/types/pm-plugins/plugin-key.d.ts +3 -0
  33. package/dist/types/pm-plugins/types.d.ts +14 -0
  34. package/dist/types/toolbar.d.ts +6 -0
  35. package/dist/types/types.d.ts +13 -0
  36. package/dist/types-ts4.5/actions.d.ts +22 -0
  37. package/dist/types-ts4.5/index.d.ts +3 -0
  38. package/dist/types-ts4.5/plugin.d.ts +18 -0
  39. package/dist/types-ts4.5/pm-plugins/main.d.ts +6 -0
  40. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +3 -0
  41. package/dist/types-ts4.5/pm-plugins/types.d.ts +14 -0
  42. package/dist/types-ts4.5/toolbar.d.ts +6 -0
  43. package/dist/types-ts4.5/types.d.ts +13 -0
  44. package/package.json +94 -0
  45. package/report.api.md +73 -0
  46. package/tmp/api-report-tmp.d.ts +43 -0
@@ -0,0 +1,108 @@
1
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
+ import commonMessages, { layoutMessages as toolbarMessages } from '@atlaskit/editor-common/messages';
3
+ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
4
+ import EditorLayoutSingleIcon from '@atlaskit/icon/glyph/editor/layout-single';
5
+ import LayoutThreeEqualIcon from '@atlaskit/icon/glyph/editor/layout-three-equal';
6
+ import LayoutThreeWithSidebarsIcon from '@atlaskit/icon/glyph/editor/layout-three-with-sidebars';
7
+ import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
8
+ import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-left-sidebar';
9
+ import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
10
+ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
11
+ import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from './actions';
12
+ var LAYOUT_TYPES = [{
13
+ id: 'editor.layout.twoEquals',
14
+ type: 'two_equal',
15
+ title: toolbarMessages.twoColumns,
16
+ icon: LayoutTwoEqualIcon
17
+ }, {
18
+ id: 'editor.layout.threeEquals',
19
+ type: 'three_equal',
20
+ title: toolbarMessages.threeColumns,
21
+ icon: LayoutThreeEqualIcon
22
+ }];
23
+ var LAYOUT_TYPES_WITH_SINGLE_COL = [{
24
+ id: 'editor.layout.singeLayout',
25
+ type: 'single',
26
+ title: toolbarMessages.singleColumn,
27
+ icon: EditorLayoutSingleIcon
28
+ }].concat(LAYOUT_TYPES);
29
+ var SIDEBAR_LAYOUT_TYPES = [{
30
+ id: 'editor.layout.twoRightSidebar',
31
+ type: 'two_right_sidebar',
32
+ title: toolbarMessages.rightSidebar,
33
+ icon: LayoutTwoRightSidebarIcon
34
+ }, {
35
+ id: 'editor.layout.twoLeftSidebar',
36
+ type: 'two_left_sidebar',
37
+ title: toolbarMessages.leftSidebar,
38
+ icon: LayoutTwoLeftSidebarIcon
39
+ }, {
40
+ id: 'editor.layout.threeWithSidebars',
41
+ type: 'three_with_sidebars',
42
+ title: toolbarMessages.threeColumnsWithSidebars,
43
+ icon: LayoutThreeWithSidebarsIcon
44
+ }];
45
+ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
46
+ return {
47
+ id: item.id,
48
+ type: 'button',
49
+ icon: item.icon,
50
+ testId: item.title.id ? "".concat(item.title.id) : undefined,
51
+ title: intl.formatMessage(item.title),
52
+ onClick: setPresetLayout(editorAnalyticsAPI)(item.type),
53
+ selected: !!currentLayout && currentLayout === item.type,
54
+ tabIndex: null
55
+ };
56
+ };
57
+ export var layoutToolbarTitle = 'Layout floating controls';
58
+ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) {
59
+ var _api$decorations$acti, _api$decorations, _api$analytics;
60
+ var _ref = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
61
+ hoverDecoration = _ref.hoverDecoration;
62
+ var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
63
+ var node = state.doc.nodeAt(pos);
64
+ if (node) {
65
+ var currentLayout = getPresetLayout(node);
66
+ var separator = {
67
+ type: 'separator'
68
+ };
69
+ var nodeType = state.schema.nodes.layoutSection;
70
+ var deleteButton = {
71
+ id: 'editor.layout.delete',
72
+ type: 'button',
73
+ appearance: 'danger',
74
+ focusEditoronEnter: true,
75
+ icon: RemoveIcon,
76
+ testId: commonMessages.remove.id,
77
+ title: intl.formatMessage(commonMessages.remove),
78
+ onClick: deleteActiveLayoutNode(editorAnalyticsAPI),
79
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
80
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
81
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
82
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
83
+ tabIndex: null
84
+ };
85
+ var layoutTypes = allowSingleColumnLayout ? LAYOUT_TYPES_WITH_SINGLE_COL : LAYOUT_TYPES;
86
+ return {
87
+ title: layoutToolbarTitle,
88
+ getDomRef: function getDomRef(view) {
89
+ return findDomRefAtPos(pos, view.domAtPos.bind(view));
90
+ },
91
+ nodeType: nodeType,
92
+ items: [].concat(_toConsumableArray(layoutTypes.map(function (i) {
93
+ return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
94
+ })), _toConsumableArray(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(function (i) {
95
+ return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
96
+ }) : []), [{
97
+ type: 'copy-button',
98
+ items: [separator, {
99
+ state: state,
100
+ formatMessage: intl.formatMessage,
101
+ nodeType: nodeType
102
+ }]
103
+ }, separator, deleteButton]),
104
+ scrollable: true
105
+ };
106
+ }
107
+ return;
108
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
+ import type { Command, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
3
+ import type { Node } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
5
+ import type { Change, PresetLayout } from './types';
6
+ export declare const ONE_COL_LAYOUTS: PresetLayout[];
7
+ export declare const TWO_COL_LAYOUTS: PresetLayout[];
8
+ export declare const THREE_COL_LAYOUTS: PresetLayout[];
9
+ /**
10
+ * Finds layout preset based on the width attrs of all the layoutColumn nodes
11
+ * inside the layoutSection node
12
+ */
13
+ export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
14
+ export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
+ export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
+ export declare const insertLayoutColumns: Command;
17
+ export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
+ export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
+ export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
20
+ export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
21
+ export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
22
+ export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -0,0 +1,3 @@
1
+ export { layoutPlugin } from './plugin';
2
+ export type { LayoutPlugin } from './plugin';
3
+ export type { LayoutPluginOptions } from './types';
@@ -0,0 +1,15 @@
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
4
+ import { insertLayoutColumnsWithAnalytics } from './actions';
5
+ import { pluginKey } from './pm-plugins/plugin-key';
6
+ import type { LayoutPluginOptions } from './types';
7
+ export { pluginKey };
8
+ export type LayoutPlugin = NextEditorPlugin<'layout', {
9
+ pluginConfiguration: LayoutPluginOptions | undefined;
10
+ dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
11
+ actions: {
12
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
13
+ };
14
+ }>;
15
+ export declare const layoutPlugin: LayoutPlugin;
@@ -0,0 +1,6 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import type { LayoutPluginOptions } from '../types';
3
+ import type { LayoutState } from './types';
4
+ export declare const DEFAULT_LAYOUT = "two_equal";
5
+ declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ import type { LayoutState } from './types';
3
+ export declare const pluginKey: PluginKey<LayoutState>;
@@ -0,0 +1,14 @@
1
+ import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import type { PresetLayout } from '../types';
3
+ export type LayoutState = {
4
+ pos: number | null;
5
+ allowBreakout: boolean;
6
+ addSidebarLayouts: boolean;
7
+ selectedLayout: PresetLayout | undefined;
8
+ allowSingleColumnLayout: boolean;
9
+ };
10
+ export type Change = {
11
+ from: number;
12
+ to: number;
13
+ slice: Slice;
14
+ };
@@ -0,0 +1,6 @@
1
+ import type { IntlShape } from 'react-intl-next';
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, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -0,0 +1,13 @@
1
+ import type { 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
+ UNSAFE_addSidebarLayouts?: boolean;
6
+ UNSAFE_allowSingleColumnLayout?: boolean;
7
+ }
8
+ export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
9
+ export interface Change {
10
+ from: number;
11
+ to: number;
12
+ slice: Slice;
13
+ }
@@ -0,0 +1,22 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
+ import type { Command, TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
3
+ import type { Node } from '@atlaskit/editor-prosemirror/model';
4
+ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
5
+ import type { Change, PresetLayout } from './types';
6
+ export declare const ONE_COL_LAYOUTS: PresetLayout[];
7
+ export declare const TWO_COL_LAYOUTS: PresetLayout[];
8
+ export declare const THREE_COL_LAYOUTS: PresetLayout[];
9
+ /**
10
+ * Finds layout preset based on the width attrs of all the layoutColumn nodes
11
+ * inside the layoutSection node
12
+ */
13
+ export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
14
+ export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
+ export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
+ export declare const insertLayoutColumns: Command;
17
+ export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
+ export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
+ export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
20
+ export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
21
+ export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
22
+ export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -0,0 +1,3 @@
1
+ export { layoutPlugin } from './plugin';
2
+ export type { LayoutPlugin } from './plugin';
3
+ export type { LayoutPluginOptions } from './types';
@@ -0,0 +1,18 @@
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
+ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
4
+ import { insertLayoutColumnsWithAnalytics } from './actions';
5
+ import { pluginKey } from './pm-plugins/plugin-key';
6
+ import type { LayoutPluginOptions } from './types';
7
+ export { pluginKey };
8
+ export type LayoutPlugin = NextEditorPlugin<'layout', {
9
+ pluginConfiguration: LayoutPluginOptions | undefined;
10
+ dependencies: [
11
+ DecorationsPlugin,
12
+ OptionalPlugin<AnalyticsPlugin>
13
+ ];
14
+ actions: {
15
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
16
+ };
17
+ }>;
18
+ export declare const layoutPlugin: LayoutPlugin;
@@ -0,0 +1,6 @@
1
+ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
+ import type { LayoutPluginOptions } from '../types';
3
+ import type { LayoutState } from './types';
4
+ export declare const DEFAULT_LAYOUT = "two_equal";
5
+ declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
6
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
+ import type { LayoutState } from './types';
3
+ export declare const pluginKey: PluginKey<LayoutState>;
@@ -0,0 +1,14 @@
1
+ import type { Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import type { PresetLayout } from '../types';
3
+ export type LayoutState = {
4
+ pos: number | null;
5
+ allowBreakout: boolean;
6
+ addSidebarLayouts: boolean;
7
+ selectedLayout: PresetLayout | undefined;
8
+ allowSingleColumnLayout: boolean;
9
+ };
10
+ export type Change = {
11
+ from: number;
12
+ to: number;
13
+ slice: Slice;
14
+ };
@@ -0,0 +1,6 @@
1
+ import type { IntlShape } from 'react-intl-next';
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, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -0,0 +1,13 @@
1
+ import type { 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
+ UNSAFE_addSidebarLayouts?: boolean;
6
+ UNSAFE_allowSingleColumnLayout?: boolean;
7
+ }
8
+ export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
9
+ export interface Change {
10
+ from: number;
11
+ to: number;
12
+ slice: Slice;
13
+ }
package/package.json ADDED
@@ -0,0 +1,94 @@
1
+ {
2
+ "name": "@atlaskit/editor-plugin-layout",
3
+ "version": "0.1.0",
4
+ "description": "Layout plugin for @atlaskit/editor-core",
5
+ "author": "Atlassian Pty Ltd",
6
+ "license": "Apache-2.0",
7
+ "publishConfig": {
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "atlassian": {
11
+ "team": "Editor: Jenga",
12
+ "inPublicMirror": false,
13
+ "releaseModel": "continuous"
14
+ },
15
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
16
+ "main": "dist/cjs/index.js",
17
+ "module": "dist/esm/index.js",
18
+ "module:es2019": "dist/es2019/index.js",
19
+ "types": "dist/types/index.d.ts",
20
+ "typesVersions": {
21
+ ">=4.5 <4.9": {
22
+ "*": [
23
+ "dist/types-ts4.5/*",
24
+ "dist/types-ts4.5/index.d.ts"
25
+ ]
26
+ }
27
+ },
28
+ "sideEffects": false,
29
+ "atlaskit:src": "src/index.ts",
30
+ "af:exports": {
31
+ ".": "./src/index.ts"
32
+ },
33
+ "dependencies": {
34
+ "@atlaskit/adf-schema": "^32.0.0",
35
+ "@atlaskit/editor-common": "^76.17.0",
36
+ "@atlaskit/editor-plugin-analytics": "^0.3.0",
37
+ "@atlaskit/editor-plugin-decorations": "^0.2.0",
38
+ "@atlaskit/editor-prosemirror": "1.1.0",
39
+ "@atlaskit/icon": "^21.12.0",
40
+ "@babel/runtime": "^7.0.0"
41
+ },
42
+ "peerDependencies": {
43
+ "react": "^16.8.0",
44
+ "react-intl-next": "npm:react-intl@^5.18.1"
45
+ },
46
+ "devDependencies": {
47
+ "@af/integration-testing": "*",
48
+ "@af/visual-regression": "*",
49
+ "@atlaskit/ssr": "*",
50
+ "@atlaskit/visual-regression": "*",
51
+ "@atlaskit/webdriver-runner": "*",
52
+ "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
53
+ "@testing-library/react": "^12.1.5",
54
+ "react-dom": "^16.8.0",
55
+ "typescript": "~4.9.5",
56
+ "wait-for-expect": "^1.2.0"
57
+ },
58
+ "techstack": {
59
+ "@atlassian/frontend": {
60
+ "import-structure": [
61
+ "atlassian-conventions"
62
+ ],
63
+ "circular-dependencies": [
64
+ "file-and-folder-level"
65
+ ]
66
+ },
67
+ "@repo/internal": {
68
+ "dom-events": "use-bind-event-listener",
69
+ "analytics": [
70
+ "analytics-next"
71
+ ],
72
+ "design-tokens": [
73
+ "color"
74
+ ],
75
+ "theming": [
76
+ "react-context"
77
+ ],
78
+ "ui-components": [
79
+ "lite-mode"
80
+ ],
81
+ "deprecation": [
82
+ "no-deprecated-imports"
83
+ ],
84
+ "styling": [
85
+ "static",
86
+ "emotion"
87
+ ],
88
+ "imports": [
89
+ "import-no-extraneous-disable-for-examples-and-docs"
90
+ ]
91
+ }
92
+ },
93
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
94
+ }
package/report.api.md ADDED
@@ -0,0 +1,73 @@
1
+ <!-- API Report Version: 2.3 -->
2
+
3
+ ## API Report File for "@atlaskit/editor-plugin-layout"
4
+
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
12
+
13
+ ### Main Entry Types
14
+
15
+ <!--SECTION START: Main Entry Types-->
16
+
17
+ ```ts
18
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
19
+ import type { Command } from '@atlaskit/editor-common/types';
20
+ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
21
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
22
+ import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
23
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
24
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
25
+ import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
26
+
27
+ // @public (undocumented)
28
+ const insertLayoutColumnsWithAnalytics: (
29
+ editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
30
+ ) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
31
+
32
+ // @public (undocumented)
33
+ export type LayoutPlugin = NextEditorPlugin<
34
+ 'layout',
35
+ {
36
+ pluginConfiguration: LayoutPluginOptions | undefined;
37
+ dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
38
+ actions: {
39
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
40
+ };
41
+ }
42
+ >;
43
+
44
+ // @public (undocumented)
45
+ export const layoutPlugin: LayoutPlugin;
46
+
47
+ // @public (undocumented)
48
+ export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
49
+ // (undocumented)
50
+ allowBreakout?: boolean;
51
+ // (undocumented)
52
+ UNSAFE_addSidebarLayouts?: boolean;
53
+ // (undocumented)
54
+ UNSAFE_allowSingleColumnLayout?: boolean;
55
+ }
56
+
57
+ // (No @packageDocumentation comment for this package)
58
+ ```
59
+
60
+ <!--SECTION END: Main Entry Types-->
61
+
62
+ ### Peer Dependencies
63
+
64
+ <!--SECTION START: Peer Dependencies-->
65
+
66
+ ```json
67
+ {
68
+ "react": "^16.8.0",
69
+ "react-intl-next": "npm:react-intl@^5.18.1"
70
+ }
71
+ ```
72
+
73
+ <!--SECTION END: Peer Dependencies-->
@@ -0,0 +1,43 @@
1
+ ## API Report File for "@atlaskit/editor-plugin-layout"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
8
+ import type { Command } from '@atlaskit/editor-common/types';
9
+ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
10
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
11
+ import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
12
+ import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
13
+ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
14
+ import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
15
+
16
+ // @public (undocumented)
17
+ const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
+
19
+ // @public (undocumented)
20
+ export type LayoutPlugin = NextEditorPlugin<'layout', {
21
+ pluginConfiguration: LayoutPluginOptions | undefined;
22
+ dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
23
+ actions: {
24
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
25
+ };
26
+ }>;
27
+
28
+ // @public (undocumented)
29
+ export const layoutPlugin: LayoutPlugin;
30
+
31
+ // @public (undocumented)
32
+ export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
33
+ // (undocumented)
34
+ allowBreakout?: boolean;
35
+ // (undocumented)
36
+ UNSAFE_addSidebarLayouts?: boolean;
37
+ // (undocumented)
38
+ UNSAFE_allowSingleColumnLayout?: boolean;
39
+ }
40
+
41
+ // (No @packageDocumentation comment for this package)
42
+
43
+ ```