@blocknote/core 0.1.1 → 0.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 (171) hide show
  1. package/README.md +12 -6
  2. package/dist/blocknote.js +1425 -5114
  3. package/dist/blocknote.js.map +1 -1
  4. package/dist/blocknote.umd.cjs +1 -53
  5. package/dist/blocknote.umd.cjs.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/package.json +3 -16
  8. package/src/BlockNoteEditor.ts +54 -0
  9. package/src/BlockNoteExtensions.ts +52 -7
  10. package/src/assets/fonts-inter.css +92 -0
  11. package/src/editor.module.css +37 -0
  12. package/src/extensions/Blocks/BlockAttributes.ts +1 -3
  13. package/src/extensions/Blocks/PreviousBlockTypePlugin.ts +71 -18
  14. package/src/extensions/Blocks/helpers/getBlockInfoFromPos.ts +66 -0
  15. package/src/extensions/Blocks/index.ts +7 -3
  16. package/src/extensions/Blocks/nodes/Block.module.css +116 -74
  17. package/src/extensions/Blocks/nodes/Block.ts +415 -292
  18. package/src/extensions/Blocks/nodes/BlockGroup.ts +6 -6
  19. package/src/extensions/Blocks/nodes/BlockTypes/HeadingBlock/HeadingContent.ts +84 -0
  20. package/src/extensions/Blocks/nodes/BlockTypes/ListItemBlock/ListItemContent.ts +177 -0
  21. package/src/extensions/Blocks/nodes/BlockTypes/ListItemBlock/OrderedListItemIndexPlugin.ts +77 -0
  22. package/src/extensions/Blocks/nodes/BlockTypes/TextBlock/TextContent.ts +34 -0
  23. package/src/extensions/DraggableBlocks/BlockSideMenuFactoryTypes.ts +20 -0
  24. package/src/extensions/DraggableBlocks/DraggableBlocksExtension.ts +27 -9
  25. package/src/extensions/DraggableBlocks/{DraggableBlocksPlugin.tsx → DraggableBlocksPlugin.ts} +227 -147
  26. package/src/extensions/FormattingToolbar/FormattingToolbarExtension.ts +29 -0
  27. package/src/extensions/FormattingToolbar/FormattingToolbarFactoryTypes.ts +35 -0
  28. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +308 -0
  29. package/src/extensions/HyperlinkToolbar/HyperlinkMark.ts +28 -0
  30. package/src/extensions/HyperlinkToolbar/HyperlinkToolbarFactoryTypes.ts +19 -0
  31. package/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.ts +251 -0
  32. package/src/extensions/Placeholder/PlaceholderExtension.ts +2 -2
  33. package/src/extensions/SlashMenu/SlashMenuExtension.ts +9 -1
  34. package/src/extensions/SlashMenu/SlashMenuItem.ts +1 -3
  35. package/src/extensions/SlashMenu/defaultCommands.tsx +33 -22
  36. package/src/extensions/TrailingNode/TrailingNodeExtension.ts +4 -4
  37. package/src/extensions/UniqueID/UniqueID.ts +14 -12
  38. package/src/index.ts +8 -4
  39. package/src/shared/EditorElement.ts +10 -0
  40. package/src/shared/plugins/suggestion/SuggestionItem.ts +1 -8
  41. package/src/shared/plugins/suggestion/SuggestionPlugin.ts +222 -101
  42. package/src/shared/plugins/suggestion/SuggestionsMenuFactoryTypes.ts +21 -0
  43. package/src/{utils.ts → shared/utils.ts} +0 -0
  44. package/types/src/BlockNoteEditor.d.ts +13 -0
  45. package/types/src/BlockNoteExtensions.d.ts +12 -1
  46. package/types/src/EditorElement.d.ts +7 -0
  47. package/types/src/extensions/Blocks/PreviousBlockTypePlugin.d.ts +1 -1
  48. package/types/src/extensions/Blocks/helpers/getBlockInfoFromPos.d.ts +19 -0
  49. package/types/src/extensions/Blocks/nodes/Block.d.ts +11 -19
  50. package/types/src/extensions/Blocks/nodes/BlockTypes/HeadingBlock/HeadingContent.d.ts +8 -0
  51. package/types/src/extensions/Blocks/nodes/BlockTypes/ListItemBlock/ListItemContent.d.ts +8 -0
  52. package/types/src/extensions/Blocks/nodes/BlockTypes/ListItemBlock/OrderedListItemIndexPlugin.d.ts +2 -0
  53. package/types/src/extensions/Blocks/nodes/BlockTypes/TextBlock/TextContent.d.ts +6 -0
  54. package/types/src/extensions/BubbleMenu/BubbleMenuExtension.d.ts +4 -1
  55. package/types/src/extensions/BubbleMenu/BubbleMenuFactoryTypes.d.ts +27 -0
  56. package/types/src/extensions/BubbleMenu/BubbleMenuPlugin.d.ts +10 -12
  57. package/types/src/extensions/DraggableBlocks/BlockMenuFactoryTypes.d.ts +12 -0
  58. package/types/src/extensions/DraggableBlocks/BlockSideMenuFactoryTypes.d.ts +14 -0
  59. package/types/src/extensions/DraggableBlocks/DragMenuFactoryTypes.d.ts +18 -0
  60. package/types/src/extensions/DraggableBlocks/DraggableBlocksExtension.d.ts +9 -3
  61. package/types/src/extensions/DraggableBlocks/DraggableBlocksPlugin.d.ts +23 -1
  62. package/types/src/extensions/FormattingToolbar/FormattingToolbarExtension.d.ts +8 -0
  63. package/types/src/extensions/FormattingToolbar/FormattingToolbarFactoryTypes.d.ts +23 -0
  64. package/types/src/extensions/FormattingToolbar/FormattingToolbarPlugin.d.ts +43 -0
  65. package/types/src/extensions/HyperlinkToolbar/HyperlinkMark.d.ts +8 -0
  66. package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarFactoryTypes.d.ts +12 -0
  67. package/types/src/extensions/HyperlinkToolbar/HyperlinkToolbarPlugin.d.ts +11 -0
  68. package/types/src/extensions/Hyperlinks/HyperlinkMark.d.ts +2 -1
  69. package/types/src/extensions/Hyperlinks/HyperlinkMenuFactoryTypes.d.ts +11 -0
  70. package/types/src/extensions/Hyperlinks/HyperlinkMenuPlugin.d.ts +10 -1
  71. package/types/src/extensions/SlashMenu/SlashMenuExtension.d.ts +3 -1
  72. package/types/src/extensions/SlashMenu/SlashMenuItem.d.ts +2 -4
  73. package/types/src/index.d.ts +8 -3
  74. package/types/src/shared/EditorElement.d.ts +6 -0
  75. package/types/src/shared/plugins/suggestion/SuggestionItem.d.ts +1 -6
  76. package/types/src/shared/plugins/suggestion/SuggestionPlugin.d.ts +15 -10
  77. package/types/src/shared/plugins/suggestion/SuggestionsMenuFactoryTypes.d.ts +12 -0
  78. package/types/src/shared/utils.d.ts +2 -0
  79. package/types/src/utils.d.ts +2 -2
  80. package/src/BlockNoteTheme.ts +0 -150
  81. package/src/EditorContent.tsx +0 -2
  82. package/src/extensions/Blocks/OrderedListPlugin.ts +0 -46
  83. package/src/extensions/Blocks/commands/joinBackward.ts +0 -274
  84. package/src/extensions/Blocks/helpers/setBlockHeading.ts +0 -30
  85. package/src/extensions/Blocks/nodes/Content.ts +0 -63
  86. package/src/extensions/Blocks/rule.ts +0 -48
  87. package/src/extensions/BubbleMenu/BubbleMenuExtension.tsx +0 -36
  88. package/src/extensions/BubbleMenu/BubbleMenuPlugin.ts +0 -245
  89. package/src/extensions/BubbleMenu/component/BubbleMenu.tsx +0 -240
  90. package/src/extensions/BubbleMenu/component/LinkToolbarButton.tsx +0 -67
  91. package/src/extensions/DraggableBlocks/components/DragHandle.tsx +0 -102
  92. package/src/extensions/DraggableBlocks/components/DragHandleMenu.tsx +0 -19
  93. package/src/extensions/Hyperlinks/HyperlinkMark.tsx +0 -16
  94. package/src/extensions/Hyperlinks/HyperlinkMenuPlugin.tsx +0 -165
  95. package/src/extensions/Hyperlinks/menus/EditHyperlinkMenu.tsx +0 -44
  96. package/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItem.tsx +0 -34
  97. package/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItemIcon.tsx +0 -31
  98. package/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItemInput.tsx +0 -40
  99. package/src/extensions/Hyperlinks/menus/HoverHyperlinkMenu.tsx +0 -37
  100. package/src/extensions/Hyperlinks/menus/HyperlinkMenu.tsx +0 -63
  101. package/src/fonts-inter.css +0 -94
  102. package/src/globals.css +0 -28
  103. package/src/root.module.css +0 -19
  104. package/src/shared/components/toolbar/Toolbar.tsx +0 -10
  105. package/src/shared/components/toolbar/ToolbarButton.tsx +0 -57
  106. package/src/shared/components/toolbar/ToolbarDropdown.tsx +0 -35
  107. package/src/shared/components/toolbar/ToolbarDropdownItem.tsx +0 -35
  108. package/src/shared/components/toolbar/ToolbarDropdownTarget.tsx +0 -31
  109. package/src/shared/components/tooltip/TooltipContent.module.css +0 -15
  110. package/src/shared/components/tooltip/TooltipContent.tsx +0 -23
  111. package/src/shared/hooks/useEditorForceUpdate.tsx +0 -30
  112. package/src/shared/plugins/suggestion/SuggestionListReactRenderer.tsx +0 -236
  113. package/src/shared/plugins/suggestion/components/SuggestionGroup.tsx +0 -47
  114. package/src/shared/plugins/suggestion/components/SuggestionGroupItem.tsx +0 -82
  115. package/src/shared/plugins/suggestion/components/SuggestionList.tsx +0 -92
  116. package/src/useEditor.ts +0 -51
  117. package/types/src/BlockNoteTheme.d.ts +0 -2
  118. package/types/src/EditorContent.d.ts +0 -1
  119. package/types/src/commands/indentation.d.ts +0 -2
  120. package/types/src/extensions/Blocks/OrderedListPlugin.d.ts +0 -2
  121. package/types/src/extensions/Blocks/commands/joinBackward.d.ts +0 -14
  122. package/types/src/extensions/Blocks/helpers/setBlockHeading.d.ts +0 -5
  123. package/types/src/extensions/Blocks/nodes/Content.d.ts +0 -5
  124. package/types/src/extensions/Blocks/rule.d.ts +0 -16
  125. package/types/src/extensions/BubbleMenu/component/BubbleMenu.d.ts +0 -5
  126. package/types/src/extensions/BubbleMenu/component/DropdownBlockItem.d.ts +0 -10
  127. package/types/src/extensions/BubbleMenu/component/LinkToolbarButton.d.ts +0 -11
  128. package/types/src/extensions/DraggableBlocks/components/DragHandle.d.ts +0 -12
  129. package/types/src/extensions/DraggableBlocks/components/DragHandleMenu.d.ts +0 -6
  130. package/types/src/extensions/Hyperlinks/menus/EditHyperlinkMenu.d.ts +0 -11
  131. package/types/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItem.d.ts +0 -13
  132. package/types/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItemIcon.d.ts +0 -8
  133. package/types/src/extensions/Hyperlinks/menus/EditHyperlinkMenuItemInput.d.ts +0 -9
  134. package/types/src/extensions/Hyperlinks/menus/HoverHyperlinkMenu.d.ts +0 -12
  135. package/types/src/extensions/Hyperlinks/menus/HyperlinkBasicMenu.d.ts +0 -12
  136. package/types/src/extensions/Hyperlinks/menus/HyperlinkEditMenu.d.ts +0 -10
  137. package/types/src/extensions/Hyperlinks/menus/HyperlinkMenu.d.ts +0 -21
  138. package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInput.d.ts +0 -39
  139. package/types/src/extensions/Hyperlinks/menus/atlaskit/PanelTextInputStyles.d.ts +0 -1
  140. package/types/src/extensions/Hyperlinks/menus/atlaskit/ToolbarComponent.d.ts +0 -11
  141. package/types/src/extensions/Hyperlinks/menus/helpers/PanelTextInput.d.ts +0 -39
  142. package/types/src/extensions/Hyperlinks/menus/helpers/PanelTextInputStyles.d.ts +0 -3
  143. package/types/src/extensions/Hyperlinks/menus/helpers/ToolbarComponent.d.ts +0 -13
  144. package/types/src/extensions/helpers/formatKeyboardShortcut.d.ts +0 -1
  145. package/types/src/lib/atlaskit/browser.d.ts +0 -12
  146. package/types/src/nodes/ChildgroupNode.d.ts +0 -28
  147. package/types/src/nodes/patchNodes.d.ts +0 -1
  148. package/types/src/plugins/TreeViewPlugin/index.d.ts +0 -2
  149. package/types/src/plugins/animation.d.ts +0 -2
  150. package/types/src/react/BlockNoteComposer.d.ts +0 -17
  151. package/types/src/react/BlockNotePlugin.d.ts +0 -1
  152. package/types/src/react/index.d.ts +0 -3
  153. package/types/src/react/useBlockNoteSetup.d.ts +0 -2
  154. package/types/src/registerBlockNote.d.ts +0 -2
  155. package/types/src/shared/components/toolbar/SimpleToolbarButton.d.ts +0 -15
  156. package/types/src/shared/components/toolbar/SimpleToolbarDropdown.d.ts +0 -11
  157. package/types/src/shared/components/toolbar/SimpleToolbarDropdownItem.d.ts +0 -11
  158. package/types/src/shared/components/toolbar/Toolbar.d.ts +0 -4
  159. package/types/src/shared/components/toolbar/ToolbarButton.d.ts +0 -15
  160. package/types/src/shared/components/toolbar/ToolbarDropdown.d.ts +0 -17
  161. package/types/src/shared/components/toolbar/ToolbarDropdownItem.d.ts +0 -11
  162. package/types/src/shared/components/toolbar/ToolbarDropdownTarget.d.ts +0 -8
  163. package/types/src/shared/components/toolbar/ToolbarSeparator.d.ts +0 -2
  164. package/types/src/shared/components/tooltip/TooltipContent.d.ts +0 -15
  165. package/types/src/shared/hooks/useEditorForceUpdate.d.ts +0 -2
  166. package/types/src/shared/plugins/suggestion/SuggestionListReactRenderer.d.ts +0 -71
  167. package/types/src/shared/plugins/suggestion/components/SuggestionGroup.d.ts +0 -23
  168. package/types/src/shared/plugins/suggestion/components/SuggestionGroupItem.d.ts +0 -9
  169. package/types/src/shared/plugins/suggestion/components/SuggestionList.d.ts +0 -11
  170. package/types/src/themes/BlockNoteEditorTheme.d.ts +0 -11
  171. package/types/src/useEditor.d.ts +0 -11
@@ -1,16 +0,0 @@
1
- import { ExtendedRegExpMatchArray, InputRule, InputRuleFinder } from "@tiptap/core";
2
- import { NodeType } from "prosemirror-model";
3
- /**
4
- * Modified version of https://github.com/ueberdosis/tiptap/blob/6a813686f5e87cebac49a624936dbeadb5a29f95/packages/core/src/inputRules/textblockTypeInputRule.ts
5
- * But instead of changing the type of a node, we use setNodeMarkup to change some of it's current attributes
6
- *
7
- * Build an input rule that changes the type of a textblock when the
8
- * matched text is typed into it. When using a regular expresion you’ll
9
- * probably want the regexp to start with `^`, so that the pattern can
10
- * only occur at the start of a textblock.
11
- */
12
- export declare function textblockTypeInputRuleSameNodeType(config: {
13
- find: InputRuleFinder;
14
- type: NodeType;
15
- getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
16
- }): InputRule;
@@ -1,5 +0,0 @@
1
- /// <reference types="react" />
2
- import { Editor } from "@tiptap/core";
3
- export declare const BubbleMenu: (props: {
4
- editor: Editor;
5
- }) => JSX.Element;
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { IconType } from "react-icons/lib";
3
- interface DropdownBlockItemProps {
4
- title: string;
5
- icon: IconType;
6
- isSelected?: boolean;
7
- onClick?: () => void;
8
- }
9
- export default function DropdownBlockItem(props: DropdownBlockItemProps): JSX.Element;
10
- export {};
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { Editor } from "@tiptap/core";
3
- import { ToolbarButtonProps } from "../../../shared/components/toolbar/ToolbarButton";
4
- declare type Props = ToolbarButtonProps & {
5
- editor: Editor;
6
- };
7
- /**
8
- * The link menu button opens a tooltip on click
9
- */
10
- export declare const LinkToolbarButton: (props: Props) => JSX.Element;
11
- export default LinkToolbarButton;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { EditorView } from "prosemirror-view";
3
- export declare const DragHandle: (props: {
4
- view: EditorView;
5
- coords: {
6
- left: number;
7
- top: number;
8
- };
9
- onShow?: () => void;
10
- onHide?: () => void;
11
- onAddClicked?: () => void;
12
- }) => JSX.Element | null;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- declare type Props = {
3
- onDelete: () => void;
4
- };
5
- declare const DragHandleMenu: (props: Props) => JSX.Element;
6
- export default DragHandleMenu;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- export declare type EditHyperlinkMenuProps = {
3
- url: string;
4
- text: string;
5
- update: (url: string, text: string) => void;
6
- };
7
- /**
8
- * Menu which opens when editing an existing hyperlink or creating a new one.
9
- * Provides input fields for setting the hyperlink URL and title.
10
- */
11
- export declare const EditHyperlinkMenu: (props: EditHyperlinkMenuProps) => JSX.Element;
@@ -1,13 +0,0 @@
1
- /// <reference types="react" />
2
- import { IconType } from "react-icons";
3
- export declare type EditHyperlinkMenuItemProps = {
4
- icon: IconType;
5
- mainIconTooltip: string;
6
- secondaryIconTooltip?: string;
7
- autofocus?: boolean;
8
- placeholder?: string;
9
- value?: string;
10
- onChange: (value: string) => void;
11
- onSubmit: () => void;
12
- };
13
- export declare function EditHyperlinkMenuItem(props: EditHyperlinkMenuItemProps): JSX.Element;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { IconType } from "react-icons";
3
- export declare type EditHyperlinkMenuItemIconProps = {
4
- icon: IconType;
5
- mainTooltip: string;
6
- secondaryTooltip?: string;
7
- };
8
- export declare function EditHyperlinkMenuItemIcon(props: EditHyperlinkMenuItemIconProps): JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- export declare type EditHyperlinkMenuItemInputProps = {
3
- autofocus?: boolean;
4
- placeholder?: string;
5
- value?: string;
6
- onChange: (value: string) => void;
7
- onSubmit: () => void;
8
- };
9
- export declare function EditHyperlinkMenuItemInput(props: EditHyperlinkMenuItemInputProps): JSX.Element;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- declare type HoverHyperlinkMenuProps = {
3
- url: string;
4
- edit: () => void;
5
- remove: () => void;
6
- };
7
- /**
8
- * Menu which opens when hovering an existing hyperlink.
9
- * Provides buttons for editing, opening, and removing the hyperlink.
10
- */
11
- export declare const HoverHyperlinkMenu: (props: HoverHyperlinkMenuProps) => JSX.Element;
12
- export {};
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- declare type HyperlinkMenuProps = {
3
- href: string;
4
- removeHandler: () => void;
5
- editMenu: React.ReactElement;
6
- };
7
- /**
8
- * A hyperlink menu shown when an anchor is hovered over.
9
- * It shows options to edit / remove / open the link
10
- */
11
- export declare const HyperlinkBasicMenu: (props: HyperlinkMenuProps) => JSX.Element;
12
- export {};
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- export declare type HyperlinkEditorMenuProps = {
3
- url: string;
4
- text: string;
5
- onSubmit: (url: string, text: string) => void;
6
- };
7
- /**
8
- * The sub menu for editing an anchor element
9
- */
10
- export declare const HyperlinkEditMenu: (props: HyperlinkEditorMenuProps) => JSX.Element;
@@ -1,21 +0,0 @@
1
- /// <reference types="react" />
2
- declare type HyperlinkMenuProps = {
3
- url: string;
4
- text: string;
5
- pos: {
6
- height: number;
7
- width: number;
8
- left: number;
9
- right: number;
10
- top: number;
11
- bottom: number;
12
- };
13
- update: (url: string, text: string) => void;
14
- remove: () => void;
15
- };
16
- /**
17
- * Main menu component for the hyperlink extension.
18
- * Either renders a menu to create/edit a hyperlink, or a menu to interact with it on mouse hover.
19
- */
20
- export declare const HyperlinkMenu: (props: HyperlinkMenuProps) => JSX.Element;
21
- export {};
@@ -1,39 +0,0 @@
1
- import { KeyboardEvent, PureComponent } from "react";
2
- import { FocusEvent } from "react";
3
- export interface Props {
4
- autoFocus?: boolean | FocusOptions;
5
- defaultValue?: string;
6
- onChange?: (value: string) => void;
7
- onSubmit?: (value: string) => void;
8
- onCancel?: (e: KeyboardEvent) => void;
9
- placeholder?: string;
10
- onMouseDown?: Function;
11
- onKeyDown?: (e: KeyboardEvent<any>) => void;
12
- onUndo?: Function;
13
- onRedo?: Function;
14
- onBlur?: Function;
15
- width?: number;
16
- maxLength?: number;
17
- testId?: string;
18
- ariaLabel?: string;
19
- id?: string;
20
- }
21
- export interface State {
22
- value?: string;
23
- }
24
- export default class PanelTextInput extends PureComponent<Props, State> {
25
- private input?;
26
- private focusTimeoutId;
27
- constructor(props: Props);
28
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
29
- componentWillUnmount(): void;
30
- onMouseDown: () => void;
31
- onBlur: (e: FocusEvent<any>) => void;
32
- render(): JSX.Element;
33
- focus(): void;
34
- private handleChange;
35
- private handleKeydown;
36
- private isUndoEvent;
37
- private isRedoEvent;
38
- private handleRef;
39
- }
@@ -1 +0,0 @@
1
- export declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
@@ -1,11 +0,0 @@
1
- export declare const RECENT_SEARCH_WIDTH_IN_PX = 420;
2
- export declare const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
3
- export declare const RECENT_SEARCH_HEIGHT_IN_PX = 360;
4
- export declare const InputWrapper = "\n display: flex;\n line-height: 0;\n padding: 4px 0;\n align-items: center;\n";
5
- export declare const UrlInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
7
- provider: boolean;
8
- }, never>;
9
- export declare const TextInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
10
- export declare const IconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
11
- export declare const ContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,39 +0,0 @@
1
- import { KeyboardEvent, PureComponent } from "react";
2
- import { FocusEvent } from "react";
3
- export interface Props {
4
- autoFocus?: boolean | FocusOptions;
5
- defaultValue?: string;
6
- onChange?: (value: string) => void;
7
- onSubmit?: (value: string) => void;
8
- onCancel?: (e: KeyboardEvent) => void;
9
- placeholder?: string;
10
- onMouseDown?: Function;
11
- onKeyDown?: (e: KeyboardEvent<any>) => void;
12
- onUndo?: Function;
13
- onRedo?: Function;
14
- onBlur?: Function;
15
- width?: number;
16
- maxLength?: number;
17
- testId?: string;
18
- ariaLabel?: string;
19
- id?: string;
20
- }
21
- export interface State {
22
- value?: string;
23
- }
24
- export default class PanelTextInput extends PureComponent<Props, State> {
25
- private input?;
26
- private focusTimeoutId;
27
- constructor(props: Props);
28
- UNSAFE_componentWillReceiveProps(nextProps: Props): void;
29
- componentWillUnmount(): void;
30
- onMouseDown: () => void;
31
- onBlur: (e: FocusEvent<any>) => void;
32
- render(): JSX.Element;
33
- focus(): void;
34
- private handleChange;
35
- private handleKeydown;
36
- private isUndoEvent;
37
- private isRedoEvent;
38
- private handleRef;
39
- }
@@ -1,3 +0,0 @@
1
- export declare const N400 = "#505F79";
2
- export declare const N800 = "#172B4D";
3
- export declare const Input: import("styled-components").StyledComponent<"input", any, {}, never>;
@@ -1,13 +0,0 @@
1
- export declare const N80 = "#97A0AF";
2
- export declare const N30 = "#EBECF0";
3
- export declare const RECENT_SEARCH_WIDTH_IN_PX = 420;
4
- export declare const RECENT_SEARCH_WIDTH_WITHOUT_ITEMS_IN_PX = 360;
5
- export declare const RECENT_SEARCH_HEIGHT_IN_PX = 360;
6
- export declare const InputWrapper = "\n display: flex;\n line-height: 0;\n padding: 4px 0;\n align-items: center;\n";
7
- export declare const UrlInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const Container: import("styled-components").StyledComponent<"div", any, {
9
- provider: boolean;
10
- }, never>;
11
- export declare const TextInputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
12
- export declare const IconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
13
- export declare const ContainerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1 +0,0 @@
1
- export default function formatKeyboardShortcut(shortcut: string): string;
@@ -1,12 +0,0 @@
1
- declare const result: {
2
- mac: boolean;
3
- ie: boolean;
4
- ie_version: number;
5
- gecko: boolean;
6
- chrome: boolean;
7
- chrome_version: number;
8
- android: boolean;
9
- ios: boolean;
10
- webkit: boolean;
11
- };
12
- export default result;
@@ -1,28 +0,0 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import { EditorConfig, ElementNode, LexicalNode, NodeKey, RangeSelection, SerializedElementNode, Spread, TextNode } from "lexical";
9
- export declare type SerializedChildgroupNode = Spread<{
10
- type: "childgroup";
11
- version: 1;
12
- }, SerializedElementNode>;
13
- export declare class ChildgroupNode extends ElementNode {
14
- static getType(): string;
15
- static clone(node: ChildgroupNode): ChildgroupNode;
16
- constructor(key?: NodeKey);
17
- canBeEmpty(): boolean;
18
- createDOM(_config: EditorConfig): HTMLElement;
19
- updateDOM(_prevNode: TextNode, _dom: HTMLElement, _config: EditorConfig): boolean;
20
- select(_anchorOffset?: number | undefined, _focusOffset?: number | undefined): RangeSelection;
21
- selectStart(): RangeSelection;
22
- insertBeforeDOM(dom: HTMLElement, childDOM: HTMLElement, referenceNode: Node | null): void;
23
- static importJSON(_serializedNode: SerializedChildgroupNode): ChildgroupNode;
24
- exportJSON(): SerializedChildgroupNode;
25
- getClassName(): string;
26
- }
27
- export declare function $isChildgroupNode(node: LexicalNode | null | undefined): node is ChildgroupNode;
28
- export declare function $createChildgroupNode(): ChildgroupNode;
@@ -1 +0,0 @@
1
- export declare function patchNode(node: any): void;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function TreeViewPlugin(): JSX.Element;
@@ -1,2 +0,0 @@
1
- import { LexicalEditor } from "lexical";
2
- export declare function registerAnimation(editor: LexicalEditor): () => void;
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { EditorState, EditorThemeClasses, Klass, LexicalEditor, LexicalNode } from "lexical";
3
- export declare type InitialEditorStateType = null | string | EditorState | ((editor: LexicalEditor) => void);
4
- declare type Props = {
5
- children: JSX.Element | JSX.Element[];
6
- initialConfig: Readonly<{
7
- editor__DEPRECATED?: LexicalEditor | null;
8
- namespace: string;
9
- nodes?: ReadonlyArray<Klass<LexicalNode>>;
10
- onError: (error: Error, editor: LexicalEditor) => void;
11
- editable?: boolean;
12
- theme?: EditorThemeClasses;
13
- editorState?: InitialEditorStateType;
14
- }>;
15
- };
16
- export declare function BlockNoteComposer({ initialConfig, children }: Props): JSX.Element;
17
- export {};
@@ -1 +0,0 @@
1
- export declare function BlockNotePlugin(_props: {}): null;
@@ -1,3 +0,0 @@
1
- export * from "./BlockNoteComposer";
2
- export * from "./BlockNotePlugin";
3
- export * from "./useBlockNoteSetup";
@@ -1,2 +0,0 @@
1
- import type { LexicalEditor } from "lexical";
2
- export declare function useBlockNoteSetup(editor: LexicalEditor): void;
@@ -1,2 +0,0 @@
1
- import type { LexicalEditor } from "lexical";
2
- export declare function registerBlockNote(editor: LexicalEditor): () => void;
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { IconType } from "react-icons";
3
- export declare type SimpleToolbarButtonProps = {
4
- onClick?: (e: React.MouseEvent) => void;
5
- icon?: IconType;
6
- mainTooltip: string;
7
- secondaryTooltip?: string;
8
- isSelected?: boolean;
9
- children?: any;
10
- isDisabled?: boolean;
11
- };
12
- /**
13
- * Helper for basic buttons that show in the inline bubble menu.
14
- */
15
- export declare const SimpleToolbarButton: React.ForwardRefExoticComponent<SimpleToolbarButtonProps & React.RefAttributes<unknown>>;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import { SimpleToolbarDropdownItemProps } from "./SimpleToolbarDropdownItem";
3
- import { IconType } from "react-icons";
4
- export declare type SimpleToolbarDropdownProps = {
5
- text: string;
6
- icon?: IconType;
7
- items: Array<SimpleToolbarDropdownItemProps>;
8
- children?: any;
9
- isDisabled?: boolean;
10
- };
11
- export declare function SimpleToolbarDropdown(props: SimpleToolbarDropdownProps): JSX.Element;
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- import { IconType } from "react-icons";
3
- export declare type SimpleToolbarDropdownItemProps = {
4
- onClick?: (e: React.MouseEvent) => void;
5
- text: string;
6
- icon?: IconType;
7
- isSelected?: boolean;
8
- children?: any;
9
- isDisabled?: boolean;
10
- };
11
- export declare function SimpleToolbarDropdownItem(props: SimpleToolbarDropdownItemProps): JSX.Element;
@@ -1,4 +0,0 @@
1
- import { ReactNode } from "react";
2
- export declare const Toolbar: (props: {
3
- children: ReactNode;
4
- }) => JSX.Element;
@@ -1,15 +0,0 @@
1
- import React from "react";
2
- import { IconType } from "react-icons";
3
- export declare type ToolbarButtonProps = {
4
- onClick?: (e: React.MouseEvent) => void;
5
- icon?: IconType;
6
- mainTooltip: string;
7
- secondaryTooltip?: string;
8
- isSelected?: boolean;
9
- children?: any;
10
- isDisabled?: boolean;
11
- };
12
- /**
13
- * Helper for basic buttons that show in the inline bubble menu.
14
- */
15
- export declare const ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & React.RefAttributes<unknown>>;
@@ -1,17 +0,0 @@
1
- import { IconType } from "react-icons";
2
- import { MouseEvent } from "react";
3
- export declare type ToolbarDropdownProps = {
4
- text: string;
5
- icon?: IconType;
6
- items: Array<{
7
- onClick?: (e: MouseEvent) => void;
8
- text: string;
9
- icon?: IconType;
10
- isSelected?: boolean;
11
- children?: any;
12
- isDisabled?: boolean;
13
- }>;
14
- children?: any;
15
- isDisabled?: boolean;
16
- };
17
- export declare function ToolbarDropdown(props: ToolbarDropdownProps): JSX.Element;
@@ -1,11 +0,0 @@
1
- import { IconType } from "react-icons";
2
- import { MouseEvent } from "react";
3
- export declare type ToolbarDropdownItemProps = {
4
- onClick?: (e: MouseEvent) => void;
5
- text: string;
6
- icon?: IconType;
7
- isSelected?: boolean;
8
- children?: any;
9
- isDisabled?: boolean;
10
- };
11
- export declare function ToolbarDropdownItem(props: ToolbarDropdownItemProps): JSX.Element;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { IconType } from "react-icons";
3
- export declare type ToolbarDropdownTargetProps = {
4
- text: string;
5
- icon?: IconType;
6
- isDisabled?: boolean;
7
- };
8
- export declare const ToolbarDropdownTarget: import("react").ForwardRefExoticComponent<ToolbarDropdownTargetProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const ToolbarSeparator: () => JSX.Element;
@@ -1,15 +0,0 @@
1
- /// <reference types="react" />
2
- /**
3
- * Helper for the tooltip for inline bubble menu buttons.
4
- *
5
- * Often used to display a tooltip showing the command name + keyboard shortcut, e.g.:
6
- *
7
- * Bold
8
- * Ctrl+B
9
- *
10
- * TODO: maybe use default Tippy styles instead?
11
- */
12
- export declare const TooltipContent: (props: {
13
- mainTooltip: string;
14
- secondaryTooltip?: string;
15
- }) => JSX.Element;
@@ -1,2 +0,0 @@
1
- import { Editor } from "@tiptap/core";
2
- export declare const useEditorForceUpdate: (editor: Editor) => void;
@@ -1,71 +0,0 @@
1
- import { Editor } from "@tiptap/core";
2
- import SuggestionItem from "./SuggestionItem";
3
- /**
4
- * The interface that each suggestion renderer should conform to.
5
- */
6
- export interface SuggestionRenderer<T extends SuggestionItem> {
7
- /**
8
- * Disposes of the suggestion menu.
9
- */
10
- onExit?: (props: SuggestionRendererProps<T>) => void;
11
- /**
12
- * Updates the suggestion menu.
13
- *
14
- * This function should be called when the renderer's `props` change,
15
- * after `onStart` has been called.
16
- */
17
- onUpdate?: (props: SuggestionRendererProps<T>) => void;
18
- /**
19
- * Creates and displays a new suggestion menu popup.
20
- */
21
- onStart?: (props: SuggestionRendererProps<T>) => void;
22
- /**
23
- * Function for handling key events
24
- */
25
- onKeyDown?: (event: KeyboardEvent) => boolean;
26
- /**
27
- * The DOM Element representing the suggestion menu
28
- */
29
- getComponent: () => Element | undefined;
30
- }
31
- export declare type SuggestionRendererProps<T extends SuggestionItem> = {
32
- /**
33
- * Object containing all suggestion items, grouped by their `groupName`.
34
- */
35
- groups: {
36
- [groupName: string]: T[];
37
- };
38
- /**
39
- * The total number of suggestion-items.
40
- */
41
- count: number;
42
- /**
43
- * This callback is executed whenever the user selects an item.
44
- *
45
- * @param item the selected item
46
- */
47
- onSelectItem: (item: T) => void;
48
- /**
49
- * A function returning the client rect to use as reference for positioning the suggestion menu popup.
50
- */
51
- clientRect: (() => DOMRect) | null;
52
- /**
53
- * This callback is executed when the suggestion menu needs to be closed,
54
- * e.g. when the user presses escape.
55
- */
56
- onClose: () => void;
57
- };
58
- /**
59
- * This function creates a SuggestionRenderer based on TipTap's ReactRenderer utility.
60
- *
61
- * The resulting renderer can be used to display a suggestion menu containing (grouped) suggestion items.
62
- *
63
- * This renderer also takes care of the following key events:
64
- * - Key up/down, for navigating the suggestion menu (selecting different items)
65
- * - Enter for picking the currently selected item and closing the menu
66
- * - Escape to close the menu, without taking action
67
- *
68
- * @param editor the TipTap editor
69
- * @returns the newly constructed SuggestionRenderer
70
- */
71
- export default function createRenderer<T extends SuggestionItem>(editor: Editor): SuggestionRenderer<T>;
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- import SuggestionItem from "../SuggestionItem";
3
- declare type SuggestionGroupProps<T> = {
4
- /**
5
- * Name of the group
6
- */
7
- name: string;
8
- /**
9
- * The list of items
10
- */
11
- items: T[];
12
- /**
13
- * Index of the selected item in this group; relative to this item group (so 0 refers to the first item in this group)
14
- * This should be 'undefined' if none of the items in this group are selected
15
- */
16
- selectedIndex?: number;
17
- /**
18
- * Callback that gets executed when an item is clicked on.
19
- */
20
- clickItem: (item: T) => void;
21
- };
22
- export declare function SuggestionGroup<T extends SuggestionItem>(props: SuggestionGroupProps<T>): JSX.Element;
23
- export {};
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import SuggestionItem from "../SuggestionItem";
3
- export declare type SuggestionGroupItemProps<T> = {
4
- item: T;
5
- index: number;
6
- selectedIndex?: number;
7
- clickItem: (item: T) => void;
8
- };
9
- export declare function SuggestionGroupItem<T extends SuggestionItem>(props: SuggestionGroupItemProps<T>): JSX.Element;
@@ -1,11 +0,0 @@
1
- /// <reference types="react" />
2
- import SuggestionItem from "../SuggestionItem";
3
- export declare type SuggestionListProps<T> = {
4
- groups: {
5
- [groupName: string]: T[];
6
- };
7
- count: number;
8
- onSelectItem: (item: T) => void;
9
- selectedIndex: number;
10
- };
11
- export declare function SuggestionList<T extends SuggestionItem>(props: SuggestionListProps<T>): JSX.Element;