@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.
- package/LICENSE +22 -0
- package/README.md +76 -2
- package/dist/assets/catalog-I5Jqg37f.js.map +1 -0
- package/dist/assets/group-BZtj1M7o.js.map +1 -0
- package/dist/assets/value-BUbTZYaX.js.map +1 -0
- package/dist/assets/wordCount-xSvDqE7d.js.map +1 -0
- package/dist/cado-editor.css +2 -0
- package/dist/cado-editor.js +23656 -0
- package/dist/cado-editor.js.map +1 -0
- package/dist/cado-editor.umd.cjs +92 -0
- package/dist/cado-editor.umd.cjs.map +1 -0
- package/dist/src/editor/core/accessibility/Accessibility.d.ts +14 -0
- package/dist/src/editor/core/actuator/Actuator.d.ts +7 -0
- package/dist/src/editor/core/actuator/handlers/positionContextChange.d.ts +3 -0
- package/dist/src/editor/core/bubblemenu/BubbleMenu.d.ts +29 -0
- package/dist/src/editor/core/bubblemenu/menus.d.ts +2 -0
- package/dist/src/editor/core/cascade/CascadeManager.d.ts +28 -0
- package/dist/src/editor/core/cascade/expression/evaluator.d.ts +14 -0
- package/dist/src/editor/core/cascade/expression/parser.d.ts +36 -0
- package/dist/src/editor/core/cascade/expression/tokenizer.d.ts +19 -0
- package/dist/src/editor/core/command/Command.d.ts +170 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +221 -0
- package/dist/src/editor/core/contextmenu/ContextMenu.d.ts +37 -0
- package/dist/src/editor/core/contextmenu/menus/controlMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/globalMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/hyperlinkMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/imageMenus.d.ts +2 -0
- package/dist/src/editor/core/contextmenu/menus/tableMenus.d.ts +2 -0
- package/dist/src/editor/core/cursor/Cursor.d.ts +46 -0
- package/dist/src/editor/core/cursor/CursorAgent.d.ts +16 -0
- package/dist/src/editor/core/cursor/LinePlaceholder.d.ts +20 -0
- package/dist/src/editor/core/draw/Draw.d.ts +368 -0
- package/dist/src/editor/core/draw/IncrementalRowComputer.d.ts +50 -0
- package/dist/src/editor/core/draw/column/ColumnManager.d.ts +15 -0
- package/dist/src/editor/core/draw/control/Control.d.ts +77 -0
- package/dist/src/editor/core/draw/control/checkbox/CheckboxControl.d.ts +16 -0
- package/dist/src/editor/core/draw/control/date/DateControl.d.ts +24 -0
- package/dist/src/editor/core/draw/control/interactive/ControlSearch.d.ts +20 -0
- package/dist/src/editor/core/draw/control/number/Calculator.d.ts +30 -0
- package/dist/src/editor/core/draw/control/number/NumberControl.d.ts +13 -0
- package/dist/src/editor/core/draw/control/radio/RadioControl.d.ts +5 -0
- package/dist/src/editor/core/draw/control/richtext/Border.d.ts +10 -0
- package/dist/src/editor/core/draw/control/select/SelectControl.d.ts +32 -0
- package/dist/src/editor/core/draw/control/text/TextControl.d.ts +18 -0
- package/dist/src/editor/core/draw/frame/Background.d.ts +11 -0
- package/dist/src/editor/core/draw/frame/Badge.d.ts +14 -0
- package/dist/src/editor/core/draw/frame/Footer.d.ts +30 -0
- package/dist/src/editor/core/draw/frame/Header.d.ts +30 -0
- package/dist/src/editor/core/draw/frame/LineNumber.d.ts +7 -0
- package/dist/src/editor/core/draw/frame/Margin.d.ts +11 -0
- package/dist/src/editor/core/draw/frame/PageBorder.d.ts +9 -0
- package/dist/src/editor/core/draw/frame/PageNumber.d.ts +9 -0
- package/dist/src/editor/core/draw/frame/Placeholder.d.ts +20 -0
- package/dist/src/editor/core/draw/frame/Watermark.d.ts +19 -0
- package/dist/src/editor/core/draw/graffiti/Graffiti.d.ts +19 -0
- package/dist/src/editor/core/draw/interactive/Area.d.ts +30 -0
- package/dist/src/editor/core/draw/interactive/Group.d.ts +18 -0
- package/dist/src/editor/core/draw/interactive/Magnifier.d.ts +19 -0
- package/dist/src/editor/core/draw/interactive/Search.d.ts +32 -0
- package/dist/src/editor/core/draw/interactive/Spellcheck.d.ts +20 -0
- package/dist/src/editor/core/draw/particle/CheckboxParticle.d.ts +18 -0
- package/dist/src/editor/core/draw/particle/HintParticle.d.ts +25 -0
- package/dist/src/editor/core/draw/particle/HyperlinkParticle.d.ts +19 -0
- package/dist/src/editor/core/draw/particle/ImageParticle.d.ts +23 -0
- package/dist/src/editor/core/draw/particle/LabelParticle.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/LineBreakParticle.d.ts +10 -0
- package/dist/src/editor/core/draw/particle/ListParticle.d.ts +30 -0
- package/dist/src/editor/core/draw/particle/PageBreakParticle.d.ts +9 -0
- package/dist/src/editor/core/draw/particle/RadioParticle.d.ts +18 -0
- package/dist/src/editor/core/draw/particle/SeparatorParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/SubscriptParticle.d.ts +5 -0
- package/dist/src/editor/core/draw/particle/SuperscriptParticle.d.ts +5 -0
- package/dist/src/editor/core/draw/particle/TextParticle.d.ts +29 -0
- package/dist/src/editor/core/draw/particle/TraceParticle.d.ts +43 -0
- package/dist/src/editor/core/draw/particle/WhiteSpaceParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/block/BlockParticle.d.ts +19 -0
- package/dist/src/editor/core/draw/particle/block/modules/BaseBlock.d.ts +41 -0
- package/dist/src/editor/core/draw/particle/block/modules/IFrameBlock.d.ts +13 -0
- package/dist/src/editor/core/draw/particle/block/modules/VideoBlock.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/date/DateParticle.d.ts +13 -0
- package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +108 -0
- package/dist/src/editor/core/draw/particle/latex/LaTexParticle.d.ts +7 -0
- package/dist/src/editor/core/draw/particle/latex/utils/LaTexUtils.d.ts +47 -0
- package/dist/src/editor/core/draw/particle/latex/utils/hershey.d.ts +10 -0
- package/dist/src/editor/core/draw/particle/latex/utils/symbols.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/previewer/Previewer.d.ts +56 -0
- package/dist/src/editor/core/draw/particle/previewer/resizer.d.ts +8 -0
- package/dist/src/editor/core/draw/particle/table/TableOperate.d.ts +35 -0
- package/dist/src/editor/core/draw/particle/table/TablePaging.d.ts +13 -0
- package/dist/src/editor/core/draw/particle/table/TableParticle.d.ts +41 -0
- package/dist/src/editor/core/draw/particle/table/TableTool.d.ts +42 -0
- package/dist/src/editor/core/draw/richtext/AbstractRichText.d.ts +11 -0
- package/dist/src/editor/core/draw/richtext/Highlight.d.ts +7 -0
- package/dist/src/editor/core/draw/richtext/Strikeout.d.ts +7 -0
- package/dist/src/editor/core/draw/richtext/Underline.d.ts +10 -0
- package/dist/src/editor/core/draw/ruler/Ruler.d.ts +43 -0
- package/dist/src/editor/core/event/CanvasEvent.d.ts +53 -0
- package/dist/src/editor/core/event/GlobalEvent.d.ts +28 -0
- package/dist/src/editor/core/event/eventbus/EventBus.d.ts +9 -0
- package/dist/src/editor/core/event/handlers/click.d.ts +11 -0
- package/dist/src/editor/core/event/handlers/composition.d.ts +8 -0
- package/dist/src/editor/core/event/handlers/copy.d.ts +3 -0
- package/dist/src/editor/core/event/handlers/cut.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/drag.d.ts +6 -0
- package/dist/src/editor/core/event/handlers/drop.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/input.d.ts +3 -0
- package/dist/src/editor/core/event/handlers/keydown/backspace.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/delete.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/end.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/enter.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/home.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/index.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/left.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/right.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/tab.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/keydown/updown.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mousedown.d.ts +7 -0
- package/dist/src/editor/core/event/handlers/mouseleave.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mousemove.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/mouseup.d.ts +2 -0
- package/dist/src/editor/core/event/handlers/paste.d.ts +8 -0
- package/dist/src/editor/core/history/HistoryManager.d.ts +16 -0
- package/dist/src/editor/core/i18n/I18n.d.ts +12 -0
- package/dist/src/editor/core/image/ImageUpload.d.ts +14 -0
- package/dist/src/editor/core/listener/ChangeEmitter.d.ts +16 -0
- package/dist/src/editor/core/listener/Listener.d.ts +15 -0
- package/dist/src/editor/core/macro/MacroManager.d.ts +25 -0
- package/dist/src/editor/core/observer/ImageObserver.d.ts +7 -0
- package/dist/src/editor/core/observer/MouseObserver.d.ts +13 -0
- package/dist/src/editor/core/observer/ScrollObserver.d.ts +20 -0
- package/dist/src/editor/core/observer/SelectionObserver.d.ts +23 -0
- package/dist/src/editor/core/override/Override.d.ts +9 -0
- package/dist/src/editor/core/plugin/Plugin.d.ts +7 -0
- package/dist/src/editor/core/position/Position.d.ts +56 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +48 -0
- package/dist/src/editor/core/register/Register.d.ts +30 -0
- package/dist/src/editor/core/shortcut/Shortcut.d.ts +16 -0
- package/dist/src/editor/core/shortcut/keys/listKeys.d.ts +2 -0
- package/dist/src/editor/core/shortcut/keys/richtextKeys.d.ts +2 -0
- package/dist/src/editor/core/shortcut/keys/titleKeys.d.ts +2 -0
- package/dist/src/editor/core/slashmenu/SlashMenu.d.ts +35 -0
- package/dist/src/editor/core/slashmenu/menus.d.ts +2 -0
- package/dist/src/editor/core/theme/ThemeColors.d.ts +18 -0
- package/dist/src/editor/core/ui/UiManager.d.ts +27 -0
- package/dist/src/editor/core/validate/Validate.d.ts +19 -0
- package/dist/src/editor/core/watermark/WatermarkEditor.d.ts +50 -0
- package/dist/src/editor/core/worker/WorkerManager.d.ts +17 -0
- package/dist/src/editor/core/worker/works/catalog.d.ts +1 -0
- package/dist/src/editor/core/worker/works/group.d.ts +1 -0
- package/dist/src/editor/core/worker/works/value.d.ts +1 -0
- package/dist/src/editor/core/worker/works/wordCount.d.ts +1 -0
- package/dist/src/editor/core/zone/Zone.d.ts +22 -0
- package/dist/src/editor/core/zone/ZoneTip.d.ts +19 -0
- package/dist/src/editor/dataset/constant/Accessibility.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Background.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Badge.d.ts +2 -0
- package/dist/src/editor/dataset/constant/BubbleMenu.d.ts +10 -0
- package/dist/src/editor/dataset/constant/Checkbox.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Column.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Common.d.ts +22 -0
- package/dist/src/editor/dataset/constant/ContextMenu.d.ts +62 -0
- package/dist/src/editor/dataset/constant/Control.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Cursor.d.ts +3 -0
- package/dist/src/editor/dataset/constant/Editor.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Element.d.ts +24 -0
- package/dist/src/editor/dataset/constant/Footer.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Graffiti.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Group.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Header.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Hint.d.ts +2 -0
- package/dist/src/editor/dataset/constant/ImgCaption.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Label.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Layout.d.ts +2 -0
- package/dist/src/editor/dataset/constant/LineBreak.d.ts +2 -0
- package/dist/src/editor/dataset/constant/LineNumber.d.ts +2 -0
- package/dist/src/editor/dataset/constant/LinePlaceholder.d.ts +2 -0
- package/dist/src/editor/dataset/constant/List.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Magnifier.d.ts +2 -0
- package/dist/src/editor/dataset/constant/PageBorder.d.ts +2 -0
- package/dist/src/editor/dataset/constant/PageBreak.d.ts +2 -0
- package/dist/src/editor/dataset/constant/PageNumber.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Paper.d.ts +5 -0
- package/dist/src/editor/dataset/constant/Placeholder.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Radio.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Regular.d.ts +10 -0
- package/dist/src/editor/dataset/constant/Ruler.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Separator.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Shortcut.d.ts +3 -0
- package/dist/src/editor/dataset/constant/SlashMenu.d.ts +14 -0
- package/dist/src/editor/dataset/constant/Spellcheck.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Table.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Title.d.ts +6 -0
- package/dist/src/editor/dataset/constant/Trace.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Watermark.d.ts +2 -0
- package/dist/src/editor/dataset/constant/WhiteSpace.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Zone.d.ts +2 -0
- package/dist/src/editor/dataset/enum/Area.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Background.d.ts +10 -0
- package/dist/src/editor/dataset/enum/Block.d.ts +4 -0
- package/dist/src/editor/dataset/enum/Common.d.ts +30 -0
- package/dist/src/editor/dataset/enum/Control.d.ts +32 -0
- package/dist/src/editor/dataset/enum/DatePicker.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +49 -0
- package/dist/src/editor/dataset/enum/Element.d.ts +21 -0
- package/dist/src/editor/dataset/enum/ElementStyle.d.ts +12 -0
- package/dist/src/editor/dataset/enum/Event.d.ts +5 -0
- package/dist/src/editor/dataset/enum/KeyMap.d.ts +86 -0
- package/dist/src/editor/dataset/enum/LineNumber.d.ts +4 -0
- package/dist/src/editor/dataset/enum/List.d.ts +20 -0
- package/dist/src/editor/dataset/enum/Macro.d.ts +4 -0
- package/dist/src/editor/dataset/enum/Observer.d.ts +6 -0
- package/dist/src/editor/dataset/enum/Row.d.ts +7 -0
- package/dist/src/editor/dataset/enum/Text.d.ts +12 -0
- package/dist/src/editor/dataset/enum/Title.d.ts +8 -0
- package/dist/src/editor/dataset/enum/Trace.d.ts +4 -0
- package/dist/src/editor/dataset/enum/VerticalAlign.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Watermark.d.ts +8 -0
- package/dist/src/editor/dataset/enum/table/Table.d.ts +17 -0
- package/dist/src/editor/dataset/enum/table/TableTool.d.ts +4 -0
- package/dist/src/editor/index.d.ts +87 -0
- package/dist/src/editor/interface/Accessibility.d.ts +3 -0
- package/dist/src/editor/interface/Area.d.ts +64 -0
- package/dist/src/editor/interface/Background.d.ts +8 -0
- package/dist/src/editor/interface/Badge.d.ts +15 -0
- package/dist/src/editor/interface/Block.d.ts +23 -0
- package/dist/src/editor/interface/Catalog.d.ts +9 -0
- package/dist/src/editor/interface/Checkbox.d.ts +18 -0
- package/dist/src/editor/interface/Column.d.ts +14 -0
- package/dist/src/editor/interface/Command.d.ts +3 -0
- package/dist/src/editor/interface/Common.d.ts +14 -0
- package/dist/src/editor/interface/Compare.d.ts +5 -0
- package/dist/src/editor/interface/Control.d.ts +249 -0
- package/dist/src/editor/interface/Cursor.d.ts +7 -0
- package/dist/src/editor/interface/Draw.d.ts +96 -0
- package/dist/src/editor/interface/Editor.d.ts +185 -0
- package/dist/src/editor/interface/Element.d.ts +247 -0
- package/dist/src/editor/interface/Event.d.ts +22 -0
- package/dist/src/editor/interface/EventBus.d.ts +61 -0
- package/dist/src/editor/interface/Footer.d.ts +9 -0
- package/dist/src/editor/interface/Graffiti.d.ts +13 -0
- package/dist/src/editor/interface/Group.d.ts +8 -0
- package/dist/src/editor/interface/Header.d.ts +9 -0
- package/dist/src/editor/interface/Hint.d.ts +7 -0
- package/dist/src/editor/interface/Image.d.ts +7 -0
- package/dist/src/editor/interface/Label.d.ts +7 -0
- package/dist/src/editor/interface/LineBreak.d.ts +5 -0
- package/dist/src/editor/interface/LineNumber.d.ts +9 -0
- package/dist/src/editor/interface/Listener.d.ts +81 -0
- package/dist/src/editor/interface/Macro.d.ts +19 -0
- package/dist/src/editor/interface/Magnifier.d.ts +6 -0
- package/dist/src/editor/interface/Margin.d.ts +1 -0
- package/dist/src/editor/interface/PageBorder.d.ts +7 -0
- package/dist/src/editor/interface/PageBreak.d.ts +5 -0
- package/dist/src/editor/interface/PageNumber.d.ts +15 -0
- package/dist/src/editor/interface/Placeholder.d.ts +7 -0
- package/dist/src/editor/interface/Plugin.d.ts +3 -0
- package/dist/src/editor/interface/Position.d.ts +117 -0
- package/dist/src/editor/interface/Previewer.d.ts +13 -0
- package/dist/src/editor/interface/Print.d.ts +10 -0
- package/dist/src/editor/interface/Radio.d.ts +15 -0
- package/dist/src/editor/interface/Range.d.ts +54 -0
- package/dist/src/editor/interface/Row.d.ts +49 -0
- package/dist/src/editor/interface/Ruler.d.ts +4 -0
- package/dist/src/editor/interface/Search.d.ts +30 -0
- package/dist/src/editor/interface/Separator.d.ts +4 -0
- package/dist/src/editor/interface/Spellcheck.d.ts +27 -0
- package/dist/src/editor/interface/Text.d.ts +13 -0
- package/dist/src/editor/interface/Title.d.ts +26 -0
- package/dist/src/editor/interface/Trace.d.ts +11 -0
- package/dist/src/editor/interface/Watermark.d.ts +20 -0
- package/dist/src/editor/interface/WhiteSpace.d.ts +5 -0
- package/dist/src/editor/interface/Zone.d.ts +3 -0
- package/dist/src/editor/interface/bubblemenu/BubbleMenu.d.ts +36 -0
- package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +73 -0
- package/dist/src/editor/interface/i18n/Accessibility.d.ts +4 -0
- package/dist/src/editor/interface/i18n/I18n.d.ts +26 -0
- package/dist/src/editor/interface/i18n/Trace.d.ts +7 -0
- package/dist/src/editor/interface/i18n/Validate.d.ts +15 -0
- package/dist/src/editor/interface/lineplaceholder/LinePlaceholder.d.ts +9 -0
- package/dist/src/editor/interface/shortcut/Shortcut.d.ts +13 -0
- package/dist/src/editor/interface/slashmenu/SlashMenu.d.ts +41 -0
- package/dist/src/editor/interface/table/Colgroup.d.ts +4 -0
- package/dist/src/editor/interface/table/Table.d.ts +8 -0
- package/dist/src/editor/interface/table/Td.d.ts +36 -0
- package/dist/src/editor/interface/table/Tr.d.ts +10 -0
- package/dist/src/editor/interface/ui/BubbleMenu.d.ts +20 -0
- package/dist/src/editor/interface/ui/Calculator.d.ts +23 -0
- package/dist/src/editor/interface/ui/ContextMenu.d.ts +24 -0
- package/dist/src/editor/interface/ui/DatePicker.d.ts +40 -0
- package/dist/src/editor/interface/ui/HintPopup.d.ts +8 -0
- package/dist/src/editor/interface/ui/HyperlinkPopup.d.ts +11 -0
- package/dist/src/editor/interface/ui/ImagePreviewer.d.ts +31 -0
- package/dist/src/editor/interface/ui/LinePlaceholder.d.ts +8 -0
- package/dist/src/editor/interface/ui/SelectControl.d.ts +18 -0
- package/dist/src/editor/interface/ui/SlashMenu.d.ts +28 -0
- package/dist/src/editor/interface/ui/TracePopup.d.ts +18 -0
- package/dist/src/editor/interface/ui/Ui.d.ts +121 -0
- package/dist/src/editor/interface/ui/WatermarkEditor.d.ts +36 -0
- package/dist/src/editor/interface/ui/ZoneTip.d.ts +10 -0
- package/dist/src/editor/lib.d.ts +3 -0
- package/dist/src/editor/utils/clipboard.d.ts +13 -0
- package/dist/src/editor/utils/diff.d.ts +7 -0
- package/dist/src/editor/utils/element.d.ts +82 -0
- package/dist/src/editor/utils/hotkey.d.ts +1 -0
- package/dist/src/editor/utils/index.d.ts +35 -0
- package/dist/src/editor/utils/option.d.ts +4 -0
- package/dist/src/editor/utils/paragraph.d.ts +8 -0
- package/dist/src/editor/utils/print.d.ts +13 -0
- package/dist/src/editor/utils/shortcut.d.ts +1 -0
- package/dist/src/editor/utils/table.d.ts +4 -0
- package/dist/src/editor/utils/textLayer.d.ts +17 -0
- package/dist/src/editor/utils/ua.d.ts +4 -0
- package/dist/src/editor/utils/unit.d.ts +3 -0
- 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
|
-
#
|
|
1
|
+
# Cado Editor
|
|
2
2
|
|
|
3
|
-
|
|
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"}
|