@atlaskit/editor-plugin-block-type 2.0.0 → 3.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 +36 -0
- package/dist/cjs/i18n/nl.js +6 -6
- package/dist/cjs/plugin/commands/block-type.js +91 -53
- package/dist/cjs/plugin/commands/index.js +1 -8
- package/dist/cjs/plugin/index.js +17 -16
- package/dist/cjs/plugin/pm-plugins/main.js +10 -8
- package/dist/cjs/plugin/ui/ToolbarBlockType/index.js +1 -1
- package/dist/es2019/i18n/nl.js +6 -6
- package/dist/es2019/plugin/commands/block-type.js +101 -46
- package/dist/es2019/plugin/commands/index.js +1 -6
- package/dist/es2019/plugin/index.js +17 -18
- package/dist/es2019/plugin/pm-plugins/main.js +10 -8
- package/dist/es2019/plugin/ui/ToolbarBlockType/index.js +1 -1
- package/dist/esm/i18n/nl.js +6 -6
- package/dist/esm/plugin/commands/block-type.js +90 -53
- package/dist/esm/plugin/commands/index.js +1 -6
- package/dist/esm/plugin/index.js +17 -16
- package/dist/esm/plugin/pm-plugins/main.js +10 -8
- package/dist/esm/plugin/ui/ToolbarBlockType/index.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugin/block-types.d.ts +1 -0
- package/dist/types/plugin/commands/block-type.d.ts +8 -6
- package/dist/types/plugin/commands/index.d.ts +0 -5
- package/dist/types/plugin/index.d.ts +5 -2
- package/dist/types/plugin/pm-plugins/main.d.ts +3 -2
- package/dist/types/plugin/ui/ToolbarBlockType/index.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/plugin/block-types.d.ts +1 -0
- package/dist/types-ts4.5/plugin/commands/block-type.d.ts +8 -6
- package/dist/types-ts4.5/plugin/commands/index.d.ts +0 -5
- package/dist/types-ts4.5/plugin/index.d.ts +5 -2
- package/dist/types-ts4.5/plugin/pm-plugins/main.d.ts +3 -2
- package/dist/types-ts4.5/plugin/ui/ToolbarBlockType/index.d.ts +2 -1
- package/package.json +4 -4
- package/report.api.md +17 -1
- package/tmp/api-report-tmp.d.ts +7 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import type { Command, HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Command, EditorCommand, HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { TextBlockTypes } from '../block-types';
|
|
3
4
|
export type InputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
4
|
-
export declare function setBlockType(name:
|
|
5
|
-
export declare function
|
|
6
|
-
export declare function
|
|
7
|
-
export declare function
|
|
8
|
-
export declare
|
|
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;
|
|
9
11
|
/**
|
|
10
12
|
*
|
|
11
13
|
* @param name - block type name
|
|
@@ -2,8 +2,3 @@ export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockTyp
|
|
|
2
2
|
export type { InputMethod } from './block-type';
|
|
3
3
|
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
|
4
4
|
export { deleteBlockContent } from './delete-block-content';
|
|
5
|
-
/**
|
|
6
|
-
* @private
|
|
7
|
-
* @deprecated use import from @atlaskit/editor-common/commands
|
|
8
|
-
*/
|
|
9
|
-
export { setHeading } from '@atlaskit/editor-common/commands';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { TextBlockTypes } from './block-types';
|
|
3
4
|
import type { InputMethod } from './commands/block-type';
|
|
4
5
|
import type { BlockTypeState } from './pm-plugins/main';
|
|
5
6
|
import type { BlockTypePluginOptions } from './types';
|
|
@@ -11,7 +12,9 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
|
|
11
12
|
sharedState: BlockTypeState | undefined;
|
|
12
13
|
actions: {
|
|
13
14
|
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
|
14
|
-
|
|
15
|
+
};
|
|
16
|
+
commands: {
|
|
17
|
+
setTextLevel: (level: TextBlockTypes, inputMethod: InputMethod) => EditorCommand;
|
|
15
18
|
};
|
|
16
19
|
}>;
|
|
17
20
|
declare const blockTypePlugin: BlockTypePlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
import type { BlockTypePlugin } from '../index';
|
|
4
5
|
import type { BlockType } from '../types';
|
|
5
6
|
export type BlockTypeState = {
|
|
6
7
|
currentBlockType: BlockType;
|
|
@@ -9,7 +10,7 @@ export type BlockTypeState = {
|
|
|
9
10
|
availableWrapperBlockTypes: BlockType[];
|
|
10
11
|
};
|
|
11
12
|
export declare const pluginKey: PluginKey<BlockTypeState>;
|
|
12
|
-
export declare const createPlugin: (
|
|
13
|
+
export declare const createPlugin: (editorAPI: ExtractInjectionAPI<BlockTypePlugin> | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean) => SafePlugin<{
|
|
13
14
|
currentBlockType: BlockType;
|
|
14
15
|
blockTypesDisabled: boolean;
|
|
15
16
|
availableBlockTypes: BlockType[];
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import type { TextBlockTypes } from '../../block-types';
|
|
6
7
|
import type { BlockTypeState } from '../../pm-plugins/main';
|
|
7
8
|
import type { BlockType } from '../../types';
|
|
8
9
|
export type DropdownItem = MenuItem & {
|
|
@@ -17,7 +18,7 @@ export interface Props {
|
|
|
17
18
|
popupsBoundariesElement?: HTMLElement;
|
|
18
19
|
popupsScrollableElement?: HTMLElement;
|
|
19
20
|
editorView?: EditorView;
|
|
20
|
-
|
|
21
|
+
setTextLevel: (type: TextBlockTypes) => void;
|
|
21
22
|
}
|
|
22
23
|
export interface State {
|
|
23
24
|
active: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@atlaskit/adf-schema": "^32.0.0",
|
|
41
|
-
"@atlaskit/editor-common": "^76.
|
|
42
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
41
|
+
"@atlaskit/editor-common": "^76.17.0",
|
|
42
|
+
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.8.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
46
46
|
"@atlaskit/icon": "^21.12.0",
|
|
47
47
|
"@atlaskit/prosemirror-input-rules": "^2.4.0",
|
|
48
48
|
"@atlaskit/theme": "^12.6.0",
|
|
49
|
-
"@atlaskit/tokens": "^1.
|
|
49
|
+
"@atlaskit/tokens": "^1.28.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
52
52
|
},
|
package/report.api.md
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
import type { AllowedBlockTypes } from '@atlaskit/editor-common/types';
|
|
19
19
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
20
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
21
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
21
22
|
import type { HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
22
23
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
23
24
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -48,7 +49,12 @@ export type BlockTypePlugin = NextEditorPlugin<
|
|
|
48
49
|
sharedState: BlockTypeState | undefined;
|
|
49
50
|
actions: {
|
|
50
51
|
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
|
51
|
-
|
|
52
|
+
};
|
|
53
|
+
commands: {
|
|
54
|
+
setTextLevel: (
|
|
55
|
+
level: TextBlockTypes,
|
|
56
|
+
inputMethod: InputMethod,
|
|
57
|
+
) => EditorCommand;
|
|
52
58
|
};
|
|
53
59
|
}
|
|
54
60
|
>;
|
|
@@ -89,6 +95,16 @@ export type InputMethod =
|
|
|
89
95
|
| INPUT_METHOD.SHORTCUT
|
|
90
96
|
| INPUT_METHOD.TOOLBAR;
|
|
91
97
|
|
|
98
|
+
// @public (undocumented)
|
|
99
|
+
export type TextBlockTypes =
|
|
100
|
+
| 'heading1'
|
|
101
|
+
| 'heading2'
|
|
102
|
+
| 'heading3'
|
|
103
|
+
| 'heading4'
|
|
104
|
+
| 'heading5'
|
|
105
|
+
| 'heading6'
|
|
106
|
+
| 'normal';
|
|
107
|
+
|
|
92
108
|
// (No @packageDocumentation comment for this package)
|
|
93
109
|
```
|
|
94
110
|
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { AllowedBlockTypes } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
9
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { EditorCommand } from '@atlaskit/editor-common/types';
|
|
10
11
|
import type { HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
|
|
11
12
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
12
13
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
@@ -35,7 +36,9 @@ export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
|
|
35
36
|
sharedState: BlockTypeState | undefined;
|
|
36
37
|
actions: {
|
|
37
38
|
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
|
38
|
-
|
|
39
|
+
};
|
|
40
|
+
commands: {
|
|
41
|
+
setTextLevel: (level: TextBlockTypes, inputMethod: InputMethod) => EditorCommand;
|
|
39
42
|
};
|
|
40
43
|
}>;
|
|
41
44
|
|
|
@@ -70,6 +73,9 @@ export type DropdownItem = MenuItem & {
|
|
|
70
73
|
// @public (undocumented)
|
|
71
74
|
export type InputMethod = INPUT_METHOD.FORMATTING | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TOOLBAR;
|
|
72
75
|
|
|
76
|
+
// @public (undocumented)
|
|
77
|
+
export type TextBlockTypes = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'normal';
|
|
78
|
+
|
|
73
79
|
// (No @packageDocumentation comment for this package)
|
|
74
80
|
|
|
75
81
|
```
|