@atlaskit/editor-plugin-block-type 15.0.14 → 15.0.16

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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/ToolbarBlockType/package.json +1 -8
  3. package/block-type/package.json +1 -8
  4. package/block-types/package.json +1 -8
  5. package/blockTypePlugin/package.json +1 -8
  6. package/blockTypePluginType/package.json +1 -8
  7. package/consts/block-types/package.json +1 -8
  8. package/consts/package.json +1 -8
  9. package/main/package.json +1 -8
  10. package/package.json +3 -3
  11. package/types/package.json +1 -8
  12. package/dist/types-ts4.5/blockTypePlugin.d.ts +0 -3
  13. package/dist/types-ts4.5/blockTypePluginType.d.ts +0 -38
  14. package/dist/types-ts4.5/entry-points/ToolbarBlockType.d.ts +0 -1
  15. package/dist/types-ts4.5/entry-points/block-type.d.ts +0 -1
  16. package/dist/types-ts4.5/entry-points/block-types.d.ts +0 -1
  17. package/dist/types-ts4.5/entry-points/blockTypePlugin.d.ts +0 -1
  18. package/dist/types-ts4.5/entry-points/blockTypePluginType.d.ts +0 -1
  19. package/dist/types-ts4.5/entry-points/consts-block-types.d.ts +0 -1
  20. package/dist/types-ts4.5/entry-points/main.d.ts +0 -1
  21. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  22. package/dist/types-ts4.5/index.d.ts +0 -7
  23. package/dist/types-ts4.5/pm-plugins/block-types.d.ts +0 -38
  24. package/dist/types-ts4.5/pm-plugins/commands/block-type.d.ts +0 -25
  25. package/dist/types-ts4.5/pm-plugins/commands/clear-formatting.d.ts +0 -8
  26. package/dist/types-ts4.5/pm-plugins/commands/delete-and-move-cursor.d.ts +0 -12
  27. package/dist/types-ts4.5/pm-plugins/commands/delete-block-content.d.ts +0 -10
  28. package/dist/types-ts4.5/pm-plugins/commands/wrapSelectionIn.d.ts +0 -3
  29. package/dist/types-ts4.5/pm-plugins/consts.d.ts +0 -3
  30. package/dist/types-ts4.5/pm-plugins/input-rule.d.ts +0 -6
  31. package/dist/types-ts4.5/pm-plugins/keymap.d.ts +0 -5
  32. package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -15
  33. package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -39
  34. package/dist/types-ts4.5/pm-plugins/ui/FloatingToolbarComponent.d.ts +0 -8
  35. package/dist/types-ts4.5/pm-plugins/ui/PrimaryToolbarComponent.d.ts +0 -15
  36. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/HeadingButton.d.ts +0 -9
  37. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/QuoteButton.d.ts +0 -10
  38. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/TextStylesMenuButton.d.ts +0 -10
  39. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/blocktype-button.d.ts +0 -22
  40. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/icons.d.ts +0 -8
  41. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/index.d.ts +0 -46
  42. package/dist/types-ts4.5/pm-plugins/ui/ToolbarBlockType/styled.d.ts +0 -12
  43. package/dist/types-ts4.5/pm-plugins/ui/toolbar-components.d.ts +0 -4
  44. package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -53
  45. package/dist/types-ts4.5/ui/HeadingBlockMenuItem.d.ts +0 -9
  46. package/dist/types-ts4.5/ui/ParagraphBlockMenuItem.d.ts +0 -8
  47. package/dist/types-ts4.5/ui/QuoteBlockMenuItem.d.ts +0 -12
  48. package/dist/types-ts4.5/ui/consts.d.ts +0 -1
  49. package/dist/types-ts4.5/ui/index.d.ts +0 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-block-type
2
2
 
3
+ ## 15.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 15.0.15
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 15.0.14
4
16
 
5
17
  ### Patch Changes
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/ToolbarBlockType.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/ToolbarBlockType.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/ToolbarBlockType.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/block-type.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/block-type.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/block-type.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/block-types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/block-types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/block-types.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/blockTypePlugin.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/blockTypePlugin.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/blockTypePlugin.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/blockTypePluginType.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/blockTypePluginType.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/blockTypePluginType.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../../dist/types/entry-points/consts-block-types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../../dist/types-ts4.5/entry-points/consts-block-types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../../dist/types/entry-points/consts-block-types.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/ui/consts.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/ui/consts.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/ui/consts.d.ts"
17
10
  }
package/main/package.json CHANGED
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/main.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/main.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/main.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-type",
3
- "version": "15.0.14",
3
+ "version": "15.0.16",
4
4
  "description": "BlockType plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -45,12 +45,12 @@
45
45
  "@atlaskit/editor-toolbar": "^1.10.0",
46
46
  "@atlaskit/editor-toolbar-model": "^0.5.0",
47
47
  "@atlaskit/icon": "^35.4.0",
48
- "@atlaskit/icon-lab": "^6.13.0",
48
+ "@atlaskit/icon-lab": "^6.14.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/primitives": "^19.0.0",
51
51
  "@atlaskit/prosemirror-history": "^0.2.0",
52
52
  "@atlaskit/prosemirror-input-rules": "^3.7.0",
53
- "@atlaskit/tmp-editor-statsig": "^101.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^103.0.0",
54
54
  "@atlaskit/tokens": "^13.4.0",
55
55
  "@babel/runtime": "^7.0.0",
56
56
  "@compiled/react": "^0.20.0",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,3 +0,0 @@
1
- import type { BlockTypePlugin } from './blockTypePluginType';
2
- declare const blockTypePlugin: BlockTypePlugin;
3
- export { blockTypePlugin };
@@ -1,38 +0,0 @@
1
- import type { _MarkdownModePluginStub, Command, EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
- import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
3
- import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
4
- import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
5
- import type { ListPlugin } from '@atlaskit/editor-plugin-list';
6
- import type { PrimaryToolbarPlugin } from '@atlaskit/editor-plugin-primary-toolbar';
7
- import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
8
- import type { SelectionToolbarPlugin } from '@atlaskit/editor-plugin-selection-toolbar';
9
- import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
10
- import type { UserPreferencesPlugin } from '@atlaskit/editor-plugin-user-preferences';
11
- import type { TextBlockTypes } from './pm-plugins/block-types';
12
- import type { ClearFormattingInputMethod, InputMethod } from './pm-plugins/commands/block-type';
13
- import type { BlockTypeState } from './pm-plugins/main';
14
- import type { BlockTypePluginOptions } from './pm-plugins/types';
15
- export type BlockTypePlugin = NextEditorPlugin<'blockType', {
16
- actions: {
17
- insertBlockQuote: (inputMethod: InputMethod) => Command;
18
- };
19
- commands: {
20
- clearFormatting: (inputMethod: ClearFormattingInputMethod) => EditorCommand;
21
- insertBlockQuote: (inputMethod: InputMethod) => EditorCommand;
22
- setTextLevel: (level: TextBlockTypes, inputMethod: InputMethod, fromBlockQuote?: boolean) => EditorCommand;
23
- };
24
- dependencies: [
25
- OptionalPlugin<AnalyticsPlugin>,
26
- OptionalPlugin<PrimaryToolbarPlugin>,
27
- OptionalPlugin<SelectionToolbarPlugin>,
28
- OptionalPlugin<UserPreferencesPlugin>,
29
- OptionalPlugin<ToolbarPlugin>,
30
- OptionalPlugin<BlockMenuPlugin>,
31
- OptionalPlugin<ListPlugin>,
32
- OptionalPlugin<SelectionPlugin>,
33
- OptionalPlugin<InteractionPlugin>,
34
- OptionalPlugin<_MarkdownModePluginStub>
35
- ];
36
- pluginConfiguration: BlockTypePluginOptions | undefined;
37
- sharedState: BlockTypeState | undefined;
38
- }>;
@@ -1 +0,0 @@
1
- export type { DropdownItem } from '../pm-plugins/ui/ToolbarBlockType/index';
@@ -1 +0,0 @@
1
- export type { InputMethod, ClearFormattingInputMethod } from '../pm-plugins/commands/block-type';
@@ -1 +0,0 @@
1
- export type { TextBlockTypes } from '../pm-plugins/block-types';
@@ -1 +0,0 @@
1
- export { blockTypePlugin } from '../blockTypePlugin';
@@ -1 +0,0 @@
1
- export type { BlockTypePlugin } from '../blockTypePluginType';
@@ -1 +0,0 @@
1
- export { BLOCK_QUOTE, CODE_BLOCK, HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6, NORMAL_TEXT, PANEL, } from '../pm-plugins/block-types';
@@ -1 +0,0 @@
1
- export type { BlockTypeState } from '../pm-plugins/main';
@@ -1 +0,0 @@
1
- export type { BlockTypePluginOptions, BlockType } from '../pm-plugins/types';
@@ -1,7 +0,0 @@
1
- export { blockTypePlugin } from './blockTypePlugin';
2
- export type { BlockTypePlugin } from './blockTypePluginType';
3
- export type { BlockTypePluginOptions, BlockType } from './pm-plugins/types';
4
- export type { BlockTypeState } from './pm-plugins/main';
5
- export type { InputMethod, ClearFormattingInputMethod } from './pm-plugins/commands/block-type';
6
- export type { DropdownItem } from './pm-plugins/ui/ToolbarBlockType';
7
- export type { TextBlockTypes } from './pm-plugins/block-types';
@@ -1,38 +0,0 @@
1
- import type { BlockType, BlockTypeWithRank } from './types';
2
- export declare const NORMAL_TEXT: BlockType;
3
- export declare const SMALL_TEXT: BlockType;
4
- export declare const HEADING_1: BlockType;
5
- export declare const HEADING_2: BlockType;
6
- export declare const HEADING_3: BlockType;
7
- export declare const HEADING_4: BlockType;
8
- export declare const HEADING_5: BlockType;
9
- export declare const HEADING_6: BlockType;
10
- export declare const BLOCK_QUOTE: BlockType;
11
- export declare const CODE_BLOCK: BlockType;
12
- export declare const PANEL: BlockType;
13
- export declare const OTHER: BlockType;
14
- export declare const TEXT_BLOCK_TYPES: BlockType[];
15
- declare enum ToolbarBlockTypes {
16
- normal = "normal",
17
- heading1 = "heading1",
18
- heading2 = "heading2",
19
- heading3 = "heading3",
20
- heading4 = "heading4",
21
- heading5 = "heading5",
22
- heading6 = "heading6",
23
- blockquote = "blockquote"
24
- }
25
- export declare const toolbarBlockTypesWithRank: ({ allowFontSize, }: {
26
- allowFontSize?: boolean;
27
- }) => Record<ToolbarBlockTypes, BlockTypeWithRank>;
28
- export type TextBlockTypes = 'normal' | 'smallText' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
29
- export declare const FORMATTING_NODE_TYPES: string[];
30
- export declare const FORMATTING_MARK_TYPES: string[];
31
- export declare const WRAPPER_BLOCK_TYPES: BlockType[];
32
- export declare const ALL_BLOCK_TYPES: BlockType[];
33
- export declare const getBlockTypesInDropdown: (includeBlockQuoteAsTextstyleOption?: boolean) => BlockType[];
34
- export declare const HEADINGS_BY_LEVEL: Record<number, BlockType>;
35
- export declare const HEADINGS_BY_NAME: {
36
- [blockType: string]: BlockType;
37
- };
38
- export {};
@@ -1,25 +0,0 @@
1
- import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
- import type { Command, EditorCommand, HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
3
- import type { TextBlockTypes } from '../block-types';
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
- export type ClearFormattingInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB;
6
- export declare function setBlockType(name: TextBlockTypes): EditorCommand;
7
- export declare function setHeading(level: HeadingLevelsAndNormalText, fromBlockQuote?: boolean): EditorCommand;
8
- export declare function setBlockTypeWithAnalytics(name: TextBlockTypes, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean): EditorCommand;
9
- export declare function setSmallText(fromBlockQuote?: boolean): EditorCommand;
10
- export declare function setSmallTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean): EditorCommand;
11
- export declare function setNormalText(fromBlockQuote?: boolean): EditorCommand;
12
- export declare function clearFormatting(inputMethod: ClearFormattingInputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): EditorCommand;
13
- export declare function setNormalTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean): EditorCommand;
14
- export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAndNormalText, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined, fromBlockQuote?: boolean) => EditorCommand;
15
- /**
16
- *
17
- * @param name - block type name
18
- * @param inputMethod - input method
19
- * @param editorAnalyticsApi - analytics api, undefined if not available either because it failed to load or wasn't added
20
- * otherwise Editor becomes very sad and crashes
21
- * @returns - command that inserts block type
22
- */
23
- export declare const insertBlockQuoteWithAnalytics: (inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
24
- export declare function insertBlockQuoteWithAnalyticsCommand(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): EditorCommand;
25
- export declare const cleanUpAtTheStartOfDocument: Command;
@@ -1,8 +0,0 @@
1
- import type { Node, NodeType, Schema } from '@atlaskit/editor-prosemirror/model';
2
- import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
- import type { CellSelection } from '@atlaskit/editor-tables/cell-selection';
4
- export declare const FORMATTING_NODE_TYPES: string[];
5
- export declare const FORMATTING_MARK_TYPES: string[];
6
- export declare const formatTypes: Record<string, string>;
7
- export declare const cellSelectionNodesBetween: (selection: CellSelection, doc: Node, f: (node: Node, pos: number, parent: Node | null, index: number) => void | boolean, startPos?: number) => void;
8
- export declare function clearNodeFormattingOnSelection(schema: Schema, tr: Transaction, formattedNodeType: NodeType, nodeName: string, formattingCleared: string[]): (node: Node, pos: number) => boolean;
@@ -1,12 +0,0 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- /**
3
- * Fixes cursor position after delete for list/task in panel and table
4
- *
5
- * ED-13873 fixes a bug where after deleting a list the cursor would move
6
- * to the cell to the right. Uses setSelection to position the cursor as expected after deleting.
7
- *
8
- * @param state EditorState
9
- * @param dispatch CommandDispatch
10
- * @returns boolean
11
- */
12
- export declare const deleteAndMoveCursor: Command;
@@ -1,10 +0,0 @@
1
- import type { Command } from '@atlaskit/editor-common/types';
2
- import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- /**
4
- * Prevent removing the block when deleting block content
5
- *
6
- * @param state EditorState
7
- * @param dispatch CommandDispatch
8
- * @returns boolean
9
- */
10
- export declare function deleteBlockContent(isNodeAWrappingBlockNode: (node?: PMNode | null) => boolean): Command;
@@ -1,3 +0,0 @@
1
- import type { EditorCommand } from '@atlaskit/editor-common/types';
2
- import type { NodeType } from '@atlaskit/editor-prosemirror/model';
3
- export declare function wrapSelectionInBlockType(_nodeType: NodeType): EditorCommand;
@@ -1,3 +0,0 @@
1
- export declare const KEY_7 = 55;
2
- export declare const HEADING_KEYS: number[];
3
- export declare const HEADING_NUMPAD_KEYS: number[];
@@ -1,6 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
4
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
5
- declare function inputRulePlugin(editorAnalyticsAPI: EditorAnalyticsAPI | undefined, schema: Schema, featureFlags: FeatureFlags): SafePlugin | undefined;
6
- export default inputRulePlugin;
@@ -1,5 +0,0 @@
1
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
- import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
4
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
5
- export default function keymapPlugin(editorAnalyticsApi: EditorAnalyticsAPI | undefined, schema: Schema, _featureFlags: FeatureFlags): SafePlugin;
@@ -1,15 +0,0 @@
1
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import type { BlockTypePlugin } from '../blockTypePluginType';
5
- import type { BlockType } from './types';
6
- export type BlockTypeState = {
7
- availableBlockTypes: BlockType[];
8
- availableBlockTypesInDropdown: BlockType[];
9
- availableWrapperBlockTypes: BlockType[];
10
- blockTypesDisabled: boolean;
11
- currentBlockType: BlockType;
12
- formattingIsPresent?: boolean;
13
- };
14
- export declare const pluginKey: PluginKey<BlockTypeState>;
15
- export declare const createPlugin: (editorAPI: ExtractInjectionAPI<BlockTypePlugin> | undefined, dispatch: (eventName: string | PluginKey, data: any) => void, lastNodeMustBeParagraph?: boolean, includeBlockQuoteAsTextstyleOption?: boolean, allowFontSize?: boolean) => SafePlugin<BlockTypeState>;
@@ -1,39 +0,0 @@
1
- import type { ReactElement } from 'react';
2
- import type { MessageDescriptor } from 'react-intl';
3
- import type { AllowedBlockTypes, HeadingLevelsAndNormalText } from '@atlaskit/editor-common/types';
4
- import type { NodeSpec } from '@atlaskit/editor-prosemirror/model';
5
- export type BlockTypeName = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6' | 'blockquote' | 'codeblock' | 'panel' | 'notePanel' | 'successPanel' | 'warningPanel' | 'errorPanel' | 'other';
6
- export interface BlockType {
7
- icon?: ReactElement;
8
- LEGACY_icon?: ReactElement;
9
- level?: HeadingLevelsAndNormalText;
10
- markName?: string;
11
- name: string;
12
- nodeName: string;
13
- tagName?: string;
14
- title: MessageDescriptor;
15
- }
16
- export interface BlockTypeWithRank extends BlockType {
17
- toolbarKey: string;
18
- toolbarRank: number;
19
- }
20
- export interface BlockTypeNode {
21
- name: AllowedBlockTypes;
22
- node: NodeSpec;
23
- }
24
- export interface BlockTypePluginOptions {
25
- allowBlockType?: {
26
- exclude?: Array<AllowedBlockTypes>;
27
- };
28
- /**
29
- * Add ability to toggle paragraph size variations.
30
- *
31
- * Note: Feature is in development and logic is under an experiment.
32
- * Note: `fontSize` mark must be supported in the ADF schema for this feature to work.
33
- * Note: To support fontSize variatons in tasks, allowBlockTaskItem must be enabled for tasksAndDecisionsPlugin
34
- */
35
- allowFontSize?: boolean;
36
- includeBlockQuoteAsTextstyleOption?: boolean;
37
- isUndoRedoButtonsEnabled?: boolean;
38
- lastNodeMustBeParagraph?: boolean;
39
- }
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockTypePlugin } from '../../blockTypePluginType';
4
- interface FloatingToolbarComponentProps {
5
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
- }
7
- export declare function FloatingToolbarComponent({ api, }: FloatingToolbarComponentProps): React.JSX.Element;
8
- export {};
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockTypePlugin } from '../../blockTypePluginType';
4
- interface PrimaryToolbarComponentProps {
5
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
- disabled: boolean;
7
- isSmall: boolean;
8
- isToolbarReducedSpacing: boolean;
9
- popupsBoundariesElement?: HTMLElement;
10
- popupsMountPoint?: HTMLElement;
11
- popupsScrollableElement?: HTMLElement;
12
- shouldUseDefaultRole: boolean;
13
- }
14
- export declare function PrimaryToolbarComponent({ api, isSmall, disabled, isToolbarReducedSpacing, popupsMountPoint, popupsBoundariesElement, popupsScrollableElement, shouldUseDefaultRole, }: PrimaryToolbarComponentProps): React.JSX.Element;
15
- export {};
@@ -1,9 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { BlockTypePlugin } from '../../../blockTypePluginType';
3
- import type { BlockTypeWithRank } from '../../types';
4
- type HeadingButtonProps = {
5
- api?: ExtractInjectionAPI<BlockTypePlugin>;
6
- blockType: BlockTypeWithRank;
7
- };
8
- export declare const HeadingButton: ({ blockType, api }: HeadingButtonProps) => React.JSX.Element | null;
9
- export {};
@@ -1,10 +0,0 @@
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
- api?: ExtractInjectionAPI<BlockTypePlugin>;
7
- blockType: BlockTypeWithRank;
8
- };
9
- export declare const QuoteButton: ({ blockType, api }: QuoteButtonProps) => React.JSX.Element | null;
10
- export {};
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockTypePlugin } from '../../../blockTypePluginType';
4
- type TextStylesMenuButtonProps = {
5
- allowFontSize?: boolean;
6
- api?: ExtractInjectionAPI<BlockTypePlugin>;
7
- children: React.ReactNode;
8
- };
9
- export declare const TextStylesMenuButton: ({ allowFontSize, api, children, }: TextStylesMenuButtonProps) => React.JSX.Element;
10
- export {};
@@ -1,22 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { ReactElement } from 'react';
7
- import { jsx } from '@emotion/react';
8
- import type { MessageDescriptor, WrappedComponentProps } from 'react-intl';
9
- export interface BlockTypeButtonProps {
10
- 'aria-expanded': React.AriaAttributes['aria-expanded'];
11
- blockTypeIcon?: ReactElement;
12
- blockTypeName?: string;
13
- disabled: boolean;
14
- formatMessage: WrappedComponentProps['intl']['formatMessage'];
15
- isReducedSpacing?: boolean;
16
- isSmall?: boolean;
17
- onClick(e: React.MouseEvent): void;
18
- onKeyDown(e: React.KeyboardEvent): void;
19
- selected: boolean;
20
- title: MessageDescriptor;
21
- }
22
- export declare const BlockTypeButton: (props: BlockTypeButtonProps) => jsx.JSX.Element;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export declare const Text: () => React.JSX.Element;
3
- export declare const H1: () => React.JSX.Element;
4
- export declare const H2: () => React.JSX.Element;
5
- export declare const H3: () => React.JSX.Element;
6
- export declare const H4: () => React.JSX.Element;
7
- export declare const H5: () => React.JSX.Element;
8
- export declare const H6: () => React.JSX.Element;
@@ -1,46 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
7
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
- import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
9
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
10
- import { ThemeMutationObserver } from '@atlaskit/tokens';
11
- import type { ThemeState } from '@atlaskit/tokens';
12
- import type { BlockTypePlugin } from '../../../blockTypePluginType';
13
- import type { TextBlockTypes } from '../../block-types';
14
- import type { BlockType } from '../../types';
15
- export type DropdownItem = MenuItem & {
16
- value: BlockType;
17
- };
18
- export interface Props {
19
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
20
- availableBlockTypes?: BlockType[];
21
- availableBlockTypesInDropdown?: BlockType[];
22
- blockTypesDisabled?: boolean;
23
- clearFormatting: () => void;
24
- currentBlockType?: BlockType;
25
- editorView?: EditorView;
26
- formattingIsPresent?: boolean;
27
- isDisabled?: boolean;
28
- isReducedSpacing?: boolean;
29
- isSmall?: boolean;
30
- popupsBoundariesElement?: HTMLElement;
31
- popupsMountPoint?: HTMLElement;
32
- popupsScrollableElement?: HTMLElement;
33
- setTextLevel: (type: TextBlockTypes, fromBlockQuote?: boolean) => void;
34
- shouldUseDefaultRole?: boolean;
35
- wrapBlockQuote: (type: TextBlockTypes) => void;
36
- }
37
- export interface State {
38
- active: boolean;
39
- isOpenedByKeyboard: boolean;
40
- observer: ThemeMutationObserver | null;
41
- typographyTheme?: ThemeState['typography'];
42
- }
43
- declare const _default_1: React.FC<WithIntlProps<Props & WrappedComponentProps>> & {
44
- WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
45
- };
46
- export default _default_1;
@@ -1,12 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type SerializedStyles } from '@emotion/react';
6
- import { type ThemeState } from '@atlaskit/tokens';
7
- export declare const blockTypeMenuItemStyle: (tagName: string, selected?: boolean, typographyTheme?: ThemeState["typography"]) => () => SerializedStyles;
8
- export declare const keyboardShortcut: SerializedStyles;
9
- export declare const keyboardShortcutSelect: SerializedStyles;
10
- export declare const wrapperSmallStyle: SerializedStyles;
11
- export declare const expandIconWrapperStyle: SerializedStyles;
12
- export declare const floatingToolbarWrapperStyle: SerializedStyles;
@@ -1,4 +0,0 @@
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>, allowFontSize?: boolean) => RegisterComponent[];
@@ -1,53 +0,0 @@
1
- import type { InputRuleWrapper } from '@atlaskit/editor-common/types';
2
- import type { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
- import type { BlockType } from './types';
5
- export declare const isNodeAWrappingBlockNode: (node?: PMNode | null) => boolean;
6
- export declare const createJoinNodesRule: (match: RegExp, nodeType: NodeType) => InputRuleWrapper;
7
- type WrappingTextRuleProps = {
8
- getAttrs?: Record<string, any> | ((matchResult: RegExpExecArray) => Record<string, any>);
9
- match: RegExp;
10
- nodeType: NodeType;
11
- };
12
- export declare const createWrappingTextBlockRule: ({ match, nodeType, getAttrs, }: WrappingTextRuleProps) => InputRuleWrapper;
13
- /**
14
- * Function will check if changing block types: Paragraph, Heading is enabled.
15
- */
16
- export declare function areBlockTypesDisabled(state: EditorState, allowFontSize?: boolean): boolean;
17
- /**
18
- * Checks if the current selection is inside a list node (bulletList, orderedList, or taskList).
19
- * Used to determine which text styles should be enabled when the small font size experiment is active.
20
- */
21
- export declare function isSelectionInsideListNode(state: EditorState): boolean;
22
- export declare function isSelectionInsideBlockquote(state: EditorState): boolean;
23
- export declare const checkFormattingIsPresent: (state: EditorState) => boolean;
24
- export declare const hasBlockQuoteInOptions: (dropdownOptions: BlockType[]) => boolean;
25
- /**
26
- * Returns a { from, to } range that extends the selection boundaries outward
27
- * to include the entirety of any list nodes at either end. If the selection
28
- * start is inside a list, `from` is pulled back to the list's start; if the
29
- * selection end is inside a list, `to` is pushed forward to the list's end.
30
- * Non-list content in the middle is included as-is.
31
- */
32
- export declare function getSelectionRangeExpandedToLists(tr: Transaction): {
33
- from: number;
34
- to: number;
35
- };
36
- /**
37
- * Converts all taskItem nodes within the given range to blockTaskItem nodes.
38
- *
39
- * taskItem nodes contain inline content directly, which cannot hold block-level
40
- * marks like fontSize. blockTaskItem nodes wrap content in paragraphs, which can
41
- * hold block marks. This conversion is needed when applying small text formatting
42
- * to task lists.
43
- *
44
- * The inline content of each taskItem is wrapped in a paragraph node, and the
45
- * taskItem is replaced with a blockTaskItem that preserves the original attributes
46
- * (localId, state).
47
- *
48
- * Collects taskItem positions in a forward pass over the unmutated document,
49
- * then applies replacements in reverse document order so positions remain valid
50
- * without needing remapping or doc snapshots.
51
- */
52
- export declare function convertTaskItemsToBlockTaskItems(tr: Transaction, from: number, to: number): void;
53
- export {};
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockTypePlugin } from '../blockTypePluginType';
4
- type HeadingBlockMenuItemProps = {
5
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
- level: 1 | 2 | 3 | 4 | 5 | 6;
7
- };
8
- export declare const createHeadingBlockMenuItem: ({ level, api }: HeadingBlockMenuItemProps) => () => React.JSX.Element;
9
- export {};
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
- import type { BlockTypePlugin } from '../blockTypePluginType';
4
- type ParagraphBlockMenuItemProps = {
5
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
6
- };
7
- export declare const createParagraphBlockMenuItem: ({ api }: ParagraphBlockMenuItemProps) => () => React.JSX.Element;
8
- export {};
@@ -1,12 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
7
- import type { BlockTypePlugin } from '../blockTypePluginType';
8
- type QuoteBlockMenuItemProps = {
9
- api: ExtractInjectionAPI<BlockTypePlugin> | undefined;
10
- };
11
- export declare const createQuoteBlockMenuItem: ({ api }: QuoteBlockMenuItemProps) => () => React.JSX.Element;
12
- export {};
@@ -1 +0,0 @@
1
- export { BLOCK_QUOTE, CODE_BLOCK, HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6, NORMAL_TEXT, PANEL, } from '../pm-plugins/block-types';
@@ -1,4 +0,0 @@
1
- import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
- import type { RegisterBlockMenuComponent } from '@atlaskit/editor-plugin-block-menu';
3
- import type { BlockTypePlugin } from '../blockTypePluginType';
4
- export declare const getBlockTypeComponents: (api: ExtractInjectionAPI<BlockTypePlugin> | undefined) => RegisterBlockMenuComponent[];