@atlaskit/editor-plugin-block-menu 10.1.15 → 10.1.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 +6 -0
- package/blockMenuPlugin/package.json +1 -8
- package/blockMenuPluginType/package.json +1 -8
- package/package.json +2 -2
- package/types/package.json +1 -8
- package/dist/types-ts4.5/blockMenuPlugin.d.ts +0 -2
- package/dist/types-ts4.5/blockMenuPluginType.d.ts +0 -125
- package/dist/types-ts4.5/editor-actions/index.d.ts +0 -52
- package/dist/types-ts4.5/editor-actions/isTransformToTargetDisabled.d.ts +0 -11
- package/dist/types-ts4.5/editor-commands/selection.d.ts +0 -10
- package/dist/types-ts4.5/editor-commands/transform-node-utils/TRANSFORMATION_MATRIX.d.ts +0 -5
- package/dist/types-ts4.5/editor-commands/transform-node-utils/marks.d.ts +0 -9
- package/dist/types-ts4.5/editor-commands/transform-node-utils/nodeChecks.d.ts +0 -17
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/applyTargetTextTypeStep.d.ts +0 -23
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/convertEachNodeStep.d.ts +0 -2
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/decisionListToListStep.d.ts +0 -30
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/flattenListStep.d.ts +0 -29
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/flattenStep.d.ts +0 -2
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/listToDecisionListStep.d.ts +0 -25
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/listToListStep.d.ts +0 -65
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/mergeNeighbourListsStep.d.ts +0 -32
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/unwrapExpandStep.d.ts +0 -13
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/unwrapLayoutStep.d.ts +0 -14
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/unwrapListStep.d.ts +0 -25
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/unwrapStep.d.ts +0 -2
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/wrapBlockquoteToDecisionListStep.d.ts +0 -15
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/wrapIntoListStep.d.ts +0 -9
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/wrapMixedContentStep.d.ts +0 -39
- package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/wrapStep.d.ts +0 -10
- package/dist/types-ts4.5/editor-commands/transform-node-utils/transform.d.ts +0 -29
- package/dist/types-ts4.5/editor-commands/transform-node-utils/types.d.ts +0 -14
- package/dist/types-ts4.5/editor-commands/transform-node-utils/utils.d.ts +0 -39
- package/dist/types-ts4.5/editor-commands/transformNode.d.ts +0 -5
- package/dist/types-ts4.5/editor-commands/types.d.ts +0 -8
- package/dist/types-ts4.5/entry-points/blockMenuPlugin.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/blockMenuPluginType.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 -3
- package/dist/types-ts4.5/pm-plugins/experiences/block-menu-experiences.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/experiences/experience-check-utils.d.ts +0 -65
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -10
- package/dist/types-ts4.5/pm-plugins/utils/shouldSuppressKeyboardEvent.d.ts +0 -14
- package/dist/types-ts4.5/ui/MenuSection.d.ts +0 -9
- package/dist/types-ts4.5/ui/block-menu-components.d.ts +0 -6
- package/dist/types-ts4.5/ui/block-menu-provider.d.ts +0 -24
- package/dist/types-ts4.5/ui/block-menu-renderer/BlockMenuComponent.d.ts +0 -11
- package/dist/types-ts4.5/ui/block-menu-renderer/BlockMenuComponents.d.ts +0 -12
- package/dist/types-ts4.5/ui/block-menu-renderer/BlockMenuRenderer.d.ts +0 -12
- package/dist/types-ts4.5/ui/block-menu-renderer/fallbacks.d.ts +0 -2
- package/dist/types-ts4.5/ui/block-menu-renderer/types.d.ts +0 -27
- package/dist/types-ts4.5/ui/block-menu-renderer/utils.d.ts +0 -36
- package/dist/types-ts4.5/ui/block-menu.d.ts +0 -16
- package/dist/types-ts4.5/ui/consts.d.ts +0 -11
- package/dist/types-ts4.5/ui/copy-link.d.ts +0 -12
- package/dist/types-ts4.5/ui/copy-section.d.ts +0 -4
- package/dist/types-ts4.5/ui/delete-button.d.ts +0 -11
- package/dist/types-ts4.5/ui/delete-section.d.ts +0 -4
- package/dist/types-ts4.5/ui/flag.d.ts +0 -8
- package/dist/types-ts4.5/ui/format-menu-nested.d.ts +0 -7
- package/dist/types-ts4.5/ui/format-menu-section.d.ts +0 -7
- package/dist/types-ts4.5/ui/hooks/useSuggestedItems.d.ts +0 -3
- package/dist/types-ts4.5/ui/move-down.d.ts +0 -11
- package/dist/types-ts4.5/ui/move-up.d.ts +0 -11
- package/dist/types-ts4.5/ui/suggested-items-menu-section.d.ts +0 -9
- package/dist/types-ts4.5/ui/suggested-menu-items.d.ts +0 -8
- package/dist/types-ts4.5/ui/utils/checkHasPreviousSectionContent.d.ts +0 -26
- package/dist/types-ts4.5/ui/utils/checkIsFormatMenuHidden.d.ts +0 -3
- package/dist/types-ts4.5/ui/utils/copyLink.d.ts +0 -8
- package/dist/types-ts4.5/ui/utils/createMenuItemsMap.d.ts +0 -6
- package/dist/types-ts4.5/ui/utils/fixBlockMenuPositionAndScroll.d.ts +0 -1
- package/dist/types-ts4.5/ui/utils/getSuggestedItemsFromSelection.d.ts +0 -6
- package/dist/types-ts4.5/ui/utils/isNestedNode.d.ts +0 -14
- package/dist/types-ts4.5/ui/utils/suggested-items-rank.d.ts +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/blockMenuPlugin.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/blockMenuPlugin.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/blockMenuPlugin.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/blockMenuPlugin.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/blockMenuPlugin.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/blockMenuPluginType.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/blockMenuPluginType.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/blockMenuPluginType.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/blockMenuPluginType.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/blockMenuPluginType.d.ts"
|
|
15
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.16",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/primitives": "^19.0.0",
|
|
46
46
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
48
48
|
"@atlaskit/tokens": "^13.4.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"bind-event-listener": "^3.0.0"
|
package/types/package.json
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/types.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/types.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/types.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/types.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/types.d.ts"
|
|
15
8
|
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { EditorCommand, 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 { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
6
|
-
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
7
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
-
import type { TransformNodeMetadata } from './editor-commands/types';
|
|
9
|
-
export declare enum FLAG_ID {
|
|
10
|
-
LINK_COPIED_TO_CLIPBOARD = "link-copied-to-clipboard"
|
|
11
|
-
}
|
|
12
|
-
type TransformNodeCommand = (targetType: NodeType, metadata?: TransformNodeMetadata) => EditorCommand;
|
|
13
|
-
export type BlockMenuPlugin = NextEditorPlugin<'blockMenu', {
|
|
14
|
-
actions: {
|
|
15
|
-
getBlockMenuComponents: () => Array<RegisterBlockMenuComponent>;
|
|
16
|
-
isTransformOptionDisabled: (optionNodeTypeName: string, optionNodeTypeAttrs?: Record<string, unknown>) => boolean;
|
|
17
|
-
registerBlockMenuComponents: (blockMenuComponents: Array<RegisterBlockMenuComponent>) => void;
|
|
18
|
-
};
|
|
19
|
-
commands: {
|
|
20
|
-
transformNode: TransformNodeCommand;
|
|
21
|
-
};
|
|
22
|
-
dependencies: [
|
|
23
|
-
OptionalPlugin<BlockControlsPlugin>,
|
|
24
|
-
OptionalPlugin<UserIntentPlugin>,
|
|
25
|
-
OptionalPlugin<SelectionPlugin>,
|
|
26
|
-
OptionalPlugin<DecorationsPlugin>,
|
|
27
|
-
OptionalPlugin<AnalyticsPlugin>
|
|
28
|
-
];
|
|
29
|
-
pluginConfiguration?: BlockMenuPluginOptions;
|
|
30
|
-
sharedState: BlockMenuSharedState;
|
|
31
|
-
}>;
|
|
32
|
-
export type BlockMenuPluginOptions = {
|
|
33
|
-
/**
|
|
34
|
-
* Optional hash prefix used for block-specific URL to create a deep link to specific block
|
|
35
|
-
* Default value from DEFAULT_BLOCK_LINK_HASH_PREFIX in @atlaskit/editor-common/block-menu
|
|
36
|
-
*/
|
|
37
|
-
blockLinkHashPrefix?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Optional function to retrieve the current link path for the editor context.
|
|
40
|
-
* @returns The current link path as a string, or null if no path is available
|
|
41
|
-
*/
|
|
42
|
-
getLinkPath?: () => string | null;
|
|
43
|
-
/**
|
|
44
|
-
* When true, nodes maintain their standard width without negative margins
|
|
45
|
-
* for block menu compatibility. Used in contexts like Jira issue descriptions
|
|
46
|
-
* where block menu controls need consistent spacing.
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
useStandardNodeWidth?: boolean;
|
|
50
|
-
};
|
|
51
|
-
export type BlockMenuSharedState = {
|
|
52
|
-
/**
|
|
53
|
-
* The name of the currently selected node type that triggered the block menu
|
|
54
|
-
* This exposes the menuTriggerBy value from blockControls plugin
|
|
55
|
-
*/
|
|
56
|
-
currentSelectedNodeName: string | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* Whether to show a flag (e.g. for copy confirmation)
|
|
59
|
-
*/
|
|
60
|
-
showFlag: FLAG_ID | false;
|
|
61
|
-
/**
|
|
62
|
-
* When true, nodes maintain their standard width without negative margins
|
|
63
|
-
* for block menu compatibility.
|
|
64
|
-
*/
|
|
65
|
-
useStandardNodeWidth?: boolean;
|
|
66
|
-
} | undefined;
|
|
67
|
-
type WithRank<T> = T & {
|
|
68
|
-
rank: number;
|
|
69
|
-
};
|
|
70
|
-
export type Parent<T> = WithRank<T>;
|
|
71
|
-
type ComponentType = BlockMenuSection | BlockMenuItem | BlockMenuNested;
|
|
72
|
-
export type ComponentTypes = Array<ComponentType>;
|
|
73
|
-
/**
|
|
74
|
-
* The relationship between BlockMenuItem, BlockMenuSection, BlockMenuNested
|
|
75
|
-
* BlockMenuSection can have BlockMenuItem or BlockMenuNested as children
|
|
76
|
-
* BlockMenuNested can have BlockMenuSection as children,
|
|
77
|
-
* BlockMenuNested, with BlockMenuSection and BlockMenuItem, is a nested menu
|
|
78
|
-
* _______________________________________
|
|
79
|
-
* | Block menu (no typing)
|
|
80
|
-
* | |BlockMenuSection
|
|
81
|
-
* | | |BlockMenuItem
|
|
82
|
-
* | | |BlockMenuNested
|
|
83
|
-
* | | | |BlockMenuSection
|
|
84
|
-
* | | | | |BlockMenuItem
|
|
85
|
-
*/
|
|
86
|
-
type BlockMenuItem = {
|
|
87
|
-
key: string;
|
|
88
|
-
type: 'block-menu-item';
|
|
89
|
-
};
|
|
90
|
-
type BlockMenuSection = {
|
|
91
|
-
key: string;
|
|
92
|
-
type: 'block-menu-section';
|
|
93
|
-
};
|
|
94
|
-
type BlockMenuNested = {
|
|
95
|
-
key: string;
|
|
96
|
-
type: 'block-menu-nested';
|
|
97
|
-
};
|
|
98
|
-
export type BlockMenuNestedComponent = (props: {
|
|
99
|
-
children: React.ReactNode;
|
|
100
|
-
}) => React.ReactNode;
|
|
101
|
-
export type BlockMenuSectionComponent = (props: {
|
|
102
|
-
children: React.ReactNode;
|
|
103
|
-
}) => React.ReactNode;
|
|
104
|
-
export type BlockMenuNestedSectionComponent = (props: {
|
|
105
|
-
children: React.ReactNode;
|
|
106
|
-
}) => React.ReactNode;
|
|
107
|
-
export type BlockMenuItemComponent = () => React.ReactNode;
|
|
108
|
-
export type RegisterBlockMenuNested = BlockMenuNested & {
|
|
109
|
-
component?: BlockMenuNestedComponent;
|
|
110
|
-
isHidden?: () => boolean;
|
|
111
|
-
parent: Parent<BlockMenuSection>;
|
|
112
|
-
};
|
|
113
|
-
export type RegisterBlockMenuSection = BlockMenuSection & {
|
|
114
|
-
component?: BlockMenuSectionComponent;
|
|
115
|
-
parent?: Parent<BlockMenuNested>;
|
|
116
|
-
rank?: number;
|
|
117
|
-
};
|
|
118
|
-
export type RegisterBlockMenuItem = BlockMenuItem & {
|
|
119
|
-
component?: BlockMenuItemComponent;
|
|
120
|
-
isHidden?: () => boolean;
|
|
121
|
-
parent: Parent<BlockMenuSection>;
|
|
122
|
-
};
|
|
123
|
-
export type RegisterBlockMenuComponent = RegisterBlockMenuNested | RegisterBlockMenuSection | RegisterBlockMenuItem;
|
|
124
|
-
export type RegisterBlockMenuComponentType = RegisterBlockMenuComponent['type'];
|
|
125
|
-
export {};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { RegisterBlockMenuComponent } from '../blockMenuPluginType';
|
|
2
|
-
/**
|
|
3
|
-
* Create a simple registry for block menu components.
|
|
4
|
-
*
|
|
5
|
-
* @returns A registry object with a `register` method and a `components` array.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```ts
|
|
9
|
-
* const registry = createBlockMenuRegistry();
|
|
10
|
-
* registry.register(
|
|
11
|
-
* [{
|
|
12
|
-
* type: 'block-menu-section' as const,
|
|
13
|
-
* key: 'block-menu-section-format',
|
|
14
|
-
* rank: 100,
|
|
15
|
-
* component: ({ children }: { children: React.ReactNode }) => {
|
|
16
|
-
* return <ToolbarDropdownItemSection>{children}</ToolbarDropdownItemSection>;
|
|
17
|
-
* },
|
|
18
|
-
* },
|
|
19
|
-
* {
|
|
20
|
-
* type: 'block-menu-nested' as const,
|
|
21
|
-
* key: 'nested-menu',
|
|
22
|
-
* parent: {
|
|
23
|
-
* type: 'block-menu-section' as const,
|
|
24
|
-
* key: 'block-menu-section-format',
|
|
25
|
-
* rank: 100,
|
|
26
|
-
* },
|
|
27
|
-
* component: () => {
|
|
28
|
-
* return (
|
|
29
|
-
* <ToolbarNestedDropdownMenu>{...}</ToolbarNestedDropdownMenu>
|
|
30
|
-
* );
|
|
31
|
-
* },
|
|
32
|
-
* },
|
|
33
|
-
* {
|
|
34
|
-
* type: 'block-menu-item' as const,
|
|
35
|
-
* key: 'block-menu-item-create-jira',
|
|
36
|
-
* parent: {
|
|
37
|
-
* type: 'block-menu-section' as const,
|
|
38
|
-
* key: 'block-menu-section-format',
|
|
39
|
-
* rank: 200,
|
|
40
|
-
* },
|
|
41
|
-
* component: () => {
|
|
42
|
-
* return <ToolbarDropdownItem elemBefore={<JiraIcon label="" />}>Create Jira work item</ToolbarDropdownItem>;
|
|
43
|
-
* },
|
|
44
|
-
* },
|
|
45
|
-
* ]);
|
|
46
|
-
* ```
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
49
|
-
export declare const createBlockMenuRegistry: () => {
|
|
50
|
-
register: (blockMenuComponents: RegisterBlockMenuComponent[]) => void;
|
|
51
|
-
components: RegisterBlockMenuComponent[];
|
|
52
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Node as PMNode, Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { NodeTypeName } from '../editor-commands/transform-node-utils/types';
|
|
4
|
-
type TransformDisabledArgs = {
|
|
5
|
-
selection: Selection;
|
|
6
|
-
targetNodeTypeAttrs?: Record<string, unknown>;
|
|
7
|
-
targetNodeTypeName: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const canParentContainNodeType: (schema: Schema, selectedNodeTypeName: NodeTypeName, parentNode: PMNode, nodeTypeName: NodeTypeName, nodeTypeAttrs?: Record<string, unknown>) => boolean;
|
|
10
|
-
export declare const isTransformToTargetDisabled: ({ selection, targetNodeTypeName, targetNodeTypeAttrs, }: TransformDisabledArgs) => boolean;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { TransfromNodeTargetType } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Sets the appropriate selection after transforming a node to a target type
|
|
5
|
-
* @param newTr - The transaction containing the transformed node
|
|
6
|
-
* @param nodePos - The position of the transformed node
|
|
7
|
-
* @param targetType - The target type the node was transformed to
|
|
8
|
-
* @returns The transaction with the updated selection, or the original transaction if no selection change needed
|
|
9
|
-
*/
|
|
10
|
-
export declare const setSelectionAfterTransform: (newTr: Transaction, nodePos: number, targetType: TransfromNodeTargetType) => Transaction;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { NodeTypeName, TransformStep } from './types';
|
|
2
|
-
type TransformationMatrix = Record<NodeTypeName, Partial<Record<NodeTypeName, TransformStep[]>>>;
|
|
3
|
-
export declare const TRANSFORMATION_MATRIX: TransformationMatrix;
|
|
4
|
-
export declare const TRANSFORMATION_MATRIX_PANEL_C1: TransformationMatrix;
|
|
5
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Removes all disallowed marks from a node based on the target node type.
|
|
4
|
-
*
|
|
5
|
-
* @param node - The node to remove marks from.
|
|
6
|
-
* @param targetNode - The target node type to check against.
|
|
7
|
-
* @returns The nodes with the marks removed.
|
|
8
|
-
*/
|
|
9
|
-
export declare const removeDisallowedMarks: (nodes: PMNode[], targetNode: NodeType) => PMNode[];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
/**
|
|
3
|
-
* Checks if a node is a list type that supports indentation (bulletList, orderedList, taskList).
|
|
4
|
-
*
|
|
5
|
-
* @param node - The node to check.
|
|
6
|
-
* @param schema - ProseMirror schema for check
|
|
7
|
-
* @returns True if the node is a list type, false otherwise.
|
|
8
|
-
*/
|
|
9
|
-
export declare const isListWithIndentation: (nodeTypeName: string, schema: Schema) => boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Checks if a node is a list where its list items only support text content (taskList or decisionList).
|
|
12
|
-
*
|
|
13
|
-
* @param nodeTypeName - The node type name to check.
|
|
14
|
-
* @param schema - ProseMirror schema for check
|
|
15
|
-
* @returns True if the node is a list text type, false otherwise.
|
|
16
|
-
*/
|
|
17
|
-
export declare const isListWithTextContentOnly: (nodeTypeName: string, schema: Schema) => boolean;
|
package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/applyTargetTextTypeStep.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Applies target text type conversion. Converts textblock nodes to the target text type
|
|
4
|
-
* (paragraph or heading). Non-textblock nodes are left unchanged.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* Input:
|
|
8
|
-
* - paragraph "Text 1"
|
|
9
|
-
* - paragraph "Text 2"
|
|
10
|
-
*
|
|
11
|
-
* Output (with target: heading, level: 2):
|
|
12
|
-
* - heading (level: 2) "Text 1"
|
|
13
|
-
* - heading (level: 2) "Text 2"
|
|
14
|
-
*
|
|
15
|
-
* Output (with target: paragraph):
|
|
16
|
-
* - paragraph "Text 1"
|
|
17
|
-
* - paragraph "Text 2"
|
|
18
|
-
*
|
|
19
|
-
* @param nodes
|
|
20
|
-
* @param context
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare const applyTargetTextTypeStep: TransformStep;
|
package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/decisionListToListStep.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Transforms a decisionList into a bulletList, orderedList, or taskList.
|
|
4
|
-
* Decision items are converted to the appropriate list item type.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* Input (decisionList):
|
|
8
|
-
* - decisionList
|
|
9
|
-
* - decisionItem "Task 1"
|
|
10
|
-
* - decisionItem "Task 2"
|
|
11
|
-
*
|
|
12
|
-
* Output (bulletList):
|
|
13
|
-
* - bulletList
|
|
14
|
-
* - listItem
|
|
15
|
-
* - paragraph "Task 1"
|
|
16
|
-
* - listItem
|
|
17
|
-
* - paragraph "Task 2"
|
|
18
|
-
*
|
|
19
|
-
* Output (taskList):
|
|
20
|
-
* - taskList
|
|
21
|
-
* - taskItem
|
|
22
|
-
* - paragraph "Task 1"
|
|
23
|
-
* - taskItem
|
|
24
|
-
* - paragraph "Task 2"
|
|
25
|
-
*
|
|
26
|
-
* @param nodes - Array of nodes to transform
|
|
27
|
-
* @param context - Transform context with schema and target node type
|
|
28
|
-
* @returns array of transformed nodes
|
|
29
|
-
*/
|
|
30
|
-
export declare const decisionListToListStep: TransformStep;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Given an array of nodes, returns an array with the flattened children of any list node
|
|
4
|
-
* to it's first ancestor list, maintaining document order.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* Input (deeply nested):
|
|
8
|
-
* - bulletList
|
|
9
|
-
* - listItem "1"
|
|
10
|
-
* - bulletList
|
|
11
|
-
* - listItem "1.1"
|
|
12
|
-
* - bulletList
|
|
13
|
-
* - listItem "1.1.1"
|
|
14
|
-
* - listItem "1.2"
|
|
15
|
-
* - listItem "2"
|
|
16
|
-
*
|
|
17
|
-
* Output:
|
|
18
|
-
* - bulletList
|
|
19
|
-
* - listItem "1"
|
|
20
|
-
* - listItem "1.1"
|
|
21
|
-
* - listItem "1.1.1"
|
|
22
|
-
* - listItem "1.2"
|
|
23
|
-
* - listItem "2"
|
|
24
|
-
*
|
|
25
|
-
* @param nodes
|
|
26
|
-
* @param context
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
export declare const flattenListStep: TransformStep;
|
package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/listToDecisionListStep.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Transforms a bulletList, orderedList, or taskList into a decisionList.
|
|
4
|
-
*
|
|
5
|
-
* Notes
|
|
6
|
-
* - decisionLists and taskList only support text as children - need to ensure content is converted to text
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* Input (nested bulletList):
|
|
10
|
-
* - bulletList
|
|
11
|
-
* - listItem "1.1"
|
|
12
|
-
* - listItem "1.2"
|
|
13
|
-
* - listItem "1.3"
|
|
14
|
-
*
|
|
15
|
-
* Output (flat decisionList):
|
|
16
|
-
* - decisionList
|
|
17
|
-
* - decisionItem "1"
|
|
18
|
-
* - decisionItem "1.1"
|
|
19
|
-
* - decisionItem "2"
|
|
20
|
-
*
|
|
21
|
-
* @param nodes - Array of nodes to transform
|
|
22
|
-
* @param context - Transform context with schema and target node type
|
|
23
|
-
* @returns array of transformed nodes
|
|
24
|
-
*/
|
|
25
|
-
export declare const listToDecisionListStep: TransformStep;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Transform step that converts between bulletList, orderedList, and taskList types.
|
|
4
|
-
* This step maintains the order and indentation of the list by recursively
|
|
5
|
-
* converting all nested lists while preserving the structure. It also handles
|
|
6
|
-
* conversion between listItem and taskItem types.
|
|
7
|
-
*
|
|
8
|
-
* When converting to taskList/taskItem, unsupported content (images, codeBlocks) is filtered out.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* Input (bulletList with nested bulletList):
|
|
12
|
-
* - bulletList
|
|
13
|
-
* - listItem "1"
|
|
14
|
-
* - bulletList
|
|
15
|
-
* - listItem "1.1"
|
|
16
|
-
* - bulletList
|
|
17
|
-
* - listItem "1.1.1"
|
|
18
|
-
* - listItem "1.2"
|
|
19
|
-
* - listItem "2"
|
|
20
|
-
*
|
|
21
|
-
* Output (orderedList with nested orderedList):
|
|
22
|
-
* 1. orderedList
|
|
23
|
-
* 1. listItem "1"
|
|
24
|
-
* 1. orderedList
|
|
25
|
-
* 1. listItem "1.1"
|
|
26
|
-
* 1. orderedList
|
|
27
|
-
* 1. listItem "1.1.1"
|
|
28
|
-
* 2. listItem "1.2"
|
|
29
|
-
* 2. listItem "2"
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* Input (bulletList with nested taskList):
|
|
33
|
-
* - bulletList
|
|
34
|
-
* - listItem "Regular item"
|
|
35
|
-
* - taskList
|
|
36
|
-
* - taskItem "Task 1" (checked)
|
|
37
|
-
* - taskItem "Task 2" (unchecked)
|
|
38
|
-
*
|
|
39
|
-
* Output (orderedList with nested orderedList, taskItems converted to listItems):
|
|
40
|
-
* 1. orderedList
|
|
41
|
-
* 1. listItem "Regular item"
|
|
42
|
-
* 1. orderedList
|
|
43
|
-
* 1. listItem "Task 1"
|
|
44
|
-
* 2. listItem "Task 2"
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* Input (bulletList to taskList, with paragraph extraction):
|
|
48
|
-
* - bulletList
|
|
49
|
-
* - listItem
|
|
50
|
-
* - paragraph "Text content"
|
|
51
|
-
* - listItem
|
|
52
|
-
* - paragraph "Text"
|
|
53
|
-
* - codeBlock "code"
|
|
54
|
-
* - mediaSingle (image)
|
|
55
|
-
*
|
|
56
|
-
* Output (taskList with text extracted from paragraphs, unsupported content filtered):
|
|
57
|
-
* - taskList
|
|
58
|
-
* - taskItem "Text content" (text extracted from paragraph)
|
|
59
|
-
* - taskItem "Text" (text extracted, codeBlock and image filtered out)
|
|
60
|
-
*
|
|
61
|
-
* @param nodes - The nodes to transform
|
|
62
|
-
* @param context - The transformation context containing schema and target node type
|
|
63
|
-
* @returns The transformed nodes
|
|
64
|
-
*/
|
|
65
|
-
export declare const listToListStep: TransformStep;
|
package/dist/types-ts4.5/editor-commands/transform-node-utils/steps/mergeNeighbourListsStep.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Merges consecutive lists of the same type into a single list.
|
|
4
|
-
* This step is useful after multiToListStep which may create multiple separate lists
|
|
5
|
-
* that should be combined.
|
|
6
|
-
*
|
|
7
|
-
* Handles both nestable lists (bulletList, orderedList, taskList) and
|
|
8
|
-
* non-nestable lists (decisionList).
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* Input:
|
|
12
|
-
* - bulletList
|
|
13
|
-
* - listItem "1"
|
|
14
|
-
* - bulletList
|
|
15
|
-
* - listItem "2"
|
|
16
|
-
* - panel (non-list node)
|
|
17
|
-
* - bulletList
|
|
18
|
-
* - listItem "3"
|
|
19
|
-
*
|
|
20
|
-
* Output:
|
|
21
|
-
* - bulletList
|
|
22
|
-
* - listItem "1"
|
|
23
|
-
* - listItem "2"
|
|
24
|
-
* - panel (non-list node)
|
|
25
|
-
* - bulletList
|
|
26
|
-
* - listItem "3"
|
|
27
|
-
*
|
|
28
|
-
* @param nodes - The nodes to process
|
|
29
|
-
* @param context - The transformation context
|
|
30
|
-
* @returns The merged nodes
|
|
31
|
-
*/
|
|
32
|
-
export declare const mergeNeighbourListsStep: TransformStep;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Unwraps an expand/nestedExpand node, converting its title attribute to a paragraph
|
|
4
|
-
* and prepending it to the children.
|
|
5
|
-
*
|
|
6
|
-
* Any nestedExpand children are converted to regular expands since nestedExpand
|
|
7
|
-
* can only exist inside an expand.
|
|
8
|
-
*
|
|
9
|
-
* Example: expand({ title: 'title' })(p('b')) → [p('title'), p('b')]
|
|
10
|
-
* Example: expand({ title: 'outer' })(nestedExpand({ title: 'inner' })(p('x')))
|
|
11
|
-
* → [p('outer'), expand({ title: 'inner' })(p('x'))]
|
|
12
|
-
*/
|
|
13
|
-
export declare const unwrapExpandStep: TransformStep;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Unwraps a layoutSection node, extracting content from all columns.
|
|
4
|
-
* Works with any number of columns (2, 3, etc.).
|
|
5
|
-
*
|
|
6
|
-
* Example:
|
|
7
|
-
* layoutSection(
|
|
8
|
-
* layoutColumn(p('a'), p('b')),
|
|
9
|
-
* layoutColumn(p('c')),
|
|
10
|
-
* layoutColumn(p('d'))
|
|
11
|
-
* )
|
|
12
|
-
* → [p('a'), p('b'), p('c'), p('d')]
|
|
13
|
-
*/
|
|
14
|
-
export declare const unwrapLayoutStep: TransformStep;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Given an array of nodes, processes each list removing all parent list nodes and
|
|
4
|
-
* just returning their child contents.
|
|
5
|
-
*
|
|
6
|
-
* For lists with block content (bulletList, orderedList), it extracts the block nodes directly.
|
|
7
|
-
* For lists with inline content (taskList, decisionList), it wraps the content in paragraphs.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* Input:
|
|
11
|
-
* - bulletList
|
|
12
|
-
* - listItem "1"
|
|
13
|
-
* - paragraph "1"
|
|
14
|
-
* - listItem "2"
|
|
15
|
-
* - paragraph "2"
|
|
16
|
-
*
|
|
17
|
-
* Output:
|
|
18
|
-
* - paragraph "1"
|
|
19
|
-
* - paragraph "2"
|
|
20
|
-
*
|
|
21
|
-
* @param nodes
|
|
22
|
-
* @param context
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export declare const unwrapListStep: TransformStep;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Wraps blockquote content into decisionList:
|
|
4
|
-
* - Text nodes (paragraph, heading) have their inline content extracted and wrapped in decisionItems
|
|
5
|
-
* - Consecutive text nodes are grouped into a single decisionList with multiple decisionItems
|
|
6
|
-
* - All other nodes break out (lists, code blocks, media, tables, macros, containers, etc.)
|
|
7
|
-
*
|
|
8
|
-
* The logic follows the transform rules:
|
|
9
|
-
* - Only flatten text nodes into decisionItem (since that's the intent - converting text to decisions)
|
|
10
|
-
* - Structures that can't be represented in a decisionItem should break out unchanged
|
|
11
|
-
* - When a break-out node is encountered, flush accumulated decisionItems into a decisionList
|
|
12
|
-
*
|
|
13
|
-
* Example: blockquote(p('a'), p('b'), ul(...), p('c')) → [decisionList(decisionItem('a'), decisionItem('b')), ul(...), decisionList(decisionItem('c'))]
|
|
14
|
-
*/
|
|
15
|
-
export declare const wrapBlockquoteToDecisionListStep: TransformStep;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TransformStep } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Wraps nodes into bullet list, numbered list, task list, or decision list.
|
|
4
|
-
*
|
|
5
|
-
* @param nodes - The nodes to wrap.
|
|
6
|
-
* @param context - The transformation context containing schema and target node type.
|
|
7
|
-
* @returns The wrapped nodes.
|
|
8
|
-
*/
|
|
9
|
-
export declare const wrapIntoListStep: TransformStep;
|