useblocks 1.1.85-dev.9 → 1.1.102
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/CHANGELOG.md +91 -0
- package/README.md +74 -41
- package/compat-globals.js +1 -1
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +35 -1
- package/iframe/{iframe.bb6d921f.html → iframe-eblock.1c4e77a0.html} +2 -2
- package/iframe/{iframe-eblock.bb6d921f.html → iframe.1c4e77a0.html} +2 -2
- package/iframe/js/discussHandlers.Xh4-JUcT.js +88 -0
- package/iframe/js/{iframe-eblock.body.js → iframe-eblock.body.1c4e77a0.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.1c4e77a0.js +319 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +8 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +49 -42
- package/runtime/package.json +4 -1
- package/runtime/react/index.js +1 -1
- package/runtime/uuid/index.js +21 -0
- package/static/core/11b821ed.js +1 -0
- package/static/core/160bf060.js +104 -0
- package/static/core/1b68c0f0.js +1 -0
- package/static/core/1ed86ed3.js +1 -0
- package/static/core/26cc947d.js +1 -0
- package/static/core/{67f78cad.js → 3ec42945.js} +7 -7
- package/static/core/3fb172c7.js +1 -0
- package/static/core/448f03f8.js +1 -0
- package/static/core/44d2c046.js +1 -0
- package/static/core/{79749848.js → 4c8d0155.js} +5 -5
- package/static/core/53103851.js +4 -0
- package/static/core/{a767f327.js → 5d849eef.js} +1 -1
- package/static/core/5e7c221f.js +28 -0
- package/static/core/64be048b.js +27 -0
- package/static/core/{de07cade.js → 6a671446.js} +3 -3
- package/static/core/{db82c42b.js → 756874c6.js} +1 -1
- package/static/core/{4c3f5897.js → 847338a8.js} +2 -2
- package/static/core/91e07171.js +2 -0
- package/static/core/a2e57e5f.js +1 -0
- package/static/core/{a5996860.js → a6303cb2.js} +1 -1
- package/static/core/{9f137764.js → a98b6879.js} +1 -1
- package/static/core/ae22b7f6.js +93 -0
- package/static/core/{44a83e21.js → b653f9c5.js} +1 -1
- package/static/core/{cb46784e.js → b7aa9fec.js} +1 -1
- package/static/core/{d8bbcfbd.js → ca4dad9b.js} +2 -2
- package/static/core/{6faa23a1.js → cc180859.js} +1 -1
- package/static/core/d7666ad0.js +291 -0
- package/static/core/dcc37768.js +1 -0
- package/static/core/edf450a1.js +7 -0
- package/static/core/f1ee2bef.js +1 -0
- package/static/core/{1e3078da.js → f323e60e.js} +1 -1
- package/static/core/{175b5b0f.js → ff7d14e8.js} +1 -1
- package/static/esm/2490dab8.js +1 -0
- package/static/esm/668ee399.js +1 -0
- package/static/esm/971f1b2c.js +1 -0
- package/static/esm/f76c9d9d.js +1 -0
- package/static/umd/6639d610.js +1 -0
- package/static/umd-runtime/B7h7P1Np.js +1 -0
- package/static/umd-runtime/{DHIkHsbq.js → BAqQTgiL.js} +1 -1
- package/static/umd-runtime/{DiNHpyis.js → BB6AXfHj.js} +1 -1
- package/static/umd-runtime/{CnUGCoaH.js → BauvM4c_.js} +1 -1
- package/static/umd-runtime/{cL_ha9ef.js → CgVJ4rE0.js} +1 -1
- package/static/umd-runtime/Cvm7BS4_.js +341 -0
- package/static/umd-runtime/{BnE05QKl.js → D7DggGzi.js} +1 -1
- package/static/umd-runtime/{2iAslXEF.js → DBbch1O-.js} +1 -1
- package/static/umd-runtime/{Bcqtk2f7.js → Dqoi-pC_.js} +2 -2
- package/static/umd-runtime/{CDTBLHGd.js → G2k8ELiO.js} +3 -3
- package/static/umd-runtime/{CVtPwspX.js → SFp4nbvq.js} +1 -1
- package/static/umd-runtime/{DVB_-O4B.js → UsRzAWs2.js} +1 -1
- package/static/umd-runtime/runtime.2paN090q.js +1 -0
- package/static/umd-runtime/{ui-kit-icons.js → ui-kit-icons.DqlZwgBU.js} +1 -1
- package/static/umd-runtime/{ui-kit.js → ui-kit.CoVNet0I.js} +2 -2
- package/static/umd-runtime/{DP3QTW77.js → uk9LyZos.js} +1 -1
- package/ui-kit/icons.js +2 -0
- package/useblocks-core.1c4e77a0.js +859 -0
- package/useblocks-esm.js +11 -10
- package/{useblocks-po.bb6d921f.js → useblocks-po.1c4e77a0.js} +1 -1
- package/useblocks.d.ts +162 -28
- package/useblocks.js +39 -15
- package/vendor/@rc-component/cascader/package.json +1 -1
- package/vendor/@rc-component/dialog/es/Dialog/Content/Panel.js +3 -2
- package/vendor/@rc-component/dialog/package.json +1 -1
- package/vendor/@rc-component/image/es/Preview/index.js +3 -3
- package/vendor/@rc-component/image/package.json +1 -1
- package/vendor/@rc-component/input/es/BaseInput.js +3 -3
- package/vendor/@rc-component/input/es/Input.js +20 -27
- package/vendor/@rc-component/{textarea → input}/es/ResizableTextArea.js +5 -4
- package/vendor/@rc-component/{textarea → input}/es/TextArea.js +30 -40
- package/vendor/@rc-component/{textarea → input}/es/calculateNodeHeight.js +4 -4
- package/vendor/@rc-component/input/es/hooks/useCountDisplay.js +25 -0
- package/vendor/@rc-component/input/es/hooks/useCountExceed.js +25 -0
- package/vendor/@rc-component/input/es/hooks/useMergedValue.js +13 -0
- package/vendor/@rc-component/input/es/index.js +3 -1
- package/vendor/@rc-component/input/package.json +1 -1
- package/vendor/@rc-component/mentions/es/DropdownMenu.js +1 -1
- package/vendor/@rc-component/mentions/es/Mentions.js +35 -8
- package/vendor/@rc-component/mentions/package.json +1 -1
- package/vendor/@rc-component/menu/es/Menu.js +1 -0
- package/vendor/@rc-component/menu/es/MenuItem.js +1 -0
- package/vendor/@rc-component/menu/es/MenuItemGroup.js +1 -0
- package/vendor/@rc-component/menu/es/SubMenu/PopupTrigger.js +1 -0
- package/vendor/@rc-component/menu/es/SubMenu/index.js +1 -0
- package/vendor/@rc-component/menu/es/context/MenuContext.js +1 -0
- package/vendor/@rc-component/menu/es/hooks/useAccessibility.js +1 -0
- package/vendor/@rc-component/menu/es/hooks/useKeyRecords.js +1 -0
- package/vendor/@rc-component/menu/es/utils/commonUtil.js +1 -0
- package/vendor/@rc-component/menu/es/utils/nodeUtil.js +2 -1
- package/vendor/@rc-component/menu/es/utils/warnUtil.js +1 -0
- package/vendor/@rc-component/menu/package.json +1 -1
- package/vendor/@rc-component/notification/LICENSE +21 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/LICENSE +22 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Children/toArray.js +15 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/canUseDom.js +6 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/contains.js +13 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/dynamicCSS.js +94 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/findDOMNode.js +14 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/focus.js +99 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/isVisible.js +18 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/shadow.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Dom/styleChecker.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/KeyCode.js +499 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/Portal.js +28 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/React/isFragment.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/React/render.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/getScrollBarSize.js +2 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useControlledState.js +3 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useDelayState.js +4 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useEvent.js +9 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useId.js +23 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useLayoutEffect.js +26 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMemo.js +12 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useMergedState.js +4 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useState.js +24 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/hooks/useSyncState.js +20 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/index.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/is.js +21 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/isEqual.js +35 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/isMobile.js +11 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/mergeProps.js +14 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/omit.js +1 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/pickAttrs.js +50 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/proxyObject.js +1 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/raf.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/ref.js +38 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/test/domHook.js +36 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/get.js +11 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/utils/set.js +58 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/es/warning.js +46 -0
- package/vendor/@rc-component/notification/_/@rc-component/util/package.json +6 -0
- package/vendor/@rc-component/notification/es/Notification.js +129 -0
- package/vendor/@rc-component/notification/es/NotificationList/Content.js +33 -0
- package/vendor/@rc-component/notification/es/NotificationList/index.js +174 -0
- package/vendor/@rc-component/notification/es/NotificationProvider.js +4 -3
- package/vendor/@rc-component/notification/es/Notifications.js +28 -31
- package/vendor/@rc-component/notification/es/Progress.js +10 -0
- package/vendor/@rc-component/notification/es/hooks/useClosable.js +30 -0
- package/vendor/@rc-component/notification/es/hooks/useListPosition/index.js +50 -0
- package/vendor/@rc-component/notification/es/hooks/useListPosition/useSizes.js +33 -0
- package/vendor/@rc-component/notification/es/hooks/useNoticeTimer.js +58 -0
- package/vendor/@rc-component/notification/es/hooks/useNotification.js +27 -18
- package/vendor/@rc-component/notification/es/hooks/useStack.js +4 -4
- package/vendor/@rc-component/notification/es/index.js +4 -2
- package/vendor/@rc-component/notification/package.json +1 -1
- package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/MultipleDates.js +13 -3
- package/vendor/@rc-component/picker/es/PickerInput/Selector/SingleSelector/index.js +3 -1
- package/vendor/@rc-component/picker/es/PickerInput/SinglePicker.js +2 -1
- package/vendor/@rc-component/picker/package.json +1 -1
- package/vendor/@rc-component/table/LICENSE +21 -0
- package/vendor/@rc-component/table/es/Body/MeasureCell.js +1 -0
- package/vendor/@rc-component/table/es/Body/MeasureRow.js +1 -0
- package/vendor/@rc-component/table/es/Cell/useCellRender.js +1 -0
- package/vendor/@rc-component/table/es/FixedHolder/index.js +1 -0
- package/vendor/@rc-component/table/es/Table.js +17 -9
- package/vendor/@rc-component/table/es/VirtualTable/BodyGrid.js +10 -4
- package/vendor/@rc-component/table/es/VirtualTable/BodyLine.js +13 -5
- package/vendor/@rc-component/table/es/hooks/useColumns/index.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useExpand.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useFixedInfo.js +1 -0
- package/vendor/@rc-component/table/es/hooks/useSticky.js +1 -0
- package/vendor/@rc-component/table/es/index.js +2 -1
- package/vendor/@rc-component/table/es/stickyScrollBar.js +1 -0
- package/vendor/@rc-component/table/es/utils/legacyUtil.js +1 -0
- package/vendor/@rc-component/table/es/utils/offsetUtil.js +1 -0
- package/vendor/@rc-component/table/package.json +1 -1
- package/vendor/@rc-component/tabs/es/TabNavList/OperationNode.js +4 -2
- package/vendor/@rc-component/tabs/es/TabNavList/TabNode.js +5 -4
- package/vendor/@rc-component/tabs/es/TabNavList/index.js +11 -4
- package/vendor/@rc-component/tabs/es/Tabs.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useAnimateConfig.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useIndicator.js +1 -0
- package/vendor/@rc-component/tabs/es/hooks/useUpdate.js +1 -0
- package/vendor/@rc-component/tabs/package.json +1 -1
- package/vendor/@rc-component/tour/es/TourStep/DefaultPanel.js +4 -1
- package/vendor/@rc-component/tour/package.json +1 -1
- package/vendor/@rc-component/tree/es/MotionTreeNode.js +1 -0
- package/vendor/@rc-component/tree/es/NodeList.js +2 -2
- package/vendor/@rc-component/tree/es/Tree.js +4 -5
- package/vendor/@rc-component/tree/es/TreeNode.js +7 -2
- package/vendor/@rc-component/tree/es/index.js +3 -0
- package/vendor/@rc-component/tree/es/useUnmount.js +1 -0
- package/vendor/@rc-component/tree/es/util.js +1 -0
- package/vendor/@rc-component/tree/es/utils/conductUtil.js +1 -0
- package/vendor/@rc-component/tree/es/utils/treeUtil.js +1 -0
- package/vendor/@rc-component/tree/package.json +1 -1
- package/vendor/@rc-component/tree-select/package.json +1 -1
- package/vendor/@rc-component/util/es/index.js +10 -10
- package/vendor/antd/es/_util/ActionButton.js +2 -3
- package/vendor/antd/es/_util/ContextIsolator.js +1 -1
- package/vendor/antd/es/_util/PurePanel.js +7 -4
- package/vendor/antd/es/_util/convertToTooltipProps.js +2 -2
- package/vendor/antd/es/_util/fallbackProp.js +15 -0
- package/vendor/antd/es/_util/gapSize.js +2 -1
- package/vendor/antd/es/_util/getRenderPropValue.js +2 -1
- package/vendor/antd/es/_util/getScroll.js +4 -4
- package/vendor/antd/es/_util/hooks/index.js +2 -2
- package/vendor/antd/es/_util/hooks/useAllowClear.js +25 -0
- package/vendor/antd/es/_util/hooks/useClosable.js +6 -5
- package/vendor/antd/es/_util/hooks/{useMergeSemantic.js → useMergeSemantic/index.js} +14 -24
- package/vendor/antd/es/_util/hooks/useMergeSemantic/utils.js +14 -0
- package/vendor/antd/es/_util/hooks/useMergedMask.js +2 -1
- package/vendor/antd/es/_util/is.js +27 -0
- package/vendor/antd/es/_util/motion.js +8 -8
- package/vendor/antd/es/_util/normalizeIcon.js +9 -0
- package/vendor/antd/es/_util/placements.js +2 -1
- package/vendor/antd/es/_util/reactNode.js +2 -1
- package/vendor/antd/es/_util/responsiveObserver.js +3 -2
- package/vendor/antd/es/_util/scrollTo.js +3 -1
- package/vendor/antd/es/_util/styleChecker.js +1 -0
- package/vendor/antd/es/_util/throttleByAnimationFrame.js +1 -0
- package/vendor/antd/es/_util/toList.js +1 -1
- package/vendor/antd/es/_util/wave/WaveEffect.js +3 -1
- package/vendor/antd/es/_util/wave/index.js +14 -4
- package/vendor/antd/es/_util/wave/util.js +5 -3
- package/vendor/antd/es/alert/Alert.js +12 -10
- package/vendor/antd/es/alert/ErrorBoundary.js +1 -1
- package/vendor/antd/es/alert/style/index.js +16 -10
- package/vendor/antd/es/anchor/Anchor.js +23 -16
- package/vendor/antd/es/anchor/AnchorLink.js +4 -4
- package/vendor/antd/es/app/App.js +7 -3
- package/vendor/antd/es/auto-complete/AutoComplete.js +7 -8
- package/vendor/antd/es/avatar/Avatar.js +5 -3
- package/vendor/antd/es/back-top/index.js +1 -0
- package/vendor/antd/es/badge/Badge.js +5 -6
- package/vendor/antd/es/badge/Ribbon.js +1 -2
- package/vendor/antd/es/badge/style/index.js +4 -3
- package/vendor/antd/es/border-beam/BorderBeam.js +42 -0
- package/vendor/antd/es/border-beam/BorderBeamEffect.js +24 -0
- package/vendor/antd/es/border-beam/hooks/useBorderSize.js +37 -0
- package/vendor/antd/es/border-beam/hooks/useChildDom.js +24 -0
- package/vendor/antd/es/border-beam/index.js +7 -0
- package/vendor/antd/es/border-beam/style/index.js +60 -0
- package/vendor/antd/es/border-beam/util.js +26 -0
- package/vendor/antd/es/breadcrumb/Breadcrumb.js +1 -2
- package/vendor/antd/es/breadcrumb/BreadcrumbItem.js +1 -1
- package/vendor/antd/es/breadcrumb/useItemRender.js +3 -2
- package/vendor/antd/es/button/Button.js +7 -6
- package/vendor/antd/es/button/buttonHelpers.js +4 -8
- package/vendor/antd/es/button/index.js +2 -2
- package/vendor/antd/es/button/style/index.js +5 -0
- package/vendor/antd/es/calendar/generateCalendar.js +20 -8
- package/vendor/antd/es/card/Card.js +5 -7
- package/vendor/antd/es/card/CardMeta.js +1 -2
- package/vendor/antd/es/carousel/index.js +2 -1
- package/vendor/antd/es/cascader/Panel.js +1 -1
- package/vendor/antd/es/cascader/index.js +23 -16
- package/vendor/antd/es/cascader/style/columns.js +6 -2
- package/vendor/antd/es/checkbox/Checkbox.js +2 -3
- package/vendor/antd/es/checkbox/Group.js +2 -1
- package/vendor/antd/es/checkbox/style/index.js +1 -5
- package/vendor/antd/es/checkbox/useBubbleLock.js +1 -0
- package/vendor/antd/es/collapse/Collapse.js +3 -3
- package/vendor/antd/es/collapse/style/index.js +1 -4
- package/vendor/antd/es/color-picker/ColorPicker.js +1 -2
- package/vendor/antd/es/color-picker/ColorPickerPanel.js +2 -1
- package/vendor/antd/es/color-picker/components/ColorTrigger.js +3 -1
- package/vendor/antd/es/color-picker/components/PanelPicker/index.js +1 -0
- package/vendor/antd/es/config-provider/hooks/useSize.js +3 -2
- package/vendor/antd/es/config-provider/hooks/useTheme.js +2 -0
- package/vendor/antd/es/config-provider/index.js +11 -3
- package/vendor/antd/es/date-picker/generatePicker/generateRangePicker.js +20 -10
- package/vendor/antd/es/date-picker/generatePicker/generateSinglePicker.js +17 -8
- package/vendor/antd/es/date-picker/generatePicker/useSuffixIcon.js +1 -1
- package/vendor/antd/es/date-picker/hooks/useMergedPickerSemantic.js +1 -2
- package/vendor/antd/es/date-picker/style/index.js +13 -3
- package/vendor/antd/es/date-picker/style/multiple.js +3 -4
- package/vendor/antd/es/date-picker/style/panel.js +5 -20
- package/vendor/antd/es/date-picker/util.js +14 -13
- package/vendor/antd/es/descriptions/Cell.js +2 -3
- package/vendor/antd/es/descriptions/hooks/useItems.js +2 -1
- package/vendor/antd/es/descriptions/index.js +3 -3
- package/vendor/antd/es/divider/index.js +3 -2
- package/vendor/antd/es/drawer/Drawer.js +10 -5
- package/vendor/antd/es/drawer/DrawerPanel.js +3 -2
- package/vendor/antd/es/dropdown/dropdown.js +11 -8
- package/vendor/antd/es/dropdown/style/index.js +2 -6
- package/vendor/antd/es/empty/index.js +1 -2
- package/vendor/antd/es/flex/index.js +2 -2
- package/vendor/antd/es/float-button/BackTop.js +1 -0
- package/vendor/antd/es/float-button/FloatButton.js +3 -3
- package/vendor/antd/es/float-button/FloatButtonGroup.js +2 -2
- package/vendor/antd/es/form/ErrorList.js +13 -6
- package/vendor/antd/es/form/Form.js +7 -6
- package/vendor/antd/es/form/FormItem/ItemHolder.js +1 -1
- package/vendor/antd/es/form/FormItem/index.js +6 -6
- package/vendor/antd/es/form/FormItemInput.js +5 -3
- package/vendor/antd/es/form/FormItemLabel.js +2 -1
- package/vendor/antd/es/form/FormList.js +1 -0
- package/vendor/antd/es/form/hooks/useChildren.js +4 -3
- package/vendor/antd/es/form/hooks/useForm.js +3 -1
- package/vendor/antd/es/form/hooks/useFrameState.js +1 -0
- package/vendor/antd/es/form/hooks/useItemRef.js +7 -5
- package/vendor/antd/es/form/style/index.js +1 -3
- package/vendor/antd/es/grid/col.js +5 -7
- package/vendor/antd/es/grid/hooks/useBreakpoint.js +1 -0
- package/vendor/antd/es/grid/hooks/useGutter.js +2 -1
- package/vendor/antd/es/grid/row.js +7 -6
- package/vendor/antd/es/image/PreviewGroup.js +1 -2
- package/vendor/antd/es/image/Progress.js +58 -0
- package/vendor/antd/es/image/hooks/useMergedPreviewConfig.js +3 -1
- package/vendor/antd/es/image/hooks/usePlaceholderConfig.js +15 -0
- package/vendor/antd/es/image/hooks/usePreviewConfig.js +3 -2
- package/vendor/antd/es/image/index.js +36 -5
- package/vendor/antd/es/image/style/index.js +114 -4
- package/vendor/antd/es/image/style/progressAnimation.js +26 -0
- package/vendor/antd/es/index.js +2 -1
- package/vendor/antd/es/input/Input.js +9 -4
- package/vendor/antd/es/input/OTP/OTPInput.js +1 -0
- package/vendor/antd/es/input/OTP/index.js +3 -3
- package/vendor/antd/es/input/Password.js +45 -26
- package/vendor/antd/es/input/Search.js +6 -5
- package/vendor/antd/es/input/TextArea.js +13 -7
- package/vendor/antd/es/input/style/index.js +17 -11
- package/vendor/antd/es/input/style/otp.js +2 -1
- package/vendor/antd/es/input/style/variants.js +16 -10
- package/vendor/antd/es/input-number/index.js +3 -3
- package/vendor/antd/es/input-number/style/index.js +9 -9
- package/vendor/antd/es/layout/Sider.js +3 -2
- package/vendor/antd/es/list/index.js +5 -3
- package/vendor/antd/es/locale/en_US.js +3 -1
- package/vendor/antd/es/locale/ru_RU.js +3 -1
- package/vendor/antd/es/locale/useLocale.js +2 -1
- package/vendor/antd/es/masonry/Masonry.js +4 -3
- package/vendor/antd/es/mentions/index.js +28 -14
- package/vendor/antd/es/menu/MenuItem.js +2 -1
- package/vendor/antd/es/menu/OverrideContext.js +1 -0
- package/vendor/antd/es/menu/SubMenu.js +1 -1
- package/vendor/antd/es/menu/menu.js +5 -5
- package/vendor/antd/es/menu/style/index.js +21 -36
- package/vendor/antd/es/menu/style/vertical.js +2 -1
- package/vendor/antd/es/message/PureList.js +49 -0
- package/vendor/antd/es/message/PurePanel.js +28 -36
- package/vendor/antd/es/message/index.js +6 -3
- package/vendor/antd/es/message/style/index.js +102 -99
- package/vendor/antd/es/message/useMessage.js +29 -33
- package/vendor/antd/es/message/util.js +1 -1
- package/vendor/antd/es/modal/ConfirmDialog.js +11 -9
- package/vendor/antd/es/modal/Modal.js +12 -7
- package/vendor/antd/es/modal/PurePanel.js +1 -2
- package/vendor/antd/es/modal/confirm.js +4 -3
- package/vendor/antd/es/modal/shared.js +3 -2
- package/vendor/antd/es/modal/useModal/HookModal.js +2 -1
- package/vendor/antd/es/notification/PureList.js +46 -0
- package/vendor/antd/es/notification/PurePanel.js +37 -56
- package/vendor/antd/es/notification/hooks/useStackConfig.js +13 -0
- package/vendor/antd/es/notification/index.js +3 -1
- package/vendor/antd/es/notification/style/index.js +103 -170
- package/vendor/antd/es/notification/style/notification.js +191 -0
- package/vendor/antd/es/notification/style/placement.js +117 -60
- package/vendor/antd/es/notification/useNotification.js +37 -40
- package/vendor/antd/es/notification/util.js +9 -50
- package/vendor/antd/es/pagination/Pagination.js +1 -2
- package/vendor/antd/es/pagination/useShowSizeChanger.js +2 -1
- package/vendor/antd/es/popconfirm/PurePanel.js +4 -1
- package/vendor/antd/es/popconfirm/index.js +1 -2
- package/vendor/antd/es/popover/PurePanel.js +1 -2
- package/vendor/antd/es/popover/index.js +1 -2
- package/vendor/antd/es/progress/Circle.js +2 -1
- package/vendor/antd/es/progress/progress.js +3 -3
- package/vendor/antd/es/progress/utils.js +4 -3
- package/vendor/antd/es/qr-code/index.js +4 -4
- package/vendor/antd/es/radio/group.js +4 -3
- package/vendor/antd/es/radio/radio.js +2 -2
- package/vendor/antd/es/radio/style/index.js +1 -1
- package/vendor/antd/es/rate/index.js +2 -4
- package/vendor/antd/es/result/index.js +6 -5
- package/vendor/antd/es/result/style/index.js +10 -6
- package/vendor/antd/es/segmented/index.js +5 -3
- package/vendor/antd/es/select/index.js +23 -12
- package/vendor/antd/es/select/style/dropdown.js +1 -1
- package/vendor/antd/es/select/style/select-input.js +23 -15
- package/vendor/antd/es/select/useIcons.js +43 -26
- package/vendor/antd/es/skeleton/Element.js +2 -1
- package/vendor/antd/es/skeleton/Skeleton.js +3 -3
- package/vendor/antd/es/slider/SliderTooltip.js +1 -0
- package/vendor/antd/es/slider/index.js +5 -3
- package/vendor/antd/es/slider/useRafLock.js +1 -0
- package/vendor/antd/es/space/Compact.js +1 -1
- package/vendor/antd/es/space/Item.js +1 -1
- package/vendor/antd/es/space/index.js +2 -2
- package/vendor/antd/es/space/style/addon.js +5 -2
- package/vendor/antd/es/spin/Indicator/Progress.js +2 -1
- package/vendor/antd/es/spin/index.js +1 -2
- package/vendor/antd/es/splitter/Panel.js +7 -3
- package/vendor/antd/es/splitter/SplitBar.js +5 -4
- package/vendor/antd/es/splitter/Splitter.js +9 -6
- package/vendor/antd/es/splitter/hooks/useItems.js +2 -1
- package/vendor/antd/es/splitter/hooks/useSizes.js +1 -1
- package/vendor/antd/es/splitter/style/index.js +8 -6
- package/vendor/antd/es/statistic/Number.js +8 -4
- package/vendor/antd/es/statistic/Statistic.js +14 -10
- package/vendor/antd/es/steps/index.js +4 -4
- package/vendor/antd/es/style/compact-item-vertical.js +2 -1
- package/vendor/antd/es/style/compact-item.js +6 -6
- package/vendor/antd/es/switch/index.js +1 -2
- package/vendor/antd/es/table/InternalTable.js +23 -14
- package/vendor/antd/es/table/hooks/useFilledColumns.js +23 -0
- package/vendor/antd/es/table/hooks/useFilter/FilterDropdown.js +22 -16
- package/vendor/antd/es/table/hooks/useFilter/FilterWrapper.js +1 -0
- package/vendor/antd/es/table/hooks/useFilter/index.js +34 -18
- package/vendor/antd/es/table/hooks/useLazyKVMap.js +2 -1
- package/vendor/antd/es/table/hooks/usePagination.js +7 -4
- package/vendor/antd/es/table/hooks/useSelection.js +32 -21
- package/vendor/antd/es/table/hooks/useSorter.js +10 -5
- package/vendor/antd/es/table/style/bordered.js +5 -27
- package/vendor/antd/es/table/style/empty.js +1 -4
- package/vendor/antd/es/table/style/index.js +1 -4
- package/vendor/antd/es/table/util.js +6 -6
- package/vendor/antd/es/tabs/hooks/useAnimateConfig.js +2 -1
- package/vendor/antd/es/tabs/index.js +1 -2
- package/vendor/antd/es/tag/CheckableTagGroup.js +8 -5
- package/vendor/antd/es/tag/hooks/useColor.js +4 -3
- package/vendor/antd/es/tag/index.js +13 -7
- package/vendor/antd/es/theme/themes/dark/colors.js +2 -1
- package/vendor/antd/es/theme/themes/default/colors.js +2 -1
- package/vendor/antd/es/theme/useToken.js +2 -2
- package/vendor/antd/es/theme/util/alias.js +34 -29
- package/vendor/antd/es/timeline/Timeline.js +3 -4
- package/vendor/antd/es/tooltip/PurePanel.js +1 -2
- package/vendor/antd/es/tooltip/UniqueProvider/index.js +2 -1
- package/vendor/antd/es/tooltip/index.js +9 -7
- package/vendor/antd/es/tour/PurePanel.js +2 -2
- package/vendor/antd/es/tour/index.js +1 -1
- package/vendor/antd/es/tour/panelRender.js +4 -2
- package/vendor/antd/es/transfer/ListBody.js +3 -1
- package/vendor/antd/es/transfer/ListItem.js +2 -1
- package/vendor/antd/es/transfer/Section.js +17 -8
- package/vendor/antd/es/transfer/index.js +51 -16
- package/vendor/antd/es/transfer/style/index.js +5 -1
- package/vendor/antd/es/tree/Tree.js +1 -2
- package/vendor/antd/es/tree/style/index.js +5 -1
- package/vendor/antd/es/tree/utils/iconUtil.js +5 -4
- package/vendor/antd/es/tree-select/index.js +3 -3
- package/vendor/antd/es/typography/Base/CopyBtn.js +3 -2
- package/vendor/antd/es/typography/Base/Ellipsis.js +3 -3
- package/vendor/antd/es/typography/Base/index.js +38 -31
- package/vendor/antd/es/typography/Editable.js +10 -4
- package/vendor/antd/es/typography/Link.js +1 -0
- package/vendor/antd/es/typography/Text.js +2 -1
- package/vendor/antd/es/typography/Typography.js +20 -10
- package/vendor/antd/es/typography/hooks/useCopyClick.js +2 -1
- package/vendor/antd/es/typography/hooks/useMergedConfig.js +13 -7
- package/vendor/antd/es/typography/hooks/useTooltipProps.js +2 -1
- package/vendor/antd/es/typography/hooks/useTypographySemantic.js +33 -0
- package/vendor/antd/es/typography/style/index.js +12 -27
- package/vendor/antd/es/typography/style/mixins.js +46 -13
- package/vendor/antd/es/upload/Upload.js +13 -7
- package/vendor/antd/es/upload/UploadList/ListItem.js +6 -5
- package/vendor/antd/es/upload/UploadList/index.js +4 -3
- package/vendor/antd/es/upload/utils.js +18 -1
- package/vendor/antd/es/version/version.js +1 -1
- package/vendor/antd/es/watermark/index.js +6 -4
- package/vendor/antd/es/watermark/useSingletonCache.js +1 -0
- package/vendor/antd/es/watermark/useWatermark.js +3 -3
- package/vendor/antd/package.json +1 -1
- package/vendor/useblocks-ui-kit/es/components/DataEntry/Input/index.js +1 -1
- package/vendor/useblocks-ui-kit/es/components/General/EmIcons/deprecationNotice.js +1 -1
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/vite/index.cjs +2 -2
- package/vite/index.js +2 -2
- package/iframe/js/discussHandlers.ozU2Hn_l.js +0 -87
- package/iframe/js/iframe.body.js +0 -319
- package/static/core/1c535081.js +0 -1
- package/static/core/1cee0d36.js +0 -1
- package/static/core/4fbdd8b6.js +0 -2
- package/static/core/55a38638.js +0 -93
- package/static/core/605c665e.js +0 -28
- package/static/core/68cbe23d.js +0 -1
- package/static/core/89431649.js +0 -7
- package/static/core/8b821a61.js +0 -1
- package/static/core/9718977a.js +0 -1
- package/static/core/b7e9202e.js +0 -27
- package/static/core/b877f7b4.js +0 -1
- package/static/core/baded0c1.js +0 -1
- package/static/core/c6cc104d.js +0 -4
- package/static/core/d70aac44.js +0 -291
- package/static/core/e0d71533.js +0 -100
- package/static/core/fb57f60b.js +0 -1
- package/static/core/fe756e4d.js +0 -1
- package/static/esm/349f9e2c.js +0 -1
- package/static/esm/50fbfdf6.js +0 -1
- package/static/media/icon-sets/lucide.json +0 -6275
- package/static/media/icon-sets/tabler.json +0 -19336
- package/static/umd-runtime/Cl8heeC3.js +0 -1
- package/static/umd-runtime/D0xo8o9c.js +0 -335
- package/static/umd-runtime/runtime.js +0 -1
- package/useblocks-core.bb6d921f.js +0 -859
- package/vendor/@rc-component/notification/es/Notice.js +0 -106
- package/vendor/@rc-component/notification/es/NoticeList.js +0 -98
- package/vendor/@rc-component/textarea/LICENSE.md +0 -9
- package/vendor/@rc-component/textarea/es/index.js +0 -6
- package/vendor/@rc-component/textarea/package.json +0 -6
- package/vendor/antd/es/_util/extendsObject.js +0 -12
- package/vendor/antd/es/_util/getAllowClear.js +0 -12
- package/vendor/antd/es/_util/isNonNullable.js +0 -6
- package/vendor/antd/es/_util/isPrimitive.js +0 -4
- package/vendor/antd/es/notification/style/pure-panel.js +0 -18
- package/vendor/antd/es/notification/style/stack.js +0 -85
- /package/static/monaco/{index.js → index.CO7s5UdA.js} +0 -0
- /package/static/umd-runtime/{delivery-libs.js → delivery-libs.3Svr0avG.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,97 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [1.1.101] - 2026-10-12
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Image editor: ready-made crop ratios (1:1, 4:5, 2:3, 4:3, 3:2, 1.91:1, 21:9) and rounded image
|
|
14
|
+
corners
|
|
15
|
+
- Strikethrough text in the button settings
|
|
16
|
+
- PNG images are compressed harder on upload and when saved from the image editor — a palette of up
|
|
17
|
+
to 1024 colours instead of 4096: PNG photos get 2–4× lighter, transparency is kept. Animated PNGs are
|
|
18
|
+
uploaded unchanged. Compression as a whole can still be turned off with `compressMaxSize: 0`
|
|
19
|
+
- File Manager: interface in German, French, Italian and Polish
|
|
20
|
+
- The editor opens faster: the startup code is lighter, the code editor and rarely used dialogs load
|
|
21
|
+
on demand, and an email from the list starts loading as soon as its row is clicked. Switching emails
|
|
22
|
+
no longer flashes an empty canvas: the next email is prepared off-screen and swapped in
|
|
23
|
+
- `create()` returns the editor object right away, with readiness as the `ready` promise, so handlers
|
|
24
|
+
that fire before startup finishes can already refer to it
|
|
25
|
+
- Hidden start: `init({ hidden: true })` brings the editor up in its container without the interface,
|
|
26
|
+
and a second `init()` without the flag reveals it without recreating the canvas or losing state
|
|
27
|
+
- The `ownership: 'counted'` option: every `init()` or `create()` in a shared container gets its own
|
|
28
|
+
object, and the editor is destroyed once all of them have released it. `getInstance(element)`
|
|
29
|
+
returns the editor object for a container
|
|
30
|
+
- `show({ reload: true })` re-reads the email on the integrator's command
|
|
31
|
+
- `getEmailSnapshot()` returns the open email's fields without compiling the HTML, and `validateCode()`
|
|
32
|
+
checks the email code without the code editor open. `getCodeErrors()` is deprecated
|
|
33
|
+
- Autosave: the optional `handleReadEmailAutosave` handler returns the email's latest autosave;
|
|
34
|
+
autosaves are marked with `autosave: true`, and the revision `slug` field is deprecated
|
|
35
|
+
- Canvas image cache `canvasImageCache`: an image is downloaded once instead of on every email show.
|
|
36
|
+
The email code keeps the original URLs
|
|
37
|
+
- The `deferEditorChrome` option (on by default): the header and the right panel are built right after
|
|
38
|
+
the first frame, so the email shows up sooner
|
|
39
|
+
- The Vite and webpack bundler plugins warn when a second copy of React or ui-kit ends up in the build;
|
|
40
|
+
`sharedReact: true` hands the editor your project's React (version 19)
|
|
41
|
+
- The `useblocks/ui-kit/icons` subpath: a plugin imports ui-kit icons one by one, and only the ones it
|
|
42
|
+
uses end up in the build
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Email import: images whose URLs share a file name (for example, from Unisender) no longer get mixed
|
|
47
|
+
up
|
|
48
|
+
- A block made of several table rows is inserted in full
|
|
49
|
+
- An image in a column takes the column's width, including when columns wrap on mobile
|
|
50
|
+
- Columns: vertical alignment of floating columns reaches Outlook, and "Add column" no longer resets
|
|
51
|
+
the alignment of the others; a preset with fewer columns leaves no empty gap in a non-responsive
|
|
52
|
+
email
|
|
53
|
+
- Enter and Backspace in a list no longer turn text into tags; a colour typed into the field character
|
|
54
|
+
by character reaches the email
|
|
55
|
+
- Non-breaking spaces in the preheader are kept
|
|
56
|
+
- AMP: replacing a carousel slide image reaches the code and the export, and editing an accordion
|
|
57
|
+
section header no longer applies to the whole accordion
|
|
58
|
+
- Saving in the image editor no longer lowers the image resolution
|
|
59
|
+
- A file dropped onto an image in the canvas is uploaded the same way as from the image dialog —
|
|
60
|
+
through `handleLoadImage` or File Manager — and errors are shown
|
|
61
|
+
- The second page of the version history shows the "Auto" label, and restoring such a version keeps
|
|
62
|
+
the email's common styles
|
|
63
|
+
- An email without a title can be duplicated, and notifications no longer say "null"
|
|
64
|
+
- The "System" interface theme follows the OS after a reload too
|
|
65
|
+
- The settings panel no longer crashes on the countdown style buttons on the Mobile tab or in the
|
|
66
|
+
elements panel when the user has no language set
|
|
67
|
+
- On a phone, the email in preview no longer overflows the screen
|
|
68
|
+
- Plugin dialogs show the OK and Cancel buttons and the close icon again when the plugin does not set
|
|
69
|
+
them itself
|
|
70
|
+
- Translations: "Custom fonts", the "Text" prefix of the button text replacement field, the block
|
|
71
|
+
saved notification
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
|
|
75
|
+
- Global plugins with the ESM entry: the compatibility layer is off by default. Turn it on with
|
|
76
|
+
`compatGlobals: true` in the bundler plugin or by importing `useblocks/compat-globals` before the
|
|
77
|
+
editor is created. Without it the plugin fails with `` `antd` is not available… ``
|
|
78
|
+
- The shared `uuid` is removed from the runtime: a plugin that took it from the editor gets a clear
|
|
79
|
+
error. Bundle `uuid` into the plugin itself
|
|
80
|
+
- A plugin built with the new `PluginDev` works only with this editor version: update the editor first,
|
|
81
|
+
then the plugins
|
|
82
|
+
- The ESM build of the editor runs on its own copy of React from the package: React no longer has to
|
|
83
|
+
be in your project's dependencies, and `resolve.alias` and `dedupe` do not affect the editor. An ESM
|
|
84
|
+
plugin does not work with the UMD entry of the editor — the editor reports this in the console
|
|
85
|
+
- The page and the canvas talk over `MessageChannel`: `message` listeners on the page do not see canvas
|
|
86
|
+
messages. The canvas document is recreated for every email — the sandbox script runs again, and
|
|
87
|
+
`onReady` signals that each new canvas is ready
|
|
88
|
+
- The canvas image cache is on by default, and images from the page's host are shown via `blob:`. With
|
|
89
|
+
a strict CSP, add `blob:` to `img-src` or turn the cache off: `canvasImageCache: false`
|
|
90
|
+
- `save()` rejects when the integrator's save handler fails or does not answer in time — previously
|
|
91
|
+
such a call looked successful
|
|
92
|
+
- Edit history: `undoRedoService.getPast()` and `getFuture()` return `EditStepInfo[]`, and
|
|
93
|
+
`createSnapshot()` returns a marker that cannot be stored across page loads. The `EditStackData`,
|
|
94
|
+
`EditStackSnapshot`, `ISelection` and `ISingleModelEditStackData` types are removed
|
|
95
|
+
- antd labels are translated only into the product's languages: in Chinese, Japanese, Korean, Turkish,
|
|
96
|
+
Dutch and Portuguese (Portugal) they are now in English
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
9
100
|
## [1.1.88] - 2026-10-01
|
|
10
101
|
|
|
11
102
|
### Added
|
package/README.md
CHANGED
|
@@ -25,7 +25,10 @@ A plugin built for globals (a UMD script loaded by URL, a descriptor with `type:
|
|
|
25
25
|
`resolve: 'registry'`) takes antd, the icons and the ui-kit from `window.__useblocks__.modules`. With the
|
|
26
26
|
ESM entry this compatibility layer is off by default: it ships the whole of antd and the icon catalogue,
|
|
27
27
|
and only hosts that actually use such plugins should pay for it. Without the layer the plugin fails with
|
|
28
|
-
`` `antd` is not available: the compatibility layer for global plugins is not enabled
|
|
28
|
+
`` `antd` is not available: the compatibility layer for global plugins is not enabled ``, ending with
|
|
29
|
+
`Requested by: <url>` of the script that read the name. `modules.UiKit` and `modules.UiKitIcons` do not
|
|
30
|
+
throw without the layer: they return `undefined` and log the same reason to the console once, since
|
|
31
|
+
older plugins checked them for presence.
|
|
29
32
|
|
|
30
33
|
Turn the layer on in one of two ways:
|
|
31
34
|
|
|
@@ -46,7 +49,7 @@ How the merged **`ExportedApi`** interfaces, **`AppEvent`** and payload types fi
|
|
|
46
49
|
| --- | --- |
|
|
47
50
|
| **`init`** | **`content` is mandatory**. **`init(options) → Promise<Instance>`**. |
|
|
48
51
|
| Module vs **instance** | The **`useblocks`** bundle exports **`init`** (plus optional named ESM APIs). **`setConfig`**, **`show`**, **`save`**, **`destroy`** belong to the **`init`** return value—not the namespace object. |
|
|
49
|
-
| Same DOM repeat | Calling **`init`** again on
|
|
52
|
+
| Same DOM repeat | Calling **`init`** again on the same element returns **the same object** and applies options like **`setConfig`**. A call made while the previous one is still starting supersedes it: the previous promise rejects with **`AbortError`**. **`destroy()`** through any reference destroys the editor. One object per call — **`ownership: 'counted'`**. |
|
|
50
53
|
| Events | **`instance.handle*(…)`** usually returns **unsubscribe**. **`handleSubjectChanged`** / **`handlePreheaderChanged`** use bespoke signatures — see typings. |
|
|
51
54
|
| Async | Handlers plus **`getAuthToken`** may be **`async`**; funnel errors via **`handleError`** or your own telemetry. |
|
|
52
55
|
| Build | Without Webpack/Vite helpers you must wire **`__useblocks__`** / **`publicPath`**. Expect a heavy UI bundle (React, Monaco, etc.). |
|
|
@@ -149,11 +152,11 @@ You can take **`EMAIL_CODE`** from <a href="https://cdn.useblocks.io/plugin/new-
|
|
|
149
152
|
|
|
150
153
|
For debugging, the dev build may support a front-end token flow — configure an auth proxy in your app if you use that path.
|
|
151
154
|
|
|
152
|
-
###
|
|
155
|
+
### The editor object right away: `create()`
|
|
153
156
|
|
|
154
157
|
`init()` resolves only once the editor is ready and the email from `content` is shown. Handlers fire
|
|
155
158
|
earlier — inside `init()` — so they cannot refer to the editor: your variable is not assigned yet.
|
|
156
|
-
`create()` returns
|
|
159
|
+
`create()` returns the **editor object** right away, synchronously, with readiness as a separate promise:
|
|
157
160
|
|
|
158
161
|
```javascript
|
|
159
162
|
const editor = emailmaker.create({
|
|
@@ -161,7 +164,7 @@ const editor = emailmaker.create({
|
|
|
161
164
|
element: '#editor',
|
|
162
165
|
content: { email },
|
|
163
166
|
handleEmailInit: async () => {
|
|
164
|
-
// The
|
|
167
|
+
// The object already exists — it is assigned by the time the event fires.
|
|
165
168
|
const compiled = await editor.compileEmail(undefined, { amp: true });
|
|
166
169
|
await saveOnYourSide(compiled);
|
|
167
170
|
},
|
|
@@ -169,9 +172,11 @@ const editor = emailmaker.create({
|
|
|
169
172
|
await editor.ready;
|
|
170
173
|
```
|
|
171
174
|
|
|
172
|
-
|
|
175
|
+
It is a plain object, just like the result of `init()`: every method is an own property, visible to
|
|
176
|
+
`Object.keys`, spread and `Object.assign`, and any method can be replaced with your own. You can store
|
|
177
|
+
the object, subscribe to events or call `destroy()` right away.
|
|
173
178
|
|
|
174
|
-
The
|
|
179
|
+
The object is bound to the editor as soon as the editor is assembled — before the email from `content`
|
|
175
180
|
is shown — so calls made from handlers (like `compileEmail()` above) reach the editor. Once bound,
|
|
176
181
|
every call goes straight to the editor. Before binding:
|
|
177
182
|
|
|
@@ -182,28 +187,17 @@ every call goes straight to the editor. Before binding:
|
|
|
182
187
|
| `setEmailMeta`, `setBlockMeta`, `notify` | applied once ready, in order |
|
|
183
188
|
| `getElement()` | the element from options if it was passed as an element; `undefined` for a selector |
|
|
184
189
|
| `getCodeErrors()` | an empty list |
|
|
185
|
-
| `getConfig()`, `use()
|
|
190
|
+
| `getConfig()`, `use()` | throw a clear error — await `ready` or use `useAsync()` |
|
|
191
|
+
| `container`, `undoRedoService` fields | `undefined`; reading them never throws |
|
|
186
192
|
| `destroy()` | cancels initialisation; `ready` rejects with `AbortError` |
|
|
187
193
|
|
|
188
|
-
After `destroy()` the handle is detached: its subscriptions are removed and its methods reject like a
|
|
189
|
-
destroyed editor's. If another owner has already reused the element, destroying the previous handle
|
|
190
|
-
leaves the editor alone and only takes its own subscriptions with it.
|
|
191
|
-
|
|
192
194
|
Between binding and `ready` the email may not be shown yet. If you need the shown document — a
|
|
193
195
|
`getEmailSnapshot()`, for example — await `ready` first.
|
|
194
196
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
one. From then on the earlier handle is not the owner: it stops receiving events, and its `destroy()` only
|
|
198
|
-
detaches it and leaves the editor alone. `destroy()` of the latest handle destroys the editor, even before
|
|
199
|
-
its `ready`.
|
|
200
|
-
|
|
201
|
-
If the new call passes the same data as the earlier one — the same email, configuration, user and the same
|
|
202
|
-
set of handlers, even as new functions, as on every component re-render — the editor does not re-apply the
|
|
203
|
-
options: the email is not shown again, `handleSetOptions` and `handleOptionsChanged` do not fire, and
|
|
204
|
-
events go to the new call's handlers.
|
|
197
|
+
A repeated `create()` or `init()` into the same element is described below, in
|
|
198
|
+
[“Repeated init() into the same element”](#repeated-init-into-the-same-element).
|
|
205
199
|
|
|
206
|
-
An initialisation error arrives as a `ready` rejection. If you create
|
|
200
|
+
An initialisation error arrives as a `ready` rejection. If you create an object and never await
|
|
207
201
|
`ready`, such an error surfaces in the console as unhandled — on purpose, otherwise there is no way to
|
|
208
202
|
learn the editor did not start. The exception is `destroy()` before `ready`: that rejection is
|
|
209
203
|
expected and stays quiet.
|
|
@@ -251,7 +245,7 @@ When you need full control over the lifecycle, mount the editor by hand with **`
|
|
|
251
245
|
|
|
252
246
|
Configuration is a nested object: editor chrome, initial email payload, and callback hooks.
|
|
253
247
|
|
|
254
|
-
Calling **`init`** again on the **same DOM host**
|
|
248
|
+
Calling **`init`** again on the **same DOM host** returns the same object and applies the new options — see [“Repeated init() into the same element”](#repeated-init-into-the-same-element).
|
|
255
249
|
|
|
256
250
|
### Element
|
|
257
251
|
|
|
@@ -288,31 +282,70 @@ is our job, not yours.
|
|
|
288
282
|
| metadata and document state | yes |
|
|
289
283
|
| the email markup | replaced by whatever you pass in `content` |
|
|
290
284
|
|
|
291
|
-
###
|
|
285
|
+
### Repeated init() into the same element
|
|
292
286
|
|
|
293
|
-
|
|
294
|
-
container and gets the same instance. This happens without you arranging it — React unmounts the
|
|
295
|
-
previous page **after** mounting the new one, and StrictMode invokes the effect twice.
|
|
287
|
+
How a repeated `init()` or `create()` into the same container behaves is set by the `ownership` option.
|
|
296
288
|
|
|
297
|
-
|
|
298
|
-
"I no longer hold it" and leaves the running instance alone:
|
|
289
|
+
**By default (`ownership: 'single'`) — as in 1.1.89.** The container has one editor object:
|
|
299
290
|
|
|
300
291
|
```javascript
|
|
301
292
|
const first = await emailmaker.init({ element: '#editor', content });
|
|
302
|
-
const second = await emailmaker.init({ element: '#editor', content });
|
|
293
|
+
const second = await emailmaker.init({ element: '#editor', content, config });
|
|
294
|
+
first === second; // true
|
|
303
295
|
|
|
304
|
-
|
|
305
|
-
second.destroy(); // destroys it
|
|
296
|
+
second.destroy(); // destroys the editor — through any reference
|
|
306
297
|
```
|
|
307
298
|
|
|
308
|
-
|
|
309
|
-
|
|
299
|
+
- A repeated call applies its options like `setConfig`. Handlers from options are swapped at once:
|
|
300
|
+
later events go to the new call's handlers. Subscriptions made through the object
|
|
301
|
+
(`editor.handleSaveEmail(cb)`) stay — it is the same object.
|
|
302
|
+
- The email is shown again only if it differs from the one you set last yourself — via `init`, `show`
|
|
303
|
+
or `reset`. `init(A)` → `show(B)` → `init(A)` brings email A back. `init(A)` → `init(A)` does not
|
|
304
|
+
redraw it, so the user's edits stay.
|
|
305
|
+
- If the call passes the same data as the previous one — the same email, configuration, user and the
|
|
306
|
+
same set of handlers, even as new functions, as on every component re-render — the options are not
|
|
307
|
+
re-applied: `handleSetOptions` and `handleOptionsChanged` do not fire and the token is not requested
|
|
308
|
+
again.
|
|
309
|
+
- A call made while the previous one is still starting supersedes it: the previous promise rejects with
|
|
310
|
+
an `AbortError` (`emailmaker.isSupersededInitError(error)`), and only the new one succeeds.
|
|
311
|
+
- `destroy()` through any reference destroys the editor, and `handleDestroy` subscribed through the
|
|
312
|
+
object fires.
|
|
313
|
+
|
|
314
|
+
**`ownership: 'counted'` — an object per call.** Use it when several parts of your app share the
|
|
315
|
+
editor in one container: a page starts it, the next page enters the same container, and the previous
|
|
316
|
+
page's tear-down comes later — React unmounts the previous page **after** mounting the new one, and
|
|
317
|
+
StrictMode invokes the effect twice.
|
|
318
|
+
|
|
319
|
+
```javascript
|
|
320
|
+
const first = emailmaker.create({ element: '#editor', content, ownership: 'counted' });
|
|
321
|
+
const second = emailmaker.create({ element: '#editor', content, ownership: 'counted' });
|
|
322
|
+
await Promise.all([first.ready, second.ready]); // both succeed, one editor
|
|
323
|
+
|
|
324
|
+
first.destroy(); // releases only first's share and its subscriptions
|
|
325
|
+
second.destroy(); // the last share: the editor is destroyed shortly after
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
- Every call gets its own object with all methods of the shared editor and holds a share in it. The
|
|
329
|
+
object's subscriptions live until its `destroy()`.
|
|
330
|
+
- `destroy()` releases the object's share. The editor is destroyed once no shares are left — after a
|
|
331
|
+
short delay, so a tear-down immediately followed by a new call (StrictMode) does not recreate it.
|
|
332
|
+
- The options and handlers of the latest call apply. When its share is released, the handlers from
|
|
333
|
+
options move to the latest remaining owner; the email and settings stay as they are.
|
|
334
|
+
- `emailmaker.getInstance(element)` returns the latest call's object.
|
|
335
|
+
|
|
336
|
+
**Modes can be mixed.** A call without the flag holds the editor until its object's `destroy()` and
|
|
337
|
+
gets the container's shared object. Counted shares live on top of it. `destroy()` of the object without
|
|
338
|
+
the flag destroys the editor with all shares — their objects then behave as after `destroy()`. In
|
|
339
|
+
development mode mixing is flagged with a console warning.
|
|
340
|
+
|
|
341
|
+
**If a repeated call fails to start** (the token or `app_init` failed, or it was cancelled via
|
|
342
|
+
`signal`), only that call is rejected: the editor keeps its previous options and its email, restored
|
|
343
|
+
from a snapshot (text and header; undo history is cleared). If the hand-back fails too, the editor is
|
|
344
|
+
destroyed, and the earlier objects' methods throw `EditorStartFailedError` with the reason in `cause` —
|
|
345
|
+
start the editor again with a new `init()`. Aborting the earlier call's `signal` after a new call came
|
|
346
|
+
in leaves the editor alone.
|
|
310
347
|
|
|
311
|
-
|
|
312
|
-
to the earlier owner: with its own options and its email restored from a snapshot (text and header;
|
|
313
|
-
undo history is cleared). If the hand-back fails too, the editor is destroyed, and the earlier
|
|
314
|
-
instance's methods throw `EditorStartFailedError` with the reason in `cause` — start the editor again
|
|
315
|
-
with a new `init()`.
|
|
348
|
+
`init()` into a **different** container starts a new editor.
|
|
316
349
|
|
|
317
350
|
### Content
|
|
318
351
|
|
|
@@ -626,7 +659,7 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
|
|
|
626
659
|
| handleDestroy | Destroy lifecycle |
|
|
627
660
|
| handleLoad | Instance ready hook |
|
|
628
661
|
| handleLoadImage | Image upload helpers & proxies |
|
|
629
|
-
| handleNotify | Generic notification. Among
|
|
662
|
+
| handleNotify | Generic notification. Among warnings (`type: 'warning'`): `TEMPLATE_READ_ERROR` (`data: { templateId }`) — the template named by `templateId` could not be read and the email opened without it. Sent once per template for the editor's lifetime and never to `handleError`; the event has no title and the editor shows no toast for it — show your own if the user should know. |
|
|
630
663
|
| handleError | Error toast hook |
|
|
631
664
|
| handleSuccess | Success toast hook |
|
|
632
665
|
| handleTestEmailSend | Send test mail |
|