@haklex/rich-editor 0.69.0 → 0.69.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/dist/{theme-DH4xzxU-.js → ColorSchemeContext-DLWz8vFw.js} +1349 -92
  2. package/dist/{thumbhash-GjK8OYAb.js → LinkCardRenderer-D4mQbUQo.js} +109 -31
  3. package/dist/NestedEditorPluginsContext-DKFdozOE.js +8 -0
  4. package/dist/{ExtraNodesContext-xQ2RNsqH.js → RendererConfigProvider-BPYO0Ip0.js} +37 -7
  5. package/dist/{RubyRenderer-8HMSMaZz.js → RubyRenderer-BuFWY87e.js} +2 -1
  6. package/dist/SpoilerNode-D7Tgdo2K.js +82 -0
  7. package/dist/{VirtualizationPlugin-nD_x-4yR.js → VirtualizationPlugin-CkNi6FW2.js} +85 -53
  8. package/dist/{VirtualizationPlugin-Bqv4MkJH.js → VirtualizationPlugin-DbAHlGBL.js} +358 -172
  9. package/dist/{VirtualizedEditor-uWe43zaI.js → VirtualizedEditor-D099IYqN.js} +54 -41
  10. package/dist/block-id-state-DfN32rR_.js +5 -0
  11. package/dist/command-registry-entry.d.ts.map +1 -1
  12. package/dist/commands/registry.d.ts +2 -2
  13. package/dist/commands/registry.d.ts.map +1 -1
  14. package/dist/commands-entry.d.ts +1 -4
  15. package/dist/commands-entry.d.ts.map +1 -1
  16. package/dist/commands-entry.mjs +2 -2
  17. package/dist/components/ContentEditable.css.d.ts.map +1 -1
  18. package/dist/components/ContentEditable.d.ts +1 -1
  19. package/dist/components/ContentEditable.d.ts.map +1 -1
  20. package/dist/components/CorePlugins.d.ts +1 -1
  21. package/dist/components/CorePlugins.d.ts.map +1 -1
  22. package/dist/components/EditorSurfaceHost.d.ts +2 -2
  23. package/dist/components/EditorSurfaceHost.d.ts.map +1 -1
  24. package/dist/components/LinkFavicon.d.ts +1 -1
  25. package/dist/components/LinkFavicon.d.ts.map +1 -1
  26. package/dist/components/RendererWrapper.d.ts +5 -16
  27. package/dist/components/RendererWrapper.d.ts.map +1 -1
  28. package/dist/components/RichEditor.d.ts +2 -2
  29. package/dist/components/RichEditor.d.ts.map +1 -1
  30. package/dist/components/RichEditorShell.d.ts +7 -7
  31. package/dist/components/RichEditorShell.d.ts.map +1 -1
  32. package/dist/components/VirtualizationFromProps.d.ts +2 -2
  33. package/dist/components/VirtualizationFromProps.d.ts.map +1 -1
  34. package/dist/components/decorators/AlertEditDecorator.d.ts +3 -3
  35. package/dist/components/decorators/AlertEditDecorator.d.ts.map +1 -1
  36. package/dist/components/decorators/BannerEditDecorator.d.ts +3 -3
  37. package/dist/components/decorators/BannerEditDecorator.d.ts.map +1 -1
  38. package/dist/components/decorators/CodeBlockEditDecorator.d.ts +1 -1
  39. package/dist/components/decorators/CodeBlockEditDecorator.d.ts.map +1 -1
  40. package/dist/components/decorators/GridEditDecorator.d.ts +2 -2
  41. package/dist/components/decorators/GridEditDecorator.d.ts.map +1 -1
  42. package/dist/components/decorators/NestedEditorCorePlugins.d.ts +1 -1
  43. package/dist/components/decorators/NestedEditorCorePlugins.d.ts.map +1 -1
  44. package/dist/components/decorators/gridAutoFocus.d.ts +1 -1
  45. package/dist/components/decorators/gridAutoFocus.d.ts.map +1 -1
  46. package/dist/components/decorators/useNestedEditorSync.d.ts +1 -1
  47. package/dist/components/decorators/useNestedEditorSync.d.ts.map +1 -1
  48. package/dist/components/renderer-decoration.d.ts +13 -0
  49. package/dist/components/renderer-decoration.d.ts.map +1 -0
  50. package/dist/components/renderers/AlertRenderer.d.ts +2 -2
  51. package/dist/components/renderers/AlertRenderer.d.ts.map +1 -1
  52. package/dist/components/renderers/AlertStaticDecorator.d.ts +3 -3
  53. package/dist/components/renderers/AlertStaticDecorator.d.ts.map +1 -1
  54. package/dist/components/renderers/BannerRenderer.d.ts +2 -2
  55. package/dist/components/renderers/BannerRenderer.d.ts.map +1 -1
  56. package/dist/components/renderers/BannerStaticDecorator.d.ts +3 -3
  57. package/dist/components/renderers/BannerStaticDecorator.d.ts.map +1 -1
  58. package/dist/components/renderers/CodeBlockRenderer.d.ts +1 -1
  59. package/dist/components/renderers/CodeBlockRenderer.d.ts.map +1 -1
  60. package/dist/components/renderers/FileRenderer.d.ts +1 -4
  61. package/dist/components/renderers/FileRenderer.d.ts.map +1 -1
  62. package/dist/components/renderers/FootnoteRenderer.d.ts +1 -1
  63. package/dist/components/renderers/FootnoteRenderer.d.ts.map +1 -1
  64. package/dist/components/renderers/FootnoteSectionEditRenderer.d.ts +1 -1
  65. package/dist/components/renderers/FootnoteSectionEditRenderer.d.ts.map +1 -1
  66. package/dist/components/renderers/FootnoteSectionRenderer.d.ts +1 -1
  67. package/dist/components/renderers/FootnoteSectionRenderer.d.ts.map +1 -1
  68. package/dist/components/renderers/FootnoteStaticRenderer.d.ts +1 -1
  69. package/dist/components/renderers/FootnoteStaticRenderer.d.ts.map +1 -1
  70. package/dist/components/renderers/GridStaticDecorator.d.ts +2 -2
  71. package/dist/components/renderers/GridStaticDecorator.d.ts.map +1 -1
  72. package/dist/components/renderers/ImageRenderer.d.ts +2 -2
  73. package/dist/components/renderers/ImageRenderer.d.ts.map +1 -1
  74. package/dist/components/renderers/KaTeXRenderer.d.ts +1 -1
  75. package/dist/components/renderers/KaTeXRenderer.d.ts.map +1 -1
  76. package/dist/components/renderers/LinkCardRenderer.d.ts +1 -1
  77. package/dist/components/renderers/LinkCardRenderer.d.ts.map +1 -1
  78. package/dist/components/renderers/MentionRenderer.d.ts +1 -1
  79. package/dist/components/renderers/MentionRenderer.d.ts.map +1 -1
  80. package/dist/components/renderers/MermaidRenderer.d.ts +1 -1
  81. package/dist/components/renderers/MermaidRenderer.d.ts.map +1 -1
  82. package/dist/components/renderers/RubyRenderer.d.ts +2 -2
  83. package/dist/components/renderers/RubyRenderer.d.ts.map +1 -1
  84. package/dist/components/renderers/TagRenderer.d.ts +1 -2
  85. package/dist/components/renderers/TagRenderer.d.ts.map +1 -1
  86. package/dist/components/renderers/VideoRenderer.d.ts +1 -1
  87. package/dist/components/renderers/VideoRenderer.d.ts.map +1 -1
  88. package/dist/components/utils.d.ts +1 -1
  89. package/dist/components/utils.d.ts.map +1 -1
  90. package/dist/config-edit.d.ts +1 -1
  91. package/dist/config-edit.d.ts.map +1 -1
  92. package/dist/config.d.ts +1 -1
  93. package/dist/config.d.ts.map +1 -1
  94. package/dist/context/ColorSchemeContext.d.ts +1 -5
  95. package/dist/context/ColorSchemeContext.d.ts.map +1 -1
  96. package/dist/context/ColorSchemeProvider.d.ts +7 -0
  97. package/dist/context/ColorSchemeProvider.d.ts.map +1 -0
  98. package/dist/context/EditorBlockContext.d.ts +2 -2
  99. package/dist/context/EditorBlockContext.d.ts.map +1 -1
  100. package/dist/context/EditorSurface.d.ts +19 -0
  101. package/dist/context/EditorSurface.d.ts.map +1 -0
  102. package/dist/context/EditorSurfaceContext.d.ts +7 -22
  103. package/dist/context/EditorSurfaceContext.d.ts.map +1 -1
  104. package/dist/context/ExtraNodesContext.d.ts +2 -6
  105. package/dist/context/ExtraNodesContext.d.ts.map +1 -1
  106. package/dist/context/ExtraNodesProvider.d.ts +7 -0
  107. package/dist/context/ExtraNodesProvider.d.ts.map +1 -0
  108. package/dist/context/FileUploadContext.d.ts +2 -6
  109. package/dist/context/FileUploadContext.d.ts.map +1 -1
  110. package/dist/context/FileUploadProvider.d.ts +7 -0
  111. package/dist/context/FileUploadProvider.d.ts.map +1 -0
  112. package/dist/context/FootnoteDefinitionsContext.d.ts +1 -4
  113. package/dist/context/FootnoteDefinitionsContext.d.ts.map +1 -1
  114. package/dist/context/FootnoteDefinitionsProvider.d.ts +6 -0
  115. package/dist/context/FootnoteDefinitionsProvider.d.ts.map +1 -0
  116. package/dist/context/ImagePreprocessContext.d.ts +2 -4
  117. package/dist/context/ImagePreprocessContext.d.ts.map +1 -1
  118. package/dist/context/ImagePreprocessProvider.d.ts +5 -0
  119. package/dist/context/ImagePreprocessProvider.d.ts.map +1 -0
  120. package/dist/context/ImageUploadContext.d.ts +2 -6
  121. package/dist/context/ImageUploadContext.d.ts.map +1 -1
  122. package/dist/context/ImageUploadProvider.d.ts +7 -0
  123. package/dist/context/ImageUploadProvider.d.ts.map +1 -0
  124. package/dist/context/NestedContentRendererContext.d.ts +4 -4
  125. package/dist/context/NestedContentRendererContext.d.ts.map +1 -1
  126. package/dist/context/NestedEditorPluginsContext.d.ts +5 -2
  127. package/dist/context/NestedEditorPluginsContext.d.ts.map +1 -1
  128. package/dist/context/NestedEditorPluginsProvider.d.ts +3 -0
  129. package/dist/context/NestedEditorPluginsProvider.d.ts.map +1 -0
  130. package/dist/context/RendererConfigContext.d.ts +9 -4
  131. package/dist/context/RendererConfigContext.d.ts.map +1 -1
  132. package/dist/context/RendererConfigProvider.d.ts +3 -0
  133. package/dist/context/RendererConfigProvider.d.ts.map +1 -0
  134. package/dist/context/TextSelectionContext.d.ts +2 -5
  135. package/dist/context/TextSelectionContext.d.ts.map +1 -1
  136. package/dist/context/TextSelectionStoreProvider.d.ts +5 -0
  137. package/dist/context/TextSelectionStoreProvider.d.ts.map +1 -0
  138. package/dist/context/VideoUploadContext.d.ts +2 -6
  139. package/dist/context/VideoUploadContext.d.ts.map +1 -1
  140. package/dist/context/VideoUploadProvider.d.ts +7 -0
  141. package/dist/context/VideoUploadProvider.d.ts.map +1 -0
  142. package/dist/{grid.css-DJWKdYpz.js → grid.css-DAMDDTZh.js} +2 -1
  143. package/dist/index.d.ts +15 -8
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.mjs +34 -22
  146. package/dist/insert-commands-CtLGoIz0.js +9 -0
  147. package/dist/{katex.css-9crOcnIa.js → katex.css-DJbW49pH.js} +1 -1
  148. package/dist/{node-registry-DRd8ZbeC.js → node-registry-PtbiwsVu.js} +416 -42
  149. package/dist/node-registry.d.ts +1 -1
  150. package/dist/node-registry.d.ts.map +1 -1
  151. package/dist/nodes/AlertQuoteEditNode.d.ts +4 -4
  152. package/dist/nodes/AlertQuoteEditNode.d.ts.map +1 -1
  153. package/dist/nodes/AlertQuoteNode.d.ts +3 -2
  154. package/dist/nodes/AlertQuoteNode.d.ts.map +1 -1
  155. package/dist/nodes/BannerEditNode.d.ts +4 -4
  156. package/dist/nodes/BannerEditNode.d.ts.map +1 -1
  157. package/dist/nodes/BannerNode.d.ts +3 -2
  158. package/dist/nodes/BannerNode.d.ts.map +1 -1
  159. package/dist/nodes/CodeBlockEditNode.d.ts +6 -6
  160. package/dist/nodes/CodeBlockEditNode.d.ts.map +1 -1
  161. package/dist/nodes/CodeBlockNode.d.ts +4 -3
  162. package/dist/nodes/CodeBlockNode.d.ts.map +1 -1
  163. package/dist/nodes/CommentNode.d.ts +3 -2
  164. package/dist/nodes/CommentNode.d.ts.map +1 -1
  165. package/dist/nodes/DetailsNode.d.ts +4 -3
  166. package/dist/nodes/DetailsNode.d.ts.map +1 -1
  167. package/dist/nodes/FileNode.d.ts +4 -3
  168. package/dist/nodes/FileNode.d.ts.map +1 -1
  169. package/dist/nodes/FootnoteNode.d.ts +3 -2
  170. package/dist/nodes/FootnoteNode.d.ts.map +1 -1
  171. package/dist/nodes/FootnoteSectionEditNode.d.ts +2 -2
  172. package/dist/nodes/FootnoteSectionEditNode.d.ts.map +1 -1
  173. package/dist/nodes/FootnoteSectionNode.d.ts +3 -2
  174. package/dist/nodes/FootnoteSectionNode.d.ts.map +1 -1
  175. package/dist/nodes/GridContainerNode.d.ts +3 -2
  176. package/dist/nodes/GridContainerNode.d.ts.map +1 -1
  177. package/dist/nodes/GridEditNode.d.ts +4 -4
  178. package/dist/nodes/GridEditNode.d.ts.map +1 -1
  179. package/dist/nodes/ImageNode.d.ts +5 -4
  180. package/dist/nodes/ImageNode.d.ts.map +1 -1
  181. package/dist/nodes/KaTeXBlockNode.d.ts +4 -3
  182. package/dist/nodes/KaTeXBlockNode.d.ts.map +1 -1
  183. package/dist/nodes/KaTeXInlineNode.d.ts +3 -2
  184. package/dist/nodes/KaTeXInlineNode.d.ts.map +1 -1
  185. package/dist/nodes/LinkCardNode.d.ts +4 -3
  186. package/dist/nodes/LinkCardNode.d.ts.map +1 -1
  187. package/dist/nodes/MentionNode.d.ts +4 -3
  188. package/dist/nodes/MentionNode.d.ts.map +1 -1
  189. package/dist/nodes/MermaidNode.d.ts +4 -3
  190. package/dist/nodes/MermaidNode.d.ts.map +1 -1
  191. package/dist/nodes/RichQuoteNode.d.ts +2 -2
  192. package/dist/nodes/RichQuoteNode.d.ts.map +1 -1
  193. package/dist/nodes/RubyNode.d.ts +2 -1
  194. package/dist/nodes/RubyNode.d.ts.map +1 -1
  195. package/dist/nodes/SpoilerNode.d.ts +2 -1
  196. package/dist/nodes/SpoilerNode.d.ts.map +1 -1
  197. package/dist/nodes/TagNode.d.ts +3 -2
  198. package/dist/nodes/TagNode.d.ts.map +1 -1
  199. package/dist/nodes/VideoNode.d.ts +4 -3
  200. package/dist/nodes/VideoNode.d.ts.map +1 -1
  201. package/dist/nodes/shared.d.ts +1 -1
  202. package/dist/nodes/shared.d.ts.map +1 -1
  203. package/dist/nodes-entry.d.ts.map +1 -1
  204. package/dist/nodes-entry.mjs +2 -4
  205. package/dist/{normalizeSerializedEditorState-VaI73T09.js → normalizeSerializedEditorState-CNUAQd3l.js} +16 -1
  206. package/dist/plugins/AlertPlugin.d.ts +0 -2
  207. package/dist/plugins/AlertPlugin.d.ts.map +1 -1
  208. package/dist/plugins/AutoFocusPlugin.d.ts.map +1 -1
  209. package/dist/plugins/AutoLinkPlugin.d.ts +1 -1
  210. package/dist/plugins/AutoLinkPlugin.d.ts.map +1 -1
  211. package/dist/plugins/BlockExitPlugin.d.ts +0 -2
  212. package/dist/plugins/BlockExitPlugin.d.ts.map +1 -1
  213. package/dist/plugins/BlockIdPlugin.d.ts +0 -1
  214. package/dist/plugins/BlockIdPlugin.d.ts.map +1 -1
  215. package/dist/plugins/ClickBelowPlugin.d.ts +0 -2
  216. package/dist/plugins/ClickBelowPlugin.d.ts.map +1 -1
  217. package/dist/plugins/EditorRefPlugin.d.ts +1 -1
  218. package/dist/plugins/EditorRefPlugin.d.ts.map +1 -1
  219. package/dist/plugins/FileUploadPlugin.d.ts +1 -1
  220. package/dist/plugins/FileUploadPlugin.d.ts.map +1 -1
  221. package/dist/plugins/FootnotePlugin.d.ts +1 -1
  222. package/dist/plugins/FootnotePlugin.d.ts.map +1 -1
  223. package/dist/plugins/HorizontalRulePlugin.d.ts.map +1 -1
  224. package/dist/plugins/ImageDialog.d.ts +2 -2
  225. package/dist/plugins/ImageDialog.d.ts.map +1 -1
  226. package/dist/plugins/ImageDialogReview.d.ts +2 -2
  227. package/dist/plugins/ImageDialogReview.d.ts.map +1 -1
  228. package/dist/plugins/ImageDialogSource.d.ts +1 -1
  229. package/dist/plugins/ImageDialogSource.d.ts.map +1 -1
  230. package/dist/plugins/ImagePlugin.d.ts +0 -3
  231. package/dist/plugins/ImagePlugin.d.ts.map +1 -1
  232. package/dist/plugins/ImageUploadPlugin.d.ts +1 -13
  233. package/dist/plugins/ImageUploadPlugin.d.ts.map +1 -1
  234. package/dist/plugins/InlineDndPlugin.d.ts +1 -3
  235. package/dist/plugins/InlineDndPlugin.d.ts.map +1 -1
  236. package/dist/plugins/KaTeXPlugin.d.ts +0 -2
  237. package/dist/plugins/KaTeXPlugin.d.ts.map +1 -1
  238. package/dist/plugins/LinkFaviconPlugin.d.ts.map +1 -1
  239. package/dist/plugins/MarkdownPastePlugin.d.ts.map +1 -1
  240. package/dist/plugins/MarkdownShortcutsPlugin.d.ts +1 -1
  241. package/dist/plugins/MarkdownShortcutsPlugin.d.ts.map +1 -1
  242. package/dist/plugins/MermaidPlugin.d.ts +0 -1
  243. package/dist/plugins/MermaidPlugin.d.ts.map +1 -1
  244. package/dist/plugins/OnChangePlugin.d.ts +1 -1
  245. package/dist/plugins/OnChangePlugin.d.ts.map +1 -1
  246. package/dist/plugins/PasteLinkPlugin.d.ts.map +1 -1
  247. package/dist/plugins/SubmitShortcutPlugin.d.ts.map +1 -1
  248. package/dist/plugins/TextSelectionPlugin.d.ts.map +1 -1
  249. package/dist/plugins/VideoUploadPlugin.d.ts.map +1 -1
  250. package/dist/plugins/VirtualizationPlugin.d.ts.map +1 -1
  251. package/dist/plugins/block-exit-commands.d.ts +3 -0
  252. package/dist/plugins/block-exit-commands.d.ts.map +1 -0
  253. package/dist/plugins/block-id-state.d.ts +2 -0
  254. package/dist/plugins/block-id-state.d.ts.map +1 -0
  255. package/dist/plugins/click-below-command.d.ts +3 -0
  256. package/dist/plugins/click-below-command.d.ts.map +1 -0
  257. package/dist/plugins/file-upload-command.d.ts +1 -1
  258. package/dist/plugins/file-upload-command.d.ts.map +1 -1
  259. package/dist/plugins/file-upload-store.d.ts +1 -1
  260. package/dist/plugins/file-upload-store.d.ts.map +1 -1
  261. package/dist/plugins/image-dialog-model.d.ts +1 -1
  262. package/dist/plugins/image-dialog-model.d.ts.map +1 -1
  263. package/dist/plugins/image-dialog.css.d.ts.map +1 -1
  264. package/dist/plugins/image-upload-command.d.ts +1 -1
  265. package/dist/plugins/image-upload-command.d.ts.map +1 -1
  266. package/dist/plugins/image-upload-fn.d.ts +14 -0
  267. package/dist/plugins/image-upload-fn.d.ts.map +1 -0
  268. package/dist/plugins/image-upload-toast.d.ts.map +1 -1
  269. package/dist/plugins/image-upload.css.d.ts.map +1 -1
  270. package/dist/plugins/inline-dnd-move.d.ts +4 -0
  271. package/dist/plugins/inline-dnd-move.d.ts.map +1 -0
  272. package/dist/plugins/inline-dnd-shared.d.ts.map +1 -1
  273. package/dist/plugins/inline-dnd.css.d.ts.map +1 -1
  274. package/dist/plugins/insert-commands.d.ts +9 -0
  275. package/dist/plugins/insert-commands.d.ts.map +1 -0
  276. package/dist/plugins/insertion-cursor.d.ts +1 -1
  277. package/dist/plugins/insertion-cursor.d.ts.map +1 -1
  278. package/dist/plugins/present-image-dialog.d.ts +1 -1
  279. package/dist/plugins/present-image-dialog.d.ts.map +1 -1
  280. package/dist/plugins/text-selection.css.d.ts.map +1 -1
  281. package/dist/plugins-entry.d.ts +15 -8
  282. package/dist/plugins-entry.d.ts.map +1 -1
  283. package/dist/plugins-entry.mjs +5 -6
  284. package/dist/recycler-entry.d.ts.map +1 -1
  285. package/dist/renderers-entry.d.ts +4 -2
  286. package/dist/renderers-entry.d.ts.map +1 -1
  287. package/dist/renderers-entry.mjs +5 -5
  288. package/dist/{utils-E6qVk-NR.js → shared.css-DRoqE_U-.js} +1 -24
  289. package/dist/static-entry.d.ts +12 -6
  290. package/dist/static-entry.d.ts.map +1 -1
  291. package/dist/static-entry.mjs +10 -9
  292. package/dist/styles/article.css.d.ts.map +1 -1
  293. package/dist/styles/chat.css.d.ts.map +1 -1
  294. package/dist/styles/comment.css.d.ts.map +1 -1
  295. package/dist/styles/details.css.d.ts +5 -5
  296. package/dist/styles/details.css.d.ts.map +1 -1
  297. package/dist/styles/grid.css.d.ts +10 -10
  298. package/dist/styles/grid.css.d.ts.map +1 -1
  299. package/dist/styles/index.d.ts +3 -0
  300. package/dist/styles/index.d.ts.map +1 -1
  301. package/dist/styles/katex.css.d.ts +3 -3
  302. package/dist/styles/katex.css.d.ts.map +1 -1
  303. package/dist/styles/note.css.d.ts.map +1 -1
  304. package/dist/styles/shared.css.d.ts +54 -54
  305. package/dist/styles/shared.css.d.ts.map +1 -1
  306. package/dist/styles/theme.d.ts +1 -1
  307. package/dist/styles/theme.d.ts.map +1 -1
  308. package/dist/styles-entry.d.ts.map +1 -1
  309. package/dist/styles-entry.mjs +4 -3
  310. package/dist/transformers/alert.d.ts +1 -1
  311. package/dist/transformers/alert.d.ts.map +1 -1
  312. package/dist/transformers/code-block.d.ts +1 -1
  313. package/dist/transformers/code-block.d.ts.map +1 -1
  314. package/dist/transformers/comment.d.ts +1 -1
  315. package/dist/transformers/comment.d.ts.map +1 -1
  316. package/dist/transformers/container.d.ts +1 -1
  317. package/dist/transformers/container.d.ts.map +1 -1
  318. package/dist/transformers/footnote.d.ts +1 -1
  319. package/dist/transformers/footnote.d.ts.map +1 -1
  320. package/dist/transformers/grid-container.d.ts +1 -1
  321. package/dist/transformers/grid-container.d.ts.map +1 -1
  322. package/dist/transformers/horizontal-rule.d.ts +1 -1
  323. package/dist/transformers/horizontal-rule.d.ts.map +1 -1
  324. package/dist/transformers/index.d.ts +1 -1
  325. package/dist/transformers/index.d.ts.map +1 -1
  326. package/dist/transformers/insert.d.ts.map +1 -1
  327. package/dist/transformers/katex.d.ts +1 -1
  328. package/dist/transformers/katex.d.ts.map +1 -1
  329. package/dist/transformers/mention.d.ts +1 -1
  330. package/dist/transformers/mention.d.ts.map +1 -1
  331. package/dist/transformers/quote.d.ts +1 -1
  332. package/dist/transformers/quote.d.ts.map +1 -1
  333. package/dist/transformers/rich-blocks.d.ts.map +1 -1
  334. package/dist/transformers/ruby.d.ts +1 -1
  335. package/dist/transformers/ruby.d.ts.map +1 -1
  336. package/dist/transformers/spoiler.d.ts +1 -1
  337. package/dist/transformers/spoiler.d.ts.map +1 -1
  338. package/dist/transformers/superscript-subscript.d.ts.map +1 -1
  339. package/dist/transformers/table.d.ts +1 -1
  340. package/dist/transformers/table.d.ts.map +1 -1
  341. package/dist/types/renderer-config.d.ts +15 -15
  342. package/dist/types/renderer-config.d.ts.map +1 -1
  343. package/dist/types/renderer-keys.d.ts +14 -14
  344. package/dist/types/renderer-keys.d.ts.map +1 -1
  345. package/dist/types/slash-menu.d.ts +2 -2
  346. package/dist/types/slash-menu.d.ts.map +1 -1
  347. package/dist/types.d.ts +5 -5
  348. package/dist/types.d.ts.map +1 -1
  349. package/dist/utils/codeBlockSelectionIntent.d.ts +1 -0
  350. package/dist/utils/codeBlockSelectionIntent.d.ts.map +1 -1
  351. package/dist/utils/collect-command-items.d.ts +2 -2
  352. package/dist/utils/collect-command-items.d.ts.map +1 -1
  353. package/dist/utils/comment-anchor.d.ts +1 -1
  354. package/dist/utils/comment-anchor.d.ts.map +1 -1
  355. package/dist/utils/extractTextContent.d.ts +1 -1
  356. package/dist/utils/extractTextContent.d.ts.map +1 -1
  357. package/dist/utils/favicon.d.ts.map +1 -1
  358. package/dist/utils/file-meta.d.ts +4 -0
  359. package/dist/utils/file-meta.d.ts.map +1 -0
  360. package/dist/utils/getRegisteredNodeKlass.d.ts +1 -1
  361. package/dist/utils/getRegisteredNodeKlass.d.ts.map +1 -1
  362. package/dist/utils/image-display-size.d.ts.map +1 -1
  363. package/dist/utils/image-insertion.d.ts +1 -1
  364. package/dist/utils/image-insertion.d.ts.map +1 -1
  365. package/dist/utils/image-preprocess.d.ts +1 -1
  366. package/dist/utils/image-preprocess.d.ts.map +1 -1
  367. package/dist/utils/katex-defaults.d.ts.map +1 -1
  368. package/dist/utils/lucide-dom.d.ts.map +1 -1
  369. package/dist/utils/nested-editor-sync.d.ts +1 -1
  370. package/dist/utils/nested-editor-sync.d.ts.map +1 -1
  371. package/dist/utils/normalizeSerializedEditorState.d.ts +1 -1
  372. package/dist/utils/normalizeSerializedEditorState.d.ts.map +1 -1
  373. package/dist/utils/occurrence-keys.d.ts +7 -0
  374. package/dist/utils/occurrence-keys.d.ts.map +1 -0
  375. package/dist/utils/tag-color.d.ts.map +1 -1
  376. package/dist/utils/text-selection-constants.d.ts.map +1 -1
  377. package/dist/utils/text-selection.d.ts +1 -1
  378. package/dist/utils/text-selection.d.ts.map +1 -1
  379. package/dist/utils/thumbhash.d.ts.map +1 -1
  380. package/dist/utils/toggle-spoiler.d.ts +1 -1
  381. package/dist/utils/toggle-spoiler.d.ts.map +1 -1
  382. package/dist/utils-i78C9io3.js +26 -0
  383. package/dist/virtualization/VirtualizationPlugin.d.ts +2 -2
  384. package/dist/virtualization/VirtualizationPlugin.d.ts.map +1 -1
  385. package/dist/virtualization/VirtualizedEditor.d.ts +3 -3
  386. package/dist/virtualization/VirtualizedEditor.d.ts.map +1 -1
  387. package/dist/virtualization/blocks.d.ts +3 -3
  388. package/dist/virtualization/blocks.d.ts.map +1 -1
  389. package/dist/virtualization/controller.d.ts +8 -4
  390. package/dist/virtualization/controller.d.ts.map +1 -1
  391. package/dist/virtualization/document.d.ts +1 -1
  392. package/dist/virtualization/document.d.ts.map +1 -1
  393. package/dist/virtualization/layout.d.ts +1 -1
  394. package/dist/virtualization/layout.d.ts.map +1 -1
  395. package/dist/virtualization/preserve.d.ts.map +1 -1
  396. package/dist/virtualization/style.css.d.ts.map +1 -1
  397. package/dist/virtualization/sync.d.ts +2 -2
  398. package/dist/virtualization/sync.d.ts.map +1 -1
  399. package/dist/virtualization/types.d.ts +2 -2
  400. package/dist/virtualization/types.d.ts.map +1 -1
  401. package/dist/virtualization/viewport.d.ts +1 -1
  402. package/dist/virtualization/viewport.d.ts.map +1 -1
  403. package/dist/virtualization-entry.d.ts.map +1 -1
  404. package/dist/virtualization-entry.mjs +1 -1
  405. package/package.json +4 -6
  406. package/dist/AlertQuoteEditNode-DFg-xOND.js +0 -372
  407. package/dist/BlockIdPlugin-Cwv8aV9g.js +0 -106
  408. package/dist/ColorSchemeContext-Dc_HebHd.js +0 -1336
  409. package/dist/LinkCardRenderer-BT8P5aJC.js +0 -100
  410. package/dist/MermaidPlugin-D0Z2_YAe.js +0 -71
  411. package/dist/NestedEditorPluginsContext-D78UZkmx.js +0 -16
@@ -1,15 +1,25 @@
1
- import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-DH4xzxU-.js";
2
- import { c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, o as useFootnoteDefinitions, p as useVariant } from "./thumbhash-GjK8OYAb.js";
3
- import { c as semanticClassNames, l as sharedStyles, t as clsx } from "./utils-E6qVk-NR.js";
1
+ import { A as KaTeXInlineNode, D as LinkCardNode, I as ImageNode, N as KaTeXBlockNode, Tt as AlertRenderer, X as GridContainerNode, Y as $isGridContainerNode, Z as occurrenceKeys, a as builtinNodes, at as FileNode, bt as BannerRenderer, c as VideoNode, ct as DetailsNode, d as TagNode, et as FootnoteSectionNode, ft as CommentNode, h as RubyNode, ht as $isBannerNode, mt as CodeBlockNode, n as useColorScheme, nt as FootnoteNode, pt as $isCodeBlockNode, r as editorTheme, v as RichQuoteNode, vt as BannerNode, w as MentionNode, wt as AlertQuoteNode, x as MermaidNode, xt as $isAlertQuoteNode, yt as normalizeBannerType } from "./ColorSchemeContext-DLWz8vFw.js";
2
+ import { b as BANNER_NODE_KEY, m as RendererWrapper, s as useFootnoteDefinitions, v as useVariant, x as CODE_BLOCK_NODE_KEY, y as ALERT_NODE_KEY } from "./LinkCardRenderer-D4mQbUQo.js";
3
+ import { n as semanticClassNames, r as sharedStyles } from "./shared.css-DRoqE_U-.js";
4
+ import { r as SpoilerNode } from "./SpoilerNode-D7Tgdo2K.js";
4
5
  import { t as _defineProperty } from "./defineProperty-BYhxpJwd.js";
5
- import { A as $isCodeBlockNode, F as BannerNode, I as normalizeBannerType, L as BannerRenderer, M as $isBannerNode, S as FileNode, T as DetailsNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, j as CodeBlockNode, k as CommentNode, n as useColorScheme, p as LinkCardNode, s as VideoNode, u as RubyNode, y as FootnoteSectionNode } from "./ColorSchemeContext-Dc_HebHd.js";
6
- import { n as gridStyles, t as gridClassNames } from "./grid.css-DJWKdYpz.js";
7
- import { a as useNestedEditorSync, i as createNestedEditor, n as AlertQuoteEditNode, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-DFg-xOND.js";
6
+ import { t as clsx } from "./utils-i78C9io3.js";
7
+ import { n as gridStyles, t as gridClassNames } from "./grid.css-DAMDDTZh.js";
8
+ import { n as useNestedEditorPlugins } from "./NestedEditorPluginsContext-DKFdozOE.js";
9
+ import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
10
+ import { ListPlugin } from "@lexical/react/LexicalListPlugin";
11
+ import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
12
+ import { AutoLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
8
13
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
9
14
  import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
10
- import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection, COMMAND_PRIORITY_HIGH, KEY_DOWN_COMMAND } from "lexical";
15
+ import { HeadingNode, QuoteNode } from "@lexical/rich-text";
16
+ import { $addUpdateTag, $createNodeSelection, $createParagraphNode, $getEditor, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isTextNode, $nodesOfType, $setSelection, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, HISTORY_MERGE_TAG, KEY_ARROW_DOWN_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, PASTE_COMMAND, SKIP_DOM_SELECTION_TAG, createEditor } from "lexical";
17
+ import { HorizontalRuleNode } from "@lexical/extension";
11
18
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
- import { Flag, LayoutGrid, Minus, Plus } from "lucide-react";
19
+ import { CodeNode } from "@lexical/code-core";
20
+ import { ListItemNode, ListNode } from "@lexical/list";
21
+ import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
22
+ import { Flag, Info, LayoutGrid, Lightbulb, Minus, Plus, TriangleAlert } from "lucide-react";
13
23
  import { ContentEditable } from "@lexical/react/LexicalContentEditable";
14
24
  import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
15
25
  import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
@@ -21,6 +31,9 @@ var codeBlockCursorIntentMap = /* @__PURE__ */ new Map();
21
31
  function setCodeBlockCursorIntent(nodeKey, placement) {
22
32
  codeBlockCursorIntentMap.set(nodeKey, placement);
23
33
  }
34
+ function peekCodeBlockCursorIntent(nodeKey) {
35
+ return codeBlockCursorIntentMap.get(nodeKey) ?? null;
36
+ }
24
37
  function consumeCodeBlockCursorIntent(nodeKey) {
25
38
  const placement = codeBlockCursorIntentMap.get(nodeKey);
26
39
  if (!placement) return null;
@@ -28,11 +41,359 @@ function consumeCodeBlockCursorIntent(nodeKey) {
28
41
  return placement;
29
42
  }
30
43
  //#endregion
44
+ //#region src/plugins/PasteLinkPlugin.tsx
45
+ var LINK_PROTOCOLS = /* @__PURE__ */ new Set([
46
+ "http:",
47
+ "https:",
48
+ "mailto:",
49
+ "tel:"
50
+ ]);
51
+ function toPureUrl(raw) {
52
+ const text = raw?.trim();
53
+ if (!text || /\s/.test(text)) return null;
54
+ try {
55
+ return LINK_PROTOCOLS.has(new URL(text).protocol) ? text : null;
56
+ } catch {
57
+ return null;
58
+ }
59
+ }
60
+ function PasteLinkPlugin() {
61
+ const [editor] = useLexicalComposerContext();
62
+ useEffect(() => {
63
+ return editor.registerCommand(PASTE_COMMAND, (event) => {
64
+ if (!(event instanceof ClipboardEvent)) return false;
65
+ const selection = $getSelection();
66
+ if (!$isRangeSelection(selection) || selection.isCollapsed()) return false;
67
+ const url = toPureUrl(event.clipboardData?.getData("text/plain"));
68
+ if (!url) return false;
69
+ const textNodes = selection.getNodes().filter($isTextNode);
70
+ if (textNodes.length === 0) return false;
71
+ if (textNodes.some((node) => !node.isSimpleText())) return false;
72
+ const block = textNodes[0].getTopLevelElement();
73
+ if (!block || textNodes.some((node) => node.getTopLevelElement() !== block)) return false;
74
+ event.preventDefault();
75
+ editor.dispatchCommand(TOGGLE_LINK_COMMAND, url);
76
+ return true;
77
+ }, COMMAND_PRIORITY_HIGH);
78
+ }, [editor]);
79
+ return null;
80
+ }
81
+ //#endregion
82
+ //#region src/components/decorators/NestedEditorCorePlugins.tsx
83
+ function NestedEditorCorePlugins() {
84
+ const [editor] = useLexicalComposerContext();
85
+ const nestedEditorPlugins = useNestedEditorPlugins();
86
+ const hasTables = editor.hasNodes([
87
+ TableNode,
88
+ TableRowNode,
89
+ TableCellNode
90
+ ]);
91
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
92
+ /* @__PURE__ */ jsx(ListPlugin, {}),
93
+ /* @__PURE__ */ jsx(LinkPlugin, {}),
94
+ /* @__PURE__ */ jsx(PasteLinkPlugin, {}),
95
+ hasTables && /* @__PURE__ */ jsx(TablePlugin, { hasHorizontalScroll: true }),
96
+ nestedEditorPlugins
97
+ ] });
98
+ }
99
+ //#endregion
100
+ //#region src/utils/nested-editor-sync.ts
101
+ function registerNestedEditorSync(parentEditor, nestedEditor, ownerKey) {
102
+ let synced = JSON.stringify(nestedEditor.getEditorState().toJSON());
103
+ return nestedEditor.registerUpdateListener(({ dirtyElements, dirtyLeaves, editorState }) => {
104
+ if (dirtyElements.size === 0 && dirtyLeaves.size === 0) return;
105
+ const content = JSON.stringify(editorState.toJSON());
106
+ if (content === synced) return;
107
+ synced = content;
108
+ parentEditor.update(() => {
109
+ const owner = $getNodeByKey(ownerKey);
110
+ if (!owner) return;
111
+ $addUpdateTag(HISTORY_MERGE_TAG);
112
+ $addUpdateTag(SKIP_DOM_SELECTION_TAG);
113
+ owner.markDirty();
114
+ });
115
+ });
116
+ }
117
+ //#endregion
118
+ //#region src/components/decorators/useNestedEditorSync.ts
119
+ function useNestedEditorSync(nestedEditors, ownerKey) {
120
+ const [editor] = useLexicalComposerContext();
121
+ useEffect(() => {
122
+ const unregisters = nestedEditors.map((nested) => registerNestedEditorSync(editor, nested, ownerKey));
123
+ return () => unregisters.forEach((unregister) => unregister());
124
+ }, [
125
+ editor,
126
+ nestedEditors,
127
+ ownerKey
128
+ ]);
129
+ }
130
+ //#endregion
131
+ //#region src/components/decorators/AlertEditDecorator.tsx
132
+ function ExitBlockPlugin({ parentEditor, nodeKey }) {
133
+ const [editor] = useLexicalComposerContext();
134
+ useEffect(() => {
135
+ const focusParent = () => {
136
+ parentEditor.focus(() => {
137
+ parentEditor.update(() => {
138
+ const alertNode = $getNodeByKey(nodeKey);
139
+ if (alertNode) {
140
+ const next = alertNode.getNextSibling();
141
+ if (next) next.selectStart();
142
+ }
143
+ });
144
+ });
145
+ };
146
+ const exitAlert = (removeEmpty) => {
147
+ const root = $getRoot();
148
+ const lastChild = root.getLastChild();
149
+ const shouldRemoveAlert = removeEmpty && root.getChildrenSize() <= 1;
150
+ if (removeEmpty && lastChild) lastChild.remove();
151
+ if (shouldRemoveAlert) parentEditor.update(() => {
152
+ const alertNode = $getNodeByKey(nodeKey);
153
+ if (alertNode) {
154
+ const paragraph = $createParagraphNode();
155
+ alertNode.insertAfter(paragraph);
156
+ alertNode.remove();
157
+ paragraph.selectStart();
158
+ }
159
+ }, { onUpdate: focusParent });
160
+ else parentEditor.update(() => {
161
+ const alertNode = $getNodeByKey(nodeKey);
162
+ if (alertNode) {
163
+ let next = alertNode.getNextSibling();
164
+ if (!next || !$isParagraphNode(next)) {
165
+ next = $createParagraphNode();
166
+ alertNode.insertAfter(next);
167
+ }
168
+ next.selectStart();
169
+ }
170
+ }, { onUpdate: focusParent });
171
+ };
172
+ const isAtLastEmptyParagraph = () => {
173
+ const selection = $getSelection();
174
+ if (!$isRangeSelection(selection) || !selection.isCollapsed()) return false;
175
+ const topLevelElement = selection.anchor.getNode().getTopLevelElement();
176
+ return topLevelElement && $isParagraphNode(topLevelElement) && topLevelElement.getTextContent() === "" && topLevelElement.getNextSibling() === null;
177
+ };
178
+ const unregisterEnter = editor.registerCommand(KEY_ENTER_COMMAND, (event) => {
179
+ if (event?.metaKey || event?.ctrlKey) {
180
+ event.preventDefault();
181
+ exitAlert(false);
182
+ return true;
183
+ }
184
+ if (!isAtLastEmptyParagraph()) return false;
185
+ event?.preventDefault();
186
+ exitAlert(true);
187
+ return true;
188
+ }, COMMAND_PRIORITY_CRITICAL);
189
+ const unregisterArrowDown = editor.registerCommand(KEY_ARROW_DOWN_COMMAND, (event) => {
190
+ if (!isAtLastEmptyParagraph()) return false;
191
+ event?.preventDefault();
192
+ exitAlert(false);
193
+ return true;
194
+ }, COMMAND_PRIORITY_HIGH);
195
+ return () => {
196
+ unregisterEnter();
197
+ unregisterArrowDown();
198
+ };
199
+ }, [
200
+ editor,
201
+ parentEditor,
202
+ nodeKey
203
+ ]);
204
+ return null;
205
+ }
206
+ function AlertEditDecorator({ nodeKey, alertType, contentEditor }) {
207
+ const [editor] = useLexicalComposerContext();
208
+ useNestedEditorSync(useMemo(() => [contentEditor], [contentEditor]), nodeKey);
209
+ const editable = editor.isEditable();
210
+ const handleTypeChange = useCallback((newType) => {
211
+ editor.update(() => {
212
+ const node = $getNodeByKey(nodeKey);
213
+ if ($isAlertQuoteNode(node)) node.setAlertType(newType);
214
+ });
215
+ }, [editor, nodeKey]);
216
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(RendererWrapper, {
217
+ defaultRenderer: AlertRenderer,
218
+ rendererKey: ALERT_NODE_KEY,
219
+ props: {
220
+ type: alertType,
221
+ editable,
222
+ onTypeChange: editable ? handleTypeChange : void 0
223
+ }
224
+ }), /* @__PURE__ */ jsx("div", {
225
+ className: "rich-alert-content",
226
+ children: /* @__PURE__ */ jsxs(LexicalNestedComposer, {
227
+ initialEditor: contentEditor,
228
+ children: [
229
+ /* @__PURE__ */ jsx(RichTextPlugin, {
230
+ ErrorBoundary: LexicalErrorBoundary,
231
+ contentEditable: /* @__PURE__ */ jsx(ContentEditable, {
232
+ "aria-placeholder": "",
233
+ className: "rich-alert-content-editable",
234
+ placeholder: /* @__PURE__ */ jsx("span", { style: { display: "none" } }),
235
+ style: { outline: "none" }
236
+ })
237
+ }),
238
+ /* @__PURE__ */ jsx(NestedEditorCorePlugins, {}),
239
+ /* @__PURE__ */ jsx(ExitBlockPlugin, {
240
+ nodeKey,
241
+ parentEditor: editor
242
+ })
243
+ ]
244
+ })
245
+ })] });
246
+ }
247
+ //#endregion
248
+ //#region src/nodes/shared.ts
249
+ var NESTED_EDITOR_NODES = [
250
+ HeadingNode,
251
+ QuoteNode,
252
+ RichQuoteNode,
253
+ {
254
+ replace: QuoteNode,
255
+ with: () => new RichQuoteNode()
256
+ },
257
+ ListNode,
258
+ ListItemNode,
259
+ LinkNode,
260
+ AutoLinkNode,
261
+ HorizontalRuleNode,
262
+ CodeNode,
263
+ TableNode,
264
+ TableCellNode,
265
+ TableRowNode,
266
+ SpoilerNode,
267
+ MentionNode,
268
+ FootnoteNode,
269
+ KaTeXInlineNode,
270
+ TagNode
271
+ ];
272
+ function $tryGetEditor() {
273
+ try {
274
+ return $getEditor();
275
+ } catch {
276
+ return null;
277
+ }
278
+ }
279
+ function createNestedEditor(fallbackNamespace) {
280
+ if ($tryGetEditor()) return createEditor();
281
+ return createEditor({
282
+ namespace: fallbackNamespace,
283
+ nodes: NESTED_EDITOR_NODES,
284
+ theme: editorTheme,
285
+ onError: (error) => console.error(`[${fallbackNamespace}]`, error)
286
+ });
287
+ }
288
+ //#endregion
289
+ //#region src/nodes/AlertQuoteEditNode.ts
290
+ function createContentEditor$1() {
291
+ return createNestedEditor("AlertContent");
292
+ }
293
+ var AlertQuoteEditNode = class AlertQuoteEditNode extends AlertQuoteNode {
294
+ static clone(node) {
295
+ const cloned = new AlertQuoteEditNode(node.__alertType, node.__contentState, node.__key);
296
+ cloned.__contentEditor = node.__contentEditor;
297
+ return cloned;
298
+ }
299
+ constructor(alertType, contentState, key) {
300
+ super(alertType, contentState, key);
301
+ _defineProperty(this, "__contentEditor", void 0);
302
+ this.__contentEditor = createContentEditor$1();
303
+ if (contentState) {
304
+ const editorState = this.__contentEditor.parseEditorState(contentState);
305
+ this.__contentEditor.setEditorState(editorState);
306
+ }
307
+ }
308
+ getContentEditor() {
309
+ return this.__contentEditor;
310
+ }
311
+ static importJSON(_serializedNode) {
312
+ const serializedNode = _serializedNode;
313
+ return new AlertQuoteEditNode(serializedNode.alertType, serializedNode.content).updateFromJSON(_serializedNode);
314
+ }
315
+ exportJSON() {
316
+ return {
317
+ ...super.exportJSON(),
318
+ type: "alert-quote",
319
+ alertType: this.__alertType,
320
+ content: this.__contentEditor.getEditorState().toJSON(),
321
+ version: 1
322
+ };
323
+ }
324
+ decorate(_editor, _config) {
325
+ return createElement(AlertEditDecorator, {
326
+ nodeKey: this.__key,
327
+ alertType: this.__alertType,
328
+ contentEditor: this.__contentEditor
329
+ });
330
+ }
331
+ };
332
+ _defineProperty(AlertQuoteEditNode, "commandItems", [
333
+ {
334
+ title: "Callout",
335
+ icon: createElement(Info, { size: 20 }),
336
+ description: "Info callout block",
337
+ keywords: [
338
+ "alert",
339
+ "note",
340
+ "info",
341
+ "callout"
342
+ ],
343
+ section: "ADVANCED",
344
+ placement: ["slash", "toolbar"],
345
+ group: "insert",
346
+ onSelect: (editor) => {
347
+ editor.update(() => {
348
+ $insertNodes([$createAlertQuoteEditNode("note")]);
349
+ });
350
+ }
351
+ },
352
+ {
353
+ title: "Tip",
354
+ icon: createElement(Lightbulb, { size: 20 }),
355
+ description: "Highlight a useful tip",
356
+ keywords: [
357
+ "alert",
358
+ "tip",
359
+ "hint"
360
+ ],
361
+ section: "ADVANCED",
362
+ placement: ["slash", "toolbar"],
363
+ group: "insert",
364
+ onSelect: (editor) => {
365
+ editor.update(() => {
366
+ $insertNodes([$createAlertQuoteEditNode("tip")]);
367
+ });
368
+ }
369
+ },
370
+ {
371
+ title: "Warning",
372
+ icon: createElement(TriangleAlert, { size: 20 }),
373
+ description: "Warn about something",
374
+ keywords: [
375
+ "alert",
376
+ "warning",
377
+ "caution"
378
+ ],
379
+ section: "ADVANCED",
380
+ placement: ["slash", "toolbar"],
381
+ group: "insert",
382
+ onSelect: (editor) => {
383
+ editor.update(() => {
384
+ $insertNodes([$createAlertQuoteEditNode("warning")]);
385
+ });
386
+ }
387
+ }
388
+ ]);
389
+ function $createAlertQuoteEditNode(alertType, contentState) {
390
+ return new AlertQuoteEditNode(alertType, contentState);
391
+ }
392
+ //#endregion
31
393
  //#region src/components/decorators/BannerEditDecorator.tsx
32
394
  function BannerEditDecorator({ nodeKey, bannerType, contentEditor }) {
33
395
  const [editor] = useLexicalComposerContext();
34
- const contentEditors = useMemo(() => [contentEditor], [contentEditor]);
35
- useNestedEditorSync(contentEditors, nodeKey);
396
+ useNestedEditorSync(useMemo(() => [contentEditor], [contentEditor]), nodeKey);
36
397
  const editable = editor.isEditable();
37
398
  const handleTypeChange = useCallback((newType) => {
38
399
  editor.update(() => {
@@ -151,17 +512,22 @@ function $createBannerEditNode(bannerType, contentState) {
151
512
  function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersProp }) {
152
513
  const variant = useVariant();
153
514
  const showLineNumbers = showLineNumbersProp ?? (variant !== "comment" && variant !== "chat");
154
- const colorScheme = useColorScheme();
155
- const [highlightedHtml, setHighlightedHtml] = useState(null);
515
+ const theme = useColorScheme() === "dark" ? "dark" : "light";
516
+ const [highlighted, setHighlighted] = useState(null);
517
+ const highlightedHtml = highlighted?.code === code && highlighted.language === language && highlighted.theme === theme ? highlighted.html : null;
156
518
  const [copied, setCopied] = useState(false);
157
519
  const copyTimerRef = useRef(void 0);
158
520
  useEffect(() => {
159
521
  let cancelled = false;
160
- setHighlightedHtml(null);
161
- highlightCode(code, language, colorScheme === "dark" ? "dark" : "light").then((html) => {
162
- if (!cancelled) setHighlightedHtml(html);
522
+ highlightCode(code, language, theme).then((html) => {
523
+ if (!cancelled) setHighlighted({
524
+ code,
525
+ language,
526
+ theme,
527
+ html
528
+ });
163
529
  }).catch(() => {
164
- if (!cancelled) setHighlightedHtml(null);
530
+ if (!cancelled) setHighlighted(null);
165
531
  });
166
532
  return () => {
167
533
  cancelled = true;
@@ -169,7 +535,7 @@ function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersPro
169
535
  }, [
170
536
  code,
171
537
  language,
172
- colorScheme
538
+ theme
173
539
  ]);
174
540
  useEffect(() => {
175
541
  return () => clearTimeout(copyTimerRef.current);
@@ -202,13 +568,14 @@ function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersPro
202
568
  children: [header, /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: highlightedHtml } })]
203
569
  });
204
570
  const lines = code.split("\n");
571
+ const lineKeys = occurrenceKeys(lines);
205
572
  return /* @__PURE__ */ jsxs("div", {
206
573
  className: wrapperClass,
207
574
  style: gutterStyle,
208
575
  children: [header, /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("span", {
209
576
  className: "line",
210
577
  children: [line, i < lines.length - 1 ? "\n" : ""]
211
- }, i)) }) })]
578
+ }, lineKeys[i])) }) })]
212
579
  });
213
580
  }
214
581
  //#endregion
@@ -216,30 +583,37 @@ function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersPro
216
583
  function CodeBlockEditDecorator({ nodeKey, code, language }) {
217
584
  const [editor] = useLexicalComposerContext();
218
585
  const [isSelected] = useLexicalNodeSelection(nodeKey);
219
- const [shouldFocusEditor, setShouldFocusEditor] = useState(false);
220
- const [cursorPlacement, setCursorPlacement] = useState("start");
221
586
  const editable = editor.isEditable();
222
- useEffect(() => {
223
- if (!editable || !isSelected) {
224
- setShouldFocusEditor(false);
225
- return;
587
+ const [focusTarget, setFocusTarget] = useState({
588
+ cursorPlacement: "start",
589
+ editable: false,
590
+ isSelected: false,
591
+ nodeKey,
592
+ shouldFocusEditor: false
593
+ });
594
+ if (focusTarget.editable !== editable || focusTarget.isSelected !== isSelected || focusTarget.nodeKey !== nodeKey) {
595
+ let shouldFocusEditor = false;
596
+ let { cursorPlacement } = focusTarget;
597
+ if (editable && isSelected) {
598
+ editor.getEditorState().read(() => {
599
+ const selection = $getSelection();
600
+ const selectedNodes = $isNodeSelection(selection) ? selection.getNodes() : null;
601
+ shouldFocusEditor = selectedNodes !== null && selectedNodes.length === 1 && selectedNodes[0]?.getKey() === nodeKey;
602
+ });
603
+ if (shouldFocusEditor) cursorPlacement = peekCodeBlockCursorIntent(nodeKey) ?? "start";
226
604
  }
227
- let nextShouldFocus = false;
228
- let nextCursorPlacement = "start";
229
- editor.getEditorState().read(() => {
230
- const selection = $getSelection();
231
- const selectedNodes = $isNodeSelection(selection) ? selection.getNodes() : null;
232
- nextShouldFocus = selectedNodes !== null && selectedNodes.length === 1 && selectedNodes[0]?.getKey() === nodeKey;
233
- if (nextShouldFocus) nextCursorPlacement = consumeCodeBlockCursorIntent(nodeKey) ?? "start";
605
+ setFocusTarget({
606
+ cursorPlacement,
607
+ editable,
608
+ isSelected,
609
+ nodeKey,
610
+ shouldFocusEditor
234
611
  });
235
- setShouldFocusEditor(nextShouldFocus);
236
- if (nextShouldFocus) setCursorPlacement(nextCursorPlacement);
237
- }, [
238
- editable,
239
- editor,
240
- isSelected,
241
- nodeKey
242
- ]);
612
+ }
613
+ const { shouldFocusEditor, cursorPlacement } = focusTarget;
614
+ useEffect(() => {
615
+ if (focusTarget.shouldFocusEditor) consumeCodeBlockCursorIntent(focusTarget.nodeKey);
616
+ }, [focusTarget]);
243
617
  useEffect(() => {
244
618
  if (!editable || !isSelected) return;
245
619
  return editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
@@ -607,7 +981,7 @@ function GridEditDecorator({ nodeKey, autoFocusOnMount, cols: initialCols, gap,
607
981
  gridTemplateColumns: `repeat(${currentCols}, 1fr)`,
608
982
  gap
609
983
  },
610
- children: cellEditors.map((cellEditor, i) => /* @__PURE__ */ jsx("div", {
984
+ children: cellEditors.map((cellEditor) => /* @__PURE__ */ jsx("div", {
611
985
  className: clsx(gridClassNames.cell, gridStyles.cell),
612
986
  children: /* @__PURE__ */ jsxs(LexicalNestedComposer, {
613
987
  initialEditor: cellEditor,
@@ -620,7 +994,7 @@ function GridEditDecorator({ nodeKey, autoFocusOnMount, cols: initialCols, gap,
620
994
  })
621
995
  }), /* @__PURE__ */ jsx(NestedEditorCorePlugins, {})]
622
996
  })
623
- }, i))
997
+ }, cellEditor.getKey()))
624
998
  })] });
625
999
  }
626
1000
  //#endregion
@@ -819,4 +1193,4 @@ function getResolvedEditNodes() {
819
1193
  return _resolvedEditNodes ?? allEditNodes;
820
1194
  }
821
1195
  //#endregion
822
- export { FootnoteSectionEditNode as a, setCodeBlockCursorIntent as c, customEditNodes as i, setResolvedEditNodes as n, $createCodeBlockEditNode as o, allEditNodes as r, $createBannerEditNode as s, getResolvedEditNodes as t };
1196
+ export { FootnoteSectionEditNode as a, $createAlertQuoteEditNode as c, useNestedEditorSync as d, registerNestedEditorSync as f, setCodeBlockCursorIntent as h, customEditNodes as i, NESTED_EDITOR_NODES as l, PasteLinkPlugin as m, setResolvedEditNodes as n, $createCodeBlockEditNode as o, NestedEditorCorePlugins as p, allEditNodes as r, $createBannerEditNode as s, getResolvedEditNodes as t, createNestedEditor as u };
@@ -1,4 +1,4 @@
1
- import { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical';
1
+ import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical';
2
2
  type EditorNodeConfig = Klass<LexicalNode> | LexicalNodeReplacement;
3
3
  export declare function setResolvedEditNodes(nodes: Array<EditorNodeConfig>): void;
4
4
  export declare function getResolvedEditNodes(): Array<EditorNodeConfig>;
@@ -1 +1 @@
1
- {"version":3,"file":"node-registry.d.ts","sourceRoot":"","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAI1E,KAAK,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC;AAIpE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAEzE;AAED,wBAAgB,oBAAoB,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAE9D"}
1
+ {"version":3,"file":"node-registry.d.ts","sources":["../src/node-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAI1E,KAAK,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC;AAIpE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAEzE;AAED,wBAAgB,oBAAoB,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAE9D"}
@@ -1,7 +1,7 @@
1
- import { EditorConfig, LexicalEditor, SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
- import { ReactElement } from 'react';
3
- import { CommandItemConfig } from '../types/slash-menu';
4
- import { AlertQuoteNode, AlertType, SerializedAlertQuoteNode } from './AlertQuoteNode';
1
+ import type { EditorConfig, LexicalEditor, SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
+ import type { ReactElement } from 'react';
3
+ import type { CommandItemConfig } from '../types/slash-menu';
4
+ import { AlertQuoteNode, type AlertType, type SerializedAlertQuoteNode } from './AlertQuoteNode';
5
5
  export declare class AlertQuoteEditNode extends AlertQuoteNode {
6
6
  __contentEditor: LexicalEditor;
7
7
  static commandItems: CommandItemConfig[];
@@ -1 +1 @@
1
- {"version":3,"file":"AlertQuoteEditNode.d.ts","sourceRoot":"","sources":["../../src/nodes/AlertQuoteEditNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAOjG,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,eAAe,EAAE,aAAa,CAAC;IAE/B,MAAM,CAAC,YAAY,EAAE,iBAAiB,EAAE,CA2CtC;IAEF,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB;gBAM9C,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,E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B,CAQrC;IAED,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAMpE;CACF;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,qBAAqB,GACnC,kBAAkB,CAEpB"}
@@ -1,5 +1,6 @@
1
- import { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode } from 'lexical';
2
- import { ReactElement } from 'react';
1
+ import type { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditorState, SerializedLexicalNode, Spread } from 'lexical';
2
+ import { DecoratorNode } from 'lexical';
3
+ import type { ReactElement } from 'react';
3
4
  export type AlertType = 'note' | 'tip' | 'important' | 'warning' | 'caution';
4
5
  export declare const ALERT_TYPES: AlertType[];
5
6
  export declare const ALERT_LABELS: Record<AlertType, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"AlertQuoteNode.d.ts","sourceRoot":"","sources":["../../src/nodes/AlertQuoteNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7E,eAAO,MAAM,WAAW,EAAE,SAAS,EAAuD,CAAC;AAE3F,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAMlD,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAC3C;IACE,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,qBAAqB,CAAC;CAChC,E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BAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,cAAc,CAKhB;IAED,UAAU,IAAI,wBAAwB,CAQrC;IAED,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAKpE;CACF;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,YAAY,CAAC,EAAE,qBAAqB,GACnC,cAAc,CAEhB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,cAAc,CAE9F"}
@@ -1,7 +1,7 @@
1
- import { EditorConfig, LexicalEditor, SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
- import { ReactElement } from 'react';
3
- import { CommandItemConfig } from '../types/slash-menu';
4
- import { BannerNode, BannerType, SerializedBannerNode } from './BannerNode';
1
+ import type { EditorConfig, LexicalEditor, SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
+ import type { ReactElement } from 'react';
3
+ import type { CommandItemConfig } from '../types/slash-menu';
4
+ import { BannerNode, type BannerType, type SerializedBannerNode } from './BannerNode';
5
5
  export declare class BannerEditNode extends BannerNode {
6
6
  __contentEditor: LexicalEditor;
7
7
  static commandItems: CommandItemConfig[];
@@ -1 +1 @@
1
- {"version":3,"file":"BannerEditNode.d.ts","sourceRoot":"","sources":["../../src/nodes/BannerEditNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAC;AAWtB,qBAAa,cAAe,SAAQ,UAAU;IA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AAgB,IAAI,aAAa,CAEhC;IAED,MAAM,CAAC,UAAU,CACf,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,cAAc,CAwBhB;IAED,UAAU,IAAI,oBAAoB,CAQjC;IAED,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY,CAMpE;CACF;AAED,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,YAAY,CAAC,EAAE,qBAAqB,GACnC,cAAc,CAEhB"}
@@ -1,5 +1,6 @@
1
- import { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditorState, SerializedLexicalNode, Spread, DecoratorNode } from 'lexical';
2
- import { ReactElement } from 'react';
1
+ import type { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditorState, SerializedLexicalNode, Spread } from 'lexical';
2
+ import { DecoratorNode } from 'lexical';
3
+ import type { ReactElement } from 'react';
3
4
  export type BannerType = 'note' | 'tip' | 'important' | 'warning' | 'caution';
4
5
  export declare function normalizeBannerType(type: string): BannerType;
5
6
  export declare const BANNER_TYPES: BannerType[];
@@ -1 +1 @@
1
- {"version":3,"file":"BannerNode.d.ts","sourceRoot":"","sources":["../../src/nodes/BannerNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAQ9E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAG5D;AAED,eAAO,MAAM,YAAY,EAA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