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,24 @@
1
+ import * as React from "react";
2
+ import type { UseBlockquoteConfig } from "@/components/tiptap-ui/blockquote-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface BlockquoteButtonProps extends Omit<ButtonProps, "type">, UseBlockquoteConfig {
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 BlockquoteShortcutBadge({ shortcutKeys, }: {
16
+ shortcutKeys?: string;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Button component for toggling blockquote in a Tiptap editor.
20
+ *
21
+ * For custom button implementations, use the `useBlockquote` hook instead.
22
+ */
23
+ export declare const BlockquoteButton: React.ForwardRefExoticComponent<BlockquoteButtonProps & React.RefAttributes<HTMLButtonElement>>;
24
+ //# sourceMappingURL=blockquote-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockquote-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/blockquote-button/blockquote-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAA;AAanF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,mBAAmB;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,uBAAuB,CAAC,EACtC,YAAsC,GACvC,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,iGAyE5B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./blockquote-button";
2
+ export * from "./use-blockquote";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/blockquote-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,82 @@
1
+ import * as React from "react";
2
+ import type { Editor } from "@tiptap/react";
3
+ export declare const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
4
+ /**
5
+ * Configuration for the blockquote functionality
6
+ */
7
+ export interface UseBlockquoteConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * Whether the button should hide when blockquote is not available.
14
+ * @default false
15
+ */
16
+ hideWhenUnavailable?: boolean;
17
+ /**
18
+ * Callback function called after a successful toggle.
19
+ */
20
+ onToggled?: () => void;
21
+ }
22
+ /**
23
+ * Checks if blockquote can be toggled in the current editor state
24
+ */
25
+ export declare function canToggleBlockquote(editor: Editor | null, turnInto?: boolean): boolean;
26
+ /**
27
+ * Toggles blockquote formatting for a specific node or the current selection
28
+ */
29
+ export declare function toggleBlockquote(editor: Editor | null): boolean;
30
+ /**
31
+ * Determines if the blockquote button should be shown
32
+ */
33
+ export declare function shouldShowButton(props: {
34
+ editor: Editor | null;
35
+ hideWhenUnavailable: boolean;
36
+ }): boolean;
37
+ /**
38
+ * Custom hook that provides blockquote functionality for Tiptap editor
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * // Simple usage - no params needed
43
+ * function MySimpleBlockquoteButton() {
44
+ * const { isVisible, handleToggle, isActive } = useBlockquote()
45
+ *
46
+ * if (!isVisible) return null
47
+ *
48
+ * return <button onClick={handleToggle}>Blockquote</button>
49
+ * }
50
+ *
51
+ * // Advanced usage with configuration
52
+ * function MyAdvancedBlockquoteButton() {
53
+ * const { isVisible, handleToggle, label, isActive } = useBlockquote({
54
+ * editor: myEditor,
55
+ * hideWhenUnavailable: true,
56
+ * onToggled: () => console.log('Blockquote toggled!')
57
+ * })
58
+ *
59
+ * if (!isVisible) return null
60
+ *
61
+ * return (
62
+ * <MyButton
63
+ * onClick={handleToggle}
64
+ * aria-label={label}
65
+ * aria-pressed={isActive}
66
+ * >
67
+ * Toggle Blockquote
68
+ * </MyButton>
69
+ * )
70
+ * }
71
+ * ```
72
+ */
73
+ export declare function useBlockquote(config?: UseBlockquoteConfig): {
74
+ isVisible: boolean;
75
+ isActive: boolean;
76
+ handleToggle: () => boolean;
77
+ canToggle: boolean;
78
+ label: string;
79
+ shortcutKeys: string;
80
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
81
+ };
82
+ //# sourceMappingURL=use-blockquote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-blockquote.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/blockquote-button/use-blockquote.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAiB3C,eAAO,MAAM,uBAAuB,gBAAgB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,QAAQ,GAAE,OAAc,GACvB,OAAO,CA6BT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAsD/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAWV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB;;;;;;;;EA+CzD"}
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import type { UseCodeBlockConfig } from "@/components/tiptap-ui/code-block-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface CodeBlockButtonProps extends Omit<ButtonProps, "type">, UseCodeBlockConfig {
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 CodeBlockShortcutBadge({ shortcutKeys, }: {
16
+ shortcutKeys?: string;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ /**
19
+ * Button component for toggling code block in a Tiptap editor.
20
+ *
21
+ * For custom button implementations, use the `useCodeBlock` hook instead.
22
+ */
23
+ export declare const CodeBlockButton: React.ForwardRefExoticComponent<CodeBlockButtonProps & React.RefAttributes<HTMLButtonElement>>;
24
+ //# sourceMappingURL=code-block-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/code-block-button/code-block-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA;AAOlF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAI1E,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;CACvB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,YAAsC,GACvC,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,gGAyE3B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./code-block-button";
2
+ export * from "./use-code-block";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/code-block-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,89 @@
1
+ import * as React from "react";
2
+ import { type Editor } from "@tiptap/react";
3
+ export declare const CODE_BLOCK_SHORTCUT_KEY = "mod+alt+c";
4
+ /**
5
+ * Configuration for the code block functionality
6
+ */
7
+ export interface UseCodeBlockConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * Whether the button should hide when code block is not available.
14
+ * @default false
15
+ */
16
+ hideWhenUnavailable?: boolean;
17
+ /**
18
+ * Callback function called after a successful code block toggle.
19
+ */
20
+ onToggled?: () => void;
21
+ }
22
+ /**
23
+ * Checks if code block can be toggled in the current editor state
24
+ */
25
+ export declare function canToggle(editor: Editor | null, turnInto?: boolean): boolean;
26
+ /**
27
+ * Toggles code block in the editor
28
+ */
29
+ export declare function toggleCodeBlock(editor: Editor | null): boolean;
30
+ /**
31
+ * Determines if the code block button should be shown
32
+ */
33
+ export declare function shouldShowButton(props: {
34
+ editor: Editor | null;
35
+ hideWhenUnavailable: boolean;
36
+ }): boolean;
37
+ /**
38
+ * Custom hook that provides code block functionality for Tiptap editor
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * // Simple usage - no params needed
43
+ * function MySimpleCodeBlockButton() {
44
+ * const { isVisible, isActive, handleToggle } = useCodeBlock()
45
+ *
46
+ * if (!isVisible) return null
47
+ *
48
+ * return (
49
+ * <button
50
+ * onClick={handleToggle}
51
+ * aria-pressed={isActive}
52
+ * >
53
+ * Code Block
54
+ * </button>
55
+ * )
56
+ * }
57
+ *
58
+ * // Advanced usage with configuration
59
+ * function MyAdvancedCodeBlockButton() {
60
+ * const { isVisible, isActive, handleToggle, label } = useCodeBlock({
61
+ * editor: myEditor,
62
+ * hideWhenUnavailable: true,
63
+ * onToggled: (isActive) => console.log('Code block toggled:', isActive)
64
+ * })
65
+ *
66
+ * if (!isVisible) return null
67
+ *
68
+ * return (
69
+ * <MyButton
70
+ * onClick={handleToggle}
71
+ * aria-label={label}
72
+ * aria-pressed={isActive}
73
+ * >
74
+ * Toggle Code Block
75
+ * </MyButton>
76
+ * )
77
+ * }
78
+ * ```
79
+ */
80
+ export declare function useCodeBlock(config?: UseCodeBlockConfig): {
81
+ isVisible: boolean;
82
+ isActive: boolean;
83
+ handleToggle: () => boolean;
84
+ canToggle: boolean;
85
+ label: string;
86
+ shortcutKeys: string;
87
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
88
+ };
89
+ //# sourceMappingURL=use-code-block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-code-block.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/code-block-button/use-code-block.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAiB3C,eAAO,MAAM,uBAAuB,cAAc,CAAA;AAElD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,QAAQ,GAAE,OAAc,GACvB,OAAO,CA6BT;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAsD9D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAWV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,kBAAkB;;;;;;;;EA+CvD"}
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import type { UseColorHighlightConfig } from "@/components/tiptap-ui/color-highlight-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ import "@/components/tiptap-ui/color-highlight-button/color-highlight-button.scss";
5
+ export interface ColorHighlightButtonProps extends Omit<ButtonProps, "type">, UseColorHighlightConfig {
6
+ /**
7
+ * Optional text to display alongside the icon.
8
+ */
9
+ text?: string;
10
+ /**
11
+ * Optional show shortcut keys in the button.
12
+ * @default false
13
+ */
14
+ showShortcut?: boolean;
15
+ }
16
+ export declare function ColorHighlightShortcutBadge({ shortcutKeys, }: {
17
+ shortcutKeys?: string;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Button component for applying color highlights in a Tiptap editor.
21
+ *
22
+ * For custom button implementations, use the `useColorHighlight` hook instead.
23
+ */
24
+ export declare const ColorHighlightButton: React.ForwardRefExoticComponent<ColorHighlightButtonProps & React.RefAttributes<HTMLButtonElement>>;
25
+ //# sourceMappingURL=color-highlight-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-highlight-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAS9B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AAO5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAK1E,OAAO,2EAA2E,CAAA;AAElF,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,uBAAuB;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,YAA2C,GAC5C,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,qGA2FhC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./color-highlight-button";
2
+ export * from "./use-color-highlight";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-highlight-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { type Editor } from "@tiptap/react";
3
+ export declare const COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
4
+ export declare const HIGHLIGHT_COLORS: {
5
+ label: string;
6
+ value: string;
7
+ border: string;
8
+ }[];
9
+ export type HighlightColor = (typeof HIGHLIGHT_COLORS)[number];
10
+ /**
11
+ * Configuration for the color highlight functionality
12
+ */
13
+ export interface UseColorHighlightConfig {
14
+ /**
15
+ * The Tiptap editor instance.
16
+ */
17
+ editor?: Editor | null;
18
+ /**
19
+ * The color to apply when toggling the highlight.
20
+ */
21
+ highlightColor?: string;
22
+ /**
23
+ * Optional label to display alongside the icon.
24
+ */
25
+ label?: string;
26
+ /**
27
+ * Whether the button should hide when the mark is not available.
28
+ * @default false
29
+ */
30
+ hideWhenUnavailable?: boolean;
31
+ /**
32
+ * Called when the highlight is applied.
33
+ */
34
+ onApplied?: ({ color, label }: {
35
+ color: string;
36
+ label: string;
37
+ }) => void;
38
+ }
39
+ export declare function pickHighlightColorsByValue(values: string[]): {
40
+ label: string;
41
+ value: string;
42
+ border: string;
43
+ }[];
44
+ export declare function canColorHighlight(editor: Editor | null): boolean;
45
+ export declare function isColorHighlightActive(editor: Editor | null, highlightColor?: string): boolean;
46
+ export declare function removeHighlight(editor: Editor | null): boolean;
47
+ export declare function shouldShowButton(props: {
48
+ editor: Editor | null;
49
+ hideWhenUnavailable: boolean;
50
+ }): boolean;
51
+ export declare function useColorHighlight(config: UseColorHighlightConfig): {
52
+ isVisible: boolean;
53
+ isActive: boolean;
54
+ handleColorHighlight: () => false | undefined;
55
+ handleRemoveHighlight: () => boolean;
56
+ canColorHighlight: boolean;
57
+ label: string;
58
+ shortcutKeys: string;
59
+ Icon: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
60
+ };
61
+ //# sourceMappingURL=use-color-highlight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-color-highlight.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-highlight-button/use-color-highlight.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAa3C,eAAO,MAAM,4BAA4B,gBAAgB,CAAA;AACzD,eAAO,MAAM,gBAAgB;;;;GAmD5B,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACzE;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE;;;;IAO1D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAShE;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAKT;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAK9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAWV;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB;;;;;;;;;EAwFhE"}
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ import { type Editor } from "@tiptap/react";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ import type { HighlightColor, UseColorHighlightConfig } from "@/components/tiptap-ui/color-highlight-button";
5
+ export interface ColorHighlightPopoverContentProps {
6
+ /**
7
+ * The Tiptap editor instance.
8
+ */
9
+ editor?: Editor | null;
10
+ /**
11
+ * Optional colors to use in the highlight popover.
12
+ * If not provided, defaults to a predefined set of colors.
13
+ */
14
+ colors?: HighlightColor[];
15
+ }
16
+ export interface ColorHighlightPopoverProps extends Omit<ButtonProps, "type">, Pick<UseColorHighlightConfig, "editor" | "hideWhenUnavailable" | "onApplied"> {
17
+ /**
18
+ * Optional colors to use in the highlight popover.
19
+ * If not provided, defaults to a predefined set of colors.
20
+ */
21
+ colors?: HighlightColor[];
22
+ }
23
+ export declare const ColorHighlightPopoverButton: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
24
+ export declare function ColorHighlightPopoverContent({ editor, colors, }: ColorHighlightPopoverContentProps): import("react/jsx-runtime").JSX.Element;
25
+ export declare function ColorHighlightPopover({ editor: providedEditor, colors, hideWhenUnavailable, onApplied, ...props }: ColorHighlightPopoverProps): import("react/jsx-runtime").JSX.Element | null;
26
+ export default ColorHighlightPopover;
27
+ //# sourceMappingURL=color-highlight-popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-highlight-popover.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAY3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAe1E,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACxB,MAAM,+CAA+C,CAAA;AAOtD,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,MAAM,WAAW,0BACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,IAAI,CACF,uBAAuB,EACvB,QAAQ,GAAG,qBAAqB,GAAG,WAAW,CAC/C;IACH;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,2BAA2B,uFAkBtC,CAAA;AAIF,wBAAgB,4BAA4B,CAAC,EAC3C,MAAM,EACN,MAME,GACH,EAAE,iCAAiC,2CAiEnC;AAED,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EAAE,cAAc,EACtB,MAME,EACF,mBAA2B,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,0BAA0B,kDAgC5B;AAED,eAAe,qBAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./color-highlight-popover";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/color-highlight-popover/index.tsx"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import type { Level, UseHeadingConfig } from "@/components/tiptap-ui/heading-button";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface HeadingButtonProps extends Omit<ButtonProps, "type">, UseHeadingConfig {
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 HeadingShortcutBadge({ level, shortcutKeys, }: {
16
+ level: Level;
17
+ shortcutKeys?: string;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ /**
20
+ * Button component for toggling heading in a Tiptap editor.
21
+ *
22
+ * For custom button implementations, use the `useHeading` hook instead.
23
+ */
24
+ export declare const HeadingButton: React.ForwardRefExoticComponent<HeadingButtonProps & React.RefAttributes<HTMLButtonElement>>;
25
+ //# sourceMappingURL=heading-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading-button.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/heading-button/heading-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EACjB,MAAM,uCAAuC,CAAA;AAO9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAK1E,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,gBAAgB;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,YAA2C,GAC5C,EAAE;IACD,KAAK,EAAE,KAAK,CAAA;IACZ,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,2CAEA;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,8FA2EzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./heading-button";
2
+ export * from "./use-heading";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/heading-button/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,110 @@
1
+ import * as React from "react";
2
+ import { type Editor } from "@tiptap/react";
3
+ export type Level = 1 | 2 | 3 | 4 | 5 | 6;
4
+ /**
5
+ * Configuration for the heading functionality
6
+ */
7
+ export interface UseHeadingConfig {
8
+ /**
9
+ * The Tiptap editor instance.
10
+ */
11
+ editor?: Editor | null;
12
+ /**
13
+ * The heading level.
14
+ */
15
+ level: Level;
16
+ /**
17
+ * Whether the button should hide when heading is not available.
18
+ * @default false
19
+ */
20
+ hideWhenUnavailable?: boolean;
21
+ /**
22
+ * Callback function called after a successful heading toggle.
23
+ */
24
+ onToggled?: () => void;
25
+ }
26
+ export declare const headingIcons: {
27
+ 1: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
28
+ 2: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
29
+ 3: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
30
+ 4: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
31
+ 5: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
32
+ 6: React.MemoExoticComponent<({ className, ...props }: React.SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element>;
33
+ };
34
+ export declare const HEADING_SHORTCUT_KEYS: Record<Level, string>;
35
+ /**
36
+ * Checks if heading can be toggled in the current editor state
37
+ */
38
+ export declare function canToggle(editor: Editor | null, level?: Level, turnInto?: boolean): boolean;
39
+ /**
40
+ * Checks if heading is currently active
41
+ */
42
+ export declare function isHeadingActive(editor: Editor | null, level?: Level | Level[]): boolean;
43
+ /**
44
+ * Toggles heading in the editor
45
+ */
46
+ export declare function toggleHeading(editor: Editor | null, level: Level | Level[]): boolean;
47
+ /**
48
+ * Determines if the heading button should be shown
49
+ */
50
+ export declare function shouldShowButton(props: {
51
+ editor: Editor | null;
52
+ level?: Level | Level[];
53
+ hideWhenUnavailable: boolean;
54
+ }): boolean;
55
+ /**
56
+ * Custom hook that provides heading functionality for Tiptap editor
57
+ *
58
+ * @example
59
+ * ```tsx
60
+ * // Simple usage
61
+ * function MySimpleHeadingButton() {
62
+ * const { isVisible, isActive, handleToggle, Icon } = useHeading({ level: 1 })
63
+ *
64
+ * if (!isVisible) return null
65
+ *
66
+ * return (
67
+ * <button
68
+ * onClick={handleToggle}
69
+ * aria-pressed={isActive}
70
+ * >
71
+ * <Icon />
72
+ * Heading 1
73
+ * </button>
74
+ * )
75
+ * }
76
+ *
77
+ * // Advanced usage with configuration
78
+ * function MyAdvancedHeadingButton() {
79
+ * const { isVisible, isActive, handleToggle, label, Icon } = useHeading({
80
+ * level: 2,
81
+ * editor: myEditor,
82
+ * hideWhenUnavailable: true,
83
+ * onToggled: (isActive) => console.log('Heading toggled:', isActive)
84
+ * })
85
+ *
86
+ * if (!isVisible) return null
87
+ *
88
+ * return (
89
+ * <MyButton
90
+ * onClick={handleToggle}
91
+ * aria-label={label}
92
+ * aria-pressed={isActive}
93
+ * >
94
+ * <Icon />
95
+ * Toggle Heading 2
96
+ * </MyButton>
97
+ * )
98
+ * }
99
+ * ```
100
+ */
101
+ export declare function useHeading(config: UseHeadingConfig): {
102
+ isVisible: boolean;
103
+ isActive: boolean;
104
+ handleToggle: () => boolean;
105
+ canToggle: boolean;
106
+ label: string;
107
+ shortcutKeys: string;
108
+ 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>;
109
+ };
110
+ //# sourceMappingURL=use-heading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-heading.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/heading-button/use-heading.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAsB3C,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,KAAK,EAAE,KAAK,CAAA;IACZ;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,eAAO,MAAM,YAAY;;;;;;;CAOxB,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAOvD,CAAA;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,CAAC,EAAE,KAAK,EACb,QAAQ,GAAE,OAAc,GACvB,OAAO,CA+BT;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,GACtB,OAAO,CAUT;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,GACrB,OAAO,CA6DT;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,EAAE,CAAA;IACvB,mBAAmB,EAAE,OAAO,CAAA;CAC7B,GAAG,OAAO,CAcV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB;;;;;;;;EAgDlD"}
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ import type { UseHeadingDropdownMenuConfig } from "@/components/tiptap-ui/heading-dropdown-menu";
3
+ import type { ButtonProps } from "@/components/tiptap-ui-primitive/button";
4
+ export interface HeadingDropdownMenuProps extends Omit<ButtonProps, "type">, UseHeadingDropdownMenuConfig {
5
+ /**
6
+ * Whether to render the dropdown menu in a portal
7
+ * @default false
8
+ */
9
+ portal?: boolean;
10
+ /**
11
+ * Callback for when the dropdown opens or closes
12
+ */
13
+ onOpenChange?: (isOpen: boolean) => void;
14
+ }
15
+ /**
16
+ * Dropdown menu component for selecting heading levels in a Tiptap editor.
17
+ *
18
+ * For custom dropdown implementations, use the `useHeadingDropdownMenu` hook instead.
19
+ */
20
+ export declare const HeadingDropdownMenu: React.ForwardRefExoticComponent<HeadingDropdownMenuProps & React.RefAttributes<HTMLButtonElement>>;
21
+ export default HeadingDropdownMenu;
22
+ //# sourceMappingURL=heading-dropdown-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"heading-dropdown-menu.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAU9B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAA;AAIhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AAU1E,MAAM,WAAW,wBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAC/B,4BAA4B;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;CACzC;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,oGA+E/B,CAAA;AAID,eAAe,mBAAmB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from "./heading-dropdown-menu";
2
+ export * from "./use-heading-dropdown-menu";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tiptap-ui/heading-dropdown-menu/index.tsx"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,6BAA6B,CAAA"}