@atlaskit/editor-plugin-block-type 6.1.2 → 6.2.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/blockTypePlugin.js +14 -7
  3. package/dist/cjs/pm-plugins/block-types.js +56 -1
  4. package/dist/cjs/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +7 -0
  5. package/dist/cjs/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +66 -0
  6. package/dist/cjs/pm-plugins/ui/ToolbarBlockType/QuoteButton.js +40 -0
  7. package/dist/cjs/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.js +35 -0
  8. package/dist/cjs/pm-plugins/ui/ToolbarComponents.js +72 -0
  9. package/dist/es2019/blockTypePlugin.js +40 -31
  10. package/dist/es2019/pm-plugins/block-types.js +58 -0
  11. package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +7 -0
  12. package/dist/es2019/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +59 -0
  13. package/dist/es2019/pm-plugins/ui/ToolbarBlockType/QuoteButton.js +33 -0
  14. package/dist/es2019/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.js +28 -0
  15. package/dist/es2019/pm-plugins/ui/ToolbarComponents.js +60 -0
  16. package/dist/esm/blockTypePlugin.js +14 -7
  17. package/dist/esm/pm-plugins/block-types.js +55 -0
  18. package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.compiled.css +7 -0
  19. package/dist/esm/pm-plugins/ui/ToolbarBlockType/HeadingButton.js +59 -0
  20. package/dist/esm/pm-plugins/ui/ToolbarBlockType/QuoteButton.js +33 -0
  21. package/dist/esm/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.js +28 -0
  22. package/dist/esm/pm-plugins/ui/ToolbarComponents.js +65 -0
  23. package/dist/types/blockTypePluginType.d.ts +3 -1
  24. package/dist/types/pm-plugins/block-types.d.ts +13 -1
  25. package/dist/types/pm-plugins/types.d.ts +4 -0
  26. package/dist/types/pm-plugins/ui/ToolbarBlockType/HeadingButton.d.ts +10 -0
  27. package/dist/types/pm-plugins/ui/ToolbarBlockType/QuoteButton.d.ts +10 -0
  28. package/dist/types/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.d.ts +9 -0
  29. package/dist/types/pm-plugins/ui/ToolbarComponents.d.ts +4 -0
  30. package/dist/types-ts4.5/blockTypePluginType.d.ts +3 -1
  31. package/dist/types-ts4.5/pm-plugins/block-types.d.ts +13 -1
  32. package/dist/types-ts4.5/pm-plugins/types.d.ts +4 -0
  33. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/HeadingButton.d.ts +10 -0
  34. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/QuoteButton.d.ts +10 -0
  35. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.d.ts +9 -0
  36. package/dist/types-ts4.5/pm-plugins/ui/ToolbarComponents.d.ts +4 -0
  37. package/package.json +13 -10
@@ -1,4 +1,4 @@
1
- import type { BlockType } from './types';
1
+ import type { BlockType, BlockTypeWithRank } from './types';
2
2
  export declare const NORMAL_TEXT: BlockType;
3
3
  export declare const HEADING_1: BlockType;
4
4
  export declare const HEADING_2: BlockType;
@@ -11,6 +11,17 @@ export declare const CODE_BLOCK: BlockType;
11
11
  export declare const PANEL: BlockType;
12
12
  export declare const OTHER: BlockType;
13
13
  export declare const TEXT_BLOCK_TYPES: BlockType[];
14
+ declare enum ToolbarBlockTypes {
15
+ normal = "normal",
16
+ heading1 = "heading1",
17
+ heading2 = "heading2",
18
+ heading3 = "heading3",
19
+ heading4 = "heading4",
20
+ heading5 = "heading5",
21
+ heading6 = "heading6",
22
+ blockquote = "blockquote"
23
+ }
24
+ export declare const toolbarBlockTypesWithRank: () => Record<ToolbarBlockTypes, BlockTypeWithRank>;
14
25
  export type TextBlockTypes = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
15
26
  export declare const FORMATTING_NODE_TYPES: string[];
16
27
  export declare const FORMATTING_MARK_TYPES: string[];
@@ -21,3 +32,4 @@ export declare const HEADINGS_BY_LEVEL: Record<number, BlockType>;
21
32
  export declare const HEADINGS_BY_NAME: {
22
33
  [blockType: string]: BlockType;
23
34
  };
35
+ export {};
@@ -12,6 +12,10 @@ export interface BlockType {
12
12
  icon?: ReactElement;
13
13
  LEGACY_icon?: ReactElement;
14
14
  }
15
+ export interface BlockTypeWithRank extends BlockType {
16
+ toolbarRank: number;
17
+ toolbarKey: string;
18
+ }
15
19
  export interface BlockTypeNode {
16
20
  name: AllowedBlockTypes;
17
21
  node: NodeSpec;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../../../blockTypePluginType';
4
+ import type { BlockTypeWithRank } from '../../types';
5
+ type HeadingButtonProps = {
6
+ blockType: BlockTypeWithRank;
7
+ api?: ExtractInjectionAPI<BlockTypePlugin>;
8
+ };
9
+ export declare const HeadingButton: ({ blockType, api }: HeadingButtonProps) => React.JSX.Element | null;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../../../blockTypePluginType';
4
+ import type { BlockTypeWithRank } from '../../types';
5
+ type QuoteButtonProps = {
6
+ blockType: BlockTypeWithRank;
7
+ api?: ExtractInjectionAPI<BlockTypePlugin>;
8
+ };
9
+ export declare const QuoteButton: ({ blockType, api }: QuoteButtonProps) => React.JSX.Element | null;
10
+ export {};
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type { BlockTypePlugin } from '../../../blockTypePluginType';
4
+ type TextStylesMenuButtonProps = {
5
+ api?: ExtractInjectionAPI<BlockTypePlugin>;
6
+ children: React.ReactNode;
7
+ };
8
+ export declare const TextStylesMenuButton: ({ api, children }: TextStylesMenuButtonProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
+ import type { RegisterComponent } from '@atlaskit/editor-toolbar-model';
3
+ import type { BlockTypePlugin } from '../../blockTypePluginType';
4
+ export declare const getToolbarComponents: (api?: ExtractInjectionAPI<BlockTypePlugin>) => RegisterComponent[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "6.1.2",
3
+ "version": "6.2.0",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,26 +34,30 @@
34
34
  "./styles": "./src/ui/styles.ts"
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/adf-schema": "^50.0.1",
37
+ "@atlaskit/adf-schema": "^50.2.0",
38
+ "@atlaskit/css": "^0.12.0",
38
39
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
39
40
  "@atlaskit/editor-plugin-primary-toolbar": "^4.1.0",
40
- "@atlaskit/editor-plugin-selection-toolbar": "^4.2.0",
41
+ "@atlaskit/editor-plugin-selection-toolbar": "^4.3.0",
42
+ "@atlaskit/editor-plugin-toolbar": "^0.1.0",
41
43
  "@atlaskit/editor-prosemirror": "7.0.0",
42
- "@atlaskit/editor-shared-styles": "^3.5.0",
44
+ "@atlaskit/editor-shared-styles": "^3.6.0",
43
45
  "@atlaskit/editor-tables": "^2.9.0",
44
- "@atlaskit/icon": "^27.9.0",
45
- "@atlaskit/icon-lab": "^5.3.0",
46
+ "@atlaskit/editor-toolbar": "^0.1.0",
47
+ "@atlaskit/editor-toolbar-model": "^0.0.4",
48
+ "@atlaskit/icon": "^27.10.0",
49
+ "@atlaskit/icon-lab": "^5.4.0",
46
50
  "@atlaskit/platform-feature-flags": "^1.1.0",
47
51
  "@atlaskit/primitives": "^14.11.0",
48
- "@atlaskit/prosemirror-input-rules": "^3.3.0",
52
+ "@atlaskit/prosemirror-input-rules": "^3.4.0",
49
53
  "@atlaskit/theme": "^19.0.0",
50
- "@atlaskit/tmp-editor-statsig": "^9.22.0",
54
+ "@atlaskit/tmp-editor-statsig": "^9.25.0",
51
55
  "@atlaskit/tokens": "^6.0.0",
52
56
  "@babel/runtime": "^7.0.0",
53
57
  "@emotion/react": "^11.7.1"
54
58
  },
55
59
  "peerDependencies": {
56
- "@atlaskit/editor-common": "^107.16.0",
60
+ "@atlaskit/editor-common": "^107.19.0",
57
61
  "react": "^18.2.0",
58
62
  "react-dom": "^18.2.0",
59
63
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -67,7 +71,6 @@
67
71
  "@atlaskit/visual-regression": "workspace:^",
68
72
  "@testing-library/react": "^13.4.0",
69
73
  "@testing-library/user-event": "^14.4.3",
70
- "typescript": "~5.4.2",
71
74
  "wait-for-expect": "^1.2.0"
72
75
  },
73
76
  "techstack": {