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,89 @@
|
|
|
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.Image = 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 antd_1 = require("antd");
|
|
11
|
+
const slate_2 = require("slate");
|
|
12
|
+
const ImageViewer = ({ attributes, element, children, style }) => {
|
|
13
|
+
return react_1.default.createElement("div", Object.assign({}, attributes, { className: 'v-image', style: style }),
|
|
14
|
+
react_1.default.createElement("img", { src: element.url }));
|
|
15
|
+
};
|
|
16
|
+
const markValue = (editor, cmd) => {
|
|
17
|
+
const marks = slate_2.Editor.marks(editor);
|
|
18
|
+
if (marks && marks[cmd]) {
|
|
19
|
+
return marks[cmd];
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
};
|
|
23
|
+
const setValue = (editor, cmd, value) => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
if (value == null || value == '') {
|
|
26
|
+
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);
|
|
27
|
+
if (notSelected) {
|
|
28
|
+
editor.select(editor.selection.focus.path);
|
|
29
|
+
}
|
|
30
|
+
slate_2.Editor.removeMark(editor, cmd);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
slate_2.Editor.addMark(editor, cmd, value);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const ImageEditor = ({ attributes, element, children, style }) => {
|
|
37
|
+
const editor = (0, slate_react_1.useSlateStatic)();
|
|
38
|
+
const path = slate_react_1.ReactEditor.findPath(editor, element);
|
|
39
|
+
return react_1.default.createElement("div", Object.assign({}, attributes, { className: 'v-image', style: style }),
|
|
40
|
+
react_1.default.createElement("img", { src: element.url }),
|
|
41
|
+
children,
|
|
42
|
+
react_1.default.createElement("div", { contentEditable: false },
|
|
43
|
+
react_1.default.createElement(antd_1.Button, { icon: "delete",
|
|
44
|
+
// active
|
|
45
|
+
onClick: () => slate_1.Transforms.removeNodes(editor, { at: path }) })));
|
|
46
|
+
};
|
|
47
|
+
const Image = (props) => {
|
|
48
|
+
const isReadOnly = (0, slate_react_1.useReadOnly)();
|
|
49
|
+
if (!isReadOnly && props.isEditor) {
|
|
50
|
+
return react_1.default.createElement(ImageEditor, Object.assign({}, props));
|
|
51
|
+
}
|
|
52
|
+
return react_1.default.createElement(ImageViewer, Object.assign({}, props));
|
|
53
|
+
// const editor = useSlateStatic()
|
|
54
|
+
// const path = ReactEditor.findPath(editor, element);
|
|
55
|
+
// // editor.above
|
|
56
|
+
// const selected = useSelected()
|
|
57
|
+
// return <div {...attributes} className='v-image' style={style}>
|
|
58
|
+
// <img src={element.url}
|
|
59
|
+
// // className={css`
|
|
60
|
+
// // display: block;
|
|
61
|
+
// // max-width: 100%;
|
|
62
|
+
// // max-height: 20em;
|
|
63
|
+
// // box-shadow: ${selected && focused ? '0 0 0 3px #B4D5FF' : 'none'};
|
|
64
|
+
// // `}
|
|
65
|
+
// />
|
|
66
|
+
// {children}
|
|
67
|
+
// <div
|
|
68
|
+
// contentEditable={false}
|
|
69
|
+
// // className={css`
|
|
70
|
+
// // position: relative;
|
|
71
|
+
// // `}
|
|
72
|
+
// >
|
|
73
|
+
// <Button
|
|
74
|
+
// icon="delete"
|
|
75
|
+
// // active
|
|
76
|
+
// onClick={() => Transforms.removeNodes(editor, { at: path })}
|
|
77
|
+
// // className={css`
|
|
78
|
+
// // display: ${selected && focused ? 'inline' : 'none'};
|
|
79
|
+
// // position: absolute;
|
|
80
|
+
// // top: 0.5em;
|
|
81
|
+
// // left: 0.5em;
|
|
82
|
+
// // background-color: white;
|
|
83
|
+
// // `}
|
|
84
|
+
// >
|
|
85
|
+
// </Button>
|
|
86
|
+
// </div>
|
|
87
|
+
// </div>
|
|
88
|
+
};
|
|
89
|
+
exports.Image = Image;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Table Support Todo
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Video Support Todo
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Element = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const _Image_1 = require("../advance/_Image");
|
|
9
|
+
const Element = (props) => {
|
|
10
|
+
const { attributes, children, } = props;
|
|
11
|
+
const element = props.element;
|
|
12
|
+
const style = {};
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
if (element.align)
|
|
15
|
+
style.textAlign = element.align;
|
|
16
|
+
switch (element.type) {
|
|
17
|
+
case 'blockQuote':
|
|
18
|
+
return react_1.default.createElement("blockquote", Object.assign({ style: style }, attributes), children);
|
|
19
|
+
case 'bulletedList':
|
|
20
|
+
return react_1.default.createElement("ul", Object.assign({ style: style }, attributes), children);
|
|
21
|
+
case 'h1':
|
|
22
|
+
return react_1.default.createElement("h1", Object.assign({ style: style }, attributes), children);
|
|
23
|
+
case 'h2':
|
|
24
|
+
return react_1.default.createElement("h2", Object.assign({ style: style }, attributes), children);
|
|
25
|
+
case 'h3':
|
|
26
|
+
return react_1.default.createElement("h3", Object.assign({ style: style }, attributes), children);
|
|
27
|
+
case 'h4':
|
|
28
|
+
return react_1.default.createElement("h4", Object.assign({ style: style }, attributes), children);
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
case 'list-item':
|
|
31
|
+
case 'listItem':
|
|
32
|
+
return react_1.default.createElement("li", Object.assign({ style: style }, attributes), children);
|
|
33
|
+
case 'numberedList':
|
|
34
|
+
return react_1.default.createElement("ol", Object.assign({ style: style }, attributes), children);
|
|
35
|
+
case 'hr':
|
|
36
|
+
return react_1.default.createElement("hr", Object.assign({ style: style }, attributes));
|
|
37
|
+
case 'image':
|
|
38
|
+
return react_1.default.createElement(_Image_1.Image, Object.assign({}, props, { style: style, isEditor: props.isEditor }));
|
|
39
|
+
default:
|
|
40
|
+
return react_1.default.createElement("p", Object.assign({ style: style }, attributes), children);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.Element = Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
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.Leaf = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
const Leaf = (props) => {
|
|
10
|
+
let leaf = props.leaf;
|
|
11
|
+
let children = props.children;
|
|
12
|
+
const style = {};
|
|
13
|
+
if (leaf.bold)
|
|
14
|
+
children = react_1.default.createElement("strong", null, children);
|
|
15
|
+
if (leaf.code)
|
|
16
|
+
children = react_1.default.createElement("code", null, children);
|
|
17
|
+
if (leaf.italic)
|
|
18
|
+
children = react_1.default.createElement("em", null, children);
|
|
19
|
+
if (leaf.underline)
|
|
20
|
+
children = react_1.default.createElement("u", null, children);
|
|
21
|
+
if (leaf.strikethrough)
|
|
22
|
+
children = react_1.default.createElement("del", null, children);
|
|
23
|
+
if (leaf.link)
|
|
24
|
+
children = react_1.default.createElement("a", { href: leaf.link, target: "_blank" }, children);
|
|
25
|
+
if (leaf.fontSize)
|
|
26
|
+
style.fontSize = leaf.fontSize;
|
|
27
|
+
if (leaf.fontFamily && leaf.fontFamily > 0 && leaf.fontFamily < 5) {
|
|
28
|
+
style.fontFamily = types_1.FontFamilyTexts[leaf.fontFamily];
|
|
29
|
+
}
|
|
30
|
+
if (leaf.color)
|
|
31
|
+
style.color = leaf.color;
|
|
32
|
+
if (leaf.bgColor)
|
|
33
|
+
style.backgroundColor = leaf.bgColor;
|
|
34
|
+
return react_1.default.createElement("span", Object.assign({}, props.attributes, { style: style }), children);
|
|
35
|
+
};
|
|
36
|
+
exports.Leaf = Leaf;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.supportVoid = void 0;
|
|
4
|
+
// import { Transforms, createEditor, Descendant } from 'slate'
|
|
5
|
+
// import { ImageElement } from './types'
|
|
6
|
+
// const isImageUrl = url => {
|
|
7
|
+
// if (!url) return false
|
|
8
|
+
// if (!isUrl(url)) return false
|
|
9
|
+
// const ext = new URL(url).pathname.split('.').pop()
|
|
10
|
+
// return imageExtensions.includes(ext)
|
|
11
|
+
// }
|
|
12
|
+
const VOID_SET = new Set(['image', 'video', 'audio']);
|
|
13
|
+
const supportVoid = (editor) => {
|
|
14
|
+
const { isVoid } = editor;
|
|
15
|
+
editor.isVoid = element => {
|
|
16
|
+
if (VOID_SET.has(element.type)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return isVoid(element);
|
|
20
|
+
};
|
|
21
|
+
return editor;
|
|
22
|
+
// editor.insertData = data => {
|
|
23
|
+
// const text = data.getData('text/plain')
|
|
24
|
+
// const { files } = data
|
|
25
|
+
// if (files && files.length > 0) {
|
|
26
|
+
// for (const file of files) {
|
|
27
|
+
// const reader = new FileReader()
|
|
28
|
+
// const [mime] = file.type.split('/')
|
|
29
|
+
// if (mime === 'image') {
|
|
30
|
+
// reader.addEventListener('load', () => {
|
|
31
|
+
// const url = reader.result
|
|
32
|
+
// insertImage(editor, url)
|
|
33
|
+
// })
|
|
34
|
+
// reader.readAsDataURL(file)
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
// } else if (isImageUrl(text)) {
|
|
38
|
+
// insertImage(editor, text)
|
|
39
|
+
// } else {
|
|
40
|
+
// insertData(data)
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
// return editor
|
|
44
|
+
};
|
|
45
|
+
exports.supportVoid = supportVoid;
|
|
46
|
+
// const insertImage = (editor, url) => {
|
|
47
|
+
// const text = { text: '' }
|
|
48
|
+
// const image: ImageElement = { type: 'image', url, }
|
|
49
|
+
// Transforms.insertNodes(editor, image)
|
|
50
|
+
// }
|
|
51
|
+
// export const withInsert = (editor: Editor) => {
|
|
52
|
+
// const { insertData, isVoid } = editor
|
|
53
|
+
// editor.isVoid = element => {
|
|
54
|
+
// return element.type === 'image' ? true : isVoid(element)
|
|
55
|
+
// }
|
|
56
|
+
// editor.insertData = data => {
|
|
57
|
+
// const text = data.getData('text/plain');
|
|
58
|
+
// // const { files } = data
|
|
59
|
+
// // if (files && files.length > 0) {
|
|
60
|
+
// // for (const file of files) {
|
|
61
|
+
// // const reader = new FileReader()
|
|
62
|
+
// // const [mime] = file.type.split('/')
|
|
63
|
+
// // if (mime === 'image') {
|
|
64
|
+
// // reader.addEventListener('load', () => {
|
|
65
|
+
// // const url = reader.result
|
|
66
|
+
// // insertImage(editor, url)
|
|
67
|
+
// // })
|
|
68
|
+
// // reader.readAsDataURL(file)
|
|
69
|
+
// // }
|
|
70
|
+
// // }
|
|
71
|
+
// // } else if (isImageUrl(text)) {
|
|
72
|
+
// insertImage(editor, text)
|
|
73
|
+
// // } else {
|
|
74
|
+
// // insertData(data)
|
|
75
|
+
// // }
|
|
76
|
+
// }
|
|
77
|
+
// return editor
|
|
78
|
+
// }
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import type { ReactEditor } from 'slate-react';
|
|
2
|
+
import type { BaseEditor, Descendant } from 'slate';
|
|
3
|
+
export type CommandType = 'bold' | 'italic' | 'underline' | 'code' | 'strikethrough' | 'color' | 'bgColor' | 'fontSize' | 'fontFamily' | 'link' | 'h1' | 'h2' | 'h3' | 'h4' | 'hr' | 'image' | 'video' | 'audio' | 'blockQuote' | 'numberedList' | 'bulletedList' | 'left' | 'center' | 'right' | 'justify';
|
|
4
|
+
export type EmptyText = {
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
export type CustomText = {
|
|
8
|
+
bold?: boolean;
|
|
9
|
+
italic?: boolean;
|
|
10
|
+
underline?: boolean;
|
|
11
|
+
code?: boolean;
|
|
12
|
+
strikethrough?: boolean;
|
|
13
|
+
color?: string;
|
|
14
|
+
link?: string;
|
|
15
|
+
bgColor?: string;
|
|
16
|
+
fontFamily?: number;
|
|
17
|
+
fontSize?: number;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
export type ButtonDefine = {
|
|
21
|
+
type: 'block' | 'mark' | 'str' | 'action';
|
|
22
|
+
icon: string;
|
|
23
|
+
ik: string;
|
|
24
|
+
tip?: string;
|
|
25
|
+
};
|
|
26
|
+
export type ButtonProps = ButtonDefine & {
|
|
27
|
+
cmd: CommandType;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const FontFamilyTexts: string[];
|
|
31
|
+
type TableRow = any;
|
|
32
|
+
type TableCell = any;
|
|
33
|
+
type BlockQuoteElement = {
|
|
34
|
+
type: 'blockQuote';
|
|
35
|
+
align?: string;
|
|
36
|
+
children: Descendant[];
|
|
37
|
+
};
|
|
38
|
+
type BulletedListElement = {
|
|
39
|
+
type: 'bulletedList';
|
|
40
|
+
align?: string;
|
|
41
|
+
children: Descendant[];
|
|
42
|
+
};
|
|
43
|
+
type NumberedListElement = {
|
|
44
|
+
type: 'numberedList';
|
|
45
|
+
align?: string;
|
|
46
|
+
children: Descendant[];
|
|
47
|
+
};
|
|
48
|
+
type CheckListItemElement = {
|
|
49
|
+
type: 'checkListItem';
|
|
50
|
+
checked: boolean;
|
|
51
|
+
children: Descendant[];
|
|
52
|
+
};
|
|
53
|
+
type EditableVoidElement = {
|
|
54
|
+
type: 'editableVoid';
|
|
55
|
+
children: EmptyText[];
|
|
56
|
+
};
|
|
57
|
+
type HeadingElement = {
|
|
58
|
+
type: 'h1';
|
|
59
|
+
align?: string;
|
|
60
|
+
children: Descendant[];
|
|
61
|
+
};
|
|
62
|
+
type HeadingTwoElement = {
|
|
63
|
+
type: 'h2';
|
|
64
|
+
align?: string;
|
|
65
|
+
children: Descendant[];
|
|
66
|
+
};
|
|
67
|
+
type HeadingThreeElement = {
|
|
68
|
+
type: 'h3';
|
|
69
|
+
align?: string;
|
|
70
|
+
children: Descendant[];
|
|
71
|
+
};
|
|
72
|
+
type HeadingFourElement = {
|
|
73
|
+
type: 'h4';
|
|
74
|
+
align?: string;
|
|
75
|
+
children: Descendant[];
|
|
76
|
+
};
|
|
77
|
+
type LinkElement = {
|
|
78
|
+
type: 'link';
|
|
79
|
+
url: string;
|
|
80
|
+
children: Descendant[];
|
|
81
|
+
};
|
|
82
|
+
type ButtonElement = {
|
|
83
|
+
type: 'button';
|
|
84
|
+
children: Descendant[];
|
|
85
|
+
};
|
|
86
|
+
type BadgeElement = {
|
|
87
|
+
type: 'badge';
|
|
88
|
+
children: Descendant[];
|
|
89
|
+
};
|
|
90
|
+
type ListItemElement = {
|
|
91
|
+
type: 'listItem';
|
|
92
|
+
children: Descendant[];
|
|
93
|
+
};
|
|
94
|
+
type MentionElement = {
|
|
95
|
+
type: 'mention';
|
|
96
|
+
character: string;
|
|
97
|
+
children: CustomText[];
|
|
98
|
+
};
|
|
99
|
+
type ParagraphElement = {
|
|
100
|
+
type: 'paragraph';
|
|
101
|
+
align?: string;
|
|
102
|
+
children: Descendant[];
|
|
103
|
+
};
|
|
104
|
+
type TableElement = {
|
|
105
|
+
type: 'table';
|
|
106
|
+
children: TableRow[];
|
|
107
|
+
};
|
|
108
|
+
type TableCellElement = {
|
|
109
|
+
type: 'table-cell';
|
|
110
|
+
children: CustomText[];
|
|
111
|
+
};
|
|
112
|
+
type TableRowElement = {
|
|
113
|
+
type: 'table-row';
|
|
114
|
+
children: TableCell[];
|
|
115
|
+
};
|
|
116
|
+
type TitleElement = {
|
|
117
|
+
type: 'title';
|
|
118
|
+
children: Descendant[];
|
|
119
|
+
};
|
|
120
|
+
export type ImageElement = {
|
|
121
|
+
type: 'image';
|
|
122
|
+
url: string;
|
|
123
|
+
children?: EmptyText[];
|
|
124
|
+
};
|
|
125
|
+
export type VideoElement = {
|
|
126
|
+
type: 'video';
|
|
127
|
+
url: string;
|
|
128
|
+
children?: EmptyText[];
|
|
129
|
+
};
|
|
130
|
+
export type AudioElement = {
|
|
131
|
+
type: 'audio';
|
|
132
|
+
url: string;
|
|
133
|
+
children?: EmptyText[];
|
|
134
|
+
};
|
|
135
|
+
export type HRElement = {
|
|
136
|
+
type: 'hr';
|
|
137
|
+
children: EmptyText[];
|
|
138
|
+
};
|
|
139
|
+
type CodeBlockElement = {
|
|
140
|
+
type: 'codeBlock';
|
|
141
|
+
language: string;
|
|
142
|
+
children: Descendant[];
|
|
143
|
+
};
|
|
144
|
+
type CodeLineElement = {
|
|
145
|
+
type: 'codeLine';
|
|
146
|
+
children: Descendant[];
|
|
147
|
+
};
|
|
148
|
+
export type CustomElement = BlockQuoteElement | BulletedListElement | NumberedListElement | CheckListItemElement | EditableVoidElement | HeadingElement | HeadingTwoElement | HeadingThreeElement | HeadingFourElement | ImageElement | AudioElement | VideoElement | HRElement | LinkElement | ButtonElement | BadgeElement | ListItemElement | MentionElement | ParagraphElement | TableElement | TableRowElement | TableCellElement | TitleElement | VideoElement | CodeBlockElement | CodeLineElement;
|
|
149
|
+
declare module 'slate' {
|
|
150
|
+
interface CustomTypes {
|
|
151
|
+
Editor: BaseEditor & ReactEditor;
|
|
152
|
+
Element: CustomElement;
|
|
153
|
+
Text: CustomText | EmptyText;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FontFamilyTexts = void 0;
|
|
4
|
+
exports.FontFamilyTexts = [
|
|
5
|
+
"",
|
|
6
|
+
"Arial, 'Lucida Grande', 'Microsoft YaHei','Segoe UI',Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,Arial,'Noto Sans',sans-serif,Roboto,'Helvetica Neue'",
|
|
7
|
+
"新宋体, NSimSun, 宋体, SimSun",
|
|
8
|
+
"楷体, 楷体_GB2312,SimKai",
|
|
9
|
+
"math",
|
|
10
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EDITOR: Record<"BOLD" | "ITALIC" | "UNDERLINE" | "CODE" | "DEL" | "COLOR" | "COLOR_BG" | "FONT_SIZE" | "FONT_FAMILY" | "LINK" | "HR" | "IMAGE" | "VIDEO" | "AUDIO" | "HEADING_ONE" | "HEADING_TWO" | "HEADING_THREE" | "HEADING_FOUR" | "BLOCK_QUOTE" | "NUMBERED_LIST" | "BULLETED_LIST" | "LEFT" | "CENTER" | "RIGHT" | "JUSTIFY", string>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EDITOR = void 0;
|
|
4
|
+
const i18n_1 = require("../../utils/i18n");
|
|
5
|
+
exports.EDITOR = (0, i18n_1.fastRegister)({
|
|
6
|
+
BOLD: '粗体',
|
|
7
|
+
ITALIC: '斜体',
|
|
8
|
+
UNDERLINE: '正划线',
|
|
9
|
+
CODE: '代码',
|
|
10
|
+
DEL: '删除线',
|
|
11
|
+
COLOR: '字体颜色',
|
|
12
|
+
COLOR_BG: '背景颜色',
|
|
13
|
+
FONT_SIZE: '字体大小',
|
|
14
|
+
FONT_FAMILY: '字体样式',
|
|
15
|
+
LINK: '链接',
|
|
16
|
+
HR: '分割线',
|
|
17
|
+
IMAGE: '插入图片',
|
|
18
|
+
VIDEO: '插入视频',
|
|
19
|
+
AUDIO: '插入音频',
|
|
20
|
+
HEADING_ONE: '一级标题',
|
|
21
|
+
HEADING_TWO: '二级标题',
|
|
22
|
+
HEADING_THREE: '三级标题',
|
|
23
|
+
HEADING_FOUR: '四级标题',
|
|
24
|
+
BLOCK_QUOTE: '引用',
|
|
25
|
+
NUMBERED_LIST: '有序列表',
|
|
26
|
+
BULLETED_LIST: '无序列表',
|
|
27
|
+
LEFT: '左对齐',
|
|
28
|
+
CENTER: '居中对齐',
|
|
29
|
+
RIGHT: '右对齐',
|
|
30
|
+
JUSTIFY: '调整',
|
|
31
|
+
});
|
|
@@ -0,0 +1,86 @@
|
|
|
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.Button = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const i18n_1 = require("../i18n");
|
|
10
|
+
const utils_1 = require("../../../utils");
|
|
11
|
+
const _BlockButton_1 = require("./_BlockButton");
|
|
12
|
+
const _MarkButton_1 = require("./_MarkButton");
|
|
13
|
+
const _InsertButton_1 = require("./_InsertButton");
|
|
14
|
+
const _TxtButton_1 = require("./_TxtButton");
|
|
15
|
+
const BUTTONS = {
|
|
16
|
+
bold: { type: 'mark', icon: 'bold', ik: i18n_1.EDITOR.BOLD },
|
|
17
|
+
italic: { type: 'mark', icon: 'italic', ik: i18n_1.EDITOR.ITALIC },
|
|
18
|
+
underline: { type: 'mark', icon: 'underline', ik: i18n_1.EDITOR.UNDERLINE },
|
|
19
|
+
code: { type: 'mark', icon: 'code', ik: i18n_1.EDITOR.CODE },
|
|
20
|
+
strikethrough: { type: 'mark', icon: 'strikethrough', ik: i18n_1.EDITOR.DEL },
|
|
21
|
+
color: { type: 'str', icon: 'font-colors', ik: i18n_1.EDITOR.COLOR },
|
|
22
|
+
bgColor: { type: 'str', icon: 'bg-colors', ik: i18n_1.EDITOR.COLOR_BG },
|
|
23
|
+
fontSize: { type: 'str', icon: 'font-size', ik: i18n_1.EDITOR.FONT_SIZE },
|
|
24
|
+
fontFamily: { type: 'str', icon: 'behance', ik: i18n_1.EDITOR.FONT_FAMILY },
|
|
25
|
+
link: { type: 'str', icon: 'link', ik: i18n_1.EDITOR.LINK },
|
|
26
|
+
// hr: { type: 'action', icon: 'line', ik: EDITOR.HR },
|
|
27
|
+
hr: { type: 'action', icon: 'minus', ik: i18n_1.EDITOR.HR },
|
|
28
|
+
image: { type: 'action', icon: 'picture', ik: i18n_1.EDITOR.IMAGE },
|
|
29
|
+
video: { type: 'action', icon: 'youtube', ik: i18n_1.EDITOR.VIDEO },
|
|
30
|
+
audio: { type: 'action', icon: 'customer-service', ik: i18n_1.EDITOR.AUDIO },
|
|
31
|
+
numberedList: { type: 'block', icon: 'ordered-list', ik: i18n_1.EDITOR.NUMBERED_LIST },
|
|
32
|
+
bulletedList: { type: 'block', icon: 'unordered-list', ik: i18n_1.EDITOR.BULLETED_LIST },
|
|
33
|
+
blockQuote: { type: 'block', icon: 'message', ik: i18n_1.EDITOR.BLOCK_QUOTE },
|
|
34
|
+
left: { type: 'block', icon: 'align-left', ik: i18n_1.EDITOR.LEFT },
|
|
35
|
+
center: { type: 'block', icon: 'align-center', ik: i18n_1.EDITOR.CENTER },
|
|
36
|
+
right: { type: 'block', icon: 'align-right', ik: i18n_1.EDITOR.RIGHT },
|
|
37
|
+
justify: { type: 'block', icon: 'menu', ik: i18n_1.EDITOR.JUSTIFY },
|
|
38
|
+
h1: { type: 'block', icon: 'h1', ik: i18n_1.EDITOR.HEADING_ONE },
|
|
39
|
+
h2: { type: 'block', icon: 'h2', ik: i18n_1.EDITOR.HEADING_TWO },
|
|
40
|
+
h3: { type: 'block', icon: 'h3', ik: i18n_1.EDITOR.HEADING_THREE },
|
|
41
|
+
h4: { type: 'block', icon: 'h4', ik: i18n_1.EDITOR.HEADING_FOUR },
|
|
42
|
+
};
|
|
43
|
+
const Button = ({ type, disabled }) => {
|
|
44
|
+
if (type == null) {
|
|
45
|
+
return react_1.default.createElement("span", { className: 'editor-toolbar-split' });
|
|
46
|
+
}
|
|
47
|
+
if (!lodash_1.default.has(BUTTONS, type)) {
|
|
48
|
+
return utils_1.Const.NONE;
|
|
49
|
+
}
|
|
50
|
+
const define = BUTTONS[type];
|
|
51
|
+
if (define.type == 'mark') {
|
|
52
|
+
return react_1.default.createElement(_MarkButton_1.MarkButton, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
53
|
+
}
|
|
54
|
+
else if (define.type == 'block') {
|
|
55
|
+
return react_1.default.createElement(_BlockButton_1.BlockButton, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
56
|
+
}
|
|
57
|
+
else if (define.type == 'str') {
|
|
58
|
+
switch (type) {
|
|
59
|
+
case 'link':
|
|
60
|
+
return react_1.default.createElement(_TxtButton_1.Link, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
61
|
+
case 'color':
|
|
62
|
+
return react_1.default.createElement(_TxtButton_1.Color, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
63
|
+
case 'bgColor':
|
|
64
|
+
return react_1.default.createElement(_TxtButton_1.BgColor, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
65
|
+
case 'fontSize':
|
|
66
|
+
return react_1.default.createElement(_TxtButton_1.FontSize, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
67
|
+
case 'fontFamily':
|
|
68
|
+
return react_1.default.createElement(_TxtButton_1.FontFamily, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
69
|
+
}
|
|
70
|
+
return utils_1.Const.NONE;
|
|
71
|
+
}
|
|
72
|
+
else if (define.type == 'action') {
|
|
73
|
+
switch (type) {
|
|
74
|
+
case 'hr':
|
|
75
|
+
return react_1.default.createElement(_InsertButton_1.HR, Object.assign({}, define, { cmd: type, disabled: disabled }));
|
|
76
|
+
// case 'image':
|
|
77
|
+
// return <Picture {...define} cmd={type} disabled={disabled} />
|
|
78
|
+
// case 'audio':
|
|
79
|
+
// return <Audio {...define} cmd={type} disabled={disabled}/>
|
|
80
|
+
// case 'video':
|
|
81
|
+
// return <Video {...define} cmd={type} disabled={disabled}F/>
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return utils_1.Const.NONE;
|
|
85
|
+
};
|
|
86
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
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.Toolbar = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Button_1 = require("./Button");
|
|
9
|
+
const Toolbar = (props) => react_1.default.createElement("div", { className: "editor-toolbar" }, props.buttons.map(lineGroup => react_1.default.createElement("div", { className: "editor-toolbar-line" }, lineGroup.map(type => react_1.default.createElement(Button_1.Button, { type: type, disabled: props.disabled })))));
|
|
10
|
+
exports.Toolbar = Toolbar;
|