@cgboiler/biz-basic 1.0.53 → 1.0.55

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 (321) hide show
  1. package/es/index.d.ts +1 -1
  2. package/es/index.js +1 -1
  3. package/es/rich-text-editor/RichTextEditor.d.ts +14 -5
  4. package/es/rich-text-editor/RichTextEditor.js +76 -196
  5. package/es/rich-text-editor/_atomic.css +2 -1
  6. package/es/rich-text-editor/extensions/ConsumedTrigger.d.ts +8 -0
  7. package/es/rich-text-editor/extensions/ConsumedTrigger.js +22 -0
  8. package/es/rich-text-editor/extensions/CustomContent.d.ts +5 -0
  9. package/es/rich-text-editor/extensions/CustomContent.js +103 -0
  10. package/es/rich-text-editor/extensions/HashTag.d.ts +15 -0
  11. package/es/rich-text-editor/extensions/HashTag.js +133 -0
  12. package/es/rich-text-editor/extensions/HorizontalRule.d.ts +2 -0
  13. package/es/rich-text-editor/extensions/HorizontalRule.js +16 -0
  14. package/es/rich-text-editor/extensions/IMEComposition.d.ts +16 -0
  15. package/es/rich-text-editor/extensions/IMEComposition.js +30 -0
  16. package/es/rich-text-editor/extensions/ImageUpload.d.ts +56 -0
  17. package/es/rich-text-editor/extensions/ImageUpload.js +80 -0
  18. package/es/rich-text-editor/extensions/MarkdownExtensions.d.ts +15 -0
  19. package/es/rich-text-editor/extensions/MarkdownExtensions.js +35 -0
  20. package/es/rich-text-editor/extensions/MediaInputRules.d.ts +17 -0
  21. package/es/rich-text-editor/extensions/MediaInputRules.js +47 -0
  22. package/es/rich-text-editor/extensions/MentionExtension.d.ts +15 -0
  23. package/es/rich-text-editor/extensions/MentionExtension.js +60 -0
  24. package/es/rich-text-editor/extensions/index.d.ts +16 -0
  25. package/es/rich-text-editor/extensions/index.js +20 -0
  26. package/es/rich-text-editor/hooks/index.d.ts +6 -0
  27. package/es/rich-text-editor/hooks/index.js +4 -0
  28. package/es/rich-text-editor/hooks/useEditorHistory.d.ts +17 -0
  29. package/es/rich-text-editor/hooks/useEditorHistory.js +87 -0
  30. package/es/rich-text-editor/index copy 2.css +1 -0
  31. package/es/rich-text-editor/index copy 2.less +598 -0
  32. package/es/rich-text-editor/index copy.css +1 -0
  33. package/es/rich-text-editor/index copy.less +356 -0
  34. package/es/rich-text-editor/index.css +1 -1
  35. package/es/rich-text-editor/index.less +444 -254
  36. package/es/rich-text-editor/lib/utils.d.ts +123 -0
  37. package/es/rich-text-editor/lib/utils.js +244 -0
  38. package/es/rich-text-editor/menu-system/components/_atomic.css +44 -0
  39. package/es/rich-text-editor/menu-system/components/blockquote-button.d.ts +49 -0
  40. package/es/rich-text-editor/menu-system/components/blockquote-button.js +75 -0
  41. package/es/rich-text-editor/menu-system/components/code-block-button.d.ts +49 -0
  42. package/es/rich-text-editor/menu-system/components/code-block-button.js +75 -0
  43. package/es/rich-text-editor/menu-system/components/color-highlight-button.d.ts +61 -0
  44. package/es/rich-text-editor/menu-system/components/color-highlight-button.js +102 -0
  45. package/es/rich-text-editor/menu-system/components/color-highlight-popover.d.ts +32 -0
  46. package/es/rich-text-editor/menu-system/components/color-highlight-popover.js +99 -0
  47. package/es/rich-text-editor/menu-system/components/heading-dropdown-menu.d.ts +43 -0
  48. package/es/rich-text-editor/menu-system/components/heading-dropdown-menu.js +102 -0
  49. package/es/rich-text-editor/menu-system/components/horizontal-rule-button.d.ts +22 -0
  50. package/es/rich-text-editor/menu-system/components/horizontal-rule-button.js +42 -0
  51. package/es/rich-text-editor/menu-system/components/image-upload-button.d.ts +40 -0
  52. package/es/rich-text-editor/menu-system/components/image-upload-button.js +71 -0
  53. package/es/rich-text-editor/menu-system/components/image-upload-node.d.ts +93 -0
  54. package/es/rich-text-editor/menu-system/components/image-upload-node.js +299 -0
  55. package/es/rich-text-editor/menu-system/components/link-popover.d.ts +32 -0
  56. package/es/rich-text-editor/menu-system/components/link-popover.js +127 -0
  57. package/es/rich-text-editor/menu-system/components/list-button.d.ts +40 -0
  58. package/es/rich-text-editor/menu-system/components/list-button.js +69 -0
  59. package/es/rich-text-editor/menu-system/components/list-dropdown-menu.d.ts +41 -0
  60. package/es/rich-text-editor/menu-system/components/list-dropdown-menu.js +97 -0
  61. package/es/rich-text-editor/menu-system/components/mark-button.d.ts +58 -0
  62. package/es/rich-text-editor/menu-system/components/mark-button.js +80 -0
  63. package/es/rich-text-editor/menu-system/components/text-align-button.d.ts +58 -0
  64. package/es/rich-text-editor/menu-system/components/text-align-button.js +80 -0
  65. package/es/rich-text-editor/menu-system/components/undo-redo-button.d.ts +58 -0
  66. package/es/rich-text-editor/menu-system/components/undo-redo-button.js +77 -0
  67. package/es/rich-text-editor/menu-system/hooks/use-blockquote.d.ts +34 -0
  68. package/es/rich-text-editor/menu-system/hooks/use-blockquote.js +140 -0
  69. package/es/rich-text-editor/menu-system/hooks/use-code-block.d.ts +34 -0
  70. package/es/rich-text-editor/menu-system/hooks/use-code-block.js +140 -0
  71. package/es/rich-text-editor/menu-system/hooks/use-color-highlight.d.ts +46 -0
  72. package/es/rich-text-editor/menu-system/hooks/use-color-highlight.js +166 -0
  73. package/es/rich-text-editor/menu-system/hooks/use-cursor-visibility.d.ts +7 -0
  74. package/es/rich-text-editor/menu-system/hooks/use-cursor-visibility.js +46 -0
  75. package/es/rich-text-editor/menu-system/hooks/use-element-rect.d.ts +10 -0
  76. package/es/rich-text-editor/menu-system/hooks/use-element-rect.js +132 -0
  77. package/es/rich-text-editor/menu-system/hooks/use-file-upload.d.ts +94 -0
  78. package/es/rich-text-editor/menu-system/hooks/use-file-upload.js +135 -0
  79. package/es/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.d.ts +41 -0
  80. package/es/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.js +70 -0
  81. package/es/rich-text-editor/menu-system/hooks/use-heading.d.ts +26 -0
  82. package/es/rich-text-editor/menu-system/hooks/use-heading.js +166 -0
  83. package/es/rich-text-editor/menu-system/hooks/use-image-upload.d.ts +35 -0
  84. package/es/rich-text-editor/menu-system/hooks/use-image-upload.js +103 -0
  85. package/es/rich-text-editor/menu-system/hooks/use-link-popover.d.ts +10 -0
  86. package/es/rich-text-editor/menu-system/hooks/use-link-popover.js +62 -0
  87. package/es/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.d.ts +34 -0
  88. package/es/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.js +121 -0
  89. package/es/rich-text-editor/menu-system/hooks/use-list.d.ts +28 -0
  90. package/es/rich-text-editor/menu-system/hooks/use-list.js +191 -0
  91. package/es/rich-text-editor/menu-system/hooks/use-mark.d.ts +22 -0
  92. package/es/rich-text-editor/menu-system/hooks/use-mark.js +109 -0
  93. package/es/rich-text-editor/menu-system/hooks/use-menu-navigation.d.ts +16 -0
  94. package/es/rich-text-editor/menu-system/hooks/use-menu-navigation.js +134 -0
  95. package/es/rich-text-editor/menu-system/hooks/use-mobile.d.ts +1 -0
  96. package/es/rich-text-editor/menu-system/hooks/use-mobile.js +20 -0
  97. package/es/rich-text-editor/menu-system/hooks/use-text-align.d.ts +28 -0
  98. package/es/rich-text-editor/menu-system/hooks/use-text-align.js +113 -0
  99. package/es/rich-text-editor/menu-system/hooks/use-throttled-callback.d.ts +8 -0
  100. package/es/rich-text-editor/menu-system/hooks/use-throttled-callback.js +45 -0
  101. package/es/rich-text-editor/menu-system/hooks/use-undo-redo.d.ts +60 -0
  102. package/es/rich-text-editor/menu-system/hooks/use-undo-redo.js +96 -0
  103. package/es/rich-text-editor/menu-system/hooks/use-window-size.d.ts +21 -0
  104. package/es/rich-text-editor/menu-system/hooks/use-window-size.js +74 -0
  105. package/es/rich-text-editor/menu-system/icons/_atomic.css +32 -0
  106. package/es/rich-text-editor/menu-system/icons/index.d.ts +546 -0
  107. package/es/rich-text-editor/menu-system/icons/index.js +487 -0
  108. package/es/rich-text-editor/menu-system/primitives/_atomic.css +38 -0
  109. package/es/rich-text-editor/menu-system/primitives/button.d.ts +110 -0
  110. package/es/rich-text-editor/menu-system/primitives/button.js +107 -0
  111. package/es/rich-text-editor/menu-system/primitives/card.d.ts +75 -0
  112. package/es/rich-text-editor/menu-system/primitives/card.js +116 -0
  113. package/es/rich-text-editor/menu-system/primitives/input.d.ts +37 -0
  114. package/es/rich-text-editor/menu-system/primitives/input.js +55 -0
  115. package/es/rich-text-editor/menu-system/primitives/separator.d.ts +34 -0
  116. package/es/rich-text-editor/menu-system/primitives/separator.js +42 -0
  117. package/es/rich-text-editor/menu-system/primitives/toolbar.d.ts +39 -0
  118. package/es/rich-text-editor/menu-system/primitives/toolbar.js +149 -0
  119. package/es/rich-text-editor/menu-system/styles/animations.css +1 -0
  120. package/es/rich-text-editor/menu-system/styles/animations.less +91 -0
  121. package/es/rich-text-editor/menu-system/styles/button-colors.css +1 -0
  122. package/es/rich-text-editor/menu-system/styles/button-colors.less +142 -0
  123. package/es/rich-text-editor/menu-system/styles/button-group.css +1 -0
  124. package/es/rich-text-editor/menu-system/styles/button-group.less +23 -0
  125. package/es/rich-text-editor/menu-system/styles/button.css +1 -0
  126. package/es/rich-text-editor/menu-system/styles/button.less +322 -0
  127. package/es/rich-text-editor/menu-system/styles/card.css +1 -0
  128. package/es/rich-text-editor/menu-system/styles/card.less +78 -0
  129. package/es/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -0
  130. package/es/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -0
  131. package/es/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -0
  132. package/es/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -0
  133. package/es/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -0
  134. package/es/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -0
  135. package/es/rich-text-editor/menu-system/styles/image-upload-node.css +1 -0
  136. package/es/rich-text-editor/menu-system/styles/image-upload-node.less +240 -0
  137. package/es/rich-text-editor/menu-system/styles/input.css +1 -0
  138. package/es/rich-text-editor/menu-system/styles/input.less +53 -0
  139. package/es/rich-text-editor/menu-system/styles/link-popover.css +1 -0
  140. package/es/rich-text-editor/menu-system/styles/link-popover.less +32 -0
  141. package/es/rich-text-editor/menu-system/styles/separator.css +1 -0
  142. package/es/rich-text-editor/menu-system/styles/separator.less +26 -0
  143. package/es/rich-text-editor/menu-system/styles/simple-editor.css +1 -0
  144. package/es/rich-text-editor/menu-system/styles/simple-editor.less +39 -0
  145. package/es/rich-text-editor/menu-system/styles/toolbar.css +1 -0
  146. package/es/rich-text-editor/menu-system/styles/toolbar.less +87 -0
  147. package/es/rich-text-editor/menu-system/styles/variables.css +1 -0
  148. package/es/rich-text-editor/menu-system/styles/variables.less +296 -0
  149. package/es/rich-text-editor/menu-system/utils/tiptap-utils.d.ts +122 -0
  150. package/es/rich-text-editor/menu-system/utils/tiptap-utils.js +243 -0
  151. package/es/rich-text-editor/types.d.ts +4 -0
  152. package/es/rich-text-editor/types.js +4 -0
  153. package/es/rich-text-editor/useExtensions.d.ts +3 -3
  154. package/es/rich-text-editor/useExtensions.js +63 -428
  155. package/es/rich-text-editor/utils/eventHandlers.d.ts +37 -0
  156. package/es/rich-text-editor/utils/eventHandlers.js +103 -0
  157. package/es/rich-text-editor/utils/index.d.ts +6 -0
  158. package/es/rich-text-editor/utils/index.js +19 -0
  159. package/es/rich-text-editor/utils/triggerHelpers.d.ts +31 -0
  160. package/es/rich-text-editor/utils/triggerHelpers.js +46 -0
  161. package/lib/index.d.ts +1 -1
  162. package/lib/index.js +1 -1
  163. package/lib/rich-text-editor/RichTextEditor.d.ts +14 -5
  164. package/lib/rich-text-editor/RichTextEditor.js +76 -206
  165. package/lib/rich-text-editor/_atomic.css +2 -1
  166. package/lib/rich-text-editor/extensions/ConsumedTrigger.d.ts +8 -0
  167. package/lib/rich-text-editor/extensions/ConsumedTrigger.js +41 -0
  168. package/lib/rich-text-editor/extensions/CustomContent.d.ts +5 -0
  169. package/lib/rich-text-editor/extensions/CustomContent.js +132 -0
  170. package/lib/rich-text-editor/extensions/HashTag.d.ts +15 -0
  171. package/lib/rich-text-editor/extensions/HashTag.js +157 -0
  172. package/lib/rich-text-editor/extensions/HorizontalRule.d.ts +2 -0
  173. package/lib/rich-text-editor/extensions/HorizontalRule.js +45 -0
  174. package/lib/rich-text-editor/extensions/IMEComposition.d.ts +16 -0
  175. package/lib/rich-text-editor/extensions/IMEComposition.js +49 -0
  176. package/lib/rich-text-editor/extensions/ImageUpload.d.ts +56 -0
  177. package/lib/rich-text-editor/extensions/ImageUpload.js +99 -0
  178. package/lib/rich-text-editor/extensions/MarkdownExtensions.d.ts +15 -0
  179. package/lib/rich-text-editor/extensions/MarkdownExtensions.js +54 -0
  180. package/lib/rich-text-editor/extensions/MediaInputRules.d.ts +17 -0
  181. package/lib/rich-text-editor/extensions/MediaInputRules.js +66 -0
  182. package/lib/rich-text-editor/extensions/MentionExtension.d.ts +15 -0
  183. package/lib/rich-text-editor/extensions/MentionExtension.js +89 -0
  184. package/lib/rich-text-editor/extensions/index.d.ts +16 -0
  185. package/lib/rich-text-editor/extensions/index.js +49 -0
  186. package/lib/rich-text-editor/hooks/index.d.ts +6 -0
  187. package/lib/rich-text-editor/hooks/index.js +23 -0
  188. package/lib/rich-text-editor/hooks/useEditorHistory.d.ts +17 -0
  189. package/lib/rich-text-editor/hooks/useEditorHistory.js +116 -0
  190. package/lib/rich-text-editor/index copy 2.css +1 -0
  191. package/lib/rich-text-editor/index copy 2.less +598 -0
  192. package/lib/rich-text-editor/index copy.css +1 -0
  193. package/lib/rich-text-editor/index copy.less +356 -0
  194. package/lib/rich-text-editor/index.css +1 -1
  195. package/lib/rich-text-editor/index.less +444 -254
  196. package/lib/rich-text-editor/lib/utils.d.ts +123 -0
  197. package/lib/rich-text-editor/lib/utils.js +263 -0
  198. package/lib/rich-text-editor/menu-system/components/_atomic.css +44 -0
  199. package/lib/rich-text-editor/menu-system/components/blockquote-button.d.ts +49 -0
  200. package/lib/rich-text-editor/menu-system/components/blockquote-button.js +94 -0
  201. package/lib/rich-text-editor/menu-system/components/code-block-button.d.ts +49 -0
  202. package/lib/rich-text-editor/menu-system/components/code-block-button.js +94 -0
  203. package/lib/rich-text-editor/menu-system/components/color-highlight-button.d.ts +61 -0
  204. package/lib/rich-text-editor/menu-system/components/color-highlight-button.js +119 -0
  205. package/lib/rich-text-editor/menu-system/components/color-highlight-popover.d.ts +32 -0
  206. package/lib/rich-text-editor/menu-system/components/color-highlight-popover.js +118 -0
  207. package/lib/rich-text-editor/menu-system/components/heading-dropdown-menu.d.ts +43 -0
  208. package/lib/rich-text-editor/menu-system/components/heading-dropdown-menu.js +131 -0
  209. package/lib/rich-text-editor/menu-system/components/horizontal-rule-button.d.ts +22 -0
  210. package/lib/rich-text-editor/menu-system/components/horizontal-rule-button.js +61 -0
  211. package/lib/rich-text-editor/menu-system/components/image-upload-button.d.ts +40 -0
  212. package/lib/rich-text-editor/menu-system/components/image-upload-button.js +90 -0
  213. package/lib/rich-text-editor/menu-system/components/image-upload-node.d.ts +93 -0
  214. package/lib/rich-text-editor/menu-system/components/image-upload-node.js +316 -0
  215. package/lib/rich-text-editor/menu-system/components/link-popover.d.ts +32 -0
  216. package/lib/rich-text-editor/menu-system/components/link-popover.js +146 -0
  217. package/lib/rich-text-editor/menu-system/components/list-button.d.ts +40 -0
  218. package/lib/rich-text-editor/menu-system/components/list-button.js +88 -0
  219. package/lib/rich-text-editor/menu-system/components/list-dropdown-menu.d.ts +41 -0
  220. package/lib/rich-text-editor/menu-system/components/list-dropdown-menu.js +116 -0
  221. package/lib/rich-text-editor/menu-system/components/mark-button.d.ts +58 -0
  222. package/lib/rich-text-editor/menu-system/components/mark-button.js +99 -0
  223. package/lib/rich-text-editor/menu-system/components/text-align-button.d.ts +58 -0
  224. package/lib/rich-text-editor/menu-system/components/text-align-button.js +99 -0
  225. package/lib/rich-text-editor/menu-system/components/undo-redo-button.d.ts +58 -0
  226. package/lib/rich-text-editor/menu-system/components/undo-redo-button.js +96 -0
  227. package/lib/rich-text-editor/menu-system/hooks/use-blockquote.d.ts +34 -0
  228. package/lib/rich-text-editor/menu-system/hooks/use-blockquote.js +154 -0
  229. package/lib/rich-text-editor/menu-system/hooks/use-code-block.d.ts +34 -0
  230. package/lib/rich-text-editor/menu-system/hooks/use-code-block.js +154 -0
  231. package/lib/rich-text-editor/menu-system/hooks/use-color-highlight.d.ts +46 -0
  232. package/lib/rich-text-editor/menu-system/hooks/use-color-highlight.js +185 -0
  233. package/lib/rich-text-editor/menu-system/hooks/use-cursor-visibility.d.ts +7 -0
  234. package/lib/rich-text-editor/menu-system/hooks/use-cursor-visibility.js +65 -0
  235. package/lib/rich-text-editor/menu-system/hooks/use-element-rect.d.ts +10 -0
  236. package/lib/rich-text-editor/menu-system/hooks/use-element-rect.js +149 -0
  237. package/lib/rich-text-editor/menu-system/hooks/use-file-upload.d.ts +94 -0
  238. package/lib/rich-text-editor/menu-system/hooks/use-file-upload.js +154 -0
  239. package/lib/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.d.ts +41 -0
  240. package/lib/rich-text-editor/menu-system/hooks/use-heading-dropdown-menu.js +84 -0
  241. package/lib/rich-text-editor/menu-system/hooks/use-heading.d.ts +26 -0
  242. package/lib/rich-text-editor/menu-system/hooks/use-heading.js +190 -0
  243. package/lib/rich-text-editor/menu-system/hooks/use-image-upload.d.ts +35 -0
  244. package/lib/rich-text-editor/menu-system/hooks/use-image-upload.js +122 -0
  245. package/lib/rich-text-editor/menu-system/hooks/use-link-popover.d.ts +10 -0
  246. package/lib/rich-text-editor/menu-system/hooks/use-link-popover.js +81 -0
  247. package/lib/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.d.ts +34 -0
  248. package/lib/rich-text-editor/menu-system/hooks/use-list-dropdown-menu.js +140 -0
  249. package/lib/rich-text-editor/menu-system/hooks/use-list.d.ts +28 -0
  250. package/lib/rich-text-editor/menu-system/hooks/use-list.js +205 -0
  251. package/lib/rich-text-editor/menu-system/hooks/use-mark.d.ts +22 -0
  252. package/lib/rich-text-editor/menu-system/hooks/use-mark.js +138 -0
  253. package/lib/rich-text-editor/menu-system/hooks/use-menu-navigation.d.ts +16 -0
  254. package/lib/rich-text-editor/menu-system/hooks/use-menu-navigation.js +153 -0
  255. package/lib/rich-text-editor/menu-system/hooks/use-mobile.d.ts +1 -0
  256. package/lib/rich-text-editor/menu-system/hooks/use-mobile.js +39 -0
  257. package/lib/rich-text-editor/menu-system/hooks/use-text-align.d.ts +28 -0
  258. package/lib/rich-text-editor/menu-system/hooks/use-text-align.js +132 -0
  259. package/lib/rich-text-editor/menu-system/hooks/use-throttled-callback.d.ts +8 -0
  260. package/lib/rich-text-editor/menu-system/hooks/use-throttled-callback.js +64 -0
  261. package/lib/rich-text-editor/menu-system/hooks/use-undo-redo.d.ts +60 -0
  262. package/lib/rich-text-editor/menu-system/hooks/use-undo-redo.js +115 -0
  263. package/lib/rich-text-editor/menu-system/hooks/use-window-size.d.ts +21 -0
  264. package/lib/rich-text-editor/menu-system/hooks/use-window-size.js +93 -0
  265. package/lib/rich-text-editor/menu-system/icons/_atomic.css +32 -0
  266. package/lib/rich-text-editor/menu-system/icons/index.d.ts +546 -0
  267. package/lib/rich-text-editor/menu-system/icons/index.js +506 -0
  268. package/lib/rich-text-editor/menu-system/primitives/_atomic.css +38 -0
  269. package/lib/rich-text-editor/menu-system/primitives/button.d.ts +110 -0
  270. package/lib/rich-text-editor/menu-system/primitives/button.js +126 -0
  271. package/lib/rich-text-editor/menu-system/primitives/card.d.ts +75 -0
  272. package/lib/rich-text-editor/menu-system/primitives/card.js +135 -0
  273. package/lib/rich-text-editor/menu-system/primitives/input.d.ts +37 -0
  274. package/lib/rich-text-editor/menu-system/primitives/input.js +74 -0
  275. package/lib/rich-text-editor/menu-system/primitives/separator.d.ts +34 -0
  276. package/lib/rich-text-editor/menu-system/primitives/separator.js +61 -0
  277. package/lib/rich-text-editor/menu-system/primitives/toolbar.d.ts +39 -0
  278. package/lib/rich-text-editor/menu-system/primitives/toolbar.js +168 -0
  279. package/lib/rich-text-editor/menu-system/styles/animations.css +1 -0
  280. package/lib/rich-text-editor/menu-system/styles/animations.less +91 -0
  281. package/lib/rich-text-editor/menu-system/styles/button-colors.css +1 -0
  282. package/lib/rich-text-editor/menu-system/styles/button-colors.less +142 -0
  283. package/lib/rich-text-editor/menu-system/styles/button-group.css +1 -0
  284. package/lib/rich-text-editor/menu-system/styles/button-group.less +23 -0
  285. package/lib/rich-text-editor/menu-system/styles/button.css +1 -0
  286. package/lib/rich-text-editor/menu-system/styles/button.less +322 -0
  287. package/lib/rich-text-editor/menu-system/styles/card.css +1 -0
  288. package/lib/rich-text-editor/menu-system/styles/card.less +78 -0
  289. package/lib/rich-text-editor/menu-system/styles/color-highlight-button.css +1 -0
  290. package/lib/rich-text-editor/menu-system/styles/color-highlight-button.less +57 -0
  291. package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.css +1 -0
  292. package/lib/rich-text-editor/menu-system/styles/color-highlight-popover.less +51 -0
  293. package/lib/rich-text-editor/menu-system/styles/dropdown-menu.css +1 -0
  294. package/lib/rich-text-editor/menu-system/styles/dropdown-menu.less +40 -0
  295. package/lib/rich-text-editor/menu-system/styles/image-upload-node.css +1 -0
  296. package/lib/rich-text-editor/menu-system/styles/image-upload-node.less +240 -0
  297. package/lib/rich-text-editor/menu-system/styles/input.css +1 -0
  298. package/lib/rich-text-editor/menu-system/styles/input.less +53 -0
  299. package/lib/rich-text-editor/menu-system/styles/link-popover.css +1 -0
  300. package/lib/rich-text-editor/menu-system/styles/link-popover.less +32 -0
  301. package/lib/rich-text-editor/menu-system/styles/separator.css +1 -0
  302. package/lib/rich-text-editor/menu-system/styles/separator.less +26 -0
  303. package/lib/rich-text-editor/menu-system/styles/simple-editor.css +1 -0
  304. package/lib/rich-text-editor/menu-system/styles/simple-editor.less +39 -0
  305. package/lib/rich-text-editor/menu-system/styles/toolbar.css +1 -0
  306. package/lib/rich-text-editor/menu-system/styles/toolbar.less +87 -0
  307. package/lib/rich-text-editor/menu-system/styles/variables.css +1 -0
  308. package/lib/rich-text-editor/menu-system/styles/variables.less +296 -0
  309. package/lib/rich-text-editor/menu-system/utils/tiptap-utils.d.ts +122 -0
  310. package/lib/rich-text-editor/menu-system/utils/tiptap-utils.js +262 -0
  311. package/lib/rich-text-editor/types.d.ts +4 -0
  312. package/lib/rich-text-editor/types.js +4 -0
  313. package/lib/rich-text-editor/useExtensions.d.ts +3 -3
  314. package/lib/rich-text-editor/useExtensions.js +64 -429
  315. package/lib/rich-text-editor/utils/eventHandlers.d.ts +37 -0
  316. package/lib/rich-text-editor/utils/eventHandlers.js +132 -0
  317. package/lib/rich-text-editor/utils/index.d.ts +6 -0
  318. package/lib/rich-text-editor/utils/index.js +32 -0
  319. package/lib/rich-text-editor/utils/triggerHelpers.d.ts +31 -0
  320. package/lib/rich-text-editor/utils/triggerHelpers.js +65 -0
  321. package/package.json +13 -3
@@ -0,0 +1,19 @@
1
+ import { checkConsumed, markAsConsumed, isSpaceKey, checkLastCharIsSpace } from "./triggerHelpers";
2
+ import {
3
+ createHashTagClickHandler,
4
+ createMentionClickHandler,
5
+ createCustomContentClickHandler,
6
+ createCustomContentHoverHandler,
7
+ createImageClickHandler
8
+ } from "./eventHandlers";
9
+ export {
10
+ checkConsumed,
11
+ checkLastCharIsSpace,
12
+ createCustomContentClickHandler,
13
+ createCustomContentHoverHandler,
14
+ createHashTagClickHandler,
15
+ createImageClickHandler,
16
+ createMentionClickHandler,
17
+ isSpaceKey,
18
+ markAsConsumed
19
+ };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * 文件说明:
3
+ * - 提供触发符(# 或 @)相关的辅助函数
4
+ * - 包括消费状态检查、标记操作等
5
+ */
6
+ /**
7
+ * 检查指定位置是否已被标记为"已消费"
8
+ * @param state - 编辑器状态
9
+ * @param range - 文本范围
10
+ * @returns 是否已被消费
11
+ */
12
+ export declare const checkConsumed: (state: any, range: any) => boolean;
13
+ /**
14
+ * 在触发符位置打上已消费标记
15
+ * @param editor - 编辑器实例
16
+ * @param range - 文本范围
17
+ * @param char - 触发符字符
18
+ */
19
+ export declare const markAsConsumed: (editor: any, range: any, char: string) => void;
20
+ /**
21
+ * 检查是否为空格键
22
+ * @param event - 键盘事件
23
+ * @returns 是否为空格键
24
+ */
25
+ export declare const isSpaceKey: (event: KeyboardEvent) => boolean;
26
+ /**
27
+ * 检测最后一个输入是否为空格(兼容安卓软键盘)
28
+ * @param editor - 编辑器实例
29
+ * @returns 是否为空格
30
+ */
31
+ export declare const checkLastCharIsSpace: (editor: any) => boolean;
@@ -0,0 +1,46 @@
1
+ const checkConsumed = (state, range) => {
2
+ const { doc, schema } = state;
3
+ const markType = schema.marks.consumedTrigger;
4
+ if (!markType)
5
+ return false;
6
+ let isConsumed = false;
7
+ doc.nodesBetween(range.from, range.to, (node) => {
8
+ if (node.marks.some((m) => m.type === markType)) {
9
+ isConsumed = true;
10
+ }
11
+ });
12
+ return isConsumed;
13
+ };
14
+ const markAsConsumed = (editor, range, char) => {
15
+ if (!editor || !range || range.from === void 0)
16
+ return;
17
+ try {
18
+ const { doc } = editor.state;
19
+ const actualChar = doc.textBetween(range.from, range.from + 1);
20
+ if (actualChar === char) {
21
+ editor.chain().setMeta("addToHistory", false).setTextSelection({ from: range.from, to: range.from + 1 }).setMark("consumedTrigger").setTextSelection(editor.state.selection.to).unsetMark("consumedTrigger").run();
22
+ }
23
+ } catch (e) {
24
+ }
25
+ };
26
+ const isSpaceKey = (event) => {
27
+ return [" ", "Space", "Spacebar"].includes(event.key) || // @ts-ignore
28
+ event.keyCode === 32 || event.code === "Space";
29
+ };
30
+ const checkLastCharIsSpace = (editor) => {
31
+ var _a, _b, _c, _d, _e;
32
+ try {
33
+ const sel = (_a = editor.state) == null ? void 0 : _a.selection;
34
+ const from = (_b = sel == null ? void 0 : sel.from) != null ? _b : 0;
35
+ const prevChar = (_e = (_d = (_c = editor.state) == null ? void 0 : _c.doc) == null ? void 0 : _d.textBetween(Math.max(from - 1, 0), from, "\0", "\0")) != null ? _e : "";
36
+ return prevChar === " ";
37
+ } catch (e) {
38
+ return false;
39
+ }
40
+ };
41
+ export {
42
+ checkConsumed,
43
+ checkLastCharIsSpace,
44
+ isSpaceKey,
45
+ markAsConsumed
46
+ };
package/lib/index.d.ts CHANGED
@@ -5,6 +5,6 @@ declare namespace _default {
5
5
  }
6
6
  export default _default;
7
7
  export function install(app: any): void;
8
- export const version: "1.0.52";
8
+ export const version: "1.0.54";
9
9
  import RichTextEditor from './rich-text-editor';
10
10
  export { RichTextEditor };
package/lib/index.js CHANGED
@@ -36,7 +36,7 @@ __export(stdin_exports, {
36
36
  module.exports = __toCommonJS(stdin_exports);
37
37
  var import_rich_text_editor = __toESM(require("./rich-text-editor"));
38
38
  __reExport(stdin_exports, require("./rich-text-editor"), module.exports);
39
- const version = "1.0.52";
39
+ const version = "1.0.54";
40
40
  function install(app) {
41
41
  const components = [
42
42
  import_rich_text_editor.default
@@ -16,7 +16,11 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
16
16
  type: BooleanConstructor;
17
17
  default: boolean;
18
18
  };
19
- }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "mention-input" | "mention-exit" | "update:modelValue" | "mention-clicked" | "hashTag-clicked" | "customContent-triggered" | "customContent-input" | "customContent-exit" | "customContent-clicked" | "customContent-hovered")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "mention-input" | "mention-exit" | "update:modelValue" | "mention-clicked" | "hashTag-clicked" | "customContent-triggered" | "customContent-input" | "customContent-exit" | "customContent-clicked" | "customContent-hovered", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
19
+ showMenu: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "mention-input" | "mention-exit" | "hashTag-clicked" | "mention-clicked" | "customContent-clicked" | "customContent-hovered" | "update:modelValue" | "customContent-triggered" | "customContent-input" | "customContent-exit")[], "blur" | "focus" | "hashTag-triggered" | "hashTag-input" | "hashTag-exit" | "mention-triggered" | "mention-input" | "mention-exit" | "hashTag-clicked" | "mention-clicked" | "customContent-clicked" | "customContent-hovered" | "update:modelValue" | "customContent-triggered" | "customContent-input" | "customContent-exit", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
20
24
  modelValue: {
21
25
  type: StringConstructor;
22
26
  default: string;
@@ -32,26 +36,31 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
32
36
  type: BooleanConstructor;
33
37
  default: boolean;
34
38
  };
39
+ showMenu: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
35
43
  }>> & Readonly<{
36
44
  onFocus?: ((...args: any[]) => any) | undefined;
37
45
  onBlur?: ((...args: any[]) => any) | undefined;
46
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
38
47
  "onHashTag-triggered"?: ((...args: any[]) => any) | undefined;
39
48
  "onHashTag-input"?: ((...args: any[]) => any) | undefined;
40
49
  "onHashTag-exit"?: ((...args: any[]) => any) | undefined;
41
50
  "onMention-triggered"?: ((...args: any[]) => any) | undefined;
42
51
  "onMention-input"?: ((...args: any[]) => any) | undefined;
43
52
  "onMention-exit"?: ((...args: any[]) => any) | undefined;
44
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
45
- "onMention-clicked"?: ((...args: any[]) => any) | undefined;
46
53
  "onHashTag-clicked"?: ((...args: any[]) => any) | undefined;
54
+ "onMention-clicked"?: ((...args: any[]) => any) | undefined;
55
+ "onCustomContent-clicked"?: ((...args: any[]) => any) | undefined;
56
+ "onCustomContent-hovered"?: ((...args: any[]) => any) | undefined;
47
57
  "onCustomContent-triggered"?: ((...args: any[]) => any) | undefined;
48
58
  "onCustomContent-input"?: ((...args: any[]) => any) | undefined;
49
59
  "onCustomContent-exit"?: ((...args: any[]) => any) | undefined;
50
- "onCustomContent-clicked"?: ((...args: any[]) => any) | undefined;
51
- "onCustomContent-hovered"?: ((...args: any[]) => any) | undefined;
52
60
  }>, {
53
61
  modelValue: string;
54
62
  placeholder: string;
55
63
  editable: boolean;
64
+ showMenu: boolean;
56
65
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
57
66
  export default _default;
@@ -1,8 +1,6 @@
1
- var __create = Object.create;
2
1
  var __defProp = Object.defineProperty;
3
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
5
  var __export = (target, all) => {
8
6
  for (var name in all)
@@ -16,35 +14,7 @@ var __copyProps = (to, from, except, desc) => {
16
14
  }
17
15
  return to;
18
16
  };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var __async = (__this, __arguments, generator) => {
29
- return new Promise((resolve, reject) => {
30
- var fulfilled = (value) => {
31
- try {
32
- step(generator.next(value));
33
- } catch (e) {
34
- reject(e);
35
- }
36
- };
37
- var rejected = (value) => {
38
- try {
39
- step(generator.throw(value));
40
- } catch (e) {
41
- reject(e);
42
- }
43
- };
44
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
- step((generator = generator.apply(__this, __arguments)).next());
46
- });
47
- };
48
18
  var stdin_exports = {};
49
19
  __export(stdin_exports, {
50
20
  default: () => stdin_default
@@ -54,12 +24,19 @@ var import_vue = require("vue");
54
24
  var import_atomic = require("./_atomic.css");
55
25
  var import_vue2 = require("vue");
56
26
  var import_vue_3 = require("@tiptap/vue-3");
57
- var import_viewerjs = __toESM(require("viewerjs"));
58
27
  var import_viewer = require("viewerjs/dist/viewer.css");
59
28
  var import_useExtensions = require("./useExtensions");
60
- var import_localforage = __toESM(require("localforage"));
29
+ var import_useEditorHistory = require("./hooks/useEditorHistory");
30
+ var import_eventHandlers = require("./utils/eventHandlers");
61
31
  var import_types = require("./types");
62
32
  var import_index = require("./index.css");
33
+ var import_toolbar = require("./menu-system/primitives/toolbar");
34
+ var import_heading_dropdown_menu = require("./menu-system/components/heading-dropdown-menu");
35
+ var import_list_dropdown_menu = require("./menu-system/components/list-dropdown-menu");
36
+ var import_blockquote_button = require("./menu-system/components/blockquote-button");
37
+ var import_code_block_button = require("./menu-system/components/code-block-button");
38
+ var import_mark_button = require("./menu-system/components/mark-button");
39
+ var import_horizontal_rule_button = require("./menu-system/components/horizontal-rule-button");
63
40
  var stdin_default = (0, import_vue2.defineComponent)({
64
41
  name: "RichTextEditor",
65
42
  props: import_types.richTextEditorProps,
@@ -69,24 +46,26 @@ var stdin_default = (0, import_vue2.defineComponent)({
69
46
  expose
70
47
  }) {
71
48
  const editor = (0, import_vue2.ref)();
49
+ const viewerRef = (0, import_vue2.ref)(null);
72
50
  const extensions = (0, import_useExtensions.useExtensions)({
73
51
  props,
74
52
  emit
75
53
  });
54
+ (0, import_useEditorHistory.useEditorHistory)({
55
+ editor: () => editor.value,
56
+ enabled: props.editable
57
+ });
58
+ const imageClickHandler = (0, import_eventHandlers.createImageClickHandler)(viewerRef);
59
+ const hashTagClickHandler = (0, import_eventHandlers.createHashTagClickHandler)(emit);
60
+ const mentionClickHandler = (0, import_eventHandlers.createMentionClickHandler)(emit);
61
+ const customContentClickHandler = (0, import_eventHandlers.createCustomContentClickHandler)(emit);
62
+ const customContentHoverHandler = (0, import_eventHandlers.createCustomContentHoverHandler)(emit);
76
63
  let isFocusFromPlaceholder = false;
77
64
  const initEditor = () => {
78
65
  editor.value = new import_vue_3.Editor({
79
66
  extensions,
80
67
  content: props.modelValue,
81
68
  editable: props.editable,
82
- // onMount: ({ editor }) => {
83
- // // 非可编辑状态下,需要手动设置 contenteditable 为 false
84
- // if (props.editable === false) {
85
- // editor.setOptions({
86
- // editable: false,
87
- // });
88
- // }
89
- // },
90
69
  onUpdate: ({
91
70
  editor: editor2
92
71
  }) => {
@@ -170,185 +149,76 @@ var stdin_default = (0, import_vue2.defineComponent)({
170
149
  var _a;
171
150
  (_a = editor.value) == null ? void 0 : _a.setEditable(val);
172
151
  });
173
- const viewerRef = (0, import_vue2.ref)(null);
174
- const imageClickHandler = (event) => {
175
- const target = event.target;
176
- if (target.tagName === "IMG") {
177
- if (viewerRef.value) {
178
- viewerRef.value.destroy();
179
- }
180
- viewerRef.value = new import_viewerjs.default(target, {
181
- inline: false,
182
- navbar: true,
183
- title: true,
184
- toolbar: {
185
- zoomIn: true,
186
- zoomOut: true,
187
- oneToOne: true,
188
- reset: true,
189
- prev: false,
190
- next: false,
191
- rotateLeft: true,
192
- rotateRight: true,
193
- flipHorizontal: true,
194
- flipVertical: true
195
- }
196
- });
197
- viewerRef.value.show();
198
- event.stopPropagation();
199
- event.preventDefault();
200
- }
201
- };
202
- const hashTagClickHandler = (event) => {
203
- const target = event.target;
204
- const tagEl = target.closest(".hash-tag") || null;
205
- if (tagEl) {
206
- const id = tagEl.getAttribute("data-id") || "";
207
- const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
208
- const trigger = tagEl.getAttribute("data-hash-tag") || "#";
209
- const tagType = tagEl.getAttribute("data-tag-type") || "";
210
- emit("hashTag-clicked", {
211
- hashTagId: id,
212
- name: label,
213
- trigger,
214
- type: tagType
215
- });
216
- event.stopPropagation();
217
- event.preventDefault();
218
- return;
219
- }
220
- };
221
- const mentionClickHandler = (event) => {
222
- const target = event.target;
223
- const tagEl = target.closest(".mention") || null;
224
- if (tagEl) {
225
- const id = tagEl.getAttribute("data-id") || "";
226
- const label = tagEl.getAttribute("data-label") || tagEl.textContent || "";
227
- emit("mention-clicked", {
228
- userId: id,
229
- name: label
230
- });
231
- event.stopPropagation();
232
- event.preventDefault();
233
- return;
234
- }
235
- };
236
- const customContentClickHandler = (event) => {
237
- const target = event.target;
238
- const tagEl = target.closest(".custom-content") || null;
239
- if (tagEl) {
240
- const objStr = tagEl.getAttribute("obj") || "{}";
241
- const label = tagEl.getAttribute("file-label") || "";
242
- try {
243
- const obj = JSON.parse(objStr);
244
- emit("customContent-clicked", {
245
- obj,
246
- label
247
- });
248
- } catch (e) {
249
- console.error("Failed to parse custom content obj:", e);
250
- }
251
- event.stopPropagation();
252
- event.preventDefault();
253
- return;
152
+ const addEventListeners = () => {
153
+ var _a, _b;
154
+ const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
155
+ if (editorElement) {
156
+ editorElement.addEventListener("click", imageClickHandler);
157
+ editorElement.addEventListener("click", hashTagClickHandler);
158
+ editorElement.addEventListener("click", mentionClickHandler);
159
+ editorElement.addEventListener("click", customContentClickHandler);
160
+ editorElement.addEventListener("mouseover", customContentHoverHandler);
254
161
  }
255
162
  };
256
- const customContentHoverHandler = (event) => {
257
- const target = event.target;
258
- const tagEl = target.closest(".custom-content") || null;
259
- if (tagEl) {
260
- const objStr = tagEl.getAttribute("obj") || "{}";
261
- const label = tagEl.getAttribute("file-label") || "";
262
- try {
263
- const obj = JSON.parse(objStr);
264
- emit("customContent-hovered", {
265
- obj,
266
- label
267
- });
268
- } catch (e) {
269
- console.error("Failed to parse custom content obj:", e);
270
- }
271
- event.stopPropagation();
272
- event.preventDefault();
273
- return;
163
+ const removeEventListeners = () => {
164
+ var _a, _b;
165
+ const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
166
+ if (editorElement) {
167
+ editorElement.removeEventListener("click", imageClickHandler);
168
+ editorElement.removeEventListener("click", hashTagClickHandler);
169
+ editorElement.removeEventListener("click", mentionClickHandler);
170
+ editorElement.removeEventListener("click", customContentClickHandler);
171
+ editorElement.removeEventListener("mouseover", customContentHoverHandler);
274
172
  }
275
173
  };
276
- const HISTORY_METADATA_KEY = "rich_text_editor_history_metadata";
277
- const MAX_HISTORY_ITEMS = 10;
278
- let saveTimeoutId = null;
279
- const noteId = (0, import_vue2.ref)("");
280
- const historyStore = import_localforage.default.createInstance({
281
- name: "RichTextEditorHistory",
282
- storeName: "notes"
283
- });
284
- const saveLoop = () => __async(this, null, function* () {
285
- if (editor.value && !editor.value.isDestroyed && editor.value.isEditable) {
286
- const content = editor.value.getHTML();
287
- const now = /* @__PURE__ */ new Date();
288
- const formattedTime = `${now.toLocaleDateString()} ${now.toLocaleTimeString()}`;
289
- const noteTitle = `\u7B14\u8BB0 at ${formattedTime}`;
290
- if (content !== "<p></p>") {
291
- yield historyStore.setItem(noteId.value, {
292
- title: noteTitle,
293
- content
294
- });
295
- let metadata = (yield historyStore.getItem(HISTORY_METADATA_KEY)) || [];
296
- const existingNoteIndex = metadata.findIndex((meta) => meta.id === noteId.value);
297
- if (existingNoteIndex === -1) {
298
- metadata.push({
299
- id: noteId.value,
300
- timestamp: now.getTime()
301
- });
302
- metadata.sort((a, b) => b.timestamp - a.timestamp);
303
- if (metadata.length > MAX_HISTORY_ITEMS) {
304
- const itemsToRemove = metadata.splice(MAX_HISTORY_ITEMS);
305
- for (const item of itemsToRemove) {
306
- yield historyStore.removeItem(item.id);
307
- }
308
- }
309
- yield historyStore.setItem(HISTORY_METADATA_KEY, metadata);
310
- }
311
- }
312
- }
313
- saveTimeoutId = setTimeout(saveLoop, 1e4);
314
- });
315
174
  (0, import_vue2.onMounted)(() => {
316
175
  initEditor();
317
- const now = /* @__PURE__ */ new Date();
318
- noteId.value = `note-${now.getTime()}`;
319
- if (props.editable) {
320
- saveLoop();
321
- }
322
176
  (0, import_vue2.nextTick)(() => {
323
- var _a, _b;
324
- const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
325
- if (editorElement) {
326
- editorElement.addEventListener("click", imageClickHandler);
327
- editorElement.addEventListener("click", hashTagClickHandler);
328
- editorElement.addEventListener("click", mentionClickHandler);
329
- editorElement.addEventListener("click", customContentClickHandler);
330
- editorElement.addEventListener("mouseover", customContentHoverHandler);
331
- }
177
+ addEventListeners();
332
178
  });
333
179
  });
334
180
  (0, import_vue2.onBeforeUnmount)(() => {
335
- var _a, _b, _c;
336
- if (saveTimeoutId) {
337
- clearTimeout(saveTimeoutId);
338
- }
339
- const editorElement = (_b = (_a = editor.value) == null ? void 0 : _a.view) == null ? void 0 : _b.dom;
340
- if (editorElement) {
341
- editorElement.removeEventListener("click", imageClickHandler);
342
- editorElement.removeEventListener("click", hashTagClickHandler);
343
- editorElement.removeEventListener("click", mentionClickHandler);
344
- editorElement.removeEventListener("click", customContentClickHandler);
345
- editorElement.removeEventListener("mouseover", customContentHoverHandler);
181
+ var _a;
182
+ if (viewerRef.value) {
183
+ viewerRef.value.destroy();
346
184
  }
347
- (_c = editor.value) == null ? void 0 : _c.destroy();
185
+ removeEventListeners();
186
+ (_a = editor.value) == null ? void 0 : _a.destroy();
348
187
  });
349
- return () => (0, import_vue.createVNode)(import_vue_3.EditorContent, {
188
+ return () => (0, import_vue.createVNode)("div", {
189
+ "class": "tiptap-editor-container"
190
+ }, [props.showMenu && editor.value && (0, import_vue.createVNode)(import_toolbar.Toolbar, {
191
+ "class": "tiptap-editor-toolbar"
192
+ }, {
193
+ default: () => [(0, import_vue.createVNode)(import_toolbar.ToolbarGroup, null, {
194
+ default: () => [(0, import_vue.createVNode)(import_heading_dropdown_menu.HeadingDropdownMenu, {
195
+ "editor": editor.value
196
+ }, null), (0, import_vue.createVNode)(import_list_dropdown_menu.ListDropdownMenu, {
197
+ "editor": editor.value
198
+ }, null), (0, import_vue.createVNode)(import_horizontal_rule_button.HorizontalRuleButton, {
199
+ "editor": editor.value
200
+ }, null), (0, import_vue.createVNode)(import_blockquote_button.BlockquoteButton, {
201
+ "editor": editor.value
202
+ }, null), (0, import_vue.createVNode)(import_code_block_button.CodeBlockButton, {
203
+ "editor": editor.value
204
+ }, null)]
205
+ }), (0, import_vue.createVNode)(import_toolbar.ToolbarSeparator, null, null), (0, import_vue.createVNode)(import_toolbar.ToolbarGroup, null, {
206
+ default: () => [(0, import_vue.createVNode)(import_mark_button.MarkButton, {
207
+ "editor": editor.value,
208
+ "type": "bold"
209
+ }, null), (0, import_vue.createVNode)(import_mark_button.MarkButton, {
210
+ "editor": editor.value,
211
+ "type": "italic"
212
+ }, null), (0, import_vue.createVNode)(import_mark_button.MarkButton, {
213
+ "editor": editor.value,
214
+ "type": "code"
215
+ }, null)]
216
+ })]
217
+ }), (0, import_vue.createVNode)("div", {
218
+ "class": "tiptap-editor-content-wrapper"
219
+ }, [(0, import_vue.createVNode)(import_vue_3.EditorContent, {
350
220
  "class": "ProseMirror",
351
221
  "editor": editor.value
352
- }, null);
222
+ }, null)])]);
353
223
  }
354
224
  });
@@ -31,5 +31,6 @@
31
31
  }
32
32
 
33
33
  /* layer: default */
34
- .cgx-atm .inline{display:inline;}
34
+ .cgx-atm .italic{font-style:italic;}
35
+ .cgx-atm .underline{text-decoration-line:underline;}
35
36
  .cgx-atm .blur{--un-blur:blur(8px);filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 文件说明:
3
+ * - ConsumedTrigger Mark 扩展
4
+ * - 功能:标记已经触发过且被"消费"(建议态结束)的触发符(# 或 @)
5
+ * - 作用:持久化建议态失活记录。即使编辑器重新初始化,该字符也不会再次触发建议,除非被删除重新输入
6
+ */
7
+ import { Mark } from '@tiptap/core';
8
+ export declare const ConsumedTrigger: Mark<any, any>;
@@ -0,0 +1,41 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var stdin_exports = {};
19
+ __export(stdin_exports, {
20
+ ConsumedTrigger: () => ConsumedTrigger
21
+ });
22
+ module.exports = __toCommonJS(stdin_exports);
23
+ var import_core = require("@tiptap/core");
24
+ const ConsumedTrigger = import_core.Mark.create({
25
+ name: "consumedTrigger",
26
+ keepOnSplit: false,
27
+ // 保证在标记后继续输入时不延续标记
28
+ parseHTML() {
29
+ return [{ tag: "span[data-consumed-trigger]" }];
30
+ },
31
+ renderHTML({ HTMLAttributes }) {
32
+ return [
33
+ "span",
34
+ (0, import_core.mergeAttributes)(HTMLAttributes, {
35
+ "data-consumed-trigger": "true",
36
+ style: "color: inherit;"
37
+ }),
38
+ 0
39
+ ];
40
+ }
41
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * 创建 CustomContent 扩展
3
+ * @returns TipTap Extension
4
+ */
5
+ export declare const createCustomContentExtension: () => import("@tiptap/core").Node<import("@tiptap/extension-mention").MentionOptions<any, import("@tiptap/extension-mention").MentionNodeAttrs>, any>;