@atlaskit/editor-plugin-breakout 11.0.14 → 11.0.16

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 (28) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/breakoutPlugin/package.json +1 -8
  3. package/breakoutPluginType/package.json +1 -8
  4. package/package.json +2 -2
  5. package/dist/types-ts4.5/breakoutPlugin.d.ts +0 -2
  6. package/dist/types-ts4.5/breakoutPluginType.d.ts +0 -34
  7. package/dist/types-ts4.5/editor-commands/remove-breakout.d.ts +0 -2
  8. package/dist/types-ts4.5/editor-commands/set-breakout-mode.d.ts +0 -2
  9. package/dist/types-ts4.5/editor-commands/set-breakout-width.d.ts +0 -2
  10. package/dist/types-ts4.5/entry-points/breakoutPlugin.d.ts +0 -1
  11. package/dist/types-ts4.5/entry-points/breakoutPluginType.d.ts +0 -1
  12. package/dist/types-ts4.5/index.d.ts +0 -2
  13. package/dist/types-ts4.5/pm-plugins/get-guidelines.d.ts +0 -15
  14. package/dist/types-ts4.5/pm-plugins/handle-key-down.d.ts +0 -4
  15. package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +0 -5
  16. package/dist/types-ts4.5/pm-plugins/pragmatic-resizer.d.ts +0 -16
  17. package/dist/types-ts4.5/pm-plugins/resizer-callbacks.d.ts +0 -22
  18. package/dist/types-ts4.5/pm-plugins/resizing-mark-view.d.ts +0 -33
  19. package/dist/types-ts4.5/pm-plugins/resizing-plugin.d.ts +0 -13
  20. package/dist/types-ts4.5/pm-plugins/utils/analytics.d.ts +0 -12
  21. package/dist/types-ts4.5/pm-plugins/utils/find-breakout-node.d.ts +0 -9
  22. package/dist/types-ts4.5/pm-plugins/utils/get-breakout-mode.d.ts +0 -7
  23. package/dist/types-ts4.5/pm-plugins/utils/is-breakout-mark-allowed.d.ts +0 -9
  24. package/dist/types-ts4.5/pm-plugins/utils/is-supported-node.d.ts +0 -6
  25. package/dist/types-ts4.5/pm-plugins/utils/measure-framerate.d.ts +0 -30
  26. package/dist/types-ts4.5/pm-plugins/utils/single-player-expand.d.ts +0 -12
  27. package/dist/types-ts4.5/ui/GuidelineLabel.d.ts +0 -13
  28. package/dist/types-ts4.5/ui/LayoutButton.d.ts +0 -20
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-breakout
2
2
 
3
+ ## 11.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.0.15
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 11.0.14
4
16
 
5
17
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/breakoutPlugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/breakoutPlugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/breakoutPlugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/breakoutPluginType.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/breakoutPluginType.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/breakoutPluginType.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-breakout",
3
- "version": "11.0.14",
3
+ "version": "11.0.16",
4
4
  "description": "Breakout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/pragmatic-drag-and-drop": "^1.8.0",
45
45
  "@atlaskit/theme": "^25.0.0",
46
- "@atlaskit/tmp-editor-statsig": "^101.0.0",
46
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
47
47
  "@atlaskit/tokens": "^13.4.0",
48
48
  "@atlaskit/tooltip": "^22.6.0",
49
49
  "@babel/runtime": "^7.0.0",
@@ -1,2 +0,0 @@
1
- import type { BreakoutPlugin } from './breakoutPluginType';
2
- export declare const breakoutPlugin: BreakoutPlugin;
@@ -1,34 +0,0 @@
1
- import type { EditorAppearance, 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 { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
5
- import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
6
- import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
7
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
8
- import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
9
- import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
10
- import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
11
- import type { ActiveGuidelineKey } from './pm-plugins/resizing-plugin';
12
- export interface BreakoutPluginState {
13
- activeGuidelineKey: ActiveGuidelineKey | undefined;
14
- breakoutNode: ContentNodeWithPos | undefined;
15
- }
16
- export interface BreakoutPluginOptions {
17
- allowBreakoutButton?: boolean;
18
- appearance?: EditorAppearance;
19
- }
20
- export type BreakoutPluginDependencies = [
21
- WidthPlugin,
22
- OptionalPlugin<EditorViewModePlugin>,
23
- OptionalPlugin<EditorDisabledPlugin>,
24
- OptionalPlugin<BlockControlsPlugin>,
25
- OptionalPlugin<InteractionPlugin>,
26
- OptionalPlugin<UserIntentPlugin>,
27
- OptionalPlugin<GuidelinePlugin>,
28
- OptionalPlugin<AnalyticsPlugin>
29
- ];
30
- export type BreakoutPlugin = NextEditorPlugin<'breakout', {
31
- dependencies: BreakoutPluginDependencies;
32
- pluginConfiguration: BreakoutPluginOptions | undefined;
33
- sharedState: Partial<BreakoutPluginState>;
34
- }>;
@@ -1,2 +0,0 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- export declare function removeBreakout(isLivePage?: boolean): Command;
@@ -1,2 +0,0 @@
1
- import type { BreakoutMode, Command } from '@atlaskit/editor-common/types';
2
- export declare function setBreakoutMode(mode: BreakoutMode, isLivePage?: boolean): Command;
@@ -1,2 +0,0 @@
1
- import type { BreakoutMode, Command } from '@atlaskit/editor-common/types';
2
- export declare function setBreakoutWidth(width: number, mode: BreakoutMode, pos: number, isLivePage?: boolean): Command;
@@ -1 +0,0 @@
1
- export { breakoutPlugin } from '../breakoutPlugin';
@@ -1 +0,0 @@
1
- export type { BreakoutPlugin, BreakoutPluginOptions, BreakoutPluginState, BreakoutPluginDependencies, } from '../breakoutPluginType';
@@ -1,2 +0,0 @@
1
- export { breakoutPlugin } from './breakoutPlugin';
2
- export type { BreakoutPlugin, BreakoutPluginOptions, BreakoutPluginState, BreakoutPluginDependencies, } from './breakoutPluginType';
@@ -1,15 +0,0 @@
1
- import type { MemoizedFn } from 'memoize-one';
2
- import type { GuidelineConfig } from '@atlaskit/editor-common/guideline';
3
- import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
4
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
5
- export declare const GUIDELINE_KEYS: {
6
- readonly lineLengthLeft: "grid_left";
7
- readonly lineLengthRight: "grid_right";
8
- readonly wideLeft: "wide_left";
9
- readonly wideRight: "wide_right";
10
- readonly fullWidthLeft: "full_width_left";
11
- readonly fullWidthRight: "full_width_right";
12
- readonly maxWidthLeft: "max_width_left";
13
- readonly maxWidthRight: "max_width_right";
14
- };
15
- export declare const getGuidelines: MemoizedFn<(isResizing: boolean, newWidth: number, getEditorWidth: () => EditorContainerWidth | undefined, nodeType?: NodeType | undefined) => GuidelineConfig[]>;
@@ -1,4 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { BreakoutPlugin } from '../breakoutPluginType';
4
- export declare const handleKeyDown: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined) => (view: EditorView, event: KeyboardEvent) => boolean;
@@ -1,5 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
3
- import type { BreakoutPluginState } from '../breakoutPluginType';
4
- export declare const pluginKey: PluginKey<BreakoutPluginState>;
5
- export declare const getPluginState: (state: EditorState) => BreakoutPluginState | undefined;
@@ -1,16 +0,0 @@
1
- import type { IntlShape, MessageDescriptor } from 'react-intl';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { BaseEventPayload, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
4
- export declare const resizeHandleMessage: Record<string, MessageDescriptor>;
5
- export declare const createPragmaticResizer: ({ target, onDragStart, onDrag, onDrop, intl, nodeViewPortalProviderAPI, }: {
6
- intl: IntlShape;
7
- nodeViewPortalProviderAPI: PortalProviderAPI;
8
- onDrag: (args: BaseEventPayload<ElementDragType>) => void;
9
- onDragStart: (args: BaseEventPayload<ElementDragType>) => void;
10
- onDrop: (args: BaseEventPayload<ElementDragType>) => void;
11
- target: HTMLElement;
12
- }) => {
13
- rightHandle: HTMLDivElement;
14
- leftHandle: HTMLDivElement;
15
- destroy: (isChangeToViewMode?: boolean) => void;
16
- };
@@ -1,22 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { Mark } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { ElementDragPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
5
- import type { BaseEventPayload, DragLocationHistory, ElementDragType } from '@atlaskit/pragmatic-drag-and-drop/types';
6
- import type { BreakoutPlugin } from '../breakoutPluginType';
7
- export declare function getProposedWidth({ initialWidth, location, api, source, }: {
8
- api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
9
- initialWidth: number;
10
- location: DragLocationHistory;
11
- source: ElementDragPayload;
12
- }): number;
13
- export declare function createResizerCallbacks({ dom, view, mark, api, }: {
14
- api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
15
- dom: HTMLElement;
16
- mark: Mark;
17
- view: EditorView;
18
- }): {
19
- onDrag: (args: BaseEventPayload<ElementDragType>) => void;
20
- onDragStart: () => void;
21
- onDrop: (args: BaseEventPayload<ElementDragType>) => void;
22
- };
@@ -1,33 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { Mark } from '@atlaskit/editor-prosemirror/model';
5
- import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
6
- import type { BreakoutPlugin } from '../breakoutPluginType';
7
- export declare const LOCAL_RESIZE_PROPERTY = "--local-resizing-width";
8
- export declare class ResizingMarkView implements NodeView {
9
- dom: HTMLElement;
10
- contentDOM: HTMLElement;
11
- view: EditorView;
12
- mark: Mark;
13
- destroyFn: ((isChangeToViewMode?: boolean) => void) | undefined;
14
- intl: IntlShape;
15
- nodeViewPortalProviderAPI: PortalProviderAPI;
16
- unsubscribeToViewModeChange: (() => void) | undefined;
17
- isResizingInitialised: boolean;
18
- /**
19
- * Wrap node view in a resizing mark view
20
- * @param {Mark} mark - The breakout mark to resize
21
- * @param {EditorView} view - The editor view
22
- * @param {ExtractInjectionAPI<BreakoutPlugin> | undefined} api - The pluginInjectionAPI
23
- * @param {Function} getIntl - () => IntlShape
24
- * @param {PortalProviderAPI} - The nodeViewPortalProviderAPI
25
- * @example
26
- * ```ts
27
- * ```
28
- */
29
- constructor(mark: Mark, view: EditorView, api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI);
30
- setupResizerCallbacks(dom: HTMLElement, contentDOM: HTMLElement, view: EditorView, mark: Mark, api?: ExtractInjectionAPI<BreakoutPlugin>): void;
31
- ignoreMutation(): boolean;
32
- destroy(): void;
33
- }
@@ -1,13 +0,0 @@
1
- import type { IntlShape } from 'react-intl';
2
- import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
6
- import type { BreakoutPlugin, BreakoutPluginOptions, BreakoutPluginState } from '../breakoutPluginType';
7
- import type { GUIDELINE_KEYS } from './get-guidelines';
8
- export declare const resizingPluginKey: PluginKey<BreakoutPluginState>;
9
- export type ActiveGuidelineKey = Exclude<(typeof GUIDELINE_KEYS)[keyof typeof GUIDELINE_KEYS], 'grid_left' | 'grid_right'>;
10
- export declare const createResizingPlugin: (api: ExtractInjectionAPI<BreakoutPlugin> | undefined, getIntl: () => IntlShape, nodeViewPortalProviderAPI: PortalProviderAPI, options?: BreakoutPluginOptions) => SafePlugin<BreakoutPluginState | {
11
- activeGuidelineLabel: undefined;
12
- breakoutNode: undefined;
13
- }>;
@@ -1,12 +0,0 @@
1
- import type { BreakoutEventPayload } from '@atlaskit/editor-common/analytics';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- export declare const generateResizeFrameRatePayloads: (props: {
4
- docSize: number;
5
- frameRateSamples: number[];
6
- originalNode: PMNode;
7
- }) => BreakoutEventPayload[];
8
- export declare const generateResizedEventPayload: ({ node, prevWidth, newWidth, }: {
9
- newWidth: number;
10
- node: PMNode;
11
- prevWidth: number;
12
- }) => BreakoutEventPayload;
@@ -1,9 +0,0 @@
1
- import type { Selection } from '@atlaskit/editor-prosemirror/state';
2
- import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
3
- /**
4
- * Find the nearest parent node to the selection that supports breakout, or if the nearest
5
- * matching parent node is the doc, return undefined.
6
- * For depth, if a node is selected and supports breakout, return the depth of the node.
7
- * @param selection Current editor selection
8
- */
9
- export declare function findSupportedNodeForBreakout(selection: Selection): ContentNodeWithPos | undefined;
@@ -1,7 +0,0 @@
1
- import type { BreakoutMode } from '@atlaskit/editor-common/types';
2
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
- /**
4
- * Get the current mode of the breakout at the selection
5
- * @param state Current EditorState
6
- */
7
- export declare function getBreakoutMode(state: EditorState): BreakoutMode | undefined;
@@ -1,9 +0,0 @@
1
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- /**
3
- * Check if breakout should be allowed for the current selection. If a node is selected,
4
- * can this node be broken out, if text, can the enclosing parent node be broken out.
5
- *
6
- * Currently breakout of a node is not possible if it's nested in anything but the document, however
7
- * this logic supports this changing.
8
- */
9
- export declare function isBreakoutMarkAllowed(state: EditorState): boolean;
@@ -1,6 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- /**
3
- * Check if breakout can be applied to a node
4
- * @param node Node to check
5
- */
6
- export declare function isSupportedNodeForBreakout(node: PMNode): boolean;
@@ -1,30 +0,0 @@
1
- /**
2
- * Measure the FPS of a resizing component.
3
- *
4
- * This is a simplified version of the `useMeasureFramerate` hook from `editor-plugin-table`.
5
- * (packages/editor/editor-plugin-table/src/pm-plugins/utils/analytics.ts)
6
- */
7
- export declare const reduceResizeFrameRateSamples: (frameRateSamples: number[]) => number[];
8
- type MeasureFramerateConfig = {
9
- maxSamples?: number;
10
- minFrames?: number;
11
- minTimeMs?: number;
12
- sampleRateMs?: number;
13
- timeoutMs?: number;
14
- };
15
- /**
16
- * Measures the framerate of a component over a given time period.
17
- * @param {object} [config] - Configuration options for framerate measurement.
18
- * @returns {object} An object containing startMeasure, endMeasure, and countFrames methods.
19
- * @example
20
- * const { startMeasure, endMeasure, countFrames } = measureFramerate();
21
- * startMeasure();
22
- * // ... animation loop with countFrames() calls
23
- * const samples = endMeasure(); // [60, 58, 62]
24
- */
25
- export declare const measureFramerate: (config?: MeasureFramerateConfig) => {
26
- startMeasure: () => void;
27
- endMeasure: () => number[];
28
- countFrames: () => void;
29
- };
30
- export {};
@@ -1,12 +0,0 @@
1
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { ContentNodeWithPos } from '@atlaskit/editor-prosemirror/utils';
4
- interface UpdateExpandedStateNew {
5
- isLivePage?: boolean;
6
- node: PMNode;
7
- pos: number;
8
- tr: Transaction;
9
- }
10
- export declare const updateExpandedStateNew: ({ tr, node, pos, isLivePage, }: UpdateExpandedStateNew) => void;
11
- export declare const updateExpandedState: (tr: Transaction, node: ContentNodeWithPos, isLivePage?: boolean) => void;
12
- export {};
@@ -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 { BreakoutPlugin } from '../breakoutPluginType';
5
- type GuidelineLabelProps = {
6
- api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
7
- boundariesElement?: HTMLElement;
8
- editorView: EditorView;
9
- mountPoint?: HTMLElement;
10
- scrollableElement?: HTMLElement;
11
- };
12
- export declare const GuidelineLabel: ({ api, editorView, mountPoint, boundariesElement, scrollableElement, }: GuidelineLabelProps) => React.JSX.Element | null;
13
- export {};
@@ -1,20 +0,0 @@
1
- import type { ComponentType, FC } from 'react';
2
- import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
3
- import type { BreakoutMode, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
- import type { BreakoutPlugin } from '../breakoutPluginType';
6
- export interface Props {
7
- api: ExtractInjectionAPI<BreakoutPlugin> | undefined;
8
- boundariesElement?: HTMLElement;
9
- breakoutMode: BreakoutMode | undefined;
10
- editorView: EditorView | undefined;
11
- handleClick?: Function;
12
- isBreakoutNodePresent: boolean;
13
- isLivePage?: boolean;
14
- mountPoint?: HTMLElement;
15
- scrollableElement?: HTMLElement;
16
- }
17
- declare const _default_1: FC<WithIntlProps<Props & WrappedComponentProps>> & {
18
- WrappedComponent: ComponentType<Props & WrappedComponentProps>;
19
- };
20
- export default _default_1;