@agentscope-ai/design 1.0.4
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/LICENSE +21 -0
- package/README.md +85 -0
- package/dist/antd/styles/button.style.d.ts +47 -0
- package/dist/antd/styles/button.style.js +32 -0
- package/dist/antd/styles/dropdown.style.d.ts +15 -0
- package/dist/antd/styles/dropdown.style.js +16 -0
- package/dist/antd/styles/index.style.d.ts +19 -0
- package/dist/antd/styles/index.style.js +50 -0
- package/dist/antd/styles/message.style.d.ts +5 -0
- package/dist/antd/styles/message.style.js +10 -0
- package/dist/antd/styles/notification.style.d.ts +46 -0
- package/dist/antd/styles/notification.style.js +29 -0
- package/dist/antd/styles/popover.style.d.ts +13 -0
- package/dist/antd/styles/popover.style.js +14 -0
- package/dist/antd/styles/radio.style.d.ts +7 -0
- package/dist/antd/styles/radio.style.js +10 -0
- package/dist/antd/styles/segment.style.d.ts +7 -0
- package/dist/antd/styles/segment.style.js +12 -0
- package/dist/antd/styles/select.style.d.ts +6 -0
- package/dist/antd/styles/select.style.js +11 -0
- package/dist/antd/styles/slider.style.d.ts +22 -0
- package/dist/antd/styles/slider.style.js +21 -0
- package/dist/antd/styles/table.style.d.ts +5 -0
- package/dist/antd/styles/table.style.js +10 -0
- package/dist/antd/styles/tooltip.style.d.ts +8 -0
- package/dist/antd/styles/tooltip.style.js +11 -0
- package/dist/antd/themes/bailianDarkTheme.json +173 -0
- package/dist/antd/themes/bailianTheme.json +170 -0
- package/dist/antd/themes/blackTheme.json +12 -0
- package/dist/antd/themes/carbonDarkTheme.json +172 -0
- package/dist/antd/themes/carbonTheme.json +170 -0
- package/dist/antd/themes/xConsoleTheme.json +26 -0
- package/dist/components/CComponents/Alert/demo/index.d.ts +2 -0
- package/dist/components/CComponents/Alert/demo/index.js +99 -0
- package/dist/components/commonComponents/Alert/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Alert/demo/index.js +87 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo1.js +86 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/AlertDialog/demo/demo2.js +70 -0
- package/dist/components/commonComponents/AlertDialog/index.d.ts +25 -0
- package/dist/components/commonComponents/AlertDialog/index.js +143 -0
- package/dist/components/commonComponents/Avatar/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Avatar/demo/index.js +25 -0
- package/dist/components/commonComponents/Avatar/index.d.ts +4 -0
- package/dist/components/commonComponents/Avatar/index.js +39 -0
- package/dist/components/commonComponents/Badge/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Badge/demo/index.js +24 -0
- package/dist/components/commonComponents/Button/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Button/demo/demo1.js +103 -0
- package/dist/components/commonComponents/Button/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Button/demo/demo2.js +17 -0
- package/dist/components/commonComponents/Button/index.d.ts +18 -0
- package/dist/components/commonComponents/Button/index.js +78 -0
- package/dist/components/commonComponents/Card/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Card/demo/demo1.js +31 -0
- package/dist/components/commonComponents/Card/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Card/demo/demo2.js +46 -0
- package/dist/components/commonComponents/Card/index.d.ts +11 -0
- package/dist/components/commonComponents/Card/index.js +40 -0
- package/dist/components/commonComponents/Card/index.style.d.ts +58 -0
- package/dist/components/commonComponents/Card/index.style.js +44 -0
- package/dist/components/commonComponents/Checkbox/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Checkbox/demo/demo1.js +21 -0
- package/dist/components/commonComponents/Checkbox/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Checkbox/demo/demo2.js +25 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo1.js +34 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/CodeBlock/demo/demo2.js +14 -0
- package/dist/components/commonComponents/CodeBlock/index.d.ts +11 -0
- package/dist/components/commonComponents/CodeBlock/index.js +88 -0
- package/dist/components/commonComponents/CodeBlock/index.style.d.ts +46 -0
- package/dist/components/commonComponents/CodeBlock/index.style.js +59 -0
- package/dist/components/commonComponents/CollapsePanel/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/CollapsePanel/demo/demo1.js +27 -0
- package/dist/components/commonComponents/CollapsePanel/index.d.ts +38 -0
- package/dist/components/commonComponents/CollapsePanel/index.js +116 -0
- package/dist/components/commonComponents/CollapsePanel/index.style.d.ts +329 -0
- package/dist/components/commonComponents/CollapsePanel/index.style.js +96 -0
- package/dist/components/commonComponents/ConfigProvider/index.d.ts +25 -0
- package/dist/components/commonComponents/ConfigProvider/index.js +152 -0
- package/dist/components/commonComponents/Drawer/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Drawer/demo/demo1.js +106 -0
- package/dist/components/commonComponents/Drawer/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Drawer/demo/demo2.js +66 -0
- package/dist/components/commonComponents/Drawer/index.d.ts +3 -0
- package/dist/components/commonComponents/Drawer/index.js +30 -0
- package/dist/components/commonComponents/Drawer/index.style.d.ts +38 -0
- package/dist/components/commonComponents/Drawer/index.style.js +40 -0
- package/dist/components/commonComponents/Dropdown/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Dropdown/demo/demo1.js +33 -0
- package/dist/components/commonComponents/Dropdown/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Dropdown/demo/demo2.js +38 -0
- package/dist/components/commonComponents/Dropdown/index.d.ts +5 -0
- package/dist/components/commonComponents/Dropdown/index.js +20 -0
- package/dist/components/commonComponents/Dropdown/index.style.d.ts +7 -0
- package/dist/components/commonComponents/Dropdown/index.style.js +21 -0
- package/dist/components/commonComponents/Ellipsis/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Ellipsis/demo/index.js +11 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo1.js +25 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/EllipsisTip/demo/demo2.js +35 -0
- package/dist/components/commonComponents/EllipsisTip/index.d.ts +13 -0
- package/dist/components/commonComponents/EllipsisTip/index.js +30 -0
- package/dist/components/commonComponents/EllipsisTip/index.style.d.ts +10 -0
- package/dist/components/commonComponents/EllipsisTip/index.style.js +24 -0
- package/dist/components/commonComponents/Empty/demo/index.css +11 -0
- package/dist/components/commonComponents/Empty/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Empty/demo/index.js +186 -0
- package/dist/components/commonComponents/Empty/index.d.ts +57 -0
- package/dist/components/commonComponents/Empty/index.js +112 -0
- package/dist/components/commonComponents/Empty/index.style.d.ts +80 -0
- package/dist/components/commonComponents/Empty/index.style.js +43 -0
- package/dist/components/commonComponents/FileIcon/demo/index.d.ts +1 -0
- package/dist/components/commonComponents/FileIcon/demo/index.js +42 -0
- package/dist/components/commonComponents/FileIcon/icons/common.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/epub.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/excel.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/html.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/image.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/md.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/mobi.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/pdf.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/ppt.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/txt.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/web.svg +1 -0
- package/dist/components/commonComponents/FileIcon/icons/word.svg +1 -0
- package/dist/components/commonComponents/FileIcon/index.d.ts +19 -0
- package/dist/components/commonComponents/FileIcon/index.js +89 -0
- package/dist/components/commonComponents/FileIcon/index.style.d.ts +61 -0
- package/dist/components/commonComponents/FileIcon/index.style.js +42 -0
- package/dist/components/commonComponents/Form/demo/api.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/api.js +22 -0
- package/dist/components/commonComponents/Form/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo1.js +107 -0
- package/dist/components/commonComponents/Form/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo2.js +52 -0
- package/dist/components/commonComponents/Form/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo3.js +28 -0
- package/dist/components/commonComponents/Form/demo/demo4.d.ts +2 -0
- package/dist/components/commonComponents/Form/demo/demo4.js +29 -0
- package/dist/components/commonComponents/Form/demo/index.module.less +0 -0
- package/dist/components/commonComponents/Form/index.d.ts +27 -0
- package/dist/components/commonComponents/Form/index.js +84 -0
- package/dist/components/commonComponents/Form/index.style.d.ts +49 -0
- package/dist/components/commonComponents/Form/index.style.js +37 -0
- package/dist/components/commonComponents/HelpIcon/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/HelpIcon/demo/index.js +17 -0
- package/dist/components/commonComponents/HelpIcon/index.d.ts +9 -0
- package/dist/components/commonComponents/HelpIcon/index.js +35 -0
- package/dist/components/commonComponents/HelpIcon/index.style.d.ts +12 -0
- package/dist/components/commonComponents/HelpIcon/index.style.js +26 -0
- package/dist/components/commonComponents/IconButton/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo1.js +66 -0
- package/dist/components/commonComponents/IconButton/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo2.js +61 -0
- package/dist/components/commonComponents/IconButton/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo3.js +53 -0
- package/dist/components/commonComponents/IconButton/demo/demo4.d.ts +3 -0
- package/dist/components/commonComponents/IconButton/demo/demo4.js +55 -0
- package/dist/components/commonComponents/IconButton/index.d.ts +22 -0
- package/dist/components/commonComponents/IconButton/index.js +43 -0
- package/dist/components/commonComponents/IconFont/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo1.js +49 -0
- package/dist/components/commonComponents/IconFont/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo2.js +17 -0
- package/dist/components/commonComponents/IconFont/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo3.js +17 -0
- package/dist/components/commonComponents/IconFont/demo/demo4.d.ts +2 -0
- package/dist/components/commonComponents/IconFont/demo/demo4.js +23 -0
- package/dist/components/commonComponents/IconFont/index.d.ts +29 -0
- package/dist/components/commonComponents/IconFont/index.js +57 -0
- package/dist/components/commonComponents/IconFont/index.style.d.ts +67 -0
- package/dist/components/commonComponents/IconFont/index.style.js +44 -0
- package/dist/components/commonComponents/Image/demo/demo1.d.ts +1 -0
- package/dist/components/commonComponents/Image/demo/demo1.js +8 -0
- package/dist/components/commonComponents/Image/index.d.ts +8 -0
- package/dist/components/commonComponents/Image/index.js +37 -0
- package/dist/components/commonComponents/Input/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/Input/demo/index.js +117 -0
- package/dist/components/commonComponents/Input/index.d.ts +13 -0
- package/dist/components/commonComponents/Input/index.js +34 -0
- package/dist/components/commonComponents/Input/index.style.d.ts +36 -0
- package/dist/components/commonComponents/Input/index.style.js +32 -0
- package/dist/components/commonComponents/InputNumber/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/InputNumber/demo/index.js +38 -0
- package/dist/components/commonComponents/InputSearch/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/InputSearch/demo/index.js +43 -0
- package/dist/components/commonComponents/Message/demo.d.ts +2 -0
- package/dist/components/commonComponents/Message/demo.js +53 -0
- package/dist/components/commonComponents/Message/index.d.ts +20 -0
- package/dist/components/commonComponents/Message/index.js +66 -0
- package/dist/components/commonComponents/Modal/demo/demo1.d.ts +2 -0
- package/dist/components/commonComponents/Modal/demo/demo1.js +137 -0
- package/dist/components/commonComponents/Modal/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Modal/demo/demo2.js +77 -0
- package/dist/components/commonComponents/Modal/demo/demo3.d.ts +2 -0
- package/dist/components/commonComponents/Modal/demo/demo3.js +57 -0
- package/dist/components/commonComponents/Modal/demo/demo4.d.ts +3 -0
- package/dist/components/commonComponents/Modal/demo/demo4.js +65 -0
- package/dist/components/commonComponents/Modal/index.css +1 -0
- package/dist/components/commonComponents/Modal/index.d.ts +15 -0
- package/dist/components/commonComponents/Modal/index.js +46 -0
- package/dist/components/commonComponents/Modal/index.style.d.ts +80 -0
- package/dist/components/commonComponents/Modal/index.style.js +58 -0
- package/dist/components/commonComponents/Notification/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo1.js +76 -0
- package/dist/components/commonComponents/Notification/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo2.js +50 -0
- package/dist/components/commonComponents/Notification/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Notification/demo/demo3.js +46 -0
- package/dist/components/commonComponents/Notification/index.d.ts +20 -0
- package/dist/components/commonComponents/Notification/index.js +106 -0
- package/dist/components/commonComponents/Pagination/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Pagination/demo/demo1.js +14 -0
- package/dist/components/commonComponents/Pagination/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Pagination/demo/demo2.js +16 -0
- package/dist/components/commonComponents/Pagination/index.d.ts +12 -0
- package/dist/components/commonComponents/Pagination/index.js +59 -0
- package/dist/components/commonComponents/Pagination/index.style.d.ts +12 -0
- package/dist/components/commonComponents/Pagination/index.style.js +24 -0
- package/dist/components/commonComponents/Popconfirm/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Popconfirm/demo/index.js +155 -0
- package/dist/components/commonComponents/Popconfirm/index.d.ts +5 -0
- package/dist/components/commonComponents/Popconfirm/index.js +29 -0
- package/dist/components/commonComponents/Popover/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Popover/demo/demo1.js +34 -0
- package/dist/components/commonComponents/Popover/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Popover/demo/demo2.js +183 -0
- package/dist/components/commonComponents/Popover/index.d.ts +4 -0
- package/dist/components/commonComponents/Popover/index.js +27 -0
- package/dist/components/commonComponents/Progress/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Progress/demo/demo1.js +15 -0
- package/dist/components/commonComponents/Radio/demo.d.ts +3 -0
- package/dist/components/commonComponents/Radio/demo.js +20 -0
- package/dist/components/commonComponents/Radio/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Radio/demo2.js +115 -0
- package/dist/components/commonComponents/RadioButton/demo/demo.d.ts +3 -0
- package/dist/components/commonComponents/RadioButton/demo/demo.js +166 -0
- package/dist/components/commonComponents/RadioButton/index.d.ts +21 -0
- package/dist/components/commonComponents/RadioButton/index.js +32 -0
- package/dist/components/commonComponents/RadioButton/index.style.d.ts +62 -0
- package/dist/components/commonComponents/RadioButton/index.style.js +49 -0
- package/dist/components/commonComponents/Select/demo/demo.d.ts +3 -0
- package/dist/components/commonComponents/Select/demo/demo.js +29 -0
- package/dist/components/commonComponents/Select/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Select/demo/demo2.js +30 -0
- package/dist/components/commonComponents/Skeleton/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Skeleton/demo/demo1.js +9 -0
- package/dist/components/commonComponents/SlateEditor/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/demo/index.js +21 -0
- package/dist/components/commonComponents/SlateEditor/elements/S.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/S.js +18 -0
- package/dist/components/commonComponents/SlateEditor/elements/Var.d.ts +3 -0
- package/dist/components/commonComponents/SlateEditor/elements/Var.js +20 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.js +2 -0
- package/dist/components/commonComponents/SlateEditor/elements/index.less +10 -0
- package/dist/components/commonComponents/SlateEditor/index.d.ts +39 -0
- package/dist/components/commonComponents/SlateEditor/index.js +272 -0
- package/dist/components/commonComponents/SlateEditor/index.style.d.ts +28 -0
- package/dist/components/commonComponents/SlateEditor/index.style.js +36 -0
- package/dist/components/commonComponents/SlateEditor/types.d.ts +56 -0
- package/dist/components/commonComponents/SlateEditor/types.js +1 -0
- package/dist/components/commonComponents/SlateEditor/utils/constant.d.ts +7 -0
- package/dist/components/commonComponents/SlateEditor/utils/constant.js +36 -0
- package/dist/components/commonComponents/SlateEditor/utils/editor.d.ts +68 -0
- package/dist/components/commonComponents/SlateEditor/utils/editor.js +558 -0
- package/dist/components/commonComponents/SlateEditor/utils/functions.d.ts +41 -0
- package/dist/components/commonComponents/SlateEditor/utils/functions.js +179 -0
- package/dist/components/commonComponents/SlateEditor/utils/index.d.ts +4 -0
- package/dist/components/commonComponents/SlateEditor/utils/index.js +4 -0
- package/dist/components/commonComponents/SlateEditor/utils/withEditor.d.ts +2 -0
- package/dist/components/commonComponents/SlateEditor/utils/withEditor.js +109 -0
- package/dist/components/commonComponents/Slider/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Slider/demo/demo1.js +35 -0
- package/dist/components/commonComponents/Slider/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Slider/demo/demo2.js +48 -0
- package/dist/components/commonComponents/SliderSelector/demo/index.d.ts +2 -0
- package/dist/components/commonComponents/SliderSelector/demo/index.js +41 -0
- package/dist/components/commonComponents/SliderSelector/index.d.ts +16 -0
- package/dist/components/commonComponents/SliderSelector/index.js +67 -0
- package/dist/components/commonComponents/SliderSelector/index.style.d.ts +38 -0
- package/dist/components/commonComponents/SliderSelector/index.style.js +37 -0
- package/dist/components/commonComponents/Spin/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Spin/demo1.js +30 -0
- package/dist/components/commonComponents/Spinner/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo1.js +46 -0
- package/dist/components/commonComponents/Spinner/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo2.js +69 -0
- package/dist/components/commonComponents/Spinner/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Spinner/demo/demo3.js +59 -0
- package/dist/components/commonComponents/Spinner/index.d.ts +16 -0
- package/dist/components/commonComponents/Spinner/index.js +77 -0
- package/dist/components/commonComponents/Spinner/index.style.d.ts +82 -0
- package/dist/components/commonComponents/Spinner/index.style.js +60 -0
- package/dist/components/commonComponents/Switch/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Switch/demo/demo1.js +26 -0
- package/dist/components/commonComponents/Switch/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Switch/demo/demo2.js +27 -0
- package/dist/components/commonComponents/Switch/index.d.ts +11 -0
- package/dist/components/commonComponents/Switch/index.js +29 -0
- package/dist/components/commonComponents/Switch/index.style.d.ts +8 -0
- package/dist/components/commonComponents/Switch/index.style.js +23 -0
- package/dist/components/commonComponents/Table/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo1.js +87 -0
- package/dist/components/commonComponents/Table/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo2.js +98 -0
- package/dist/components/commonComponents/Table/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Table/demo/demo3.js +378 -0
- package/dist/components/commonComponents/Tabs/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo1.js +45 -0
- package/dist/components/commonComponents/Tabs/demo/demo2.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo2.js +43 -0
- package/dist/components/commonComponents/Tabs/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Tabs/demo/demo3.js +32 -0
- package/dist/components/commonComponents/Tabs/index.d.ts +14 -0
- package/dist/components/commonComponents/Tabs/index.js +67 -0
- package/dist/components/commonComponents/Tabs/index.style.d.ts +23 -0
- package/dist/components/commonComponents/Tabs/index.style.js +30 -0
- package/dist/components/commonComponents/Tag/demo.d.ts +2 -0
- package/dist/components/commonComponents/Tag/demo.js +30 -0
- package/dist/components/commonComponents/Tag/index.d.ts +7 -0
- package/dist/components/commonComponents/Tag/index.js +36 -0
- package/dist/components/commonComponents/Tag/index.style.d.ts +26 -0
- package/dist/components/commonComponents/Tag/index.style.js +48 -0
- package/dist/components/commonComponents/Textarea/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Textarea/demo/demo1.js +36 -0
- package/dist/components/commonComponents/Tooltip/demo/index.d.ts +3 -0
- package/dist/components/commonComponents/Tooltip/demo/index.js +254 -0
- package/dist/components/commonComponents/Tooltip/index.d.ts +11 -0
- package/dist/components/commonComponents/Tooltip/index.js +35 -0
- package/dist/components/commonComponents/Tooltip/index.style.d.ts +24 -0
- package/dist/components/commonComponents/Tooltip/index.style.js +32 -0
- package/dist/components/commonComponents/Upload/demo/demo1.d.ts +3 -0
- package/dist/components/commonComponents/Upload/demo/demo1.js +43 -0
- package/dist/components/commonComponents/Upload/demo/demo2.d.ts +2 -0
- package/dist/components/commonComponents/Upload/demo/demo2.js +15 -0
- package/dist/components/commonComponents/Upload/demo/demo3.d.ts +3 -0
- package/dist/components/commonComponents/Upload/demo/demo3.js +145 -0
- package/dist/components/commonComponents/spark.style.d.ts +45 -0
- package/dist/components/commonComponents/spark.style.js +62 -0
- package/dist/config.d.ts +27 -0
- package/dist/config.js +56 -0
- package/dist/hooks/useGlobalStyle/demo/demo.d.ts +2 -0
- package/dist/hooks/useGlobalStyle/demo/demo.js +47 -0
- package/dist/hooks/useGlobalStyle/index.d.ts +8 -0
- package/dist/hooks/useGlobalStyle/index.js +51 -0
- package/dist/i18n/index.d.ts +33 -0
- package/dist/i18n/index.js +62 -0
- package/dist/i18n/strings/en-US.json +13 -0
- package/dist/i18n/strings/index.js +12 -0
- package/dist/i18n/strings/zh-CN.json +13 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +70 -0
- package/dist/libs/cookie.d.ts +9 -0
- package/dist/libs/cookie.js +19 -0
- package/dist/libs/createStyle/index.d.ts +1 -0
- package/dist/libs/createStyle/index.js +76 -0
- package/dist/libs/data/index.d.ts +15 -0
- package/dist/libs/data/index.js +76 -0
- package/dist/libs/delay/index.d.ts +6 -0
- package/dist/libs/delay/index.js +31 -0
- package/dist/libs/dom.d.ts +8 -0
- package/dist/libs/dom.js +37 -0
- package/dist/libs/env/index.d.ts +10 -0
- package/dist/libs/env/index.js +16 -0
- package/dist/libs/generateCssVars/index.d.ts +19 -0
- package/dist/libs/generateCssVars/index.js +39 -0
- package/dist/libs/loadStyle.d.ts +7 -0
- package/dist/libs/loadStyle.js +41 -0
- package/dist/libs/region/constant.d.ts +6 -0
- package/dist/libs/region/constant.js +154 -0
- package/dist/libs/region/index.d.ts +2 -0
- package/dist/libs/region/index.js +18 -0
- package/dist/libs/requestPop/index.d.ts +52 -0
- package/dist/libs/requestPop/index.js +89 -0
- package/dist/libs/requestPopSse/index.d.ts +35 -0
- package/dist/libs/requestPopSse/index.js +159 -0
- package/dist/libs/requestSse/index.d.ts +47 -0
- package/dist/libs/requestSse/index.js +196 -0
- package/dist/libs/requestSse/parse.d.ts +36 -0
- package/dist/libs/requestSse/parse.js +190 -0
- package/dist/libs/staticRenderer/index.d.ts +8 -0
- package/dist/libs/staticRenderer/index.js +58 -0
- package/dist/libs/string/index.d.ts +19 -0
- package/dist/libs/string/index.js +63 -0
- package/dist/libs/tokens.json +3 -0
- package/dist/libs/utils/index.d.ts +7 -0
- package/dist/libs/utils/index.js +69 -0
- package/dist/libs/waitFor/index.d.ts +25 -0
- package/dist/libs/waitFor/index.js +39 -0
- package/dist/typings.d.ts +14 -0
- package/package.json +173 -0
- package/scripts/init-migrate-config.js +68 -0
- package/scripts/migrate-from-bl.js +78 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
/**
|
|
6
|
+
* Represents a message sent in an event stream
|
|
7
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Converts a ReadableStream into a callback pattern.
|
|
12
|
+
* @param stream The input ReadableStream.
|
|
13
|
+
* @param onChunk A function that will be called on each new byte chunk in the stream.
|
|
14
|
+
* @returns {Promise<void>} A promise that will be resolved when the stream closes.
|
|
15
|
+
*/
|
|
16
|
+
export function getBytes(_x, _x2) {
|
|
17
|
+
return _getBytes.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
function _getBytes() {
|
|
20
|
+
_getBytes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(stream, onChunk) {
|
|
21
|
+
var _stream$getReader;
|
|
22
|
+
var reader, result;
|
|
23
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
|
25
|
+
case 0:
|
|
26
|
+
reader = stream === null || stream === void 0 || (_stream$getReader = stream.getReader) === null || _stream$getReader === void 0 ? void 0 : _stream$getReader.call(stream);
|
|
27
|
+
if (!reader) {
|
|
28
|
+
console.log('[sse]error: Can Not Find Reader Object');
|
|
29
|
+
console.log('[sse]StreamInfo: ', stream);
|
|
30
|
+
}
|
|
31
|
+
case 2:
|
|
32
|
+
_context.next = 4;
|
|
33
|
+
return reader.read();
|
|
34
|
+
case 4:
|
|
35
|
+
if ((result = _context.sent).done) {
|
|
36
|
+
_context.next = 8;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
onChunk(result.value);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
console.log('[sse-error][onmessage] pleach check `onmessage` or `onJsonText`.', err);
|
|
43
|
+
}
|
|
44
|
+
_context.next = 2;
|
|
45
|
+
break;
|
|
46
|
+
case 8:
|
|
47
|
+
case "end":
|
|
48
|
+
return _context.stop();
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
}));
|
|
52
|
+
return _getBytes.apply(this, arguments);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Parses arbitary byte chunks into EventSource line buffers.
|
|
56
|
+
* Each line should be of the format "field: value" and ends with \r, \n, or \r\n.
|
|
57
|
+
* @param onLine A function that will be called on each new EventSource line.
|
|
58
|
+
* @returns A function that should be called for each incoming byte chunk.
|
|
59
|
+
*/
|
|
60
|
+
export function getLines(onLine) {
|
|
61
|
+
var buffer;
|
|
62
|
+
var position; // current read position
|
|
63
|
+
var fieldLength; // length of the `field` portion of the line
|
|
64
|
+
var discardTrailingNewline = false;
|
|
65
|
+
|
|
66
|
+
// return a function that can process each incoming byte chunk:
|
|
67
|
+
return function onChunk(arr) {
|
|
68
|
+
if (buffer === undefined) {
|
|
69
|
+
buffer = arr;
|
|
70
|
+
position = 0;
|
|
71
|
+
fieldLength = -1;
|
|
72
|
+
} else {
|
|
73
|
+
// we're still parsing the old line. Append the new bytes into buffer:
|
|
74
|
+
buffer = concat(buffer, arr);
|
|
75
|
+
}
|
|
76
|
+
var bufLength = buffer.length;
|
|
77
|
+
var lineStart = 0; // index where the current line starts
|
|
78
|
+
while (position < bufLength) {
|
|
79
|
+
if (discardTrailingNewline) {
|
|
80
|
+
if (buffer[position] === 10) {
|
|
81
|
+
lineStart = ++position; // skip to next char
|
|
82
|
+
}
|
|
83
|
+
discardTrailingNewline = false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// start looking forward till the end of line:
|
|
87
|
+
var lineEnd = -1; // index of the \r or \n char
|
|
88
|
+
for (; position < bufLength && lineEnd === -1; ++position) {
|
|
89
|
+
switch (buffer[position]) {
|
|
90
|
+
case 58:
|
|
91
|
+
if (fieldLength === -1) {
|
|
92
|
+
// first colon in line
|
|
93
|
+
fieldLength = position - lineStart;
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
case 13:
|
|
97
|
+
discardTrailingNewline = true;
|
|
98
|
+
case 10:
|
|
99
|
+
lineEnd = position;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (lineEnd === -1) {
|
|
104
|
+
// We reached the end of the buffer but the line hasn't ended.
|
|
105
|
+
// Wait for the next arr and then continue parsing:
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// we've reached the line end, send it out:
|
|
110
|
+
onLine(buffer.subarray(lineStart, lineEnd), fieldLength);
|
|
111
|
+
lineStart = position; // we're now on the next line
|
|
112
|
+
fieldLength = -1;
|
|
113
|
+
}
|
|
114
|
+
if (lineStart === bufLength) {
|
|
115
|
+
buffer = undefined; // we've finished reading it
|
|
116
|
+
} else if (lineStart !== 0) {
|
|
117
|
+
// Create a new view into buffer beginning at lineStart so we don't
|
|
118
|
+
// need to copy over the previous lines when we get the new arr:
|
|
119
|
+
buffer = buffer.subarray(lineStart);
|
|
120
|
+
position -= lineStart;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Parses line buffers into EventSourceMessages.
|
|
127
|
+
* @param onId A function that will be called on each `id` field.
|
|
128
|
+
* @param onRetry A function that will be called on each `retry` field.
|
|
129
|
+
* @param onMessage A function that will be called on each message.
|
|
130
|
+
* @returns A function that should be called for each incoming line buffer.
|
|
131
|
+
*/
|
|
132
|
+
export function getMessages(onId, onRetry, onMessage) {
|
|
133
|
+
var message = newMessage();
|
|
134
|
+
var decoder = new TextDecoder();
|
|
135
|
+
|
|
136
|
+
// return a function that can process each incoming line buffer:
|
|
137
|
+
return function onLine(line, fieldLength) {
|
|
138
|
+
if (line.length === 0) {
|
|
139
|
+
// empty line denotes end of message. Trigger the callback and start a new message:
|
|
140
|
+
onMessage === null || onMessage === void 0 || onMessage(message);
|
|
141
|
+
message = newMessage();
|
|
142
|
+
} else if (fieldLength > 0) {
|
|
143
|
+
// exclude comments and lines with no values
|
|
144
|
+
// line is of format "<field>:<value>" or "<field>: <value>"
|
|
145
|
+
// https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
|
|
146
|
+
var field = decoder.decode(line.subarray(0, fieldLength));
|
|
147
|
+
var valueOffset = fieldLength + (line[fieldLength + 1] === 32 ? 2 : 1);
|
|
148
|
+
var value = decoder.decode(line.subarray(valueOffset));
|
|
149
|
+
switch (field) {
|
|
150
|
+
case 'data':
|
|
151
|
+
// if this message already has data, append the new value to the old.
|
|
152
|
+
// otherwise, just set to the new value:
|
|
153
|
+
message.data = message.data ? "".concat(message.data, "\n").concat(value) : value; // otherwise,
|
|
154
|
+
break;
|
|
155
|
+
case 'event':
|
|
156
|
+
message.event = value;
|
|
157
|
+
break;
|
|
158
|
+
case 'id':
|
|
159
|
+
onId(message.id = value);
|
|
160
|
+
break;
|
|
161
|
+
case 'retry':
|
|
162
|
+
// eslint-disable-next-line no-case-declarations
|
|
163
|
+
var _retry = parseInt(value, 10);
|
|
164
|
+
if (!isNaN(_retry)) {
|
|
165
|
+
// per spec, ignore non-integers
|
|
166
|
+
onRetry(message.retry = _retry);
|
|
167
|
+
}
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
function concat(a, b) {
|
|
174
|
+
var res = new Uint8Array(a.length + b.length);
|
|
175
|
+
res.set(a);
|
|
176
|
+
res.set(b, a.length);
|
|
177
|
+
return res;
|
|
178
|
+
}
|
|
179
|
+
function newMessage() {
|
|
180
|
+
// data, event, and id must be initialized to empty strings:
|
|
181
|
+
// https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
|
|
182
|
+
// retry should be initialized to undefined so we return a consistent shape
|
|
183
|
+
// to the js engine all the time: https://mathiasbynens.be/notes/shapes-ics#takeaways
|
|
184
|
+
return {
|
|
185
|
+
data: '',
|
|
186
|
+
event: '',
|
|
187
|
+
id: '',
|
|
188
|
+
retry: undefined
|
|
189
|
+
};
|
|
190
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { getCommonConfig } from "../../config";
|
|
8
|
+
// import $i18n from '@/i18n';
|
|
9
|
+
import { ConfigProvider } from "../..";
|
|
10
|
+
import ReactDOM from 'react-dom/client';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description 静态方法渲染组件
|
|
14
|
+
*/
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
export default {
|
|
17
|
+
show: function show(modal, id) {
|
|
18
|
+
var _getCommonConfig = getCommonConfig(),
|
|
19
|
+
prefix = _getCommonConfig.prefix,
|
|
20
|
+
antPrefix = _getCommonConfig.antPrefix,
|
|
21
|
+
configProviderProps = _getCommonConfig.configProviderProps;
|
|
22
|
+
var prevModal = document.querySelector("div[role=".concat(prefix, "-static").concat(id ? "-".concat(id) : '', "]"));
|
|
23
|
+
if (prevModal) {
|
|
24
|
+
prevModal.parentElement.removeChild(prevModal);
|
|
25
|
+
}
|
|
26
|
+
var container = document.createElement('div');
|
|
27
|
+
container.setAttribute('role', "".concat(prefix, "-static").concat(id ? "-".concat(id) : ''));
|
|
28
|
+
var target = document.querySelector('.spark') || document.body;
|
|
29
|
+
target.appendChild(container);
|
|
30
|
+
var root = ReactDOM.createRoot(container);
|
|
31
|
+
root.render( /*#__PURE__*/_jsx(ConfigProvider
|
|
32
|
+
// iconFontUrl={DEFAULT_ICON_FONT_URL}
|
|
33
|
+
// locale={$i18n.language === 'zh-CN' ? zhCN : enUS}
|
|
34
|
+
, _objectSpread(_objectSpread({
|
|
35
|
+
prefix: prefix,
|
|
36
|
+
prefixCls: antPrefix
|
|
37
|
+
}, configProviderProps), {}, {
|
|
38
|
+
children: modal
|
|
39
|
+
})));
|
|
40
|
+
|
|
41
|
+
// 保存 root 实例到 container 上
|
|
42
|
+
container['root'] = root;
|
|
43
|
+
},
|
|
44
|
+
hide: function hide(id) {
|
|
45
|
+
var _getCommonConfig2 = getCommonConfig(),
|
|
46
|
+
_getCommonConfig2$pre = _getCommonConfig2.prefix,
|
|
47
|
+
prefix = _getCommonConfig2$pre === void 0 ? '' : _getCommonConfig2$pre;
|
|
48
|
+
var prevModal = document.querySelector("div[role=".concat(prefix, "-static").concat(id ? "-".concat(id) : '', "]"));
|
|
49
|
+
if (prevModal) {
|
|
50
|
+
// 卸载 ReactDOM.createRoot 产生的实例
|
|
51
|
+
var root = prevModal['root'];
|
|
52
|
+
if (root) {
|
|
53
|
+
root.unmount();
|
|
54
|
+
}
|
|
55
|
+
prevModal.parentElement.removeChild(prevModal);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 字符串处理相关的逻辑
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 解析json,如果不是合法的json,不会抛出错误,而是返回null或原值(取决于returnOriginal的取值)
|
|
6
|
+
* @param str
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseJsonSafely(str: string, returnOriginal?: boolean, muteWarning?: boolean): any;
|
|
10
|
+
/**
|
|
11
|
+
* 将utf字符串转换为base64
|
|
12
|
+
* @param utfString
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export declare function base64Encoder(utfString: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* 将base64字符串转换为utf字符串
|
|
18
|
+
*/
|
|
19
|
+
export declare function base64Decoder(base64String: string): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 字符串处理相关的逻辑
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 解析json,如果不是合法的json,不会抛出错误,而是返回null或原值(取决于returnOriginal的取值)
|
|
7
|
+
* @param str
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export function parseJsonSafely(str) {
|
|
11
|
+
var returnOriginal = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
12
|
+
var muteWarning = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
13
|
+
if (typeof str !== 'string') {
|
|
14
|
+
if (!muteWarning) {
|
|
15
|
+
console.warn(str, 'is not valid json');
|
|
16
|
+
}
|
|
17
|
+
return returnOriginal ? str : null;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(str);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
if (!muteWarning) {
|
|
23
|
+
console.warn(str, 'is not valid json');
|
|
24
|
+
}
|
|
25
|
+
return returnOriginal ? str : null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 将utf字符串转换为base64
|
|
31
|
+
* @param utfString
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export function base64Encoder(utfString) {
|
|
35
|
+
// 创建一个TextEncoder对象来编码字符串到Uint8Array
|
|
36
|
+
var encoder = new TextEncoder();
|
|
37
|
+
var uint8Array = encoder.encode(utfString);
|
|
38
|
+
// 将Uint8Array转换为字符串,以便btoa可以处理
|
|
39
|
+
var binaryString = '';
|
|
40
|
+
for (var i = 0; i < uint8Array.length; i++) {
|
|
41
|
+
binaryString += String.fromCharCode(uint8Array[i]);
|
|
42
|
+
}
|
|
43
|
+
// 使用btoa进行Base64编码
|
|
44
|
+
var encodedString = btoa(binaryString);
|
|
45
|
+
return encodedString;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 将base64字符串转换为utf字符串
|
|
50
|
+
*/
|
|
51
|
+
export function base64Decoder(base64String) {
|
|
52
|
+
// 使用atob进行Base64解码
|
|
53
|
+
var binaryString = atob(base64String);
|
|
54
|
+
// 将二进制字符串转换为Uint8Array
|
|
55
|
+
var bytes = new Uint8Array(binaryString.length);
|
|
56
|
+
for (var i = 0; i < binaryString.length; i++) {
|
|
57
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
58
|
+
}
|
|
59
|
+
// 使用TextDecoder解码Uint8Array为原始字符串
|
|
60
|
+
var decoder = new TextDecoder('utf-8');
|
|
61
|
+
var originalString = decoder.decode(bytes);
|
|
62
|
+
return originalString;
|
|
63
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const copy: (text: string) => void;
|
|
3
|
+
export declare const renderTooltip: (title: string | JSX.Element, extraProps?: any) => any;
|
|
4
|
+
export declare function isElement(e: any): e is JSX.Element;
|
|
5
|
+
export declare function isSafari(agent?: any): boolean;
|
|
6
|
+
export declare const addZreo: (num: number) => string | number;
|
|
7
|
+
export declare const initSeconed: (seconds: number) => string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["maxWidth", "maxHeight"];
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
import React from 'react';
|
|
11
|
+
export var copy = function copy(text) {
|
|
12
|
+
if (navigator.clipboard) {
|
|
13
|
+
navigator.clipboard.writeText(text);
|
|
14
|
+
} else {
|
|
15
|
+
var textarea = document.createElement('textarea');
|
|
16
|
+
document.body.appendChild(textarea);
|
|
17
|
+
// 隐藏此输入框
|
|
18
|
+
textarea.style.position = 'fixed';
|
|
19
|
+
textarea.style.clip = 'rect(0 0 0 0)';
|
|
20
|
+
textarea.style.top = '10px';
|
|
21
|
+
// 赋值
|
|
22
|
+
textarea.value = text;
|
|
23
|
+
// 选中
|
|
24
|
+
textarea.select();
|
|
25
|
+
// 复制
|
|
26
|
+
document.execCommand('copy', true);
|
|
27
|
+
// 移除输入框
|
|
28
|
+
document.body.removeChild(textarea);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export var renderTooltip = function renderTooltip(title) {
|
|
32
|
+
var extraProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
33
|
+
var maxWidth = extraProps.maxWidth,
|
|
34
|
+
maxHeight = extraProps.maxHeight,
|
|
35
|
+
extra = _objectWithoutProperties(extraProps, _excluded);
|
|
36
|
+
return _objectSpread({
|
|
37
|
+
overlayInnerStyle: {
|
|
38
|
+
maxWidth: maxWidth || 326,
|
|
39
|
+
maxHeight: maxHeight || 150,
|
|
40
|
+
overflowY: 'auto',
|
|
41
|
+
padding: '6px 12px'
|
|
42
|
+
},
|
|
43
|
+
title: title,
|
|
44
|
+
arrow: false
|
|
45
|
+
}, extra);
|
|
46
|
+
};
|
|
47
|
+
export function isElement(e) {
|
|
48
|
+
return /*#__PURE__*/React.isValidElement(e);
|
|
49
|
+
}
|
|
50
|
+
export function isSafari(agent) {
|
|
51
|
+
var _agent = agent || navigator.userAgent;
|
|
52
|
+
return /^((?!chrome|android).)*safari/i.test(_agent);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// 小于10补零
|
|
56
|
+
export var addZreo = function addZreo(num) {
|
|
57
|
+
return num >= 10 ? num : "0".concat(num);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 时间秒转化为0:00格式
|
|
61
|
+
export var initSeconed = function initSeconed(seconds) {
|
|
62
|
+
if (seconds < 60) {
|
|
63
|
+
var num = Math.ceil(seconds);
|
|
64
|
+
return "0:".concat(addZreo(num));
|
|
65
|
+
}
|
|
66
|
+
var minutes = Math.floor(seconds / 60);
|
|
67
|
+
var rest = Math.ceil(seconds % 60);
|
|
68
|
+
return "".concat(addZreo(minutes), ":").concat(addZreo(rest));
|
|
69
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface WaitForOptions {
|
|
2
|
+
/** 最长等待时间
|
|
3
|
+
* @default 5000
|
|
4
|
+
*/
|
|
5
|
+
timeout?: number;
|
|
6
|
+
/** 执行判断间隔时间,单位ms
|
|
7
|
+
* @default 100
|
|
8
|
+
*/
|
|
9
|
+
intervalTime?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 等待函数执行成功
|
|
13
|
+
* @param func dom的css选择器
|
|
14
|
+
* @param option 控制参数
|
|
15
|
+
* @returns Promise<any>
|
|
16
|
+
*/
|
|
17
|
+
export declare function waitForFunc<FuncResult>(func: () => FuncResult, { timeout, intervalTime }?: WaitForOptions): Promise<FuncResult>;
|
|
18
|
+
/**
|
|
19
|
+
* 等待出现在指定dom
|
|
20
|
+
* @param selector dom的css选择器
|
|
21
|
+
* @param option 控制参数
|
|
22
|
+
* @returns Promise<any>
|
|
23
|
+
*/
|
|
24
|
+
export declare function waitForDom(selector: string, opts?: WaitForOptions): Promise<HTMLElement>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 等待函数执行成功
|
|
3
|
+
* @param func dom的css选择器
|
|
4
|
+
* @param option 控制参数
|
|
5
|
+
* @returns Promise<any>
|
|
6
|
+
*/
|
|
7
|
+
export function waitForFunc(func) {
|
|
8
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
9
|
+
_ref$timeout = _ref.timeout,
|
|
10
|
+
timeout = _ref$timeout === void 0 ? 5000 : _ref$timeout,
|
|
11
|
+
_ref$intervalTime = _ref.intervalTime,
|
|
12
|
+
intervalTime = _ref$intervalTime === void 0 ? 100 : _ref$intervalTime;
|
|
13
|
+
var start = Date.now();
|
|
14
|
+
return new Promise(function (resolve, reject) {
|
|
15
|
+
var interval = setInterval(function () {
|
|
16
|
+
var result = func();
|
|
17
|
+
if (result) {
|
|
18
|
+
clearInterval(interval);
|
|
19
|
+
resolve(result);
|
|
20
|
+
} else if (Date.now() - start > timeout) {
|
|
21
|
+
reject('timeout');
|
|
22
|
+
clearInterval(interval);
|
|
23
|
+
}
|
|
24
|
+
}, intervalTime);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* 等待出现在指定dom
|
|
30
|
+
* @param selector dom的css选择器
|
|
31
|
+
* @param option 控制参数
|
|
32
|
+
* @returns Promise<any>
|
|
33
|
+
*/
|
|
34
|
+
export function waitForDom(selector) {
|
|
35
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36
|
+
return waitForFunc(function () {
|
|
37
|
+
return document.querySelector(selector);
|
|
38
|
+
}, opts);
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module '*.css';
|
|
2
|
+
declare module '*.less';
|
|
3
|
+
declare module '*.module.less';
|
|
4
|
+
declare module '*.svg';
|
|
5
|
+
|
|
6
|
+
interface Window {
|
|
7
|
+
g_config: any;
|
|
8
|
+
ALIYUN_CONSOLE_CONFIG: any;
|
|
9
|
+
g_efm_common: boolean;
|
|
10
|
+
currentRegionId?: string;
|
|
11
|
+
g_track?: any;
|
|
12
|
+
/** 在阿里云viper>应用配置>基础数据中配置的应用配置项 */
|
|
13
|
+
ALIYUN_CONSOLE_GLOBAL?: any;
|
|
14
|
+
}
|