vap1 0.0.1
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/basetype.d.ts +62 -0
- package/basetype.js +2 -0
- package/components/Box/Box.d.ts +118 -0
- package/components/Box/Box.js +150 -0
- package/components/Box/SelectBar.d.ts +90 -0
- package/components/Box/SelectBar.js +93 -0
- package/components/Box/_register.d.ts +49 -0
- package/components/Box/_register.js +29 -0
- package/components/Box/index.d.ts +9 -0
- package/components/Box/index.js +6 -0
- package/components/Lists/SList.d.ts +58 -0
- package/components/Lists/SList.js +167 -0
- package/components/SearchBar/ActionButtons.d.ts +49 -0
- package/components/SearchBar/ActionButtons.js +96 -0
- package/components/SearchBar/ByField.d.ts +3 -0
- package/components/SearchBar/ByField.js +193 -0
- package/components/SearchBar/ByKeyword.d.ts +3 -0
- package/components/SearchBar/ByKeyword.js +34 -0
- package/components/SearchBar/SearchField.d.ts +15 -0
- package/components/SearchBar/SearchField.js +25 -0
- package/components/SearchBar/SearchTags.d.ts +2 -0
- package/components/SearchBar/SearchTags.js +18 -0
- package/components/SearchBar/_FieldType.d.ts +8 -0
- package/components/SearchBar/_FieldType.js +45 -0
- package/components/SearchBar/_register.d.ts +65 -0
- package/components/SearchBar/_register.js +29 -0
- package/components/SearchBar/index.d.ts +134 -0
- package/components/SearchBar/index.js +33 -0
- package/components/Tables/ApiTable.d.ts +18 -0
- package/components/Tables/ApiTable.js +48 -0
- package/components/Tables/ApiTableModal.d.ts +22 -0
- package/components/Tables/ApiTableModal.js +73 -0
- package/components/Tables/Components/ActionBar.d.ts +56 -0
- package/components/Tables/Components/ActionBar.js +100 -0
- package/components/Tables/Components/Actions.d.ts +47 -0
- package/components/Tables/Components/Actions.js +91 -0
- package/components/Tables/Components/Summary.d.ts +11 -0
- package/components/Tables/Components/Summary.js +11 -0
- package/components/Tables/Components/index.d.ts +17 -0
- package/components/Tables/Components/index.js +19 -0
- package/components/Tables/STable.d.ts +5 -0
- package/components/Tables/STable.js +37 -0
- package/components/Tables/TopTable.d.ts +24 -0
- package/components/Tables/TopTable.js +157 -0
- package/components/Tables/TopTableModal.d.ts +5 -0
- package/components/Tables/TopTableModal.js +20 -0
- package/components/Tables/Util.d.ts +3 -0
- package/components/Tables/Util.js +41 -0
- package/components/Tables/VTable.d.ts +11 -0
- package/components/Tables/VTable.js +237 -0
- package/components/Tables/index.d.ts +81 -0
- package/components/Tables/index.js +20 -0
- package/components/TreeSelect/BaseTreeSelect.d.ts +33 -0
- package/components/TreeSelect/BaseTreeSelect.js +190 -0
- package/components/TreeSelect/DTreeSelect.d.ts +24 -0
- package/components/TreeSelect/DTreeSelect.js +66 -0
- package/components/TreeSelect/FTreeSelect.d.ts +11 -0
- package/components/TreeSelect/FTreeSelect.js +39 -0
- package/components/TreeSelect/STreeSelect.d.ts +14 -0
- package/components/TreeSelect/STreeSelect.js +52 -0
- package/components/TreeSelect/index.d.ts +94 -0
- package/components/TreeSelect/index.js +9 -0
- package/components/Trees/ActionTree.d.ts +54 -0
- package/components/Trees/ActionTree.js +657 -0
- package/components/Trees/BaseTree.d.ts +31 -0
- package/components/Trees/BaseTree.js +185 -0
- package/components/Trees/DTree.d.ts +48 -0
- package/components/Trees/DTree.js +142 -0
- package/components/Trees/FTree.d.ts +33 -0
- package/components/Trees/FTree.js +79 -0
- package/components/Trees/STree.d.ts +21 -0
- package/components/Trees/STree.js +92 -0
- package/components/Trees/index.d.ts +134 -0
- package/components/Trees/index.js +9 -0
- package/components/UForm/FormWrapper.d.ts +22 -0
- package/components/UForm/FormWrapper.js +270 -0
- package/components/UForm/UDescriptions.d.ts +5 -0
- package/components/UForm/UDescriptions.js +134 -0
- package/components/UForm/UForm.d.ts +33 -0
- package/components/UForm/UForm.js +484 -0
- package/components/UForm/UFormModal.d.ts +3 -0
- package/components/UForm/UFormModal.js +149 -0
- package/components/UForm/UInfo.d.ts +10 -0
- package/components/UForm/UInfo.js +75 -0
- package/components/UForm/UInfoModal.d.ts +3 -0
- package/components/UForm/UInfoModal.js +50 -0
- package/components/UForm/UModal.d.ts +3 -0
- package/components/UForm/UModal.js +24 -0
- package/components/UForm/_FieldType.d.ts +8 -0
- package/components/UForm/_FieldType.js +100 -0
- package/components/UForm/_FormUtils.d.ts +5 -0
- package/components/UForm/_FormUtils.js +75 -0
- package/components/UForm/_input.d.ts +59 -0
- package/components/UForm/_input.js +147 -0
- package/components/UForm/_register.d.ts +87 -0
- package/components/UForm/_register.js +44 -0
- package/components/UForm/index.d.ts +387 -0
- package/components/UForm/index.js +15 -0
- package/components/Upload/UploadFile.d.ts +3 -0
- package/components/Upload/UploadFile.js +40 -0
- package/components/Upload/UploadImage.d.ts +24 -0
- package/components/Upload/UploadImage.js +93 -0
- package/components/Upload/UploadModal.d.ts +50 -0
- package/components/Upload/UploadModal.js +140 -0
- package/components/Upload/index.d.ts +77 -0
- package/components/Upload/index.js +9 -0
- package/components/Upload/useUpload.d.ts +15 -0
- package/components/Upload/useUpload.js +93 -0
- package/components/_RegisterUtil.d.ts +1 -0
- package/components/_RegisterUtil.js +25 -0
- package/components/_adapt/Alert.d.ts +11 -0
- package/components/_adapt/Alert.js +43 -0
- package/components/_adapt/Button.d.ts +20 -0
- package/components/_adapt/Button.js +26 -0
- package/components/_adapt/Col.d.ts +53 -0
- package/components/_adapt/Col.js +90 -0
- package/components/_adapt/Collapse.d.ts +30 -0
- package/components/_adapt/Collapse.js +33 -0
- package/components/_adapt/Drawer.d.ts +12 -0
- package/components/_adapt/Drawer.js +11 -0
- package/components/_adapt/Dropdown.d.ts +15 -0
- package/components/_adapt/Dropdown.js +38 -0
- package/components/_adapt/Icon.d.ts +14 -0
- package/components/_adapt/Icon.js +34 -0
- package/components/_adapt/Image.d.ts +4 -0
- package/components/_adapt/Image.js +11 -0
- package/components/_adapt/Menu.d.ts +32 -0
- package/components/_adapt/Menu.js +25 -0
- package/components/_adapt/Modal.d.ts +23 -0
- package/components/_adapt/Modal.js +69 -0
- package/components/_adapt/Popconfirm.d.ts +5 -0
- package/components/_adapt/Popconfirm.js +34 -0
- package/components/_adapt/Popover.d.ts +5 -0
- package/components/_adapt/Popover.js +34 -0
- package/components/_adapt/Progress.d.ts +14 -0
- package/components/_adapt/Progress.js +56 -0
- package/components/_adapt/Row.d.ts +10 -0
- package/components/_adapt/Row.js +23 -0
- package/components/_adapt/Select.d.ts +14 -0
- package/components/_adapt/Select.js +47 -0
- package/components/_adapt/Tag.d.ts +7 -0
- package/components/_adapt/Tag.js +12 -0
- package/components/_adapt/Tooltip.d.ts +5 -0
- package/components/_adapt/Tooltip.js +11 -0
- package/components/_adapt/todo/ColorPicker.d.ts +3 -0
- package/components/_adapt/todo/ColorPicker.js +42 -0
- package/components/_adapt/todo/FloatButton.d.ts +2 -0
- package/components/_adapt/todo/FloatButton.js +6 -0
- package/components/_adapt/todo/Image.d.ts +2 -0
- package/components/_adapt/todo/Image.js +6 -0
- package/components/_adapt/todo/Segmented.d.ts +2 -0
- package/components/_adapt/todo/Segmented.js +6 -0
- package/components/_adapt/todo/Space.d.ts +2 -0
- package/components/_adapt/todo/Space.js +6 -0
- package/components/_adapt/utils.d.ts +12 -0
- package/components/_adapt/utils.js +93 -0
- package/components/_common/AutoComplete.d.ts +32 -0
- package/components/_common/AutoComplete.js +87 -0
- package/components/_common/CountUp.d.ts +38 -0
- package/components/_common/CountUp.js +60 -0
- package/components/_common/DateRange.d.ts +52 -0
- package/components/_common/DateRange.js +108 -0
- package/components/_common/HighLight.d.ts +15 -0
- package/components/_common/HighLight.js +37 -0
- package/components/_common/I18N.d.ts +7 -0
- package/components/_common/I18N.js +6 -0
- package/components/_common/Loading.d.ts +9 -0
- package/components/_common/Loading.js +52 -0
- package/components/_common/MonthRange.d.ts +46 -0
- package/components/_common/MonthRange.js +130 -0
- package/components/_common/PromiseLabel.d.ts +11 -0
- package/components/_common/PromiseLabel.js +34 -0
- package/components/_common/Role.d.ts +5 -0
- package/components/_common/Role.js +11 -0
- package/components/_common/Upagination.d.ts +21 -0
- package/components/_common/Upagination.js +106 -0
- package/components/_setup/Const.d.ts +205 -0
- package/components/_setup/Const.js +112 -0
- package/components/_setup/I18N/enUS.d.ts +1 -0
- package/components/_setup/I18N/enUS.js +106 -0
- package/components/_setup/I18N/index.d.ts +3 -0
- package/components/_setup/I18N/index.js +5 -0
- package/components/_setup/I18N/zhCN.d.ts +3 -0
- package/components/_setup/I18N/zhCN.js +109 -0
- package/components/_setup/I18N/zhHK.d.ts +1 -0
- package/components/_setup/I18N/zhHK.js +107 -0
- package/components/_setup/ICON/IconTypes.d.ts +1 -0
- package/components/_setup/ICON/IconTypes.js +10 -0
- package/components/_setup/SearchField/SearchFieldAdvance.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldAdvance.js +57 -0
- package/components/_setup/SearchField/SearchFieldDate.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldDate.js +186 -0
- package/components/_setup/SearchField/SearchFieldInput.d.ts +3 -0
- package/components/_setup/SearchField/SearchFieldInput.js +20 -0
- package/components/_setup/SearchField/SearchFieldSelect.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldSelect.js +106 -0
- package/components/_setup/SearchField/SearchFieldTree.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldTree.js +191 -0
- package/components/_setup/SelectBar/SelectList.d.ts +1 -0
- package/components/_setup/SelectBar/SelectList.js +21 -0
- package/components/_setup/SelectBar/SelectTree.d.ts +1 -0
- package/components/_setup/SelectBar/SelectTree.js +11 -0
- package/components/_setup/UForm/UFormAdvanceInput.d.ts +1 -0
- package/components/_setup/UForm/UFormAdvanceInput.js +300 -0
- package/components/_setup/UForm/UFormAdvanceSelect.d.ts +0 -0
- package/components/_setup/UForm/UFormAdvanceSelect.js +26 -0
- package/components/_setup/UForm/UFormCrontab.d.ts +1 -0
- package/components/_setup/UForm/UFormCrontab.js +199 -0
- package/components/_setup/UForm/UFormDate.d.ts +1 -0
- package/components/_setup/UForm/UFormDate.js +313 -0
- package/components/_setup/UForm/UFormInput.d.ts +1 -0
- package/components/_setup/UForm/UFormInput.js +159 -0
- package/components/_setup/UForm/UFormJSON.d.ts +1 -0
- package/components/_setup/UForm/UFormJSON.js +219 -0
- package/components/_setup/UForm/UFormOrg.d.ts +1 -0
- package/components/_setup/UForm/UFormOrg.js +121 -0
- package/components/_setup/UForm/UFormRole.d.ts +1 -0
- package/components/_setup/UForm/UFormRole.js +47 -0
- package/components/_setup/UForm/UFormSearch.d.ts +0 -0
- package/components/_setup/UForm/UFormSearch.js +35 -0
- package/components/_setup/UForm/UFormSelect.d.ts +1 -0
- package/components/_setup/UForm/UFormSelect.js +179 -0
- package/components/_setup/UForm/UFormTree.d.ts +0 -0
- package/components/_setup/UForm/UFormTree.js +134 -0
- package/components/_setup/UForm/UFormUpload.d.ts +1 -0
- package/components/_setup/UForm/UFormUpload.js +173 -0
- package/components/_setup/UForm/_utils.d.ts +11 -0
- package/components/_setup/UForm/_utils.js +41 -0
- package/components/_setup/index.d.ts +21 -0
- package/components/_setup/index.js +25 -0
- package/components/index.d.ts +7 -0
- package/components/index.js +16 -0
- package/deps/JsonView.d.ts +6 -0
- package/deps/JsonView.js +57 -0
- package/deps/SpringBoot.d.ts +4 -0
- package/deps/SpringBoot.js +18 -0
- package/deps/SpringCloud.d.ts +14 -0
- package/deps/SpringCloud.js +29 -0
- package/deps/_editor/advance/_Audio.d.ts +0 -0
- package/deps/_editor/advance/_Audio.js +1 -0
- package/deps/_editor/advance/_Image.d.ts +2 -0
- package/deps/_editor/advance/_Image.js +89 -0
- package/deps/_editor/advance/_Table.d.ts +0 -0
- package/deps/_editor/advance/_Table.js +1 -0
- package/deps/_editor/advance/_Video.d.ts +0 -0
- package/deps/_editor/advance/_Video.js +1 -0
- package/deps/_editor/base/Element.d.ts +5 -0
- package/deps/_editor/base/Element.js +43 -0
- package/deps/_editor/base/Leaf.d.ts +3 -0
- package/deps/_editor/base/Leaf.js +36 -0
- package/deps/_editor/base/Support.d.ts +2 -0
- package/deps/_editor/base/Support.js +78 -0
- package/deps/_editor/base/types.d.ts +156 -0
- package/deps/_editor/base/types.js +10 -0
- package/deps/_editor/i18n.d.ts +1 -0
- package/deps/_editor/i18n.js +31 -0
- package/deps/_editor/tools/Button.d.ts +6 -0
- package/deps/_editor/tools/Button.js +86 -0
- package/deps/_editor/tools/ToolBar.d.ts +8 -0
- package/deps/_editor/tools/ToolBar.js +10 -0
- package/deps/_editor/tools/_BlockButton.d.ts +4 -0
- package/deps/_editor/tools/_BlockButton.js +77 -0
- package/deps/_editor/tools/_InsertButton.d.ts +6 -0
- package/deps/_editor/tools/_InsertButton.js +65 -0
- package/deps/_editor/tools/_MarkButton.d.ts +6 -0
- package/deps/_editor/tools/_MarkButton.js +45 -0
- package/deps/_editor/tools/_TxtButton.d.ts +7 -0
- package/deps/_editor/tools/_TxtButton.js +187 -0
- package/deps/_editor/utils/ParseHtml.d.ts +0 -0
- package/deps/_editor/utils/ParseHtml.js +220 -0
- package/deps/api-audit.d.ts +1 -0
- package/deps/api-audit.js +6 -0
- package/deps/api-data.d.ts +0 -0
- package/deps/api-data.js +1 -0
- package/deps/apis/useSource.d.ts +0 -0
- package/deps/apis/useSource.js +152 -0
- package/deps/echarts.d.ts +26 -0
- package/deps/echarts.js +71 -0
- package/deps/editor.d.ts +34 -0
- package/deps/editor.js +111 -0
- package/deps/registerEditor.d.ts +1 -0
- package/deps/registerEditor.js +15 -0
- package/hooks/_list.d.ts +87 -0
- package/hooks/_list.js +13 -0
- package/hooks/index.d.ts +14 -0
- package/hooks/index.js +49 -0
- package/hooks/useAjax.d.ts +14 -0
- package/hooks/useAjax.js +43 -0
- package/hooks/useAjaxAction.d.ts +13 -0
- package/hooks/useAjaxAction.js +42 -0
- package/hooks/useAjaxQuery.d.ts +40 -0
- package/hooks/useAjaxQuery.js +81 -0
- package/hooks/useApi.d.ts +69 -0
- package/hooks/useApi.js +352 -0
- package/hooks/useApiGlobal.d.ts +0 -0
- package/hooks/useApiGlobal.js +5 -0
- package/hooks/useApp.d.ts +243 -0
- package/hooks/useApp.js +17 -0
- package/hooks/useArray.d.ts +21 -0
- package/hooks/useArray.js +182 -0
- package/hooks/useCounter.d.ts +0 -0
- package/hooks/useCounter.js +82 -0
- package/hooks/useDefault.d.ts +6 -0
- package/hooks/useDefault.js +16 -0
- package/hooks/useDoLoad.d.ts +17 -0
- package/hooks/useDoLoad.js +44 -0
- package/hooks/useEffectFunction.d.ts +8 -0
- package/hooks/useEffectFunction.js +16 -0
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +23 -0
- package/hooks/useError.d.ts +5 -0
- package/hooks/useError.js +21 -0
- package/hooks/useFirstMountState.d.ts +6 -0
- package/hooks/useFirstMountState.js +18 -0
- package/hooks/useGenkey.d.ts +2 -0
- package/hooks/useGenkey.js +16 -0
- package/hooks/useGetSet.d.ts +11 -0
- package/hooks/useGetSet.js +27 -0
- package/hooks/useGlobal.d.ts +19 -0
- package/hooks/useGlobal.js +62 -0
- package/hooks/useGlobal_back.d.ts +1 -0
- package/hooks/useGlobal_back.js +11 -0
- package/hooks/useHover.d.ts +8 -0
- package/hooks/useHover.js +49 -0
- package/hooks/useMemoPromise.d.ts +6 -0
- package/hooks/useMemoPromise.js +42 -0
- package/hooks/useModals.d.ts +40 -0
- package/hooks/useModals.js +98 -0
- package/hooks/useMountedState.d.ts +5 -0
- package/hooks/useMountedState.js +20 -0
- package/hooks/useOpenState.d.ts +28 -0
- package/hooks/useOpenState.js +23 -0
- package/hooks/usePromise.d.ts +7 -0
- package/hooks/usePromise.js +22 -0
- package/hooks/useQueue.d.ts +12 -0
- package/hooks/useQueue.js +34 -0
- package/hooks/useSetState.d.ts +9 -0
- package/hooks/useSetState.js +26 -0
- package/hooks/useStateList.d.ts +13 -0
- package/hooks/useStateList.js +59 -0
- package/hooks/useToggle.d.ts +6 -0
- package/hooks/useToggle.js +12 -0
- package/hooks/useUnmountPromise.d.ts +6 -0
- package/hooks/useUnmountPromise.js +36 -0
- package/hooks/useUpdate.d.ts +7 -0
- package/hooks/useUpdate.js +15 -0
- package/hooks/useUpdateEffect.d.ts +6 -0
- package/hooks/useUpdateEffect.js +18 -0
- package/index.d.ts +139 -0
- package/index.js +161 -0
- package/login/Base65.d.ts +8 -0
- package/login/Base65.js +65 -0
- package/login/Password.d.ts +61 -0
- package/login/Password.js +124 -0
- package/login/SM4.d.ts +20 -0
- package/login/SM4.js +193 -0
- package/login/cems/index.d.ts +10 -0
- package/login/cems/index.js +17 -0
- package/login/jit/index.d.ts +32 -0
- package/login/jit/index.js +180 -0
- package/login/jit/pnxclient.d.ts +54 -0
- package/login/jit/pnxclient.js +575 -0
- package/login/sso/index.d.ts +0 -0
- package/login/sso/index.js +0 -0
- package/login/vap/index.d.ts +1 -0
- package/login/vap/index.js +6 -0
- package/login/xrtx/index.d.ts +2 -0
- package/login/xrtx/index.js +33 -0
- package/package.json +1 -0
- package/screen/Comment.d.ts +31 -0
- package/screen/Comment.js +29 -0
- package/screen/EchartContent.d.ts +0 -0
- package/screen/EchartContent.js +63 -0
- package/screen/Page.d.ts +13 -0
- package/screen/Page.js +74 -0
- package/screen/index.d.ts +3 -0
- package/screen/index.js +9 -0
- package/screen/render.d.ts +5 -0
- package/screen/render.js +10 -0
- package/utils/Ajax.d.ts +85 -0
- package/utils/Ajax.js +147 -0
- package/utils/ArrayUtil.d.ts +22 -0
- package/utils/ArrayUtil.js +51 -0
- package/utils/CacheUtil.d.ts +20 -0
- package/utils/CacheUtil.js +86 -0
- package/utils/Const.d.ts +14 -0
- package/utils/Const.js +37 -0
- package/utils/CustomApp.d.ts +242 -0
- package/utils/CustomApp.js +18 -0
- package/utils/EventUtil.d.ts +22 -0
- package/utils/EventUtil.js +63 -0
- package/utils/Format.d.ts +28 -0
- package/utils/Format.js +206 -0
- package/utils/Global.d.ts +276 -0
- package/utils/Global.js +125 -0
- package/utils/Logger.d.ts +5 -0
- package/utils/Logger.js +32 -0
- package/utils/PageUtil.d.ts +24 -0
- package/utils/PageUtil.js +87 -0
- package/utils/Renders/ApiGetRender.d.ts +23 -0
- package/utils/Renders/ApiGetRender.js +192 -0
- package/utils/Renders/ApiPostRender.d.ts +17 -0
- package/utils/Renders/ApiPostRender.js +161 -0
- package/utils/Renders/DateRender.d.ts +8 -0
- package/utils/Renders/DateRender.js +35 -0
- package/utils/Renders/DictRender.d.ts +23 -0
- package/utils/Renders/DictRender.js +258 -0
- package/utils/Renders/FileRender.d.ts +3 -0
- package/utils/Renders/FileRender.js +46 -0
- package/utils/Renders/ListRender.d.ts +23 -0
- package/utils/Renders/ListRender.js +111 -0
- package/utils/Renders/NumberRender.d.ts +19 -0
- package/utils/Renders/NumberRender.js +65 -0
- package/utils/Renders/StatusRender.d.ts +12 -0
- package/utils/Renders/StatusRender.js +68 -0
- package/utils/Renders/StringRender.d.ts +14 -0
- package/utils/Renders/StringRender.js +194 -0
- package/utils/Renders/_define.d.ts +26 -0
- package/utils/Renders/_define.js +64 -0
- package/utils/Renders/index.d.ts +9 -0
- package/utils/Renders/index.js +42 -0
- package/utils/StringUtil.d.ts +124 -0
- package/utils/StringUtil.js +352 -0
- package/utils/TreeUtil.d.ts +42 -0
- package/utils/TreeUtil.js +69 -0
- package/utils/VAP.d.ts +16 -0
- package/utils/VAP.js +78 -0
- package/utils/XHR.d.ts +9 -0
- package/utils/XHR.js +53 -0
- package/utils/_AjaxUtil.d.ts +11 -0
- package/utils/_AjaxUtil.js +45 -0
- package/utils/_Support.d.ts +22 -0
- package/utils/_Support.js +106 -0
- package/utils/i18n.d.ts +60 -0
- package/utils/i18n.js +184 -0
- package/utils/index.d.ts +19 -0
- package/utils/index.js +54 -0
- package/utils/screenful.d.ts +15 -0
- package/utils/screenful.js +64 -0
- package/widget/index.d.ts +39 -0
- package/widget/index.js +21 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BlockButton = exports.TEXT_ALIGN_TYPES = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const slate_react_1 = require("slate-react");
|
|
9
|
+
const Icon_1 = require("../../../components/_adapt/Icon");
|
|
10
|
+
const utils_1 = require("../../../utils");
|
|
11
|
+
const slate_1 = require("slate");
|
|
12
|
+
const LIST_TYPES = ['numberedList', 'bulletedList'];
|
|
13
|
+
exports.TEXT_ALIGN_TYPES = ['left', 'center', 'right', 'justify'];
|
|
14
|
+
const toggleBlock = (editor, format) => {
|
|
15
|
+
const isActive = isBlockActive(editor, format, exports.TEXT_ALIGN_TYPES.includes(format) ? 'align' : 'type');
|
|
16
|
+
const isList = LIST_TYPES.includes(format);
|
|
17
|
+
slate_1.Transforms.unwrapNodes(editor, {
|
|
18
|
+
match: n => !slate_1.Editor.isEditor(n) &&
|
|
19
|
+
slate_1.Element.isElement(n) &&
|
|
20
|
+
LIST_TYPES.includes(n.type) &&
|
|
21
|
+
!exports.TEXT_ALIGN_TYPES.includes(format),
|
|
22
|
+
split: true,
|
|
23
|
+
});
|
|
24
|
+
let newProperties;
|
|
25
|
+
if (exports.TEXT_ALIGN_TYPES.includes(format)) {
|
|
26
|
+
newProperties = {
|
|
27
|
+
align: isActive ? undefined : format,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
newProperties = {
|
|
32
|
+
type: isActive ? 'paragraph' : isList ? 'list-item' : format,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
slate_1.Transforms.setNodes(editor, newProperties);
|
|
36
|
+
if (!isActive && isList) {
|
|
37
|
+
const block = { type: format, children: [] };
|
|
38
|
+
slate_1.Transforms.wrapNodes(editor, block);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const isBlockActive = (editor, format, blockType = 'type') => {
|
|
42
|
+
const { selection } = editor;
|
|
43
|
+
if (!selection)
|
|
44
|
+
return false;
|
|
45
|
+
const [match] = Array.from(slate_1.Editor.nodes(editor, {
|
|
46
|
+
at: slate_1.Editor.unhangRange(editor, selection),
|
|
47
|
+
match: n => !slate_1.Editor.isEditor(n) &&
|
|
48
|
+
slate_1.Element.isElement(n) &&
|
|
49
|
+
n[blockType] === format,
|
|
50
|
+
}));
|
|
51
|
+
return !!match;
|
|
52
|
+
};
|
|
53
|
+
const BlockButton = ({ icon, ik, cmd, disabled }) => {
|
|
54
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
55
|
+
const clazz = ['editor-icon', 'editor-icon-block'];
|
|
56
|
+
const isActive = isBlockActive(editor, cmd, exports.TEXT_ALIGN_TYPES.includes(cmd) ? 'align' : 'type');
|
|
57
|
+
if (isActive) {
|
|
58
|
+
clazz.push('editor-icon-marked');
|
|
59
|
+
}
|
|
60
|
+
if (disabled) {
|
|
61
|
+
clazz.push('editor-icon-disabled');
|
|
62
|
+
}
|
|
63
|
+
return react_1.default.createElement(Icon_1.Icon, { className: clazz.join(' '), type: icon, title: utils_1.i18n.txt(ik), onClick: () => toggleBlock(editor, cmd) });
|
|
64
|
+
// return (
|
|
65
|
+
// <Button
|
|
66
|
+
// active={ }
|
|
67
|
+
// onMouseDown={event => {
|
|
68
|
+
// event.preventDefault()
|
|
69
|
+
// toggleBlock(editor, cmd)
|
|
70
|
+
// }}
|
|
71
|
+
// >
|
|
72
|
+
// <Icon>{icon}</Icon>
|
|
73
|
+
// </Button>
|
|
74
|
+
// )
|
|
75
|
+
// return <Icon className={clazz.join(' ')} type={icon} title={i18n.txt(ik)}></Icon>
|
|
76
|
+
};
|
|
77
|
+
exports.BlockButton = BlockButton;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '../base/types';
|
|
3
|
+
export declare const HR: React.FC<ButtonProps>;
|
|
4
|
+
export declare const Audio: React.FC<ButtonProps>;
|
|
5
|
+
export declare const Video: React.FC<ButtonProps>;
|
|
6
|
+
export declare const Picture: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Picture = exports.Video = exports.Audio = exports.HR = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const slate_react_1 = require("slate-react");
|
|
9
|
+
const UploadImage_1 = require("../../../components/Upload/UploadImage");
|
|
10
|
+
const UForm_1 = require("../../../components/UForm");
|
|
11
|
+
const Icon_1 = require("../../../components/_adapt/Icon");
|
|
12
|
+
const utils_1 = require("../../../utils");
|
|
13
|
+
const slate_1 = require("slate");
|
|
14
|
+
const Dropdown_1 = require("../../../components/_adapt/Dropdown");
|
|
15
|
+
const Modal_1 = require("../../../components/_adapt/Modal");
|
|
16
|
+
const hooks_1 = require("../../../hooks");
|
|
17
|
+
const insertImage = (editor, url) => {
|
|
18
|
+
const text = { text: '' };
|
|
19
|
+
const image = { type: 'image', url, children: [text] };
|
|
20
|
+
slate_1.Transforms.insertNodes(editor, image);
|
|
21
|
+
};
|
|
22
|
+
const HR = ({ icon, ik, cmd, disabled }) => {
|
|
23
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
24
|
+
return react_1.default.createElement(Icon_1.Icon, { className: 'editor-icon', type: icon, title: utils_1.i18n.txt(ik), onClick: () => slate_1.Transforms.insertNodes(editor, { type: 'hr', children: [{ text: '' }] }) });
|
|
25
|
+
};
|
|
26
|
+
exports.HR = HR;
|
|
27
|
+
const Audio = ({ icon, ik, cmd }) => {
|
|
28
|
+
const clazz = ['editor-icon'];
|
|
29
|
+
return react_1.default.createElement(Icon_1.Icon, { className: clazz.join(' '), type: icon, title: utils_1.i18n.txt(ik) });
|
|
30
|
+
};
|
|
31
|
+
exports.Audio = Audio;
|
|
32
|
+
const Video = ({ icon, ik, cmd }) => {
|
|
33
|
+
const clazz = ['editor-icon'];
|
|
34
|
+
return react_1.default.createElement(Icon_1.Icon, { className: clazz.join(' '), type: icon, title: utils_1.i18n.txt(ik) });
|
|
35
|
+
};
|
|
36
|
+
exports.Video = Video;
|
|
37
|
+
const Picture = ({ icon, ik, cmd, disabled }) => {
|
|
38
|
+
const uploadState = (0, hooks_1.useToggle)();
|
|
39
|
+
const inputState = (0, hooks_1.useToggle)();
|
|
40
|
+
const selectState = (0, hooks_1.useToggle)();
|
|
41
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
42
|
+
const clazz = ['editor-icon', 'vicon', 'vicon-' + icon];
|
|
43
|
+
if (disabled) {
|
|
44
|
+
clazz.push('editor-icon-disabled');
|
|
45
|
+
}
|
|
46
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
47
|
+
react_1.default.createElement(Dropdown_1.Dropdown, { placement: "bottomLeft", arrow: true, menu: {
|
|
48
|
+
items: [
|
|
49
|
+
{ key: 1, label: "上传图片", onClick: uploadState[1] },
|
|
50
|
+
// { key: 2, label: "从图库中选择", onClick: selectState[1] },
|
|
51
|
+
{ key: 3, label: "输入图片URL", onClick: inputState[1] },
|
|
52
|
+
]
|
|
53
|
+
} },
|
|
54
|
+
react_1.default.createElement("span", { className: clazz.join(' '), title: utils_1.i18n.txt(ik) })),
|
|
55
|
+
react_1.default.createElement(Modal_1.Modal, { title: "\u4E0A\u4F20\u56FE\u7247", open: uploadState[0], onCancel: uploadState[1], footer: null },
|
|
56
|
+
react_1.default.createElement(UploadImage_1.UploadImage, { onChange: (url) => {
|
|
57
|
+
} })),
|
|
58
|
+
react_1.default.createElement(Modal_1.Modal, { title: "\u4ECE\u56FE\u5E93\u4E2D\u9009\u62E9", open: selectState[0], onCancel: selectState[1], footer: null }),
|
|
59
|
+
react_1.default.createElement(UForm_1.UFormModal, { title: "\u8F93\u5165\u56FE\u7247\u5730\u5740", open: inputState[0], onCancel: inputState[1], default: { url: 'http://localhost/images/logo.png' }, fields: [
|
|
60
|
+
{ field: 'url', title: '图片地址', required: true }
|
|
61
|
+
], onOk: (data) => {
|
|
62
|
+
insertImage(editor, data.url);
|
|
63
|
+
} }));
|
|
64
|
+
};
|
|
65
|
+
exports.Picture = Picture;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MarkButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Icon_1 = require("../../../components/_adapt/Icon");
|
|
9
|
+
const slate_1 = require("slate");
|
|
10
|
+
const slate_react_1 = require("slate-react");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
|
+
const isMarkActive = (editor, cmd) => {
|
|
13
|
+
const marks = slate_1.Editor.marks(editor);
|
|
14
|
+
return marks ? marks[cmd] === true : false;
|
|
15
|
+
};
|
|
16
|
+
const toggleMark = (editor, cmd) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
if (isMarkActive(editor, cmd)) {
|
|
19
|
+
if (((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset)) {
|
|
20
|
+
editor.select(editor.selection.focus.path);
|
|
21
|
+
}
|
|
22
|
+
slate_1.Editor.removeMark(editor, cmd);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
slate_1.Editor.addMark(editor, cmd, true);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const MarkButton = ({ icon, ik, cmd, disabled }) => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
31
|
+
const clazz = ['editor-icon', 'editor-icon-mark'];
|
|
32
|
+
if (disabled) {
|
|
33
|
+
clazz.push('editor-icon-disabled');
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (isMarkActive(editor, cmd)) {
|
|
37
|
+
clazz.push('editor-icon-marked');
|
|
38
|
+
}
|
|
39
|
+
else if (((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset)) {
|
|
40
|
+
clazz.push('editor-icon-disabled');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return react_1.default.createElement(Icon_1.Icon, { className: clazz.join(' '), type: icon, title: utils_1.i18n.txt(ik), onClick: () => toggleMark(editor, cmd) });
|
|
44
|
+
};
|
|
45
|
+
exports.MarkButton = MarkButton;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonProps } from '../base/types';
|
|
3
|
+
export declare const Link: React.FC<ButtonProps>;
|
|
4
|
+
export declare const FontFamily: React.FC<ButtonProps>;
|
|
5
|
+
export declare const FontSize: React.FC<ButtonProps>;
|
|
6
|
+
export declare const Color: React.FC<ButtonProps>;
|
|
7
|
+
export declare const BgColor: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BgColor = exports.Color = exports.FontSize = exports.FontFamily = exports.Link = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const slate_1 = require("slate");
|
|
9
|
+
const slate_react_1 = require("slate-react");
|
|
10
|
+
const types_1 = require("../base/types");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
|
+
const antd_1 = require("antd");
|
|
13
|
+
const Button_1 = require("../../../components/_adapt/Button");
|
|
14
|
+
const Select_1 = require("../../../components/_adapt/Select");
|
|
15
|
+
const UForm_1 = require("../../../components/UForm");
|
|
16
|
+
const Icon_1 = require("../../../components/_adapt/Icon");
|
|
17
|
+
const hooks_1 = require("../../../hooks");
|
|
18
|
+
const ColorPicker_1 = require("../../../components/_adapt/todo/ColorPicker");
|
|
19
|
+
const markValue = (editor, cmd) => {
|
|
20
|
+
const marks = slate_1.Editor.marks(editor);
|
|
21
|
+
if (marks && marks[cmd]) {
|
|
22
|
+
return marks[cmd];
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
};
|
|
26
|
+
const setValue = (editor, cmd, value) => {
|
|
27
|
+
var _a, _b;
|
|
28
|
+
if (value == null || value == '') {
|
|
29
|
+
const notSelected = ((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset);
|
|
30
|
+
if (notSelected) {
|
|
31
|
+
editor.select(editor.selection.focus.path);
|
|
32
|
+
}
|
|
33
|
+
slate_1.Editor.removeMark(editor, cmd);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// if (hasSection) {
|
|
37
|
+
slate_1.Editor.addMark(editor, cmd, value);
|
|
38
|
+
// editor.select(editor.selection.focus.path);
|
|
39
|
+
// }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const Link = ({ icon, ik, cmd, disabled }) => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
45
|
+
const [openModal, showModal] = (0, hooks_1.useToggle)();
|
|
46
|
+
const value = markValue(editor, cmd);
|
|
47
|
+
const clazz = ['editor-icon', 'editor-icon-mark'];
|
|
48
|
+
if (value)
|
|
49
|
+
clazz.push('editor-icon-marked');
|
|
50
|
+
if (disabled || (value == null && ((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset))) {
|
|
51
|
+
clazz.push('editor-icon-disabled');
|
|
52
|
+
}
|
|
53
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
54
|
+
value ? react_1.default.createElement(antd_1.Popover, { placement: "bottomLeft", content: react_1.default.createElement("div", { style: { width: 320 } },
|
|
55
|
+
react_1.default.createElement("p", null,
|
|
56
|
+
"\u94FE\u63A5\u5230 : ",
|
|
57
|
+
react_1.default.createElement("a", { href: value, target: '_blank' }, value)),
|
|
58
|
+
react_1.default.createElement("p", null,
|
|
59
|
+
react_1.default.createElement(Button_1.Button, { type: 'primary', style: { marginRight: 6 }, onClick: () => showModal() }, "\u4FEE\u6539\u5730\u5740"),
|
|
60
|
+
react_1.default.createElement(Button_1.Button, { danger: true, onClick: () => setValue(editor, cmd, null) }, "\u5220\u9664\u94FE\u63A5"))) },
|
|
61
|
+
react_1.default.createElement("span", { className: 'vicon vicon-link editor-icon editor-icon-mark editor-icon-marked vicon-clickable', title: utils_1.i18n.txt(ik), onClick: () => showModal() })) : react_1.default.createElement(Icon_1.Icon, { className: clazz.join(' '), type: icon, title: utils_1.i18n.txt(ik), onClick: showModal }),
|
|
62
|
+
react_1.default.createElement(UForm_1.UFormModal, { title: '添加链接', open: openModal, onCancel: showModal, data: { url: value }, fields: [
|
|
63
|
+
{ field: 'url', type: 'url', title: '链接地址' },
|
|
64
|
+
], onOk: (data) => {
|
|
65
|
+
showModal();
|
|
66
|
+
setValue(editor, cmd, data.url);
|
|
67
|
+
} }));
|
|
68
|
+
};
|
|
69
|
+
exports.Link = Link;
|
|
70
|
+
const FontFamily = ({ icon, ik, cmd }) => {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
73
|
+
const value = markValue(editor, cmd) || undefined;
|
|
74
|
+
const notSelected = ((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset);
|
|
75
|
+
return react_1.default.createElement(Select_1.Select, { size: 'small', value: value, disabled: value === undefined && notSelected, style: { width: 72, marginRight: 6 }, placeholder: "\u5B57\u4F53",
|
|
76
|
+
// onSelect={()=>{
|
|
77
|
+
// }}
|
|
78
|
+
// onClick={(evt) => PageUtil.stopEvent(evt)}
|
|
79
|
+
onChange: val => {
|
|
80
|
+
if (val == 0) {
|
|
81
|
+
setValue(editor, cmd, null);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
setValue(editor, cmd, val);
|
|
85
|
+
}
|
|
86
|
+
} },
|
|
87
|
+
react_1.default.createElement(Select_1.Select.Option, { value: 1 },
|
|
88
|
+
react_1.default.createElement("span", { style: { fontFamily: types_1.FontFamilyTexts[1] } }, "\u9ED1\u4F53")),
|
|
89
|
+
react_1.default.createElement(Select_1.Select.Option, { value: 2 },
|
|
90
|
+
react_1.default.createElement("span", { style: { fontFamily: types_1.FontFamilyTexts[2] } }, "\u5B8B\u4F53")),
|
|
91
|
+
react_1.default.createElement(Select_1.Select.Option, { value: 3 },
|
|
92
|
+
react_1.default.createElement("span", { style: { fontFamily: types_1.FontFamilyTexts[3] } }, "\u6977\u4F53")),
|
|
93
|
+
react_1.default.createElement(Select_1.Select.Option, { value: 4 },
|
|
94
|
+
react_1.default.createElement("span", { style: { fontFamily: types_1.FontFamilyTexts[4] } }, "\u82F1\u6587")),
|
|
95
|
+
react_1.default.createElement(Select_1.Select.Option, { value: 0 }, "\u6E05\u9664"));
|
|
96
|
+
};
|
|
97
|
+
exports.FontFamily = FontFamily;
|
|
98
|
+
const FontSize = ({ icon, ik, cmd, disabled }) => {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
101
|
+
const value = markValue(editor, cmd) || 12;
|
|
102
|
+
const clazz = ['editor-tool-font'];
|
|
103
|
+
if (disabled || (((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset))) {
|
|
104
|
+
clazz.push('editor-icon-disabled');
|
|
105
|
+
}
|
|
106
|
+
return react_1.default.createElement(antd_1.Popover, { placement: "bottomLeft", content: react_1.default.createElement("div", { style: { width: 240, }, onClick: utils_1.PageUtil.stopEvent },
|
|
107
|
+
react_1.default.createElement(antd_1.Slider, { value: value, min: 12, max: 60, onChange: (val) => setValue(editor, cmd, val) })) },
|
|
108
|
+
react_1.default.createElement("span", { className: clazz.join(' ') },
|
|
109
|
+
"\u5B57\u53F7 : ",
|
|
110
|
+
react_1.default.createElement("b", { className: 'vapfont' },
|
|
111
|
+
value,
|
|
112
|
+
"px")));
|
|
113
|
+
};
|
|
114
|
+
exports.FontSize = FontSize;
|
|
115
|
+
const ColorProps = {
|
|
116
|
+
format: "hex",
|
|
117
|
+
presets: [
|
|
118
|
+
{
|
|
119
|
+
label: '常用',
|
|
120
|
+
colors: [
|
|
121
|
+
'#000000',
|
|
122
|
+
'#000000E0',
|
|
123
|
+
'#000000A6',
|
|
124
|
+
'#00000073',
|
|
125
|
+
'#00000040',
|
|
126
|
+
'#00000026',
|
|
127
|
+
'#0000001A',
|
|
128
|
+
'#00000012',
|
|
129
|
+
'#0000000A',
|
|
130
|
+
'#00000005',
|
|
131
|
+
'#F5222D',
|
|
132
|
+
'#FA8C16',
|
|
133
|
+
'#FADB14',
|
|
134
|
+
'#8BBB11',
|
|
135
|
+
'#52C41A',
|
|
136
|
+
'#13A8A8',
|
|
137
|
+
'#1677FF',
|
|
138
|
+
'#2F54EB',
|
|
139
|
+
'#722ED1',
|
|
140
|
+
'#EB2F96',
|
|
141
|
+
'#F5222D4D',
|
|
142
|
+
'#FA8C164D',
|
|
143
|
+
'#FADB144D',
|
|
144
|
+
'#8BBB114D',
|
|
145
|
+
'#52C41A4D',
|
|
146
|
+
'#13A8A84D',
|
|
147
|
+
'#1677FF4D',
|
|
148
|
+
'#2F54EB4D',
|
|
149
|
+
'#722ED14D',
|
|
150
|
+
'#EB2F964D',
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
]
|
|
154
|
+
};
|
|
155
|
+
const Color = ({ icon, ik, cmd, disabled }) => {
|
|
156
|
+
var _a, _b;
|
|
157
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
158
|
+
const value = markValue(editor, cmd);
|
|
159
|
+
const clazz = ['editor-icon', 'editor-icon-mark', 'vicon', 'vicon-' + icon];
|
|
160
|
+
if (disabled || (((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset))) {
|
|
161
|
+
clazz.push('editor-icon-disabled');
|
|
162
|
+
}
|
|
163
|
+
const style = {};
|
|
164
|
+
if (value) {
|
|
165
|
+
style.color = value;
|
|
166
|
+
style.fontWeight = 'bold';
|
|
167
|
+
}
|
|
168
|
+
return react_1.default.createElement(ColorPicker_1.ColorPicker, Object.assign({}, ColorProps, { onChange: (val, hex) => setValue(editor, cmd, hex) }),
|
|
169
|
+
react_1.default.createElement("span", { className: clazz.join(' '), style: style }));
|
|
170
|
+
};
|
|
171
|
+
exports.Color = Color;
|
|
172
|
+
const BgColor = ({ icon, ik, cmd, disabled }) => {
|
|
173
|
+
var _a, _b;
|
|
174
|
+
const editor = (0, slate_react_1.useSlate)();
|
|
175
|
+
const value = markValue(editor, cmd);
|
|
176
|
+
const clazz = ['editor-icon', 'editor-icon-mark', 'vicon', 'vicon-' + icon];
|
|
177
|
+
if (disabled || (((_a = editor.selection) === null || _a === void 0 ? void 0 : _a.focus.offset) == ((_b = editor.selection) === null || _b === void 0 ? void 0 : _b.anchor.offset))) {
|
|
178
|
+
clazz.push('editor-icon-disabled');
|
|
179
|
+
}
|
|
180
|
+
const style = {};
|
|
181
|
+
if (value) {
|
|
182
|
+
style.backgroundColor = value;
|
|
183
|
+
}
|
|
184
|
+
return react_1.default.createElement(ColorPicker_1.ColorPicker, Object.assign({}, ColorProps, { onChange: (val, hex) => setValue(editor, cmd, hex) }),
|
|
185
|
+
react_1.default.createElement("span", { className: clazz.join(' '), style: style }));
|
|
186
|
+
};
|
|
187
|
+
exports.BgColor = BgColor;
|
|
File without changes
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// import React, { useCallback, useMemo } from 'react'
|
|
2
|
+
// import { jsx } from 'slate-hyperscript'
|
|
3
|
+
// import { Transforms, createEditor, Descendant } from 'slate'
|
|
4
|
+
// import { withHistory } from 'slate-history'
|
|
5
|
+
// import { css } from '@emotion/css'
|
|
6
|
+
// import {
|
|
7
|
+
// Slate,
|
|
8
|
+
// Editable,
|
|
9
|
+
// withReact,
|
|
10
|
+
// useSelected,
|
|
11
|
+
// useFocused,
|
|
12
|
+
// } from 'slate-react'
|
|
13
|
+
// const ELEMENT_TAGS = {
|
|
14
|
+
// A: el => ({ type: 'link', url: el.getAttribute('href') }),
|
|
15
|
+
// BLOCKQUOTE: () => ({ type: 'quote' }),
|
|
16
|
+
// H1: () => ({ type: 'heading-one' }),
|
|
17
|
+
// H2: () => ({ type: 'heading-two' }),
|
|
18
|
+
// H3: () => ({ type: 'heading-three' }),
|
|
19
|
+
// H4: () => ({ type: 'heading-four' }),
|
|
20
|
+
// H5: () => ({ type: 'heading-five' }),
|
|
21
|
+
// H6: () => ({ type: 'heading-six' }),
|
|
22
|
+
// IMG: el => ({ type: 'image', url: el.getAttribute('src') }),
|
|
23
|
+
// LI: () => ({ type: 'list-item' }),
|
|
24
|
+
// OL: () => ({ type: 'numbered-list' }),
|
|
25
|
+
// P: () => ({ type: 'paragraph' }),
|
|
26
|
+
// PRE: () => ({ type: 'code' }),
|
|
27
|
+
// UL: () => ({ type: 'bulleted-list' }),
|
|
28
|
+
// }
|
|
29
|
+
// // COMPAT: `B` is omitted here because Google Docs uses `<b>` in weird ways.
|
|
30
|
+
// const TEXT_TAGS = {
|
|
31
|
+
// CODE: () => ({ code: true }),
|
|
32
|
+
// DEL: () => ({ strikethrough: true }),
|
|
33
|
+
// EM: () => ({ italic: true }),
|
|
34
|
+
// I: () => ({ italic: true }),
|
|
35
|
+
// S: () => ({ strikethrough: true }),
|
|
36
|
+
// STRONG: () => ({ bold: true }),
|
|
37
|
+
// U: () => ({ underline: true }),
|
|
38
|
+
// }
|
|
39
|
+
// export const deserialize = el => {
|
|
40
|
+
// if (el.nodeType === 3) {
|
|
41
|
+
// return el.textContent
|
|
42
|
+
// } else if (el.nodeType !== 1) {
|
|
43
|
+
// return null
|
|
44
|
+
// } else if (el.nodeName === 'BR') {
|
|
45
|
+
// return '\n'
|
|
46
|
+
// }
|
|
47
|
+
// const { nodeName } = el
|
|
48
|
+
// let parent = el
|
|
49
|
+
// if (
|
|
50
|
+
// nodeName === 'PRE' &&
|
|
51
|
+
// el.childNodes[0] &&
|
|
52
|
+
// el.childNodes[0].nodeName === 'CODE'
|
|
53
|
+
// ) {
|
|
54
|
+
// parent = el.childNodes[0]
|
|
55
|
+
// }
|
|
56
|
+
// let children = Array.from(parent.childNodes)
|
|
57
|
+
// .map(deserialize)
|
|
58
|
+
// .flat()
|
|
59
|
+
// if (children.length === 0) {
|
|
60
|
+
// children = [{ text: '' }]
|
|
61
|
+
// }
|
|
62
|
+
// if (el.nodeName === 'BODY') {
|
|
63
|
+
// return jsx('fragment', {}, children)
|
|
64
|
+
// }
|
|
65
|
+
// if (ELEMENT_TAGS[nodeName]) {
|
|
66
|
+
// const attrs = ELEMENT_TAGS[nodeName](el)
|
|
67
|
+
// return jsx('element', attrs, children)
|
|
68
|
+
// }
|
|
69
|
+
// if (TEXT_TAGS[nodeName]) {
|
|
70
|
+
// const attrs = TEXT_TAGS[nodeName](el)
|
|
71
|
+
// return children.map(child => jsx('text', attrs, child))
|
|
72
|
+
// }
|
|
73
|
+
// return children
|
|
74
|
+
// }
|
|
75
|
+
// const PasteHtmlExample = () => {
|
|
76
|
+
// const renderElement = useCallback(props => <Element {...props} />, [])
|
|
77
|
+
// const renderLeaf = useCallback(props => <Leaf {...props} />, [])
|
|
78
|
+
// const editor = useMemo(
|
|
79
|
+
// () => withHtml(withReact(withHistory(createEditor()))),
|
|
80
|
+
// []
|
|
81
|
+
// )
|
|
82
|
+
// return (
|
|
83
|
+
// <Slate editor={editor} value={initialValue}>
|
|
84
|
+
// <Editable
|
|
85
|
+
// renderElement={renderElement}
|
|
86
|
+
// renderLeaf={renderLeaf}
|
|
87
|
+
// placeholder="Paste in some HTML..."
|
|
88
|
+
// />
|
|
89
|
+
// </Slate>
|
|
90
|
+
// )
|
|
91
|
+
// }
|
|
92
|
+
// const withHtml = editor => {
|
|
93
|
+
// const { insertData, isInline, isVoid } = editor
|
|
94
|
+
// editor.isInline = element => {
|
|
95
|
+
// return element.type === 'link' ? true : isInline(element)
|
|
96
|
+
// }
|
|
97
|
+
// editor.isVoid = element => {
|
|
98
|
+
// return element.type === 'image' ? true : isVoid(element)
|
|
99
|
+
// }
|
|
100
|
+
// editor.insertData = data => {
|
|
101
|
+
// const html = data.getData('text/html')
|
|
102
|
+
// if (html) {
|
|
103
|
+
// const parsed = new DOMParser().parseFromString(html, 'text/html')
|
|
104
|
+
// const fragment = deserialize(parsed.body)
|
|
105
|
+
// Transforms.insertFragment(editor, fragment)
|
|
106
|
+
// return
|
|
107
|
+
// }
|
|
108
|
+
// insertData(data)
|
|
109
|
+
// }
|
|
110
|
+
// return editor
|
|
111
|
+
// }
|
|
112
|
+
// const Element = props => {
|
|
113
|
+
// const { attributes, children, element } = props
|
|
114
|
+
// switch (element.type) {
|
|
115
|
+
// default:
|
|
116
|
+
// return <p {...attributes}>{children}</p>
|
|
117
|
+
// case 'quote':
|
|
118
|
+
// return <blockquote {...attributes}>{children}</blockquote>
|
|
119
|
+
// case 'code':
|
|
120
|
+
// return (
|
|
121
|
+
// <pre>
|
|
122
|
+
// <code {...attributes}>{children}</code>
|
|
123
|
+
// </pre>
|
|
124
|
+
// )
|
|
125
|
+
// case 'bulleted-list':
|
|
126
|
+
// return <ul {...attributes}>{children}</ul>
|
|
127
|
+
// case 'heading-one':
|
|
128
|
+
// return <h1 {...attributes}>{children}</h1>
|
|
129
|
+
// case 'heading-two':
|
|
130
|
+
// return <h2 {...attributes}>{children}</h2>
|
|
131
|
+
// case 'heading-three':
|
|
132
|
+
// return <h3 {...attributes}>{children}</h3>
|
|
133
|
+
// case 'heading-four':
|
|
134
|
+
// return <h4 {...attributes}>{children}</h4>
|
|
135
|
+
// case 'heading-five':
|
|
136
|
+
// return <h5 {...attributes}>{children}</h5>
|
|
137
|
+
// case 'heading-six':
|
|
138
|
+
// return <h6 {...attributes}>{children}</h6>
|
|
139
|
+
// case 'list-item':
|
|
140
|
+
// return <li {...attributes}>{children}</li>
|
|
141
|
+
// case 'numbered-list':
|
|
142
|
+
// return <ol {...attributes}>{children}</ol>
|
|
143
|
+
// case 'link':
|
|
144
|
+
// return (
|
|
145
|
+
// <a href={element.url} {...attributes}>
|
|
146
|
+
// {children}
|
|
147
|
+
// </a>
|
|
148
|
+
// )
|
|
149
|
+
// case 'image':
|
|
150
|
+
// return <ImageElement {...props} />
|
|
151
|
+
// }
|
|
152
|
+
// }
|
|
153
|
+
// const ImageElement = ({ attributes, children, element }) => {
|
|
154
|
+
// const selected = useSelected()
|
|
155
|
+
// const focused = useFocused()
|
|
156
|
+
// return (
|
|
157
|
+
// <div {...attributes}>
|
|
158
|
+
// {children}
|
|
159
|
+
// <img
|
|
160
|
+
// src={element.url}
|
|
161
|
+
// className={css`
|
|
162
|
+
// display: block;
|
|
163
|
+
// max-width: 100%;
|
|
164
|
+
// max-height: 20em;
|
|
165
|
+
// box-shadow: ${selected && focused ? '0 0 0 2px blue;' : 'none'};
|
|
166
|
+
// `}
|
|
167
|
+
// />
|
|
168
|
+
// </div>
|
|
169
|
+
// )
|
|
170
|
+
// }
|
|
171
|
+
// const Leaf = ({ attributes, children, leaf }) => {
|
|
172
|
+
// if (leaf.bold) {
|
|
173
|
+
// children = <strong>{children}</strong>
|
|
174
|
+
// }
|
|
175
|
+
// if (leaf.code) {
|
|
176
|
+
// children = <code>{children}</code>
|
|
177
|
+
// }
|
|
178
|
+
// if (leaf.italic) {
|
|
179
|
+
// children = <em>{children}</em>
|
|
180
|
+
// }
|
|
181
|
+
// if (leaf.underline) {
|
|
182
|
+
// children = <u>{children}</u>
|
|
183
|
+
// }
|
|
184
|
+
// if (leaf.strikethrough) {
|
|
185
|
+
// children = <del>{children}</del>
|
|
186
|
+
// }
|
|
187
|
+
// return <span {...attributes}>{children}</span>
|
|
188
|
+
// }
|
|
189
|
+
// const initialValue: Descendant[] = [
|
|
190
|
+
// {
|
|
191
|
+
// type: 'paragraph',
|
|
192
|
+
// children: [
|
|
193
|
+
// {
|
|
194
|
+
// text:
|
|
195
|
+
// "By default, pasting content into a Slate editor will use the clipboard's ",
|
|
196
|
+
// },
|
|
197
|
+
// { text: "'text/plain'", code: true },
|
|
198
|
+
// {
|
|
199
|
+
// text:
|
|
200
|
+
// " data. That's okay for some use cases, but sometimes you want users to be able to paste in content and have it maintain its formatting. To do this, your editor needs to handle ",
|
|
201
|
+
// },
|
|
202
|
+
// { text: "'text/html'", code: true },
|
|
203
|
+
// { text: ' data. ' },
|
|
204
|
+
// ],
|
|
205
|
+
// },
|
|
206
|
+
// {
|
|
207
|
+
// type: 'paragraph',
|
|
208
|
+
// children: [{ text: 'This is an example of doing exactly that!' }],
|
|
209
|
+
// },
|
|
210
|
+
// {
|
|
211
|
+
// type: 'paragraph',
|
|
212
|
+
// children: [
|
|
213
|
+
// {
|
|
214
|
+
// text:
|
|
215
|
+
// "Try it out for yourself! Copy and paste some rendered HTML rich text content (not the source code) from another site into this editor and it's formatting should be preserved.",
|
|
216
|
+
// },
|
|
217
|
+
// ],
|
|
218
|
+
// },
|
|
219
|
+
// ]
|
|
220
|
+
// export default PasteHtmlExample
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLookUp: () => void;
|
|
File without changes
|
package/deps/api-data.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// export const
|
|
File without changes
|