@atlaskit/editor-plugin-block-type 4.0.10 → 4.0.12
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 +18 -0
- package/dist/cjs/blockTypePlugin.js +9 -11
- package/dist/cjs/pm-plugins/block-types.js +9 -2
- package/dist/cjs/pm-plugins/commands/block-type.js +63 -15
- package/dist/cjs/pm-plugins/commands/wrapSelectionIn.js +61 -0
- package/dist/cjs/pm-plugins/keymap.js +6 -4
- package/dist/cjs/pm-plugins/main.js +15 -7
- package/dist/cjs/pm-plugins/ui/FloatingToolbarComponent.js +5 -0
- package/dist/cjs/pm-plugins/ui/PrimaryToolbarComponent.js +7 -2
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/index.js +22 -19
- package/dist/cjs/pm-plugins/ui/ToolbarBlockType/styled.js +1 -1
- package/dist/cjs/pm-plugins/utils.js +17 -1
- package/dist/es2019/blockTypePlugin.js +11 -9
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/pm-plugins/block-types.js +8 -1
- package/dist/es2019/pm-plugins/commands/block-type.js +61 -13
- package/dist/es2019/pm-plugins/commands/wrapSelectionIn.js +54 -0
- package/dist/es2019/pm-plugins/keymap.js +3 -1
- package/dist/es2019/pm-plugins/main.js +12 -6
- package/dist/es2019/pm-plugins/ui/FloatingToolbarComponent.js +5 -0
- package/dist/es2019/pm-plugins/ui/PrimaryToolbarComponent.js +7 -2
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/index.js +12 -6
- package/dist/es2019/pm-plugins/ui/ToolbarBlockType/styled.js +2 -2
- package/dist/es2019/pm-plugins/utils.js +15 -1
- package/dist/es2019/ui/consts.js +3 -0
- package/dist/esm/blockTypePlugin.js +11 -8
- package/dist/esm/index.js +3 -0
- package/dist/esm/pm-plugins/block-types.js +8 -1
- package/dist/esm/pm-plugins/commands/block-type.js +62 -15
- package/dist/esm/pm-plugins/commands/wrapSelectionIn.js +55 -0
- package/dist/esm/pm-plugins/keymap.js +3 -1
- package/dist/esm/pm-plugins/main.js +14 -6
- package/dist/esm/pm-plugins/ui/FloatingToolbarComponent.js +5 -0
- package/dist/esm/pm-plugins/ui/PrimaryToolbarComponent.js +7 -2
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/index.js +22 -19
- package/dist/esm/pm-plugins/ui/ToolbarBlockType/styled.js +2 -2
- package/dist/esm/pm-plugins/utils.js +17 -1
- package/dist/esm/ui/consts.js +3 -0
- package/dist/types/blockTypePlugin.d.ts +0 -2
- package/dist/types/blockTypePluginType.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/pm-plugins/block-types.d.ts +1 -0
- package/dist/types/pm-plugins/commands/block-type.d.ts +6 -5
- package/dist/types/pm-plugins/commands/wrapSelectionIn.d.ts +3 -0
- package/dist/types/pm-plugins/main.d.ts +3 -1
- package/dist/types/pm-plugins/types.d.ts +1 -0
- package/dist/types/pm-plugins/ui/ToolbarBlockType/index.d.ts +2 -1
- package/dist/types-ts4.5/blockTypePlugin.d.ts +0 -2
- package/dist/types-ts4.5/blockTypePluginType.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/block-types.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/commands/block-type.d.ts +6 -5
- package/dist/types-ts4.5/pm-plugins/commands/wrapSelectionIn.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/index.d.ts +2 -1
- package/package.json +6 -6
- package/dist/cjs/pm-plugins/commands/index.js +0 -62
- package/dist/es2019/pm-plugins/commands/index.js +0 -3
- package/dist/esm/pm-plugins/commands/index.js +0 -3
- package/dist/types/pm-plugins/commands/index.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/commands/index.d.ts +0 -4
@@ -2,6 +2,6 @@ export { blockTypePlugin } from './blockTypePlugin';
|
|
2
2
|
export type { BlockTypePlugin } from './blockTypePluginType';
|
3
3
|
export type { BlockTypePluginOptions, BlockType } from './pm-plugins/types';
|
4
4
|
export type { BlockTypeState } from './pm-plugins/main';
|
5
|
-
export type { InputMethod } from './pm-plugins/commands';
|
5
|
+
export type { InputMethod } from './pm-plugins/commands/block-type';
|
6
6
|
export type { DropdownItem } from './pm-plugins/ui/ToolbarBlockType';
|
7
7
|
export type { TextBlockTypes } from './pm-plugins/block-types';
|
@@ -14,6 +14,7 @@ export declare const TEXT_BLOCK_TYPES: BlockType[];
|
|
14
14
|
export type TextBlockTypes = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
|
15
15
|
export declare const WRAPPER_BLOCK_TYPES: BlockType[];
|
16
16
|
export declare const ALL_BLOCK_TYPES: BlockType[];
|
17
|
+
export declare const getBlockTypesInDropdown: (includeBlockQuoteAsTextstyleOption?: boolean) => BlockType[];
|
17
18
|
export declare const HEADINGS_BY_LEVEL: Record<number, BlockType>;
|
18
19
|
export declare const HEADINGS_BY_NAME: {
|
19
20
|
[blockType: string]: BlockType;
|
@@ -3,11 +3,11 @@ import type { Command, EditorCommand, HeadingLevelsAndNormalText } from '@atlask
|
|
3
3
|
import type { TextBlockTypes } from '../block-types';
|
4
4
|
export type InputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB;
|
5
5
|
export declare function setBlockType(name: TextBlockTypes): EditorCommand;
|
6
|
-
export declare function setHeading(level: HeadingLevelsAndNormalText): EditorCommand;
|
7
|
-
export declare function setBlockTypeWithAnalytics(name: TextBlockTypes, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): EditorCommand;
|
8
|
-
export declare function setNormalText(): EditorCommand;
|
9
|
-
export declare function setNormalTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): EditorCommand;
|
10
|
-
export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAndNormalText, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => EditorCommand;
|
6
|
+
export declare function setHeading(level: HeadingLevelsAndNormalText, fromBlockQuote?: boolean): EditorCommand;
|
7
|
+
export declare function setBlockTypeWithAnalytics(name: TextBlockTypes, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean): EditorCommand;
|
8
|
+
export declare function setNormalText(fromBlockQuote?: boolean): EditorCommand;
|
9
|
+
export declare function setNormalTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean): EditorCommand;
|
10
|
+
export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAndNormalText, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean) => EditorCommand;
|
11
11
|
/**
|
12
12
|
*
|
13
13
|
* @param name - block type name
|
@@ -17,4 +17,5 @@ export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAnd
|
|
17
17
|
* @returns - command that inserts block type
|
18
18
|
*/
|
19
19
|
export declare const insertBlockQuoteWithAnalytics: (inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
20
|
+
export declare function insertBlockQuoteWithAnalyticsCommand(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): EditorCommand;
|
20
21
|
export declare const cleanUpAtTheStartOfDocument: Command;
|
@@ -10,12 +10,14 @@ export type BlockTypeState = {
|
|
10
10
|
blockTypesDisabled: boolean;
|
11
11
|
availableBlockTypes: BlockType[];
|
12
12
|
availableWrapperBlockTypes: BlockType[];
|
13
|
+
availableBlockTypesInDropdown: BlockType[];
|
13
14
|
};
|
14
15
|
export declare const pluginKey: PluginKey<BlockTypeState>;
|
15
|
-
export declare const createPlugin: (editorAPI: ExtractInjectionAPI<BlockTypePlugin> | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean) => SafePlugin<{
|
16
|
+
export declare const createPlugin: (editorAPI: ExtractInjectionAPI<BlockTypePlugin> | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean, includeBlockQuoteAsTextstyleOption?: boolean) => SafePlugin<{
|
16
17
|
currentBlockType: BlockType;
|
17
18
|
blockTypesDisabled: boolean;
|
18
19
|
availableBlockTypes: BlockType[];
|
19
20
|
availableWrapperBlockTypes: BlockType[];
|
21
|
+
availableBlockTypesInDropdown: BlockType[];
|
20
22
|
}>;
|
21
23
|
export declare const handleBlockQuoteDND: (view: EditorView, event: DragEvent, slice: Slice) => boolean;
|
@@ -24,7 +24,8 @@ export interface Props {
|
|
24
24
|
popupsBoundariesElement?: HTMLElement;
|
25
25
|
popupsScrollableElement?: HTMLElement;
|
26
26
|
editorView?: EditorView;
|
27
|
-
setTextLevel: (type: TextBlockTypes) => void;
|
27
|
+
setTextLevel: (type: TextBlockTypes, fromBlockQuote?: boolean) => void;
|
28
|
+
wrapBlockQuote: (type: TextBlockTypes) => void;
|
28
29
|
shouldUseDefaultRole?: boolean;
|
29
30
|
api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
|
30
31
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.12",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -34,9 +34,9 @@
|
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
36
|
"@atlaskit/adf-schema": "^46.1.0",
|
37
|
-
"@atlaskit/editor-common": "^96.
|
37
|
+
"@atlaskit/editor-common": "^96.6.0",
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
39
|
-
"@atlaskit/editor-plugin-primary-toolbar": "^2.
|
39
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^2.1.0",
|
40
40
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
41
41
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
42
42
|
"@atlaskit/editor-tables": "^2.8.0",
|
@@ -45,8 +45,8 @@
|
|
45
45
|
"@atlaskit/primitives": "^13.3.0",
|
46
46
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
47
47
|
"@atlaskit/theme": "^14.0.0",
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
49
|
-
"@atlaskit/tokens": "^2.
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^2.28.0",
|
49
|
+
"@atlaskit/tokens": "^2.5.0",
|
50
50
|
"@babel/runtime": "^7.0.0",
|
51
51
|
"@emotion/react": "^11.7.1"
|
52
52
|
},
|
@@ -57,7 +57,7 @@
|
|
57
57
|
},
|
58
58
|
"devDependencies": {
|
59
59
|
"@af/visual-regression": "*",
|
60
|
-
"@atlaskit/analytics-next": "^10.
|
60
|
+
"@atlaskit/analytics-next": "^10.2.0",
|
61
61
|
"@atlaskit/editor-plugin-quick-insert": "^1.8.0",
|
62
62
|
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
63
63
|
"@atlaskit/ssr": "*",
|
@@ -1,62 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "cleanUpAtTheStartOfDocument", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function get() {
|
9
|
-
return _blockType.cleanUpAtTheStartOfDocument;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "deleteAndMoveCursor", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function get() {
|
15
|
-
return _deleteAndMoveCursor.deleteAndMoveCursor;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
Object.defineProperty(exports, "deleteBlockContent", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function get() {
|
21
|
-
return _deleteBlockContent.deleteBlockContent;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
Object.defineProperty(exports, "insertBlockQuoteWithAnalytics", {
|
25
|
-
enumerable: true,
|
26
|
-
get: function get() {
|
27
|
-
return _blockType.insertBlockQuoteWithAnalytics;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
Object.defineProperty(exports, "setBlockType", {
|
31
|
-
enumerable: true,
|
32
|
-
get: function get() {
|
33
|
-
return _blockType.setBlockType;
|
34
|
-
}
|
35
|
-
});
|
36
|
-
Object.defineProperty(exports, "setBlockTypeWithAnalytics", {
|
37
|
-
enumerable: true,
|
38
|
-
get: function get() {
|
39
|
-
return _blockType.setBlockTypeWithAnalytics;
|
40
|
-
}
|
41
|
-
});
|
42
|
-
Object.defineProperty(exports, "setHeadingWithAnalytics", {
|
43
|
-
enumerable: true,
|
44
|
-
get: function get() {
|
45
|
-
return _blockType.setHeadingWithAnalytics;
|
46
|
-
}
|
47
|
-
});
|
48
|
-
Object.defineProperty(exports, "setNormalText", {
|
49
|
-
enumerable: true,
|
50
|
-
get: function get() {
|
51
|
-
return _blockType.setNormalText;
|
52
|
-
}
|
53
|
-
});
|
54
|
-
Object.defineProperty(exports, "setNormalTextWithAnalytics", {
|
55
|
-
enumerable: true,
|
56
|
-
get: function get() {
|
57
|
-
return _blockType.setNormalTextWithAnalytics;
|
58
|
-
}
|
59
|
-
});
|
60
|
-
var _blockType = require("./block-type");
|
61
|
-
var _deleteAndMoveCursor = require("./delete-and-move-cursor");
|
62
|
-
var _deleteBlockContent = require("./delete-block-content");
|
@@ -1,3 +0,0 @@
|
|
1
|
-
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics } from './block-type';
|
2
|
-
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
3
|
-
export { deleteBlockContent } from './delete-block-content';
|
@@ -1,3 +0,0 @@
|
|
1
|
-
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics } from './block-type';
|
2
|
-
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
3
|
-
export { deleteBlockContent } from './delete-block-content';
|
@@ -1,4 +0,0 @@
|
|
1
|
-
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics, } from './block-type';
|
2
|
-
export type { InputMethod } from './block-type';
|
3
|
-
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
4
|
-
export { deleteBlockContent } from './delete-block-content';
|
@@ -1,4 +0,0 @@
|
|
1
|
-
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics, } from './block-type';
|
2
|
-
export type { InputMethod } from './block-type';
|
3
|
-
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
4
|
-
export { deleteBlockContent } from './delete-block-content';
|