@unicom-cloud/ui 0.8.133 → 0.8.135
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 +1 -1
- package/Alert.js +1 -1
- package/Anchor.js +1 -1
- package/App.js +1 -1
- package/AutoComplete.js +1 -1
- package/Avatar.js +1 -1
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- package/Breadcrumb.js +1 -1
- 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/Collapse.js +1 -1
- package/ColorPicker.js +16 -15
- package/Comment.js +1 -1
- package/ConfigProvider.js +1 -1
- package/Constant.js +1 -1
- package/Copy.js +2 -2
- package/Countdown.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +4 -3
- package/Details.js +1 -1
- package/Development.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Drawer.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Flex.js +1 -1
- package/Form.js +1 -1
- package/Grid.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +4 -3
- package/Image.js +1 -1
- package/Input.js +1 -1
- package/InputNumber.js +7 -3
- package/InputTag.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/LiquidFill.js +1 -1
- package/List.js +1 -1
- package/Loading.js +1 -1
- package/Marquee.js +1 -1
- package/Masonry.js +1 -1
- package/Mentions.js +4 -3
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +2 -2
- package/Popover.js +3 -11
- package/Portal.js +3 -7
- package/Progress.js +1 -1
- package/Progress2.js +1 -1
- package/QrCode.js +1 -1
- package/Radio.js +1 -1
- package/Rate.js +5 -4
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/RichText.js +36 -24
- package/RowCol.js +1 -1
- package/Segmented.js +1 -1
- package/Select.js +1 -1
- package/SelectView.js +4 -3
- package/Skeleton.js +1 -1
- package/Slider.js +4 -3
- package/Space.js +1 -1
- package/SpeechSynthesis.js +1 -1
- package/Spin.js +1 -1
- package/Splitter.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/SuspenseFallbackTest.js +1 -1
- package/Switch.js +4 -3
- package/Table.js +1 -1
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/TimePicker.js +1 -1
- package/Timeline.js +1 -1
- package/Timer.js +1 -1
- package/Tooltip.js +3 -13
- package/Tour.js +1 -1
- package/Transfer.js +4 -3
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +1 -1
- package/Typography.js +1 -1
- package/Upload.js +1 -1
- package/VerificationCode.js +1 -1
- package/VirtualList.js +1 -1
- package/Watermark.js +1 -1
- package/affix/Affix.js +1 -1
- package/affix/index.js +1 -1
- package/alert/Alert.js +1 -1
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/anchor/context.js +1 -1
- package/anchor/index.js +1 -1
- package/anchor/utils.js +17 -16
- package/app/App.js +1 -1
- package/app/context.js +1 -1
- package/app/index.js +1 -1
- package/app/useApp.js +1 -1
- package/auto-complete/AutoComplete.js +117 -112
- package/auto-complete/index.js +1 -1
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +2 -2
- package/avatar/context.js +1 -1
- package/avatar/index.js +1 -1
- package/back-top/BackTop.js +1 -1
- package/back-top/index.js +1 -1
- package/badge/Badge.js +1 -1
- package/badge/Count.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumb/Breadcrumb.js +1 -1
- package/breadcrumb/Item.js +1 -1
- package/breadcrumb/index.js +1 -1
- package/button/Button.js +33 -32
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/Lunar.js +1 -1
- package/calendar/Month.js +1 -1
- package/calendar/WeekList.js +1 -1
- package/calendar/Year.js +1 -1
- package/calendar/header/Panel.js +1 -1
- package/calendar/header/index.js +1 -1
- package/calendar/hook/useCellClassName.js +1 -1
- package/calendar/index.js +1 -1
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +130 -127
- package/cascader/base/node.js +1 -1
- package/cascader/base/store.js +1 -1
- package/cascader/hook/useRefCurrent.js +1 -1
- package/cascader/index.js +1 -1
- package/cascader/panel/List.js +37 -36
- package/cascader/panel/Option.js +1 -1
- package/cascader/panel/Search.js +1 -1
- package/cascader/utils.js +1 -1
- package/checkbox/Checkbox.js +91 -86
- package/checkbox/Group.js +83 -67
- package/checkbox/GroupBlock.js +93 -59
- package/checkbox/index.js +1 -1
- package/checkbox/useCheckbox.js +1 -1
- package/collapse/Collapse.js +1 -1
- package/collapse/Item.js +1 -1
- package/collapse/index.js +1 -1
- 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/Mode.js +1 -1
- package/color-picker/Palette.js +1 -1
- package/color-picker/Panel.js +2 -2
- package/color-picker/colors.js +1 -1
- package/color-picker/hooks/useColorPicker.js +99 -104
- package/color-picker/hooks/useControlBlock.js +1 -1
- package/color-picker/index.js +145 -131
- package/color-picker/interface.js +1 -1
- package/color-picker/utils.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +42 -60
- package/config-provider/context.js +14 -13
- package/config-provider/index.js +1 -1
- package/config-provider/useConfigProvider.js +38 -0
- package/constant/index.js +1 -1
- package/copy/index.js +2 -2
- package/countdown/index.js +1 -1
- package/countdown/utils.js +1 -1
- package/date-picker/Picker.js +260 -254
- package/date-picker/RangePicker.js +315 -309
- package/date-picker/context.js +1 -1
- package/date-picker/hook/useCellClassName.js +1 -1
- package/date-picker/index.js +1 -1
- package/date-picker/panel/Body.js +1 -1
- package/date-picker/panel/Footer.js +1 -1
- package/date-picker/panel/Header.js +1 -1
- package/date-picker/panel/Shortcut.js +1 -1
- package/date-picker/panel/WeekList.js +1 -1
- package/date-picker/panel/date/index.js +1 -1
- package/date-picker/panel/month/index.js +1 -1
- package/date-picker/panel/quarter/index.js +1 -1
- package/date-picker/panel/range/index.js +1 -1
- package/date-picker/panel/week/index.js +1 -1
- package/date-picker/panel/year/index.js +1 -1
- package/date-picker/utils.js +1 -1
- package/descriptions/index.js +2 -1
- package/details/index.js +1 -1
- package/development/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/Item.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +44 -38
- package/drawer/index.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 +1 -1
- package/form/Control.js +1 -1
- package/form/Form.js +93 -94
- package/form/FormItem.js +140 -133
- package/form/FormLabel.js +38 -37
- package/form/FormList.js +1 -1
- package/form/FormProvider.js +1 -1
- package/form/context.js +1 -1
- package/form/hook/useContext.js +1 -1
- package/form/hook/useForm.js +1 -1
- package/form/hook/useState.js +1 -1
- package/form/hook/useWatch.js +1 -1
- package/form/index.js +1 -1
- package/form/interface.js +1 -1
- package/form/promisify.js +1 -1
- package/form/store.js +1 -1
- package/form/utils.js +1 -1
- package/grid/Grid.js +1 -1
- package/grid/Item.js +1 -1
- package/grid/context.js +1 -1
- package/grid/index.js +1 -1
- package/grid/utils.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/use-breakpoint/index.js +1 -1
- package/hooks/use-computed-state/index.js +1 -1
- package/hooks/use-create/index.js +1 -1
- package/hooks/use-creation/index.js +1 -1
- package/hooks/use-event/index.js +1 -1
- package/hooks/use-force-update/index.js +1 -1
- package/hooks/use-id/index.js +1 -1
- package/hooks/use-in-view/index.js +1 -1
- package/hooks/use-intersection-observer/index.js +1 -1
- package/hooks/use-intersection-observers/index.js +1 -1
- package/hooks/use-interval/index.js +1 -1
- package/hooks/use-is-first-render/index.js +1 -1
- package/hooks/use-isomorphic-layout-effect/index.js +1 -1
- package/hooks/use-keyboard-event/index.js +1 -1
- package/hooks/use-latest/index.js +1 -1
- package/hooks/use-listen-window-resize/index.js +1 -1
- package/hooks/use-media/index.js +1 -1
- package/hooks/use-merge-props/index.js +1 -1
- package/hooks/use-merge-value/index.js +1 -1
- package/hooks/use-move/index.js +1 -1
- package/hooks/use-mutation-observers/index.js +1 -1
- package/hooks/use-online-status/index.js +1 -1
- package/hooks/use-overflow-hidden/index.js +1 -1
- package/hooks/use-override-ref/index.js +1 -1
- package/hooks/use-persist-callback/index.js +1 -1
- package/hooks/use-prefers-color-scheme-dark/index.js +1 -1
- package/hooks/use-previous/index.js +1 -1
- package/hooks/use-refs/index.js +1 -1
- package/hooks/use-resize-observer/index.js +1 -1
- package/hooks/use-resize-observers/index.js +1 -1
- package/hooks/use-responsive-state/index.js +1 -1
- package/hooks/use-state-callback/index.js +1 -1
- package/hooks/use-state-with-promise/index.js +1 -1
- package/hooks/use-update-effect/index.js +1 -1
- package/hooks/use-update-layout-effect/index.js +1 -1
- package/hooks/use-verification-code/index.js +1 -1
- package/hooks/use-watch/index.js +1 -1
- package/hooks/use-watermark/index.js +1 -1
- package/hooks/use-watermark/utils.js +1 -1
- package/hooks/use-window-size/index.js +1 -1
- package/hooks/useBreakpoint.js +1 -1
- package/hooks/useComputedState.js +1 -1
- package/hooks/useCreate.js +1 -1
- package/hooks/useCreation.js +1 -1
- package/hooks/useEvent.js +1 -1
- package/hooks/useForceUpdate.js +1 -1
- package/hooks/useId.js +1 -1
- package/hooks/useInView.js +1 -1
- package/hooks/useIntersectionObserver.js +1 -1
- package/hooks/useIntersectionObservers.js +1 -1
- package/hooks/useInterval.js +1 -1
- package/hooks/useIsFirstRender.js +1 -1
- package/hooks/useIsomorphicLayoutEffect.js +1 -1
- package/hooks/useKeyboardEvent.js +1 -1
- package/hooks/useLatest.js +1 -1
- package/hooks/useListenWindowResize.js +1 -1
- package/hooks/useMedia.js +1 -1
- package/hooks/useMergeProps.js +1 -1
- package/hooks/useMergeValue.js +1 -1
- package/hooks/useMove.js +1 -1
- package/hooks/useMutationObservers.js +1 -1
- package/hooks/useOnlineStatus.js +1 -1
- package/hooks/useOverflowHidden.js +1 -1
- package/hooks/useOverrideRef.js +1 -1
- package/hooks/usePersistCallback.js +1 -1
- package/hooks/usePrefersColorSchemeDark.js +1 -1
- package/hooks/usePrevious.js +1 -1
- package/hooks/useRefs.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/hooks/useResizeObservers.js +1 -1
- package/hooks/useResponsiveState.js +1 -1
- package/hooks/useStateCallback.js +1 -1
- package/hooks/useStateWithPromise.js +1 -1
- package/hooks/useUpdateEffect.js +1 -1
- package/hooks/useUpdateLayoutEffect.js +1 -1
- package/hooks/useVerificationCode.js +1 -1
- package/hooks/useWatch.js +1 -1
- package/hooks/useWatermark.js +1 -1
- package/hooks/useWindowSize.js +1 -1
- package/icon/Icon.js +1 -1
- package/icon/addIconFromCdn.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +29 -26
- package/icons/file/index.js +1 -1
- package/icons/file.js +1 -1
- package/icons.js +1 -1
- package/image/Image.js +1 -1
- package/image/ImageFooter.js +1 -1
- package/image/ImagePreview.js +198 -198
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/ImagePreviewToolbar.js +2 -2
- package/image/TriggerForToolbar.js +1 -1
- package/image/index.js +1 -1
- package/image/previewGroupContext.js +1 -1
- package/image/utils/getFixTranslate.js +1 -1
- package/image/utils/getScale.js +1 -1
- package/image/utils/hook/useImageStatus.js +1 -1
- package/image/utils/hook/useShowFooter.js +1 -1
- package/index.js +551 -549
- package/input/Button.js +69 -57
- package/input/Group.js +1 -1
- package/input/Input.js +144 -133
- package/input/InputElement.js +123 -118
- package/input/Number.js +1 -1
- package/input/Password.js +60 -41
- package/input/Search.js +62 -43
- package/input/Tag.js +1 -1
- package/input/Textarea.js +106 -100
- package/input/autoSizeTextAreaHeight.js +1 -1
- package/input/index.js +1 -1
- package/input/useComposition.js +1 -1
- package/input-number/decimal.js +1 -1
- package/input-number/index.js +132 -128
- package/input-number/useSelectionRange.js +1 -1
- package/input-number/utils.js +1 -1
- package/input-tag/InputTag.js +221 -209
- package/input-tag/index.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 +30 -29
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/liquid-fill/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +1 -1
- package/loading/index.js +1 -1
- package/locale/ar-EG.js +1 -1
- package/locale/de-DE.js +1 -1
- package/locale/default.js +1 -1
- package/locale/en-US.js +1 -1
- package/locale/es-ES.js +1 -1
- package/locale/fr-FR.js +1 -1
- package/locale/id-ID.js +1 -1
- package/locale/it-IT.js +1 -1
- package/locale/ja-JP.js +1 -1
- package/locale/ko-KR.js +1 -1
- package/locale/ms-MY.js +1 -1
- package/locale/pt-BR.js +1 -1
- package/locale/pt-PT.js +1 -1
- package/locale/ru-RU.js +1 -1
- package/locale/th-TH.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/locale/vi-VN.js +1 -1
- package/locale/zh-CN.js +1 -1
- package/locale/zh-HK.js +1 -1
- package/locale/zh-TW.js +1 -1
- package/marquee/index.js +36 -48
- package/masonry/Masonry.js +2 -1
- package/masonry/MasonryItem.js +1 -1
- package/masonry/hooks/useDelay.js +1 -1
- package/masonry/hooks/useGutter.js +1 -1
- package/masonry/hooks/usePositions.js +1 -1
- package/masonry/hooks/useRefs.js +1 -1
- package/masonry/index.js +1 -1
- package/mentions/index.js +90 -85
- package/mentions/utils.js +1 -1
- package/menu/Indent.js +1 -1
- package/menu/Item.js +2 -2
- package/menu/ItemGroup.js +1 -1
- package/menu/Menu.js +1 -1
- package/menu/OverflowWrap.js +1 -1
- package/menu/context.js +1 -1
- package/menu/index.js +1 -1
- package/menu/sub-menu/Inline.js +1 -1
- package/menu/sub-menu/Pop.js +1 -1
- package/menu/sub-menu/index.js +1 -1
- package/menu/utils.js +1 -1
- package/message/index.js +1 -1
- package/message/useMessage.js +4 -3
- package/modal/Confirm.js +1 -1
- package/modal/Modal.js +2 -2
- package/modal/config.js +1 -1
- package/modal/index.js +1 -1
- package/modal/use-modal/Hook.js +1 -1
- package/modal/use-modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +1 -1
- package/notification/useNotification.js +4 -3
- package/notification/withNotification.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 +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +4 -3
- package/pagination/Pagination.js +1 -1
- package/pagination/index.js +1 -1
- package/pagination/interface.js +1 -1
- package/picker/Input.js +99 -94
- package/picker/InputRange.js +130 -125
- package/picker/index.js +1 -1
- package/popconfirm/index.js +2 -2
- package/popover/Popover.js +75 -0
- package/popover/index.js +3 -73
- package/portal/Portal.js +28 -0
- package/portal/index.js +3 -21
- package/progress/CircleProgress.js +2 -2
- package/progress/LineProgess.js +1 -1
- package/progress/StepProgress.js +1 -1
- package/progress/index.js +1 -1
- package/progress2/index.js +1 -1
- package/qr-code/index.js +1 -1
- package/qr-code/src/index.js +48 -47
- package/qr-code/src/qrcodegen.js +1 -1
- package/radio/Group.js +91 -68
- package/radio/GroupBlock.js +86 -62
- package/radio/Radio.js +80 -67
- package/radio/index.js +1 -1
- package/rate/index.js +83 -82
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/403.js +1 -1
- package/result/404.js +1 -1
- package/result/500.js +1 -1
- package/result/index.js +1 -1
- package/rich-text/Toolbar.js +509 -420
- package/rich-text/constant.js +1 -1
- package/rich-text/index.js +375 -338
- package/rich-text/lib/blots/block.js +1 -1
- package/rich-text/lib/blots/break.js +1 -1
- package/rich-text/lib/blots/container.js +1 -1
- package/rich-text/lib/blots/cursor.js +1 -1
- package/rich-text/lib/blots/embed.js +1 -1
- package/rich-text/lib/blots/inline.js +1 -1
- package/rich-text/lib/blots/scroll.js +1 -1
- package/rich-text/lib/blots/text.js +1 -1
- package/rich-text/lib/core/composition.js +1 -1
- package/rich-text/lib/core/editor.js +3 -1
- package/rich-text/lib/core/emitter.js +15 -33
- package/rich-text/lib/core/logger.js +1 -1
- package/rich-text/lib/core/module.js +1 -1
- package/rich-text/lib/core/rich.js +180 -174
- package/rich-text/lib/core/selection.js +114 -99
- package/rich-text/lib/core/theme.js +5 -4
- package/rich-text/lib/core/utils/createRegistryWithFormats.js +1 -1
- package/rich-text/lib/core/utils/scrollRectIntoView.js +1 -1
- package/rich-text/lib/core.js +21 -21
- package/rich-text/lib/delta/AttributeMap.js +1 -1
- package/rich-text/lib/delta/Op.js +1 -1
- package/rich-text/lib/delta/OpIterator.js +1 -1
- package/rich-text/lib/delta/index.js +1 -1
- package/rich-text/lib/diff/index.js +1 -1
- package/rich-text/lib/formats/align.js +16 -15
- package/rich-text/lib/formats/background.js +11 -10
- package/rich-text/lib/formats/blockquote.js +1 -1
- package/rich-text/lib/formats/bold.js +2 -2
- package/rich-text/lib/formats/code.js +1 -1
- package/rich-text/lib/formats/color.js +15 -13
- package/rich-text/lib/formats/direction.js +12 -11
- package/rich-text/lib/formats/emoji.js +19 -0
- package/rich-text/lib/formats/font.js +51 -16
- package/rich-text/lib/formats/formula.js +1 -1
- package/rich-text/lib/formats/header.js +15 -7
- package/rich-text/lib/formats/hr.js +18 -12
- package/rich-text/lib/formats/image.js +1 -1
- package/rich-text/lib/formats/indent.js +11 -10
- package/rich-text/lib/formats/italic.js +2 -2
- package/rich-text/lib/formats/lineHeight.js +2 -1
- package/rich-text/lib/formats/link.js +1 -1
- package/rich-text/lib/formats/list.js +1 -1
- package/rich-text/lib/formats/script.js +5 -3
- package/rich-text/lib/formats/size.js +17 -15
- package/rich-text/lib/formats/strike.js +1 -1
- package/rich-text/lib/formats/table.js +2 -2
- package/rich-text/lib/formats/underline.js +1 -1
- package/rich-text/lib/formats/video.js +1 -1
- package/rich-text/lib/index.js +48 -43
- package/rich-text/lib/modules/clipboard.js +1 -1
- package/rich-text/lib/modules/history.js +13 -16
- package/rich-text/lib/{formats → modules}/image-resize/index.js +9 -8
- package/rich-text/lib/{formats/image-resize/modules/BaseModule.js → modules/image-resize/modules/Base.js} +4 -4
- package/rich-text/lib/{formats → modules}/image-resize/modules/DisplaySize.js +2 -2
- package/rich-text/lib/{formats → modules}/image-resize/modules/Resize.js +2 -2
- package/rich-text/lib/{formats → modules}/image-resize/options.js +1 -1
- package/rich-text/lib/modules/input.js +36 -30
- package/rich-text/lib/modules/keyboard.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/index.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/normalizers/googleDocs.js +1 -1
- package/rich-text/lib/modules/normalizeExternalHTML/normalizers/msWord.js +1 -1
- package/rich-text/lib/modules/table.js +58 -55
- package/rich-text/lib/modules/toolbar.js +1 -1
- package/rich-text/lib/modules/uiNode.js +1 -1
- package/rich-text/lib/modules/uploader.js +1 -1
- package/rich-text/lib/parchment/attributor/attributor.js +1 -1
- package/rich-text/lib/parchment/attributor/class.js +1 -1
- package/rich-text/lib/parchment/attributor/store.js +1 -1
- package/rich-text/lib/parchment/attributor/style.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/container.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/leaf.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/parent.js +1 -1
- package/rich-text/lib/parchment/blot/abstract/shadow.js +1 -1
- package/rich-text/lib/parchment/blot/block.js +1 -1
- package/rich-text/lib/parchment/blot/embed.js +1 -1
- package/rich-text/lib/parchment/blot/inline.js +1 -1
- package/rich-text/lib/parchment/blot/scroll.js +1 -1
- package/rich-text/lib/parchment/blot/text.js +1 -1
- package/rich-text/lib/parchment/collection/linked-list.js +1 -1
- package/rich-text/lib/parchment/error.js +1 -1
- package/rich-text/lib/parchment/index.js +1 -1
- package/rich-text/lib/parchment/registry.js +1 -1
- package/rich-text/lib/parchment/scope.js +1 -1
- package/row-col/Col-.js +1 -1
- package/row-col/Col.js +1 -1
- package/row-col/Row.js +1 -1
- package/row-col/context.js +1 -1
- package/row-col/index.js +1 -1
- package/segmented/index.js +1 -1
- package/select/OptGroup.js +1 -1
- package/select/Option.js +11 -11
- package/select/Select.js +280 -281
- package/select/index.js +1 -1
- package/select/utils.js +1 -1
- package/select-view/Core.js +234 -218
- package/select-view/index.js +42 -39
- package/skeleton/Image.js +1 -1
- package/skeleton/Text.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/Dot.js +1 -1
- package/slider/Input.js +48 -43
- package/slider/Mark.js +1 -1
- package/slider/Tick.js +1 -1
- package/slider/hook/useInterval.js +1 -1
- package/slider/hook/useLegalValue.js +1 -1
- package/slider/index.js +176 -168
- package/slider/utils.js +1 -1
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +1 -1
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/splitter/Panel.js +1 -1
- package/splitter/SplitBar.js +1 -1
- package/splitter/Splitter.js +1 -1
- package/splitter/hooks/useItems.js +1 -1
- package/splitter/hooks/useResizable.js +1 -1
- package/splitter/hooks/useResize.js +1 -1
- package/splitter/hooks/useSizes.js +1 -1
- package/splitter/index.js +1 -1
- package/statistic/index.js +1 -1
- package/statistic/interface.js +1 -1
- package/steps/Step.js +1 -1
- package/steps/index.js +1 -1
- package/style/normalize.less +6 -6
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +1 -1
- package/switch/index.js +80 -76
- package/table/ColGroup.js +1 -1
- package/table/Table.js +1 -1
- package/table/constant.js +1 -1
- package/table/context.js +1 -1
- package/table/hook/useColumns.js +1 -1
- package/table/hook/useComponent.js +1 -1
- package/table/hook/useExpand.js +1 -1
- package/table/hook/useRowSelection.js +1 -1
- package/table/hook/useSorter.js +1 -1
- package/table/hook/useStickyClassNames.js +1 -1
- package/table/hook/useStickyOffsets.js +1 -1
- package/table/hook/useThResizable.js +1 -1
- package/table/index.js +1 -1
- package/table/summary/Cell.js +1 -1
- package/table/summary/Row.js +1 -1
- package/table/summary/context.js +1 -1
- package/table/summary/index.js +1 -1
- package/table/tbody/Td.js +2 -2
- package/table/tbody/Tr.js +1 -1
- package/table/tbody/index.js +1 -1
- package/table/tfoot/index.js +1 -1
- package/table/th-resizable/index.js +1 -1
- package/table/thead/Column.js +2 -2
- package/table/thead/index.js +1 -1
- package/table/utils.js +1 -1
- package/tabs/Tab.js +1 -1
- package/tabs/TabContent.js +1 -1
- package/tabs/TabPane.js +1 -1
- package/tabs/hook/useDomSize.js +1 -1
- package/tabs/hook/useHeaderScroll.js +1 -1
- package/tabs/index.js +1 -1
- package/tabs/tab-header/DropdownIcon.js +1 -1
- package/tabs/tab-header/TabInk.js +1 -1
- package/tabs/tab-header/TabNavIcon.js +1 -1
- package/tabs/tab-header/TabTitle.js +1 -1
- package/tabs/tab-header/index.js +1 -1
- package/tabs/utils.js +1 -1
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +174 -168
- package/time-picker/RangePicker.js +41 -38
- package/time-picker/TimeColumn.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/time-picker/context.js +1 -1
- package/time-picker/index.js +1 -1
- package/time-picker/utils.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/timeline/index.js +1 -1
- package/timer/index.js +1 -1
- package/tooltip/Tooltip.js +139 -0
- package/tooltip/index.js +3 -141
- package/tour/index.js +1 -1
- package/transfer/Item.js +61 -56
- package/transfer/List.js +147 -121
- package/transfer/index.js +113 -109
- package/tree/Animation.js +1 -1
- package/tree/Context.js +1 -1
- package/tree/Node.js +22 -21
- package/tree/NodeList.js +1 -1
- package/tree/Tree.js +1 -1
- package/tree/index.js +1 -1
- package/tree/utils.js +1 -1
- package/tree-select/List.js +1 -1
- package/tree-select/Select.js +105 -99
- package/tree-select/hook/useKeyCache.js +1 -1
- package/tree-select/hook/useStateValue.js +1 -1
- package/tree-select/hook/useTreeData.js +1 -1
- package/tree-select/index.js +1 -1
- package/tree-select/interface.js +1 -1
- package/tree-select/utils.js +1 -1
- package/trigger/getPopupStyle.js +1 -1
- package/trigger/index.js +1 -1
- package/types/anchor/utils.d.ts +1 -1
- package/types/auto-complete/AutoComplete.d.ts +1 -1
- package/types/auto-complete/interface.d.ts +2 -1
- package/types/cascader/interface.d.ts +3 -2
- package/types/checkbox/Group.d.ts +2 -1
- package/types/checkbox/GroupBlock.d.ts +2 -1
- package/types/checkbox/interface.d.ts +3 -2
- package/types/color-picker/interface.d.ts +2 -1
- package/types/config-provider/interface.d.ts +11 -10
- package/types/config-provider/useConfigProvider.d.ts +5 -0
- package/types/date-picker/interface.d.ts +2 -2
- package/types/form/FormLabel.d.ts +1 -1
- package/types/form/context.d.ts +0 -1
- package/types/form/interface.d.ts +5 -4
- package/types/icon-hover/interface.d.ts +2 -1
- package/types/input/interface.d.ts +4 -9
- package/types/input-number/interface.d.ts +2 -6
- package/types/input-tag/interface.d.ts +2 -6
- package/types/interface.d.ts +7 -0
- package/types/picker/Input.d.ts +2 -30
- package/types/picker/InputRange.d.ts +2 -34
- package/types/picker/interface.d.ts +59 -0
- package/types/popover/Popover.d.ts +6 -0
- package/types/popover/index.d.ts +3 -6
- package/types/portal/Portal.d.ts +4 -0
- package/types/portal/index.d.ts +4 -4
- package/types/portal/interface.d.ts +0 -1
- package/types/radio/interface.d.ts +4 -2
- package/types/rate/interface.d.ts +2 -6
- package/types/rich-text/interface.d.ts +8 -0
- package/types/rich-text/lib/core/editor.d.ts +1 -0
- package/types/rich-text/lib/core/emitter.d.ts +8 -8
- package/types/rich-text/lib/core/rich.d.ts +5 -2
- package/types/rich-text/lib/core/selection.d.ts +5 -0
- package/types/rich-text/lib/core/theme.d.ts +1 -1
- package/types/rich-text/lib/delta/index.d.ts +1 -0
- package/types/rich-text/lib/formats/align.d.ts +2 -1
- package/types/rich-text/lib/formats/background.d.ts +2 -1
- package/types/rich-text/lib/formats/color.d.ts +2 -1
- package/types/rich-text/lib/formats/direction.d.ts +2 -1
- package/types/rich-text/lib/formats/emoji.d.ts +7 -0
- package/types/rich-text/lib/formats/font.d.ts +6 -1
- package/types/rich-text/lib/formats/header.d.ts +5 -0
- package/types/rich-text/lib/formats/hr.d.ts +3 -0
- package/types/rich-text/lib/formats/indent.d.ts +2 -0
- package/types/rich-text/lib/formats/liOl.d.ts +2 -2
- package/types/rich-text/lib/formats/liUl.d.ts +2 -2
- package/types/rich-text/lib/formats/lineHeight.d.ts +2 -0
- package/types/rich-text/lib/formats/list.d.ts +2 -2
- package/types/rich-text/lib/formats/size.d.ts +3 -1
- package/types/rich-text/lib/formats/table.d.ts +3 -3
- package/types/rich-text/lib/modules/history.d.ts +1 -0
- package/types/rich-text/lib/{formats → modules}/image-resize/index.d.ts +2 -3
- package/types/rich-text/lib/{formats/image-resize/modules/BaseModule.d.ts → modules/image-resize/modules/Base.d.ts} +2 -1
- package/types/rich-text/lib/{formats → modules}/image-resize/modules/DisplaySize.d.ts +1 -1
- package/types/rich-text/lib/{formats → modules}/image-resize/modules/Resize.d.ts +1 -1
- package/types/rich-text/lib/modules/input.d.ts +1 -0
- package/types/rich-text/lib/modules/table.d.ts +4 -2
- package/types/select/interface.d.ts +7 -7
- package/types/select-view/interface.d.ts +4 -4
- package/types/slider/Input.d.ts +2 -1
- package/types/slider/interface.d.ts +2 -1
- package/types/switch/interface.d.ts +2 -1
- package/types/time-picker/interface.d.ts +2 -1
- package/types/tooltip/Tooltip.d.ts +6 -0
- package/types/tooltip/index.d.ts +3 -10
- package/types/tooltip/interface.d.ts +4 -0
- package/types/transfer/interface.d.ts +4 -3
- package/types/typography/interface.d.ts +1 -1
- package/types/upload/Upload.d.ts +0 -5
- package/types/upload/interface.d.ts +8 -2
- package/types/utils/string.d.ts +2 -0
- package/types/verification-code/interface.d.ts +2 -6
- package/typography/Base.js +3 -3
- package/typography/EditContent.js +1 -1
- package/typography/Ellipsis.js +2 -2
- package/typography/Operations.js +2 -2
- package/typography/Paragraph.js +1 -1
- package/typography/Text.js +1 -1
- package/typography/Title.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +1 -1
- package/typography/useCssEllipsis.js +1 -1
- package/typography/useEllipsis.js +1 -1
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +115 -106
- package/upload/Uploader.js +1 -1
- package/upload/constant.js +1 -1
- package/upload/index.js +1 -1
- package/upload/list/PictureItem.js +47 -39
- package/upload/list/TextItem.js +73 -58
- package/upload/list/UploadProgress.js +2 -2
- package/upload/list/index.js +65 -58
- package/upload/list/utils.js +1 -1
- package/upload/request.js +1 -1
- package/upload/utils.js +1 -1
- package/utils/callOrReturn.js +1 -1
- package/utils/callbackOriginRef.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/className.js +1 -1
- package/utils/constant.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/copy.js +1 -1
- package/utils/date.js +1 -1
- package/utils/dayjs.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/emitter.js +1 -1
- package/utils/fileRead.js +1 -1
- package/utils/fileToDataURL.js +1 -1
- package/utils/fillNBSP.js +1 -1
- package/utils/findRootElement.js +1 -1
- package/utils/findScrollParent.js +1 -1
- package/utils/getHighlightText.js +1 -1
- package/utils/getHotkeyHandler.js +1 -1
- package/utils/getStringLength.js +1 -1
- package/utils/include.js +1 -1
- package/utils/index.js +176 -174
- package/utils/intersectionObserver.js +1 -1
- package/utils/is.js +1 -1
- package/utils/keyboardCode.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/math.js +1 -1
- package/utils/mergeProps.js +1 -1
- package/utils/mergedToString.js +1 -1
- package/utils/mutationObserver.js +1 -1
- package/utils/names.js +5 -5
- package/utils/omit.js +1 -1
- package/utils/pad.js +1 -1
- package/utils/pick.js +1 -1
- package/utils/pinyin.js +1 -1
- package/utils/react19Adapter.js +1 -1
- package/utils/ref.js +1 -1
- package/utils/resizeObserver.js +1 -1
- package/utils/responsiveObserve.js +1 -1
- package/utils/saveAs.js +1 -1
- package/utils/screenfull.js +1 -1
- package/utils/scrollIntoViewIfNeeded.js +1 -1
- package/utils/setCreateRoot.js +1 -1
- package/utils/setDarkTheme.js +1 -1
- package/utils/setPrimaryColor.js +1 -1
- package/utils/setTheme.js +1 -1
- package/utils/string.js +5 -3
- package/utils/style.js +1 -1
- package/utils/throttleByRaf.js +1 -1
- package/utils/throttleByRaf2.js +1 -1
- package/utils/toArray.js +1 -1
- package/utils/tree.js +1 -1
- package/utils/tween.js +1 -1
- package/utils/uuid.js +1 -1
- package/utils/validate.js +1 -1
- package/utils/warning.js +1 -1
- package/verification-code/VerificationCode.js +80 -61
- package/verification-code/index.js +1 -1
- package/version/index.js +2 -2
- package/virtual-list/Filler.js +1 -1
- package/virtual-list/VirtualList.js +1 -1
- package/virtual-list/constant.js +1 -1
- package/virtual-list/hook/useCacheChildrenNodes.js +1 -1
- package/virtual-list/hook/useComputeVirtualItemHeight.js +1 -1
- package/virtual-list/index.js +1 -1
- package/virtual-list/utils/algorithm.js +1 -1
- package/virtual-list/utils/item.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/watermark/index.js +1 -1
- package/checkbox/IconCheck.js +0 -20
- package/rich-text/lib/diff/index.d.ts +0 -21
- package/types/checkbox/IconCheck.d.ts +0 -4
- /package/types/rich-text/lib/{formats → modules}/image-resize/options.d.ts +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/*
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { isString as
|
|
5
|
-
import { RICH_TEXT_CLASS_NAME_PREFIX as
|
|
6
|
-
import
|
|
1
|
+
/* 2026-01-08 16:35:57 */
|
|
2
|
+
import v from "lodash/merge";
|
|
3
|
+
import H from "@unicom-cloud/ui-common/utils/findRootElement";
|
|
4
|
+
import { isString as w, isBoolean as _, isFunction as $, isNumber as u, isObjectLike as j } from "@unicom-cloud/ui-common/utils/is";
|
|
5
|
+
import { RICH_TEXT_CLASS_NAME_PREFIX as p } from "../../constant.js";
|
|
6
|
+
import g from "../delta/index.js";
|
|
7
7
|
import * as G from "../parchment/index.js";
|
|
8
8
|
import q from "./composition.js";
|
|
9
9
|
import X from "./editor.js";
|
|
10
10
|
import l from "./emitter.js";
|
|
11
|
-
import
|
|
11
|
+
import P from "./logger.js";
|
|
12
12
|
import z from "./module.js";
|
|
13
13
|
import K, { Range as B } from "./selection.js";
|
|
14
|
-
import
|
|
14
|
+
import F from "./theme.js";
|
|
15
15
|
import W from "./utils/createRegistryWithFormats.js";
|
|
16
16
|
import J from "./utils/scrollRectIntoView.js";
|
|
17
|
-
import Q from "../parchment/blot/
|
|
17
|
+
import Q from "../parchment/blot/scroll.js";
|
|
18
18
|
import Y from "../parchment/registry.js";
|
|
19
|
-
import Z from "../parchment/
|
|
20
|
-
import x from "../parchment/
|
|
21
|
-
const E =
|
|
22
|
-
function
|
|
19
|
+
import Z from "../parchment/scope.js";
|
|
20
|
+
import x from "../parchment/blot/abstract/parent.js";
|
|
21
|
+
const E = P("rich"), R = /* @__PURE__ */ new WeakMap(), V = ["selectionchange", "mousedown", "mouseup", "click"];
|
|
22
|
+
function k(...n) {
|
|
23
23
|
const t = document.querySelectorAll(
|
|
24
|
-
`.${
|
|
24
|
+
`.${p}-container`
|
|
25
25
|
);
|
|
26
26
|
Array.from(t).forEach((e) => {
|
|
27
27
|
const s = R.get(e);
|
|
@@ -30,17 +30,70 @@ function H(...n) {
|
|
|
30
30
|
}
|
|
31
31
|
function tt() {
|
|
32
32
|
V.forEach((n) => {
|
|
33
|
-
document.addEventListener(n,
|
|
33
|
+
document.addEventListener(n, k);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function M() {
|
|
37
37
|
V.forEach((n) => {
|
|
38
|
-
document.removeEventListener(n,
|
|
38
|
+
document.removeEventListener(n, k);
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
const L = new Y();
|
|
42
|
-
|
|
43
|
-
class
|
|
42
|
+
x.uiClass = `${p}-ui`;
|
|
43
|
+
class d {
|
|
44
|
+
constructor(t, e = {}) {
|
|
45
|
+
if (this.editorChange = (r) => {
|
|
46
|
+
r === l.events.TEXT_CHANGE && this.root.classList.toggle(
|
|
47
|
+
`${p}-blank`,
|
|
48
|
+
this.editor.isBlank()
|
|
49
|
+
);
|
|
50
|
+
}, this.scrollUpdate = (r, h) => {
|
|
51
|
+
const m = this.selection.lastRange, [c] = this.selection.getRange(), y = m && c ? { oldRange: m, newRange: c } : void 0;
|
|
52
|
+
a.call(
|
|
53
|
+
this,
|
|
54
|
+
() => this.editor.update(null, h, y),
|
|
55
|
+
r
|
|
56
|
+
);
|
|
57
|
+
}, this.scrollEmbedUpdate = (r, h) => {
|
|
58
|
+
const m = this.selection.lastRange, [c] = this.selection.getRange(), y = m && c ? { oldRange: m, newRange: c } : void 0;
|
|
59
|
+
a.call(
|
|
60
|
+
this,
|
|
61
|
+
() => {
|
|
62
|
+
const b = new g().retain(r.offset(this)).retain({ [r.statics.blotName]: h });
|
|
63
|
+
return this.editor.update(b, [], y);
|
|
64
|
+
},
|
|
65
|
+
d.sources.USER
|
|
66
|
+
);
|
|
67
|
+
}, M(), tt(), this.elements = t, this.options = et(
|
|
68
|
+
H(this.elements?.container),
|
|
69
|
+
e
|
|
70
|
+
), this.container = this.options.container, this.container == null) {
|
|
71
|
+
E.error("Invalid Rich container", this.container);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
this.options.debug && d.debug(this.options.debug);
|
|
75
|
+
const s = this.container.innerHTML.trim();
|
|
76
|
+
this.container.classList.add(`${p}-container`), this.container.innerHTML = "", R.set(this.container, this), this.root = this.addContainer(`${p}-editor`), this.root.classList.add(`${p}-blank`), this.emitter = new l();
|
|
77
|
+
const i = Q.blotName, o = this.options.registry.query(i);
|
|
78
|
+
if (!o || !("blotName" in o))
|
|
79
|
+
throw new Error(
|
|
80
|
+
`Cannot initialize Rich without "${i}" blot`
|
|
81
|
+
);
|
|
82
|
+
if (this.scroll = new o(this.options.registry, this.root, {
|
|
83
|
+
emitter: this.emitter
|
|
84
|
+
}), this.editor = new X(this.scroll), this.selection = new K(this.scroll, this.emitter), this.options.readOnly || (this.composition = new q(this.scroll, this.emitter), this.theme = new this.options.theme(this, this.options), this.keyboard = this.theme.addModule("keyboard"), this.clipboard = this.theme.addModule("clipboard"), this.history = this.theme.addModule("history"), this.uploader = this.theme.addModule("uploader"), this.theme.addModule("input"), this.theme.addModule("uiNode"), this.theme.init(), this.emitter.on(l.events.EDITOR_CHANGE, this.editorChange), this.emitter.on(l.events.SCROLL_UPDATE, this.scrollUpdate), this.emitter.on(
|
|
85
|
+
l.events.SCROLL_EMBED_UPDATE,
|
|
86
|
+
this.scrollEmbedUpdate
|
|
87
|
+
)), s && this.clipboard) {
|
|
88
|
+
const r = this.clipboard.convert({
|
|
89
|
+
html: `${s}<p><br></p>`,
|
|
90
|
+
text: `
|
|
91
|
+
`
|
|
92
|
+
});
|
|
93
|
+
this.setContents(r);
|
|
94
|
+
}
|
|
95
|
+
this.history && this.history.clear(), this.options.placeholder && this.root.setAttribute("data-placeholder", this.options.placeholder), this.options.readOnly && this.disable(), this.allowReadOnlyEdits = !1;
|
|
96
|
+
}
|
|
44
97
|
static {
|
|
45
98
|
this.DEFAULTS = {
|
|
46
99
|
bounds: null,
|
|
@@ -64,84 +117,34 @@ class f {
|
|
|
64
117
|
}
|
|
65
118
|
static {
|
|
66
119
|
this.imports = {
|
|
67
|
-
delta:
|
|
120
|
+
delta: g,
|
|
68
121
|
parchment: G,
|
|
69
122
|
"core/module": z,
|
|
70
|
-
"core/theme":
|
|
123
|
+
"core/theme": F
|
|
71
124
|
};
|
|
72
125
|
}
|
|
73
126
|
static debug(t) {
|
|
74
|
-
t === !0 && (t = "log"),
|
|
127
|
+
t === !0 && (t = "log"), P.level(t);
|
|
75
128
|
}
|
|
76
129
|
static find(t, e = !1) {
|
|
77
130
|
return R.get(t) || L.find(t, e);
|
|
78
131
|
}
|
|
79
132
|
static import(t) {
|
|
80
|
-
return this.imports[t]
|
|
133
|
+
return this.imports[t] || E.error(`Cannot import ${t}. Are you sure it was registered?`), this.imports[t];
|
|
81
134
|
}
|
|
82
135
|
static register(...t) {
|
|
83
|
-
if (
|
|
136
|
+
if (w(t[0])) {
|
|
84
137
|
const e = t[0], s = t[1], i = !!t[2];
|
|
85
|
-
this.imports[e] != null && !i && E.warn(`Overwriting ${e} with`, s), this.imports[e] = s, ["blots/", "formats/"].some((
|
|
138
|
+
this.imports[e] != null && !i && E.warn(`Overwriting ${e} with`, s), this.imports[e] = s, ["blots/", "formats/"].some((o) => e.startsWith(o)) && s && !_(s) && s.blotName !== "abstract" && L.register(s), $(s.register) && s.register(L);
|
|
86
139
|
} else {
|
|
87
140
|
const e = t[0], s = !!t[1], i = "attrName" in e ? e.attrName : e.blotName;
|
|
88
|
-
|
|
89
|
-
this.register(
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
constructor(t, e = {}) {
|
|
94
|
-
if (N(), tt(), this.elements = t, this.options = et(
|
|
95
|
-
k(this.elements.container),
|
|
96
|
-
e
|
|
97
|
-
), this.container = this.options.container, this.container == null) {
|
|
98
|
-
E.error("Invalid Rich container", this.container);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
this.options.debug && f.debug(this.options.debug);
|
|
102
|
-
const s = this.container.innerHTML.trim();
|
|
103
|
-
this.container.classList.add(`${g}-container`), this.container.innerHTML = "", R.set(this.container, this), this.root = this.addContainer(`${g}-editor`), this.root.classList.add(`${g}-blank`), this.emitter = new l();
|
|
104
|
-
const i = Z.blotName, r = this.options.registry.query(i);
|
|
105
|
-
if (!r || !("blotName" in r))
|
|
106
|
-
throw new Error(
|
|
107
|
-
`Cannot initialize Rich without "${i}" blot`
|
|
108
|
-
);
|
|
109
|
-
if (this.scroll = new r(this.options.registry, this.root, {
|
|
110
|
-
emitter: this.emitter
|
|
111
|
-
}), this.editor = new X(this.scroll), this.selection = new K(this.scroll, this.emitter), this.composition = new q(this.scroll, this.emitter), this.theme = new this.options.theme(this, this.options), this.keyboard = this.theme.addModule("keyboard"), this.clipboard = this.theme.addModule("clipboard"), this.history = this.theme.addModule("history"), this.uploader = this.theme.addModule("uploader"), this.theme.addModule("input"), this.theme.addModule("uiNode"), this.theme.init(), this.emitter.on(l.events.EDITOR_CHANGE, (o) => {
|
|
112
|
-
o === l.events.TEXT_CHANGE && this.root.classList.toggle(
|
|
113
|
-
`${g}-blank`,
|
|
114
|
-
this.editor.isBlank()
|
|
115
|
-
);
|
|
116
|
-
}), this.emitter.on(l.events.SCROLL_UPDATE, (o, c) => {
|
|
117
|
-
const d = this.selection.lastRange, [h] = this.selection.getRange(), w = d && h ? { oldRange: d, newRange: h } : void 0;
|
|
118
|
-
a.call(
|
|
119
|
-
this,
|
|
120
|
-
() => this.editor.update(null, c, w),
|
|
121
|
-
o
|
|
122
|
-
);
|
|
123
|
-
}), this.emitter.on(l.events.SCROLL_EMBED_UPDATE, (o, c) => {
|
|
124
|
-
const d = this.selection.lastRange, [h] = this.selection.getRange(), w = d && h ? { oldRange: d, newRange: h } : void 0;
|
|
125
|
-
a.call(
|
|
126
|
-
this,
|
|
127
|
-
() => {
|
|
128
|
-
const b = new p().retain(o.offset(this)).retain({ [o.statics.blotName]: c });
|
|
129
|
-
return this.editor.update(b, [], w);
|
|
130
|
-
},
|
|
131
|
-
f.sources.USER
|
|
132
|
-
);
|
|
133
|
-
}), s) {
|
|
134
|
-
const o = this.clipboard.convert({
|
|
135
|
-
html: `${s}<p><br></p>`,
|
|
136
|
-
text: `
|
|
137
|
-
`
|
|
141
|
+
w(i) ? this.register(`formats/${i}`, e, s) : Object.entries(e).forEach(([o, r], h, m) => {
|
|
142
|
+
this.register(o, r, s);
|
|
138
143
|
});
|
|
139
|
-
this.setContents(o);
|
|
140
144
|
}
|
|
141
|
-
this.history.clear(), this.options.placeholder && this.root.setAttribute("data-placeholder", this.options.placeholder), this.options.readOnly && this.disable(), this.allowReadOnlyEdits = !1;
|
|
142
145
|
}
|
|
143
146
|
addContainer(t, e = null, s) {
|
|
144
|
-
if (
|
|
147
|
+
if (w(t)) {
|
|
145
148
|
const i = t;
|
|
146
149
|
t = document.createElement("div"), t.classList.add(i);
|
|
147
150
|
}
|
|
@@ -151,7 +154,7 @@ class f {
|
|
|
151
154
|
this.selection.setRange(null);
|
|
152
155
|
}
|
|
153
156
|
deleteText(t, e, s) {
|
|
154
|
-
return [t, e, , s] =
|
|
157
|
+
return [t, e, , s] = f(t, e, s), a.call(
|
|
155
158
|
this,
|
|
156
159
|
() => this.editor.deleteText(t, e),
|
|
157
160
|
s,
|
|
@@ -169,7 +172,7 @@ class f {
|
|
|
169
172
|
}
|
|
170
173
|
enable(t = !0) {
|
|
171
174
|
this.scroll.enable(t), this.container.classList.toggle(
|
|
172
|
-
`${
|
|
175
|
+
`${p}-disabled`,
|
|
173
176
|
!t
|
|
174
177
|
);
|
|
175
178
|
}
|
|
@@ -180,54 +183,54 @@ class f {
|
|
|
180
183
|
return a.call(
|
|
181
184
|
this,
|
|
182
185
|
() => {
|
|
183
|
-
const
|
|
184
|
-
let
|
|
185
|
-
if (
|
|
186
|
-
return
|
|
187
|
-
if (this.scroll.query(t,
|
|
188
|
-
|
|
186
|
+
const o = this.getSelection(!0);
|
|
187
|
+
let r = new g();
|
|
188
|
+
if (o == null)
|
|
189
|
+
return r;
|
|
190
|
+
if (this.scroll.query(t, Z.BLOCK))
|
|
191
|
+
r = this.editor.formatLine(o.index, o.length, {
|
|
189
192
|
[t]: e
|
|
190
193
|
});
|
|
191
194
|
else {
|
|
192
|
-
if (
|
|
193
|
-
return this.selection.format(t, e),
|
|
194
|
-
|
|
195
|
+
if (o.length === 0)
|
|
196
|
+
return this.selection.format(t, e), r;
|
|
197
|
+
r = this.editor.formatText(o.index, o.length, {
|
|
195
198
|
[t]: e
|
|
196
199
|
});
|
|
197
200
|
}
|
|
198
|
-
return this.setSelection(
|
|
201
|
+
return this.setSelection(o, l.sources.SILENT), r;
|
|
199
202
|
},
|
|
200
203
|
s
|
|
201
204
|
);
|
|
202
205
|
}
|
|
203
|
-
formatLine(t, e, s, i,
|
|
204
|
-
let
|
|
205
|
-
return [t, e,
|
|
206
|
+
formatLine(t, e, s, i, o) {
|
|
207
|
+
let r;
|
|
208
|
+
return [t, e, r, o] = f(
|
|
206
209
|
t,
|
|
207
210
|
e,
|
|
208
211
|
s,
|
|
209
212
|
i,
|
|
210
|
-
|
|
213
|
+
o
|
|
211
214
|
), a.call(
|
|
212
215
|
this,
|
|
213
|
-
() => this.editor.formatLine(t, e,
|
|
214
|
-
|
|
216
|
+
() => this.editor.formatLine(t, e, r),
|
|
217
|
+
o,
|
|
215
218
|
t,
|
|
216
219
|
0
|
|
217
220
|
);
|
|
218
221
|
}
|
|
219
|
-
formatText(t, e, s, i,
|
|
220
|
-
let
|
|
221
|
-
return [t, e,
|
|
222
|
+
formatText(t, e, s, i, o) {
|
|
223
|
+
let r;
|
|
224
|
+
return [t, e, r, o] = f(
|
|
222
225
|
t,
|
|
223
226
|
e,
|
|
224
227
|
s,
|
|
225
228
|
i,
|
|
226
|
-
|
|
229
|
+
o
|
|
227
230
|
), a.call(
|
|
228
231
|
this,
|
|
229
|
-
() => this.editor.formatText(t, e,
|
|
230
|
-
|
|
232
|
+
() => this.editor.formatText(t, e, r),
|
|
233
|
+
o,
|
|
231
234
|
t,
|
|
232
235
|
0
|
|
233
236
|
);
|
|
@@ -246,7 +249,7 @@ class f {
|
|
|
246
249
|
};
|
|
247
250
|
}
|
|
248
251
|
getContents(t = 0, e = this.getLength() - t) {
|
|
249
|
-
return [t, e] =
|
|
252
|
+
return [t, e] = f(t, e), this.editor.getContents(t, e);
|
|
250
253
|
}
|
|
251
254
|
getFormat(t = this.getSelection(!0), e = 0) {
|
|
252
255
|
return u(t) ? this.editor.getFormat(t, e) : this.editor.getFormat(t.index, t.length);
|
|
@@ -273,15 +276,15 @@ class f {
|
|
|
273
276
|
return t && this.focus(), this.update(), this.selection.getRange()[0];
|
|
274
277
|
}
|
|
275
278
|
getSemanticHTML(t = 0, e) {
|
|
276
|
-
return u(t) && (e = e ?? this.getLength() - t), [t, e] =
|
|
279
|
+
return u(t) && (e = e ?? this.getLength() - t), [t, e] = f(t, e), this.editor.getHTML(t, e);
|
|
277
280
|
}
|
|
278
281
|
getText(t = 0, e) {
|
|
279
|
-
return u(t) && (e = e ?? this.getLength() - t), [t, e] =
|
|
282
|
+
return u(t) && (e = e ?? this.getLength() - t), [t, e] = f(t, e), this.editor.getText(t, e);
|
|
280
283
|
}
|
|
281
284
|
hasFocus() {
|
|
282
285
|
return this.selection.hasFocus();
|
|
283
286
|
}
|
|
284
|
-
insertEmbed(t, e, s, i =
|
|
287
|
+
insertEmbed(t, e, s, i = d.sources.API) {
|
|
285
288
|
return a.call(
|
|
286
289
|
this,
|
|
287
290
|
() => this.editor.insertEmbed(t, e, s),
|
|
@@ -289,12 +292,12 @@ class f {
|
|
|
289
292
|
t
|
|
290
293
|
);
|
|
291
294
|
}
|
|
292
|
-
insertText(t, e, s, i,
|
|
293
|
-
let
|
|
294
|
-
return [t, ,
|
|
295
|
+
insertText(t, e, s, i, o) {
|
|
296
|
+
let r;
|
|
297
|
+
return [t, , r, o] = f(t, 0, s, i, o), a.call(
|
|
295
298
|
this,
|
|
296
|
-
() => this.editor.insertText(t, e,
|
|
297
|
-
|
|
299
|
+
() => this.editor.insertText(t, e, r),
|
|
300
|
+
o,
|
|
298
301
|
t,
|
|
299
302
|
e.length
|
|
300
303
|
);
|
|
@@ -302,20 +305,20 @@ class f {
|
|
|
302
305
|
isEnabled() {
|
|
303
306
|
return this.scroll.isEnabled();
|
|
304
307
|
}
|
|
305
|
-
off(...t) {
|
|
306
|
-
return this.emitter.off(...t);
|
|
307
|
-
}
|
|
308
|
-
offAll() {
|
|
309
|
-
return this.emitter.offAll();
|
|
310
|
-
}
|
|
311
308
|
on(...t) {
|
|
312
309
|
return this.emitter.on(...t);
|
|
313
310
|
}
|
|
314
311
|
once(...t) {
|
|
315
312
|
return this.emitter.once(...t);
|
|
316
313
|
}
|
|
314
|
+
off(...t) {
|
|
315
|
+
return this.emitter.off(...t);
|
|
316
|
+
}
|
|
317
|
+
offAll() {
|
|
318
|
+
return this.emitter.offAll();
|
|
319
|
+
}
|
|
317
320
|
removeFormat(t, e, s) {
|
|
318
|
-
return [t, e, , s] =
|
|
321
|
+
return [t, e, , s] = f(t, e, s), a.call(
|
|
319
322
|
this,
|
|
320
323
|
() => this.editor.removeFormat(t, e),
|
|
321
324
|
s,
|
|
@@ -345,18 +348,18 @@ class f {
|
|
|
345
348
|
return a.call(
|
|
346
349
|
this,
|
|
347
350
|
() => {
|
|
348
|
-
t = new
|
|
349
|
-
const s = this.getLength(), i = this.editor.deleteText(0, s),
|
|
350
|
-
return i.compose(
|
|
351
|
+
t = new g(t);
|
|
352
|
+
const s = this.getLength(), i = this.editor.deleteText(0, s), o = this.editor.insertContents(0, t), r = this.editor.deleteText(this.getLength() - 1, 1);
|
|
353
|
+
return i.compose(o).compose(r);
|
|
351
354
|
},
|
|
352
355
|
e
|
|
353
356
|
);
|
|
354
357
|
}
|
|
355
358
|
setSelection(t, e, s) {
|
|
356
|
-
t == null ? this.selection.setRange(null, e ||
|
|
359
|
+
t == null ? this.selection.setRange(null, e || d.sources.API) : ([t, e, , s] = f(t, e, s), this.selection.setRange(new B(Math.max(0, t), e), s), s !== l.sources.SILENT && this.scrollSelectionIntoView());
|
|
357
360
|
}
|
|
358
361
|
setText(t, e = l.sources.API) {
|
|
359
|
-
const s = new
|
|
362
|
+
const s = new g().insert(t);
|
|
360
363
|
return this.setContents(s, e);
|
|
361
364
|
}
|
|
362
365
|
update(t = l.sources.USER) {
|
|
@@ -366,24 +369,27 @@ class f {
|
|
|
366
369
|
updateContents(t, e = l.sources.API) {
|
|
367
370
|
return a.call(
|
|
368
371
|
this,
|
|
369
|
-
() => (t = new
|
|
372
|
+
() => (t = new g(t), this.editor.applyDelta(t)),
|
|
370
373
|
e,
|
|
371
374
|
!0
|
|
372
375
|
);
|
|
373
376
|
}
|
|
374
377
|
destroy() {
|
|
375
|
-
this.
|
|
378
|
+
this.scroll && this.scroll.destroy(), this.editor && this.editor.destroy(), this.selection && this.selection.destroy(), this.composition && this.composition.destroy(), this.theme && this.theme.destroy(), this.keyboard && this.keyboard.destroy(), this.clipboard && this.clipboard.destroy(), this.history && this.history.destroy(), this.uploader && this.uploader.destroy(), this.options.readOnly, this.emitter.off(l.events.EDITOR_CHANGE, this.editorChange), this.emitter.off(l.events.SCROLL_UPDATE, this.scrollUpdate), this.emitter.off(
|
|
379
|
+
l.events.SCROLL_EMBED_UPDATE,
|
|
380
|
+
this.scrollEmbedUpdate
|
|
381
|
+
), this.emitter.destroy(), this.offAll(), setTimeout(() => {
|
|
376
382
|
const t = document.querySelectorAll(
|
|
377
|
-
`.${
|
|
383
|
+
`.${p}-container`
|
|
378
384
|
);
|
|
379
|
-
Array.from(t).length ||
|
|
380
|
-
}, 27), R.delete(this.container)
|
|
385
|
+
Array.from(t).length || M();
|
|
386
|
+
}, 27), R.delete(this.container);
|
|
381
387
|
}
|
|
382
388
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
389
|
+
function U(n) {
|
|
390
|
+
return w(n) ? document.querySelector(n) : n;
|
|
385
391
|
}
|
|
386
|
-
function
|
|
392
|
+
function C(n) {
|
|
387
393
|
return Object.entries(n ?? {}).reduce(
|
|
388
394
|
(t, [e, s]) => ({
|
|
389
395
|
...t,
|
|
@@ -398,78 +404,78 @@ function D(n) {
|
|
|
398
404
|
);
|
|
399
405
|
}
|
|
400
406
|
function et(n, t) {
|
|
401
|
-
const e =
|
|
407
|
+
const e = U(n);
|
|
402
408
|
if (!e)
|
|
403
409
|
throw new Error("Invalid Rich container");
|
|
404
|
-
const i = !t.theme || t.theme ===
|
|
405
|
-
if (!i)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
let
|
|
409
|
-
|
|
410
|
-
...
|
|
411
|
-
toolbar: { container:
|
|
410
|
+
const i = !t.theme || t.theme === d.DEFAULTS.theme ? d.import("themes/default") ?? F : d.import(`themes/${t.theme}`);
|
|
411
|
+
if (!i) throw new Error(`Invalid theme ${t.theme}. Did you register it?`);
|
|
412
|
+
const { modules: o, ...r } = d.DEFAULTS, { modules: h, ...m } = i.DEFAULTS;
|
|
413
|
+
o.clipboard = o.uploader = o.history = o.keyboard = !t.readOnly;
|
|
414
|
+
let c = C(t.modules);
|
|
415
|
+
c != null && c.toolbar && c.toolbar.constructor !== Object && (c = {
|
|
416
|
+
...c,
|
|
417
|
+
toolbar: { container: c.toolbar }
|
|
412
418
|
});
|
|
413
|
-
const
|
|
419
|
+
const y = v(
|
|
414
420
|
{},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
421
|
+
C(o),
|
|
422
|
+
C(h),
|
|
423
|
+
c
|
|
418
424
|
), b = {
|
|
419
|
-
...
|
|
420
|
-
...D(
|
|
425
|
+
...r,
|
|
426
|
+
...D(m),
|
|
421
427
|
...D(t)
|
|
422
428
|
};
|
|
423
|
-
let
|
|
424
|
-
return
|
|
429
|
+
let T = t.registry;
|
|
430
|
+
return T ? t.formats && E.warn('Ignoring "formats" option because "registry" is specified') : T = t.formats ? W(t.formats, b.registry, E) : b.registry, {
|
|
425
431
|
...b,
|
|
426
|
-
registry:
|
|
432
|
+
registry: T,
|
|
427
433
|
container: e,
|
|
428
434
|
theme: i,
|
|
429
|
-
modules: Object.entries(
|
|
430
|
-
(
|
|
431
|
-
if (!
|
|
432
|
-
const
|
|
433
|
-
return
|
|
435
|
+
modules: Object.entries(y).reduce(
|
|
436
|
+
(S, [A, I]) => {
|
|
437
|
+
if (!I) return S;
|
|
438
|
+
const O = d.import(`modules/${A}`);
|
|
439
|
+
return O == null ? (E.error(
|
|
434
440
|
`Cannot load ${A} module. Are you sure you registered it?`
|
|
435
|
-
),
|
|
436
|
-
...
|
|
437
|
-
[A]:
|
|
441
|
+
), S) : {
|
|
442
|
+
...S,
|
|
443
|
+
[A]: v({}, O.DEFAULTS || {}, I)
|
|
438
444
|
};
|
|
439
445
|
},
|
|
440
446
|
{}
|
|
441
447
|
),
|
|
442
|
-
bounds:
|
|
448
|
+
bounds: U(b.bounds)
|
|
443
449
|
};
|
|
444
450
|
}
|
|
445
451
|
function a(n, t, e, s) {
|
|
446
452
|
if (!this.isEnabled() && t === l.sources.USER && !this.allowReadOnlyEdits)
|
|
447
|
-
return new
|
|
453
|
+
return new g();
|
|
448
454
|
let i = e == null ? null : this.getSelection();
|
|
449
|
-
const
|
|
450
|
-
if (i != null && (e === !0 && (e = i.index), s == null ? i =
|
|
451
|
-
const
|
|
452
|
-
this.emitter.emit(l.events.EDITOR_CHANGE, ...
|
|
455
|
+
const o = this.editor.delta, r = n();
|
|
456
|
+
if (i != null && (e === !0 && (e = i.index), s == null ? i = N(i, r, t) : s !== 0 && (i = N(i, e, s, t)), this.setSelection(i, l.sources.SILENT)), r.length() > 0) {
|
|
457
|
+
const h = [l.events.TEXT_CHANGE, r, o, t];
|
|
458
|
+
this.emitter.emit(l.events.EDITOR_CHANGE, ...h), t !== l.sources.SILENT && this.emitter.emit(...h);
|
|
453
459
|
}
|
|
454
|
-
return
|
|
460
|
+
return r;
|
|
455
461
|
}
|
|
456
|
-
function
|
|
457
|
-
let
|
|
458
|
-
return u(n.index) && u(n.length) ? u(t) ? (t = n.length, n = n.index) : (i = s, s = e, e = t, t = n.length, n = n.index) : u(t) || (i = s, s = e, e = t, t = 0), j(e) ? (
|
|
462
|
+
function f(n, t, e, s, i) {
|
|
463
|
+
let o = {};
|
|
464
|
+
return u(n.index) && u(n.length) ? u(t) ? (t = n.length, n = n.index) : (i = s, s = e, e = t, t = n.length, n = n.index) : u(t) || (i = s, s = e, e = t, t = 0), j(e) ? (o = e, i = s) : w(e) && (s != null ? o[e] = s : i = e), i = i || l.sources.API, [n, t, o, i];
|
|
459
465
|
}
|
|
460
|
-
function
|
|
466
|
+
function N(n, t, e, s) {
|
|
461
467
|
const i = u(e) ? e : 0;
|
|
462
468
|
if (n == null) return null;
|
|
463
|
-
let
|
|
464
|
-
return t &&
|
|
465
|
-
(
|
|
466
|
-
) : [
|
|
469
|
+
let o, r;
|
|
470
|
+
return t && $(t.transformPosition) ? [o, r] = [n.index, n.index + n.length].map(
|
|
471
|
+
(h) => t.transformPosition(h, s !== l.sources.USER)
|
|
472
|
+
) : [o, r] = [n.index, n.index + n.length].map((h) => h < t || h === t && s === l.sources.USER ? h : i >= 0 ? h + i : Math.max(t, h + i)), new B(o, r - o);
|
|
467
473
|
}
|
|
468
474
|
export {
|
|
469
475
|
G as Parchment,
|
|
470
476
|
B as Range,
|
|
471
|
-
|
|
477
|
+
d as default,
|
|
472
478
|
et as expandConfig,
|
|
473
479
|
L as globalRegistry,
|
|
474
|
-
|
|
480
|
+
f as overload
|
|
475
481
|
};
|