@maketribe/ms-app 3.2.32 → 3.2.34

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 (375) hide show
  1. package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue.js +74 -0
  2. package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue.js.map +1 -0
  3. package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue2.js +4 -0
  4. package/dist/cjs/components/basic/doc-editor/core/LexicalComposer.vue2.js.map +1 -0
  5. package/dist/cjs/components/basic/doc-editor/core/composables/inject.js +5 -0
  6. package/dist/cjs/components/basic/doc-editor/core/composables/inject.js.map +1 -0
  7. package/dist/cjs/components/basic/doc-editor/core/composables/listenerManager.js +18 -0
  8. package/dist/cjs/components/basic/doc-editor/core/composables/listenerManager.js.map +1 -0
  9. package/dist/cjs/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js +31 -0
  10. package/dist/cjs/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js.map +1 -0
  11. package/dist/cjs/components/basic/doc-editor/core/composables/useDecorators.js +31 -0
  12. package/dist/cjs/components/basic/doc-editor/core/composables/useDecorators.js.map +1 -0
  13. package/dist/cjs/components/basic/doc-editor/core/composables/useHistory.js +15 -0
  14. package/dist/cjs/components/basic/doc-editor/core/composables/useHistory.js.map +1 -0
  15. package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalComposer.js +17 -0
  16. package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalComposer.js.map +1 -0
  17. package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalTextEntity.js +16 -0
  18. package/dist/cjs/components/basic/doc-editor/core/composables/useLexicalTextEntity.js.map +1 -0
  19. package/dist/cjs/components/basic/doc-editor/core/composables/useList.js +48 -0
  20. package/dist/cjs/components/basic/doc-editor/core/composables/useList.js.map +1 -0
  21. package/dist/cjs/components/basic/doc-editor/core/composables/useMounted.js +14 -0
  22. package/dist/cjs/components/basic/doc-editor/core/composables/useMounted.js.map +1 -0
  23. package/dist/cjs/components/basic/doc-editor/core/composables/useRichTextSetup.js +16 -0
  24. package/dist/cjs/components/basic/doc-editor/core/composables/useRichTextSetup.js.map +1 -0
  25. package/dist/cjs/components/basic/doc-editor/core/element-block.js +60 -66
  26. package/dist/cjs/components/basic/doc-editor/core/element-block.js.map +1 -1
  27. package/dist/cjs/components/basic/doc-editor/core/index.js +14 -0
  28. package/dist/cjs/components/basic/doc-editor/core/index.js.map +1 -1
  29. package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin/nodes/RichTextNode.js → core/nodes/RichElementNode.js} +81 -35
  30. package/dist/cjs/components/basic/doc-editor/core/nodes/RichElementNode.js.map +1 -0
  31. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js +42 -0
  32. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js.map +1 -0
  33. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js +4 -0
  34. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js.map +1 -0
  35. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js +4 -0
  36. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js.map +1 -0
  37. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js +37 -0
  38. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js.map +1 -0
  39. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js +176 -0
  40. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js.map +1 -0
  41. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js +215 -0
  42. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js.map +1 -0
  43. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js +4 -0
  44. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js.map +1 -0
  45. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js +75 -0
  46. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js.map +1 -0
  47. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js +4 -0
  48. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js.map +1 -0
  49. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js +29 -0
  50. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js.map +1 -0
  51. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js +4 -0
  52. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js.map +1 -0
  53. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js +4 -0
  54. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js.map +1 -0
  55. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js +77 -0
  56. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js.map +1 -0
  57. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js +25 -0
  58. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js.map +1 -0
  59. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js +4 -0
  60. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js.map +1 -0
  61. package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.js +14 -3
  62. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/ContentEditable.vue.js.map +1 -0
  63. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js +24 -0
  64. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js.map +1 -0
  65. package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.js +20 -9
  66. package/dist/cjs/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/index.vue.js.map +1 -0
  67. package/dist/cjs/components/basic/doc-editor/editor.vue.js +22 -12
  68. package/dist/cjs/components/basic/doc-editor/editor.vue.js.map +1 -1
  69. package/dist/cjs/components/basic/doc-editor/index.js +2 -0
  70. package/dist/cjs/components/basic/doc-editor/index.js.map +1 -1
  71. package/dist/cjs/components/basic/doc-editor/{plugins/nodes.js → nodes.js} +13 -11
  72. package/dist/cjs/components/basic/doc-editor/nodes.js.map +1 -0
  73. package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js +5 -3
  74. package/dist/cjs/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js.map +1 -1
  75. package/dist/cjs/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js +215 -68
  76. package/dist/cjs/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
  77. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/GridNode.js +39 -39
  78. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/GridNode.js.map +1 -1
  79. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js +8 -1
  80. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js.map +1 -1
  81. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js +32 -23
  82. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js.map +1 -1
  83. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js +33 -18
  84. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js.map +1 -1
  85. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js +8 -1
  86. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js.map +1 -1
  87. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +14 -54
  88. package/dist/cjs/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
  89. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js +4 -0
  90. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js.map +1 -1
  91. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +38 -33
  92. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
  93. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/utils.js +2 -2
  94. package/dist/cjs/components/basic/doc-editor/plugins/ImagePlugin/utils.js.map +1 -1
  95. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js +16 -9
  96. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js.map +1 -1
  97. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/composables.js +11 -10
  98. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/composables.js.map +1 -1
  99. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js +15 -28
  100. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
  101. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/utils.js +3 -1
  102. package/dist/cjs/components/basic/doc-editor/plugins/ModulePlugin/utils.js.map +1 -1
  103. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/commands.js +6 -0
  104. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/commands.js.map +1 -0
  105. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +127 -0
  106. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -0
  107. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +36 -0
  108. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -0
  109. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js +4 -0
  110. package/dist/cjs/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js.map +1 -0
  111. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +9 -4
  112. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js.map +1 -1
  113. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js +10 -2
  114. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
  115. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +17 -4
  116. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js.map +1 -1
  117. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js +10 -2
  118. package/dist/cjs/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
  119. package/dist/cjs/components/basic/doc-editor/themes/doc-editor-edit.css.js +1 -1
  120. package/dist/cjs/components/basic/doc-editor/themes/doc-editor-edit.css.js.map +1 -1
  121. package/dist/cjs/components/basic/doc-editor/themes/doc-theme.css.js +1 -2
  122. package/dist/cjs/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
  123. package/dist/cjs/index.js +2 -0
  124. package/dist/cjs/index.js.map +1 -1
  125. package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +1 -10
  126. package/dist/cjs/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
  127. package/dist/cjs/modules/cms/pages/cms-contents/components/article-list.vue.js +180 -48
  128. package/dist/cjs/modules/cms/pages/cms-contents/components/article-list.vue.js.map +1 -1
  129. package/dist/cjs/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js +44 -22
  130. package/dist/cjs/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js.map +1 -1
  131. package/dist/cjs/modules/cms/pages/cms-contents/components/part-info.vue.js +1 -11
  132. package/dist/cjs/modules/cms/pages/cms-contents/components/part-info.vue.js.map +1 -1
  133. package/dist/cjs/modules/cms/pages/cms-contents/index.vue2.js +11 -6
  134. package/dist/cjs/modules/cms/pages/cms-contents/index.vue2.js.map +1 -1
  135. package/dist/cjs/modules/ms/components/rich-text-editor/index.js.map +1 -1
  136. package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor-options.js +3 -5
  137. package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor-options.js.map +1 -1
  138. package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor.js +5 -4
  139. package/dist/cjs/modules/ms/components/rich-text-editor/rich-text-editor.js.map +1 -1
  140. package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue.js +75 -0
  141. package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue.js.map +1 -0
  142. package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue2.js +5 -0
  143. package/dist/esm/components/basic/doc-editor/core/LexicalComposer.vue2.js.map +1 -0
  144. package/dist/esm/components/basic/doc-editor/core/composables/inject.js +5 -0
  145. package/dist/esm/components/basic/doc-editor/core/composables/inject.js.map +1 -0
  146. package/dist/esm/components/basic/doc-editor/core/composables/listenerManager.js +18 -0
  147. package/dist/esm/components/basic/doc-editor/core/composables/listenerManager.js.map +1 -0
  148. package/dist/esm/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js +31 -0
  149. package/dist/esm/components/basic/doc-editor/core/composables/useCanShowPlaceholder.js.map +1 -0
  150. package/dist/esm/components/basic/doc-editor/core/composables/useDecorators.js +31 -0
  151. package/dist/esm/components/basic/doc-editor/core/composables/useDecorators.js.map +1 -0
  152. package/dist/esm/components/basic/doc-editor/core/composables/useHistory.js +15 -0
  153. package/dist/esm/components/basic/doc-editor/core/composables/useHistory.js.map +1 -0
  154. package/dist/esm/components/basic/doc-editor/core/composables/useLexicalComposer.js +17 -0
  155. package/dist/esm/components/basic/doc-editor/core/composables/useLexicalComposer.js.map +1 -0
  156. package/dist/esm/components/basic/doc-editor/core/composables/useLexicalTextEntity.js +16 -0
  157. package/dist/esm/components/basic/doc-editor/core/composables/useLexicalTextEntity.js.map +1 -0
  158. package/dist/esm/components/basic/doc-editor/core/composables/useList.js +48 -0
  159. package/dist/esm/components/basic/doc-editor/core/composables/useList.js.map +1 -0
  160. package/dist/esm/components/basic/doc-editor/core/composables/useMounted.js +14 -0
  161. package/dist/esm/components/basic/doc-editor/core/composables/useMounted.js.map +1 -0
  162. package/dist/esm/components/basic/doc-editor/core/composables/useRichTextSetup.js +16 -0
  163. package/dist/esm/components/basic/doc-editor/core/composables/useRichTextSetup.js.map +1 -0
  164. package/dist/esm/components/basic/doc-editor/core/element-block.js +60 -66
  165. package/dist/esm/components/basic/doc-editor/core/element-block.js.map +1 -1
  166. package/dist/esm/components/basic/doc-editor/core/index.js +15 -1
  167. package/dist/esm/components/basic/doc-editor/core/index.js.map +1 -1
  168. package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin/nodes/RichTextNode.js → core/nodes/RichElementNode.js} +82 -36
  169. package/dist/esm/components/basic/doc-editor/core/nodes/RichElementNode.js.map +1 -0
  170. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js +43 -0
  171. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.js.map +1 -0
  172. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js +5 -0
  173. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue2.js.map +1 -0
  174. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js +5 -0
  175. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.js.map +1 -0
  176. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js +38 -0
  177. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue2.js.map +1 -0
  178. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js +176 -0
  179. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.js.map +1 -0
  180. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js +216 -0
  181. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.js.map +1 -0
  182. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js +5 -0
  183. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue2.js.map +1 -0
  184. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js +76 -0
  185. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.js.map +1 -0
  186. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js +5 -0
  187. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue2.js.map +1 -0
  188. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js +30 -0
  189. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.js.map +1 -0
  190. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js +5 -0
  191. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue2.js.map +1 -0
  192. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js +5 -0
  193. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.js.map +1 -0
  194. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js +78 -0
  195. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue2.js.map +1 -0
  196. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js +26 -0
  197. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.js.map +1 -0
  198. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js +5 -0
  199. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue2.js.map +1 -0
  200. package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.js +12 -1
  201. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/ContentEditable.vue.js.map +1 -0
  202. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js +25 -0
  203. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/DecoratedTeleports.js.map +1 -0
  204. package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.js +19 -8
  205. package/dist/esm/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/index.vue.js.map +1 -0
  206. package/dist/esm/components/basic/doc-editor/editor.vue.js +33 -23
  207. package/dist/esm/components/basic/doc-editor/editor.vue.js.map +1 -1
  208. package/dist/esm/components/basic/doc-editor/index.js +3 -1
  209. package/dist/esm/components/basic/doc-editor/index.js.map +1 -1
  210. package/dist/esm/components/basic/doc-editor/{plugins/nodes.js → nodes.js} +13 -11
  211. package/dist/esm/components/basic/doc-editor/nodes.js.map +1 -0
  212. package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js +5 -3
  213. package/dist/esm/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue.js.map +1 -1
  214. package/dist/esm/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js +216 -69
  215. package/dist/esm/components/basic/doc-editor/plugins/ElementBlockSelectionPlugin/index.vue.js.map +1 -1
  216. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/GridNode.js +39 -39
  217. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/GridNode.js.map +1 -1
  218. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js +8 -1
  219. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.js.map +1 -1
  220. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js +32 -23
  221. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.js.map +1 -1
  222. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js +33 -18
  223. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.js.map +1 -1
  224. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js +8 -1
  225. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.js.map +1 -1
  226. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js +16 -56
  227. package/dist/esm/components/basic/doc-editor/plugins/GridPlugin/index.vue.js.map +1 -1
  228. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js +4 -0
  229. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/ImageNode.js.map +1 -1
  230. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js +31 -26
  231. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/index.vue.js.map +1 -1
  232. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/utils.js +2 -2
  233. package/dist/esm/components/basic/doc-editor/plugins/ImagePlugin/utils.js.map +1 -1
  234. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js +16 -9
  235. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.js.map +1 -1
  236. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/composables.js +12 -11
  237. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/composables.js.map +1 -1
  238. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js +16 -29
  239. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/index.vue.js.map +1 -1
  240. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/utils.js +4 -2
  241. package/dist/esm/components/basic/doc-editor/plugins/ModulePlugin/utils.js.map +1 -1
  242. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/commands.js +6 -0
  243. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/commands.js.map +1 -0
  244. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js +127 -0
  245. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/composables.js.map +1 -0
  246. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js +37 -0
  247. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.js.map +1 -0
  248. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js +5 -0
  249. package/dist/esm/components/basic/doc-editor/plugins/TemplatePlugin/index.vue2.js.map +1 -0
  250. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js +8 -3
  251. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/ContentStyleTool.vue.js.map +1 -1
  252. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js +9 -1
  253. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/FontStyleTool.vue.js.map +1 -1
  254. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js +16 -3
  255. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/PreviewToolbar.vue.js.map +1 -1
  256. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js +9 -1
  257. package/dist/esm/components/basic/doc-editor/plugins/ToolbarPlugin/index.vue.js.map +1 -1
  258. package/dist/esm/components/basic/doc-editor/themes/doc-editor-edit.css.js +1 -1
  259. package/dist/esm/components/basic/doc-editor/themes/doc-editor-edit.css.js.map +1 -1
  260. package/dist/esm/components/basic/doc-editor/themes/doc-theme.css.js +1 -2
  261. package/dist/esm/components/basic/doc-editor/themes/doc-theme.css.js.map +1 -1
  262. package/dist/esm/index.js +2 -0
  263. package/dist/esm/index.js.map +1 -1
  264. package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js +1 -10
  265. package/dist/esm/modules/cms/pages/cms-contents/article-edit-add-page.vue2.js.map +1 -1
  266. package/dist/esm/modules/cms/pages/cms-contents/components/article-list.vue.js +181 -49
  267. package/dist/esm/modules/cms/pages/cms-contents/components/article-list.vue.js.map +1 -1
  268. package/dist/esm/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js +45 -23
  269. package/dist/esm/modules/cms/pages/cms-contents/components/part-banner-edit.vue.js.map +1 -1
  270. package/dist/esm/modules/cms/pages/cms-contents/components/part-info.vue.js +1 -11
  271. package/dist/esm/modules/cms/pages/cms-contents/components/part-info.vue.js.map +1 -1
  272. package/dist/esm/modules/cms/pages/cms-contents/index.vue2.js +11 -6
  273. package/dist/esm/modules/cms/pages/cms-contents/index.vue2.js.map +1 -1
  274. package/dist/esm/modules/ms/components/rich-text-editor/index.js.map +1 -1
  275. package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor-options.js +3 -5
  276. package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor-options.js.map +1 -1
  277. package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor.js +5 -4
  278. package/dist/esm/modules/ms/components/rich-text-editor/rich-text-editor.js.map +1 -1
  279. package/dist/style/components/basic/doc-editor/index.css +1 -1
  280. package/dist/style/components/index.css +1 -1
  281. package/dist/style/index.css +2 -2
  282. package/dist/style/modules/cms/index.css +1 -1
  283. package/dist/style/modules/cms/pages/cms-contents/components/article-list.css +1 -1
  284. package/dist/style/modules/cms/pages/cms-contents/index.css +1 -1
  285. package/dist/style/modules/ms/components/rich-text-editor/index.css +1 -1
  286. package/dist/style/modules/ms/index.css +1 -1
  287. package/dist/style/src/components/basic/doc-editor/index.scss +19 -2
  288. package/dist/style/src/modules/cms/pages/cms-contents/components/article-list.scss +32 -3
  289. package/dist/style/src/modules/ms/components/rich-text-editor/index.scss +1 -1
  290. package/dist/types/components/basic/doc-editor/core/LexicalComposer.vue.d.ts +29 -0
  291. package/dist/types/components/basic/doc-editor/core/composables/index.d.ts +15 -0
  292. package/dist/types/components/basic/doc-editor/core/composables/inject.d.ts +1 -0
  293. package/dist/types/components/basic/doc-editor/core/composables/listenerManager.d.ts +1 -0
  294. package/dist/types/components/basic/doc-editor/core/composables/useCanShowPlaceholder.d.ts +2 -0
  295. package/dist/types/components/basic/doc-editor/core/composables/useCharacterLimit.d.ts +9 -0
  296. package/dist/types/components/basic/doc-editor/core/composables/useDecorators.d.ts +4 -0
  297. package/dist/types/components/basic/doc-editor/core/composables/useEffect.d.ts +5 -0
  298. package/dist/types/components/basic/doc-editor/core/composables/useHistory.d.ts +4 -0
  299. package/dist/types/components/basic/doc-editor/core/composables/useLexicalCommandsLog.d.ts +5 -0
  300. package/dist/types/components/basic/doc-editor/core/composables/useLexicalComposer.d.ts +6 -0
  301. package/dist/types/components/basic/doc-editor/core/composables/useLexicalIsTextContentEmpty.d.ts +2 -0
  302. package/dist/types/components/basic/doc-editor/core/composables/useLexicalNodeSelection.d.ts +7 -0
  303. package/dist/types/components/basic/doc-editor/core/composables/useLexicalTextEntity.d.ts +3 -0
  304. package/dist/types/components/basic/doc-editor/core/composables/useList.d.ts +2 -0
  305. package/dist/types/components/basic/doc-editor/core/composables/useMounted.d.ts +4 -0
  306. package/dist/types/components/basic/doc-editor/core/composables/usePlainTextSetup.d.ts +2 -0
  307. package/dist/types/components/basic/doc-editor/core/composables/useReactiveEditor.d.ts +2 -0
  308. package/dist/types/components/basic/doc-editor/core/composables/useRichTextSetup.d.ts +2 -0
  309. package/dist/types/components/basic/doc-editor/core/composables/useTableOfContents.d.ts +8 -0
  310. package/dist/types/components/basic/doc-editor/core/element-block.d.ts +5 -13
  311. package/dist/types/components/basic/doc-editor/core/index.d.ts +8 -1
  312. package/dist/types/components/basic/doc-editor/core/nodes/RichElementNode.d.ts +46 -0
  313. package/dist/types/components/basic/doc-editor/core/nodes/index.d.ts +1 -0
  314. package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoFocusPlugin.vue.d.ts +15 -0
  315. package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/index.vue.d.ts +26 -0
  316. package/dist/types/components/basic/doc-editor/core/plugins/LexicalAutoLinkPlugin/shared.d.ts +14 -0
  317. package/dist/types/components/basic/doc-editor/core/plugins/LexicalCheckListPlugin.vue.d.ts +2 -0
  318. package/dist/types/components/basic/doc-editor/core/plugins/LexicalHashtagPlugin.vue.d.ts +2 -0
  319. package/dist/types/components/basic/doc-editor/core/plugins/LexicalHistoryPlugin.vue.d.ts +16 -0
  320. package/dist/types/components/basic/doc-editor/core/plugins/LexicalLinkPlugin.vue.d.ts +15 -0
  321. package/dist/types/components/basic/doc-editor/core/plugins/LexicalListPlugin.vue.d.ts +2 -0
  322. package/dist/types/components/basic/doc-editor/core/types.d.ts +2 -0
  323. package/dist/types/components/basic/doc-editor/index.d.ts +2 -1
  324. package/dist/types/components/basic/doc-editor/plugins/GridPlugin/GridNode.d.ts +10 -5
  325. package/dist/types/components/basic/doc-editor/plugins/GridPlugin/ImageTextGridNode.d.ts +5 -0
  326. package/dist/types/components/basic/doc-editor/plugins/GridPlugin/LayoutGridNode.d.ts +5 -0
  327. package/dist/types/components/basic/doc-editor/plugins/GridPlugin/ModuleGridNode.d.ts +5 -0
  328. package/dist/types/components/basic/doc-editor/plugins/GridPlugin/TextGridNode.d.ts +5 -0
  329. package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/ModuleBlockNode.d.ts +5 -1
  330. package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/composables.d.ts +4 -9
  331. package/dist/types/components/basic/doc-editor/plugins/ModulePlugin/utils.d.ts +1 -1
  332. package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/commands.d.ts +5 -0
  333. package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/composables.d.ts +35 -0
  334. package/dist/types/components/basic/doc-editor/plugins/TemplatePlugin/index.vue.d.ts +2 -0
  335. package/dist/types/components/basic/doc-editor/plugins/index.d.ts +2 -3
  336. package/dist/types/components/data-model/data-table/views/table/index.d.ts +1 -1
  337. package/dist/types/components/data-model/data-table/views/table/table.d.ts +1 -1
  338. package/dist/types/components/data-model/data-table/views/tree/index.d.ts +1 -1
  339. package/dist/types/components/data-model/data-table/views/tree/tree.d.ts +1 -1
  340. package/dist/types/modules/ms/components/material-list/material-item.vue.d.ts +1 -1
  341. package/dist/types/modules/ms/components/rich-text-editor/index.d.ts +4 -4
  342. package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor-options.d.ts +2 -2
  343. package/dist/types/modules/ms/components/rich-text-editor/rich-text-editor.d.ts +4 -4
  344. package/package.json +22 -23
  345. package/dist/cjs/components/basic/doc-editor/core/utils.js +0 -42
  346. package/dist/cjs/components/basic/doc-editor/core/utils.js.map +0 -1
  347. package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map +0 -1
  348. package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +0 -13
  349. package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +0 -1
  350. package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +0 -1
  351. package/dist/cjs/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +0 -1
  352. package/dist/cjs/components/basic/doc-editor/plugins/nodes.js.map +0 -1
  353. package/dist/esm/components/basic/doc-editor/core/utils.js +0 -42
  354. package/dist/esm/components/basic/doc-editor/core/utils.js.map +0 -1
  355. package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/ContentEditable.vue.js.map +0 -1
  356. package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js +0 -14
  357. package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/DecoratedTeleports.js.map +0 -1
  358. package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/index.vue.js.map +0 -1
  359. package/dist/esm/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.js.map +0 -1
  360. package/dist/esm/components/basic/doc-editor/plugins/nodes.js.map +0 -1
  361. package/dist/types/components/basic/doc-editor/core/utils.d.ts +0 -4
  362. package/dist/types/components/basic/doc-editor/plugins/RichTextPlugin/nodes/RichTextNode.d.ts +0 -13
  363. package/dist/types/components/basic/doc-editor/plugins/VideoPlugin/VideoNode.d.ts +0 -23
  364. /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js +0 -0
  365. /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js.map +0 -0
  366. /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js +0 -0
  367. /package/dist/cjs/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js.map +0 -0
  368. /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js +0 -0
  369. /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue2.js.map +0 -0
  370. /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js +0 -0
  371. /package/dist/esm/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue2.js.map +0 -0
  372. /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/ContentEditable.vue.d.ts +0 -0
  373. /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/DecoratedTeleports.d.ts +0 -0
  374. /package/dist/types/components/basic/doc-editor/{plugins/RichTextPlugin → core/plugins/LexicalRichTextPlugin}/index.vue.d.ts +0 -0
  375. /package/dist/types/components/basic/doc-editor/{plugins/nodes.d.ts → nodes.d.ts} +0 -0
@@ -1,7 +1,19 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const lexicalVue = require("lexical-vue");
3
+ const useCanShowPlaceholder = require("../../composables/useCanShowPlaceholder.js");
4
+ require("@lexical/overflow");
5
+ require("@lexical/text");
6
+ require("@lexical/utils");
4
7
  const lexical = require("lexical");
8
+ require("tiny-invariant");
9
+ const useMounted = require("../../composables/useMounted.js");
10
+ require("@lexical/history");
11
+ const useLexicalComposer = require("../../composables/useLexicalComposer.js");
12
+ require("@lexical/list");
13
+ require("@lexical/dragon");
14
+ require("@lexical/plain-text");
15
+ const useRichTextSetup = require("../../composables/useRichTextSetup.js");
16
+ require("@lexical/rich-text");
5
17
  const html = require("@lexical/html");
6
18
  const ContentEditable_vue_vue_type_script_setup_true_lang = require("./ContentEditable.vue.js");
7
19
  const DecoratedTeleports = require("./DecoratedTeleports.js");
@@ -20,8 +32,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
20
32
  setup(__props, { emit: __emit }) {
21
33
  const emit = __emit;
22
34
  const props = __props;
23
- const editor = lexicalVue.useLexicalComposer();
24
- const canShowPlaceholder = lexicalVue.useCanShowPlaceholder(editor);
35
+ const editor = useLexicalComposer.useLexicalComposer();
36
+ const canShowPlaceholder = useCanShowPlaceholder.useCanShowPlaceholder(editor);
25
37
  const parser = new DOMParser();
26
38
  const htmlContent = vue.ref("");
27
39
  const contentIsEmpty = vue.computed(() => htmlContent.value == `<p class="mk-doc__paragraph"><br></p>` || !htmlContent.value);
@@ -42,17 +54,16 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
42
54
  });
43
55
  }
44
56
  };
45
- vue.onMounted(() => {
46
- vue.watch(() => props.content, setHtml, { immediate: true });
47
- vue.watch(htmlContent, (value) => emit("change", value));
48
- const unregisterMergeListener = editor.registerUpdateListener(({ editorState }) => {
57
+ useMounted.useMounted(() => {
58
+ return editor.registerUpdateListener(({ editorState }) => {
49
59
  editorState.read(() => {
50
60
  htmlContent.value = html.$generateHtmlFromNodes(editor);
51
61
  });
52
62
  });
53
- vue.onUnmounted(() => unregisterMergeListener());
54
63
  });
55
- lexicalVue.useRichTextSetup(editor);
64
+ vue.watch(() => props.content, setHtml, { immediate: true });
65
+ vue.watch(htmlContent, (value) => emit("change", value));
66
+ useRichTextSetup.useRichTextSetup(editor);
56
67
  return (_ctx, _cache) => {
57
68
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
58
69
  vue.createVNode(ContentEditable_vue_vue_type_script_setup_true_lang),
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.vue.js","sources":["../../../../../../../../src/components/basic/doc-editor/core/plugins/LexicalRichTextPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\n\r\nimport { ref,defineProps,computed,defineEmits,watch } from \"vue\"\r\nimport { useCanShowPlaceholder, useLexicalComposer, useRichTextSetup,useMounted } from '../../composables'\r\nimport { $getSelection ,$selectAll } from 'lexical'\r\nimport { $generateHtmlFromNodes,$generateNodesFromDOM } from '@lexical/html'\r\nimport ContentEditable from \"./ContentEditable.vue\"\r\nimport DecoratedTeleports from \"./DecoratedTeleports\"\r\n\r\n// 事件\r\nconst emit = defineEmits([\"change\"]);\r\n\r\n// 参数\r\nconst props = defineProps({\r\n content:{ type:String,default:`` },\r\n placeholder:{ type:String,default:`` }\r\n})\r\n\r\nconst editor = useLexicalComposer()\r\n\r\nconst canShowPlaceholder = useCanShowPlaceholder(editor)\r\n\r\nconst parser = new DOMParser();\r\n\r\n// html 内容\r\nconst htmlContent = ref(\"\");\r\n\r\n// 空内容\r\nconst contentIsEmpty = computed(()=>htmlContent.value == `<p class=\"mk-doc__paragraph\"><br></p>` || !htmlContent.value);\r\n\r\n// 设置 HTML\r\nconst setHtml = (html : any)=>{\r\n\r\n // 内容不同则重置 \r\n if(htmlContent.value != html){\r\n\r\n let nodes : Array<any> = [];\r\n\r\n htmlContent.value = html;\r\n\r\n editor.update(()=>{\r\n\r\n if(html.trim()){\r\n // Once you have the DOM instance it's easy to generate LexicalNodes.\r\n nodes = $generateNodesFromDOM(editor,parser.parseFromString(html.trim(),\"text/html\"));\r\n // console.log($generateNodesFromDOM,parser.parseFromString(html.trim(),\"text/html\"));\r\n }\r\n // 设置权限替换\r\n $selectAll();\r\n $getSelection()?.insertText(\"\")\r\n if(nodes.length > 0){\r\n $getSelection()?.insertNodes(nodes);\r\n }\r\n })\r\n }\r\n}\r\n\r\nuseMounted(()=>{\r\n return editor.registerUpdateListener(({ editorState }) => {\r\n editorState.read(() => {\r\n htmlContent.value = $generateHtmlFromNodes(editor);\r\n })\r\n })\r\n})\r\n\r\n\r\n// 初始化\r\nwatch(()=>props.content,setHtml,{ immediate:true });\r\n\r\n// 监听内容变化\r\nwatch(htmlContent,(value:any)=>emit('change',value));\r\n\r\n// 使用富文本\r\nuseRichTextSetup(editor)\r\n\r\n</script>\r\n\r\n<template>\r\n <div class=\"mk-doc-editor__stage__editable\">\r\n <ContentEditable />\r\n <template v-if=\"canShowPlaceholder && contentIsEmpty\">\r\n <div class=\"mk-doc-editor__stage__placeholder mk-doc__paragraph\">\r\n {{props.placeholder}}\r\n </div>\r\n </template>\r\n <DecoratedTeleports />\r\n </div>\r\n\r\n</template>\r\n"],"names":["useLexicalComposer","useCanShowPlaceholder","ref","computed","html","$generateNodesFromDOM","$selectAll","$getSelection","useMounted","$generateHtmlFromNodes","watch","useRichTextSetup"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,UAAM,OAAO;AAGb,UAAM,QAAQ;AAKd,UAAM,SAASA,mBAAAA;AAET,UAAA,qBAAqBC,4CAAsB,MAAM;AAEjD,UAAA,SAAS,IAAI;AAGb,UAAA,cAAcC,QAAI,EAAE;AAGpB,UAAA,iBAAiBC,aAAS,MAAI,YAAY,SAAS,2CAA2C,CAAC,YAAY,KAAK;AAGhH,UAAA,UAAU,CAACC,WAAa;AAGvB,UAAA,YAAY,SAASA,QAAK;AAE3B,YAAI,QAAqB,CAAA;AAEzB,oBAAY,QAAQA;AAEpB,eAAO,OAAO,MAAI;;AAEb,cAAAA,OAAK,QAAO;AAEL,oBAAAC,KAAAA,sBAAsB,QAAO,OAAO,gBAAgBD,OAAK,KAAK,GAAE,WAAW,CAAC;AAAA,UAEtF;AAEWE,kBAAAA;AACGC,sCAAA,MAAAA,mBAAG,WAAW;AACzB,cAAA,MAAM,SAAS,GAAE;AACJA,wCAAA,MAAAA,mBAAG,YAAY;AAAA,UAC/B;AAAA,QAAA,CACD;AAAA,MACH;AAAA,IAAA;AAGJC,eAAAA,WAAW,MAAI;AACb,aAAO,OAAO,uBAAuB,CAAC,EAAE,kBAAkB;AACxD,oBAAY,KAAK,MAAM;AACT,sBAAA,QAAQC,4BAAuB,MAAM;AAAA,QAAA,CAClD;AAAA,MAAA,CACF;AAAA,IAAA,CACF;AAIDC,QAAA,MAAM,MAAI,MAAM,SAAQ,SAAQ,EAAE,WAAU,MAAM;AAGlDA,QAAA,MAAM,aAAY,CAAC,UAAY,KAAK,UAAS,KAAK,CAAC;AAGnDC,qBAAA,iBAAiB,MAAM;;;;;;;;;;;"}
@@ -1,20 +1,27 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const lexicalVue = require("lexical-vue");
3
+ const LexicalComposer_vue_vue_type_script_setup_true_lang = require("./core/LexicalComposer.vue.js");
4
+ const index = require("./core/index.js");
4
5
  const index_vue_vue_type_script_setup_true_lang$3 = require("./plugins/AutoLinkPlugin/index.vue.js");
5
6
  const index_vue_vue_type_script_setup_true_lang$2 = require("./plugins/ImagePlugin/index.vue.js");
6
7
  const index_vue_vue_type_script_setup_true_lang = require("./plugins/ToolbarPlugin/index.vue.js");
7
- const index_vue_vue_type_script_setup_true_lang$1 = require("./plugins/RichTextPlugin/index.vue.js");
8
8
  const index_vue_vue_type_script_setup_true_lang$6 = require("./plugins/ElementBlockSelectionPlugin/index.vue.js");
9
9
  const index_vue_vue_type_script_setup_true_lang$4 = require("./plugins/ModulePlugin/index.vue.js");
10
10
  const index_vue_vue_type_script_setup_true_lang$5 = require("./plugins/GridPlugin/index.vue.js");
11
- const nodes = require("./plugins/nodes.js");
12
- const composables = require("./plugins/ModulePlugin/composables.js");
13
- const index = require("./core/index.js");
11
+ const index_vue_vue_type_script_setup_true_lang$7 = require("./plugins/TemplatePlugin/index.vue.js");
12
+ const nodes = require("./nodes.js");
13
+ const composables$1 = require("./plugins/ModulePlugin/composables.js");
14
+ const composables = require("./plugins/TemplatePlugin/composables.js");
14
15
  const DocTheme = require("./themes/DocTheme.js");
15
16
  const docEditor = require("./themes/doc-editor.css.js");
16
17
  const docEditorEdit = require("./themes/doc-editor-edit.css.js");
17
18
  const docTheme = require("./themes/doc-theme.css.js");
19
+ const index_vue_vue_type_script_setup_true_lang$1 = require("./core/plugins/LexicalRichTextPlugin/index.vue.js");
20
+ const LexicalAutoFocusPlugin_vue_vue_type_script_setup_true_lang = require("./core/plugins/LexicalAutoFocusPlugin.vue.js");
21
+ const LexicalCheckListPlugin_vue_vue_type_script_setup_true_lang = require("./core/plugins/LexicalCheckListPlugin.vue.js");
22
+ const LexicalHashtagPlugin_vue_vue_type_script_setup_true_lang = require("./core/plugins/LexicalHashtagPlugin.vue.js");
23
+ const LexicalListPlugin_vue_vue_type_script_setup_true_lang = require("./core/plugins/LexicalListPlugin.vue.js");
24
+ const LexicalHistoryPlugin_vue_vue_type_script_setup_true_lang = require("./core/plugins/LexicalHistoryPlugin.vue.js");
18
25
  const _hoisted_1 = { class: "mk-doc-editor__stage_warp" };
19
26
  const _hoisted_2 = { class: "mk-doc-editor__stage_body" };
20
27
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
@@ -61,10 +68,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
61
68
  vue.onMounted(() => {
62
69
  var _a, _b;
63
70
  const doc = (_b = (_a = iframeContentRef.value) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.document;
71
+ const { Modules } = composables$1.useModule();
64
72
  const style = document.createElement("style");
65
73
  style.setAttribute("type", "text/css");
66
74
  style.innerHTML = [docEditor, docTheme, docEditorEdit].join("\r\n");
67
- style.innerHTML += composables.useModules().filter((item) => item.editorCss).map((item) => item.editorCss).join("\r\n");
75
+ style.innerHTML += Modules.filter((item) => item.editorCss).map((item) => item.editorCss).join("\r\n");
76
+ style.innerHTML += composables.Templates.filter((item) => item.editorCss).map((item) => item.editorCss).join("\r\n");
68
77
  doc.head.append(style);
69
78
  props.js.split(",").filter((item) => !!item).forEach((path) => {
70
79
  const script = document.createElement("script");
@@ -88,7 +97,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
88
97
  });
89
98
  return (_ctx, _cache) => {
90
99
  const _directive_loading = vue.resolveDirective("loading");
91
- return vue.openBlock(), vue.createBlock(vue.unref(lexicalVue.LexicalComposer), { "initial-config": config }, {
100
+ return vue.openBlock(), vue.createBlock(LexicalComposer_vue_vue_type_script_setup_true_lang, { "initial-config": config }, {
92
101
  default: vue.withCtx(() => [
93
102
  vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
94
103
  class: vue.normalizeClass(["mk-doc-editor", vue.unref(index.DEVICE_VIEW_MODE)])
@@ -129,11 +138,12 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
129
138
  ], 2)), [
130
139
  [_directive_loading, __props.loading]
131
140
  ]),
132
- vue.createVNode(vue.unref(lexicalVue.LexicalAutoFocusPlugin)),
133
- vue.createVNode(vue.unref(lexicalVue.LexicalCheckListPlugin)),
134
- vue.createVNode(vue.unref(lexicalVue.LexicalHashtagPlugin)),
135
- vue.createVNode(vue.unref(lexicalVue.LexicalListPlugin)),
136
- vue.createVNode(vue.unref(lexicalVue.LexicalHistoryPlugin))
141
+ vue.createVNode(vue.unref(index_vue_vue_type_script_setup_true_lang$7)),
142
+ vue.createVNode(vue.unref(LexicalAutoFocusPlugin_vue_vue_type_script_setup_true_lang)),
143
+ vue.createVNode(vue.unref(LexicalCheckListPlugin_vue_vue_type_script_setup_true_lang)),
144
+ vue.createVNode(vue.unref(LexicalHashtagPlugin_vue_vue_type_script_setup_true_lang)),
145
+ vue.createVNode(vue.unref(LexicalListPlugin_vue_vue_type_script_setup_true_lang)),
146
+ vue.createVNode(vue.unref(LexicalHistoryPlugin_vue_vue_type_script_setup_true_lang))
137
147
  ]),
138
148
  _: 3
139
149
  });
@@ -1 +1 @@
1
- {"version":3,"file":"editor.vue.js","sources":["../../../../../src/components/basic/doc-editor/editor.vue"],"sourcesContent":["<template>\r\n <LexicalComposer :initial-config=\"config\">\r\n <div class=\"mk-doc-editor\" v-loading=\"loading\" :class=\"DEVICE_VIEW_MODE\">\r\n <ToolbarPlugin :js=\"js\" :css=\"css\" />\r\n <div class=\"mk-doc-editor__stage_warp\">\r\n <slot name=\"before-extentions\"></slot>\r\n <div class=\"mk-doc-editor__stage_body\">\r\n <slot name=\"header\"></slot>\r\n <iframe title=\"iframe\" class=\"mk-doc-editor__stage_iframe\" ref=\"iframeContentRef\"></iframe>\r\n <Teleport v-if=\"iframeBody\" :to=\"iframeBody\">\r\n <RichTextPlugin :content=\"props.content\" @change=\"contentChangeHandle\" :placeholder=\"placeholder\">\r\n </RichTextPlugin>\r\n <ImagePlugin />\r\n <AutoLinkPlugin />\r\n <ModulePlugin />\r\n <GridPlugin />\r\n </Teleport>\r\n <ElementBlockSelectionPlugin />\r\n <slot name=\"footer\"></slot>\r\n </div>\r\n <slot name=\"after-extentions\"></slot>\r\n </div>\r\n \r\n </div>\r\n <LexicalAutoFocusPlugin />\r\n <LexicalCheckListPlugin />\r\n <LexicalHashtagPlugin />\r\n <LexicalListPlugin />\r\n <LexicalHistoryPlugin />\r\n </LexicalComposer>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { defineOptions,defineProps,defineEmits,computed,ref,onMounted,watch } from \"vue\"\r\nimport {\r\n LexicalComposer,\r\n LexicalAutoFocusPlugin,\r\n LexicalCheckListPlugin,\r\n LexicalHashtagPlugin,\r\n LexicalHistoryPlugin,\r\n LexicalListPlugin,\r\n} from 'lexical-vue'\r\nimport { \r\n ToolbarPlugin,\r\n RichTextPlugin,\r\n AutoLinkPlugin,\r\n ImagePlugin,\r\n ElementBlockSelectionPlugin,\r\n GridPlugin,\r\n ModulePlugin\r\n} from \"./plugins\"\r\nimport { useModules } from \"./plugins/ModulePlugin/composables\"\r\nimport { DEVICE_VIEW_MODE } from \"./core\"\r\n\r\nimport DocTheme from \"./themes/DocTheme\";\r\nimport DocNodes from \"./plugins/nodes\"\r\nimport DocEditorCss from \"./themes/doc-editor.css?raw\";\r\nimport DocEditorEditCss from \"./themes/doc-editor-edit.css?raw\";\r\nimport DocThemeCss from \"./themes/doc-theme.css?raw\";\r\n\r\n// 定义组件\r\ndefineOptions({ name: \"MKDocEditor\" })\r\n\r\n// 事件\r\nconst emit = defineEmits(['change']);\r\n\r\n// 参数\r\nconst props = defineProps({\r\n placeholder:{type:String,default:\"这里输入正文...\"},\r\n content:{ type:String,default:`` },\r\n loading:{ type:Boolean,defualt:false},\r\n js:{ type:String,default:`` },\r\n css:{ type:String,default:`` }\r\n})\r\n \r\n\r\n// 配置\r\nconst config = {\r\n namespace: 'MyEditor',\r\n theme: DocTheme,\r\n nodes: [\r\n ...DocNodes,\r\n ],\r\n onError(error:Error) {\r\n // Catch any errors that occur during Lexical updates and log them\r\n // or throw them as needed. If you don't throw them, Lexical will\r\n // try to recover gracefully without losing user data.\r\n console.error(error)\r\n },\r\n}\r\n\r\n// iframe 编辑器\r\nconst iframeContentRef = ref(null as any);\r\nconst iframeBody = computed(()=>iframeContentRef.value?.contentWindow?.document?.body)\r\n\r\n//内容改变时\r\nconst updateStage = ()=>{\r\n setTimeout(() => {\r\n if(iframeBody.value?.scrollHeight > iframeBody.value?.offsetHeight){\r\n iframeContentRef.value.style.height = (iframeBody.value?.scrollHeight + 10)+\"px\";\r\n }\r\n }, 10);\r\n}\r\nconst contentChangeHandle = (content:any)=>{\r\n emit('change',content);\r\n updateStage();\r\n}\r\n\r\nonMounted(()=>{\r\n\r\n const doc = iframeContentRef.value?.contentWindow?.document;\r\n\r\n // 样式\r\n const style = document.createElement(\"style\");\r\n style.setAttribute(\"type\",\"text/css\")\r\n\r\n // 默认样式\r\n style.innerHTML = [DocEditorCss,DocThemeCss,DocEditorEditCss].join(\"\\r\\n\");\r\n\r\n //模块渲染样式\r\n style.innerHTML += useModules().filter(item=>item.editorCss).map(item=>item.editorCss).join(\"\\r\\n\");\r\n\r\n doc.head.append(style);\r\n\r\n // 扩展的js和css\r\n props.js.split(\",\").filter(item=>!!item).forEach(path=>{\r\n const script = document.createElement(\"script\");\r\n script.src = path;\r\n script.setAttribute(\"crossorigin\",\"true\")\r\n doc.head.append(script);\r\n })\r\n\r\n props.css.split(\",\").filter(item=>!!item).forEach(path=>{\r\n const link = document.createElement(\"link\");\r\n link.href = path;\r\n link.setAttribute(\"rel\",\"stylesheet\")\r\n link.setAttribute(\"crossorigin\",\"true\")\r\n doc.head.append(link);\r\n })\r\n\r\n // 设备显示模式改变\r\n watch(DEVICE_VIEW_MODE,(payload: string) => {\r\n doc.body.style.fontSize = payload == \"pc\" ? \"14px\" : \"18px\";\r\n updateStage();\r\n return false\r\n },{ immediate :true})\r\n\r\n // 初始化计算舞台\r\n setTimeout(()=> updateStage(),500)\r\n});\r\n\r\n</script>\r\n"],"names":["DocNodes","ref","computed","onMounted","DocEditorCss","DocThemeCss","DocEditorEditCss","useModules","watch","DEVICE_VIEW_MODE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEA,UAAM,OAAO;AAGb,UAAM,QAAQ;AAUd,UAAM,SAAS;AAAA,MACb,WAAW;AAAA,MACX,OAAO;AAAA,MACP,OAAO;AAAA,QACL,GAAGA;AAAAA,MACL;AAAA,MACA,QAAQ,OAAa;AAInB,gBAAQ,MAAM,KAAK;AAAA,MACrB;AAAA,IAAA;AAII,UAAA,mBAAmBC,QAAI,IAAW;AACxC,UAAM,aAAaC,IAAS,SAAA;;AAAI,gDAAiB,UAAjB,mBAAwB,kBAAxB,mBAAuC,aAAvC,mBAAiD;AAAA,KAAI;AAGrF,UAAM,cAAc,MAAI;AACtB,iBAAW,MAAM;;AACf,cAAG,gBAAW,UAAX,mBAAkB,kBAAe,gBAAW,UAAX,mBAAkB,eAAa;AACjE,2BAAiB,MAAM,MAAM,WAAU,gBAAW,UAAX,mBAAkB,gBAAe,KAAI;AAAA,QAC9E;AAAA,SACC,EAAE;AAAA,IAAA;AAED,UAAA,sBAAsB,CAAC,YAAc;AACzC,WAAK,UAAS,OAAO;AACT;IAAA;AAGdC,QAAAA,UAAU,MAAI;;AAEN,YAAA,OAAM,4BAAiB,UAAjB,mBAAwB,kBAAxB,mBAAuC;AAG7C,YAAA,QAAQ,SAAS,cAAc,OAAO;AACtC,YAAA,aAAa,QAAO,UAAU;AAGpC,YAAM,YAAY,CAACC,WAAaC,UAAYC,aAAgB,EAAE,KAAK,MAAM;AAGzE,YAAM,aAAaC,YAAA,WAAA,EAAa,OAAO,UAAM,KAAK,SAAS,EAAE,IAAI,CAAM,SAAA,KAAK,SAAS,EAAE,KAAK,MAAM;AAE9F,UAAA,KAAK,OAAO,KAAK;AAGf,YAAA,GAAG,MAAM,GAAG,EAAE,OAAO,CAAM,SAAA,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAM,SAAA;AAC/C,cAAA,SAAS,SAAS,cAAc,QAAQ;AAC9C,eAAO,MAAM;AACN,eAAA,aAAa,eAAc,MAAM;AACpC,YAAA,KAAK,OAAO,MAAM;AAAA,MAAA,CACvB;AAEK,YAAA,IAAI,MAAM,GAAG,EAAE,OAAO,CAAM,SAAA,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAM,SAAA;AAChD,cAAA,OAAO,SAAS,cAAc,MAAM;AAC1C,aAAK,OAAO;AACP,aAAA,aAAa,OAAM,YAAY;AAC/B,aAAA,aAAa,eAAc,MAAM;AAClC,YAAA,KAAK,OAAO,IAAI;AAAA,MAAA,CACrB;AAGKC,gBAAAC,MAAAA,kBAAiB,CAAC,YAAoB;AAC1C,YAAI,KAAK,MAAM,WAAW,WAAW,OAAO,SAAS;AACzC;AACL,eAAA;AAAA,MAAA,GACP,EAAE,WAAW,KAAA,CAAK;AAGT,iBAAA,MAAK,eAAc,GAAG;AAAA,IAAA,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"editor.vue.js","sources":["../../../../../src/components/basic/doc-editor/editor.vue"],"sourcesContent":["<template>\r\n <LexicalComposer :initial-config=\"config\">\r\n <div class=\"mk-doc-editor\" v-loading=\"loading\" :class=\"DEVICE_VIEW_MODE\">\r\n <ToolbarPlugin :js=\"js\" :css=\"css\" />\r\n <div class=\"mk-doc-editor__stage_warp\">\r\n <slot name=\"before-extentions\"></slot>\r\n <div class=\"mk-doc-editor__stage_body\">\r\n <slot name=\"header\"></slot>\r\n <iframe title=\"iframe\" class=\"mk-doc-editor__stage_iframe\" ref=\"iframeContentRef\"></iframe>\r\n <Teleport v-if=\"iframeBody\" :to=\"iframeBody\">\r\n <LexicalRichTextPlugin :content=\"props.content\" @change=\"contentChangeHandle\" :placeholder=\"placeholder\">\r\n </LexicalRichTextPlugin>\r\n <ImagePlugin />\r\n <AutoLinkPlugin />\r\n <ModulePlugin />\r\n <GridPlugin />\r\n </Teleport>\r\n <ElementBlockSelectionPlugin />\r\n <slot name=\"footer\"></slot>\r\n </div>\r\n <slot name=\"after-extentions\"></slot>\r\n </div>\r\n \r\n </div>\r\n <TemplatePlguin />\r\n <LexicalAutoFocusPlugin />\r\n <LexicalCheckListPlugin />\r\n <LexicalHashtagPlugin />\r\n <LexicalListPlugin />\r\n <LexicalHistoryPlugin />\r\n </LexicalComposer>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\nimport { defineOptions,defineProps,defineEmits,computed,ref,onMounted,watch } from \"vue\"\r\nimport LexicalComposer from \"./core/LexicalComposer.vue\"\r\nimport { \r\n DEVICE_VIEW_MODE,\r\n LexicalAutoFocusPlugin,\r\n LexicalCheckListPlugin,\r\n LexicalHashtagPlugin,\r\n LexicalHistoryPlugin,\r\n LexicalListPlugin,\r\n LexicalRichTextPlugin,\r\n} from \"./core\"\r\n\r\nimport { \r\n ToolbarPlugin,\r\n AutoLinkPlugin,\r\n ImagePlugin,\r\n ElementBlockSelectionPlugin,\r\n GridPlugin,\r\n ModulePlugin,\r\n TemplatePlguin\r\n} from \"./plugins\"\r\n\r\nimport DocNodes from \"./nodes\"\r\n\r\nimport { useModule } from \"./plugins/ModulePlugin/composables\"\r\nimport { Templates } from \"./plugins/TemplatePlugin/composables\"\r\nimport DocTheme from \"./themes/DocTheme\";\r\nimport DocEditorCss from \"./themes/doc-editor.css?raw\";\r\nimport DocEditorEditCss from \"./themes/doc-editor-edit.css?raw\";\r\nimport DocThemeCss from \"./themes/doc-theme.css?raw\";\r\n\r\n// 定义组件\r\ndefineOptions({ name: \"MKDocEditor\" })\r\n\r\n// 事件\r\nconst emit = defineEmits(['change']);\r\n\r\n// 参数\r\nconst props = defineProps({\r\n placeholder:{type:String,default:\"这里输入正文...\"},\r\n content:{ type:String,default:`` },\r\n loading:{ type:Boolean,defualt:false},\r\n js:{ type:String,default:`` },\r\n css:{ type:String,default:`` }\r\n})\r\n \r\n\r\n// 配置\r\nconst config = {\r\n namespace: 'MyEditor',\r\n theme: DocTheme,\r\n nodes: [\r\n ...DocNodes,\r\n ],\r\n onError(error:Error) {\r\n // Catch any errors that occur during Lexical updates and log them\r\n // or throw them as needed. If you don't throw them, Lexical will\r\n // try to recover gracefully without losing user data.\r\n console.error(error)\r\n },\r\n}\r\n\r\n// iframe 编辑器\r\nconst iframeContentRef = ref(null as any);\r\nconst iframeBody = computed(()=>iframeContentRef.value?.contentWindow?.document?.body)\r\n\r\n//内容改变时\r\nconst updateStage = ()=>{\r\n setTimeout(() => {\r\n if(iframeBody.value?.scrollHeight > iframeBody.value?.offsetHeight){\r\n iframeContentRef.value.style.height = (iframeBody.value?.scrollHeight + 10)+\"px\";\r\n }\r\n }, 10);\r\n}\r\nconst contentChangeHandle = (content:any)=>{\r\n emit('change',content);\r\n updateStage();\r\n}\r\n\r\nonMounted(()=>{\r\n\r\n const doc = iframeContentRef.value?.contentWindow?.document;\r\n const { Modules } = useModule(); \r\n\r\n // 样式\r\n const style = document.createElement(\"style\");\r\n style.setAttribute(\"type\",\"text/css\")\r\n\r\n // 默认样式\r\n style.innerHTML = [DocEditorCss,DocThemeCss,DocEditorEditCss].join(\"\\r\\n\");\r\n\r\n //模块渲染样式\r\n style.innerHTML += Modules.filter(item=>item.editorCss).map(item=>item.editorCss).join(\"\\r\\n\");\r\n\r\n //模版渲染样式\r\n style.innerHTML += Templates.filter(item=>item.editorCss).map(item=>item.editorCss).join(\"\\r\\n\");\r\n\r\n doc.head.append(style);\r\n\r\n // 扩展的js和css\r\n props.js.split(\",\").filter(item=>!!item).forEach(path=>{\r\n const script = document.createElement(\"script\");\r\n script.src = path;\r\n script.setAttribute(\"crossorigin\",\"true\")\r\n doc.head.append(script);\r\n })\r\n\r\n props.css.split(\",\").filter(item=>!!item).forEach(path=>{\r\n const link = document.createElement(\"link\");\r\n link.href = path;\r\n link.setAttribute(\"rel\",\"stylesheet\")\r\n link.setAttribute(\"crossorigin\",\"true\")\r\n doc.head.append(link);\r\n })\r\n\r\n // 设备显示模式改变\r\n watch(DEVICE_VIEW_MODE,(payload: string) => {\r\n doc.body.style.fontSize = payload == \"pc\" ? \"14px\" : \"18px\";\r\n updateStage();\r\n return false\r\n },{ immediate :true})\r\n\r\n // 初始化计算舞台\r\n setTimeout(()=> updateStage(),500)\r\n});\r\n\r\n</script>\r\n"],"names":["DocNodes","ref","computed","onMounted","useModule","DocEditorCss","DocThemeCss","DocEditorEditCss","Templates","watch","DEVICE_VIEW_MODE"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,UAAM,OAAO;AAGb,UAAM,QAAQ;AAUd,UAAM,SAAS;AAAA,MACb,WAAW;AAAA,MACX,OAAO;AAAA,MACP,OAAO;AAAA,QACL,GAAGA;AAAAA,MACL;AAAA,MACA,QAAQ,OAAa;AAInB,gBAAQ,MAAM,KAAK;AAAA,MACrB;AAAA,IAAA;AAII,UAAA,mBAAmBC,QAAI,IAAW;AACxC,UAAM,aAAaC,IAAS,SAAA;;AAAI,gDAAiB,UAAjB,mBAAwB,kBAAxB,mBAAuC,aAAvC,mBAAiD;AAAA,KAAI;AAGrF,UAAM,cAAc,MAAI;AACtB,iBAAW,MAAM;;AACf,cAAG,gBAAW,UAAX,mBAAkB,kBAAe,gBAAW,UAAX,mBAAkB,eAAa;AACjE,2BAAiB,MAAM,MAAM,WAAU,gBAAW,UAAX,mBAAkB,gBAAe,KAAI;AAAA,QAC9E;AAAA,SACC,EAAE;AAAA,IAAA;AAED,UAAA,sBAAsB,CAAC,YAAc;AACzC,WAAK,UAAS,OAAO;AACT;IAAA;AAGdC,QAAAA,UAAU,MAAI;;AAEN,YAAA,OAAM,4BAAiB,UAAjB,mBAAwB,kBAAxB,mBAAuC;AAC7C,YAAA,EAAE,YAAYC,cAAAA;AAGd,YAAA,QAAQ,SAAS,cAAc,OAAO;AACtC,YAAA,aAAa,QAAO,UAAU;AAGpC,YAAM,YAAY,CAACC,WAAaC,UAAYC,aAAgB,EAAE,KAAK,MAAM;AAGzE,YAAM,aAAa,QAAQ,OAAO,CAAA,SAAM,KAAK,SAAS,EAAE,IAAI,CAAM,SAAA,KAAK,SAAS,EAAE,KAAK,MAAM;AAG7F,YAAM,aAAaC,YAAA,UAAU,OAAO,CAAA,SAAM,KAAK,SAAS,EAAE,IAAI,CAAM,SAAA,KAAK,SAAS,EAAE,KAAK,MAAM;AAE3F,UAAA,KAAK,OAAO,KAAK;AAGf,YAAA,GAAG,MAAM,GAAG,EAAE,OAAO,CAAM,SAAA,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAM,SAAA;AAC/C,cAAA,SAAS,SAAS,cAAc,QAAQ;AAC9C,eAAO,MAAM;AACN,eAAA,aAAa,eAAc,MAAM;AACpC,YAAA,KAAK,OAAO,MAAM;AAAA,MAAA,CACvB;AAEK,YAAA,IAAI,MAAM,GAAG,EAAE,OAAO,CAAM,SAAA,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAM,SAAA;AAChD,cAAA,OAAO,SAAS,cAAc,MAAM;AAC1C,aAAK,OAAO;AACP,aAAA,aAAa,OAAM,YAAY;AAC/B,aAAA,aAAa,eAAc,MAAM;AAClC,YAAA,KAAK,OAAO,IAAI;AAAA,MAAA,CACrB;AAGKC,gBAAAC,MAAAA,kBAAiB,CAAC,YAAoB;AAC1C,YAAI,KAAK,MAAM,WAAW,WAAW,OAAO,SAAS;AACzC;AACL,eAAA;AAAA,MAAA,GACP,EAAE,WAAW,KAAA,CAAK;AAGT,iBAAA,MAAK,eAAc,GAAG;AAAA,IAAA,CAClC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,9 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const utils = require("@maketribe/utils");
4
4
  const editor_vue_vue_type_script_setup_true_lang = require("./editor.vue.js");
5
+ const composables$1 = require("./plugins/TemplatePlugin/composables.js");
5
6
  const MKDocEditor = utils.withInstall(editor_vue_vue_type_script_setup_true_lang);
7
+ exports.registerDocTemplate = composables$1.registerDocTemplate;
6
8
  exports.MKDocEditor = MKDocEditor;
7
9
  exports.default = MKDocEditor;
8
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/basic/doc-editor/index.ts"],"sourcesContent":["import { withInstall } from \"@maketribe/utils\";\r\nimport Editor from \"./editor.vue\";\r\nimport { registerDocModule } from \"./plugins/ModulePlugin/composables\";\r\n\r\nexport const MKDocEditor = withInstall(Editor);\r\n\r\nexport { registerDocModule }\r\n\r\nexport default MKDocEditor;\r\n\r\n"],"names":["withInstall","Editor"],"mappings":";;;;AAIa,MAAA,cAAcA,kBAAYC,0CAAM;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/basic/doc-editor/index.ts"],"sourcesContent":["import { withInstall } from \"@maketribe/utils\";\r\nimport Editor from \"./editor.vue\";\r\nimport { registerDocModule } from \"./plugins/ModulePlugin/composables\";\r\nimport { registerDocTemplate } from \"./plugins/TemplatePlugin/composables\";\r\n\r\nexport const MKDocEditor = withInstall(Editor);\r\n\r\nexport { registerDocModule,registerDocTemplate }\r\n\r\nexport default MKDocEditor;\r\n\r\n"],"names":["withInstall","Editor"],"mappings":";;;;;AAKa,MAAA,cAAcA,kBAAYC,0CAAM;;;;"}
@@ -1,21 +1,23 @@
1
1
  "use strict";
2
+ const lexical = require("lexical");
2
3
  const richText = require("@lexical/rich-text");
3
4
  const table = require("@lexical/table");
4
5
  const list = require("@lexical/list");
5
6
  const code = require("@lexical/code");
6
7
  const link = require("@lexical/link");
7
8
  const hashtag = require("@lexical/hashtag");
8
- require("./ImagePlugin/commands.js");
9
- const ImageNode = require("./ImagePlugin/ImageNode.js");
10
- const RichTextNode = require("./RichTextPlugin/nodes/RichTextNode.js");
11
- require("./ModulePlugin/commands.js");
12
- const ModuleBlockNode = require("./ModulePlugin/ModuleBlockNode.js");
13
- const GridNode = require("./GridPlugin/GridNode.js");
14
- const TextGridNode = require("./GridPlugin/TextGridNode.js");
15
- const LayoutGridNode = require("./GridPlugin/LayoutGridNode.js");
16
- const ImageTextGridNode = require("./GridPlugin/ImageTextGridNode.js");
17
- const ModuleGridNode = require("./GridPlugin/ModuleGridNode.js");
9
+ require("./plugins/ImagePlugin/commands.js");
10
+ const ImageNode = require("./plugins/ImagePlugin/ImageNode.js");
11
+ require("./plugins/ModulePlugin/commands.js");
12
+ const ModuleBlockNode = require("./plugins/ModulePlugin/ModuleBlockNode.js");
13
+ const GridNode = require("./plugins/GridPlugin/GridNode.js");
14
+ const TextGridNode = require("./plugins/GridPlugin/TextGridNode.js");
15
+ const LayoutGridNode = require("./plugins/GridPlugin/LayoutGridNode.js");
16
+ const ImageTextGridNode = require("./plugins/GridPlugin/ImageTextGridNode.js");
17
+ const ModuleGridNode = require("./plugins/GridPlugin/ModuleGridNode.js");
18
+ const RichElementNode = require("./core/nodes/RichElementNode.js");
18
19
  const Nodes = [
20
+ lexical.TextNode,
19
21
  richText.HeadingNode,
20
22
  list.ListNode,
21
23
  list.ListItemNode,
@@ -28,7 +30,7 @@ const Nodes = [
28
30
  link.AutoLinkNode,
29
31
  link.LinkNode,
30
32
  hashtag.HashtagNode,
31
- RichTextNode.RichTextNode,
33
+ RichElementNode.RichElementNode,
32
34
  ImageNode.ImageNode,
33
35
  ImageNode.InlineImageNode,
34
36
  ModuleBlockNode.ModuleBlockNode,
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes.js","sources":["../../../../../src/components/basic/doc-editor/nodes.ts"],"sourcesContent":["\r\nimport { type Klass, type LexicalNode,TextNode } from 'lexical'\r\nimport { HeadingNode, QuoteNode } from '@lexical/rich-text'\r\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table'\r\nimport { ListItemNode, ListNode } from '@lexical/list'\r\nimport { CodeHighlightNode, CodeNode } from '@lexical/code'\r\nimport { AutoLinkNode, LinkNode } from '@lexical/link'\r\nimport { HashtagNode } from '@lexical/hashtag'\r\nimport { ImageNode,InlineImageNode } from \"./plugins/ImagePlugin\"\r\nimport { ModuleBlockNode } from \"./plugins/ModulePlugin\"\r\nimport { GridNode,LayoutGridNode,TextGridNode,ImageTextGridNode,ModuleGridNode } from \"./plugins/GridPlugin\"\r\n\r\nimport { RichElementNode} from \"./core/nodes\"\r\n\r\nconst Nodes: Array<Klass<LexicalNode>> = [\r\n TextNode,\r\n HeadingNode,\r\n ListNode,\r\n ListItemNode,\r\n QuoteNode,\r\n CodeNode,\r\n CodeHighlightNode,\r\n TableNode,\r\n TableCellNode,\r\n TableRowNode,\r\n AutoLinkNode,\r\n LinkNode,\r\n HashtagNode,\r\n\r\n RichElementNode,\r\n ImageNode,\r\n InlineImageNode,\r\n ModuleBlockNode,\r\n GridNode,\r\n TextGridNode,\r\n LayoutGridNode,\r\n ImageTextGridNode,\r\n ModuleGridNode\r\n]\r\n\r\nexport default Nodes\r\n\r\n"],"names":["TextNode","HeadingNode","ListNode","ListItemNode","QuoteNode","CodeNode","CodeHighlightNode","TableNode","TableCellNode","TableRowNode","AutoLinkNode","LinkNode","HashtagNode","RichElementNode","ImageNode","InlineImageNode","ModuleBlockNode","GridNode","TextGridNode","LayoutGridNode","ImageTextGridNode","ModuleGridNode"],"mappings":";;;;;;;;;;;;;;;;;;AAcA,MAAM,QAAmC;AAAA,EACvCA,QAAA;AAAA,EACAC,SAAA;AAAA,EACAC,KAAA;AAAA,EACAC,KAAA;AAAA,EACAC,SAAA;AAAA,EACAC,KAAA;AAAA,EACAC,KAAA;AAAA,EACAC,MAAA;AAAA,EACAC,MAAA;AAAA,EACAC,MAAA;AAAA,EACAC,KAAA;AAAA,EACAC,KAAA;AAAA,EACAC,QAAA;AAAA,EAEAC,gBAAA;AAAA,EACAC,UAAA;AAAA,EACAC,UAAA;AAAA,EACAC,gBAAA;AAAA,EACAC,SAAA;AAAA,EACAC,aAAA;AAAA,EACAC,eAAA;AAAA,EACAC,kBAAA;AAAA,EACAC,eAAA;AACF;;"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const lexicalVue = require("lexical-vue");
3
+ require("../../core/index.js");
4
+ const index_vue_vue_type_script_setup_true_lang = require("../../core/plugins/LexicalAutoLinkPlugin/index.vue2.js");
5
+ const LexicalLinkPlugin_vue_vue_type_script_setup_true_lang = require("../../core/plugins/LexicalLinkPlugin.vue2.js");
4
6
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
7
  __name: "index",
6
8
  setup(__props) {
@@ -28,8 +30,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
28
30
  ];
29
31
  return (_ctx, _cache) => {
30
32
  return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
31
- vue.createVNode(vue.unref(lexicalVue.LexicalAutoLinkPlugin), { matchers: MATCHERS }),
32
- vue.createVNode(vue.unref(lexicalVue.LexicalLinkPlugin))
33
+ vue.createVNode(vue.unref(index_vue_vue_type_script_setup_true_lang), { matchers: MATCHERS }),
34
+ vue.createVNode(vue.unref(LexicalLinkPlugin_vue_vue_type_script_setup_true_lang))
33
35
  ], 64);
34
36
  };
35
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { LexicalAutoLinkPlugin,LexicalLinkPlugin } from 'lexical-vue'\r\n\r\n\r\nconst URL_MATCHER = /((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/\r\n\r\nconst EMAIL_MATCHER = /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/\r\n\r\nconst MATCHERS = [\r\n (text: string) => {\r\n const match = URL_MATCHER.exec(text)\r\n return (\r\n match && {\r\n index: match.index,\r\n length: match[0].length,\r\n text: match[0],\r\n url: match[0],\r\n }\r\n )\r\n },\r\n (text: string) => {\r\n const match = EMAIL_MATCHER.exec(text)\r\n return (\r\n match && {\r\n index: match.index,\r\n length: match[0].length,\r\n text: match[0],\r\n url: `mailto:${match[0]}`,\r\n }\r\n )\r\n },\r\n]\r\n</script>\r\n\r\n<template>\r\n <LexicalAutoLinkPlugin :matchers=\"MATCHERS\" />\r\n <LexicalLinkPlugin />\r\n</template>\r\n"],"names":[],"mappings":";;;;;;AAIA,UAAM,cAAc;AAEpB,UAAM,gBAAgB;AAEtB,UAAM,WAAW;AAAA,MACf,CAAC,SAAiB;AACV,cAAA,QAAQ,YAAY,KAAK,IAAI;AACnC,eACE,SAAS;AAAA,UACP,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM,CAAC,EAAE;AAAA,UACjB,MAAM,MAAM,CAAC;AAAA,UACb,KAAK,MAAM,CAAC;AAAA,QAAA;AAAA,MAGlB;AAAA,MACA,CAAC,SAAiB;AACV,cAAA,QAAQ,cAAc,KAAK,IAAI;AACrC,eACE,SAAS;AAAA,UACP,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM,CAAC,EAAE;AAAA,UACjB,MAAM,MAAM,CAAC;AAAA,UACb,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,QAAA;AAAA,MAG7B;AAAA,IAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"index.vue.js","sources":["../../../../../../../src/components/basic/doc-editor/plugins/AutoLinkPlugin/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { LexicalAutoLinkPlugin,LexicalLinkPlugin } from '../../core'\r\n\r\n\r\nconst URL_MATCHER = /((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/\r\n\r\nconst EMAIL_MATCHER = /(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))/\r\n\r\nconst MATCHERS = [\r\n (text: string) => {\r\n const match = URL_MATCHER.exec(text)\r\n return (\r\n match && {\r\n index: match.index,\r\n length: match[0].length,\r\n text: match[0],\r\n url: match[0],\r\n }\r\n )\r\n },\r\n (text: string) => {\r\n const match = EMAIL_MATCHER.exec(text)\r\n return (\r\n match && {\r\n index: match.index,\r\n length: match[0].length,\r\n text: match[0],\r\n url: `mailto:${match[0]}`,\r\n }\r\n )\r\n },\r\n]\r\n</script>\r\n\r\n<template>\r\n <LexicalAutoLinkPlugin :matchers=\"MATCHERS\" />\r\n <LexicalLinkPlugin />\r\n</template>\r\n"],"names":[],"mappings":";;;;;;;;AAIA,UAAM,cAAc;AAEpB,UAAM,gBAAgB;AAEtB,UAAM,WAAW;AAAA,MACf,CAAC,SAAiB;AACV,cAAA,QAAQ,YAAY,KAAK,IAAI;AACnC,eACE,SAAS;AAAA,UACP,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM,CAAC,EAAE;AAAA,UACjB,MAAM,MAAM,CAAC;AAAA,UACb,KAAK,MAAM,CAAC;AAAA,QAAA;AAAA,MAGlB;AAAA,MACA,CAAC,SAAiB;AACV,cAAA,QAAQ,cAAc,KAAK,IAAI;AACrC,eACE,SAAS;AAAA,UACP,OAAO,MAAM;AAAA,UACb,QAAQ,MAAM,CAAC,EAAE;AAAA,UACjB,MAAM,MAAM,CAAC;AAAA,UACb,KAAK,UAAU,MAAM,CAAC,CAAC;AAAA,QAAA;AAAA,MAG7B;AAAA,IAAA;;;;;;;;;;"}
@@ -2,14 +2,34 @@
2
2
  const vue = require("vue");
3
3
  const lexical = require("lexical");
4
4
  const utils = require("@lexical/utils");
5
- const lexicalVue = require("lexical-vue");
5
+ require("@lexical/text");
6
+ const useMounted = require("../../core/composables/useMounted.js");
7
+ require("@lexical/overflow");
8
+ require("tiny-invariant");
9
+ require("@lexical/history");
10
+ const useLexicalComposer = require("../../core/composables/useLexicalComposer.js");
11
+ require("@lexical/list");
12
+ require("@lexical/dragon");
13
+ require("@lexical/plain-text");
14
+ require("@lexical/rich-text");
15
+ const GridNode = require("../GridPlugin/GridNode.js");
16
+ require("../GridPlugin/TextGridNode.js");
17
+ require("../GridPlugin/LayoutGridNode.js");
18
+ require("../GridPlugin/ImageTextGridNode.js");
19
+ require("../GridPlugin/ModuleGridNode.js");
20
+ require("../ImagePlugin/commands.js");
21
+ const ImageNode = require("../ImagePlugin/ImageNode.js");
22
+ require("../ModulePlugin/commands.js");
23
+ const ModuleBlockNode = require("../ModulePlugin/ModuleBlockNode.js");
6
24
  const index = require("../../core/index.js");
7
25
  const elementBlock = require("../../core/element-block.js");
8
26
  const lowPriority = 1;
9
27
  const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
28
  __name: "index",
11
29
  setup(__props) {
12
- const editor = lexicalVue.useLexicalComposer();
30
+ const editor = useLexicalComposer.useLexicalComposer();
31
+ const isSelectGrid = vue.ref(false);
32
+ const selectionMarkPos = vue.ref({ left: "px", top: "0px", width: "0", height: "0" });
13
33
  const toolbarRef = vue.ref(null);
14
34
  const selectPayload = vue.shallowRef(null);
15
35
  const toolsPos = vue.reactive({ left: "px", top: "0px" });
@@ -19,20 +39,64 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
19
39
  const updateToolsPos = () => {
20
40
  vue.nextTick(() => {
21
41
  if (selectPayload.value != null && toolbarRef.value != null) {
42
+ const element = editor.getElementByKey(selectPayload.value.nodeKey);
22
43
  const editIframeRect = toolbarRef.value.getRootNode().body.querySelector(".mk-doc-editor__stage_iframe").getBoundingClientRect();
23
44
  const editBodyRect = toolbarRef.value.getRootNode().body.querySelector(".mk-doc-editor__stage_body").getBoundingClientRect();
24
45
  const baseY = editIframeRect.y - editBodyRect.y;
25
- const selectRect = selectPayload.value.element.getBoundingClientRect();
46
+ const selectRect = element.getBoundingClientRect();
26
47
  const toolsRect = toolbarRef.value.getBoundingClientRect();
27
48
  if (toolsRect) {
28
49
  toolsPos.top = Math.max(selectRect.y - toolsRect.height - 5 + baseY, 5 + baseY) + "px";
29
- toolsPos.left = toolsRect.width / -2 + selectRect.x + selectRect.width / 2 + "px";
50
+ toolsPos.left = Math.max(toolsRect.width / -2 + selectRect.x + selectRect.width / 2, 0) + "px";
30
51
  }
52
+ selectionMarkPos.value = {
53
+ top: `${selectRect.y + baseY}px`,
54
+ left: `${selectRect.x}px`,
55
+ width: `${selectRect.width}px`,
56
+ height: `${selectRect.height}px`
57
+ };
31
58
  }
32
59
  });
33
60
  return false;
34
61
  };
35
- lexicalVue.useMounted(() => {
62
+ const nodeDesc = vue.computed(() => {
63
+ if (selectPayload.value) {
64
+ const node = editor.getEditorState().read(() => {
65
+ return lexical.$getNodeByKey(selectPayload.value.nodeKey);
66
+ });
67
+ return node.getTitle ? node.getTitle() : "";
68
+ } else {
69
+ return "";
70
+ }
71
+ });
72
+ const canSelectedParentNode = vue.ref(false);
73
+ const selectedParentNode = () => {
74
+ const node = editor.getEditorState().read(() => {
75
+ return lexical.$getNodeByKey(selectPayload.value.nodeKey);
76
+ });
77
+ if (node && node.__parent) {
78
+ elementBlock.setElementBlockSelection(editor, node.__parent);
79
+ }
80
+ };
81
+ const canSelectedNextNode = vue.ref(false);
82
+ const selectedNextNode = () => {
83
+ const node = editor.getEditorState().read(() => {
84
+ return lexical.$getNodeByKey(selectPayload.value.nodeKey);
85
+ });
86
+ if (node && node.__next) {
87
+ elementBlock.setElementBlockSelection(editor, node.__next);
88
+ }
89
+ };
90
+ const canSelectedPrevNode = vue.ref(false);
91
+ const selectedPrevNode = () => {
92
+ const node = editor.getEditorState().read(() => {
93
+ return lexical.$getNodeByKey(selectPayload.value.nodeKey);
94
+ });
95
+ if (node && node.__prev) {
96
+ elementBlock.setElementBlockSelection(editor, node.__prev);
97
+ }
98
+ };
99
+ useMounted.useMounted(() => {
36
100
  return utils.mergeRegister(
37
101
  editor.registerCommand(elementBlock.UPDATE_ELEMENTBLOCK_TOOLBAR_POS_COMMAND, () => updateToolsPos(), lowPriority),
38
102
  editor.registerUpdateListener(() => setTimeout(() => updateToolsPos(), 50)),
@@ -41,19 +105,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
41
105
  if (payload != null) {
42
106
  let toolsbarList = [];
43
107
  if (typeof payload.toolsbars == "function") {
44
- const selection = lexical.$getSelection();
45
- if (lexical.$isNodeSelection(selection)) {
46
- toolsbarList = payload.toolsbars(selection) ?? [];
47
- } else {
48
- toolsbarList = payload.toolsbars(null) ?? [];
49
- }
108
+ toolsbarList = payload.toolsbars(payload.nodeKey) ?? [];
50
109
  } else {
51
110
  toolsbarList = payload.toolsbars;
52
111
  }
53
- selectPayload.value = {
54
- element: payload.element,
55
- toolsbars: toolsbarList
56
- };
112
+ selectPayload.value = { nodeKey: payload.nodeKey, toolsbars: toolsbarList };
57
113
  } else {
58
114
  selectPayload.value = null;
59
115
  }
@@ -67,76 +123,167 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
67
123
  editor.dispatchCommand(elementBlock.SELECTED_ELEMENTBLOCK_COMMAND, null);
68
124
  }
69
125
  return false;
126
+ }, lowPriority),
127
+ editor.registerCommand(lexical.SELECTION_CHANGE_COMMAND, () => {
128
+ const selection = lexical.$getSelection();
129
+ if (lexical.$isNodeSelection(selection)) {
130
+ const node = selection.getNodes()[0];
131
+ canSelectedParentNode.value = GridNode.$isGridNode(node == null ? void 0 : node.getParent());
132
+ if (node == null ? void 0 : node.__next) {
133
+ const nextNode = lexical.$getNodeByKey(node.__next);
134
+ canSelectedNextNode.value = (node == null ? void 0 : node.__next) ? GridNode.$isGridNode(nextNode) || ModuleBlockNode.$isModuleBlockNode(nextNode) || ImageNode.$isImageNode(nextNode) : false;
135
+ } else {
136
+ canSelectedNextNode.value = false;
137
+ }
138
+ if (node == null ? void 0 : node.__prev) {
139
+ const prevNode = lexical.$getNodeByKey(node.__prev);
140
+ canSelectedPrevNode.value = (node == null ? void 0 : node.__prev) ? GridNode.$isGridNode(prevNode) || ModuleBlockNode.$isModuleBlockNode(prevNode) || ImageNode.$isImageNode(prevNode) : false;
141
+ } else {
142
+ canSelectedPrevNode.value = false;
143
+ }
144
+ } else {
145
+ canSelectedParentNode.value = false;
146
+ canSelectedNextNode.value = false;
147
+ canSelectedPrevNode.value = false;
148
+ }
149
+ return updateToolsPos();
70
150
  }, lowPriority)
71
- // editor.registerCommand(SELECTION_CHANGE_COMMAND, (payload, newEditor) => {
72
- // const selection = $getSelection();
73
- // if($isNodeSelection(selection)){
74
- // const node = selection.getNodes()[0]
75
- // console.log(node,node.getTopLevelElement());
76
- // }
77
- // return updateToolsPos();
78
- // },lowPriority)
79
151
  );
80
152
  });
81
153
  return (_ctx, _cache) => {
82
- const _component_MKSvgIcon = vue.resolveComponent("MKSvgIcon");
83
154
  const _component_el_button = vue.resolveComponent("el-button");
155
+ const _component_MKSvgIcon = vue.resolveComponent("MKSvgIcon");
84
156
  const _component_el_tooltip = vue.resolveComponent("el-tooltip");
85
157
  const _component_el_button_group = vue.resolveComponent("el-button-group");
86
- return selectPayload.value != null ? (vue.openBlock(), vue.createElementBlock("div", {
87
- key: 0,
88
- ref_key: "toolbarRef",
89
- ref: toolbarRef,
90
- class: "mk-doc-editor-decorator-module-toolbar",
91
- style: vue.normalizeStyle(toolsPos)
92
- }, [
93
- vue.createVNode(_component_el_button_group, null, {
94
- default: vue.withCtx(() => [
95
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selectPayload.value.toolsbars, (item) => {
96
- return vue.openBlock(), vue.createBlock(_component_el_tooltip, {
158
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
159
+ selectPayload.value != null ? (vue.openBlock(), vue.createElementBlock("div", {
160
+ key: 0,
161
+ ref_key: "toolbarRef",
162
+ ref: toolbarRef,
163
+ class: "mk-doc-editor-decorator-module-toolbar",
164
+ style: vue.normalizeStyle(toolsPos)
165
+ }, [
166
+ vue.createVNode(_component_el_button_group, null, {
167
+ default: vue.withCtx(() => [
168
+ nodeDesc.value ? (vue.openBlock(), vue.createBlock(_component_el_button, {
169
+ key: 0,
170
+ text: "",
171
+ bg: "",
172
+ style: { "font-size": "14px" }
173
+ }, {
174
+ default: vue.withCtx(() => [
175
+ vue.createTextVNode(vue.toDisplayString(nodeDesc.value), 1)
176
+ ]),
177
+ _: 1
178
+ })) : vue.createCommentVNode("", true),
179
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selectPayload.value.toolsbars, (item) => {
180
+ return vue.openBlock(), vue.createBlock(_component_el_tooltip, {
181
+ effect: "dark",
182
+ content: item.title,
183
+ placement: "top"
184
+ }, {
185
+ default: vue.withCtx(() => [
186
+ vue.createVNode(_component_el_button, {
187
+ text: "",
188
+ onClick: ($event) => item.action()
189
+ }, {
190
+ default: vue.withCtx(() => [
191
+ vue.createVNode(_component_MKSvgIcon, {
192
+ iconClass: item.icon
193
+ }, null, 8, ["iconClass"])
194
+ ]),
195
+ _: 2
196
+ }, 1032, ["onClick"])
197
+ ]),
198
+ _: 2
199
+ }, 1032, ["content"]);
200
+ }), 256)),
201
+ canSelectedParentNode.value ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
202
+ key: 1,
97
203
  effect: "dark",
98
- content: item.title,
204
+ content: "上层容器",
99
205
  placement: "top"
100
206
  }, {
101
207
  default: vue.withCtx(() => [
102
208
  vue.createVNode(_component_el_button, {
103
209
  text: "",
104
- onClick: ($event) => item.action()
210
+ onClick: _cache[0] || (_cache[0] = ($event) => selectedParentNode())
105
211
  }, {
106
212
  default: vue.withCtx(() => [
107
- vue.createVNode(_component_MKSvgIcon, {
108
- iconClass: item.icon
109
- }, null, 8, ["iconClass"])
213
+ vue.createVNode(_component_MKSvgIcon, { iconClass: `ArrowUpBold` })
110
214
  ]),
111
- _: 2
112
- }, 1032, ["onClick"])
215
+ _: 1
216
+ })
113
217
  ]),
114
- _: 2
115
- }, 1032, ["content"]);
116
- }), 256)),
117
- vue.createVNode(_component_el_tooltip, {
118
- effect: "dark",
119
- content: "删除",
120
- placement: "top"
121
- }, {
122
- default: vue.withCtx(() => [
123
- vue.createVNode(_component_el_button, {
124
- text: "",
125
- type: "danger",
126
- onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editor).dispatchCommand(vue.unref(elementBlock.REMOVE_ELEMENTBLOCK_COMMAND), null))
127
- }, {
128
- default: vue.withCtx(() => [
129
- vue.createVNode(_component_MKSvgIcon, { iconClass: `Delete` })
130
- ]),
131
- _: 1
132
- })
133
- ]),
134
- _: 1
135
- })
136
- ]),
137
- _: 1
138
- })
139
- ], 4)) : vue.createCommentVNode("", true);
218
+ _: 1
219
+ })) : vue.createCommentVNode("", true),
220
+ canSelectedPrevNode.value ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
221
+ key: 2,
222
+ effect: "dark",
223
+ content: "上一个",
224
+ placement: "top"
225
+ }, {
226
+ default: vue.withCtx(() => [
227
+ vue.createVNode(_component_el_button, {
228
+ text: "",
229
+ onClick: _cache[1] || (_cache[1] = ($event) => selectedPrevNode())
230
+ }, {
231
+ default: vue.withCtx(() => [
232
+ vue.createVNode(_component_MKSvgIcon, { iconClass: `ArrowLeftBold` })
233
+ ]),
234
+ _: 1
235
+ })
236
+ ]),
237
+ _: 1
238
+ })) : vue.createCommentVNode("", true),
239
+ canSelectedNextNode.value ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
240
+ key: 3,
241
+ effect: "dark",
242
+ content: "下一个",
243
+ placement: "top"
244
+ }, {
245
+ default: vue.withCtx(() => [
246
+ vue.createVNode(_component_el_button, {
247
+ text: "",
248
+ onClick: _cache[2] || (_cache[2] = ($event) => selectedNextNode())
249
+ }, {
250
+ default: vue.withCtx(() => [
251
+ vue.createVNode(_component_MKSvgIcon, { iconClass: `ArrowRightBold` })
252
+ ]),
253
+ _: 1
254
+ })
255
+ ]),
256
+ _: 1
257
+ })) : vue.createCommentVNode("", true),
258
+ vue.createVNode(_component_el_tooltip, {
259
+ effect: "dark",
260
+ content: "删除",
261
+ placement: "top"
262
+ }, {
263
+ default: vue.withCtx(() => [
264
+ vue.createVNode(_component_el_button, {
265
+ text: "",
266
+ type: "danger",
267
+ onClick: _cache[3] || (_cache[3] = ($event) => vue.unref(editor).dispatchCommand(vue.unref(elementBlock.REMOVE_ELEMENTBLOCK_COMMAND), null))
268
+ }, {
269
+ default: vue.withCtx(() => [
270
+ vue.createVNode(_component_MKSvgIcon, { iconClass: `Delete` })
271
+ ]),
272
+ _: 1
273
+ })
274
+ ]),
275
+ _: 1
276
+ })
277
+ ]),
278
+ _: 1
279
+ })
280
+ ], 4)) : vue.createCommentVNode("", true),
281
+ selectPayload.value != null ? (vue.openBlock(), vue.createElementBlock("div", {
282
+ key: 1,
283
+ class: vue.normalizeClass(["mk-doc-selection-element-block-mark box", { box: isSelectGrid.value }]),
284
+ style: vue.normalizeStyle(selectionMarkPos.value)
285
+ }, null, 6)) : vue.createCommentVNode("", true)
286
+ ], 64);
140
287
  };
141
288
  }
142
289
  });