@atlaskit/editor-plugin-block-menu 0.0.20 → 1.0.1
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 +16 -0
- package/dist/cjs/editor-commands/formatNode.js +6 -3
- package/dist/cjs/editor-commands/transforms/block-transforms.js +22 -10
- package/dist/cjs/editor-commands/transforms/container-transforms.js +40 -7
- package/dist/cjs/editor-commands/transforms/inline-node-transforms.js +27 -0
- package/dist/cjs/editor-commands/transforms/list/transformBetweenListTypes.js +102 -0
- package/dist/cjs/editor-commands/transforms/list-transforms.js +51 -19
- package/dist/cjs/editor-commands/transforms/utils.js +1 -1
- package/dist/cjs/ui/block-menu-components.js +1 -2
- package/dist/es2019/editor-commands/formatNode.js +6 -3
- package/dist/es2019/editor-commands/transforms/block-transforms.js +29 -15
- package/dist/es2019/editor-commands/transforms/container-transforms.js +35 -2
- package/dist/es2019/editor-commands/transforms/inline-node-transforms.js +21 -0
- package/dist/es2019/editor-commands/transforms/list/transformBetweenListTypes.js +98 -0
- package/dist/es2019/editor-commands/transforms/list-transforms.js +49 -15
- package/dist/es2019/editor-commands/transforms/utils.js +1 -1
- package/dist/es2019/ui/block-menu-components.js +1 -2
- package/dist/esm/editor-commands/formatNode.js +6 -3
- package/dist/esm/editor-commands/transforms/block-transforms.js +23 -11
- package/dist/esm/editor-commands/transforms/container-transforms.js +39 -7
- package/dist/esm/editor-commands/transforms/inline-node-transforms.js +21 -0
- package/dist/esm/editor-commands/transforms/list/transformBetweenListTypes.js +95 -0
- package/dist/esm/editor-commands/transforms/list-transforms.js +50 -18
- package/dist/esm/editor-commands/transforms/utils.js +1 -1
- package/dist/esm/ui/block-menu-components.js +1 -2
- package/dist/types/editor-commands/transforms/container-transforms.d.ts +2 -2
- package/dist/types/editor-commands/transforms/inline-node-transforms.d.ts +3 -0
- package/dist/types/editor-commands/transforms/list/transformBetweenListTypes.d.ts +9 -0
- package/dist/types/editor-commands/transforms/list-transforms.d.ts +1 -6
- package/dist/types/editor-commands/transforms/types.d.ts +3 -3
- package/dist/types/editor-commands/transforms/utils.d.ts +1 -1
- package/dist/types-ts4.5/editor-commands/transforms/container-transforms.d.ts +2 -2
- package/dist/types-ts4.5/editor-commands/transforms/inline-node-transforms.d.ts +3 -0
- package/dist/types-ts4.5/editor-commands/transforms/list/transformBetweenListTypes.d.ts +9 -0
- package/dist/types-ts4.5/editor-commands/transforms/list-transforms.d.ts +1 -6
- package/dist/types-ts4.5/editor-commands/transforms/types.d.ts +3 -3
- package/dist/types-ts4.5/editor-commands/transforms/utils.d.ts +1 -1
- package/package.json +7 -12
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export type FormatNodeTargetType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'blockquote' | 'expand' | 'panel' | '
|
|
3
|
+
export type FormatNodeTargetType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'blockquote' | 'expand' | 'layout' | 'panel' | 'codeBlock' | 'bulletList' | 'orderedList' | 'taskList';
|
|
4
4
|
export interface TransformContext {
|
|
5
|
-
tr: Transaction;
|
|
6
5
|
sourceNode: PMNode;
|
|
7
6
|
sourcePos: number | null;
|
|
8
|
-
targetNodeType: NodeType;
|
|
9
7
|
targetAttrs?: Record<string, unknown>;
|
|
8
|
+
targetNodeType: NodeType;
|
|
9
|
+
tr: Transaction;
|
|
10
10
|
}
|
|
11
11
|
export type TransformFunction = (context: TransformContext) => Transaction | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { FormatNodeTargetType } from './types';
|
|
3
3
|
export declare const getTargetNodeInfo: (targetType: FormatNodeTargetType, nodes: Record<string, NodeType>) => {
|
|
4
|
-
nodeType: NodeType;
|
|
5
4
|
attrs?: Record<string, unknown>;
|
|
5
|
+
nodeType: NodeType;
|
|
6
6
|
} | null;
|
|
7
7
|
export declare const isBlockNode: (node: PMNode) => boolean;
|
|
8
8
|
export declare const isListNode: (node: PMNode) => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { TransformFunction } from './types';
|
|
1
|
+
import type { TransformContext, TransformFunction } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Transform selection to container type
|
|
4
4
|
*/
|
|
5
|
-
export declare const transformToContainer: () => null;
|
|
5
|
+
export declare const transformToContainer: ({ tr, sourceNode, targetNodeType, targetAttrs, }: TransformContext) => import("prosemirror-state").Transaction | null;
|
|
6
6
|
/**
|
|
7
7
|
* Transform container nodes (panel, expand, blockquote)
|
|
8
8
|
*/
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const getInlineNodeTextContent: (sourceContent: Fragment, tr: Transaction) => import("prosemirror-model").Node | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Transform list structure
|
|
5
|
+
*/
|
|
6
|
+
export declare const transformListStructure: (tr: Transaction, listNode: {
|
|
7
|
+
node: PMNode;
|
|
8
|
+
pos: number;
|
|
9
|
+
}, targetNodeType: NodeType, nodes: Record<string, NodeType>) => Transaction;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
1
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import type { TransformContext, TransformFunction } from './types';
|
|
4
3
|
/**
|
|
5
4
|
* Transform selection to list type
|
|
6
5
|
*/
|
|
7
|
-
export declare const
|
|
8
|
-
targetAttrs?: Record<string, unknown>;
|
|
9
|
-
targetNodeType: NodeType;
|
|
10
|
-
tr: Transaction;
|
|
11
|
-
}) => Transaction | null;
|
|
6
|
+
export declare const transformBlockToList: (context: TransformContext) => Transaction | null;
|
|
12
7
|
/**
|
|
13
8
|
* Transform list nodes
|
|
14
9
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export type FormatNodeTargetType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'blockquote' | 'expand' | 'panel' | '
|
|
3
|
+
export type FormatNodeTargetType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'paragraph' | 'blockquote' | 'expand' | 'layout' | 'panel' | 'codeBlock' | 'bulletList' | 'orderedList' | 'taskList';
|
|
4
4
|
export interface TransformContext {
|
|
5
|
-
tr: Transaction;
|
|
6
5
|
sourceNode: PMNode;
|
|
7
6
|
sourcePos: number | null;
|
|
8
|
-
targetNodeType: NodeType;
|
|
9
7
|
targetAttrs?: Record<string, unknown>;
|
|
8
|
+
targetNodeType: NodeType;
|
|
9
|
+
tr: Transaction;
|
|
10
10
|
}
|
|
11
11
|
export type TransformFunction = (context: TransformContext) => Transaction | null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { FormatNodeTargetType } from './types';
|
|
3
3
|
export declare const getTargetNodeInfo: (targetType: FormatNodeTargetType, nodes: Record<string, NodeType>) => {
|
|
4
|
-
nodeType: NodeType;
|
|
5
4
|
attrs?: Record<string, unknown>;
|
|
5
|
+
nodeType: NodeType;
|
|
6
6
|
} | null;
|
|
7
7
|
export declare const isBlockNode: (node: PMNode) => boolean;
|
|
8
8
|
export declare const isListNode: (node: PMNode) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/css": "^0.12.0",
|
|
32
32
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
33
|
-
"@atlaskit/editor-plugin-block-controls": "^
|
|
34
|
-
"@atlaskit/editor-plugin-decorations": "^
|
|
35
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
36
|
-
"@atlaskit/editor-plugin-user-intent": "^
|
|
33
|
+
"@atlaskit/editor-plugin-block-controls": "^5.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-decorations": "^4.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-selection": "^4.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-user-intent": "^2.0.0",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
38
38
|
"@atlaskit/editor-shared-styles": "^3.6.0",
|
|
39
39
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
40
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
40
|
+
"@atlaskit/editor-toolbar": "^0.7.0",
|
|
41
41
|
"@atlaskit/icon": "^28.1.0",
|
|
42
42
|
"@atlaskit/icon-lab": "^5.7.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^
|
|
49
|
+
"@atlaskit/editor-common": "^108.1.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
52
52
|
},
|
|
@@ -85,10 +85,5 @@
|
|
|
85
85
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
86
86
|
]
|
|
87
87
|
}
|
|
88
|
-
},
|
|
89
|
-
"platform-feature-flags": {
|
|
90
|
-
"platform_editor_block_menu_format": {
|
|
91
|
-
"type": "boolean"
|
|
92
|
-
}
|
|
93
88
|
}
|
|
94
89
|
}
|