@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.
@@ -1,12 +1,13 @@
1
1
  import type { Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
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<typeof analyticsPlugin>];
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 { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
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<typeof analyticsPlugin>
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.0",
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.8.0",
39
- "@atlaskit/editor-common": "^80.4.0",
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.11.0",
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 [API Extractor](https://api-extractor.com/).
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
- // (undocumented)
32
- level?: HeadingLevelsAndNormalText;
33
- // (undocumented)
34
- name: string;
35
- // (undocumented)
36
- nodeName: string;
37
- // (undocumented)
38
- tagName?: string;
39
- // (undocumented)
40
- title: MessageDescriptor;
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
- 'blockType',
46
- {
47
- pluginConfiguration: BlockTypePluginOptions | undefined;
48
- dependencies: [OptionalPlugin<typeof analyticsPlugin>];
49
- sharedState: BlockTypeState | undefined;
50
- actions: {
51
- insertBlockQuote: (inputMethod: InputMethod) => Command;
52
- };
53
- commands: {
54
- setTextLevel: (
55
- level: TextBlockTypes,
56
- inputMethod: InputMethod,
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
- // (undocumented)
68
- allowBlockType?: {
69
- exclude?: Array<AllowedBlockTypes>;
70
- };
71
- // (undocumented)
72
- isUndoRedoButtonsEnabled?: boolean;
73
- // (undocumented)
74
- lastNodeMustBeParagraph?: boolean;
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
- currentBlockType: BlockType;
80
- blockTypesDisabled: boolean;
81
- availableBlockTypes: BlockType[];
82
- availableWrapperBlockTypes: BlockType[];
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
- value: BlockType;
85
+ value: BlockType;
88
86
  };
89
87
 
90
88
  // @public (undocumented)
91
89
  export type InputMethod =
92
- | INPUT_METHOD.FORMATTING
93
- | INPUT_METHOD.INSERT_MENU
94
- | INPUT_METHOD.KEYBOARD
95
- | INPUT_METHOD.SHORTCUT
96
- | INPUT_METHOD.TOOLBAR;
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
- | 'heading1'
101
- | 'heading2'
102
- | 'heading3'
103
- | 'heading4'
104
- | 'heading5'
105
- | 'heading6'
106
- | 'normal';
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
- "react": "^16.8.0",
120
- "react-intl-next": "npm:react-intl@^5.18.1"
117
+ "react": "^16.8.0",
118
+ "react-intl-next": "npm:react-intl@^5.18.1"
121
119
  }
122
120
  ```
123
121