@advocado-labs/cado-editor 0.0.0-stage → 1.0.5

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 (314) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +76 -2
  3. package/dist/assets/catalog-I5Jqg37f.js.map +1 -0
  4. package/dist/assets/group-BZtj1M7o.js.map +1 -0
  5. package/dist/assets/value-BUbTZYaX.js.map +1 -0
  6. package/dist/assets/wordCount-xSvDqE7d.js.map +1 -0
  7. package/dist/cado-editor.css +2 -0
  8. package/dist/cado-editor.js +23656 -0
  9. package/dist/cado-editor.js.map +1 -0
  10. package/dist/cado-editor.umd.cjs +92 -0
  11. package/dist/cado-editor.umd.cjs.map +1 -0
  12. package/dist/src/editor/core/accessibility/Accessibility.d.ts +14 -0
  13. package/dist/src/editor/core/actuator/Actuator.d.ts +7 -0
  14. package/dist/src/editor/core/actuator/handlers/positionContextChange.d.ts +3 -0
  15. package/dist/src/editor/core/bubblemenu/BubbleMenu.d.ts +29 -0
  16. package/dist/src/editor/core/bubblemenu/menus.d.ts +2 -0
  17. package/dist/src/editor/core/cascade/CascadeManager.d.ts +28 -0
  18. package/dist/src/editor/core/cascade/expression/evaluator.d.ts +14 -0
  19. package/dist/src/editor/core/cascade/expression/parser.d.ts +36 -0
  20. package/dist/src/editor/core/cascade/expression/tokenizer.d.ts +19 -0
  21. package/dist/src/editor/core/command/Command.d.ts +170 -0
  22. package/dist/src/editor/core/command/CommandAdapt.d.ts +221 -0
  23. package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +37 -0
  24. package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -0
  25. package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -0
  26. package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -0
  27. package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -0
  28. package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -0
  29. package/dist/src/editor/core/cursor/Cursor.d.ts +46 -0
  30. package/dist/src/editor/core/cursor/CursorAgent.d.ts +16 -0
  31. package/dist/src/editor/core/cursor/LinePlaceholder.d.ts +20 -0
  32. package/dist/src/editor/core/draw/Draw.d.ts +368 -0
  33. package/dist/src/editor/core/draw/IncrementalRowComputer.d.ts +50 -0
  34. package/dist/src/editor/core/draw/column/ColumnManager.d.ts +15 -0
  35. package/dist/src/editor/core/draw/control/Control.d.ts +77 -0
  36. package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +16 -0
  37. package/dist/src/editor/core/draw/control/date/DateControl.d.ts +24 -0
  38. package/dist/src/editor/core/draw/control/interactive/ControlSearch.d.ts +20 -0
  39. package/dist/src/editor/core/draw/control/number/Calculator.d.ts +30 -0
  40. package/dist/src/editor/core/draw/control/number/NumberControl.d.ts +13 -0
  41. package/dist/src/editor/core/draw/control/radio/RadioControl.d.ts +5 -0
  42. package/dist/src/editor/core/draw/control/richtext/Border.d.ts +10 -0
  43. package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +32 -0
  44. package/dist/src/editor/core/draw/control/text/TextControl.d.ts +18 -0
  45. package/dist/src/editor/core/draw/frame/Background.d.ts +11 -0
  46. package/dist/src/editor/core/draw/frame/Badge.d.ts +14 -0
  47. package/dist/src/editor/core/draw/frame/Footer.d.ts +30 -0
  48. package/dist/src/editor/core/draw/frame/Header.d.ts +30 -0
  49. package/dist/src/editor/core/draw/frame/LineNumber.d.ts +7 -0
  50. package/dist/src/editor/core/draw/frame/Margin.d.ts +11 -0
  51. package/dist/src/editor/core/draw/frame/PageBorder.d.ts +9 -0
  52. package/dist/src/editor/core/draw/frame/PageNumber.d.ts +9 -0
  53. package/dist/src/editor/core/draw/frame/Placeholder.d.ts +20 -0
  54. package/dist/src/editor/core/draw/frame/Watermark.d.ts +19 -0
  55. package/dist/src/editor/core/draw/graffiti/Graffiti.d.ts +19 -0
  56. package/dist/src/editor/core/draw/interactive/Area.d.ts +30 -0
  57. package/dist/src/editor/core/draw/interactive/Group.d.ts +18 -0
  58. package/dist/src/editor/core/draw/interactive/Magnifier.d.ts +19 -0
  59. package/dist/src/editor/core/draw/interactive/Search.d.ts +32 -0
  60. package/dist/src/editor/core/draw/interactive/Spellcheck.d.ts +20 -0
  61. package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +18 -0
  62. package/dist/src/editor/core/draw/particle/HintParticle.d.ts +25 -0
  63. package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +19 -0
  64. package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +23 -0
  65. package/dist/src/editor/core/draw/particle/LabelParticle.d.ts +8 -0
  66. package/dist/src/editor/core/draw/particle/LineBreakParticle.d.ts +10 -0
  67. package/dist/src/editor/core/draw/particle/ListParticle.d.ts +30 -0
  68. package/dist/src/editor/core/draw/particle/PageBreakParticle.d.ts +9 -0
  69. package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +18 -0
  70. package/dist/src/editor/core/draw/particle/SeparatorParticle.d.ts +7 -0
  71. package/dist/src/editor/core/draw/particle/SubscriptParticle.d.ts +5 -0
  72. package/dist/src/editor/core/draw/particle/SuperscriptParticle.d.ts +5 -0
  73. package/dist/src/editor/core/draw/particle/TextParticle.d.ts +29 -0
  74. package/dist/src/editor/core/draw/particle/TraceParticle.d.ts +43 -0
  75. package/dist/src/editor/core/draw/particle/WhiteSpaceParticle.d.ts +7 -0
  76. package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +19 -0
  77. package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +41 -0
  78. package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +13 -0
  79. package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +8 -0
  80. package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +13 -0
  81. package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +108 -0
  82. package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -0
  83. package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -0
  84. package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -0
  85. package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -0
  86. package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +56 -0
  87. package/dist/src/editor/core/draw/particle/previewer/resizer.d.ts +8 -0
  88. package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +35 -0
  89. package/dist/src/editor/core/draw/particle/table/TablePaging.d.ts +13 -0
  90. package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +41 -0
  91. package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +42 -0
  92. package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +11 -0
  93. package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -0
  94. package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -0
  95. package/dist/src/editor/core/draw/richtext/Underline.d.ts +10 -0
  96. package/dist/src/editor/core/draw/ruler/Ruler.d.ts +43 -0
  97. package/dist/src/editor/core/event/CanvasEvent.d.ts +53 -0
  98. package/dist/src/editor/core/event/GlobalEvent.d.ts +28 -0
  99. package/dist/src/editor/core/event/eventbus/EventBus.d.ts +9 -0
  100. package/dist/src/editor/core/event/handlers/click.d.ts +11 -0
  101. package/dist/src/editor/core/event/handlers/composition.d.ts +8 -0
  102. package/dist/src/editor/core/event/handlers/copy.d.ts +3 -0
  103. package/dist/src/editor/core/event/handlers/cut.d.ts +2 -0
  104. package/dist/src/editor/core/event/handlers/drag.d.ts +6 -0
  105. package/dist/src/editor/core/event/handlers/drop.d.ts +2 -0
  106. package/dist/src/editor/core/event/handlers/input.d.ts +3 -0
  107. package/dist/src/editor/core/event/handlers/keydown/backspace.d.ts +2 -0
  108. package/dist/src/editor/core/event/handlers/keydown/delete.d.ts +2 -0
  109. package/dist/src/editor/core/event/handlers/keydown/end.d.ts +2 -0
  110. package/dist/src/editor/core/event/handlers/keydown/enter.d.ts +2 -0
  111. package/dist/src/editor/core/event/handlers/keydown/home.d.ts +2 -0
  112. package/dist/src/editor/core/event/handlers/keydown/index.d.ts +2 -0
  113. package/dist/src/editor/core/event/handlers/keydown/left.d.ts +2 -0
  114. package/dist/src/editor/core/event/handlers/keydown/right.d.ts +2 -0
  115. package/dist/src/editor/core/event/handlers/keydown/tab.d.ts +2 -0
  116. package/dist/src/editor/core/event/handlers/keydown/updown.d.ts +2 -0
  117. package/dist/src/editor/core/event/handlers/mousedown.d.ts +7 -0
  118. package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -0
  119. package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -0
  120. package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -0
  121. package/dist/src/editor/core/event/handlers/paste.d.ts +8 -0
  122. package/dist/src/editor/core/history/HistoryManager.d.ts +16 -0
  123. package/dist/src/editor/core/i18n/I18n.d.ts +12 -0
  124. package/dist/src/editor/core/image/ImageUpload.d.ts +14 -0
  125. package/dist/src/editor/core/listener/ChangeEmitter.d.ts +16 -0
  126. package/dist/src/editor/core/listener/Listener.d.ts +15 -0
  127. package/dist/src/editor/core/macro/MacroManager.d.ts +25 -0
  128. package/dist/src/editor/core/observer/ImageObserver.d.ts +7 -0
  129. package/dist/src/editor/core/observer/MouseObserver.d.ts +13 -0
  130. package/dist/src/editor/core/observer/ScrollObserver.d.ts +20 -0
  131. package/dist/src/editor/core/observer/SelectionObserver.d.ts +23 -0
  132. package/dist/src/editor/core/override/Override.d.ts +9 -0
  133. package/dist/src/editor/core/plugin/Plugin.d.ts +7 -0
  134. package/dist/src/editor/core/position/Position.d.ts +56 -0
  135. package/dist/src/editor/core/range/RangeManager.d.ts +48 -0
  136. package/dist/src/editor/core/register/Register.d.ts +30 -0
  137. package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -0
  138. package/dist/src/editor/core/shortcut/keys/listKeys.d.ts +2 -0
  139. package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -0
  140. package/dist/src/editor/core/shortcut/keys/titleKeys.d.ts +2 -0
  141. package/dist/src/editor/core/slashmenu/SlashMenu.d.ts +35 -0
  142. package/dist/src/editor/core/slashmenu/menus.d.ts +2 -0
  143. package/dist/src/editor/core/theme/ThemeColors.d.ts +18 -0
  144. package/dist/src/editor/core/ui/UiManager.d.ts +27 -0
  145. package/dist/src/editor/core/validate/Validate.d.ts +19 -0
  146. package/dist/src/editor/core/watermark/WatermarkEditor.d.ts +50 -0
  147. package/dist/src/editor/core/worker/WorkerManager.d.ts +17 -0
  148. package/dist/src/editor/core/worker/works/catalog.d.ts +1 -0
  149. package/dist/src/editor/core/worker/works/group.d.ts +1 -0
  150. package/dist/src/editor/core/worker/works/value.d.ts +1 -0
  151. package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -0
  152. package/dist/src/editor/core/zone/Zone.d.ts +22 -0
  153. package/dist/src/editor/core/zone/ZoneTip.d.ts +19 -0
  154. package/dist/src/editor/dataset/constant/Accessibility.d.ts +2 -0
  155. package/dist/src/editor/dataset/constant/Background.d.ts +2 -0
  156. package/dist/src/editor/dataset/constant/Badge.d.ts +2 -0
  157. package/dist/src/editor/dataset/constant/BubbleMenu.d.ts +10 -0
  158. package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -0
  159. package/dist/src/editor/dataset/constant/Column.d.ts +2 -0
  160. package/dist/src/editor/dataset/constant/Common.d.ts +22 -0
  161. package/dist/src/editor/dataset/constant/ContextMenu.d.ts +62 -0
  162. package/dist/src/editor/dataset/constant/Control.d.ts +2 -0
  163. package/dist/src/editor/dataset/constant/Cursor.d.ts +3 -0
  164. package/dist/src/editor/dataset/constant/Editor.d.ts +6 -0
  165. package/dist/src/editor/dataset/constant/Element.d.ts +24 -0
  166. package/dist/src/editor/dataset/constant/Footer.d.ts +2 -0
  167. package/dist/src/editor/dataset/constant/Graffiti.d.ts +2 -0
  168. package/dist/src/editor/dataset/constant/Group.d.ts +2 -0
  169. package/dist/src/editor/dataset/constant/Header.d.ts +2 -0
  170. package/dist/src/editor/dataset/constant/Hint.d.ts +2 -0
  171. package/dist/src/editor/dataset/constant/ImgCaption.d.ts +2 -0
  172. package/dist/src/editor/dataset/constant/Label.d.ts +2 -0
  173. package/dist/src/editor/dataset/constant/Layout.d.ts +2 -0
  174. package/dist/src/editor/dataset/constant/LineBreak.d.ts +2 -0
  175. package/dist/src/editor/dataset/constant/LineNumber.d.ts +2 -0
  176. package/dist/src/editor/dataset/constant/LinePlaceholder.d.ts +2 -0
  177. package/dist/src/editor/dataset/constant/List.d.ts +6 -0
  178. package/dist/src/editor/dataset/constant/Magnifier.d.ts +2 -0
  179. package/dist/src/editor/dataset/constant/PageBorder.d.ts +2 -0
  180. package/dist/src/editor/dataset/constant/PageBreak.d.ts +2 -0
  181. package/dist/src/editor/dataset/constant/PageNumber.d.ts +6 -0
  182. package/dist/src/editor/dataset/constant/Paper.d.ts +5 -0
  183. package/dist/src/editor/dataset/constant/Placeholder.d.ts +2 -0
  184. package/dist/src/editor/dataset/constant/Radio.d.ts +2 -0
  185. package/dist/src/editor/dataset/constant/Regular.d.ts +10 -0
  186. package/dist/src/editor/dataset/constant/Ruler.d.ts +2 -0
  187. package/dist/src/editor/dataset/constant/Separator.d.ts +2 -0
  188. package/dist/src/editor/dataset/constant/Shortcut.d.ts +3 -0
  189. package/dist/src/editor/dataset/constant/SlashMenu.d.ts +14 -0
  190. package/dist/src/editor/dataset/constant/Spellcheck.d.ts +2 -0
  191. package/dist/src/editor/dataset/constant/Table.d.ts +2 -0
  192. package/dist/src/editor/dataset/constant/Title.d.ts +6 -0
  193. package/dist/src/editor/dataset/constant/Trace.d.ts +2 -0
  194. package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -0
  195. package/dist/src/editor/dataset/constant/WhiteSpace.d.ts +2 -0
  196. package/dist/src/editor/dataset/constant/Zone.d.ts +2 -0
  197. package/dist/src/editor/dataset/enum/Area.d.ts +5 -0
  198. package/dist/src/editor/dataset/enum/Background.d.ts +10 -0
  199. package/dist/src/editor/dataset/enum/Block.d.ts +4 -0
  200. package/dist/src/editor/dataset/enum/Common.d.ts +30 -0
  201. package/dist/src/editor/dataset/enum/Control.d.ts +32 -0
  202. package/dist/src/editor/dataset/enum/DatePicker.d.ts +5 -0
  203. package/dist/src/editor/dataset/enum/Editor.d.ts +49 -0
  204. package/dist/src/editor/dataset/enum/Element.d.ts +21 -0
  205. package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -0
  206. package/dist/src/editor/dataset/enum/Event.d.ts +5 -0
  207. package/dist/src/editor/dataset/enum/KeyMap.d.ts +86 -0
  208. package/dist/src/editor/dataset/enum/LineNumber.d.ts +4 -0
  209. package/dist/src/editor/dataset/enum/List.d.ts +20 -0
  210. package/dist/src/editor/dataset/enum/Macro.d.ts +4 -0
  211. package/dist/src/editor/dataset/enum/Observer.d.ts +6 -0
  212. package/dist/src/editor/dataset/enum/Row.d.ts +7 -0
  213. package/dist/src/editor/dataset/enum/Text.d.ts +12 -0
  214. package/dist/src/editor/dataset/enum/Title.d.ts +8 -0
  215. package/dist/src/editor/dataset/enum/Trace.d.ts +4 -0
  216. package/dist/src/editor/dataset/enum/VerticalAlign.d.ts +5 -0
  217. package/dist/src/editor/dataset/enum/Watermark.d.ts +8 -0
  218. package/dist/src/editor/dataset/enum/table/Table.d.ts +17 -0
  219. package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -0
  220. package/dist/src/editor/index.d.ts +87 -0
  221. package/dist/src/editor/interface/Accessibility.d.ts +3 -0
  222. package/dist/src/editor/interface/Area.d.ts +64 -0
  223. package/dist/src/editor/interface/Background.d.ts +8 -0
  224. package/dist/src/editor/interface/Badge.d.ts +15 -0
  225. package/dist/src/editor/interface/Block.d.ts +23 -0
  226. package/dist/src/editor/interface/Catalog.d.ts +9 -0
  227. package/dist/src/editor/interface/Checkbox.d.ts +18 -0
  228. package/dist/src/editor/interface/Column.d.ts +14 -0
  229. package/dist/src/editor/interface/Command.d.ts +3 -0
  230. package/dist/src/editor/interface/Common.d.ts +14 -0
  231. package/dist/src/editor/interface/Compare.d.ts +5 -0
  232. package/dist/src/editor/interface/Control.d.ts +249 -0
  233. package/dist/src/editor/interface/Cursor.d.ts +7 -0
  234. package/dist/src/editor/interface/Draw.d.ts +96 -0
  235. package/dist/src/editor/interface/Editor.d.ts +185 -0
  236. package/dist/src/editor/interface/Element.d.ts +247 -0
  237. package/dist/src/editor/interface/Event.d.ts +22 -0
  238. package/dist/src/editor/interface/EventBus.d.ts +61 -0
  239. package/dist/src/editor/interface/Footer.d.ts +9 -0
  240. package/dist/src/editor/interface/Graffiti.d.ts +13 -0
  241. package/dist/src/editor/interface/Group.d.ts +8 -0
  242. package/dist/src/editor/interface/Header.d.ts +9 -0
  243. package/dist/src/editor/interface/Hint.d.ts +7 -0
  244. package/dist/src/editor/interface/Image.d.ts +7 -0
  245. package/dist/src/editor/interface/Label.d.ts +7 -0
  246. package/dist/src/editor/interface/LineBreak.d.ts +5 -0
  247. package/dist/src/editor/interface/LineNumber.d.ts +9 -0
  248. package/dist/src/editor/interface/Listener.d.ts +81 -0
  249. package/dist/src/editor/interface/Macro.d.ts +19 -0
  250. package/dist/src/editor/interface/Magnifier.d.ts +6 -0
  251. package/dist/src/editor/interface/Margin.d.ts +1 -0
  252. package/dist/src/editor/interface/PageBorder.d.ts +7 -0
  253. package/dist/src/editor/interface/PageBreak.d.ts +5 -0
  254. package/dist/src/editor/interface/PageNumber.d.ts +15 -0
  255. package/dist/src/editor/interface/Placeholder.d.ts +7 -0
  256. package/dist/src/editor/interface/Plugin.d.ts +3 -0
  257. package/dist/src/editor/interface/Position.d.ts +117 -0
  258. package/dist/src/editor/interface/Previewer.d.ts +13 -0
  259. package/dist/src/editor/interface/Print.d.ts +10 -0
  260. package/dist/src/editor/interface/Radio.d.ts +15 -0
  261. package/dist/src/editor/interface/Range.d.ts +54 -0
  262. package/dist/src/editor/interface/Row.d.ts +49 -0
  263. package/dist/src/editor/interface/Ruler.d.ts +4 -0
  264. package/dist/src/editor/interface/Search.d.ts +30 -0
  265. package/dist/src/editor/interface/Separator.d.ts +4 -0
  266. package/dist/src/editor/interface/Spellcheck.d.ts +27 -0
  267. package/dist/src/editor/interface/Text.d.ts +13 -0
  268. package/dist/src/editor/interface/Title.d.ts +26 -0
  269. package/dist/src/editor/interface/Trace.d.ts +11 -0
  270. package/dist/src/editor/interface/Watermark.d.ts +20 -0
  271. package/dist/src/editor/interface/WhiteSpace.d.ts +5 -0
  272. package/dist/src/editor/interface/Zone.d.ts +3 -0
  273. package/dist/src/editor/interface/bubblemenu/BubbleMenu.d.ts +36 -0
  274. package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +73 -0
  275. package/dist/src/editor/interface/i18n/Accessibility.d.ts +4 -0
  276. package/dist/src/editor/interface/i18n/I18n.d.ts +26 -0
  277. package/dist/src/editor/interface/i18n/Trace.d.ts +7 -0
  278. package/dist/src/editor/interface/i18n/Validate.d.ts +15 -0
  279. package/dist/src/editor/interface/lineplaceholder/LinePlaceholder.d.ts +9 -0
  280. package/dist/src/editor/interface/shortcut/Shortcut.d.ts +13 -0
  281. package/dist/src/editor/interface/slashmenu/SlashMenu.d.ts +41 -0
  282. package/dist/src/editor/interface/table/Colgroup.d.ts +4 -0
  283. package/dist/src/editor/interface/table/Table.d.ts +8 -0
  284. package/dist/src/editor/interface/table/Td.d.ts +36 -0
  285. package/dist/src/editor/interface/table/Tr.d.ts +10 -0
  286. package/dist/src/editor/interface/ui/BubbleMenu.d.ts +20 -0
  287. package/dist/src/editor/interface/ui/Calculator.d.ts +23 -0
  288. package/dist/src/editor/interface/ui/ContextMenu.d.ts +24 -0
  289. package/dist/src/editor/interface/ui/DatePicker.d.ts +40 -0
  290. package/dist/src/editor/interface/ui/HintPopup.d.ts +8 -0
  291. package/dist/src/editor/interface/ui/HyperlinkPopup.d.ts +11 -0
  292. package/dist/src/editor/interface/ui/ImagePreviewer.d.ts +31 -0
  293. package/dist/src/editor/interface/ui/LinePlaceholder.d.ts +8 -0
  294. package/dist/src/editor/interface/ui/SelectControl.d.ts +18 -0
  295. package/dist/src/editor/interface/ui/SlashMenu.d.ts +28 -0
  296. package/dist/src/editor/interface/ui/TracePopup.d.ts +18 -0
  297. package/dist/src/editor/interface/ui/Ui.d.ts +121 -0
  298. package/dist/src/editor/interface/ui/WatermarkEditor.d.ts +36 -0
  299. package/dist/src/editor/interface/ui/ZoneTip.d.ts +10 -0
  300. package/dist/src/editor/lib.d.ts +3 -0
  301. package/dist/src/editor/utils/clipboard.d.ts +13 -0
  302. package/dist/src/editor/utils/diff.d.ts +7 -0
  303. package/dist/src/editor/utils/element.d.ts +82 -0
  304. package/dist/src/editor/utils/hotkey.d.ts +1 -0
  305. package/dist/src/editor/utils/index.d.ts +35 -0
  306. package/dist/src/editor/utils/option.d.ts +4 -0
  307. package/dist/src/editor/utils/paragraph.d.ts +8 -0
  308. package/dist/src/editor/utils/print.d.ts +13 -0
  309. package/dist/src/editor/utils/shortcut.d.ts +1 -0
  310. package/dist/src/editor/utils/table.d.ts +4 -0
  311. package/dist/src/editor/utils/textLayer.d.ts +17 -0
  312. package/dist/src/editor/utils/ua.d.ts +4 -0
  313. package/dist/src/editor/utils/unit.d.ts +3 -0
  314. package/package.json +82 -4
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021-present, hufe
4
+ Copyright (c) 2026-present, Bordinlabs
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,77 @@
1
- # Temporary Holding Version
1
+ # Cado Editor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A canvas-based rich text editor. Use it for documents that need print-accurate pages (headers and footers, tables, form controls, precise pagination) or as a page-less writing area that fills its container. The UI is headless, so you can render every menu and popup with your own components and Tailwind.
4
+
5
+ ## Features
6
+
7
+ - **Two layouts**: paper pages for documents, or a page-less `flow` area that fills its container for notes and comments
8
+ - **Paged layout**: paper sizes, portrait/landscape (per section), margins, headers and footers, page numbers, watermarks, columns, line numbers, rulers
9
+ - **Rich text**: fonts, sizes, bold, italic, underline, strikethrough, sub/superscript, colors, highlight, alignment, line spacing, headings, lists and to-do lists
10
+ - **Content**: tables (merge/split cells, borders, cross-page rows), images, hyperlinks, LaTeX, separators, page breaks, dates, embedded blocks
11
+ - **Form controls**: text, number, select, checkbox, radio and date fields with validation and cascade expressions
12
+ - **Editing**: undo/redo, search and replace, format painter, track changes, comments, macros, drag and drop, paste from HTML
13
+ - **Notion-style menus**: slash command menu, bubble menu on selection and a placeholder on empty lines
14
+ - **Headless UI**: every popup can be rendered by the editor (styled with your classes) or by your own components
15
+ - **Print to PDF** with selectable, searchable text
16
+ - **Extensible**: plugins, custom shortcuts, context menus and translations (English by default)
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install @advocado-labs/cado-editor
22
+ # or straight from GitHub
23
+ npm install github:Bordinlabs/cado-editor
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```ts
29
+ import Editor from '@advocado-labs/cado-editor'
30
+ // Optional default look for the builtin popups
31
+ import '@advocado-labs/cado-editor/style.css'
32
+
33
+ const editor = new Editor(document.querySelector<HTMLDivElement>('#editor')!, {
34
+ main: [{ value: 'Hello world' }]
35
+ })
36
+
37
+ editor.command.executeBold()
38
+ editor.eventBus.on('contentChange', () => {
39
+ console.log(editor.command.getValue())
40
+ })
41
+ ```
42
+
43
+ ### Headless UI
44
+
45
+ Set `ui: { mode: 'headless' }` and render the popups yourself. Each one emits an event with its position, data and actions:
46
+
47
+ ```ts
48
+ const editor = new Editor(container, data, { ui: { mode: 'headless' } })
49
+
50
+ editor.eventBus.on('uiSlashMenu', menu => {
51
+ if (!menu.visible) return hideMenu()
52
+ // menu.items, menu.activeIndex, menu.anchor, menu.select(key)
53
+ renderMenu(menu)
54
+ })
55
+ ```
56
+
57
+ For a page-less writing area use `layout: EditorLayout.FLOW`, see [Layout](docs/layout.md).
58
+
59
+ See [Headless UI](docs/headless.md), [Slash menu](docs/slash-menu.md) and [Bubble menu](docs/bubble-menu.md).
60
+
61
+ ## Documentation
62
+
63
+ The full reference (options, commands, events, controls, plugins) is in [docs](docs/README.md).
64
+
65
+ ## Development
66
+
67
+ ```bash
68
+ pnpm install
69
+ pnpm dev # demo app at http://localhost:3000/cado-editor/
70
+ pnpm test:unit # unit tests
71
+ pnpm lint # ESLint, type check and tests
72
+ pnpm lib # build the library into dist/
73
+ ```
74
+
75
+ ## License
76
+
77
+ [MIT](LICENSE)
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-I5Jqg37f.js","names":[],"sources":["../../src/editor/core/worker/works/catalog.ts"],"sourcesContent":["import { ICatalog, ICatalogItem } from '../../../interface/Catalog'\nimport { IElement, IElementPosition } from '../../../interface/Element'\n\ninterface IGetCatalogPayload {\n elementList: IElement[]\n positionList: IElementPosition[]\n}\n\ntype ICatalogElement = IElement & {\n pageNo: number\n}\n\nenum ElementType {\n TEXT = 'text',\n IMAGE = 'image',\n TABLE = 'table',\n HYPERLINK = 'hyperlink',\n SUPERSCRIPT = 'superscript',\n SUBSCRIPT = 'subscript',\n SEPARATOR = 'separator',\n PAGE_BREAK = 'pageBreak',\n CONTROL = 'control',\n CHECKBOX = 'checkbox',\n RADIO = 'radio',\n LATEX = 'latex',\n TAB = 'tab',\n DATE = 'date',\n BLOCK = 'block',\n TITLE = 'title',\n AREA = 'area',\n LIST = 'list',\n LABEL = 'label'\n}\n\nenum TitleLevel {\n FIRST = 'first',\n SECOND = 'second',\n THIRD = 'third',\n FOURTH = 'fourth',\n FIFTH = 'fifth',\n SIXTH = 'sixth'\n}\n\nconst titleOrderNumberMapping: Record<TitleLevel, number> = {\n [TitleLevel.FIRST]: 1,\n [TitleLevel.SECOND]: 2,\n [TitleLevel.THIRD]: 3,\n [TitleLevel.FOURTH]: 4,\n [TitleLevel.FIFTH]: 5,\n [TitleLevel.SIXTH]: 6\n}\n\nconst TEXTLIKE_ELEMENT_TYPE: ElementType[] = [\n ElementType.TEXT,\n ElementType.HYPERLINK,\n ElementType.SUBSCRIPT,\n ElementType.SUPERSCRIPT,\n ElementType.CONTROL,\n ElementType.DATE,\n ElementType.LABEL\n]\n\nconst ZERO = '\\u200B'\n\nfunction isTextLikeElement(element: IElement): boolean {\n return !element.type || TEXTLIKE_ELEMENT_TYPE.includes(element.type)\n}\n\nfunction getCatalog(payload: IGetCatalogPayload): ICatalog | null {\n const { elementList, positionList } = payload\n // Collect titles\n const titleElementList: ICatalogElement[] = []\n let t = 0\n while (t < elementList.length) {\n const element = elementList[t]\n const getElementInfo = (\n element: IElement,\n elementList: IElement[],\n position: number\n ) => {\n const titleId = element.titleId\n const level = element.level\n const titleElement: ICatalogElement = {\n type: ElementType.TITLE,\n value: '',\n level,\n titleId,\n pageNo: positionList[t].pageNo\n }\n const valueList: IElement[] = []\n while (position < elementList.length) {\n const titleE = elementList[position]\n if (titleId !== titleE.titleId) {\n position--\n break\n }\n valueList.push(titleE)\n position++\n }\n titleElement.value = valueList\n .filter(el => isTextLikeElement(el))\n .map(el => el.value)\n .join('')\n .replace(new RegExp(ZERO, 'g'), '')\n return { position, titleElement }\n }\n if (element.titleId) {\n const { position, titleElement } = getElementInfo(element, elementList, t)\n t = position\n titleElementList.push(titleElement)\n }\n if (element.type === ElementType.TABLE) {\n const trList = element.trList!\n for (let r = 0; r < trList.length; r++) {\n const tr = trList[r]\n for (let d = 0; d < tr.tdList.length; d++) {\n const td = tr.tdList[d]\n const value = td.value\n if (value.length > 1) {\n let index = 1\n while (index < value.length) {\n if (value[index]?.titleId) {\n const { titleElement, position } = getElementInfo(\n value[index],\n value,\n index\n )\n titleElementList.push(titleElement)\n index = position\n }\n index++\n }\n }\n }\n }\n }\n t++\n }\n if (!titleElementList.length) return null\n // Stop when finding a title higher than the latest element\n const recursiveInsert = (\n title: ICatalogElement,\n catalogItem: ICatalogItem\n ) => {\n const subCatalogItem =\n catalogItem.subCatalog[catalogItem.subCatalog.length - 1]\n const catalogItemLevel = titleOrderNumberMapping[subCatalogItem?.level]\n const titleLevel = titleOrderNumberMapping[title.level!]\n if (subCatalogItem && titleLevel > catalogItemLevel) {\n recursiveInsert(title, subCatalogItem)\n } else {\n catalogItem.subCatalog.push({\n id: title.titleId!,\n name: title.value,\n level: title.level!,\n pageNo: title.pageNo,\n subCatalog: []\n })\n }\n }\n // Iterate title groups\n // If the title is lower than the group's latest title: recurse and append\n // Otherwise append it directly to the catalog as a new group\n const catalog: ICatalog = []\n for (let e = 0; e < titleElementList.length; e++) {\n const title = titleElementList[e]\n const catalogItem = catalog[catalog.length - 1]\n const catalogItemLevel = titleOrderNumberMapping[catalogItem?.level]\n const titleLevel = titleOrderNumberMapping[title.level!]\n if (catalogItem && titleLevel > catalogItemLevel) {\n recursiveInsert(title, catalogItem)\n } else {\n catalog.push({\n id: title.titleId!,\n name: title.value,\n level: title.level!,\n pageNo: title.pageNo,\n subCatalog: []\n })\n }\n }\n return catalog\n}\n\nonmessage = evt => {\n const payload = <IGetCatalogPayload>evt.data\n const catalog = getCatalog(payload)\n postMessage(catalog)\n}\n"],"mappings":"YA2CA,IAAM,EAAsD,CACtC,MAAA,EACC,OAAA,EACD,MAAA,EACC,OAAA,EACD,MAAA,EACA,MAAA,CACtB,EAEM,EAAuC,sEAQ7C,EAIA,SAAS,EAAkB,EAA4B,CACrD,MAAO,CAAC,EAAQ,MAAQ,EAAsB,SAAS,EAAQ,IAAI,CACrE,CAEA,SAAS,EAAW,EAA8C,CAChE,GAAM,CAAE,cAAa,gBAAiB,EAEhC,EAAsC,CAAC,EACzC,EAAI,EACR,KAAO,EAAI,EAAY,QAAQ,CAC7B,IAAM,EAAU,EAAY,GACtB,GACJ,EACA,EACA,IACG,CACH,IAAM,EAAU,EAAQ,QAElB,EAAgC,CACpC,KAAA,QACA,MAAO,GACP,MAJY,EAAQ,MAKpB,UACA,OAAQ,EAAa,EAAE,CAAC,MAC1B,EACM,EAAwB,CAAC,EAC/B,KAAO,EAAW,EAAY,QAAQ,CACpC,IAAM,EAAS,EAAY,GAC3B,GAAI,IAAY,EAAO,QAAS,CAC9B,IACA,KACF,CACA,EAAU,KAAK,CAAM,EACrB,GACF,CAMA,MALA,GAAa,MAAQ,EAClB,OAAO,GAAM,EAAkB,CAAE,CAAC,CAAC,CACnC,IAAI,GAAM,EAAG,KAAK,CAAC,CACnB,KAAK,EAAE,CAAC,CACR,QAAQ,gBAAI,OAAO,IAAM,GAAG,EAAG,EAAE,EAC7B,CAAE,WAAU,cAAa,CAClC,EACA,GAAI,EAAQ,QAAS,CACnB,GAAM,CAAE,WAAU,gBAAiB,EAAe,EAAS,EAAa,CAAC,EACzE,EAAI,EACJ,EAAiB,KAAK,CAAY,CACpC,CACA,GAAI,EAAQ,OAAA,QAA4B,CACtC,IAAM,EAAS,EAAQ,OACvB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAK,EAAO,GAClB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,OAAO,OAAQ,IAAK,CAEzC,IAAM,EADK,EAAG,OAAO,EACP,CAAG,MACjB,GAAI,EAAM,OAAS,EAAG,CACpB,IAAI,EAAQ,EACZ,KAAO,EAAQ,EAAM,QAAQ,CAC3B,GAAI,EAAM,EAAM,EAAE,QAAS,CACzB,GAAM,CAAE,eAAc,YAAa,EACjC,EAAM,GACN,EACA,CACF,EACA,EAAiB,KAAK,CAAY,EAClC,EAAQ,CACV,CACA,GACF,CACF,CACF,CACF,CACF,CACA,GACF,CACA,GAAI,CAAC,EAAiB,OAAQ,OAAO,KAErC,IAAM,GACJ,EACA,IACG,CACH,IAAM,EACJ,EAAY,WAAW,EAAY,WAAW,OAAS,GACnD,EAAmB,EAAwB,GAAgB,OAC3D,EAAa,EAAwB,EAAM,OAC7C,GAAkB,EAAa,EACjC,EAAgB,EAAO,CAAc,EAErC,EAAY,WAAW,KAAK,CAC1B,GAAI,EAAM,QACV,KAAM,EAAM,MACZ,MAAO,EAAM,MACb,OAAQ,EAAM,OACd,WAAY,CAAC,CACf,CAAC,CAEL,EAIM,EAAoB,CAAC,EAC3B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAiB,OAAQ,IAAK,CAChD,IAAM,EAAQ,EAAiB,GACzB,EAAc,EAAQ,EAAQ,OAAS,GACvC,EAAmB,EAAwB,GAAa,OACxD,EAAa,EAAwB,EAAM,OAC7C,GAAe,EAAa,EAC9B,EAAgB,EAAO,CAAW,EAElC,EAAQ,KAAK,CACX,GAAI,EAAM,QACV,KAAM,EAAM,MACZ,MAAO,EAAM,MACb,OAAQ,EAAM,OACd,WAAY,CAAC,CACf,CAAC,CAEL,CACA,OAAO,CACT,CAEA,UAAY,GAAO,CACjB,IAAM,EAA8B,EAAI,KAClC,EAAU,EAAW,CAAO,EAClC,YAAY,CAAO,CACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group-BZtj1M7o.js","names":[],"sources":["../../src/editor/core/worker/works/group.ts"],"sourcesContent":["import { IElement } from '../../../interface/Element'\n\nenum ElementType {\n TABLE = 'table'\n}\n\nfunction getGroupIds(elementList: IElement[]): string[] {\n const groupIds: string[] = []\n for (const element of elementList) {\n if (element.type === ElementType.TABLE) {\n const trList = element.trList!\n for (let r = 0; r < trList.length; r++) {\n const tr = trList[r]\n for (let d = 0; d < tr.tdList.length; d++) {\n const td = tr.tdList[d]\n groupIds.push(...getGroupIds(td.value))\n }\n }\n }\n if (!element.groupIds) continue\n for (const groupId of element.groupIds) {\n if (!groupIds.includes(groupId)) {\n groupIds.push(groupId)\n }\n }\n }\n return groupIds\n}\n\nonmessage = evt => {\n const elementList = <IElement[]>evt.data\n const groupIds = getGroupIds(elementList)\n postMessage(groupIds)\n}\n"],"mappings":"YAMA,SAAS,EAAY,EAAmC,CACtD,IAAM,EAAqB,CAAC,EAC5B,IAAK,IAAM,KAAW,EAAa,CACjC,GAAI,EAAQ,OAAA,QAA4B,CACtC,IAAM,EAAS,EAAQ,OACvB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAK,EAAO,GAClB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAG,OAAO,OAAQ,IAAK,CACzC,IAAM,EAAK,EAAG,OAAO,GACrB,EAAS,KAAK,GAAG,EAAY,EAAG,KAAK,CAAC,CACxC,CACF,CACF,CACK,KAAQ,SACb,IAAK,IAAM,KAAW,EAAQ,SACvB,EAAS,SAAS,CAAO,GAC5B,EAAS,KAAK,CAAO,CAG3B,CACA,OAAO,CACT,CAEA,UAAY,GAAO,CACjB,IAAM,EAA0B,EAAI,KAC9B,EAAW,EAAY,CAAW,EACxC,YAAY,CAAQ,CACtB"}