@atlaskit/editor-plugin-block-menu 5.2.20 → 5.2.22
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/blockMenuPlugin.js +17 -2
- package/dist/cjs/editor-actions/isTrasformToTargetDisabled.js +114 -0
- package/dist/cjs/editor-commands/transform-node-utils/transform.js +94 -28
- package/dist/cjs/ui/copy-link.js +3 -6
- package/dist/es2019/blockMenuPlugin.js +17 -2
- package/dist/es2019/editor-actions/isTrasformToTargetDisabled.js +110 -0
- package/dist/es2019/editor-commands/transform-node-utils/transform.js +93 -27
- package/dist/es2019/ui/copy-link.js +3 -6
- package/dist/esm/blockMenuPlugin.js +17 -2
- package/dist/esm/editor-actions/isTrasformToTargetDisabled.js +108 -0
- package/dist/esm/editor-commands/transform-node-utils/transform.js +93 -27
- package/dist/esm/ui/copy-link.js +3 -6
- package/dist/types/blockMenuPluginType.d.ts +1 -0
- package/dist/types/editor-actions/isTrasformToTargetDisabled.d.ts +11 -0
- package/dist/types/editor-commands/transform-node-utils/transform.d.ts +2 -0
- package/dist/types-ts4.5/blockMenuPluginType.d.ts +1 -0
- package/dist/types-ts4.5/editor-actions/isTrasformToTargetDisabled.d.ts +11 -0
- package/dist/types-ts4.5/editor-commands/transform-node-utils/transform.d.ts +2 -0
- package/package.json +3 -3
- package/dist/cjs/editor-commands/transform-node-utils/stubStep.js +0 -9
- package/dist/es2019/editor-commands/transform-node-utils/stubStep.js +0 -3
- package/dist/esm/editor-commands/transform-node-utils/stubStep.js +0 -3
- package/dist/types/editor-commands/transform-node-utils/stubStep.d.ts +0 -2
- package/dist/types-ts4.5/editor-commands/transform-node-utils/stubStep.d.ts +0 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Node as PMNode, type NodeType, type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeTypeName } from './types';
|
|
2
3
|
interface GetOutputNodesArgs {
|
|
3
4
|
isNested: boolean;
|
|
4
5
|
schema: Schema;
|
|
@@ -7,4 +8,5 @@ interface GetOutputNodesArgs {
|
|
|
7
8
|
targetNodeType: NodeType;
|
|
8
9
|
}
|
|
9
10
|
export declare const getOutputNodes: ({ sourceNode, targetNodeType, schema, isNested, targetAttrs, }: GetOutputNodesArgs) => PMNode[] | undefined;
|
|
11
|
+
export declare const isTransformDisabledBasedOnStepsConfig: (selectedNodeType: NodeTypeName, targetNodeType: NodeTypeName) => boolean;
|
|
10
12
|
export {};
|
|
@@ -14,6 +14,7 @@ type TransformNodeCommand = (targetType: NodeType, metadata?: TransformNodeMetad
|
|
|
14
14
|
export type BlockMenuPlugin = NextEditorPlugin<'blockMenu', {
|
|
15
15
|
actions: {
|
|
16
16
|
getBlockMenuComponents: () => Array<RegisterBlockMenuComponent>;
|
|
17
|
+
isTransformOptionDisabled: (optionNodeTypeName: string, optionNodeTypeAttrs?: Record<string, unknown>) => boolean;
|
|
17
18
|
registerBlockMenuComponents: (blockMenuComponents: Array<RegisterBlockMenuComponent>) => void;
|
|
18
19
|
};
|
|
19
20
|
commands: {
|
|
@@ -0,0 +1,11 @@
|
|
|
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, parentNode: PMNode, nodeTypeName: NodeTypeName, nodeTypeAttrs?: Record<string, unknown>) => boolean;
|
|
10
|
+
export declare const isTrasformToTargetDisabled: ({ selection, targetNodeTypeName, targetNodeTypeAttrs, }: TransformDisabledArgs) => boolean;
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Node as PMNode, type NodeType, type Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { NodeTypeName } from './types';
|
|
2
3
|
interface GetOutputNodesArgs {
|
|
3
4
|
isNested: boolean;
|
|
4
5
|
schema: Schema;
|
|
@@ -7,4 +8,5 @@ interface GetOutputNodesArgs {
|
|
|
7
8
|
targetNodeType: NodeType;
|
|
8
9
|
}
|
|
9
10
|
export declare const getOutputNodes: ({ sourceNode, targetNodeType, schema, isNested, targetAttrs, }: GetOutputNodesArgs) => PMNode[] | undefined;
|
|
11
|
+
export declare const isTransformDisabledBasedOnStepsConfig: (selectedNodeType: NodeTypeName, targetNodeType: NodeTypeName) => boolean;
|
|
10
12
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-menu",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.22",
|
|
4
4
|
"description": "BlockMenu plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
46
46
|
"@atlaskit/primitives": "^17.0.0",
|
|
47
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
47
|
+
"@atlaskit/tmp-editor-statsig": "^16.2.0",
|
|
48
48
|
"@atlaskit/tokens": "^9.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@atlaskit/editor-common": "^110.
|
|
52
|
+
"@atlaskit/editor-common": "^110.48.0",
|
|
53
53
|
"react": "^18.2.0",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
55
55
|
},
|