@atlaskit/editor-plugin-expand 12.0.14 → 12.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.
- package/CHANGELOG.md +12 -0
- package/package.json +3 -3
- package/plugin/package.json +1 -8
- package/types/package.json +1 -8
- package/dist/types-ts4.5/editor-commands/toggleExpandRange.d.ts +0 -3
- package/dist/types-ts4.5/entry-points/plugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/legacyExpand/commands.d.ts +0 -28
- package/dist/types-ts4.5/legacyExpand/nodeviews/index.d.ts +0 -68
- package/dist/types-ts4.5/legacyExpand/plugin.d.ts +0 -2
- package/dist/types-ts4.5/legacyExpand/pm-plugins/keymap.d.ts +0 -6
- package/dist/types-ts4.5/legacyExpand/pm-plugins/main.d.ts +0 -14
- package/dist/types-ts4.5/legacyExpand/pm-plugins/plugin-factory.d.ts +0 -8
- package/dist/types-ts4.5/legacyExpand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/legacyExpand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/legacyExpand/ui/ExpandIconButton.d.ts +0 -44
- package/dist/types-ts4.5/plugin.d.ts +0 -2
- package/dist/types-ts4.5/singlePlayerExpand/commands.d.ts +0 -31
- package/dist/types-ts4.5/singlePlayerExpand/node-views/index.d.ts +0 -73
- package/dist/types-ts4.5/singlePlayerExpand/plugin.d.ts +0 -2
- package/dist/types-ts4.5/singlePlayerExpand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/singlePlayerExpand/pm-plugins/main.d.ts +0 -16
- package/dist/types-ts4.5/singlePlayerExpand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/singlePlayerExpand/ui/ExpandButton.d.ts +0 -13
- package/dist/types-ts4.5/singlePlayerExpand/ui/NodeView.d.ts +0 -4
- package/dist/types-ts4.5/singlePlayerExpand/utils.d.ts +0 -4
- package/dist/types-ts4.5/types.d.ts +0 -108
- package/dist/types-ts4.5/ui/ExpandBlockMenuItem.d.ts +0 -4
- package/dist/types-ts4.5/ui/renderExpandButton.d.ts +0 -17
- package/dist/types-ts4.5/utils.d.ts +0 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-expand",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.16",
|
|
4
4
|
"description": "Expand plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@atlaskit/editor-tables": "^2.10.0",
|
|
46
46
|
"@atlaskit/editor-toolbar": "^1.10.0",
|
|
47
47
|
"@atlaskit/icon": "^35.4.0",
|
|
48
|
-
"@atlaskit/icon-lab": "^6.
|
|
48
|
+
"@atlaskit/icon-lab": "^6.14.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
51
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
51
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
52
52
|
"@atlaskit/tokens": "^13.4.0",
|
|
53
53
|
"@atlaskit/tooltip": "^22.6.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
package/plugin/package.json
CHANGED
|
@@ -6,12 +6,5 @@
|
|
|
6
6
|
"sideEffects": [
|
|
7
7
|
"*.compiled.css"
|
|
8
8
|
],
|
|
9
|
-
"types": "../dist/types/entry-points/plugin.d.ts"
|
|
10
|
-
"typesVersions": {
|
|
11
|
-
">=4.5 <5.9": {
|
|
12
|
-
"*": [
|
|
13
|
-
"../dist/types-ts4.5/entry-points/plugin.d.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
9
|
+
"types": "../dist/types/entry-points/plugin.d.ts"
|
|
17
10
|
}
|
package/types/package.json
CHANGED
|
@@ -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 { expandPlugin } from '../plugin';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { ExpandPlugin, ExpandPluginState, ExpandPluginOptions, InsertMethod, ExpandPluginDependencies, } from '../types';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import type { InsertMethod } from '../types';
|
|
7
|
-
export declare const setExpandRef: (ref?: HTMLDivElement | null) => Command;
|
|
8
|
-
export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
|
|
9
|
-
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
10
|
-
export declare const updateExpandTitle: ({ title, nodeType, pos, __livePage, }: {
|
|
11
|
-
__livePage: boolean;
|
|
12
|
-
nodeType: NodeType;
|
|
13
|
-
pos: number;
|
|
14
|
-
title: string;
|
|
15
|
-
}) => Command;
|
|
16
|
-
export declare const toggleExpandExpanded: ({ editorAnalyticsAPI, pos, nodeType, __livePage, }: {
|
|
17
|
-
__livePage: boolean;
|
|
18
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
19
|
-
nodeType: NodeType;
|
|
20
|
-
pos: number;
|
|
21
|
-
}) => Command;
|
|
22
|
-
export declare const createExpandNode: (state: EditorState) => PMNode | null;
|
|
23
|
-
export declare const insertExpandWithInputMethod: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: InsertMethod) => Command;
|
|
24
|
-
export declare const insertExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
25
|
-
export declare const focusTitle: (pos: number) => Command;
|
|
26
|
-
export declare const focusIcon: (expand: Node) => Command;
|
|
27
|
-
export declare const setSelectionInsideExpand: (expandPos: number) => Command;
|
|
28
|
-
export declare const toggleExpandWithMatch: (_selection: Selection) => EditorCommand;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
-
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
4
|
-
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import type { ExpandPlugin } from '../../types';
|
|
8
|
-
export declare class ExpandNodeView implements NodeView {
|
|
9
|
-
private selectNearNode;
|
|
10
|
-
private __livePage;
|
|
11
|
-
private cleanUpEditorDisabledOnChange?;
|
|
12
|
-
node: PmNode;
|
|
13
|
-
view: EditorView;
|
|
14
|
-
dom: HTMLElement;
|
|
15
|
-
contentDOM?: HTMLElement;
|
|
16
|
-
icon?: HTMLElement | null;
|
|
17
|
-
input?: HTMLInputElement | null;
|
|
18
|
-
titleContainer?: HTMLElement | null;
|
|
19
|
-
content?: HTMLElement | null;
|
|
20
|
-
getPos: getPosHandlerNode;
|
|
21
|
-
intl: IntlShape;
|
|
22
|
-
allowInteractiveExpand: boolean;
|
|
23
|
-
isMobile: boolean;
|
|
24
|
-
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
25
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
26
|
-
decorationCleanup?: () => boolean | undefined;
|
|
27
|
-
renderKey: string;
|
|
28
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean, cleanUpEditorDisabledOnChange?: (() => void) | undefined);
|
|
29
|
-
private initHandlers;
|
|
30
|
-
private focusTitle;
|
|
31
|
-
private handleIconKeyDown;
|
|
32
|
-
private renderNativeIcon;
|
|
33
|
-
private renderIcon;
|
|
34
|
-
private handleClick;
|
|
35
|
-
private handleInput;
|
|
36
|
-
private handleFocus;
|
|
37
|
-
private handleInputFocus;
|
|
38
|
-
private handleBlur;
|
|
39
|
-
private handleTitleKeydown;
|
|
40
|
-
private deleteExpand;
|
|
41
|
-
private toggleExpand;
|
|
42
|
-
private moveToOutsideOfTitle;
|
|
43
|
-
private isCollapsed;
|
|
44
|
-
private setRightGapCursor;
|
|
45
|
-
private moveToPreviousLine;
|
|
46
|
-
private setLeftGapCursor;
|
|
47
|
-
private handleArrowRightFromTitle;
|
|
48
|
-
private handleArrowLeftFromTitle;
|
|
49
|
-
private handleUndoFromTitle;
|
|
50
|
-
private handleRedoFromTitle;
|
|
51
|
-
private getContentEditable;
|
|
52
|
-
private updateDisplayStyle;
|
|
53
|
-
stopEvent(event: Event): boolean;
|
|
54
|
-
ignoreMutation(mutationRecord: MutationRecord | {
|
|
55
|
-
target: Node;
|
|
56
|
-
type: 'selection';
|
|
57
|
-
}): boolean;
|
|
58
|
-
update(node: PmNode, _decorations: readonly Decoration[]): boolean;
|
|
59
|
-
destroy(): void;
|
|
60
|
-
}
|
|
61
|
-
export default function ({ getIntl, isMobile, api, nodeViewPortalProviderAPI, allowInteractiveExpand, __livePage, }: {
|
|
62
|
-
__livePage: boolean;
|
|
63
|
-
allowInteractiveExpand: boolean;
|
|
64
|
-
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
65
|
-
getIntl: () => IntlShape;
|
|
66
|
-
isMobile: boolean;
|
|
67
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
68
|
-
}): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ExpandPlugin } from '../../types';
|
|
4
|
-
export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined, options: {
|
|
5
|
-
__livePage?: boolean;
|
|
6
|
-
}): SafePlugin;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { Dispatch } 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 { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
8
|
-
import type { ExpandPlugin, ExpandPluginState } from '../../types';
|
|
9
|
-
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
10
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin<ExpandPluginState>;
|
|
11
|
-
/**
|
|
12
|
-
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
13
|
-
*/
|
|
14
|
-
export declare function handleExpandDrag(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { EditorState, PluginKey, Transaction, type SafeStateField } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import type { ExpandPluginState, ExpandPluginAction } from '../../types';
|
|
5
|
-
export declare const pluginKey: PluginKey;
|
|
6
|
-
export declare const createPluginState: (dispatch: Dispatch, initialState: ExpandPluginState | ((state: EditorState) => ExpandPluginState)) => SafeStateField<ExpandPluginState>;
|
|
7
|
-
export declare const createCommand: <A = ExpandPluginAction>(action: A | ((state: Readonly<EditorState>) => false | A), transform?: (tr: Transaction, state: EditorState) => Transaction) => Command;
|
|
8
|
-
export declare const getPluginState: (state: EditorState) => ExpandPluginState;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
7
|
-
import type { IntlShape } from 'react-intl';
|
|
8
|
-
interface ExpandIconButtonProps {
|
|
9
|
-
allowInteractiveExpand: boolean;
|
|
10
|
-
expanded: boolean;
|
|
11
|
-
intl?: IntlShape;
|
|
12
|
-
}
|
|
13
|
-
interface ExpandIconButtonWithLabelProps extends ExpandIconButtonProps {
|
|
14
|
-
label: string;
|
|
15
|
-
}
|
|
16
|
-
export declare const withTooltip: (WrapperComponent: React.ElementType) => {
|
|
17
|
-
new (props: ExpandIconButtonWithLabelProps): {
|
|
18
|
-
componentDidCatch?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
19
|
-
componentDidMount?: () => void;
|
|
20
|
-
componentDidUpdate?: (prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>, snapshot?: any) => void;
|
|
21
|
-
componentWillMount?: () => void;
|
|
22
|
-
componentWillReceiveProps?: (nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any) => void;
|
|
23
|
-
componentWillUnmount?: () => void;
|
|
24
|
-
componentWillUpdate?: (nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any) => void;
|
|
25
|
-
context: unknown;
|
|
26
|
-
forceUpdate: (callback?: (() => void) | undefined) => void;
|
|
27
|
-
getSnapshotBeforeUpdate?: (prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>) => any;
|
|
28
|
-
readonly props: Readonly<ExpandIconButtonWithLabelProps>;
|
|
29
|
-
refs: {
|
|
30
|
-
[key: string]: React.ReactInstance;
|
|
31
|
-
};
|
|
32
|
-
render: () => jsx.JSX.Element;
|
|
33
|
-
setState: <K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ExpandIconButtonWithLabelProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined) => void;
|
|
34
|
-
shouldComponentUpdate?: (nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any) => boolean;
|
|
35
|
-
state: Readonly<{}>;
|
|
36
|
-
UNSAFE_componentWillMount?: () => void;
|
|
37
|
-
UNSAFE_componentWillReceiveProps?: (nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any) => void;
|
|
38
|
-
UNSAFE_componentWillUpdate?: (nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any) => void;
|
|
39
|
-
};
|
|
40
|
-
contextType?: React.Context<any> | undefined;
|
|
41
|
-
};
|
|
42
|
-
export declare const CustomButton: (props: ExpandIconButtonWithLabelProps) => jsx.JSX.Element;
|
|
43
|
-
export declare const ExpandIconButton: (props: ExpandIconButtonProps) => jsx.JSX.Element;
|
|
44
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
7
|
-
import type { ExpandPlugin, InsertMethod } from '../types';
|
|
8
|
-
export declare const createExpandNode: (state: EditorState, setExpandedState?: boolean, addLocalId?: boolean) => PMNode | null;
|
|
9
|
-
/**
|
|
10
|
-
* When cleaning up platform_editor_adf_with_localid we can reuse this function
|
|
11
|
-
* in insertExpandWithInputMethod.
|
|
12
|
-
*/
|
|
13
|
-
export declare const wrapSelectionAndSetExpandedState: (state: EditorState, node: PMNode) => Transaction;
|
|
14
|
-
export declare const insertExpandWithInputMethod: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => (inputMethod: InsertMethod) => Command;
|
|
15
|
-
export declare const insertExpand: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => Command;
|
|
16
|
-
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
17
|
-
export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
|
|
18
|
-
export declare const setSelectionInsideExpand: (expandPos: number) => Command;
|
|
19
|
-
export declare const toggleExpandExpanded: ({ editorAnalyticsAPI, pos, node, }: {
|
|
20
|
-
editorAnalyticsAPI: EditorAnalyticsAPI | undefined;
|
|
21
|
-
node: PMNode;
|
|
22
|
-
pos: number;
|
|
23
|
-
}) => Command;
|
|
24
|
-
export declare const updateExpandTitle: ({ title, nodeType, pos }: {
|
|
25
|
-
nodeType: NodeType;
|
|
26
|
-
pos: number;
|
|
27
|
-
title: string;
|
|
28
|
-
}) => Command;
|
|
29
|
-
export declare const focusTitle: (pos: number) => Command;
|
|
30
|
-
export declare const focusIcon: (expand: Node) => Command;
|
|
31
|
-
export declare const toggleExpandWithMatch: (selection: Selection) => EditorCommand;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
3
|
-
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
4
|
-
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { Decoration, EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
-
import type { ExpandPlugin } from '../../types';
|
|
8
|
-
export declare class ExpandNodeView implements NodeView {
|
|
9
|
-
private selectNearNode;
|
|
10
|
-
private __livePage;
|
|
11
|
-
private cleanUpEditorDisabledOnChange?;
|
|
12
|
-
private isExpanded;
|
|
13
|
-
node: PmNode;
|
|
14
|
-
view: EditorView;
|
|
15
|
-
dom: HTMLElement;
|
|
16
|
-
contentDOM?: HTMLElement;
|
|
17
|
-
icon?: HTMLElement | null;
|
|
18
|
-
input?: HTMLInputElement | null;
|
|
19
|
-
titleContainer?: HTMLElement | null;
|
|
20
|
-
content?: HTMLElement | null;
|
|
21
|
-
getPos: getPosHandlerNode;
|
|
22
|
-
intl: IntlShape;
|
|
23
|
-
allowInteractiveExpand: boolean;
|
|
24
|
-
isMobile: boolean;
|
|
25
|
-
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
26
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
27
|
-
decorationCleanup?: () => boolean | undefined;
|
|
28
|
-
renderKey: string;
|
|
29
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean, cleanUpEditorDisabledOnChange?: (() => void) | undefined, isExpanded?: {
|
|
30
|
-
expanded: boolean;
|
|
31
|
-
localId?: string;
|
|
32
|
-
});
|
|
33
|
-
private focusTitle;
|
|
34
|
-
private handleIconKeyDown;
|
|
35
|
-
private handleClick;
|
|
36
|
-
private handleInput;
|
|
37
|
-
private handleFocus;
|
|
38
|
-
private handleInputFocus;
|
|
39
|
-
private handleBlur;
|
|
40
|
-
private handleTitleKeydown;
|
|
41
|
-
private deleteEmptyExpand;
|
|
42
|
-
private toggleExpand;
|
|
43
|
-
private moveToOutsideOfTitle;
|
|
44
|
-
private isCollapsed;
|
|
45
|
-
private setRightGapCursor;
|
|
46
|
-
private moveToPreviousLine;
|
|
47
|
-
private setLeftGapCursor;
|
|
48
|
-
private handleArrowRightFromTitle;
|
|
49
|
-
private handleArrowLeftFromTitle;
|
|
50
|
-
private handleUndoFromTitle;
|
|
51
|
-
private handleRedoFromTitle;
|
|
52
|
-
private getContentEditable;
|
|
53
|
-
stopEvent(event: Event): boolean;
|
|
54
|
-
ignoreMutation(mutationRecord: MutationRecord | {
|
|
55
|
-
target: Node;
|
|
56
|
-
type: 'selection';
|
|
57
|
-
}): boolean;
|
|
58
|
-
update(node: PmNode, _decorations: readonly Decoration[]): boolean;
|
|
59
|
-
updateExpandToggleIcon(node: PmNode): void;
|
|
60
|
-
private updateDisplayStyle;
|
|
61
|
-
updateExpandBodyContentEditable(): void;
|
|
62
|
-
private renderNativeIcon;
|
|
63
|
-
renderIcon: (icon: HTMLElement | null, expanded: boolean) => void;
|
|
64
|
-
destroy(): void;
|
|
65
|
-
}
|
|
66
|
-
export default function ({ getIntl, isMobile, api, nodeViewPortalProviderAPI, allowInteractiveExpand, __livePage, }: {
|
|
67
|
-
__livePage: boolean;
|
|
68
|
-
allowInteractiveExpand: boolean;
|
|
69
|
-
api: ExtractInjectionAPI<ExpandPlugin> | undefined;
|
|
70
|
-
getIntl: () => IntlShape;
|
|
71
|
-
isMobile: boolean;
|
|
72
|
-
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
73
|
-
}): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ExpandPlugin } from '../../types';
|
|
4
|
-
export declare function expandKeymap(api: ExtractInjectionAPI<ExpandPlugin> | undefined): SafePlugin;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { Dispatch } 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 { EditorAppearance, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
-
import type { ExpandPlugin } from '../../types';
|
|
10
|
-
export declare const pluginKey: PluginKey;
|
|
11
|
-
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
12
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, api: ExtractInjectionAPI<ExpandPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, allowInteractiveExpand?: boolean, __livePage?: boolean) => SafePlugin;
|
|
13
|
-
/**
|
|
14
|
-
* Convert a nested expand to an expand when dropped outside an expand or table. Convert an expand to a nested expand when dropped inside an expand or table.
|
|
15
|
-
*/
|
|
16
|
-
export declare function handleExpandDrag(view: EditorView, event: DragEvent, slice: Slice): boolean;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx } from '@emotion/react';
|
|
2
|
-
import type { IntlShape } from 'react-intl';
|
|
3
|
-
interface ExpandIconButtonProps {
|
|
4
|
-
allowInteractiveExpand: boolean;
|
|
5
|
-
expanded: boolean;
|
|
6
|
-
intl?: IntlShape;
|
|
7
|
-
}
|
|
8
|
-
interface ExpandIconButtonWithLabelProps extends ExpandIconButtonProps {
|
|
9
|
-
label: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const ExpandButtonInner: (props: ExpandIconButtonWithLabelProps) => jsx.JSX.Element;
|
|
12
|
-
export declare const ExpandButton: (props: ExpandIconButtonProps) => jsx.JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { DOMOutputSpec, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
export declare const buildExpandClassName: (type: string, expanded: boolean) => string;
|
|
4
|
-
export declare const toDOM: (node: PmNode, __livePage: boolean, intl?: IntlShape, titleReadOnly?: boolean, contentEditable?: boolean) => DOMOutputSpec;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
export declare const findSelectedParentExpandNode: (state: EditorState) => ReturnType<ReturnType<typeof findParentNodeOfType>>;
|
|
4
|
-
export declare const findReplaceExpandDecorations: string[];
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { EditorAppearance, EditorCommand, LongPressSelectionPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
import type { BlockControlsPlugin } from '@atlaskit/editor-plugin-block-controls';
|
|
5
|
-
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
6
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
|
-
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
8
|
-
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
9
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
|
-
import type { LocalIdPlugin } from '@atlaskit/editor-plugin-local-id';
|
|
11
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
12
|
-
import type { SelectionMarkerPlugin } from '@atlaskit/editor-plugin-selection-marker';
|
|
13
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
14
|
-
import type { insertExpand, insertExpandWithInputMethod } from './legacyExpand/commands';
|
|
15
|
-
export interface ExpandPluginState {
|
|
16
|
-
expandRef?: HTMLDivElement | null;
|
|
17
|
-
}
|
|
18
|
-
export type ExpandPluginAction = {
|
|
19
|
-
data: {
|
|
20
|
-
ref?: HTMLDivElement | null;
|
|
21
|
-
};
|
|
22
|
-
type: 'SET_EXPAND_REF';
|
|
23
|
-
};
|
|
24
|
-
export type ExpandPluginSharedState = {
|
|
25
|
-
allowInsertion?: boolean;
|
|
26
|
-
} | undefined;
|
|
27
|
-
export type InsertMethod = INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.ELEMENT_BROWSER | INPUT_METHOD.TOOLBAR;
|
|
28
|
-
export interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
|
|
29
|
-
/**
|
|
30
|
-
* There is expected to be temporary divergence between Live Page editor expand behaviour and the standard expand behaviour.
|
|
31
|
-
*
|
|
32
|
-
* This is expected to be removed in Q4 as Editor and Live Page teams align on a singular behaviour.
|
|
33
|
-
*
|
|
34
|
-
* It is only supported for use by Confluence.
|
|
35
|
-
*
|
|
36
|
-
* @default false
|
|
37
|
-
*/
|
|
38
|
-
__livePage?: boolean;
|
|
39
|
-
allowInsertion?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Allows the expand button to toggle. Previously this was set via the editor prop featureFlag (`interactiveExpand`)
|
|
42
|
-
*
|
|
43
|
-
* Defaults to true
|
|
44
|
-
*/
|
|
45
|
-
allowInteractiveExpand?: boolean;
|
|
46
|
-
appearance?: EditorAppearance;
|
|
47
|
-
}
|
|
48
|
-
export type ExpandPluginDependencies = [
|
|
49
|
-
DecorationsPlugin,
|
|
50
|
-
SelectionPlugin,
|
|
51
|
-
OptionalPlugin<AnalyticsPlugin>,
|
|
52
|
-
OptionalPlugin<SelectionMarkerPlugin>,
|
|
53
|
-
OptionalPlugin<EditorDisabledPlugin>,
|
|
54
|
-
OptionalPlugin<FeatureFlagsPlugin>,
|
|
55
|
-
OptionalPlugin<EditorViewModePlugin>,
|
|
56
|
-
OptionalPlugin<BlockMenuPlugin>,
|
|
57
|
-
OptionalPlugin<LocalIdPlugin>,
|
|
58
|
-
OptionalPlugin<BlockControlsPlugin>
|
|
59
|
-
];
|
|
60
|
-
export type ExpandPlugin = NextEditorPlugin<'expand', {
|
|
61
|
-
actions: {
|
|
62
|
-
/**
|
|
63
|
-
* Insert an expand node and dispatch event with `insertMenu` inputMethod
|
|
64
|
-
*/
|
|
65
|
-
insertExpand: ReturnType<typeof insertExpand>;
|
|
66
|
-
/**
|
|
67
|
-
* Insert an expand node and dispatch event with inputMethod specified
|
|
68
|
-
*/
|
|
69
|
-
insertExpandWithInputMethod: ReturnType<typeof insertExpandWithInputMethod>;
|
|
70
|
-
};
|
|
71
|
-
commands: {
|
|
72
|
-
/**
|
|
73
|
-
* Expand or collapse a range of expand nodes. With no parameters
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @param from Starting range (defaults to 0)
|
|
77
|
-
* @param to Ending range (defaults to the document size)
|
|
78
|
-
* @param open Boolean to open (defaults to opening expands)
|
|
79
|
-
* @returns EditorCommand to be executed
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```ts
|
|
83
|
-
* // Opens all the expands on the page
|
|
84
|
-
* editorAPI.core.actions.execute(
|
|
85
|
-
* editorAPI.expand.commands.toggleExpandRange()
|
|
86
|
-
* )
|
|
87
|
-
*
|
|
88
|
-
* // Closes all the expands between positions 0 and 34 on the page
|
|
89
|
-
* editorAPI.core.actions.execute(
|
|
90
|
-
* editorAPI.expand.commands.toggleExpandRange(0, 34, false)
|
|
91
|
-
* )
|
|
92
|
-
*
|
|
93
|
-
* // Closes all the expands on the page
|
|
94
|
-
* editorAPI.core.actions.execute(
|
|
95
|
-
* editorAPI.expand.commands.toggleExpandRange(undefined, undefined, false)
|
|
96
|
-
* )
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
toggleExpandRange: (from?: number, to?: number, open?: boolean) => EditorCommand;
|
|
100
|
-
/**
|
|
101
|
-
* Toggle the expand or nested expand node open
|
|
102
|
-
*/
|
|
103
|
-
toggleExpandWithMatch: (selection: Selection) => EditorCommand;
|
|
104
|
-
};
|
|
105
|
-
dependencies: ExpandPluginDependencies;
|
|
106
|
-
pluginConfiguration: ExpandPluginOptions | undefined;
|
|
107
|
-
sharedState: ExpandPluginSharedState;
|
|
108
|
-
}>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { ExpandPlugin } from '../types';
|
|
4
|
-
export declare const createExpandBlockMenuItem: (api: ExtractInjectionAPI<ExpandPlugin> | undefined) => () => React.JSX.Element;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
interface ButtonProps {
|
|
3
|
-
/** Indicates whether interactive expand is allowed */
|
|
4
|
-
allowInteractiveExpand: boolean;
|
|
5
|
-
/** Indicates whether the expand is currently expanded */
|
|
6
|
-
expanded: boolean;
|
|
7
|
-
/** Internationalization object for formatting messages */
|
|
8
|
-
intl: IntlShape;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Renders or updates the expand/collapse button inside the provided container element.
|
|
12
|
-
*
|
|
13
|
-
* @param container - The HTML element that will contain the expand/collapse button.
|
|
14
|
-
* @param buttonProps - Properties for configuring the button's behavior and appearance.
|
|
15
|
-
*/
|
|
16
|
-
export declare function renderExpandButton(container: HTMLElement, buttonProps: ButtonProps): void;
|
|
17
|
-
export {};
|