react-tiptap-base-editor 1.0.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 (233) hide show
  1. package/README.md +69 -0
  2. package/dist/components/tiptap-icons/align-center-icon.d.ts +3 -0
  3. package/dist/components/tiptap-icons/align-center-icon.d.ts.map +1 -0
  4. package/dist/components/tiptap-icons/align-justify-icon.d.ts +3 -0
  5. package/dist/components/tiptap-icons/align-justify-icon.d.ts.map +1 -0
  6. package/dist/components/tiptap-icons/align-left-icon.d.ts +3 -0
  7. package/dist/components/tiptap-icons/align-left-icon.d.ts.map +1 -0
  8. package/dist/components/tiptap-icons/align-right-icon.d.ts +3 -0
  9. package/dist/components/tiptap-icons/align-right-icon.d.ts.map +1 -0
  10. package/dist/components/tiptap-icons/arrow-left-icon.d.ts +3 -0
  11. package/dist/components/tiptap-icons/arrow-left-icon.d.ts.map +1 -0
  12. package/dist/components/tiptap-icons/ban-icon.d.ts +3 -0
  13. package/dist/components/tiptap-icons/ban-icon.d.ts.map +1 -0
  14. package/dist/components/tiptap-icons/blockquote-icon.d.ts +3 -0
  15. package/dist/components/tiptap-icons/blockquote-icon.d.ts.map +1 -0
  16. package/dist/components/tiptap-icons/bold-icon.d.ts +3 -0
  17. package/dist/components/tiptap-icons/bold-icon.d.ts.map +1 -0
  18. package/dist/components/tiptap-icons/chevron-down-icon.d.ts +3 -0
  19. package/dist/components/tiptap-icons/chevron-down-icon.d.ts.map +1 -0
  20. package/dist/components/tiptap-icons/close-icon.d.ts +3 -0
  21. package/dist/components/tiptap-icons/close-icon.d.ts.map +1 -0
  22. package/dist/components/tiptap-icons/code-block-icon.d.ts +3 -0
  23. package/dist/components/tiptap-icons/code-block-icon.d.ts.map +1 -0
  24. package/dist/components/tiptap-icons/code2-icon.d.ts +3 -0
  25. package/dist/components/tiptap-icons/code2-icon.d.ts.map +1 -0
  26. package/dist/components/tiptap-icons/corner-down-left-icon.d.ts +3 -0
  27. package/dist/components/tiptap-icons/corner-down-left-icon.d.ts.map +1 -0
  28. package/dist/components/tiptap-icons/external-link-icon.d.ts +3 -0
  29. package/dist/components/tiptap-icons/external-link-icon.d.ts.map +1 -0
  30. package/dist/components/tiptap-icons/heading-five-icon.d.ts +3 -0
  31. package/dist/components/tiptap-icons/heading-five-icon.d.ts.map +1 -0
  32. package/dist/components/tiptap-icons/heading-four-icon.d.ts +3 -0
  33. package/dist/components/tiptap-icons/heading-four-icon.d.ts.map +1 -0
  34. package/dist/components/tiptap-icons/heading-icon.d.ts +3 -0
  35. package/dist/components/tiptap-icons/heading-icon.d.ts.map +1 -0
  36. package/dist/components/tiptap-icons/heading-one-icon.d.ts +3 -0
  37. package/dist/components/tiptap-icons/heading-one-icon.d.ts.map +1 -0
  38. package/dist/components/tiptap-icons/heading-six-icon.d.ts +3 -0
  39. package/dist/components/tiptap-icons/heading-six-icon.d.ts.map +1 -0
  40. package/dist/components/tiptap-icons/heading-three-icon.d.ts +3 -0
  41. package/dist/components/tiptap-icons/heading-three-icon.d.ts.map +1 -0
  42. package/dist/components/tiptap-icons/heading-two-icon.d.ts +3 -0
  43. package/dist/components/tiptap-icons/heading-two-icon.d.ts.map +1 -0
  44. package/dist/components/tiptap-icons/highlighter-icon.d.ts +3 -0
  45. package/dist/components/tiptap-icons/highlighter-icon.d.ts.map +1 -0
  46. package/dist/components/tiptap-icons/image-plus-icon.d.ts +3 -0
  47. package/dist/components/tiptap-icons/image-plus-icon.d.ts.map +1 -0
  48. package/dist/components/tiptap-icons/italic-icon.d.ts +3 -0
  49. package/dist/components/tiptap-icons/italic-icon.d.ts.map +1 -0
  50. package/dist/components/tiptap-icons/link-icon.d.ts +3 -0
  51. package/dist/components/tiptap-icons/link-icon.d.ts.map +1 -0
  52. package/dist/components/tiptap-icons/list-icon.d.ts +3 -0
  53. package/dist/components/tiptap-icons/list-icon.d.ts.map +1 -0
  54. package/dist/components/tiptap-icons/list-ordered-icon.d.ts +3 -0
  55. package/dist/components/tiptap-icons/list-ordered-icon.d.ts.map +1 -0
  56. package/dist/components/tiptap-icons/list-todo-icon.d.ts +3 -0
  57. package/dist/components/tiptap-icons/list-todo-icon.d.ts.map +1 -0
  58. package/dist/components/tiptap-icons/moon-star-icon.d.ts +3 -0
  59. package/dist/components/tiptap-icons/moon-star-icon.d.ts.map +1 -0
  60. package/dist/components/tiptap-icons/redo2-icon.d.ts +3 -0
  61. package/dist/components/tiptap-icons/redo2-icon.d.ts.map +1 -0
  62. package/dist/components/tiptap-icons/strike-icon.d.ts +3 -0
  63. package/dist/components/tiptap-icons/strike-icon.d.ts.map +1 -0
  64. package/dist/components/tiptap-icons/subscript-icon.d.ts +3 -0
  65. package/dist/components/tiptap-icons/subscript-icon.d.ts.map +1 -0
  66. package/dist/components/tiptap-icons/sun-icon.d.ts +3 -0
  67. package/dist/components/tiptap-icons/sun-icon.d.ts.map +1 -0
  68. package/dist/components/tiptap-icons/superscript-icon.d.ts +3 -0
  69. package/dist/components/tiptap-icons/superscript-icon.d.ts.map +1 -0
  70. package/dist/components/tiptap-icons/trash-icon.d.ts +3 -0
  71. package/dist/components/tiptap-icons/trash-icon.d.ts.map +1 -0
  72. package/dist/components/tiptap-icons/underline-icon.d.ts +3 -0
  73. package/dist/components/tiptap-icons/underline-icon.d.ts.map +1 -0
  74. package/dist/components/tiptap-icons/undo2-icon.d.ts +3 -0
  75. package/dist/components/tiptap-icons/undo2-icon.d.ts.map +1 -0
  76. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +3 -0
  77. package/dist/components/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts.map +1 -0
  78. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts +59 -0
  79. package/dist/components/tiptap-node/image-upload-node/image-upload-node-extension.d.ts.map +1 -0
  80. package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts +71 -0
  81. package/dist/components/tiptap-node/image-upload-node/image-upload-node.d.ts.map +1 -0
  82. package/dist/components/tiptap-node/image-upload-node/index.d.ts +2 -0
  83. package/dist/components/tiptap-node/image-upload-node/index.d.ts.map +1 -0
  84. package/dist/components/tiptap-templates/simple/simple-editor.d.ts +10 -0
  85. package/dist/components/tiptap-templates/simple/simple-editor.d.ts.map +1 -0
  86. package/dist/components/tiptap-templates/simple/theme-toggle.d.ts +2 -0
  87. package/dist/components/tiptap-templates/simple/theme-toggle.d.ts.map +1 -0
  88. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts +24 -0
  89. package/dist/components/tiptap-ui/blockquote-button/blockquote-button.d.ts.map +1 -0
  90. package/dist/components/tiptap-ui/blockquote-button/index.d.ts +3 -0
  91. package/dist/components/tiptap-ui/blockquote-button/index.d.ts.map +1 -0
  92. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts +82 -0
  93. package/dist/components/tiptap-ui/blockquote-button/use-blockquote.d.ts.map +1 -0
  94. package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts +24 -0
  95. package/dist/components/tiptap-ui/code-block-button/code-block-button.d.ts.map +1 -0
  96. package/dist/components/tiptap-ui/code-block-button/index.d.ts +3 -0
  97. package/dist/components/tiptap-ui/code-block-button/index.d.ts.map +1 -0
  98. package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts +89 -0
  99. package/dist/components/tiptap-ui/code-block-button/use-code-block.d.ts.map +1 -0
  100. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts +25 -0
  101. package/dist/components/tiptap-ui/color-highlight-button/color-highlight-button.d.ts.map +1 -0
  102. package/dist/components/tiptap-ui/color-highlight-button/index.d.ts +3 -0
  103. package/dist/components/tiptap-ui/color-highlight-button/index.d.ts.map +1 -0
  104. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts +61 -0
  105. package/dist/components/tiptap-ui/color-highlight-button/use-color-highlight.d.ts.map +1 -0
  106. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts +27 -0
  107. package/dist/components/tiptap-ui/color-highlight-popover/color-highlight-popover.d.ts.map +1 -0
  108. package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts +2 -0
  109. package/dist/components/tiptap-ui/color-highlight-popover/index.d.ts.map +1 -0
  110. package/dist/components/tiptap-ui/heading-button/heading-button.d.ts +25 -0
  111. package/dist/components/tiptap-ui/heading-button/heading-button.d.ts.map +1 -0
  112. package/dist/components/tiptap-ui/heading-button/index.d.ts +3 -0
  113. package/dist/components/tiptap-ui/heading-button/index.d.ts.map +1 -0
  114. package/dist/components/tiptap-ui/heading-button/use-heading.d.ts +110 -0
  115. package/dist/components/tiptap-ui/heading-button/use-heading.d.ts.map +1 -0
  116. package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +22 -0
  117. package/dist/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts.map +1 -0
  118. package/dist/components/tiptap-ui/heading-dropdown-menu/index.d.ts +3 -0
  119. package/dist/components/tiptap-ui/heading-dropdown-menu/index.d.ts.map +1 -0
  120. package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +75 -0
  121. package/dist/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts.map +1 -0
  122. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts +24 -0
  123. package/dist/components/tiptap-ui/image-upload-button/image-upload-button.d.ts.map +1 -0
  124. package/dist/components/tiptap-ui/image-upload-button/index.d.ts +3 -0
  125. package/dist/components/tiptap-ui/image-upload-button/index.d.ts.map +1 -0
  126. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts +86 -0
  127. package/dist/components/tiptap-ui/image-upload-button/use-image-upload.d.ts.map +1 -0
  128. package/dist/components/tiptap-ui/link-popover/index.d.ts +3 -0
  129. package/dist/components/tiptap-ui/link-popover/index.d.ts.map +1 -0
  130. package/dist/components/tiptap-ui/link-popover/link-popover.d.ts +59 -0
  131. package/dist/components/tiptap-ui/link-popover/link-popover.d.ts.map +1 -0
  132. package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts +119 -0
  133. package/dist/components/tiptap-ui/link-popover/use-link-popover.d.ts.map +1 -0
  134. package/dist/components/tiptap-ui/list-button/index.d.ts +3 -0
  135. package/dist/components/tiptap-ui/list-button/index.d.ts.map +1 -0
  136. package/dist/components/tiptap-ui/list-button/list-button.d.ts +25 -0
  137. package/dist/components/tiptap-ui/list-button/list-button.d.ts.map +1 -0
  138. package/dist/components/tiptap-ui/list-button/use-list.d.ts +99 -0
  139. package/dist/components/tiptap-ui/list-button/use-list.d.ts.map +1 -0
  140. package/dist/components/tiptap-ui/list-dropdown-menu/index.d.ts +2 -0
  141. package/dist/components/tiptap-ui/list-dropdown-menu/index.d.ts.map +1 -0
  142. package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.d.ts +30 -0
  143. package/dist/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.d.ts.map +1 -0
  144. package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +92 -0
  145. package/dist/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts.map +1 -0
  146. package/dist/components/tiptap-ui/mark-button/index.d.ts +3 -0
  147. package/dist/components/tiptap-ui/mark-button/index.d.ts.map +1 -0
  148. package/dist/components/tiptap-ui/mark-button/mark-button.d.ts +25 -0
  149. package/dist/components/tiptap-ui/mark-button/mark-button.d.ts.map +1 -0
  150. package/dist/components/tiptap-ui/mark-button/use-mark.d.ts +106 -0
  151. package/dist/components/tiptap-ui/mark-button/use-mark.d.ts.map +1 -0
  152. package/dist/components/tiptap-ui/text-align-button/index.d.ts +3 -0
  153. package/dist/components/tiptap-ui/text-align-button/index.d.ts.map +1 -0
  154. package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts +32 -0
  155. package/dist/components/tiptap-ui/text-align-button/text-align-button.d.ts.map +1 -0
  156. package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts +104 -0
  157. package/dist/components/tiptap-ui/text-align-button/use-text-align.d.ts.map +1 -0
  158. package/dist/components/tiptap-ui/undo-redo-button/index.d.ts +3 -0
  159. package/dist/components/tiptap-ui/undo-redo-button/index.d.ts.map +1 -0
  160. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts +25 -0
  161. package/dist/components/tiptap-ui/undo-redo-button/undo-redo-button.d.ts.map +1 -0
  162. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts +92 -0
  163. package/dist/components/tiptap-ui/undo-redo-button/use-undo-redo.d.ts.map +1 -0
  164. package/dist/components/tiptap-ui-primitive/badge/badge.d.ts +13 -0
  165. package/dist/components/tiptap-ui-primitive/badge/badge.d.ts.map +1 -0
  166. package/dist/components/tiptap-ui-primitive/badge/index.d.ts +2 -0
  167. package/dist/components/tiptap-ui-primitive/badge/index.d.ts.map +1 -0
  168. package/dist/components/tiptap-ui-primitive/button/button.d.ts +19 -0
  169. package/dist/components/tiptap-ui-primitive/button/button.d.ts.map +1 -0
  170. package/dist/components/tiptap-ui-primitive/button/index.d.ts +2 -0
  171. package/dist/components/tiptap-ui-primitive/button/index.d.ts.map +1 -0
  172. package/dist/components/tiptap-ui-primitive/card/card.d.ts +12 -0
  173. package/dist/components/tiptap-ui-primitive/card/card.d.ts.map +1 -0
  174. package/dist/components/tiptap-ui-primitive/card/index.d.ts +2 -0
  175. package/dist/components/tiptap-ui-primitive/card/index.d.ts.map +1 -0
  176. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts +19 -0
  177. package/dist/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.d.ts.map +1 -0
  178. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts +2 -0
  179. package/dist/components/tiptap-ui-primitive/dropdown-menu/index.d.ts.map +1 -0
  180. package/dist/components/tiptap-ui-primitive/input/index.d.ts +2 -0
  181. package/dist/components/tiptap-ui-primitive/input/index.d.ts.map +1 -0
  182. package/dist/components/tiptap-ui-primitive/input/input.d.ts +6 -0
  183. package/dist/components/tiptap-ui-primitive/input/input.d.ts.map +1 -0
  184. package/dist/components/tiptap-ui-primitive/popover/index.d.ts +2 -0
  185. package/dist/components/tiptap-ui-primitive/popover/index.d.ts.map +1 -0
  186. package/dist/components/tiptap-ui-primitive/popover/popover.d.ts +8 -0
  187. package/dist/components/tiptap-ui-primitive/popover/popover.d.ts.map +1 -0
  188. package/dist/components/tiptap-ui-primitive/separator/index.d.ts +2 -0
  189. package/dist/components/tiptap-ui-primitive/separator/index.d.ts.map +1 -0
  190. package/dist/components/tiptap-ui-primitive/separator/separator.d.ts +9 -0
  191. package/dist/components/tiptap-ui-primitive/separator/separator.d.ts.map +1 -0
  192. package/dist/components/tiptap-ui-primitive/spacer/index.d.ts +2 -0
  193. package/dist/components/tiptap-ui-primitive/spacer/index.d.ts.map +1 -0
  194. package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts +8 -0
  195. package/dist/components/tiptap-ui-primitive/spacer/spacer.d.ts.map +1 -0
  196. package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts +2 -0
  197. package/dist/components/tiptap-ui-primitive/toolbar/index.d.ts.map +1 -0
  198. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts +11 -0
  199. package/dist/components/tiptap-ui-primitive/toolbar/toolbar.d.ts.map +1 -0
  200. package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts +2 -0
  201. package/dist/components/tiptap-ui-primitive/tooltip/index.d.ts.map +1 -0
  202. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts +31 -0
  203. package/dist/components/tiptap-ui-primitive/tooltip/tooltip.d.ts.map +1 -0
  204. package/dist/hooks/use-composed-ref.d.ts +5 -0
  205. package/dist/hooks/use-composed-ref.d.ts.map +1 -0
  206. package/dist/hooks/use-cursor-visibility.d.ts +21 -0
  207. package/dist/hooks/use-cursor-visibility.d.ts.map +1 -0
  208. package/dist/hooks/use-element-rect.d.ts +37 -0
  209. package/dist/hooks/use-element-rect.d.ts.map +1 -0
  210. package/dist/hooks/use-menu-navigation.d.ts +54 -0
  211. package/dist/hooks/use-menu-navigation.d.ts.map +1 -0
  212. package/dist/hooks/use-mobile.d.ts +2 -0
  213. package/dist/hooks/use-mobile.d.ts.map +1 -0
  214. package/dist/hooks/use-scrolling.d.ts +9 -0
  215. package/dist/hooks/use-scrolling.d.ts.map +1 -0
  216. package/dist/hooks/use-throttled-callback.d.ts +20 -0
  217. package/dist/hooks/use-throttled-callback.d.ts.map +1 -0
  218. package/dist/hooks/use-tiptap-editor.d.ts +18 -0
  219. package/dist/hooks/use-tiptap-editor.d.ts.map +1 -0
  220. package/dist/hooks/use-unmount.d.ts +8 -0
  221. package/dist/hooks/use-unmount.d.ts.map +1 -0
  222. package/dist/hooks/use-window-size.d.ts +36 -0
  223. package/dist/hooks/use-window-size.d.ts.map +1 -0
  224. package/dist/index.cjs +2 -0
  225. package/dist/index.cjs.map +1 -0
  226. package/dist/index.d.ts +18 -0
  227. package/dist/index.d.ts.map +1 -0
  228. package/dist/index.js +5929 -0
  229. package/dist/index.js.map +1 -0
  230. package/dist/lib/tiptap-utils.d.ts +123 -0
  231. package/dist/lib/tiptap-utils.d.ts.map +1 -0
  232. package/dist/styles/index.css +1 -0
  233. package/package.json +62 -0
@@ -0,0 +1,92 @@
1
+ import * as React from "react";
2
+ import type { Editor } from "@tiptap/react";
3
+ import { type ListType } from "@/components/tiptap-ui/list-button";
4
+ /**
5
+ * Configuration for the list dropdown menu functionality
6
+ */
7
+ export interface UseListDropdownMenuConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * The list types to display in the dropdown.
14
+ * @default ["bulletList", "orderedList", "taskList"]
15
+ */
16
+ types?: ListType[];
17
+ /**
18
+ * Whether the dropdown should be hidden when no list types are available
19
+ * @default false
20
+ */
21
+ hideWhenUnavailable?: boolean;
22
+ }
23
+ export interface ListOption {
24
+ label: string;
25
+ type: ListType;
26
+ icon: React.ElementType;
27
+ }
28
+ export declare const listOptions: ListOption[];
29
+ export declare function canToggleAnyList(editor: Editor | null, listTypes: ListType[]): boolean;
30
+ export declare function isAnyListActive(editor: Editor | null, listTypes: ListType[]): boolean;
31
+ export declare function getFilteredListOptions(availableTypes: ListType[]): typeof listOptions;
32
+ export declare function shouldShowListDropdown(params: {
33
+ editor: Editor | null;
34
+ listTypes: ListType[];
35
+ hideWhenUnavailable: boolean;
36
+ listInSchema: boolean;
37
+ canToggleAny: boolean;
38
+ }): boolean;
39
+ /**
40
+ * Gets the currently active list type from the available types
41
+ */
42
+ export declare function getActiveListType(editor: Editor | null, availableTypes: ListType[]): ListType | undefined;
43
+ /**
44
+ * Custom hook that provides list dropdown menu functionality for Tiptap editor
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * // Simple usage
49
+ * function MyListDropdown() {
50
+ * const {
51
+ * isVisible,
52
+ * activeType,
53
+ * isAnyActive,
54
+ * canToggleAny,
55
+ * filteredLists,
56
+ * } = useListDropdownMenu()
57
+ *
58
+ * if (!isVisible) return null
59
+ *
60
+ * return (
61
+ * <DropdownMenu>
62
+ * // dropdown content
63
+ * </DropdownMenu>
64
+ * )
65
+ * }
66
+ *
67
+ * // Advanced usage with configuration
68
+ * function MyAdvancedListDropdown() {
69
+ * const {
70
+ * isVisible,
71
+ * activeType,
72
+ * } = useListDropdownMenu({
73
+ * editor: myEditor,
74
+ * types: ["bulletList", "orderedList"],
75
+ * hideWhenUnavailable: true,
76
+ * })
77
+ *
78
+ * // component implementation
79
+ * }
80
+ * ```
81
+ */
82
+ export declare function useListDropdownMenu(config?: UseListDropdownMenuConfig): {
83
+ isVisible: boolean;
84
+ activeType: ListType | undefined;
85
+ isActive: boolean;
86
+ canToggle: boolean;
87
+ types: ListType[];
88
+ filteredLists: ListOption[];
89
+ label: string;
90
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
91
+ };
92
+ //# sourceMappingURL=use-list-dropdown-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-list-dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAc3C,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,oCAAoC,CAAA;AAE3C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;IAClB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,KAAK,CAAC,WAAW,CAAA;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,UAAU,EAgBnC,CAAA;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAGT;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAGT;AAED,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,QAAQ,EAAE,GACzB,OAAO,WAAW,CAIpB;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,SAAS,EAAE,QAAQ,EAAE,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,YAAY,EAAE,OAAO,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;CACtB,GAAG,OAAO,CAYV;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,cAAc,EAAE,QAAQ,EAAE,GACzB,QAAQ,GAAG,SAAS,CAGtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,yBAAyB;;;;;;;;;EAwDrE"}
@@ -0,0 +1,3 @@
1
+ export * from "./mark-button";
2
+ export * from "./use-mark";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/mark-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import type { Mark, UseMarkConfig } from "@/components/tiptap-ui/mark-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface MarkButtonProps extends Omit<ButtonProps, "type">, UseMarkConfig {
5
+ /**
6
+ * Optional text to display alongside the icon.
7
+ */
8
+ text?: string;
9
+ /**
10
+ * Optional show shortcut keys in the button.
11
+ * @default false
12
+ */
13
+ showShortcut?: boolean;
14
+ }
15
+ export declare function MarkShortcutBadge({ type, shortcutKeys, }: {
16
+ type: Mark;
17
+ shortcutKeys?: string;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Button component for toggling marks in a Tiptap editor.
21
+ *
22
+ * For custom button implementations, use the `useMark` hook instead.
23
+ */
24
+ export declare const MarkButton: React.ForwardRefExoticComponent<MarkButtonProps & React.RefAttributes<HTMLButtonElement>>;
25
+ //# sourceMappingURL=mark-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mark-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/mark-button/mark-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAI7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,aAAa;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,YAAuC,GACxC,EAAE;IACD,IAAI,EAAE,IAAI,CAAA;IACV,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,2FAwEtB,CAAA"}
@@ -0,0 +1,106 @@
1
+ import * as React from "react";
2
+ import type { Editor } from "@tiptap/react";
3
+ export type Mark = "bold" | "italic" | "strike" | "code" | "underline" | "superscript" | "subscript";
4
+ /**
5
+ * Configuration for the mark functionality
6
+ */
7
+ export interface UseMarkConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * The type of mark to toggle
14
+ */
15
+ type: Mark;
16
+ /**
17
+ * Whether the button should hide when mark is not available.
18
+ * @default false
19
+ */
20
+ hideWhenUnavailable?: boolean;
21
+ /**
22
+ * Callback function called after a successful mark toggle.
23
+ */
24
+ onToggled?: () => void;
25
+ }
26
+ export declare const markIcons: {
27
+ bold: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
28
+ italic: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
29
+ underline: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
30
+ strike: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
31
+ code: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
32
+ superscript: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
33
+ subscript: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
34
+ };
35
+ export declare const MARK_SHORTCUT_KEYS: Record<Mark, string>;
36
+ /**
37
+ * Checks if a mark can be toggled in the current editor state
38
+ */
39
+ export declare function canToggleMark(editor: Editor | null, type: Mark): boolean;
40
+ /**
41
+ * Checks if a mark is currently active
42
+ */
43
+ export declare function isMarkActive(editor: Editor | null, type: Mark): boolean;
44
+ /**
45
+ * Toggles a mark in the editor
46
+ */
47
+ export declare function toggleMark(editor: Editor | null, type: Mark): boolean;
48
+ /**
49
+ * Determines if the mark button should be shown
50
+ */
51
+ export declare function shouldShowButton(props: {
52
+ editor: Editor | null;
53
+ type: Mark;
54
+ hideWhenUnavailable: boolean;
55
+ }): boolean;
56
+ /**
57
+ * Gets the formatted mark name
58
+ */
59
+ export declare function getFormattedMarkName(type: Mark): string;
60
+ /**
61
+ * Custom hook that provides mark functionality for Tiptap editor
62
+ *
63
+ * @example
64
+ * ```tsx
65
+ * // Simple usage
66
+ * function MySimpleBoldButton() {
67
+ * const { isVisible, handleMark } = useMark({ type: "bold" })
68
+ *
69
+ * if (!isVisible) return null
70
+ *
71
+ * return <button onClick={handleMark}>Bold</button>
72
+ * }
73
+ *
74
+ * // Advanced usage with configuration
75
+ * function MyAdvancedItalicButton() {
76
+ * const { isVisible, handleMark, label, isActive } = useMark({
77
+ * editor: myEditor,
78
+ * type: "italic",
79
+ * hideWhenUnavailable: true,
80
+ * onToggled: () => console.log('Mark toggled!')
81
+ * })
82
+ *
83
+ * if (!isVisible) return null
84
+ *
85
+ * return (
86
+ * <MyButton
87
+ * onClick={handleMark}
88
+ * aria-pressed={isActive}
89
+ * aria-label={label}
90
+ * >
91
+ * Italic
92
+ * </MyButton>
93
+ * )
94
+ * }
95
+ * ```
96
+ */
97
+ export declare function useMark(config: UseMarkConfig): {
98
+ isVisible: boolean;
99
+ isActive: boolean;
100
+ handleMark: () => boolean;
101
+ canToggle: boolean;
102
+ label: string;
103
+ shortcutKeys: string;
104
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
105
+ };
106
+ //# sourceMappingURL=use-mark.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-mark.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/mark-button/use-mark.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAiB3C,MAAM,MAAM,IAAI,GACZ,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,WAAW,GACX,aAAa,GACb,WAAW,CAAA;AAEf;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,IAAI,CAAA;IACV;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,eAAO,MAAM,SAAS;;;;;;;;CAQrB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAQnD,CAAA;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAMxE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAGvE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAKrE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,EAAE,IAAI,CAAA;IACV,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAWV;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa;;;;;;;;EAgD5C"}
@@ -0,0 +1,3 @@
1
+ export * from "./text-align-button";
2
+ export * from "./use-text-align";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/text-align-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ import type { TextAlign, UseTextAlignConfig } from "@/components/tiptap-ui/text-align-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ type IconProps = React.SVGProps<SVGSVGElement>;
5
+ type IconComponent = ({ className, ...props }: IconProps) => React.ReactElement;
6
+ export interface TextAlignButtonProps extends Omit<ButtonProps, "type">, UseTextAlignConfig {
7
+ /**
8
+ * Optional text to display alongside the icon.
9
+ */
10
+ text?: string;
11
+ /**
12
+ * Optional show shortcut keys in the button.
13
+ * @default false
14
+ */
15
+ showShortcut?: boolean;
16
+ /**
17
+ * Optional custom icon component to render instead of the default.
18
+ */
19
+ icon?: React.MemoExoticComponent<IconComponent> | React.FC<IconProps>;
20
+ }
21
+ export declare function TextAlignShortcutBadge({ align, shortcutKeys, }: {
22
+ align: TextAlign;
23
+ shortcutKeys?: string;
24
+ }): import("react/jsx-runtime").JSX.Element;
25
+ /**
26
+ * Button component for setting text alignment in a Tiptap editor.
27
+ *
28
+ * For custom button implementations, use the `useTextAlign` hook instead.
29
+ */
30
+ export declare const TextAlignButton: React.ForwardRefExoticComponent<TextAlignButtonProps & React.RefAttributes<HTMLButtonElement>>;
31
+ export {};
32
+ //# sourceMappingURL=text-align-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-align-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/text-align-button/text-align-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EACnB,MAAM,0CAA0C,CAAA;AAOjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,KAAK,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;AAC9C,KAAK,aAAa,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,KAAK,KAAK,CAAC,YAAY,CAAA;AAE/E,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,kBAAkB;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,mBAAmB,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAA;CACtE;AAED,wBAAgB,sBAAsB,CAAC,EACrC,KAAK,EACL,YAA8C,GAC/C,EAAE;IACD,KAAK,EAAE,SAAS,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,gGAiF3B,CAAA"}
@@ -0,0 +1,104 @@
1
+ import * as React from "react";
2
+ import type { ChainedCommands } from "@tiptap/react";
3
+ import { type Editor } from "@tiptap/react";
4
+ export type TextAlign = "left" | "center" | "right" | "justify";
5
+ /**
6
+ * Configuration for the text align functionality
7
+ */
8
+ export interface UseTextAlignConfig {
9
+ /**
10
+ * The Tiptap editor instance.
11
+ */
12
+ editor?: Editor | null;
13
+ /**
14
+ * The text alignment to apply.
15
+ */
16
+ align: TextAlign;
17
+ /**
18
+ * Whether the button should hide when alignment is not available.
19
+ * @default false
20
+ */
21
+ hideWhenUnavailable?: boolean;
22
+ /**
23
+ * Callback function called after a successful alignment change.
24
+ */
25
+ onAligned?: () => void;
26
+ }
27
+ export declare const TEXT_ALIGN_SHORTCUT_KEYS: Record<TextAlign, string>;
28
+ export declare const textAlignIcons: {
29
+ left: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
30
+ center: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
31
+ right: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
32
+ justify: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
33
+ };
34
+ export declare const textAlignLabels: Record<TextAlign, string>;
35
+ /**
36
+ * Checks if text alignment can be performed in the current editor state
37
+ */
38
+ export declare function canSetTextAlign(editor: Editor | null, align: TextAlign): boolean;
39
+ export declare function hasSetTextAlign(commands: ChainedCommands): commands is ChainedCommands & {
40
+ setTextAlign: (align: TextAlign) => ChainedCommands;
41
+ };
42
+ /**
43
+ * Checks if the text alignment is currently active
44
+ */
45
+ export declare function isTextAlignActive(editor: Editor | null, align: TextAlign): boolean;
46
+ /**
47
+ * Sets text alignment in the editor
48
+ */
49
+ export declare function setTextAlign(editor: Editor | null, align: TextAlign): boolean;
50
+ /**
51
+ * Determines if the text align button should be shown
52
+ */
53
+ export declare function shouldShowButton(props: {
54
+ editor: Editor | null;
55
+ hideWhenUnavailable: boolean;
56
+ align: TextAlign;
57
+ }): boolean;
58
+ /**
59
+ * Custom hook that provides text align functionality for Tiptap editor
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * // Simple usage
64
+ * function MySimpleAlignButton() {
65
+ * const { isVisible, handleTextAlign } = useTextAlign({ align: "center" })
66
+ *
67
+ * if (!isVisible) return null
68
+ *
69
+ * return <button onClick={handleTextAlign}>Align Center</button>
70
+ * }
71
+ *
72
+ * // Advanced usage with configuration
73
+ * function MyAdvancedAlignButton() {
74
+ * const { isVisible, handleTextAlign, label, isActive } = useTextAlign({
75
+ * editor: myEditor,
76
+ * align: "right",
77
+ * hideWhenUnavailable: true,
78
+ * onAligned: () => console.log('Text aligned!')
79
+ * })
80
+ *
81
+ * if (!isVisible) return null
82
+ *
83
+ * return (
84
+ * <MyButton
85
+ * onClick={handleTextAlign}
86
+ * aria-pressed={isActive}
87
+ * aria-label={label}
88
+ * >
89
+ * Align Right
90
+ * </MyButton>
91
+ * )
92
+ * }
93
+ * ```
94
+ */
95
+ export declare function useTextAlign(config: UseTextAlignConfig): {
96
+ isVisible: boolean;
97
+ isActive: boolean;
98
+ handleTextAlign: () => boolean;
99
+ canAlign: boolean;
100
+ label: string;
101
+ shortcutKeys: string;
102
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
103
+ };
104
+ //# sourceMappingURL=use-text-align.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-text-align.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/text-align-button/use-text-align.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAiB3C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAA;IAChB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAK9D,CAAA;AAED,eAAO,MAAM,cAAc;;;;;CAK1B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAKrD,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,EAAE,SAAS,GACf,OAAO,CAST;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,GACxB,QAAQ,IAAI,eAAe,GAAG;IAC/B,YAAY,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,eAAe,CAAA;CACpD,CAEA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,EAAE,SAAS,GACf,OAAO,CAGT;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAU7E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,KAAK,EAAE,SAAS,CAAA;CACjB,GAAG,OAAO,CAWV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB;;;;;;;;EAgDtD"}
@@ -0,0 +1,3 @@
1
+ export * from "./undo-redo-button";
2
+ export * from "./use-undo-redo";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/undo-redo-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import type { UndoRedoAction, UseUndoRedoConfig } from "@/components/tiptap-ui/undo-redo-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface UndoRedoButtonProps extends Omit<ButtonProps, "type">, UseUndoRedoConfig {
5
+ /**
6
+ * Optional text to display alongside the icon.
7
+ */
8
+ text?: string;
9
+ /**
10
+ * Optional show shortcut keys in the button.
11
+ * @default false
12
+ */
13
+ showShortcut?: boolean;
14
+ }
15
+ export declare function HistoryShortcutBadge({ action, shortcutKeys, }: {
16
+ action: UndoRedoAction;
17
+ shortcutKeys?: string;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Button component for triggering undo/redo actions in a Tiptap editor.
21
+ *
22
+ * For custom button implementations, use the `useHistory` hook instead.
23
+ */
24
+ export declare const UndoRedoButton: React.ForwardRefExoticComponent<UndoRedoButtonProps & React.RefAttributes<HTMLButtonElement>>;
25
+ //# sourceMappingURL=undo-redo-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undo-redo-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EAClB,MAAM,yCAAyC,CAAA;AAOhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,MAAM,WAAW,mBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,iBAAiB;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,YAA8C,GAC/C,EAAE;IACD,MAAM,EAAE,cAAc,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,+FAqE1B,CAAA"}
@@ -0,0 +1,92 @@
1
+ import * as React from "react";
2
+ import { type Editor } from "@tiptap/react";
3
+ export type UndoRedoAction = "undo" | "redo";
4
+ /**
5
+ * Configuration for the history functionality
6
+ */
7
+ export interface UseUndoRedoConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * The history action to perform (undo or redo).
14
+ */
15
+ action: UndoRedoAction;
16
+ /**
17
+ * Whether the button should hide when action is not available.
18
+ * @default false
19
+ */
20
+ hideWhenUnavailable?: boolean;
21
+ /**
22
+ * Callback function called after a successful action execution.
23
+ */
24
+ onExecuted?: () => void;
25
+ }
26
+ export declare const UNDO_REDO_SHORTCUT_KEYS: Record<UndoRedoAction, string>;
27
+ export declare const historyActionLabels: Record<UndoRedoAction, string>;
28
+ export declare const historyIcons: {
29
+ undo: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
30
+ redo: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
31
+ };
32
+ /**
33
+ * Checks if a history action can be executed
34
+ */
35
+ export declare function canExecuteUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean;
36
+ /**
37
+ * Executes a history action on the editor
38
+ */
39
+ export declare function executeUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean;
40
+ /**
41
+ * Determines if the history button should be shown
42
+ */
43
+ export declare function shouldShowButton(props: {
44
+ editor: Editor | null;
45
+ hideWhenUnavailable: boolean;
46
+ action: UndoRedoAction;
47
+ }): boolean;
48
+ /**
49
+ * Custom hook that provides history functionality for Tiptap editor
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * // Simple usage
54
+ * function MySimpleUndoButton() {
55
+ * const { isVisible, handleAction } = useHistory({ action: "undo" })
56
+ *
57
+ * if (!isVisible) return null
58
+ *
59
+ * return <button onClick={handleAction}>Undo</button>
60
+ * }
61
+ *
62
+ * // Advanced usage with configuration
63
+ * function MyAdvancedRedoButton() {
64
+ * const { isVisible, handleAction, label } = useHistory({
65
+ * editor: myEditor,
66
+ * action: "redo",
67
+ * hideWhenUnavailable: true,
68
+ * onExecuted: () => console.log('Action executed!')
69
+ * })
70
+ *
71
+ * if (!isVisible) return null
72
+ *
73
+ * return (
74
+ * <MyButton
75
+ * onClick={handleAction}
76
+ * aria-label={label}
77
+ * >
78
+ * Redo
79
+ * </MyButton>
80
+ * )
81
+ * }
82
+ * ```
83
+ */
84
+ export declare function useUndoRedo(config: UseUndoRedoConfig): {
85
+ isVisible: boolean;
86
+ handleAction: () => boolean;
87
+ canExecute: boolean;
88
+ label: string;
89
+ shortcutKeys: string;
90
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element> | React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
91
+ };
92
+ //# sourceMappingURL=use-undo-redo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-undo-redo.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/undo-redo-button/use-undo-redo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAY3C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,MAAM,EAAE,cAAc,CAAA;IACtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAGlE,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAG9D,CAAA;AAED,eAAO,MAAM,YAAY;;;CAGxB,CAAA;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,MAAM,EAAE,cAAc,GACrB,OAAO,CAKT;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,MAAM,EAAE,cAAc,GACrB,OAAO,CAMT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;IAC5B,MAAM,EAAE,cAAc,CAAA;CACvB,GAAG,OAAO,CAUV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,iBAAiB;;;;;;;EA8CpD"}
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import "@/components/tiptap-ui-primitive/badge/badge-colors.scss";
3
+ import "@/components/tiptap-ui-primitive/badge/badge-group.scss";
4
+ import "@/components/tiptap-ui-primitive/badge/badge.scss";
5
+ export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
6
+ variant?: "ghost" | "white" | "gray" | "green" | "default";
7
+ size?: "default" | "small";
8
+ appearance?: "default" | "subdued" | "emphasized";
9
+ trimText?: boolean;
10
+ }
11
+ export declare const Badge: React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLDivElement>>;
12
+ export default Badge;
13
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,0DAA0D,CAAA;AACjE,OAAO,yDAAyD,CAAA;AAChE,OAAO,mDAAmD,CAAA;AAE1D,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;IAC1D,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC1B,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,YAAY,CAAA;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,KAAK,mFA2BjB,CAAA;AAID,eAAe,KAAK,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./badge";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/badge/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import "@/components/tiptap-ui-primitive/button/button-colors.scss";
3
+ import "@/components/tiptap-ui-primitive/button/button-group.scss";
4
+ import "@/components/tiptap-ui-primitive/button/button.scss";
5
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ className?: string;
7
+ showTooltip?: boolean;
8
+ tooltip?: React.ReactNode;
9
+ shortcutKeys?: string;
10
+ }
11
+ export declare const ShortcutDisplay: React.FC<{
12
+ shortcuts: string[];
13
+ }>;
14
+ export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
15
+ export declare const ButtonGroup: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
16
+ orientation?: "horizontal" | "vertical";
17
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
18
+ export default Button;
19
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,OAAO,4DAA4D,CAAA;AACnE,OAAO,2DAA2D,CAAA;AAClE,OAAO,qDAAqD,CAAA;AAE5D,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAe7D,CAAA;AAED,eAAO,MAAM,MAAM,uFAgDlB,CAAA;AAID,eAAO,MAAM,WAAW;kBAGN,YAAY,GAAG,UAAU;gDAczC,CAAA;AAGF,eAAe,MAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./button";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ import "@/components/tiptap-ui-primitive/card/card.scss";
3
+ declare const Card: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardBody: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardItemGroup: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
7
+ orientation?: "horizontal" | "vertical";
8
+ }, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const CardGroupLabel: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const CardFooter: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ export { Card, CardHeader, CardFooter, CardBody, CardItemGroup, CardGroupLabel };
12
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/card/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,iDAAiD,CAAA;AAExD,QAAA,MAAM,IAAI,mKAIT,CAAA;AAGD,QAAA,MAAM,UAAU,mKAOd,CAAA;AAGF,QAAA,MAAM,QAAQ,mKAMb,CAAA;AAGD,QAAA,MAAM,aAAa;kBAGD,YAAY,GAAG,UAAU;gDAWzC,CAAA;AAGF,QAAA,MAAM,cAAc,mKAWlB,CAAA;AAGF,QAAA,MAAM,UAAU,mKAOd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./card";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui-primitive/card/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}