@atlaskit/editor-plugin-block-type 3.3.0 → 3.5.0
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/.eslintrc.js +12 -12
- package/CHANGELOG.md +225 -192
- package/LICENSE.md +6 -8
- package/dist/cjs/plugin/index.js +35 -28
- package/dist/cjs/plugin/styles.js +1 -1
- package/dist/cjs/plugin/ui/PrimaryToolbarComponent.js +2 -1
- package/dist/cjs/plugin/ui/ToolbarBlockType/blocktype-button.js +3 -1
- package/dist/cjs/plugin/ui/ToolbarBlockType/index.js +4 -3
- package/dist/cjs/plugin/ui/ToolbarBlockType/styled.js +2 -1
- package/dist/es2019/plugin/index.js +88 -79
- package/dist/es2019/plugin/styles.js +4 -4
- package/dist/es2019/plugin/ui/PrimaryToolbarComponent.js +2 -1
- package/dist/es2019/plugin/ui/ToolbarBlockType/blocktype-button.js +3 -1
- package/dist/es2019/plugin/ui/ToolbarBlockType/index.js +4 -3
- package/dist/es2019/plugin/ui/ToolbarBlockType/styled.js +2 -1
- package/dist/esm/plugin/index.js +36 -29
- package/dist/esm/plugin/styles.js +1 -1
- package/dist/esm/plugin/ui/PrimaryToolbarComponent.js +2 -1
- package/dist/esm/plugin/ui/ToolbarBlockType/blocktype-button.js +3 -1
- package/dist/esm/plugin/ui/ToolbarBlockType/index.js +4 -3
- package/dist/esm/plugin/ui/ToolbarBlockType/styled.js +2 -1
- package/dist/types/plugin/index.d.ts +3 -2
- package/dist/types/plugin/ui/ToolbarBlockType/index.d.ts +3 -0
- package/dist/types-ts4.5/plugin/index.d.ts +4 -2
- package/dist/types-ts4.5/plugin/ui/ToolbarBlockType/index.d.ts +3 -0
- package/package.json +5 -9
- package/report.api.md +51 -53
@@ -1,12 +1,13 @@
|
|
1
1
|
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
2
|
-
import type {
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
3
4
|
import type { TextBlockTypes } from './block-types';
|
4
5
|
import type { InputMethod } from './commands/block-type';
|
5
6
|
import type { BlockTypeState } from './pm-plugins/main';
|
6
7
|
import type { BlockTypePluginOptions } from './types';
|
7
8
|
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
8
9
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
9
|
-
dependencies: [OptionalPlugin<
|
10
|
+
dependencies: [OptionalPlugin<AnalyticsPlugin>, OptionalPlugin<PrimaryToolbarPlugin>];
|
10
11
|
sharedState: BlockTypeState | undefined;
|
11
12
|
actions: {
|
12
13
|
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
/** @jsx jsx */
|
2
2
|
import React from 'react';
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
4
5
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
5
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
6
7
|
import type { TextBlockTypes } from '../../block-types';
|
8
|
+
import type { BlockTypePlugin } from '../../index';
|
7
9
|
import type { BlockTypeState } from '../../pm-plugins/main';
|
8
10
|
import type { BlockType } from '../../types';
|
9
11
|
export type DropdownItem = MenuItem & {
|
@@ -20,6 +22,7 @@ export interface Props {
|
|
20
22
|
editorView?: EditorView;
|
21
23
|
setTextLevel: (type: TextBlockTypes) => void;
|
22
24
|
shouldUseDefaultRole?: boolean;
|
25
|
+
api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
|
23
26
|
}
|
24
27
|
export interface State {
|
25
28
|
active: boolean;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
2
|
-
import type {
|
2
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
3
|
+
import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
|
3
4
|
import type { TextBlockTypes } from './block-types';
|
4
5
|
import type { InputMethod } from './commands/block-type';
|
5
6
|
import type { BlockTypeState } from './pm-plugins/main';
|
@@ -7,7 +8,8 @@ import type { BlockTypePluginOptions } from './types';
|
|
7
8
|
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
8
9
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
9
10
|
dependencies: [
|
10
|
-
OptionalPlugin<
|
11
|
+
OptionalPlugin<AnalyticsPlugin>,
|
12
|
+
OptionalPlugin<PrimaryToolbarPlugin>
|
11
13
|
];
|
12
14
|
sharedState: BlockTypeState | undefined;
|
13
15
|
actions: {
|
@@ -1,9 +1,11 @@
|
|
1
1
|
/** @jsx jsx */
|
2
2
|
import React from 'react';
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
4
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
4
5
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
5
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
6
7
|
import type { TextBlockTypes } from '../../block-types';
|
8
|
+
import type { BlockTypePlugin } from '../../index';
|
7
9
|
import type { BlockTypeState } from '../../pm-plugins/main';
|
8
10
|
import type { BlockType } from '../../types';
|
9
11
|
export type DropdownItem = MenuItem & {
|
@@ -20,6 +22,7 @@ export interface Props {
|
|
20
22
|
editorView?: EditorView;
|
21
23
|
setTextLevel: (type: TextBlockTypes) => void;
|
22
24
|
shouldUseDefaultRole?: boolean;
|
25
|
+
api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
|
23
26
|
}
|
24
27
|
export interface State {
|
25
28
|
active: boolean;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.5.0",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -35,11 +35,12 @@
|
|
35
35
|
"./styles": "./src/styles.ts"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@atlaskit/adf-schema": "^36.
|
39
|
-
"@atlaskit/editor-common": "^
|
38
|
+
"@atlaskit/adf-schema": "^36.10.7",
|
39
|
+
"@atlaskit/editor-common": "^82.0.0",
|
40
40
|
"@atlaskit/editor-plugin-analytics": "^1.2.0",
|
41
|
+
"@atlaskit/editor-plugin-primary-toolbar": "^1.1.0",
|
41
42
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
42
|
-
"@atlaskit/editor-shared-styles": "^2.
|
43
|
+
"@atlaskit/editor-shared-styles": "^2.12.0",
|
43
44
|
"@atlaskit/editor-tables": "^2.7.0",
|
44
45
|
"@atlaskit/icon": "^22.3.0",
|
45
46
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
@@ -61,7 +62,6 @@
|
|
61
62
|
"@atlaskit/editor-plugin-type-ahead": "^1.2.0",
|
62
63
|
"@atlaskit/ssr": "*",
|
63
64
|
"@atlaskit/visual-regression": "*",
|
64
|
-
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
65
65
|
"@testing-library/react": "^12.1.5",
|
66
66
|
"@testing-library/user-event": "^14.4.3",
|
67
67
|
"react-dom": "^16.8.0",
|
@@ -101,13 +101,9 @@
|
|
101
101
|
]
|
102
102
|
}
|
103
103
|
},
|
104
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
|
105
104
|
"platform-feature-flags": {
|
106
105
|
"platform.editor.allow-list-in-blockquote": {
|
107
106
|
"type": "boolean"
|
108
|
-
},
|
109
|
-
"platform.editor.enable-localid-for-paragraph-in-stage-0_cby7g": {
|
110
|
-
"type": "boolean"
|
111
107
|
}
|
112
108
|
}
|
113
109
|
}
|
package/report.api.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## API Report File for "@atlaskit/editor-plugin-block-type"
|
4
4
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
7
8
|
|
8
9
|
### Table of contents
|
@@ -28,35 +29,32 @@ import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
28
29
|
|
29
30
|
// @public (undocumented)
|
30
31
|
export interface BlockType {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
// (undocumented)
|
33
|
+
level?: HeadingLevelsAndNormalText;
|
34
|
+
// (undocumented)
|
35
|
+
name: string;
|
36
|
+
// (undocumented)
|
37
|
+
nodeName: string;
|
38
|
+
// (undocumented)
|
39
|
+
tagName?: string;
|
40
|
+
// (undocumented)
|
41
|
+
title: MessageDescriptor;
|
41
42
|
}
|
42
43
|
|
43
44
|
// @public (undocumented)
|
44
45
|
export type BlockTypePlugin = NextEditorPlugin<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
) => EditorCommand;
|
58
|
-
};
|
59
|
-
}
|
46
|
+
'blockType',
|
47
|
+
{
|
48
|
+
pluginConfiguration: BlockTypePluginOptions | undefined;
|
49
|
+
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
50
|
+
sharedState: BlockTypeState | undefined;
|
51
|
+
actions: {
|
52
|
+
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
53
|
+
};
|
54
|
+
commands: {
|
55
|
+
setTextLevel: (level: TextBlockTypes, inputMethod: InputMethod) => EditorCommand;
|
56
|
+
};
|
57
|
+
}
|
60
58
|
>;
|
61
59
|
|
62
60
|
// @public (undocumented)
|
@@ -64,46 +62,46 @@ export const blockTypePlugin: BlockTypePlugin;
|
|
64
62
|
|
65
63
|
// @public (undocumented)
|
66
64
|
export interface BlockTypePluginOptions {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
65
|
+
// (undocumented)
|
66
|
+
allowBlockType?: {
|
67
|
+
exclude?: Array<AllowedBlockTypes>;
|
68
|
+
};
|
69
|
+
// (undocumented)
|
70
|
+
isUndoRedoButtonsEnabled?: boolean;
|
71
|
+
// (undocumented)
|
72
|
+
lastNodeMustBeParagraph?: boolean;
|
75
73
|
}
|
76
74
|
|
77
75
|
// @public (undocumented)
|
78
76
|
export type BlockTypeState = {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
77
|
+
currentBlockType: BlockType;
|
78
|
+
blockTypesDisabled: boolean;
|
79
|
+
availableBlockTypes: BlockType[];
|
80
|
+
availableWrapperBlockTypes: BlockType[];
|
83
81
|
};
|
84
82
|
|
85
83
|
// @public (undocumented)
|
86
84
|
export type DropdownItem = MenuItem & {
|
87
|
-
|
85
|
+
value: BlockType;
|
88
86
|
};
|
89
87
|
|
90
88
|
// @public (undocumented)
|
91
89
|
export type InputMethod =
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
90
|
+
| INPUT_METHOD.FORMATTING
|
91
|
+
| INPUT_METHOD.INSERT_MENU
|
92
|
+
| INPUT_METHOD.KEYBOARD
|
93
|
+
| INPUT_METHOD.SHORTCUT
|
94
|
+
| INPUT_METHOD.TOOLBAR;
|
97
95
|
|
98
96
|
// @public (undocumented)
|
99
97
|
export type TextBlockTypes =
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
98
|
+
| 'heading1'
|
99
|
+
| 'heading2'
|
100
|
+
| 'heading3'
|
101
|
+
| 'heading4'
|
102
|
+
| 'heading5'
|
103
|
+
| 'heading6'
|
104
|
+
| 'normal';
|
107
105
|
|
108
106
|
// (No @packageDocumentation comment for this package)
|
109
107
|
```
|
@@ -116,8 +114,8 @@ export type TextBlockTypes =
|
|
116
114
|
|
117
115
|
```json
|
118
116
|
{
|
119
|
-
|
120
|
-
|
117
|
+
"react": "^16.8.0",
|
118
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
121
119
|
}
|
122
120
|
```
|
123
121
|
|