@unicom-cloud/ui 0.8.109 → 0.8.110
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/Affix.js +2 -2
- package/Alert.js +1 -1
- package/AutoComplete.js +1 -1
- package/BackTop.js +2 -2
- package/Badge.js +1 -1
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +1 -1
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/ColorPicker.js +1 -1
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Copy.js +6 -4
- package/Countdown.js +42 -8
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Details.js +42 -6
- package/Development.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Flex.js +43 -7
- package/Form.js +21 -16
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +2 -2
- package/LiquidFill.js +12 -10
- package/List.js +1 -1
- package/Loading.js +42 -6
- package/Marquee.js +12 -10
- package/Mentions.js +1 -1
- package/Menu.js +1 -1
- package/Message.js +3 -3
- package/Modal.js +1 -1
- package/Notice.js +41 -5
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +2 -2
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/QrCode.js +12 -10
- package/Radio.js +1 -1
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/RichText.js +76 -0
- package/Segmented.js +42 -7
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +43 -7
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +2 -2
- package/Tooltip.js +1 -1
- package/Tour.js +13 -11
- package/Transfer.js +1 -1
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/affix/index.js +2 -2
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +2 -2
- package/anchor/Link.js +1 -1
- package/app/App.js +2 -2
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +2 -2
- package/badge/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +3 -3
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +2 -2
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +3 -3
- package/cascader/index.js +1 -1
- package/cascader/util.js +1 -1
- package/checkbox/Checkbox.js +2 -2
- package/checkbox/Group.js +2 -2
- package/checkbox/GroupBlock.js +2 -2
- package/checkbox/index.js +2 -2
- package/chunk/BDMqvmVH.js +4239 -0
- package/chunk/BDgzrqDN.js +154 -0
- package/chunk/BG6j6Ct7.js +30 -0
- package/chunk/BGJspFG9.js +56 -0
- package/chunk/BO_5qdS_.js +13 -0
- package/chunk/{DblEjsQ8.js → BUNoUPLs.js} +1 -1
- package/chunk/B_c0gPsX.js +83 -0
- package/chunk/BcEZk8pT.js +837 -0
- package/chunk/{DGSfSsAY.js → BeHcDey_.js} +1 -1
- package/chunk/{Bm3gJPkz.js → BnUWOu3_.js} +5 -5
- package/chunk/Bvxzb1wd.js +16 -0
- package/chunk/{DryCfcSV.js → CFyN9Eio.js} +4 -4
- package/chunk/CN7NKv_2.js +11 -0
- package/chunk/COc48wzV.js +64 -0
- package/chunk/{BDKb_-wj.js → COsRZOz1.js} +4 -4
- package/chunk/CT7ury1Z.js +13 -0
- package/chunk/Ca6eMq_Y.js +8 -0
- package/chunk/{p9jiLDTk.js → CgN4U7Ou.js} +2 -2
- package/chunk/{Bg3uJGPu.js → CsqGBZv1.js} +1 -1
- package/chunk/CylJZkp8.js +6 -0
- package/chunk/{9WWq1a0I.js → DSqW_efI.js} +1 -1
- package/chunk/{Bz3KT4sO.js → Dbw0YUY1.js} +81 -47
- package/chunk/Dh-zFF65.js +15 -0
- package/chunk/Di5KBCVQ.js +4 -0
- package/chunk/{DjPTURUf.js → Lyh0cz3R.js} +3 -3
- package/chunk/{DgWzb7M5.js → Y_GQsZUt.js} +1 -1
- package/chunk/{BfBHo0RR.js → n1tirBXA.js} +7 -7
- package/chunk/{DYc9a7tm.js → qsVvkBLU.js} +1 -1
- package/chunk/zFFM4RBT.js +2100 -0
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +1 -1
- package/color-picker/InputRgb.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +2 -2
- package/color-picker/index.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +1 -1
- package/config-provider/context.js +1 -1
- package/config-provider/index.js +2 -2
- package/copy/index.js +10 -8
- package/countdown/index.js +67 -33
- package/date-picker/Picker.js +1 -1
- package/date-picker/RangePicker.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/details/index.js +74 -38
- package/development/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +1 -1
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +63 -29
- package/form/Form.js +3 -3
- package/form/FormItem.js +1 -1
- package/form/index.js +85 -77
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/hooks/index.js +128 -133
- package/hooks/useCreation.js +4 -0
- package/hooks/useId.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useMedia.js +1 -1
- package/hooks/usePersistCallback.js +1 -1
- package/hooks/useRefs.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useWatch.js +1 -1
- package/hooks/useWindowSize.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/icons/file.js +1 -1
- package/image/Image.js +3 -3
- package/image/ImagePreview.js +44 -9
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +718 -717
- package/input/Button.js +1 -1
- package/input/Group.js +1 -1
- package/input/Input.js +3 -3
- package/input/InputElement.js +2 -2
- package/input/Password.js +2 -2
- package/input/Search.js +1 -1
- package/input/Textarea.js +2 -2
- package/input-number/index.js +1 -1
- package/input-number/useSelectionRange.js +1 -1
- package/input-tag/InputTag.js +1 -1
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +2 -2
- package/liquid-fill/index.js +17 -15
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +1 -1
- package/loading/index.js +54 -18
- package/marquee/index.js +19 -17
- package/marquee-/index.js +17 -15
- package/mentions/index.js +1 -1
- package/menu/Menu.js +4 -4
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +3 -3
- package/message/useMessage.js +4 -3
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +2 -2
- package/notice/index.js +41 -5
- package/notification/index.js +1 -1
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +120 -81
- package/pagination/PageItem.js +2 -2
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +1 -1
- package/pagination/Pagination.js +1 -1
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/CircleProgress.js +2 -2
- package/progress/index.js +1 -1
- package/qr-code/index.js +15 -13
- package/radio/Group.js +2 -2
- package/radio/GroupBlock.js +2 -2
- package/radio/Radio.js +2 -2
- package/radio/index.js +2 -2
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +2 -2
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/rich-text/constant.js +5 -0
- package/rich-text/core.js +11 -0
- package/rich-text/eventemitter/index.d.ts +135 -0
- package/rich-text/index.js +182 -0
- package/rich-text/interface.js +1 -0
- package/rich-text/rich.js +1877 -0
- package/row-col/Col-.js +1 -1
- package/row-col/Col.js +1 -1
- package/row-col/Row.js +1 -1
- package/segmented/index.js +145 -110
- package/select/Option.js +1 -1
- package/select/Select.js +235 -227
- package/select-view/Core.js +2 -2
- package/skeleton/index.js +1 -1
- package/slider/Button.js +2 -2
- package/slider/index.js +1 -1
- package/space/index.js +51 -15
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/splitter/Panel.js +1 -1
- package/splitter/SplitBar.js +2 -2
- package/splitter/Splitter.js +2 -2
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style.css +1 -1
- package/switch/index.js +1 -1
- package/table/Table.js +3 -3
- package/table/index.js +41 -39
- package/tabs/Tab.js +3 -3
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +2 -2
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +1 -1
- package/tour/index.js +20 -18
- package/transfer/Item.js +3 -3
- package/transfer/List.js +3 -3
- package/transfer/index.js +1 -1
- package/tree/Animation.js +2 -2
- package/tree/Node.js +3 -3
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +2 -2
- package/tree/index.js +1 -1
- package/tree-select/Select.js +4 -4
- package/tree-select/index.js +1 -1
- package/trigger/index.js +1 -1
- package/types/common/hooks/src/index.d.ts +1 -5
- package/types/common/hooks/src/use-url-state/index.d.ts +1 -1
- package/types/common/hooks/useId.d.ts +1 -1
- package/types/common/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
- package/types/common/hooks/useKeyboardEvent.d.ts +1 -1
- package/types/common/hooks/{useListenResize.d.ts → useListenWindowResize.d.ts} +4 -6
- package/types/common/hooks/useWatch.d.ts +1 -1
- package/types/common/hooks/useWindowSize.d.ts +2 -2
- package/types/common/utils/index.d.ts +47 -0
- package/types/common/utils/keyboardCode.d.ts +4 -0
- package/types/common/utils/math.d.ts +1 -0
- package/types/common/utils/mitt.d.ts +1 -0
- package/types/common/utils/pinyin.d.ts +1 -0
- package/types/common/utils/reactTransitionGroup.d.ts +1 -0
- package/types/common/utils/uuid.d.ts +1 -0
- package/types/common/utils/validate.d.ts +1 -0
- package/types/pc/config-provider/interface.d.ts +2 -0
- package/types/pc/date-picker/RangePicker.d.ts +1 -1
- package/types/pc/form/index.d.ts +6 -1
- package/types/pc/hooks/index.d.ts +2 -2
- package/types/pc/hooks/useCreation.d.ts +1 -0
- package/types/pc/hooks/useListenWindowResize.d.ts +1 -0
- package/types/pc/index.d.ts +2 -0
- package/types/pc/message/index.d.ts +1 -0
- package/types/pc/message/interface.d.ts +2 -2
- package/types/pc/page-header/interface.d.ts +3 -0
- package/types/pc/rich-text/blots/block.d.ts +34 -0
- package/types/pc/rich-text/blots/break.d.ts +8 -0
- package/types/pc/rich-text/blots/container.d.ts +4 -0
- package/types/pc/rich-text/blots/cursor.d.ts +26 -0
- package/types/pc/rich-text/blots/embed.d.ts +18 -0
- package/types/pc/rich-text/blots/inline.d.ts +12 -0
- package/types/pc/rich-text/blots/scroll.d.ts +49 -0
- package/types/pc/rich-text/blots/text.d.ts +5 -0
- package/types/pc/rich-text/constant.d.ts +1 -0
- package/types/pc/rich-text/core/composition.d.ts +12 -0
- package/types/pc/rich-text/core/editor.d.ts +28 -0
- package/types/pc/rich-text/core/emitter.d.ts +37 -0
- package/types/pc/rich-text/core/instances.d.ts +3 -0
- package/types/pc/rich-text/core/logger.d.ts +7 -0
- package/types/pc/rich-text/core/module.d.ts +8 -0
- package/types/pc/rich-text/core/rich.d.ts +217 -0
- package/types/pc/rich-text/core/selection.d.ts +74 -0
- package/types/pc/rich-text/core/theme.d.ts +32 -0
- package/types/pc/rich-text/core/utils/createRegistryWithFormats.d.ts +5 -0
- package/types/pc/rich-text/core/utils/scrollRectIntoView.d.ts +11 -0
- package/types/pc/rich-text/core.d.ts +7 -0
- package/types/pc/rich-text/delta/AttributeMap.d.ts +10 -0
- package/types/pc/rich-text/delta/Op.d.ts +11 -0
- package/types/pc/rich-text/delta/OpIterator.d.ts +13 -0
- package/types/pc/rich-text/delta/index.d.ts +45 -0
- package/types/pc/rich-text/eventemitter/index.d.ts +101 -0
- package/types/pc/rich-text/formats/align.d.ts +5 -0
- package/types/pc/rich-text/formats/background.d.ts +5 -0
- package/types/pc/rich-text/formats/blockquote.d.ts +6 -0
- package/types/pc/rich-text/formats/bold.d.ts +11 -0
- package/types/pc/rich-text/formats/code.d.ts +15 -0
- package/types/pc/rich-text/formats/color.d.ts +7 -0
- package/types/pc/rich-text/formats/direction.d.ts +5 -0
- package/types/pc/rich-text/formats/font.d.ts +7 -0
- package/types/pc/rich-text/formats/formula.d.ts +10 -0
- package/types/pc/rich-text/formats/header.d.ts +7 -0
- package/types/pc/rich-text/formats/image.d.ts +13 -0
- package/types/pc/rich-text/formats/indent.d.ts +8 -0
- package/types/pc/rich-text/formats/italic.d.ts +6 -0
- package/types/pc/rich-text/formats/link.d.ts +13 -0
- package/types/pc/rich-text/formats/list.d.ts +13 -0
- package/types/pc/rich-text/formats/script.d.ts +8 -0
- package/types/pc/rich-text/formats/size.d.ts +4 -0
- package/types/pc/rich-text/formats/strike.d.ts +6 -0
- package/types/pc/rich-text/formats/table.d.ts +45 -0
- package/types/pc/rich-text/formats/underline.d.ts +6 -0
- package/types/pc/rich-text/formats/video.d.ts +14 -0
- package/types/pc/rich-text/index.d.ts +6 -0
- package/types/pc/rich-text/interface.d.ts +17 -0
- package/types/pc/rich-text/modules/clipboard.d.ts +43 -0
- package/types/pc/rich-text/modules/history.d.ts +36 -0
- package/types/pc/rich-text/modules/input.d.ts +10 -0
- package/types/pc/rich-text/modules/keyboard.d.ts +58 -0
- package/types/pc/rich-text/modules/normalizeExternalHTML/index.d.ts +2 -0
- package/types/pc/rich-text/modules/normalizeExternalHTML/normalizers/googleDocs.d.ts +1 -0
- package/types/pc/rich-text/modules/normalizeExternalHTML/normalizers/msWord.d.ts +1 -0
- package/types/pc/rich-text/modules/syntax.d.ts +50 -0
- package/types/pc/rich-text/modules/table.d.ts +20 -0
- package/types/pc/rich-text/modules/tableEmbed.d.ts +27 -0
- package/types/pc/rich-text/modules/toolbar.d.ts +24 -0
- package/types/pc/rich-text/modules/uiNode.d.ts +19 -0
- package/types/pc/rich-text/modules/uploader.d.ts +15 -0
- package/types/pc/rich-text/parchment/attributor/attributor.d.ts +17 -0
- package/types/pc/rich-text/parchment/attributor/class.d.ts +8 -0
- package/types/pc/rich-text/parchment/attributor/store.d.ts +15 -0
- package/types/pc/rich-text/parchment/attributor/style.d.ts +8 -0
- package/types/pc/rich-text/parchment/blot/abstract/blot.d.ts +115 -0
- package/types/pc/rich-text/parchment/blot/abstract/container.d.ts +18 -0
- package/types/pc/rich-text/parchment/blot/abstract/leaf.d.ts +29 -0
- package/types/pc/rich-text/parchment/blot/abstract/parent.d.ts +50 -0
- package/types/pc/rich-text/parchment/blot/abstract/shadow.d.ts +37 -0
- package/types/pc/rich-text/parchment/blot/block.d.ts +25 -0
- package/types/pc/rich-text/parchment/blot/embed.d.ts +11 -0
- package/types/pc/rich-text/parchment/blot/inline.d.ts +28 -0
- package/types/pc/rich-text/parchment/blot/scroll.d.ts +34 -0
- package/types/pc/rich-text/parchment/blot/text.d.ts +26 -0
- package/types/pc/rich-text/parchment/collection/linked-list.d.ts +21 -0
- package/types/pc/rich-text/parchment/collection/linked-node.d.ts +6 -0
- package/types/pc/rich-text/parchment/error.d.ts +6 -0
- package/types/pc/rich-text/parchment/index.d.ts +21 -0
- package/types/pc/rich-text/parchment/registry.d.ts +21 -0
- package/types/pc/rich-text/parchment/scope.d.ts +14 -0
- package/types/pc/rich-text/rich.d.ts +5 -0
- package/types/pc/rich-text/themes/base.d.ts +35 -0
- package/types/pc/rich-text/themes/bubble.d.ts +18 -0
- package/types/pc/rich-text/themes/snow.d.ts +9 -0
- package/types/pc/rich-text/ui/color-picker.d.ts +7 -0
- package/types/pc/rich-text/ui/icon-picker.d.ts +7 -0
- package/types/pc/rich-text/ui/icons.d.ts +51 -0
- package/types/pc/rich-text/ui/picker.d.ts +16 -0
- package/types/pc/rich-text/ui/tooltip.d.ts +12 -0
- package/types/pc/select/interface.d.ts +4 -0
- package/types/pc/utils/index.d.ts +2 -0
- package/types/pc/utils/mitt.d.ts +1 -0
- package/types/pc/utils/names.d.ts +107 -91
- package/types/pc/utils/pinyin.d.ts +1 -0
- package/types/pc/version/index.d.ts +1 -1
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +5 -3
- package/typography/Operations.js +6 -4
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/useEllipsis.js +1 -1
- package/upload/TriggerNode.js +2 -2
- package/upload/Upload.js +2 -2
- package/utils/contextHolder.js +1 -1
- package/utils/index.js +167 -163
- package/utils/mitt.js +5 -0
- package/utils/names.js +12 -2
- package/utils/pinyin.js +5 -0
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +2 -2
- package/watermark/Watermark.js +1 -1
- package/chunk/5_U1CBIu.js +0 -8
- package/chunk/B9YvSTvI.js +0 -2321
- package/chunk/BLOlsa0k.js +0 -11
- package/chunk/BTLlOOe9.js +0 -189
- package/chunk/C6Aw3qIJ.js +0 -16
- package/chunk/CMl7m9nA.js +0 -6
- package/chunk/COqvRD0G.js +0 -11
- package/chunk/DXlwLh0Y.js +0 -806
- package/chunk/DlSv5Vu0.js +0 -16
- package/chunk/DmDh7NRL.js +0 -14
- package/chunk/Duezix3m.js +0 -25
- package/chunk/siEVY1s5.js +0 -33
- package/hooks/useCreate.js +0 -4
- package/types/common/hooks/src/use-dynamic-list/index.d.ts +0 -18
- package/types/common/hooks/src/use-event-emitter/index.d.ts +0 -11
- package/types/common/hooks/src/use-map/index.d.ts +0 -8
- package/types/common/hooks/src/use-set/index.d.ts +0 -6
- package/types/common/hooks/useCreate.d.ts +0 -2
- package/types/pc/hooks/useCreate.d.ts +0 -1
- package/types/pc/hooks/useListenResize.d.ts +0 -1
- /package/hooks/{useListenResize.js → useListenWindowResize.js} +0 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import type Block from '../blots/block.js';
|
|
2
|
+
import type { BlockEmbed } from '../blots/block.js';
|
|
3
|
+
import type Scroll from '../blots/scroll.js';
|
|
4
|
+
import type { Op } from '../delta/index.js';
|
|
5
|
+
import Delta from '../delta/index.js';
|
|
6
|
+
import type Clipboard from '../modules/clipboard.js';
|
|
7
|
+
import type History from '../modules/history.js';
|
|
8
|
+
import type Keyboard from '../modules/keyboard.js';
|
|
9
|
+
import type Uploader from '../modules/uploader.js';
|
|
10
|
+
import * as Parchment from '../parchment/index.js';
|
|
11
|
+
import Composition from './composition.js';
|
|
12
|
+
import Editor from './editor.js';
|
|
13
|
+
import type { EmitterSource } from './emitter.js';
|
|
14
|
+
import Emitter from './emitter.js';
|
|
15
|
+
import type { DebugLevel } from './logger.js';
|
|
16
|
+
import Module from './module.js';
|
|
17
|
+
import type { Bounds } from './selection.js';
|
|
18
|
+
import Selection, { Range } from './selection.js';
|
|
19
|
+
import type { ThemeConstructor } from './theme.js';
|
|
20
|
+
import Theme from './theme.js';
|
|
21
|
+
import type { Rect, ScrollRectIntoViewOptions } from './utils/scrollRectIntoView.js';
|
|
22
|
+
declare const globalRegistry: Parchment.Registry;
|
|
23
|
+
/**
|
|
24
|
+
* Options for initializing a Rich instance
|
|
25
|
+
*/
|
|
26
|
+
export interface RichOptions {
|
|
27
|
+
theme?: string;
|
|
28
|
+
debug?: DebugLevel | boolean;
|
|
29
|
+
registry?: Parchment.Registry;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to disable the editing
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
readOnly?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Placeholder text to display when the editor is empty
|
|
37
|
+
* @default ""
|
|
38
|
+
*/
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
bounds?: HTMLElement | string | null;
|
|
41
|
+
modules?: Record<string, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* A list of formats that are recognized and can exist within the editor contents.
|
|
44
|
+
* `null` means all formats are allowed.
|
|
45
|
+
* @default null
|
|
46
|
+
*/
|
|
47
|
+
formats?: string[] | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Similar to RichOptions, but with all properties expanded to their default values,
|
|
51
|
+
* and all selectors resolved to HTMLElements.
|
|
52
|
+
*/
|
|
53
|
+
export interface ExpandedRichOptions extends Omit<RichOptions, 'theme' | 'formats'> {
|
|
54
|
+
theme: ThemeConstructor;
|
|
55
|
+
registry: Parchment.Registry;
|
|
56
|
+
container: HTMLElement;
|
|
57
|
+
modules: Record<string, unknown>;
|
|
58
|
+
bounds?: HTMLElement | null;
|
|
59
|
+
readOnly: boolean;
|
|
60
|
+
}
|
|
61
|
+
declare class Rich {
|
|
62
|
+
static DEFAULTS: {
|
|
63
|
+
bounds: null;
|
|
64
|
+
modules: {
|
|
65
|
+
clipboard: boolean;
|
|
66
|
+
keyboard: boolean;
|
|
67
|
+
history: boolean;
|
|
68
|
+
uploader: boolean;
|
|
69
|
+
};
|
|
70
|
+
placeholder: string;
|
|
71
|
+
readOnly: false;
|
|
72
|
+
registry: Parchment.Registry;
|
|
73
|
+
theme: string;
|
|
74
|
+
};
|
|
75
|
+
static events: {
|
|
76
|
+
readonly EDITOR_CHANGE: "editor-change";
|
|
77
|
+
readonly SCROLL_BEFORE_UPDATE: "scroll-before-update";
|
|
78
|
+
readonly SCROLL_BLOT_MOUNT: "scroll-blot-mount";
|
|
79
|
+
readonly SCROLL_BLOT_UNMOUNT: "scroll-blot-unmount";
|
|
80
|
+
readonly SCROLL_OPTIMIZE: "scroll-optimize";
|
|
81
|
+
readonly SCROLL_UPDATE: "scroll-update";
|
|
82
|
+
readonly SCROLL_EMBED_UPDATE: "scroll-embed-update";
|
|
83
|
+
readonly SELECTION_CHANGE: "selection-change";
|
|
84
|
+
readonly TEXT_CHANGE: "text-change";
|
|
85
|
+
readonly COMPOSITION_BEFORE_START: "composition-before-start";
|
|
86
|
+
readonly COMPOSITION_START: "composition-start";
|
|
87
|
+
readonly COMPOSITION_BEFORE_END: "composition-before-end";
|
|
88
|
+
readonly COMPOSITION_END: "composition-end";
|
|
89
|
+
};
|
|
90
|
+
static sources: {
|
|
91
|
+
readonly API: "api";
|
|
92
|
+
readonly SILENT: "silent";
|
|
93
|
+
readonly USER: "user";
|
|
94
|
+
};
|
|
95
|
+
static imports: Record<string, unknown>;
|
|
96
|
+
static debug(limit: DebugLevel | boolean): void;
|
|
97
|
+
static find(node: Node, bubble?: boolean): Parchment.Blot | Rich | null;
|
|
98
|
+
static import(name: 'core/module'): typeof Module;
|
|
99
|
+
static import(name: `themes/${string}`): typeof Theme;
|
|
100
|
+
static import(name: '../parchment'): typeof Parchment;
|
|
101
|
+
static import(name: 'delta'): typeof Delta;
|
|
102
|
+
static import(name: string): unknown;
|
|
103
|
+
static register(targets: Record<string, Parchment.RegistryDefinition | Record<string, unknown> | Theme | Module | Function>, overwrite?: boolean): void;
|
|
104
|
+
static register(target: Parchment.RegistryDefinition, overwrite?: boolean): void;
|
|
105
|
+
static register(path: string, target: any, overwrite?: boolean): void;
|
|
106
|
+
container: HTMLElement;
|
|
107
|
+
root: HTMLDivElement;
|
|
108
|
+
scroll: Scroll;
|
|
109
|
+
emitter: Emitter;
|
|
110
|
+
protected allowReadOnlyEdits: boolean;
|
|
111
|
+
editor: Editor;
|
|
112
|
+
composition: Composition;
|
|
113
|
+
selection: Selection;
|
|
114
|
+
theme: Theme;
|
|
115
|
+
keyboard: Keyboard;
|
|
116
|
+
clipboard: Clipboard;
|
|
117
|
+
history: History;
|
|
118
|
+
uploader: Uploader;
|
|
119
|
+
options: ExpandedRichOptions;
|
|
120
|
+
constructor(container: HTMLElement | string, options?: RichOptions);
|
|
121
|
+
addContainer(container: string, refNode?: Node | null): HTMLDivElement;
|
|
122
|
+
addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;
|
|
123
|
+
blur(): void;
|
|
124
|
+
deleteText(range: Range, source?: EmitterSource): Delta;
|
|
125
|
+
deleteText(index: number, length: number, source?: EmitterSource): Delta;
|
|
126
|
+
disable(): void;
|
|
127
|
+
editReadOnly<T>(modifier: () => T): T;
|
|
128
|
+
enable(enabled?: boolean): void;
|
|
129
|
+
focus(options?: {
|
|
130
|
+
preventScroll?: boolean;
|
|
131
|
+
}): void;
|
|
132
|
+
format(name: string, value: unknown, source?: EmitterSource): Delta;
|
|
133
|
+
formatLine(index: number, length: number, formats: Record<string, unknown>, source?: EmitterSource): Delta;
|
|
134
|
+
formatLine(index: number, length: number, name: string, value?: unknown, source?: EmitterSource): Delta;
|
|
135
|
+
formatText(range: Range, name: string, value: unknown, source?: EmitterSource): Delta;
|
|
136
|
+
formatText(index: number, length: number, name: string, value: unknown, source?: EmitterSource): Delta;
|
|
137
|
+
formatText(index: number, length: number, formats: Record<string, unknown>, source?: EmitterSource): Delta;
|
|
138
|
+
getBounds(index: number | Range, length?: number): Bounds | null;
|
|
139
|
+
getContents(index?: number, length?: number): Delta;
|
|
140
|
+
getFormat(index?: number, length?: number): {
|
|
141
|
+
[format: string]: unknown;
|
|
142
|
+
};
|
|
143
|
+
getFormat(range?: Range): {
|
|
144
|
+
[format: string]: unknown;
|
|
145
|
+
};
|
|
146
|
+
getIndex(blot: Parchment.Blot): number;
|
|
147
|
+
getLength(): number;
|
|
148
|
+
getLeaf(index: number): [Parchment.LeafBlot | null, number];
|
|
149
|
+
getLine(index: number): [Block | BlockEmbed | null, number];
|
|
150
|
+
getLines(range: Range): (Block | BlockEmbed)[];
|
|
151
|
+
getLines(index?: number, length?: number): (Block | BlockEmbed)[];
|
|
152
|
+
getModule(name: string): unknown;
|
|
153
|
+
getSelection(focus: true): Range;
|
|
154
|
+
getSelection(focus?: boolean): Range | null;
|
|
155
|
+
getSemanticHTML(range: Range): string;
|
|
156
|
+
getSemanticHTML(index?: number, length?: number): string;
|
|
157
|
+
getText(range?: Range): string;
|
|
158
|
+
getText(index?: number, length?: number): string;
|
|
159
|
+
hasFocus(): boolean;
|
|
160
|
+
insertEmbed(index: number, embed: string, value: unknown, source?: EmitterSource): Delta;
|
|
161
|
+
insertText(index: number, text: string, source?: EmitterSource): Delta;
|
|
162
|
+
insertText(index: number, text: string, formats: Record<string, unknown>, source?: EmitterSource): Delta;
|
|
163
|
+
insertText(index: number, text: string, name: string, value: unknown, source?: EmitterSource): Delta;
|
|
164
|
+
isEnabled(): boolean;
|
|
165
|
+
off(...args: Parameters<(typeof Emitter)['prototype']['off']>): void;
|
|
166
|
+
on(event: (typeof Emitter)['events']['TEXT_CHANGE'], handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void): Emitter;
|
|
167
|
+
on(event: (typeof Emitter)['events']['SELECTION_CHANGE'], handler: (range: Range, oldRange: Range, source: EmitterSource) => void): Emitter;
|
|
168
|
+
on(event: (typeof Emitter)['events']['EDITOR_CHANGE'], handler: (...args: [
|
|
169
|
+
(typeof Emitter)['events']['TEXT_CHANGE'],
|
|
170
|
+
Delta,
|
|
171
|
+
Delta,
|
|
172
|
+
EmitterSource
|
|
173
|
+
] | [
|
|
174
|
+
(typeof Emitter)['events']['SELECTION_CHANGE'],
|
|
175
|
+
Range,
|
|
176
|
+
Range,
|
|
177
|
+
EmitterSource
|
|
178
|
+
]) => void): Emitter;
|
|
179
|
+
on(event: string, ...args: unknown[]): Emitter;
|
|
180
|
+
once(...args: Parameters<(typeof Emitter)['prototype']['once']>): void;
|
|
181
|
+
removeFormat(index: number, length: number, source?: EmitterSource): Delta;
|
|
182
|
+
scrollRectIntoView(rect: Rect, options?: ScrollRectIntoViewOptions): void;
|
|
183
|
+
/**
|
|
184
|
+
* @deprecated Use Rich#scrollSelectionIntoView() instead.
|
|
185
|
+
*/
|
|
186
|
+
scrollIntoView(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Scroll the current selection into the visible area.
|
|
189
|
+
* If the selection is already visible, no scrolling will occur.
|
|
190
|
+
*/
|
|
191
|
+
scrollSelectionIntoView(options?: ScrollRectIntoViewOptions): void;
|
|
192
|
+
setContents(delta: Delta | Op[], source?: EmitterSource): Delta;
|
|
193
|
+
setSelection(range: Range | null, source?: EmitterSource): void;
|
|
194
|
+
setSelection(index: number, source?: EmitterSource): void;
|
|
195
|
+
setSelection(index: number, length?: number, source?: EmitterSource): void;
|
|
196
|
+
setSelection(index: number, source?: EmitterSource): void;
|
|
197
|
+
setText(text: string, source?: EmitterSource): Delta;
|
|
198
|
+
update(source?: EmitterSource): void;
|
|
199
|
+
updateContents(delta: Delta | Op[], source?: EmitterSource): Delta;
|
|
200
|
+
}
|
|
201
|
+
declare function expandConfig(containerOrSelector: HTMLElement | string, options: RichOptions): ExpandedRichOptions;
|
|
202
|
+
type NormalizedIndexLength = [
|
|
203
|
+
number,
|
|
204
|
+
number,
|
|
205
|
+
Record<string, unknown>,
|
|
206
|
+
EmitterSource
|
|
207
|
+
];
|
|
208
|
+
declare function overload(index: number, source?: EmitterSource): NormalizedIndexLength;
|
|
209
|
+
declare function overload(index: number, length: number, source?: EmitterSource): NormalizedIndexLength;
|
|
210
|
+
declare function overload(index: number, length: number, format: string, value: unknown, source?: EmitterSource): NormalizedIndexLength;
|
|
211
|
+
declare function overload(index: number, length: number, format: Record<string, unknown>, source?: EmitterSource): NormalizedIndexLength;
|
|
212
|
+
declare function overload(range: Range, source?: EmitterSource): NormalizedIndexLength;
|
|
213
|
+
declare function overload(range: Range, format: string, value: unknown, source?: EmitterSource): NormalizedIndexLength;
|
|
214
|
+
declare function overload(range: Range, format: Record<string, unknown>, source?: EmitterSource): NormalizedIndexLength;
|
|
215
|
+
export { Parchment, Range };
|
|
216
|
+
export type { Bounds, DebugLevel, EmitterSource };
|
|
217
|
+
export { Rich as default, expandConfig, globalRegistry, overload };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type Cursor from '../blots/cursor.js';
|
|
2
|
+
import type Scroll from '../blots/scroll.js';
|
|
3
|
+
import type { EmitterSource } from './emitter.js';
|
|
4
|
+
import Emitter from './emitter.js';
|
|
5
|
+
type NativeRange = AbstractRange;
|
|
6
|
+
interface NormalizedRange {
|
|
7
|
+
start: {
|
|
8
|
+
node: NativeRange['startContainer'];
|
|
9
|
+
offset: NativeRange['startOffset'];
|
|
10
|
+
};
|
|
11
|
+
end: {
|
|
12
|
+
node: NativeRange['endContainer'];
|
|
13
|
+
offset: NativeRange['endOffset'];
|
|
14
|
+
};
|
|
15
|
+
native: NativeRange;
|
|
16
|
+
}
|
|
17
|
+
export interface Bounds {
|
|
18
|
+
bottom: number;
|
|
19
|
+
height: number;
|
|
20
|
+
left: number;
|
|
21
|
+
right: number;
|
|
22
|
+
top: number;
|
|
23
|
+
width: number;
|
|
24
|
+
}
|
|
25
|
+
export declare class Range {
|
|
26
|
+
index: number;
|
|
27
|
+
length: number;
|
|
28
|
+
constructor(index: number, length?: number);
|
|
29
|
+
}
|
|
30
|
+
declare class Selection {
|
|
31
|
+
scroll: Scroll;
|
|
32
|
+
emitter: Emitter;
|
|
33
|
+
composing: boolean;
|
|
34
|
+
mouseDown: boolean;
|
|
35
|
+
root: HTMLElement;
|
|
36
|
+
cursor: Cursor;
|
|
37
|
+
savedRange: Range;
|
|
38
|
+
lastRange: Range | null;
|
|
39
|
+
lastNative: NormalizedRange | null;
|
|
40
|
+
constructor(scroll: Scroll, emitter: Emitter);
|
|
41
|
+
handleComposition(): void;
|
|
42
|
+
handleDragging(): void;
|
|
43
|
+
focus(): void;
|
|
44
|
+
format(format: string, value: unknown): void;
|
|
45
|
+
getBounds(index: number, length?: number): DOMRect | {
|
|
46
|
+
bottom: number;
|
|
47
|
+
height: number;
|
|
48
|
+
left: number;
|
|
49
|
+
right: number;
|
|
50
|
+
top: number;
|
|
51
|
+
width: number;
|
|
52
|
+
} | null;
|
|
53
|
+
getNativeRange(): NormalizedRange | null;
|
|
54
|
+
getRange(): [Range, NormalizedRange] | [null, null];
|
|
55
|
+
hasFocus(): boolean;
|
|
56
|
+
normalizedToRange(range: NormalizedRange): Range;
|
|
57
|
+
normalizeNative(nativeRange: NativeRange): {
|
|
58
|
+
start: {
|
|
59
|
+
node: Node;
|
|
60
|
+
offset: number;
|
|
61
|
+
};
|
|
62
|
+
end: {
|
|
63
|
+
node: Node;
|
|
64
|
+
offset: number;
|
|
65
|
+
};
|
|
66
|
+
native: AbstractRange;
|
|
67
|
+
} | null;
|
|
68
|
+
rangeToNative(range: Range): [Node | null, number, Node | null, number];
|
|
69
|
+
setNativeRange(startNode: Node | null, startOffset?: number, endNode?: Node | null, endOffset?: number | undefined, force?: boolean): void;
|
|
70
|
+
setRange(range: Range | null, force: boolean, source?: EmitterSource): void;
|
|
71
|
+
setRange(range: Range | null, source?: EmitterSource): void;
|
|
72
|
+
update(source?: EmitterSource): void;
|
|
73
|
+
}
|
|
74
|
+
export default Selection;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type Rich from '../core.js';
|
|
2
|
+
import type Clipboard from '../modules/clipboard.js';
|
|
3
|
+
import type History from '../modules/history.js';
|
|
4
|
+
import type Keyboard from '../modules/keyboard.js';
|
|
5
|
+
import type { ToolbarProps } from '../modules/toolbar.js';
|
|
6
|
+
import type Uploader from '../modules/uploader.js';
|
|
7
|
+
export interface ThemeOptions {
|
|
8
|
+
modules: Record<string, unknown> & {
|
|
9
|
+
toolbar?: null | ToolbarProps;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare class Theme {
|
|
13
|
+
protected rich: Rich;
|
|
14
|
+
protected options: ThemeOptions;
|
|
15
|
+
static DEFAULTS: ThemeOptions;
|
|
16
|
+
static themes: {
|
|
17
|
+
default: typeof Theme;
|
|
18
|
+
};
|
|
19
|
+
modules: ThemeOptions['modules'];
|
|
20
|
+
constructor(rich: Rich, options: ThemeOptions);
|
|
21
|
+
init(): void;
|
|
22
|
+
addModule(name: 'clipboard'): Clipboard;
|
|
23
|
+
addModule(name: 'keyboard'): Keyboard;
|
|
24
|
+
addModule(name: 'uploader'): Uploader;
|
|
25
|
+
addModule(name: 'history'): History;
|
|
26
|
+
addModule(name: string): unknown;
|
|
27
|
+
}
|
|
28
|
+
export interface ThemeConstructor {
|
|
29
|
+
new (rich: Rich, options: unknown): Theme;
|
|
30
|
+
DEFAULTS: ThemeOptions;
|
|
31
|
+
}
|
|
32
|
+
export default Theme;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Rect = {
|
|
2
|
+
top: number;
|
|
3
|
+
right: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
};
|
|
7
|
+
export interface ScrollRectIntoViewOptions {
|
|
8
|
+
smooth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const scrollRectIntoView: (root: HTMLElement, targetRect: Rect, options?: ScrollRectIntoViewOptions) => void;
|
|
11
|
+
export default scrollRectIntoView;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Bounds, DebugLevel, EmitterSource, ExpandedRichOptions, RichOptions } from './core/rich.js';
|
|
2
|
+
import Rich, { Parchment, Range } from './core/rich.js';
|
|
3
|
+
import Delta, { AttributeMap, Op, OpIterator } from './delta';
|
|
4
|
+
export { default as Module } from './core/module.js';
|
|
5
|
+
export { AttributeMap, Delta, Op, OpIterator, Parchment, Range };
|
|
6
|
+
export type { Bounds, DebugLevel, EmitterSource, ExpandedRichOptions, RichOptions, };
|
|
7
|
+
export default Rich;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface AttributeMap {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
}
|
|
4
|
+
declare namespace AttributeMap {
|
|
5
|
+
function compose(a?: AttributeMap, b?: AttributeMap, keepNull?: boolean): AttributeMap | undefined;
|
|
6
|
+
function diff(a?: AttributeMap, b?: AttributeMap): AttributeMap | undefined;
|
|
7
|
+
function invert(attr?: AttributeMap, base?: AttributeMap): AttributeMap;
|
|
8
|
+
function transform(a: AttributeMap | undefined, b: AttributeMap | undefined, priority?: boolean): AttributeMap | undefined;
|
|
9
|
+
}
|
|
10
|
+
export default AttributeMap;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import AttributeMap from './AttributeMap';
|
|
2
|
+
interface Op {
|
|
3
|
+
insert?: string | Record<string, unknown>;
|
|
4
|
+
delete?: number;
|
|
5
|
+
retain?: number | Record<string, unknown>;
|
|
6
|
+
attributes?: AttributeMap;
|
|
7
|
+
}
|
|
8
|
+
declare namespace Op {
|
|
9
|
+
function length(op: Op): number;
|
|
10
|
+
}
|
|
11
|
+
export default Op;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Op from './Op';
|
|
2
|
+
export default class Iterator {
|
|
3
|
+
ops: Op[];
|
|
4
|
+
index: number;
|
|
5
|
+
offset: number;
|
|
6
|
+
constructor(ops: Op[]);
|
|
7
|
+
hasNext(): boolean;
|
|
8
|
+
next(length?: number): Op;
|
|
9
|
+
peek(): Op;
|
|
10
|
+
peekLength(): number;
|
|
11
|
+
peekType(): string;
|
|
12
|
+
rest(): Op[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import diff from '@unicom-cloud/utils/diff';
|
|
2
|
+
import AttributeMap from './AttributeMap';
|
|
3
|
+
import Op from './Op';
|
|
4
|
+
import OpIterator from './OpIterator';
|
|
5
|
+
interface EmbedHandler<T> {
|
|
6
|
+
compose(a: T, b: T, keepNull: boolean): T;
|
|
7
|
+
invert(a: T, b: T): T;
|
|
8
|
+
transform(a: T, b: T, priority: boolean): T;
|
|
9
|
+
}
|
|
10
|
+
declare class Delta {
|
|
11
|
+
static Op: typeof Op;
|
|
12
|
+
static OpIterator: typeof OpIterator;
|
|
13
|
+
static AttributeMap: typeof AttributeMap;
|
|
14
|
+
private static handlers;
|
|
15
|
+
static registerEmbed<T>(embedType: string, handler: EmbedHandler<T>): void;
|
|
16
|
+
static unregisterEmbed(embedType: string): void;
|
|
17
|
+
private static getHandler;
|
|
18
|
+
ops: Op[];
|
|
19
|
+
constructor(ops?: Op[] | {
|
|
20
|
+
ops: Op[];
|
|
21
|
+
});
|
|
22
|
+
insert(arg: string | Record<string, unknown>, attributes?: AttributeMap | null): this;
|
|
23
|
+
delete(length: number): this;
|
|
24
|
+
retain(length: number | Record<string, unknown>, attributes?: AttributeMap | null): this;
|
|
25
|
+
push(newOp: Op): this;
|
|
26
|
+
chop(): this;
|
|
27
|
+
filter(predicate: (op: Op, index: number) => boolean): Op[];
|
|
28
|
+
forEach(predicate: (op: Op, index: number) => void): void;
|
|
29
|
+
map<T>(predicate: (op: Op, index: number) => T): T[];
|
|
30
|
+
partition(predicate: (op: Op) => boolean): [Op[], Op[]];
|
|
31
|
+
reduce<T>(predicate: (accum: T, curr: Op, index: number) => T, initialValue: T): T;
|
|
32
|
+
changeLength(): number;
|
|
33
|
+
length(): number;
|
|
34
|
+
slice(start?: number, end?: number): Delta;
|
|
35
|
+
compose(other: Delta): Delta;
|
|
36
|
+
concat(other: Delta): Delta;
|
|
37
|
+
diff(other: Delta, cursor?: number | diff.CursorInfo): Delta;
|
|
38
|
+
eachLine(predicate: (line: Delta, attributes: AttributeMap, index: number) => boolean | void, newline?: string): void;
|
|
39
|
+
invert(base: Delta): Delta;
|
|
40
|
+
transform(index: number, priority?: boolean): number;
|
|
41
|
+
transform(other: Delta, priority?: boolean): Delta;
|
|
42
|
+
transformPosition(index: number, priority?: boolean): number;
|
|
43
|
+
}
|
|
44
|
+
export default Delta;
|
|
45
|
+
export { AttributeMap, Op, OpIterator };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export default EventEmitter;
|
|
2
|
+
/**
|
|
3
|
+
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
4
|
+
* `EventEmitter` interface.
|
|
5
|
+
*
|
|
6
|
+
* @constructor
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export function EventEmitter(): void;
|
|
10
|
+
export class EventEmitter {
|
|
11
|
+
_events: Events;
|
|
12
|
+
_eventsCount: number;
|
|
13
|
+
/**
|
|
14
|
+
* Return an array listing the events for which the emitter has registered
|
|
15
|
+
* listeners.
|
|
16
|
+
*
|
|
17
|
+
* @returns {Array}
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
public eventNames(): any[];
|
|
21
|
+
/**
|
|
22
|
+
* Return the listeners registered for a given event.
|
|
23
|
+
*
|
|
24
|
+
* @param {(String|Symbol)} event The event name.
|
|
25
|
+
* @returns {Array} The registered listeners.
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
public listeners(event: (string | Symbol)): any[];
|
|
29
|
+
/**
|
|
30
|
+
* Return the number of listeners listening to a given event.
|
|
31
|
+
*
|
|
32
|
+
* @param {(String|Symbol)} event The event name.
|
|
33
|
+
* @returns {Number} The number of listeners.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
public listenerCount(event: (string | Symbol)): number;
|
|
37
|
+
/**
|
|
38
|
+
* Calls each of the listeners registered for a given event.
|
|
39
|
+
*
|
|
40
|
+
* @param {(String|Symbol)} event The event name.
|
|
41
|
+
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
public emit(event: (string | Symbol), a1: any, a2: any, a3: any, a4: any, a5: any, ...args: any[]): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Add a listener for a given event.
|
|
47
|
+
*
|
|
48
|
+
* @param {(String|Symbol)} event The event name.
|
|
49
|
+
* @param {Function} fn The listener function.
|
|
50
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
51
|
+
* @returns {EventEmitter} `this`.
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
public on(event: (string | Symbol), fn: Function, context?: any): EventEmitter;
|
|
55
|
+
/**
|
|
56
|
+
* Add a one-time listener for a given event.
|
|
57
|
+
*
|
|
58
|
+
* @param {(String|Symbol)} event The event name.
|
|
59
|
+
* @param {Function} fn The listener function.
|
|
60
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
61
|
+
* @returns {EventEmitter} `this`.
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
public once(event: (string | Symbol), fn: Function, context?: any): EventEmitter;
|
|
65
|
+
/**
|
|
66
|
+
* Remove the listeners of a given event.
|
|
67
|
+
*
|
|
68
|
+
* @param {(String|Symbol)} event The event name.
|
|
69
|
+
* @param {Function} fn Only remove the listeners that match this function.
|
|
70
|
+
* @param {*} context Only remove the listeners that have this context.
|
|
71
|
+
* @param {Boolean} once Only remove one-time listeners.
|
|
72
|
+
* @returns {EventEmitter} `this`.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
public removeListener(event: (string | Symbol), fn: Function, context: any, once: boolean): EventEmitter;
|
|
76
|
+
/**
|
|
77
|
+
* Remove all listeners, or those of the specified event.
|
|
78
|
+
*
|
|
79
|
+
* @param {(String|Symbol)} [event] The event name.
|
|
80
|
+
* @returns {EventEmitter} `this`.
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
public removeAllListeners(event?: (string | Symbol)): EventEmitter;
|
|
84
|
+
off: any;
|
|
85
|
+
addListener: any;
|
|
86
|
+
}
|
|
87
|
+
export namespace EventEmitter {
|
|
88
|
+
export { prefix as prefixed };
|
|
89
|
+
export { EventEmitter };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Constructor to create a storage for our `EE` objects.
|
|
93
|
+
* An `Events` instance is a plain object whose properties are event names.
|
|
94
|
+
*
|
|
95
|
+
* @constructor
|
|
96
|
+
* @private
|
|
97
|
+
*/
|
|
98
|
+
declare function Events(): void;
|
|
99
|
+
declare class Events {
|
|
100
|
+
}
|
|
101
|
+
declare var prefix: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Inline from '../blots/inline.js';
|
|
2
|
+
declare class Bold extends Inline {
|
|
3
|
+
static blotName: string;
|
|
4
|
+
static tagName: string[];
|
|
5
|
+
static create(): HTMLElement;
|
|
6
|
+
static formats(): boolean;
|
|
7
|
+
optimize(context: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}): void;
|
|
10
|
+
}
|
|
11
|
+
export default Bold;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Block from '../blots/block.js';
|
|
2
|
+
import Container from '../blots/container.js';
|
|
3
|
+
import Inline from '../blots/inline.js';
|
|
4
|
+
declare class CodeBlockContainer extends Container {
|
|
5
|
+
static create(value: string): Element;
|
|
6
|
+
code(index: number, length: number): string;
|
|
7
|
+
html(index: number, length: number): string;
|
|
8
|
+
}
|
|
9
|
+
declare class CodeBlock extends Block {
|
|
10
|
+
static TAB: string;
|
|
11
|
+
static register(): void;
|
|
12
|
+
}
|
|
13
|
+
declare class Code extends Inline {
|
|
14
|
+
}
|
|
15
|
+
export { Code, CodeBlockContainer, CodeBlock as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClassAttributor, StyleAttributor } from '../parchment';
|
|
2
|
+
declare class ColorAttributor extends StyleAttributor {
|
|
3
|
+
value(domNode: HTMLElement): string;
|
|
4
|
+
}
|
|
5
|
+
declare const ColorClass: ClassAttributor;
|
|
6
|
+
declare const ColorStyle: ColorAttributor;
|
|
7
|
+
export { ColorAttributor, ColorClass, ColorStyle };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Attributor, ClassAttributor, StyleAttributor } from '../parchment';
|
|
2
|
+
declare const DirectionAttribute: Attributor;
|
|
3
|
+
declare const DirectionClass: ClassAttributor;
|
|
4
|
+
declare const DirectionStyle: StyleAttributor;
|
|
5
|
+
export { DirectionAttribute, DirectionClass, DirectionStyle };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ClassAttributor, StyleAttributor } from '../parchment';
|
|
2
|
+
declare const FontClass: ClassAttributor;
|
|
3
|
+
declare class FontStyleAttributor extends StyleAttributor {
|
|
4
|
+
value(node: HTMLElement): any;
|
|
5
|
+
}
|
|
6
|
+
declare const FontStyle: FontStyleAttributor;
|
|
7
|
+
export { FontClass, FontStyle };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Embed from '../blots/embed.js';
|
|
2
|
+
declare class Formula extends Embed {
|
|
3
|
+
static blotName: string;
|
|
4
|
+
static className: string;
|
|
5
|
+
static tagName: string;
|
|
6
|
+
static create(value: string): Element;
|
|
7
|
+
static value(domNode: Element): string | null;
|
|
8
|
+
html(): string;
|
|
9
|
+
}
|
|
10
|
+
export default Formula;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EmbedBlot } from '../parchment';
|
|
2
|
+
declare class Image extends EmbedBlot {
|
|
3
|
+
static blotName: string;
|
|
4
|
+
static tagName: string;
|
|
5
|
+
static create(value: string): Element;
|
|
6
|
+
static formats(domNode: Element): Record<string, string | null>;
|
|
7
|
+
static match(url: string): boolean;
|
|
8
|
+
static sanitize(url: string): string;
|
|
9
|
+
static value(domNode: Element): string | null;
|
|
10
|
+
domNode: HTMLImageElement;
|
|
11
|
+
format(name: string, value: string): void;
|
|
12
|
+
}
|
|
13
|
+
export default Image;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClassAttributor } from '../parchment';
|
|
2
|
+
declare class IndentAttributor extends ClassAttributor {
|
|
3
|
+
add(node: HTMLElement, value: string | number): boolean;
|
|
4
|
+
canAdd(node: HTMLElement, value: string): boolean;
|
|
5
|
+
value(node: HTMLElement): number | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const IndentClass: IndentAttributor;
|
|
8
|
+
export default IndentClass;
|