reactjs-tiptap-editor 0.0.1 → 0.0.2

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 (169) hide show
  1. package/lib/components/ActionButton.d.ts +20 -0
  2. package/lib/components/ActionMenuButton.d.ts +14 -0
  3. package/lib/components/ColorPicker.d.ts +12 -0
  4. package/lib/components/RcTiptapEditor.d.ts +26 -0
  5. package/lib/components/Toolbar.d.ts +2 -0
  6. package/lib/components/icons/AspectRatio.d.ts +3 -0
  7. package/lib/components/icons/Blockquote.d.ts +1 -0
  8. package/lib/components/icons/FileWordOutline.d.ts +3 -0
  9. package/lib/components/icons/Icon.d.ts +7 -0
  10. package/lib/components/icons/LineHeight.d.ts +3 -0
  11. package/lib/components/icons/MenuDown.d.ts +3 -0
  12. package/lib/components/icons/SizeL.d.ts +3 -0
  13. package/lib/components/icons/SizeM.d.ts +3 -0
  14. package/lib/components/icons/SizeS.d.ts +3 -0
  15. package/lib/components/icons/icons.d.ts +2 -0
  16. package/lib/components/menus/bubble.d.ts +56 -0
  17. package/lib/components/menus/components/BubbleMenuLink.d.ts +2 -0
  18. package/lib/components/menus/components/BubbleMenuMedia.d.ts +9 -0
  19. package/lib/components/menus/components/BubbleMenuText.d.ts +8 -0
  20. package/lib/components/menus/components/ContentMenu.d.ts +2 -0
  21. package/lib/components/ui/button.d.ts +11 -0
  22. package/lib/components/ui/dropdown-menu.d.ts +27 -0
  23. package/lib/components/ui/input.d.ts +5 -0
  24. package/lib/components/ui/label.d.ts +5 -0
  25. package/lib/components/ui/popover.d.ts +6 -0
  26. package/lib/components/ui/separator.d.ts +4 -0
  27. package/lib/components/ui/switch.d.ts +4 -0
  28. package/lib/components/ui/tabs.d.ts +7 -0
  29. package/lib/components/ui/toast.d.ts +15 -0
  30. package/lib/components/ui/toaster.d.ts +1 -0
  31. package/lib/components/ui/toggle.d.ts +12 -0
  32. package/lib/components/ui/tooltip.d.ts +7 -0
  33. package/lib/components/ui/use-toast.d.ts +44 -0
  34. package/lib/constants/index.d.ts +44 -0
  35. package/lib/extensions/BaseKit.d.ts +111 -0
  36. package/lib/extensions/Blockquote/Blockquote.d.ts +6 -0
  37. package/lib/extensions/Blockquote/index.d.ts +1 -0
  38. package/lib/extensions/Bold/Bold.d.ts +6 -0
  39. package/lib/extensions/Bold/index.d.ts +1 -0
  40. package/lib/extensions/BulletList/BulletList.d.ts +6 -0
  41. package/lib/extensions/BulletList/index.d.ts +1 -0
  42. package/lib/extensions/Clear/Clear.d.ts +6 -0
  43. package/lib/extensions/Clear/index.d.ts +1 -0
  44. package/lib/extensions/Code/Code.d.ts +6 -0
  45. package/lib/extensions/Code/index.d.ts +1 -0
  46. package/lib/extensions/CodeBlock/CodeBlock.d.ts +6 -0
  47. package/lib/extensions/CodeBlock/index.d.ts +1 -0
  48. package/lib/extensions/Color/Color.d.ts +6 -0
  49. package/lib/extensions/Color/components/ColorActionButton.d.ts +13 -0
  50. package/lib/extensions/Color/index.d.ts +1 -0
  51. package/lib/extensions/Document/Document.d.ts +2 -0
  52. package/lib/extensions/Document/index.d.ts +1 -0
  53. package/lib/extensions/FontFamily/FontFamily.d.ts +3 -0
  54. package/lib/extensions/FontFamily/components/FontFamilyButton.d.ts +26 -0
  55. package/lib/extensions/FontFamily/index.d.ts +1 -0
  56. package/lib/extensions/FontSize/FontSize.d.ts +32 -0
  57. package/lib/extensions/FontSize/components/FontSizeMenuButton.d.ts +23 -0
  58. package/lib/extensions/FontSize/index.d.ts +1 -0
  59. package/lib/extensions/FormatPainter/FormatPainter.d.ts +24 -0
  60. package/lib/extensions/FormatPainter/index.d.ts +1 -0
  61. package/lib/extensions/Heading/Heading.d.ts +6 -0
  62. package/lib/extensions/Heading/components/HeadingButton.d.ts +26 -0
  63. package/lib/extensions/Heading/index.d.ts +1 -0
  64. package/lib/extensions/Highlight/Highlight.d.ts +6 -0
  65. package/lib/extensions/Highlight/components/HighlightActionButton.d.ts +14 -0
  66. package/lib/extensions/Highlight/index.d.ts +1 -0
  67. package/lib/extensions/History/History.d.ts +6 -0
  68. package/lib/extensions/History/components/HistoryActionButton.d.ts +20 -0
  69. package/lib/extensions/History/index.d.ts +1 -0
  70. package/lib/extensions/HorizontalRule/HorizontalRule.d.ts +6 -0
  71. package/lib/extensions/HorizontalRule/index.d.ts +1 -0
  72. package/lib/extensions/Iframe/Iframe.d.ts +23 -0
  73. package/lib/extensions/Iframe/components/IframeNodeView.d.ts +2 -0
  74. package/lib/extensions/Iframe/embed.d.ts +23 -0
  75. package/lib/extensions/Iframe/index.d.ts +1 -0
  76. package/lib/extensions/Image/Image.d.ts +25 -0
  77. package/lib/extensions/Image/components/ImageView.d.ts +2 -0
  78. package/lib/extensions/Image/index.d.ts +1 -0
  79. package/lib/extensions/ImageUpload/ImageUpload.d.ts +16 -0
  80. package/lib/extensions/ImageUpload/components/ImageUploader.d.ts +2 -0
  81. package/lib/extensions/ImageUpload/index.d.ts +1 -0
  82. package/lib/extensions/Indent/Indent.d.ts +23 -0
  83. package/lib/extensions/Indent/index.d.ts +1 -0
  84. package/lib/extensions/Italic/Italic.d.ts +6 -0
  85. package/lib/extensions/Italic/index.d.ts +1 -0
  86. package/lib/extensions/LineHeight/LineHeight.d.ts +17 -0
  87. package/lib/extensions/LineHeight/components/LineHeightDropdown.d.ts +12 -0
  88. package/lib/extensions/LineHeight/index.d.ts +1 -0
  89. package/lib/extensions/Link/Link.d.ts +6 -0
  90. package/lib/extensions/Link/components/LinkEditBlock.d.ts +6 -0
  91. package/lib/extensions/Link/components/LinkEditPopover.d.ts +14 -0
  92. package/lib/extensions/Link/components/LinkViewBlock.d.ts +8 -0
  93. package/lib/extensions/Link/index.d.ts +1 -0
  94. package/lib/extensions/ListItem/ListItem.d.ts +1 -0
  95. package/lib/extensions/ListItem/index.d.ts +1 -0
  96. package/lib/extensions/MoreMark/MoreMark.d.ts +20 -0
  97. package/lib/extensions/MoreMark/components/ActionMoreButton.d.ts +25 -0
  98. package/lib/extensions/MoreMark/index.d.ts +1 -0
  99. package/lib/extensions/MultiColumn/Column.d.ts +4 -0
  100. package/lib/extensions/MultiColumn/ColumnToolbar.d.ts +3 -0
  101. package/lib/extensions/MultiColumn/Columns.d.ts +22 -0
  102. package/lib/extensions/MultiColumn/index.d.ts +3 -0
  103. package/lib/extensions/MultiColumn/menus/ColumnsMenu.d.ts +6 -0
  104. package/lib/extensions/MultiColumn/menus/index.d.ts +1 -0
  105. package/lib/extensions/OrderedList/OrderedList.d.ts +6 -0
  106. package/lib/extensions/OrderedList/index.d.ts +1 -0
  107. package/lib/extensions/Selection/Selection.d.ts +4 -0
  108. package/lib/extensions/Selection/index.d.ts +1 -0
  109. package/lib/extensions/SlashCommand/SlashCommand.d.ts +4 -0
  110. package/lib/extensions/SlashCommand/components/CommandsList.d.ts +4 -0
  111. package/lib/extensions/SlashCommand/groups.d.ts +3 -0
  112. package/lib/extensions/SlashCommand/index.d.ts +1 -0
  113. package/lib/extensions/SlashCommand/types.d.ts +25 -0
  114. package/lib/extensions/Strike/Strike.d.ts +6 -0
  115. package/lib/extensions/Strike/index.d.ts +1 -0
  116. package/lib/extensions/Subscript/Subscript.d.ts +23 -0
  117. package/lib/extensions/Subscript/index.d.ts +1 -0
  118. package/lib/extensions/Table/cell-background.d.ts +19 -0
  119. package/lib/extensions/Table/cell.d.ts +6 -0
  120. package/lib/extensions/Table/components/CreateTablePopover.d.ts +14 -0
  121. package/lib/extensions/Table/components/TableActionButton.d.ts +13 -0
  122. package/lib/extensions/Table/header.d.ts +5 -0
  123. package/lib/extensions/Table/index.d.ts +6 -0
  124. package/lib/extensions/Table/menus/TableBubbleMenu.d.ts +5 -0
  125. package/lib/extensions/Table/menus/TableCell/TableCellMenu.d.ts +21 -0
  126. package/lib/extensions/Table/menus/TableColumn/TableColumnMenu.d.ts +20 -0
  127. package/lib/extensions/Table/menus/TableRow/TableRowMenu.d.ts +20 -0
  128. package/lib/extensions/Table/row.d.ts +2 -0
  129. package/lib/extensions/Table/table.d.ts +24 -0
  130. package/lib/extensions/Table/utils.d.ts +67 -0
  131. package/lib/extensions/TaskList/TaskList.d.ts +12 -0
  132. package/lib/extensions/TaskList/index.d.ts +1 -0
  133. package/lib/extensions/TextAlign/TextAlign.d.ts +18 -0
  134. package/lib/extensions/TextAlign/components/TextAlignMenuButton.d.ts +27 -0
  135. package/lib/extensions/TextAlign/index.d.ts +1 -0
  136. package/lib/extensions/TextBubble/TextBubble.d.ts +7 -0
  137. package/lib/extensions/TextBubble/components/TextDropdown.d.ts +10 -0
  138. package/lib/extensions/TextBubble/index.d.ts +1 -0
  139. package/lib/extensions/TrailingNode/TrailingNode.d.ts +12 -0
  140. package/lib/extensions/TrailingNode/index.d.ts +1 -0
  141. package/lib/extensions/UnderLine/Underline.d.ts +6 -0
  142. package/lib/extensions/UnderLine/index.d.ts +1 -0
  143. package/lib/extensions/Video/Video.d.ts +55 -0
  144. package/lib/extensions/Video/index.d.ts +1 -0
  145. package/lib/extensions/VideoUpload/VideoUpload.d.ts +14 -0
  146. package/lib/extensions/VideoUpload/components/VideoUploaderView.d.ts +2 -0
  147. package/lib/extensions/VideoUpload/index.d.ts +1 -0
  148. package/lib/extensions/index.d.ts +64 -0
  149. package/lib/index.d.ts +4 -0
  150. package/lib/lib/utils.d.ts +3 -0
  151. package/lib/locales/en.d.ts +2 -0
  152. package/lib/locales/index.d.ts +33 -0
  153. package/lib/locales/vi.d.ts +2 -0
  154. package/lib/plugins/image-upload.d.ts +12 -0
  155. package/lib/reactjs-tiptap-editor.js +1 -0
  156. package/lib/reactjs-tiptap-editor.mjs +5704 -0
  157. package/lib/style.css +1 -0
  158. package/lib/theme/theme.d.ts +4 -0
  159. package/lib/types.d.ts +80 -0
  160. package/lib/utils/getRenderContainer.d.ts +4 -0
  161. package/lib/utils/indent.d.ts +15 -0
  162. package/lib/utils/is-mobile.d.ts +19 -0
  163. package/lib/utils/line-height.d.ts +7 -0
  164. package/lib/utils/mitt.d.ts +24 -0
  165. package/lib/utils/plateform.d.ts +11 -0
  166. package/lib/utils/utils.d.ts +17 -0
  167. package/lib/vendor-D85xV5eE.js +518 -0
  168. package/lib/vendor-IlByxugU.mjs +34816 -0
  169. package/package.json +2 -1
@@ -0,0 +1,3 @@
1
+ import { Group } from './types';
2
+
3
+ export declare function renderGroups(editor: any): Group[];
@@ -0,0 +1 @@
1
+ export * from './SlashCommand';
@@ -0,0 +1,25 @@
1
+ import { Editor, Range } from '@tiptap/core';
2
+
3
+ export interface Group {
4
+ name: string;
5
+ title: string;
6
+ commands: Command[];
7
+ }
8
+ export interface Command {
9
+ name: string;
10
+ label: string;
11
+ description?: string;
12
+ aliases?: string[];
13
+ iconName?: any;
14
+ iconUrl?: string;
15
+ action: ({ editor, range }: {
16
+ editor: Editor;
17
+ range: Range;
18
+ }) => void;
19
+ shouldBeHidden?: (editor: Editor) => boolean;
20
+ }
21
+ export interface MenuListProps {
22
+ editor: Editor;
23
+ items: Group[];
24
+ command: (command: Command) => void;
25
+ }
@@ -0,0 +1,6 @@
1
+ import { StrikeOptions as TiptapStrikeOptions } from '@tiptap/extension-strike';
2
+ import { GeneralOptions } from '../../types';
3
+
4
+ export interface StrikeOptions extends TiptapStrikeOptions, GeneralOptions<StrikeOptions> {
5
+ }
6
+ export declare const Strike: import('@tiptap/core').Mark<StrikeOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './Strike';
@@ -0,0 +1,23 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { SubscriptExtensionOptions as TiptapSubscriptOptions } from '@tiptap/extension-subscript';
3
+ import { SuperscriptExtensionOptions as TiptapSuperscriptOptions } from '@tiptap/extension-superscript';
4
+ import { GeneralOptions } from '../../types';
5
+
6
+ /**
7
+ * Represents the interface for subscript and superscript options, extending GeneralOptions.
8
+ */
9
+ export interface SubAndSuperScriptOptions extends GeneralOptions<SubAndSuperScriptOptions> {
10
+ /**
11
+ * subscript options or false, indicating whether subscript is enabled
12
+ *
13
+ * @default true
14
+ */
15
+ subscript: Partial<TiptapSubscriptOptions> | false;
16
+ /**
17
+ * superscript options or false, indicating whether superscript is enabled
18
+ *
19
+ * @default true
20
+ */
21
+ superscript: Partial<TiptapSuperscriptOptions> | false;
22
+ }
23
+ export declare const SubAndSuperScript: Extension<SubAndSuperScriptOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './Subscript';
@@ -0,0 +1,19 @@
1
+ import { Command, Extension } from '@tiptap/core';
2
+ import { Transaction } from '@tiptap/pm/state';
3
+
4
+ export type TableCellBackgroundOptions = {
5
+ HTMLAttributes: Record<string, any>;
6
+ types?: any;
7
+ };
8
+ declare module '@tiptap/core' {
9
+ interface Commands<ReturnType> {
10
+ tableCellBackground: {
11
+ setTableCellBackground: (color: string) => ReturnType;
12
+ unsetTableCellBackground: () => ReturnType;
13
+ };
14
+ }
15
+ }
16
+ export declare const setCellBackgroundMarkup: (tr: Transaction, pos: number, backgroundColor: string) => Transaction;
17
+ export declare const updateCellBackground: (tr: Transaction, options: TableCellBackgroundOptions, backgroundColor: string) => Transaction;
18
+ export declare const createCellBackgroundCommand: (backgroundColor: string, options: TableCellBackgroundOptions) => Command;
19
+ export declare const TableCellBackground: Extension<TableCellBackgroundOptions, any>;
@@ -0,0 +1,6 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ export interface TableCellOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ export declare const TableCell: Node<TableCellOptions, any>;
@@ -0,0 +1,14 @@
1
+ interface IPropsCreateTablePopover {
2
+ createTable: any;
3
+ disabled: any;
4
+ children: any;
5
+ }
6
+ export interface GridSize {
7
+ rows: number;
8
+ cols: number;
9
+ }
10
+ export interface CreateTablePayload extends GridSize {
11
+ withHeaderRow: boolean;
12
+ }
13
+ declare const CreateTablePopover: (props: IPropsCreateTablePopover) => import("react/jsx-runtime").JSX.Element;
14
+ export default CreateTablePopover;
@@ -0,0 +1,13 @@
1
+ import { ButtonViewReturnComponentProps } from '../../../types';
2
+
3
+ interface IPropsTableActionButton {
4
+ editor: any;
5
+ icon?: any;
6
+ tooltip?: string;
7
+ disabled?: boolean;
8
+ color?: string;
9
+ action?: ButtonViewReturnComponentProps['action'];
10
+ isActive?: ButtonViewReturnComponentProps['isActive'];
11
+ }
12
+ declare const TableActionButton: (props: IPropsTableActionButton) => import("react/jsx-runtime").JSX.Element;
13
+ export default TableActionButton;
@@ -0,0 +1,5 @@
1
+ export type TableHeaderOptions = {
2
+ HTMLAttributes: Record<string, any>;
3
+ };
4
+ export declare const TableHeader: import('@tiptap/core').Node<TableHeaderOptions, any>;
5
+ export default TableHeader;
@@ -0,0 +1,6 @@
1
+ export { TableCell, type TableCellOptions } from './cell';
2
+ export type { TableRowOptions } from '@tiptap/extension-table-row';
3
+ export { Table, type TableOptions } from './table';
4
+ export { TableCellBackground, type TableCellBackgroundOptions } from './cell-background';
5
+ export { TableHeader, type TableHeaderOptions } from './header';
6
+ export { TableRow } from './row';
@@ -0,0 +1,5 @@
1
+ interface IPropsTableBubbleMenu {
2
+ editor: any;
3
+ }
4
+ declare const TableBubbleMenu: (props: IPropsTableBubbleMenu) => import("react/jsx-runtime").JSX.Element;
5
+ export default TableBubbleMenu;
@@ -0,0 +1,21 @@
1
+ import { Editor as CoreEditor } from '@tiptap/core';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ import { EditorView } from '@tiptap/pm/view';
4
+
5
+ interface IPropsTableCellMenu {
6
+ editor: any;
7
+ onDeleteTable: () => void;
8
+ onSplitCell: () => void;
9
+ onMergeCell: () => void;
10
+ onSetCellBackground: (color: string) => void;
11
+ }
12
+ export interface ShouldShowProps {
13
+ editor?: CoreEditor;
14
+ view: EditorView;
15
+ state?: EditorState;
16
+ oldState?: EditorState;
17
+ from?: number;
18
+ to?: number;
19
+ }
20
+ declare const TableCellMenu: (props: IPropsTableCellMenu) => import("react/jsx-runtime").JSX.Element;
21
+ export default TableCellMenu;
@@ -0,0 +1,20 @@
1
+ import { Editor as CoreEditor } from '@tiptap/core';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ import { EditorView } from '@tiptap/pm/view';
4
+
5
+ interface IPropsTableColumnMenu {
6
+ editor: any;
7
+ onSplitCell: () => void;
8
+ onMergeCell: () => void;
9
+ onSetCellBackground: (color: string) => void;
10
+ }
11
+ export interface ShouldShowProps {
12
+ editor?: CoreEditor;
13
+ view: EditorView;
14
+ state?: EditorState;
15
+ oldState?: EditorState;
16
+ from?: number;
17
+ to?: number;
18
+ }
19
+ declare const TableColumnMenu: (props: IPropsTableColumnMenu) => import("react/jsx-runtime").JSX.Element;
20
+ export default TableColumnMenu;
@@ -0,0 +1,20 @@
1
+ import { Editor as CoreEditor } from '@tiptap/core';
2
+ import { EditorState } from '@tiptap/pm/state';
3
+ import { EditorView } from '@tiptap/pm/view';
4
+
5
+ interface IPropsTableRowMenu {
6
+ editor: any;
7
+ onSplitCell: () => void;
8
+ onMergeCell: () => void;
9
+ onSetCellBackground: (color: string) => void;
10
+ }
11
+ export interface ShouldShowProps {
12
+ editor?: CoreEditor;
13
+ view: EditorView;
14
+ state?: EditorState;
15
+ oldState?: EditorState;
16
+ from?: number;
17
+ to?: number;
18
+ }
19
+ declare const TableRowMenu: (props: IPropsTableRowMenu) => import("react/jsx-runtime").JSX.Element;
20
+ export default TableRowMenu;
@@ -0,0 +1,2 @@
1
+ export declare const TableRow: import('@tiptap/core').Node<import('@tiptap/extension-table-row').TableRowOptions, any>;
2
+ export default TableRow;
@@ -0,0 +1,24 @@
1
+ import { TableRowOptions } from '@tiptap/extension-table-row';
2
+ import { GeneralOptions } from '../../types';
3
+ import { TableCellOptions } from './cell';
4
+ import { TableCellBackgroundOptions } from './cell-background';
5
+ import { TableHeaderOptions } from './header';
6
+
7
+ export interface TableOptions extends GeneralOptions<TableOptions> {
8
+ HTMLAttributes: Record<string, any>;
9
+ resizable: boolean;
10
+ handleWidth: number;
11
+ cellMinWidth: number;
12
+ lastColumnResizable: boolean;
13
+ allowTableNodeSelection: boolean;
14
+ /** options for table rows */
15
+ tableRow: Partial<TableRowOptions>;
16
+ /** options for table headers */
17
+ tableHeader: Partial<TableHeaderOptions>;
18
+ /** options for table cells */
19
+ tableCell: Partial<TableCellOptions>;
20
+ /** options for table cell background */
21
+ tableCellBackground: Partial<TableCellBackgroundOptions>;
22
+ }
23
+ export declare const Table: import('@tiptap/core').Node<TableOptions, any>;
24
+ export default Table;
@@ -0,0 +1,67 @@
1
+ import { Editor } from '@tiptap/core';
2
+ import { Node, ResolvedPos } from '@tiptap/pm/model';
3
+ import { EditorState, Selection, Transaction } from '@tiptap/pm/state';
4
+ import { CellSelection } from '@tiptap/pm/tables';
5
+ import { EditorView } from '@tiptap/pm/view';
6
+
7
+ export declare const isRectSelected: (rect: any) => (selection: CellSelection) => boolean;
8
+ export declare const findTable: (selection: Selection) => {
9
+ pos: number;
10
+ start: number;
11
+ depth: number;
12
+ node: Node;
13
+ } | undefined;
14
+ export declare const isCellSelection: (selection: any) => boolean;
15
+ export declare const isColumnSelected: (columnIndex: number) => (selection: any) => boolean;
16
+ export declare const isRowSelected: (rowIndex: number) => (selection: any) => boolean;
17
+ export declare const isTableSelected: (selection: any) => boolean;
18
+ export declare const getCellsInColumn: (columnIndex: number | number[]) => (selection: Selection) => any;
19
+ export declare const getCellsInRow: (rowIndex: number | number[]) => (selection: Selection) => {
20
+ pos: number;
21
+ start: number;
22
+ node: Node | null | undefined;
23
+ }[] | null;
24
+ export declare const getCellsInTable: (selection: Selection) => {
25
+ pos: number;
26
+ start: number;
27
+ node: Node | null;
28
+ }[] | null;
29
+ export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate: (node: Node) => boolean) => {
30
+ pos: number;
31
+ start: number;
32
+ depth: number;
33
+ node: Node;
34
+ } | null;
35
+ export declare const findCellClosestToPos: ($pos: ResolvedPos) => {
36
+ pos: number;
37
+ start: number;
38
+ depth: number;
39
+ node: Node;
40
+ } | null;
41
+ export declare const selectColumn: (index: number) => (tr: Transaction) => Transaction;
42
+ export declare const selectRow: (index: number) => (tr: Transaction) => Transaction;
43
+ export declare const selectTable: (tr: Transaction) => Transaction;
44
+ export declare const analyzeCellSelection: (editor: Editor) => {
45
+ isRowSelection: boolean;
46
+ isColSelection: boolean;
47
+ cellCount: number;
48
+ mergedCellCount: number;
49
+ };
50
+ export declare const isTableCellSelected: ({ editor, view, state, from, }: {
51
+ editor: Editor;
52
+ view: EditorView;
53
+ state: EditorState;
54
+ from: number;
55
+ }) => boolean;
56
+ export declare const isColumnGripSelected: ({ editor, view, state, from, }: {
57
+ editor: Editor;
58
+ view: EditorView;
59
+ state: EditorState;
60
+ from: number;
61
+ }) => boolean;
62
+ export declare const isRowGripSelected: ({ editor, view, state, from, }: {
63
+ editor: Editor;
64
+ view: EditorView;
65
+ state: EditorState;
66
+ from: number;
67
+ }) => boolean;
@@ -0,0 +1,12 @@
1
+ import { TaskItemOptions } from '@tiptap/extension-task-item';
2
+ import { TaskListOptions as TiptapTaskListOptions } from '@tiptap/extension-task-list';
3
+ import { GeneralOptions } from '../../types';
4
+
5
+ /**
6
+ * Represents the interface for task list options, extending TiptapTaskListOptions and GeneralOptions.
7
+ */
8
+ export interface TaskListOptions extends TiptapTaskListOptions, GeneralOptions<TaskListOptions> {
9
+ /** options for task items */
10
+ taskItem: Partial<TaskItemOptions>;
11
+ }
12
+ export declare const TaskList: import('@tiptap/core').Node<TaskListOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './TaskList';
@@ -0,0 +1,18 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { TextAlignOptions as TiptapTextAlignOptions } from '@tiptap/extension-text-align';
3
+ import { GeneralOptions } from '../../types';
4
+
5
+ type Alignments = 'left' | 'center' | 'right' | 'justify';
6
+ /**
7
+ * Represents the interface for text align options, extending TiptapTextAlignOptions and GeneralOptions.
8
+ */
9
+ export interface TextAlignOptions extends TiptapTextAlignOptions, GeneralOptions<TextAlignOptions> {
10
+ /**
11
+ * List of available alignment options
12
+ *
13
+ * @default ['left', 'center', 'right', 'justify']
14
+ */
15
+ alignments: Alignments[];
16
+ }
17
+ export declare const TextAlign: Extension<TextAlignOptions, any>;
18
+ export {};
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ import { ButtonViewReturnComponentProps } from '../../../types';
3
+
4
+ interface IPropsTextAlignMenuButton {
5
+ }
6
+ export interface Item {
7
+ title: string;
8
+ icon?: any;
9
+ isActive: NonNullable<ButtonViewReturnComponentProps['isActive']>;
10
+ action?: ButtonViewReturnComponentProps['action'];
11
+ style?: React.CSSProperties;
12
+ shortcutKeys?: string[];
13
+ disabled?: boolean;
14
+ divider?: boolean;
15
+ default?: boolean;
16
+ }
17
+ interface IPropsTextAlignMenuButton {
18
+ editor: any;
19
+ disabled?: boolean;
20
+ color?: string;
21
+ maxHeight?: string | number;
22
+ icon?: any;
23
+ tooltip?: string;
24
+ items?: Item[];
25
+ }
26
+ declare const TextAlignMenuButton: (props: IPropsTextAlignMenuButton) => import("react/jsx-runtime").JSX.Element;
27
+ export default TextAlignMenuButton;
@@ -0,0 +1 @@
1
+ export * from './TextAlign';
@@ -0,0 +1,7 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { GeneralOptions } from '../../types';
3
+
4
+ export interface TextBubbleOptions extends GeneralOptions<TextBubbleOptions> {
5
+ }
6
+ export declare const TextBubble: Extension<TextBubbleOptions, any>;
7
+ export default TextBubble;
@@ -0,0 +1,10 @@
1
+ interface IPropsTextDropdown {
2
+ editor: any;
3
+ disabled?: boolean;
4
+ color?: string;
5
+ maxHeight?: string | number;
6
+ icon?: any;
7
+ tooltip?: string;
8
+ }
9
+ declare const TextDropdown: (props: IPropsTextDropdown) => import("react/jsx-runtime").JSX.Element;
10
+ export default TextDropdown;
@@ -0,0 +1 @@
1
+ export * from './TextBubble';
@@ -0,0 +1,12 @@
1
+ import { Extension } from '@tiptap/core';
2
+
3
+ /**
4
+ * Extension based on:
5
+ * - https://github.com/ueberdosis/tiptap/blob/v1/packages/tiptap-extensions/src/extensions/TrailingNode.js
6
+ * - https://github.com/remirror/remirror/blob/e0f1bec4a1e8073ce8f5500d62193e52321155b9/packages/prosemirror-trailing-node/src/trailing-node-plugin.ts
7
+ */
8
+ export interface TrailingNodeOptions {
9
+ node: string;
10
+ notAfter: string[];
11
+ }
12
+ export declare const TrailingNode: Extension<TrailingNodeOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './TrailingNode';
@@ -0,0 +1,6 @@
1
+ import { UnderlineOptions as TiptapUnderlineOptions } from '@tiptap/extension-underline';
2
+ import { GeneralOptions } from '../../types';
3
+
4
+ export interface UnderlineOptions extends TiptapUnderlineOptions, GeneralOptions<UnderlineOptions> {
5
+ }
6
+ export declare const Underline: import('@tiptap/core').Mark<UnderlineOptions, any>;
@@ -0,0 +1 @@
1
+ export * from './Underline';
@@ -0,0 +1,55 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ /**
4
+ * Represents the interface for video options, extending GeneralOptions.
5
+ */
6
+ export interface VideoOptions {
7
+ /**
8
+ * Indicates whether fullscreen play is allowed
9
+ *
10
+ * @default true
11
+ */
12
+ allowFullscreen: boolean;
13
+ /**
14
+ * Indicates whether to display the frameborder
15
+ *
16
+ * @default false
17
+ */
18
+ frameborder: boolean;
19
+ /**
20
+ * Width of the video, can be a number or string
21
+ *
22
+ * @default VIDEO_SIZE['size-medium']
23
+ */
24
+ width: number | string;
25
+ /** HTML attributes object for passing additional attributes */
26
+ HTMLAttributes: {
27
+ [key: string]: any;
28
+ };
29
+ upload?: (file: File) => Promise<string>;
30
+ }
31
+ /**
32
+ * Represents the type for setting video options
33
+ */
34
+ type SetVideoOptions = {
35
+ /** The source URL of the video */
36
+ src: string;
37
+ /** The width of the video */
38
+ width: string | number;
39
+ };
40
+ declare module '@tiptap/core' {
41
+ interface Commands<ReturnType> {
42
+ video: {
43
+ /**
44
+ * Add an video
45
+ */
46
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
47
+ /**
48
+ * Update an video
49
+ */
50
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
51
+ };
52
+ }
53
+ }
54
+ export declare const Video: Node<VideoOptions, any>;
55
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Video';
@@ -0,0 +1,14 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ export interface VideoOptions {
4
+ upload?: (files: File[]) => void;
5
+ }
6
+ declare module '@tiptap/core' {
7
+ interface Commands<ReturnType> {
8
+ videoUpload: {
9
+ setVideoUpload: () => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const VideoUpload: Node<VideoOptions, any>;
14
+ export default VideoUpload;
@@ -0,0 +1,2 @@
1
+ declare const VideoUploaderView: (props: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default VideoUploaderView;
@@ -0,0 +1 @@
1
+ export * from './VideoUpload';
@@ -0,0 +1,64 @@
1
+ export { Bold } from './Bold';
2
+ export type { BoldOptions } from './Bold';
3
+ export { Italic } from './Italic';
4
+ export type { ItalicOptions } from './Italic';
5
+ export { Underline } from './UnderLine';
6
+ export type { UnderlineOptions } from './UnderLine';
7
+ export { Strike } from './Strike';
8
+ export type { StrikeOptions } from './Strike';
9
+ export { Code } from './Code';
10
+ export type { CodeOptions } from './Code';
11
+ export { CodeBlock } from './CodeBlock';
12
+ export type { CodeBlockOptions } from './CodeBlock';
13
+ export { FontFamily } from './FontFamily';
14
+ export { Heading } from './Heading';
15
+ export type { HeadingOptions } from './Heading';
16
+ export { TextAlign } from './TextAlign';
17
+ export type { TextAlignOptions } from './TextAlign';
18
+ export { FontSize } from './FontSize';
19
+ export type { FontSizeOptions } from './FontSize';
20
+ export { Color } from './Color';
21
+ export type { ColorOptions } from './Color';
22
+ export { Highlight } from './Highlight';
23
+ export type { HighlightOptions } from './Highlight';
24
+ export { BulletList } from './BulletList';
25
+ export type { BulletListOptions } from './BulletList';
26
+ export { Clear } from './Clear';
27
+ export type { ClearOptions } from './Clear';
28
+ export { OrderedList } from './OrderedList';
29
+ export type { OrderedListOptions } from './OrderedList';
30
+ export { TaskList } from './TaskList';
31
+ export type { TaskListOptions } from './TaskList';
32
+ export { Blockquote } from './Blockquote';
33
+ export type { BlockquoteOptions } from './Blockquote';
34
+ export { Link } from './Link';
35
+ export type { LinkOptions } from './Link';
36
+ export { HorizontalRule } from './HorizontalRule';
37
+ export type { HorizontalRuleOptions } from './HorizontalRule';
38
+ export { History } from './History';
39
+ export type { HistoryOptions } from './History';
40
+ export { BaseKit } from './BaseKit';
41
+ export type { BaseKitOptions } from './BaseKit';
42
+ export { SubAndSuperScript } from './Subscript';
43
+ export type { SubAndSuperScriptOptions } from './Subscript';
44
+ export type { MoreMarkOptions } from './MoreMark';
45
+ export { MoreMark } from './MoreMark';
46
+ export { Indent } from './Indent';
47
+ export type { IndentOptions } from './Indent';
48
+ export { LineHeight } from './LineHeight';
49
+ export type { LineHeightOptions } from './LineHeight';
50
+ export { SlashCommand } from './SlashCommand';
51
+ export { Image } from './Image';
52
+ export type { SetImageAttrsOptions } from './Image';
53
+ export { ImageUpload } from './ImageUpload';
54
+ export type { ImageUploadOptions } from './ImageUpload';
55
+ export { Video } from './Video/Video';
56
+ export type { VideoOptions } from './Video';
57
+ export { VideoUpload } from './VideoUpload';
58
+ export { Table } from './Table';
59
+ export type { TableOptions } from './Table';
60
+ export { FormatPainter } from './FormatPainter';
61
+ export type { FormatPainterOptions } from './FormatPainter';
62
+ export { Columns, ColumnToolbar } from './MultiColumn';
63
+ export type { ColumnsOptions } from './MultiColumn';
64
+ export { Iframe } from './Iframe';
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { default as locale } from './locales';
2
+ export * from './extensions';
3
+ export { default } from './components/RcTiptapEditor';
4
+ export { locale };
@@ -0,0 +1,3 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,2 @@
1
+ declare const locale: Record<string, string>;
2
+ export default locale;
@@ -0,0 +1,33 @@
1
+ interface LocaleInterface {
2
+ lang: string;
3
+ message: Record<string, Record<string, string>>;
4
+ }
5
+ export declare const DEFAULT_LOCALE: LocaleInterface;
6
+ declare class Locale {
7
+ private emitter;
8
+ constructor();
9
+ get lang(): string;
10
+ set lang(lang: string);
11
+ get message(): Record<string, Record<string, string>>;
12
+ set message(message: Record<string, Record<string, string>>);
13
+ loadLangMessage(lang: string): Record<string, string>;
14
+ private isLangSupported;
15
+ setLang(lang: string): void;
16
+ registerWatchLang(hook: (lang: string) => void): {
17
+ unsubscribe: () => void;
18
+ };
19
+ setMessage(lang: string, message: Record<string, string>): void;
20
+ buildLocalesHandler(lang?: string): (path: string) => string;
21
+ }
22
+ declare const locale: Locale;
23
+ declare const useLocale: () => {
24
+ lang: string;
25
+ t: (path: string) => string;
26
+ };
27
+ declare const localeActions: {
28
+ t: (path: string) => string;
29
+ };
30
+ export default locale;
31
+ export { Locale, useLocale, localeActions };
32
+ export { default as en } from './en';
33
+ export { default as vi } from './vi';
@@ -0,0 +1,2 @@
1
+ declare const locale: Record<string, string>;
2
+ export default locale;
@@ -0,0 +1,12 @@
1
+ import { Plugin } from '@tiptap/pm/state';
2
+ import { EditorView } from '@tiptap/pm/view';
3
+
4
+ export declare const UploadImagesPlugin: () => Plugin<any>;
5
+ export interface ImageUploadOptions {
6
+ validateFn?: (file: File) => boolean;
7
+ onUpload: (file: File) => Promise<string | object>;
8
+ }
9
+ export type UploadFn = (files: File[], view: EditorView, pos: number) => void;
10
+ export declare const createImageUpload: ({ validateFn, onUpload }: ImageUploadOptions) => UploadFn;
11
+ export declare const handleImagePaste: (view: EditorView, event: ClipboardEvent, uploadFn: UploadFn) => boolean;
12
+ export declare const handleImageDrop: (view: EditorView, event: DragEvent, moved: boolean, uploadFn: UploadFn) => boolean;