@atlaskit/editor-plugin-breakout 2.7.1 → 2.7.3
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 +23 -0
- package/dist/cjs/breakoutPlugin.js +25 -2
- package/dist/cjs/pm-plugins/get-guidelines.js +37 -17
- package/dist/cjs/pm-plugins/resizer-callbacks.js +61 -9
- package/dist/cjs/pm-plugins/resizing-plugin.js +39 -0
- package/dist/cjs/pm-plugins/utils/analytics.js +16 -1
- package/dist/cjs/ui/GuidelineLabel.js +44 -0
- package/dist/es2019/breakoutPlugin.js +26 -3
- package/dist/es2019/pm-plugins/get-guidelines.js +36 -16
- package/dist/es2019/pm-plugins/resizer-callbacks.js +57 -5
- package/dist/es2019/pm-plugins/resizing-plugin.js +38 -0
- package/dist/es2019/pm-plugins/utils/analytics.js +16 -0
- package/dist/es2019/ui/GuidelineLabel.js +38 -0
- package/dist/esm/breakoutPlugin.js +26 -3
- package/dist/esm/pm-plugins/get-guidelines.js +36 -16
- package/dist/esm/pm-plugins/resizer-callbacks.js +62 -10
- package/dist/esm/pm-plugins/resizing-plugin.js +38 -0
- package/dist/esm/pm-plugins/utils/analytics.js +15 -0
- package/dist/esm/ui/GuidelineLabel.js +37 -0
- package/dist/types/breakoutPluginType.d.ts +2 -0
- package/dist/types/pm-plugins/get-guidelines.d.ts +8 -0
- package/dist/types/pm-plugins/resizing-plugin.d.ts +8 -3
- package/dist/types/pm-plugins/utils/analytics.d.ts +5 -0
- package/dist/types/ui/GuidelineLabel.d.ts +13 -0
- package/dist/types-ts4.5/breakoutPluginType.d.ts +2 -0
- package/dist/types-ts4.5/pm-plugins/get-guidelines.d.ts +8 -0
- package/dist/types-ts4.5/pm-plugins/resizing-plugin.d.ts +8 -3
- package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +5 -0
- package/dist/types-ts4.5/ui/GuidelineLabel.d.ts +13 -0
- package/package.json +4 -4
|
@@ -4,6 +4,11 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
7
|
-
import type { BreakoutPluginOptions } from '../breakoutPluginType';
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
7
|
+
import type { BreakoutPluginOptions, BreakoutPluginState } from '../breakoutPluginType';
|
|
8
|
+
import { GUIDELINE_KEYS } from './get-guidelines';
|
|
9
|
+
export declare const resizingPluginKey: PluginKey<BreakoutPluginState>;
|
|
10
|
+
export type ActiveGuidelineKey = Exclude<(typeof GUIDELINE_KEYS)[keyof typeof GUIDELINE_KEYS], 'grid_left' | 'grid_right'>;
|
|
11
|
+
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, options?: BreakoutPluginOptions) => SafePlugin<BreakoutPluginState | {
|
|
12
|
+
activeGuidelineLabel: undefined;
|
|
13
|
+
breakoutNode: undefined;
|
|
14
|
+
}>;
|
|
@@ -5,3 +5,8 @@ export declare const generateResizeFrameRatePayloads: (props: {
|
|
|
5
5
|
frameRateSamples: number[];
|
|
6
6
|
originalNode: PMNode;
|
|
7
7
|
}) => BreakoutEventPayload[];
|
|
8
|
+
export declare const generateResizedEventPayload: ({ node, prevWidth, newWidth, }: {
|
|
9
|
+
node: PMNode;
|
|
10
|
+
prevWidth: number;
|
|
11
|
+
newWidth: number;
|
|
12
|
+
}) => BreakoutEventPayload;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
5
|
+
type GuidelineLabelProps = {
|
|
6
|
+
api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
|
|
7
|
+
editorView: EditorView;
|
|
8
|
+
mountPoint?: HTMLElement;
|
|
9
|
+
boundariesElement?: HTMLElement;
|
|
10
|
+
scrollableElement?: HTMLElement;
|
|
11
|
+
};
|
|
12
|
+
export declare const GuidelineLabel: ({ api, editorView, mountPoint, boundariesElement, scrollableElement, }: GuidelineLabelProps) => React.JSX.Element | null;
|
|
13
|
+
export {};
|
|
@@ -8,8 +8,10 @@ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
|
8
8
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
9
9
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
10
|
import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
11
|
+
import { ActiveGuidelineKey } from './pm-plugins/resizing-plugin';
|
|
11
12
|
export interface BreakoutPluginState {
|
|
12
13
|
breakoutNode: ContentNodeWithPos | undefined;
|
|
14
|
+
activeGuidelineKey: ActiveGuidelineKey | undefined;
|
|
13
15
|
}
|
|
14
16
|
export interface BreakoutPluginOptions {
|
|
15
17
|
allowBreakoutButton?: boolean;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { GuidelineConfig } from '@atlaskit/editor-common/guideline';
|
|
2
2
|
import { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
+
export declare const GUIDELINE_KEYS: {
|
|
5
|
+
readonly lineLengthLeft: "grid_left";
|
|
6
|
+
readonly lineLengthRight: "grid_right";
|
|
7
|
+
readonly wideLeft: "wide_left";
|
|
8
|
+
readonly wideRight: "wide_right";
|
|
9
|
+
readonly fullWidthLeft: "full_width_left";
|
|
10
|
+
readonly fullWidthRight: "full_width_right";
|
|
11
|
+
};
|
|
4
12
|
export declare const getGuidelines: import("memoize-one").MemoizedFn<(isResizing: boolean, newWidth: number, getEditorWidth: () => EditorContainerWidth | undefined, nodeType?: NodeType | undefined) => GuidelineConfig[]>;
|
|
@@ -4,6 +4,11 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
4
4
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
7
|
-
import type { BreakoutPluginOptions } from '../breakoutPluginType';
|
|
8
|
-
|
|
9
|
-
export declare const
|
|
7
|
+
import type { BreakoutPluginOptions, BreakoutPluginState } from '../breakoutPluginType';
|
|
8
|
+
import { GUIDELINE_KEYS } from './get-guidelines';
|
|
9
|
+
export declare const resizingPluginKey: PluginKey<BreakoutPluginState>;
|
|
10
|
+
export type ActiveGuidelineKey = Exclude<(typeof GUIDELINE_KEYS)[keyof typeof GUIDELINE_KEYS], 'grid_left' | 'grid_right'>;
|
|
11
|
+
export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, options?: BreakoutPluginOptions) => SafePlugin<BreakoutPluginState | {
|
|
12
|
+
activeGuidelineLabel: undefined;
|
|
13
|
+
breakoutNode: undefined;
|
|
14
|
+
}>;
|
|
@@ -5,3 +5,8 @@ export declare const generateResizeFrameRatePayloads: (props: {
|
|
|
5
5
|
frameRateSamples: number[];
|
|
6
6
|
originalNode: PMNode;
|
|
7
7
|
}) => BreakoutEventPayload[];
|
|
8
|
+
export declare const generateResizedEventPayload: ({ node, prevWidth, newWidth, }: {
|
|
9
|
+
node: PMNode;
|
|
10
|
+
prevWidth: number;
|
|
11
|
+
newWidth: number;
|
|
12
|
+
}) => BreakoutEventPayload;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import { BreakoutPlugin } from '../breakoutPluginType';
|
|
5
|
+
type GuidelineLabelProps = {
|
|
6
|
+
api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
|
|
7
|
+
editorView: EditorView;
|
|
8
|
+
mountPoint?: HTMLElement;
|
|
9
|
+
boundariesElement?: HTMLElement;
|
|
10
|
+
scrollableElement?: HTMLElement;
|
|
11
|
+
};
|
|
12
|
+
export declare const GuidelineLabel: ({ api, editorView, mountPoint, boundariesElement, scrollableElement, }: GuidelineLabelProps) => React.JSX.Element | null;
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-breakout",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"description": "Breakout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
-
"@atlaskit/editor-common": "^106.
|
|
38
|
-
"@atlaskit/editor-plugin-block-controls": "^3.
|
|
37
|
+
"@atlaskit/editor-common": "^106.6.0",
|
|
38
|
+
"@atlaskit/editor-plugin-block-controls": "^3.17.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
50
50
|
"@atlaskit/theme": "^18.0.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^6.
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^6.2.0",
|
|
52
52
|
"@atlaskit/tokens": "^5.1.0",
|
|
53
53
|
"@atlaskit/tooltip": "^20.3.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|