diff --git a/.eslintrc.js b/.eslintrc.js index d8dee5ec17..1e07a7c02b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -121,6 +121,8 @@ module.exports = { "space-infix-ops": ["error", { "int32Hint": false }], 'space-before-blocks': ['error', 'always'], "space-infix-ops": "error", + '@typescript-eslint/prefer-as-const': 'off', + '@typescript-eslint/no-namespace': 'off', "@typescript-eslint/type-annotation-spacing": ['error', {"after": true}], "@typescript-eslint/member-delimiter-style": [ "error", diff --git a/content/feedback/banner/index-en-US.md b/content/feedback/banner/index-en-US.md index 912b6a51c7..854498a3d0 100644 --- a/content/feedback/banner/index-en-US.md +++ b/content/feedback/banner/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 78 +order: 80 category: Feedback title: Banner subTitle: Banner diff --git a/content/feedback/banner/index.md b/content/feedback/banner/index.md index 056bd9701c..64cb1bbf03 100644 --- a/content/feedback/banner/index.md +++ b/content/feedback/banner/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 78 +order: 80 category: 反馈类 title: Banner 通知横幅 icon: doc-banner diff --git a/content/feedback/notification/index-en-US.md b/content/feedback/notification/index-en-US.md index 2c374a426f..5c95b20dec 100644 --- a/content/feedback/notification/index-en-US.md +++ b/content/feedback/notification/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 79 +order: 81 category: Feedback title: Notification subTitle: Notification diff --git a/content/feedback/notification/index.md b/content/feedback/notification/index.md index df98a79b77..308a15b52e 100644 --- a/content/feedback/notification/index.md +++ b/content/feedback/notification/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 79 +order: 81 category: 反馈类 title: Notification 通知 icon: doc-notification diff --git a/content/feedback/popconfirm/index-en-US.md b/content/feedback/popconfirm/index-en-US.md index 4403cae742..1c48572e77 100644 --- a/content/feedback/popconfirm/index-en-US.md +++ b/content/feedback/popconfirm/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 80 +order: 82 category: Feedback title: Popconfirm subTitle: Popconfirm diff --git a/content/feedback/popconfirm/index.md b/content/feedback/popconfirm/index.md index 2da9849deb..53df4b37e4 100644 --- a/content/feedback/popconfirm/index.md +++ b/content/feedback/popconfirm/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 80 +order: 82 category: 反馈类 title: Popconfirm 气泡确认框 icon: doc-popconfirm diff --git a/content/feedback/progress/index-en-US.md b/content/feedback/progress/index-en-US.md index 70b15301e8..cb0edf5af1 100644 --- a/content/feedback/progress/index-en-US.md +++ b/content/feedback/progress/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 81 +order: 83 category: Feedback title: Progress subTitle: Progress diff --git a/content/feedback/progress/index.md b/content/feedback/progress/index.md index cf3d5bbd94..21c91cd6ea 100644 --- a/content/feedback/progress/index.md +++ b/content/feedback/progress/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 81 +order: 83 category: 反馈类 title: Progress 进度条 icon: doc-progress diff --git a/content/feedback/skeleton/index-en-US.md b/content/feedback/skeleton/index-en-US.md index b1ba8c9a6c..0a00439862 100644 --- a/content/feedback/skeleton/index-en-US.md +++ b/content/feedback/skeleton/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 82 +order: 84 category: Feedback title: Skeleton subTitle: Skeleton diff --git a/content/feedback/skeleton/index.md b/content/feedback/skeleton/index.md index 020d4299ed..987dfaccb4 100644 --- a/content/feedback/skeleton/index.md +++ b/content/feedback/skeleton/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 82 +order: 84 category: 反馈类 title: Skeleton 骨架屏 icon: doc-skeleton diff --git a/content/feedback/spin/index-en-US.md b/content/feedback/spin/index-en-US.md index 045a00e8b6..f93f1f5d42 100644 --- a/content/feedback/spin/index-en-US.md +++ b/content/feedback/spin/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 83 +order: 85 category: Feedback title: Spin subTitle: Spin diff --git a/content/feedback/spin/index.md b/content/feedback/spin/index.md index 76b4260eb6..4c5d68fe17 100644 --- a/content/feedback/spin/index.md +++ b/content/feedback/spin/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 83 +order: 85 category: 反馈类 title: Spin 加载器 icon: doc-spin diff --git a/content/feedback/toast/index-en-US.md b/content/feedback/toast/index-en-US.md index de9370ce5b..b4c5b34d5c 100644 --- a/content/feedback/toast/index-en-US.md +++ b/content/feedback/toast/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 84 +order: 86 category: Feedback title: Toast subTitle: Toast diff --git a/content/feedback/toast/index.md b/content/feedback/toast/index.md index 6a841c37c0..92d95266ab 100644 --- a/content/feedback/toast/index.md +++ b/content/feedback/toast/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 84 +order: 86 category: 反馈类 title: Toast 提示 icon: doc-toast diff --git a/content/input/autocomplete/index-en-US.md b/content/input/autocomplete/index-en-US.md index a44a2497f4..e9ce6e124a 100644 --- a/content/input/autocomplete/index-en-US.md +++ b/content/input/autocomplete/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 28 +order: 30 category: Input title: AutoComplete icon: doc-autocomplete diff --git a/content/input/autocomplete/index.md b/content/input/autocomplete/index.md index b29ffd3540..a3130c5b5a 100644 --- a/content/input/autocomplete/index.md +++ b/content/input/autocomplete/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 28 +order: 30 category: 输入类 title: AutoComplete 自动完成 icon: doc-autocomplete diff --git a/content/input/cascader/index-en-US.md b/content/input/cascader/index-en-US.md index 1f4792dec7..4e833ba946 100644 --- a/content/input/cascader/index-en-US.md +++ b/content/input/cascader/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 29 +order: 31 category: Input title: Cascader subTitle: Cascade @@ -1537,6 +1537,63 @@ import { Cascader } from '@douyinfe/semi-ui'; }; ``` +### Checked RelationShip + +Version: >= 2.71.0 + +In multiple, `checkRelation` can be used to set the type of node selection relationship, optional: 'related' (default), 'unRelated'. When the selection relationship is 'unRelated', it means that selections between nodes do not affect each other. + +```jsx live=true +import React from 'react'; +import { Cascader } from '@douyinfe/semi-ui'; +() => { + const treeData = [ + { + label: 'Asia', + value: 'Asia', + key: '0', + children: [ + { + label: 'China', + value: 'China', + key: '0-0', + children: [ + { + label: 'Beijing', + value: 'Beijing', + key: '0-0-0', + }, + { + label: 'Shanghai', + value: 'Shanghai', + key: '0-0-1', + }, + ], + }, + ], + }, + { + label: 'North America', + value: 'North America', + key: '1', + } + ]; + + return ( + + ); +}; +``` + ### Dynamic Update of Data ```jsx live=true @@ -1895,6 +1952,7 @@ function Demo() { | borderless | borderless mode >=2.33.0 | boolean | | | bottomSlot | bottom slot | ReactNode | - | 1.27.0 | | changeOnSelect | Toggle whether non-leaf nodes are selectable | boolean | false | - | +| checkRelation | In multiple, the relationship between the checked states of the nodes, optional: 'related'、'unRelated'. | string | 'related' | v2.71.0 | | className | ClassName | string | - | - | | clearIcon | Can be used to customize the clear button, valid when showClear is true | ReactNode | - | 2.25.0 | | defaultOpen | Set whether to open the dropDown by default | boolean | false | - | diff --git a/content/input/cascader/index.md b/content/input/cascader/index.md index 76140d5b5a..2a34d86078 100644 --- a/content/input/cascader/index.md +++ b/content/input/cascader/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 29 +order: 31 category: 输入类 title: Cascader 级联选择 icon: doc-cascader @@ -1516,6 +1516,56 @@ import { Cascader } from '@douyinfe/semi-ui'; }; ``` +### 节点选中关系 + +版本:>= 2.71.0 + +多选时,可以使用 `checkRelation` 来设置节点之间选中关系的类型,可选:'related'(默认)、'unRelated'。当选中关系为 'unRelated' 时,意味着节点之间的选中互不影响。 + +```jsx live=true +import React from 'react'; +import { Cascader } from '@douyinfe/semi-ui'; +() => { + const treeData = [ + { + label: '亚洲', + value: 'Asia', + children: [ + { + label: '中国', + value: 'China', + children: [ + { + label: '北京', + value: 'Beijing', + }, + { + label: '上海', + value: 'Shanghai', + }, + ], + }, + ], + }, + { + label: '北美洲', + value: 'North America', + } + ]; + return ( + + ); +}; +``` ### 动态更新数据 @@ -1872,6 +1922,7 @@ function Demo() { | bottomSlot | 底部插槽 | ReactNode | - | 1.27.0 | | borderless | 无边框模式 >=2.33.0 | boolean | | | changeOnSelect | 是否允许选择非叶子节点 | boolean | false | - | +| checkRelation | 多选时,节点之间选中状态的关系,可选:'related'、'unRelated'。 | string | 'related' | v2.71.0 | | className | 选择框的 className 属性 | string | - | - | | clearIcon | 可用于自定义清除按钮, showClear为true时有效 | ReactNode | - | 2.25.0 | | defaultOpen | 设置是否默认打开下拉菜单 | boolean | false | - | diff --git a/content/input/checkbox/index-en-US.md b/content/input/checkbox/index-en-US.md index bbb0785646..773cac9e1b 100644 --- a/content/input/checkbox/index-en-US.md +++ b/content/input/checkbox/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 30 +order: 32 category: Input title: Checkbox subTitle: Checkbox diff --git a/content/input/checkbox/index.md b/content/input/checkbox/index.md index 6a0d35fc5d..5457f82da0 100644 --- a/content/input/checkbox/index.md +++ b/content/input/checkbox/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 30 +order: 32 category: 输入类 title: Checkbox 复选框 icon: doc-checkbox diff --git a/content/input/colorpicker/index-en-US.md b/content/input/colorpicker/index-en-US.md index 47fbda212b..4982b3edb0 100644 --- a/content/input/colorpicker/index-en-US.md +++ b/content/input/colorpicker/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 31 +order: 33 category: Input title: ColorPicker icon: doc-colorPlatteNew diff --git a/content/input/colorpicker/index.md b/content/input/colorpicker/index.md index be382beb46..6f1a3a73ee 100644 --- a/content/input/colorpicker/index.md +++ b/content/input/colorpicker/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 31 +order: 33 category: 输入类 title: ColorPicker 颜色选择器 icon: doc-colorPlatteNew diff --git a/content/input/datepicker/index-en-US.md b/content/input/datepicker/index-en-US.md index bb3415565f..43d5d4ea20 100644 --- a/content/input/datepicker/index-en-US.md +++ b/content/input/datepicker/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 32 +order: 34 category: Input title: DatePicker subTitle: Date Selector @@ -965,7 +965,8 @@ function Demo() { const ref = useRef(); // Typescript // const ref = useRef(); - // Why not import the DatePicker exported by the entry? -> The entry component is a forwardRef component, and the ref is transparently passed to this component + // Why not import the DatePicker exported by the entry? + // The entry component is a forwardRef component, and the ref is transparently passed to this component const handleClickOutside = () => { console.log('click outside'); diff --git a/content/input/datepicker/index.md b/content/input/datepicker/index.md index 5d1e618884..7450b8411c 100644 --- a/content/input/datepicker/index.md +++ b/content/input/datepicker/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 32 +order: 34 category: 输入类 title: DatePicker 日期选择器 icon: doc-datepicker diff --git a/content/input/form/index-en-US.md b/content/input/form/index-en-US.md index daacc48ff0..843edc04ae 100644 --- a/content/input/form/index-en-US.md +++ b/content/input/form/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 33 +order: 35 category: Input title: Form subTitle: Form diff --git a/content/input/form/index.md b/content/input/form/index.md index f00cb22090..316868cda2 100644 --- a/content/input/form/index.md +++ b/content/input/form/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 33 +order: 35 category: 输入类 title: Form 表单 icon: doc-form diff --git a/content/input/input/index-en-US.md b/content/input/input/index-en-US.md index 05fa525ff4..f27708f11a 100644 --- a/content/input/input/index-en-US.md +++ b/content/input/input/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 34 +order: 36 category: Input title: Input subTitle: Input diff --git a/content/input/input/index.md b/content/input/input/index.md index 2740cc783a..963090d51b 100644 --- a/content/input/input/index.md +++ b/content/input/input/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 34 +order: 36 category: 输入类 title: Input 输入框 icon: doc-input diff --git a/content/input/inputnumber/index-en-US.md b/content/input/inputnumber/index-en-US.md index a43e6e1c82..283d4bc1ae 100644 --- a/content/input/inputnumber/index-en-US.md +++ b/content/input/inputnumber/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 35 +order: 37 category: Input title: InputNumber subTitle: InputNumber diff --git a/content/input/inputnumber/index.md b/content/input/inputnumber/index.md index 5f074a5e33..1352f654b8 100644 --- a/content/input/inputnumber/index.md +++ b/content/input/inputnumber/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 35 +order: 37 category: 输入类 title: InputNumber 数字输入框 icon: doc-inputnumber diff --git a/content/input/pincode/index-en-US.md b/content/input/pincode/index-en-US.md index 2f09f1420e..327b520611 100644 --- a/content/input/pincode/index-en-US.md +++ b/content/input/pincode/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 36 +order: 38 category: Input title: PinCode icon: doc-pincode diff --git a/content/input/pincode/index.md b/content/input/pincode/index.md index c4c7e94ad4..b6f2a12479 100644 --- a/content/input/pincode/index.md +++ b/content/input/pincode/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 36 +order: 38 category: 输入类 title: PinCode 验证码输入 icon: doc-pincode diff --git a/content/input/radio/index-en-US.md b/content/input/radio/index-en-US.md index b9222bd839..d587cbe303 100644 --- a/content/input/radio/index-en-US.md +++ b/content/input/radio/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 37 +order: 39 category: Input title: Radio subTitle: Radio diff --git a/content/input/radio/index.md b/content/input/radio/index.md index 2bcac82a1f..49917ba3a1 100644 --- a/content/input/radio/index.md +++ b/content/input/radio/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 37 +order: 39 category: 输入类 title: Radio 单选框 icon: doc-radio diff --git a/content/input/rating/index-en-US.md b/content/input/rating/index-en-US.md index ea4a3b99c9..2c3d6b7d17 100644 --- a/content/input/rating/index-en-US.md +++ b/content/input/rating/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 38 +order: 40 category: Input title: Rating subTitle: Rating diff --git a/content/input/rating/index.md b/content/input/rating/index.md index ff6d0de567..5630d9fc81 100644 --- a/content/input/rating/index.md +++ b/content/input/rating/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 38 +order: 40 category: 输入类 title: Rating 评分 icon: doc-rating diff --git a/content/input/select/index-en-US.md b/content/input/select/index-en-US.md index bb533f90b4..50a24d5b91 100644 --- a/content/input/select/index-en-US.md +++ b/content/input/select/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 39 +order: 41 category: Input title: Select subTitle: Select @@ -28,21 +28,15 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <> - -
-
- + Douyin + Capcut

); @@ -58,9 +52,9 @@ import { Select } from '@douyinfe/semi-ui'; () => { const list = [ - { value: 'abc', label: 'Semi' }, - { value: 'hotsoon', label: 'Hotsoon' }, - { value: 'pipixia', label: 'Pipixia' }, + { value: 'douyin', label: 'Douyin' }, + { value: 'capcut', label: 'Capcut' }, + { value: 'coze', label: 'Coze' }, { value: 'toutiao', label: 'TooBuzz' }, ]; return ; @@ -88,10 +82,10 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <> - + Douyin + Coze + Capcut BuzzVideo
@@ -102,11 +96,11 @@ import { Select } from '@douyinfe/semi-ui'; showRestTagsPopover={true} restTagsPopoverProps={{ position: 'top' }} style={{ width: '320px' }} - defaultValue={['abc', 'hotsoon', 'pipixia']} + defaultValue={['douyin', 'coze', 'capcut']} > - Semi - Hotsoon - Pipixia + Semi + Coze + Capcut BuzzVideo @@ -115,13 +109,13 @@ import { Select } from '@douyinfe/semi-ui';
@@ -132,13 +126,13 @@ import { Select } from '@douyinfe/semi-ui'; showRestTagsPopover={true} restTagsPopoverProps={{ position: 'top' }} style={{ width: '220px' }} - defaultValue={['xigua', 'hotsoon', 'pipixia', 'abc']} + defaultValue={['xigua', 'coze', 'capcut', 'douyin']} ellipsisTrigger expandRestTagsOnClick > - Semi - Hotsoon - Pipixia + Semi + Coze + Capcut BuzzVideo @@ -222,17 +216,17 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <>



); @@ -248,17 +242,17 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <> - Capcut

- Capcut

- Capcut @@ -279,24 +273,24 @@ import { IconVigoLogo, IconGift } from '@douyinfe/semi-icons'; () => ( <> - } showClear={true}> + Douyin + Capcut + Coze BuzzVideo

@@ -314,13 +308,13 @@ import { Select } from '@douyinfe/semi-ui'; () => { const list = [ - { value: 'abc', label: 'Semi' }, + { value: 'douyin', label: 'Douyin' }, { value: 'capcut', label: 'Capcut' }, { value: 'xigua', label: 'BuzzVideo' }, ]; return ( <> - +

innerBottomSlot:

- + Douyin + Capcut + Coze BuzzVideo @@ -454,12 +448,13 @@ import { Select } from '@douyinfe/semi-ui'; display: 'flex', paddingTop: 8, paddingLeft: 32, + paddingRight: 32, borderBottom: '0.5px solid var(--semi-color-border)', }; const tabOptions = [ - { itemKey: 'component', label: '组件' }, - { itemKey: 'design', label: '设计' }, - { itemKey: 'feedback', label: '反馈' }, + { itemKey: 'component', label: 'Compoonent' }, + { itemKey: 'design', label: 'Design' }, + { itemKey: 'feedback', label: 'Feedback' }, ]; const outerTopSlotNode = ( @@ -502,7 +497,7 @@ import { Select } from '@douyinfe/semi-ui'; return ( <> @@ -592,9 +587,9 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <>
@@ -745,8 +740,8 @@ import { Select } from '@douyinfe/semi-ui'; return label.includes(sug) || value.includes(sug); } return ( - + Douyin UlikeCam BuzzVideo @@ -915,9 +910,9 @@ import { Select } from '@douyinfe/semi-ui'; () => ( ); @@ -968,7 +963,7 @@ import { Select, TextArea } from '@douyinfe/semi-ui'; () => { const list = [ - { value: 'abc', label: 'Semi', type: 1 }, + { value: 'douyin', label: 'Douyin', type: 1 }, { value: 'capcut', label: 'Capcut', type: 2 }, { value: 'xigua', label: 'BuzzVideo', type: 3 }, ]; @@ -1029,7 +1024,7 @@ import { Select } from '@douyinfe/semi-ui'; () => { const optionList = [ - { value: 'abc', label: 'Semi' }, + { value: 'douyin', label: 'Douyin' }, { value: 'capcut', label: 'Capcut' }, { value: 'xigua', label: 'BuzzVideo' }, ]; @@ -1125,18 +1120,17 @@ interface TriggerRenderProps { ``` ```jsx live=true -import React from 'react'; -import { Select } from '@douyinfe/semi-ui'; +import React, { useState } from 'react'; +import { Select, Tag } from '@douyinfe/semi-ui'; import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; () => { - const [valList, setValList] = useState(['abc', 'hotsoon']); - const [val, setVal] = useState('abc'); + const [valList, setValList] = useState(['douyin', 'ulikecam']); const list = [ - { value: 'abc', label: 'Semi' }, - { value: 'hotsoon', label: 'Hotsoon' }, - { value: 'pipixia', label: 'Pipixia' }, - { value: 'toutiao', label: 'TooBuzz' }, + { value: 'douyin', label: 'Douyin' }, + { value: 'ulikecam', label: 'UlikeCam' }, + { value: 'jianying', label: 'Capcut' }, + { value: 'doubao', label: 'Cici' }, ]; const triggerRender = ({ value }) => { return ( @@ -1147,7 +1141,7 @@ import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; height: 32, display: 'flex', alignItems: 'center', - paddingLeft: 8, + paddingLeft: 12, borderRadius: 3, color: 'var(--semi-color-primary)', }} @@ -1159,7 +1153,7 @@ import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; fontSize: 14, }} > - Business Line + AppName
{ + const triggerRender2 = ({ value, ...rest }) => { return (
- -
- {value.map(item => item.label).join(' , ')} -
+ }> + {value.map(item => item.label).join(' / ')} +
); }; + return (
-

Different background Trigger

+

Different Background Trigger



-

Borderless and transparent Trigger

+

Use circle Tag as trigger

@@ -1237,6 +1222,63 @@ import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; }; ``` + +The following is a more complex example: Reusing the drag-and-sort capability of TagInput and adding sorting to Select through triggerRender. + +```jsx live=true +import React, { useState } from 'react'; +import { Select, TagInput } from '@douyinfe/semi-ui'; + +() => { + const [valList, setValList] = useState(['douyin', 'ulikecam']); + const [inputVal, setInputVal] = useState(''); + const list = [ + { value: 'douyin', label: 'Douyin' }, + { value: 'ulikecam', label: 'UlikeCam' }, + { value: 'jianying', label: 'Capcut' }, + { value: 'doubao', label: 'Cici' }, + ]; + + const handleSort = (currentLabels) => { + const newValue = currentLabels.map(item => list.find((i) => i.label === item).value) + setValList(newValue); + }; + + const triggerRender = ({ value, onSearch, onClear }) => { + return ( + item.label)} + inputValue={inputVal} + onInputChange={(word) => { + onSearch(word); + setInputVal(word); + }} + onChange={handleSort} + onClear={() => onClear()} + showClear + /> + ); + }; + + return ( + <> +

Select that can reorder selected options by dragging

+ + + ); +}; +``` + ### Custom Option Render - Simple customization: Pass the label property of Option or children into ReactNode, you can control the rendering of the candidates, and the content will automatically bring styles such as padding, background color, etc. @@ -1288,7 +1330,7 @@ import { Select, Checkbox } from '@douyinfe/semi-ui'; }; const optionList = [ - { value: 'abc', label: 'Semi', otherKey: 0 }, + { value: 'douyin', label: 'Semi', otherKey: 0 }, { value: 'capcut', label: 'Capcut', disabled: true, otherKey: 1 }, { value: 'cam', label: 'UlikeCam', otherKey: 2 }, { value: 'buzz', label: 'Buzz', otherKey: 3 }, @@ -1299,7 +1341,7 @@ import { Select, Checkbox } from '@douyinfe/semi-ui'; - 抖音 +

- + 抖音 轻颜相机

- 抖音 + Toast.warning('最多只允许选择两项')} > - 抖音 + 抖音 轻颜相机 剪映 西瓜视频 @@ -143,11 +143,11 @@ import { Select } from '@douyinfe/semi-ui'; showRestTagsPopover={true} restTagsPopoverProps={{ position: 'top' }} style={{ width: '220px' }} - defaultValue={['xigua', 'ulikecam', 'jianying', 'abc']} + defaultValue={['xigua', 'ulikecam', 'jianying', 'douyin']} ellipsisTrigger expandRestTagsOnClick > - 抖音 + 抖音 轻颜相机 剪映 西瓜视频 @@ -298,7 +298,7 @@ import { IconVigoLogo, IconGift } from '@douyinfe/semi-icons'; () => ( <> +

- 抖音 + 抖音 轻颜相机 剪映 西瓜视频 @@ -681,7 +681,7 @@ import { Select } from '@douyinfe/semi-ui'; () => ( <> - ABC + - - ); - } -} +() => { + const newOptions = Array.from({ length: 3000 }, (v, i) => ({ label: `option-${i}`, value: i })); + let virtualize = { + height: 270, + width: '100%', + itemSize: 36, // px + }; + return ( + + ); +}; ``` ### 自定义触发器 @@ -1188,14 +1175,13 @@ interface TriggerRenderProps { ```jsx live=true import React, { useState } from 'react'; -import { Select } from '@douyinfe/semi-ui'; +import { Select, Tag } from '@douyinfe/semi-ui'; import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; () => { - const [valList, setValList] = useState(['abc', 'ulikecam']); - const [val, setVal] = useState('abc'); + const [valList, setValList] = useState(['douyin', 'ulikecam']); const list = [ - { value: 'abc', label: '抖音' }, + { value: 'douyin', label: '抖音' }, { value: 'ulikecam', label: '轻颜相机' }, { value: 'jianying', label: '剪映' }, { value: 'toutiao', label: '今日头条' }, @@ -1243,28 +1229,18 @@ import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; return (
-
- {value.map(item => item.label).join(' , ')} - -
+ }> + {value.map(item => item.label).join(' / ')} +
); }; @@ -1284,19 +1260,77 @@ import { IconAppCenter, IconChevronDown } from '@douyinfe/semi-icons'; >

-

无边框无背景色的触发器

+

使用 circle Tag 作为触发器

); }; + +``` + +下例是更复杂的例子:复用了 TagInput 拖拽排序能力,通过 triggerRender 为 Select 增加排序 + +```jsx live=true +import React, { useState } from 'react'; +import { Select, TagInput } from '@douyinfe/semi-ui'; + +() => { + const [valList, setValList] = useState(['douyin', 'ulikecam']); + const [inputVal, setInputVal] = useState(''); + const list = [ + { value: 'douyin', label: '抖音' }, + { value: 'ulikecam', label: '轻颜相机' }, + { value: 'jianying', label: '剪映' }, + { value: 'toutiao', label: '今日头条' }, + ]; + + const handleSort = (currentLabels) => { + const newValue = currentLabels.map(item => list.find((i) => i.label === item).value) + setValList(newValue); + }; + + const triggerRender = ({ value, onSearch, onClear }) => { + return ( + item.label)} + inputValue={inputVal} + onInputChange={(word) => { + onSearch(word); + setInputVal(word); + }} + onChange={handleSort} + onClear={() => onClear()} + showClear + /> + ); + }; + + return ( + <> +

可对已选项拖拽重新排序的 Select

+ + + ); +}; ``` ### 自定义候选项渲染 @@ -1355,7 +1389,7 @@ import { Select, Checkbox, Highlight } from '@douyinfe/semi-ui'; }; const optionList = [ - { value: 'abc', label: '抖音', otherKey: 0 }, + { value: 'douyin', label: '抖音', otherKey: 0 }, { value: 'ulikecam', label: '轻颜相机', disabled: true, otherKey: 1 }, { value: 'jianying', label: '剪映', otherKey: 2 }, { value: 'toutiao', label: '今日头条', otherKey: 3 }, @@ -1529,11 +1563,11 @@ import { Select, Checkbox, Highlight } from '@douyinfe/semi-ui'; --- -| 属性 | 说明 | 类型 | 版本 | -| --------- | ---------- | --------- | ------- | -| className | 样式类名 | string | v0.31.0 | -| label | 展示的文本 | ReactNode | v0.31.0 | -| style | 样式 | object | v0.31.0 | +| 属性 | 说明 | 类型 | +| --------- | ---------- | --------- | +| className | 样式类名 | string | +| label | 展示的文本 | ReactNode | +| style | 样式 | object | ## Methods @@ -1541,12 +1575,12 @@ import { Select, Checkbox, Highlight } from '@douyinfe/semi-ui'; | 方法 | 说明 | 版本 | | ----------- | ----------------------------------- | ------- | -| close | 调用时可以手动关闭下拉列表 | v0.34.0 | -| open | 调用时可以手动展开下拉列表 | v0.34.0 | -| focus | 调用时可以手动聚焦 | v1.11.0 | -| clearInput | 调用时可以手动清空 input 搜索框的值 | v1.18.0 | -| deselectAll | 调用时可以手动清空所有已选项 | v1.18.0 | -| selectAll | 调用时可以选中所有 Option | v1.18.0 | +| close | 调用时可以手动关闭下拉列表 | | +| open | 调用时可以手动展开下拉列表 | | +| focus | 调用时可以手动聚焦 | | +| clearInput | 调用时可以手动清空 input 搜索框的值 | | +| deselectAll | 调用时可以手动清空所有已选项 | | +| selectAll | 调用时可以选中所有 Option | | | search(value: string, event: event)| 可通过 ref 调用该方法进行搜索,该搜索值会被置给 Input | v2.35.0 | ## Accessibility @@ -1618,7 +1652,7 @@ import { Select, Checkbox, Highlight } from '@douyinfe/semi-ui'; ``` ``` - 分组情况下,重复 label 并不会造成用户困惑为什么仍要求 label 必须唯一? diff --git a/content/input/slider/index-en-US.md b/content/input/slider/index-en-US.md index 83b827c7e6..b48285c52a 100644 --- a/content/input/slider/index-en-US.md +++ b/content/input/slider/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 40 +order: 42 category: Input title: Slider subTitle: Slider diff --git a/content/input/slider/index.md b/content/input/slider/index.md index 05c9507484..b57f280b64 100644 --- a/content/input/slider/index.md +++ b/content/input/slider/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 40 +order: 42 category: 输入类 title: Slider 滑动选择器 icon: doc-slider diff --git a/content/input/switch/index-en-US.md b/content/input/switch/index-en-US.md index 220ffae66e..e3ecd71de9 100644 --- a/content/input/switch/index-en-US.md +++ b/content/input/switch/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 41 +order: 43 category: Input title: Switch subTitle: Switch diff --git a/content/input/switch/index.md b/content/input/switch/index.md index 7cffa24aa9..18698f5190 100644 --- a/content/input/switch/index.md +++ b/content/input/switch/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 41 +order: 43 category: 输入类 title: Switch 开关 icon: doc-switch diff --git a/content/input/taginput/index-en-US.md b/content/input/taginput/index-en-US.md index ec35febdad..a57523e927 100644 --- a/content/input/taginput/index-en-US.md +++ b/content/input/taginput/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 42 +order: 44 category: Input title: TagInput subTitle: TagInput diff --git a/content/input/taginput/index.md b/content/input/taginput/index.md index c456b26417..5d92979c3e 100644 --- a/content/input/taginput/index.md +++ b/content/input/taginput/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 42 +order: 44 category: 输入类 title: TagInput 标签输入框 icon: doc-tagInput diff --git a/content/input/timepicker/index-en-US.md b/content/input/timepicker/index-en-US.md index d71f397373..199198f54f 100644 --- a/content/input/timepicker/index-en-US.md +++ b/content/input/timepicker/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 43 +order: 45 category: Input title: TimePicker subTitle: TimePicker diff --git a/content/input/timepicker/index.md b/content/input/timepicker/index.md index 3ab6c2823d..015ee76ee4 100644 --- a/content/input/timepicker/index.md +++ b/content/input/timepicker/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 43 +order: 45 category: 输入类 title: TimePicker 时间选择器 icon: doc-timepicker diff --git a/content/input/transfer/index-en-US.md b/content/input/transfer/index-en-US.md index df4161d37e..153509a678 100644 --- a/content/input/transfer/index-en-US.md +++ b/content/input/transfer/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 44 +order: 46 category: Input title: Transfer icon: doc-transfer diff --git a/content/input/transfer/index.md b/content/input/transfer/index.md index b56f19a08f..9f8438906b 100644 --- a/content/input/transfer/index.md +++ b/content/input/transfer/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 44 +order: 46 category: 输入类 title: Transfer 穿梭框 icon: doc-transfer diff --git a/content/input/treeselect/index-en-US.md b/content/input/treeselect/index-en-US.md index 23645e95e6..9805d5cb84 100644 --- a/content/input/treeselect/index-en-US.md +++ b/content/input/treeselect/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 45 +order: 47 category: Input title: TreeSelect subTitle: TreeSelect diff --git a/content/input/treeselect/index.md b/content/input/treeselect/index.md index 1909cd15cf..6ee2a5ef11 100644 --- a/content/input/treeselect/index.md +++ b/content/input/treeselect/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 45 +order: 47 category: 输入类 title: TreeSelect 树选择器 icon: doc-treeselect diff --git a/content/input/upload/index-en-US.md b/content/input/upload/index-en-US.md index 4952ef56c9..9bdbb6b0d2 100644 --- a/content/input/upload/index-en-US.md +++ b/content/input/upload/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 46 +order: 48 category: Input title: Upload icon: doc-upload diff --git a/content/input/upload/index.md b/content/input/upload/index.md index b56c343961..c2c5757b4a 100644 --- a/content/input/upload/index.md +++ b/content/input/upload/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 46 +order: 48 category: 输入类 title: Upload 上传 icon: doc-upload diff --git a/content/navigation/anchor/index-en-US.md b/content/navigation/anchor/index-en-US.md index 4e6ef5851c..fb45a3d621 100644 --- a/content/navigation/anchor/index-en-US.md +++ b/content/navigation/anchor/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 47 +order: 49 category: Navigation title: Anchor subTitle: Anchor diff --git a/content/navigation/anchor/index.md b/content/navigation/anchor/index.md index eaf2d2fbe6..f156aad534 100644 --- a/content/navigation/anchor/index.md +++ b/content/navigation/anchor/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 47 +order: 49 category: 导航类 title: Anchor 锚点 icon: doc-anchor diff --git a/content/navigation/backtop/index-en-US.md b/content/navigation/backtop/index-en-US.md index 10fd0c2a0c..951928ff4d 100644 --- a/content/navigation/backtop/index-en-US.md +++ b/content/navigation/backtop/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 48 +order: 50 category: Navigation title: BackTop subTitle: BackTop diff --git a/content/navigation/backtop/index.md b/content/navigation/backtop/index.md index 1e1d3c9945..eca909ef77 100644 --- a/content/navigation/backtop/index.md +++ b/content/navigation/backtop/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 48 +order: 50 category: 导航类 title: BackTop 回到顶部 icon: doc-backtop diff --git a/content/navigation/breadcrumb/index-en-US.md b/content/navigation/breadcrumb/index-en-US.md index 7a5ae22a99..bc20c0cb55 100644 --- a/content/navigation/breadcrumb/index-en-US.md +++ b/content/navigation/breadcrumb/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 49 +order: 51 category: Navigation title: Breadcrumb subTitle: Breadcrumb diff --git a/content/navigation/breadcrumb/index.md b/content/navigation/breadcrumb/index.md index 0b15fa5d1d..cd0ed2ed2c 100644 --- a/content/navigation/breadcrumb/index.md +++ b/content/navigation/breadcrumb/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 49 +order: 51 category: 导航类 title: Breadcrumb 面包屑 icon: doc-breadcrumb diff --git a/content/navigation/navigation/index-en-US.md b/content/navigation/navigation/index-en-US.md index 666181d949..0401985b3e 100644 --- a/content/navigation/navigation/index-en-US.md +++ b/content/navigation/navigation/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 50 +order: 52 category: Navigation title: Navigation subTitle: Navigation diff --git a/content/navigation/navigation/index.md b/content/navigation/navigation/index.md index 155683d05e..c462ae8831 100644 --- a/content/navigation/navigation/index.md +++ b/content/navigation/navigation/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 50 +order: 52 category: 导航类 title: Navigation 导航 icon: doc-navigation diff --git a/content/navigation/pagination/index-en-US.md b/content/navigation/pagination/index-en-US.md index 4b84008e3e..5389fcafda 100644 --- a/content/navigation/pagination/index-en-US.md +++ b/content/navigation/pagination/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 51 +order: 53 category: Navigation title: Pagination subTitle: Pagination diff --git a/content/navigation/pagination/index.md b/content/navigation/pagination/index.md index dcaf7ad968..18c94b2578 100644 --- a/content/navigation/pagination/index.md +++ b/content/navigation/pagination/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 51 +order: 53 category: 导航类 title: Pagination 翻页器 icon: doc-pagination diff --git a/content/navigation/steps/index-en-US.md b/content/navigation/steps/index-en-US.md index f897a67ba9..2fe1d3b138 100644 --- a/content/navigation/steps/index-en-US.md +++ b/content/navigation/steps/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 52 +order: 54 category: Navigation title: Steps subTitle: Steps diff --git a/content/navigation/steps/index.md b/content/navigation/steps/index.md index 376a9fce81..6d176855c0 100644 --- a/content/navigation/steps/index.md +++ b/content/navigation/steps/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 52 +order: 54 category: 导航类 title: Steps 步骤 icon: doc-steps diff --git a/content/navigation/tabs/index-en-US.md b/content/navigation/tabs/index-en-US.md index d3571ec925..a5d7971499 100644 --- a/content/navigation/tabs/index-en-US.md +++ b/content/navigation/tabs/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 53 +order: 55 category: Navigation title: Tabs subTitle: Tabs diff --git a/content/navigation/tabs/index.md b/content/navigation/tabs/index.md index bdf13b88db..23dfd4df24 100644 --- a/content/navigation/tabs/index.md +++ b/content/navigation/tabs/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 53 +order: 55 category: 导航类 title: Tabs 标签栏 icon: doc-tabs diff --git a/content/navigation/tree/index-en-US.md b/content/navigation/tree/index-en-US.md index 6d7e025ff3..6e958384c7 100644 --- a/content/navigation/tree/index-en-US.md +++ b/content/navigation/tree/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 54 +order: 56 category: Navigation title: Tree subTitle: Tree diff --git a/content/navigation/tree/index.md b/content/navigation/tree/index.md index d92196ecf1..21716be45f 100644 --- a/content/navigation/tree/index.md +++ b/content/navigation/tree/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 54 +order: 56 category: 导航类 title: Tree 树形控件 icon: doc-tree diff --git a/content/order.js b/content/order.js index 1063b4942b..5a7c8126db 100644 --- a/content/order.js +++ b/content/order.js @@ -24,6 +24,8 @@ const order = [ 'chat', 'codehighlight', "markdownrender", + "dragMove", + "jsonviewer", 'hotkeys', "lottie", 'autocomplete', @@ -84,7 +86,8 @@ const order = [ 'spin', 'toast', 'configprovider', - 'locale' + 'locale', + 'jsonviewer', ]; let { exec } = require('child_process'); let fs = require('fs'); diff --git a/content/other/configprovider/index-en-US.md b/content/other/configprovider/index-en-US.md index 51027369e8..491d267366 100644 --- a/content/other/configprovider/index-en-US.md +++ b/content/other/configprovider/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 85 +order: 87 category: Other title: ConfigProvider icon: doc-configprovider diff --git a/content/other/configprovider/index.md b/content/other/configprovider/index.md index efbe7b7b84..1d30a41aa0 100644 --- a/content/other/configprovider/index.md +++ b/content/other/configprovider/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 85 +order: 87 category: 其他 title: ConfigProvider 全局配置 icon: doc-configprovider diff --git a/content/other/locale/index-en-US.md b/content/other/locale/index-en-US.md index 652439d65d..bec9391f44 100644 --- a/content/other/locale/index-en-US.md +++ b/content/other/locale/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 86 +order: 88 category: Other title: LocaleProvider subTitle: LocaleProvider diff --git a/content/other/locale/index.md b/content/other/locale/index.md index 7c67194ca1..6065edb032 100644 --- a/content/other/locale/index.md +++ b/content/other/locale/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 86 +order: 88 category: 其他 title: LocaleProvider 多语言 icon: doc-i18n diff --git a/content/plus/dragMove/index-en-US.md b/content/plus/dragMove/index-en-US.md new file mode 100644 index 0000000000..a596311b77 --- /dev/null +++ b/content/plus/dragMove/index-en-US.md @@ -0,0 +1,236 @@ +--- +localeCode: en-US +order: 26 +category: Plus +title: DragMove +icon: doc-configprovider +dir: column +brief: Set elements to change their position by dragging +showNew: true +--- + +## When to use + +It is used to set the element that can be dragged to change its position. It supports limiting the drag range and customizing the elements that trigger dragging. + +## Demos + +### How to introduce + +DragMove supported from v2.71.0. + +```jsx +import { DragMove } from '@douyinfe/semi-ui'; +``` + +### Basic usage + +Elements wrapped by `DragMove` will be able to change their position by dragging. + +***Notice*** + +1. DragMove will set the draggable element to absolute positioning +2. DragMove needs to apply DOM event listeners to children. If the child element is a custom component, you need to ensure that it can pass properties to the underlying DOM element. The following types of children are supported: + 1. Class Component, it is not mandatory to bind ref, but you need to ensure that props can be transparently transmitted to the real DOM node + 2. Use the functional component wrapped by forwardRef to transparently transmit props and ref to the real DOM node in children + 3. Real DOM nodes, such as span, div, p... + +```jsx live=true +import React, { useRef, useEffect } from 'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo() { + return ( + +
Drag me
+
+ ); +} + +``` + +### Limit drag range + +Passing in `constrainer`, this function returns the elements that limit the draggable range. + +***Note: The elements returned by the constrainer need to be positioned relative*** + +```jsx live=true +import React, { useRef, useEffect } from 'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo() { + const containerRef = React.useRef(); + + return ( +
+ Constrainer + containerRef.current} + > +
Drag me
+
+
+ ) +} +``` + +### Customize elements that trigger dragging + +Passing in `handler`, this function returns the element that triggered the drag. If not set, you can click anywhere to drag; if set, only the part of the element returned by the handler can be dragged. + +```jsx live=true +import React, { useRef, useEffect } from'react'; +import { IconTransparentStroked } from '@douyinfe/semi-icons'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo(){ + const handlerRef = React.useRef(); + const containerRef = React.useRef(); + + return ( +
+ Constrainer + handlerRef.current} + constrainer={() => containerRef.current} + > +
+
+
+
+
+ ) +} +``` + +### Customize position processing after dragging + +You can customize the position processing after dragging through `customMove`. After this parameter is set, the DragMove component will only return the calculated position through the parameters without setting it. The user can set the new position as needed. + +```jsx live=true +import React, { useRef, useEffect } from'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function CustomMove() { + const containerRef = React.useRef(); + const elementRef = React.useRef(); + const startPoint = React.useRef(); + + const customMove = useCallback((element, top, left) => { + if (left + 100 > containerRef.current.offsetWidth) { + element.style.right = `${containerRef.current.offsetWidth - left - element.offsetWidth}px` + element.style.left = 'auto'; + } else { + element.style.left = left + 'px'; + } + element.style.top = top + 'px'; + }, []) + + const onMouseDown = useCallback((e) => { + startPoint.current = { + x: e.clientX, + y: e.clientY, + } + }, []); + + const onMouseUp = useCallback((e) => { + if (startPoint.current) { + const { x, y } = startPoint.current; + if (Math.abs(e.clientX - x) < 5 && Math.abs(e.clientY - y) < 5) { + if (elementRef.current.style.width === '50px') { + elementRef.current.style.width = '100px'; + } else { + elementRef.current.style.width = '50px'; + } + } + } + startPoint.current = null; + }, []); + + return ( + <> + Click on the blue color block to change the width. The blue color block will not exceed the range limit before and after the change. +

+
+ Constrainer + containerRef.current} + customMove={customMove} + > +
Drag me
+
+
+ + ) +} + +``` + + +### API + +| Property | Description | Type | Default value | +| --- | --- | --- | ----- | +| allowInputDrag | Whether to allow dragging when clicking on native input/textarea | boolean | false | +| allowMove | Determine whether dragging is allowed when clicking/touching. | (event: TouchEvent \|MouseEvent, element: ReactNode) => boolean | - | +| constrainer | Returns the element that limits the draggable range. | () => ReactNode \| 'parent' | - | +| customMove | Customize position processing after dragging| (element: ReactNode, top: number, left: number) => void | -| +| handler | Returns the element that triggers dragging. | () => ReactNode | - | +| onMouseDown | Callback when mouse is pressed | (e: MouseEvent) => void | - | +| onMouseMove | Callback when mouse moves | (e: MouseEvent) => void | - | +| onMouseUp | Callback when mouse is raised | (e: MouseEvent) => void | - | +| onTouchCancel | Callback when touch cancels | (e: TouchEvent) => void | - | +| onTouchEnd | callback when touch ends | (e: TouchEvent) => void | - | +| onTouchMove | Callback when touch moves | (e: TouchEvent) => void | - | +| onTouchStart | Callback when touch starts | (e: TouchEvent) => void | - | diff --git a/content/plus/dragMove/index.md b/content/plus/dragMove/index.md new file mode 100644 index 0000000000..98a4587b1a --- /dev/null +++ b/content/plus/dragMove/index.md @@ -0,0 +1,237 @@ +--- +localeCode: zh-CN +order: 26 +category: Plus +title: DragMove 拖拽移动 +icon: doc-configprovider +dir: column +brief: 可通过拖拽改变位置 +showNew: true +--- + +## 使用场景 + +用于设置元素可被拖动改变位置,支持限制拖拽范围,支持自定义触发拖动的元素。 + +## 代码演示 + +### 如何引入 + +DragMove 从 v2.71.0 开始支持 + +```jsx +import { DragMove } from '@douyinfe/semi-ui'; +``` + +### 基本用法 + +被 `DragMove` 包裹的元素将能够通过拖拽改变位置。 + +***注意*** + +1. DragMove 会将可拖拽的元素设置为 absolute 定位 +2. DragMove 需要将 DOM 事件监听器应用到 children 中,如果子元素是自定义的组件,你需要确保它能将属性传递至底层的 DOM 元素。支持以下类型的 children: + 1. Class Component,不强制绑定ref,但需要确保 props 可被透传至真实的 DOM 节点上 + 2. 使用 forwardRef 包裹后的函数式组件,将 props 与 ref 透传到 children 内真实的 DOM 节点上 + 3. 真实 DOM 节点, 如 span,div,p... + +```jsx live=true +import React, { useRef, useEffect } from 'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo() { + return ( + +
Drag me
+
+ ); +} + +``` + +### 限制拖动范围 + +传入 `constrainer`, 该函数返回限制可拖拽范围的元素。 + +***注意:constrainer 设置的元素需要为 relative 定位*** + +```jsx live=true +import React, { useRef, useEffect } from 'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo() { + const containerRef = React.useRef(); + + return ( +
+ Constrainer + containerRef.current} + > +
Drag me
+
+
+ ) +} +``` + +### 自定义触发拖动的元素 + +可通过 `handler` 自定义触发拖动的元素。如果不设置, 则点击任意位置均可拖动;如果设置,则仅点击 handler 部分可拖动。 + +```jsx live=true +import React, { useRef, useEffect } from'react'; +import { IconTransparentStroked } from '@douyinfe/semi-icons'; +import { DragMove } from '@douyinfe/semi-ui'; + +function Demo(){ + const handlerRef = React.useRef(); + const containerRef = React.useRef(); + + return ( +
+ Constrainer + handlerRef.current} + constrainer={() => containerRef.current} + > +
+
+
+
+
+ ) +} +``` + +### 自定义拖动后的位置处理 + +可通过 `customMove` 自定义拖动后的位置处理,该参数设置后,DragMove 组件内部将仅通过参数返回计算后的位置,不做设置,用户按需自行设置新位置。 + +```jsx live=true +import React, { useRef, useEffect } from'react'; +import { DragMove } from '@douyinfe/semi-ui'; + +function CustomMove() { + const containerRef = React.useRef(); + const elementRef = React.useRef(); + const startPoint = React.useRef(); + + const customMove = useCallback((element, top, left) => { + if (left + 100 > containerRef.current.offsetWidth) { + element.style.right = `${containerRef.current.offsetWidth - left - element.offsetWidth}px` + element.style.left = 'auto'; + } else { + element.style.left = left + 'px'; + } + element.style.top = top + 'px'; + }, []) + + const onMouseDown = useCallback((e) => { + startPoint.current = { + x: e.clientX, + y: e.clientY, + } + }, []); + + const onMouseUp = useCallback((e) => { + if (startPoint.current) { + const { x, y } = startPoint.current; + if (Math.abs(e.clientX - x) < 5 && Math.abs(e.clientY - y) < 5) { + if (elementRef.current.style.width === '60px') { + elementRef.current.style.width = '100px'; + } else { + elementRef.current.style.width = '60px'; + } + } + } + startPoint.current = null; + }, []); + + return ( + <> + 蓝色色块点击可改变宽度,改变前后蓝色色块均不会超出范围限制 +

+
+ Constrainer + containerRef.current} + customMove={customMove} + > +
Drag me
+
+
+ + ) +} + +``` + + + +### API + +| 属性 | 说明 | 类型 | 默认值 | +| --- | --- | --- | ----- | +| allowInputDrag | 点击原生 input/textarea 时是否允许拖动 | boolean | false | +| allowMove | 点击/触摸时是否允许拖动的判断函数 | (event: TouchEvent \|MouseEvent, element: ReactNode) => boolean | - | +| constrainer | 返回限制可拖拽的范围的元素 | () => ReactNode | - | +| customMove | 自定义拖动后的位置处理| (element: ReactNode, top: number, left: number) => void | -| +| handler | 返回触发拖动的元素 | () => ReactNode | - | +| onMouseDown | 鼠标按下时的回调 | (e: MouseEvent) => void | - | +| onMouseMove | 鼠标移动时的回调 | (e: MouseEvent) => void | - | +| onMouseUp | 鼠标抬起时的回调 | (e: MouseEvent) => void | - | +| onTouchCancel | 触摸取消时的回调 | (e: TouchEvent) => void | - | +| onTouchEnd | 触摸结束时的回调 | (e: TouchEvent) => void | - | +| onTouchMove | 触摸移动时的回调 | (e: TouchEvent) => void | - | +| onTouchStart | 触摸开始时的回调 | (e: TouchEvent) => void | - | diff --git a/content/plus/hotkeys/index-en-US.md b/content/plus/hotkeys/index-en-US.md index 8b2cd62abe..077baf3959 100644 --- a/content/plus/hotkeys/index-en-US.md +++ b/content/plus/hotkeys/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 26 +order: 28 category: Plus title: HotKeys icon: doc-configprovider diff --git a/content/plus/hotkeys/index.md b/content/plus/hotkeys/index.md index ff7fe89151..0b08c75836 100644 --- a/content/plus/hotkeys/index.md +++ b/content/plus/hotkeys/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 26 +order: 28 category: Plus title: HotKeys 快捷键 icon: doc-configprovider diff --git a/content/plus/jsonviewer/index-en-US.md b/content/plus/jsonviewer/index-en-US.md new file mode 100644 index 0000000000..32e4b58ae3 --- /dev/null +++ b/content/plus/jsonviewer/index-en-US.md @@ -0,0 +1,210 @@ +--- +localeCode: en-US +order: 27 +category: Plus +title: JsonViewer +icon: doc-jsonviewer +dir: column +noInline: true +brief: Used for displaying and editing JSON data +showNew: true +--- + +## When to use + +The JsonViewer component can be used for the display and editing of JSON data. + +Semi mainly referred to the design concept of the `text-buffer` data structure of [VS Code](https://github.com/microsoft/vscode), reused some utilities and data type definitions (Token parsing, language services, etc.), and implemented the JsonViewer component in combination with our functional/style customization requirements. Visually, it will be more coordinated with other components within the Semi Design system, and it will be more convenient for customized rendering and customization of specific data types. + +Compared with directly using MonacoEditor, Semi JsonViewer has additional processing in engineering construction, is simpler to use, and there is no need to pay attention to complex configurations such as Webpack plugins and worker loaders. At the same time, since we only focus on the JSON data format, it is more lightweight. While being ready to use out of the box, it has a smaller size **(📦-96%)**, a more extreme loading speed **(🚀 -53.5%)**, and less memory occupation **(⬇️71.6% reduction)**. For data with five million lines and below, data loading and parsing can be completed within 1 second. + +Detailed comparison data can be referred to in the [Performance](#Performance) section. + +- If you only need to preview/edit JSON and don't need to modify other more complex programming languages, we recommend that you choose `JsonViewer`. +- If you also need to handle data/code files in other formats and the full capabilities of a code editor (syntax highlighting, code completion, error prompts, complex editing, etc.) are essential and the build product size is not a key concern, we recommend that you choose `Monaco Editor`. + +## Demos + +### How to import + +JsonViewer supported from v2.71.0 + +```jsx import +import { JsonViewer } from '@douyinfe/semi-ui'; +``` + +### Basic Usage + +Basic usage of JsonViewer. Pass in the `height` and `width` parameters to set the height, width and initial value of the component. Pass in the JSON string through the `value`. + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +class SimpleJsonViewer extends React.Component { + render() { + return ( +
+ +
+ ); + } +} + +render(SimpleJsonViewer); +``` + +### Differrent lineHeight + +Configure the `lineHeight` parameter of `options` to set a fixed line height (unit: px, default 18). + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer, Space } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +class SimpleJsonViewerWithLineHeight extends React.Component { + render() { + return ( +
+
+ +
+
+ +
+
+ +
+
+ ); + } +} + +render(SimpleJsonViewerWithLineHeight); +``` + +### Autowrap + +Configure the `autoWrap` parameter of `options`. When it is set to `true`, the component will automatically wrap lines according to the length of the content. + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0", + "description": "Semi Design is a design system that defines a set of mid_back design and front_end basic components." +}`; +class SimpleJsonViewerWithAutoWrap extends React.Component { + render() { + return ( +
+ +
+ ); + } +} + +render(SimpleJsonViewerWithAutoWrap); +``` + +### Format options + +Configure `options.formatOptions` to set the formatting configuration of the component. + +- tabSize: number,set the indent size to 4, which means each level of indentation is 4 spaces. +- insertSpaces: boolean,when it is true, it means using spaces for indentation, and when it is false, it means using tabs. +- eol: string,set the line break character, which can be `\n`,`\r\n`, + +```jsx live=true dir="column" noInline=true +import React, { useRef } from 'react'; +import { JsonViewer, Button } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +function FormatJsonComponent() { + const jsonviewerRef = useRef(); + return ( +
+ +
+ +
+
+ ); +} + +render(FormatJsonComponent); +``` + +## API Reference + +### JsonViewer + +| Attribute | Description | Type | Default | +| --- | --- | --- | --- | +| value | Display content | string | - | +| height | Height of wrapper DOM | number | - | +| width | Width of wrapper DOM | number | - | +| className | className of wrapper DOM | string | - | +| style | InlineStyle of wrapper DOM | object | - | +| options | Formatting configuration | JsonViewerOptions | - | +| onChange | Callback for content change | (value: string) => void | - | + +### JsonViewerOptions + +| Attribute | Description | Type | Default | +| ------------- | --------------------------------------- | ----------------- | ------- | +| lineHeight | Height of each line of content, unit:px | number | 20 | +| autoWrap | Whether to wrap lines automatically. | boolean | true | +| formatOptions | Content format setting | FormattingOptions | - | + +### FormattingOptions + +| Attribute | Description | Type | Default | +| ------------ | ------------------------------------- | ------- | ------- | +| tabSize | Indent size. Unit: px | number | 4 | +| insertSpaces | Whether to use spaces for indentation | boolean | true | +| eol | Line break character | string | '\n' | + +## Methods + +Methods bound to the component instance can be called via `ref` to achieve certain special interactions. + +| Method | Description | +| ---------- | ---------------------- | +| getValue() | Get current value | +| format() | Format current content | + +### Performance + +#### Bundle Size + +| Libs Name | Size | Size (Gzip) | +| ------------ | --------- | ----------- | +| JsonViewer | 203.14kb | 51.23kb | +| MonacoEditor | 5102.0 KB | 1322.7 KB | + +#### Time for rendering data of different magnitudes. + +> For details on the generation method of the test data, please refer to [URL](https://github.com/DouyinFE/semi-design/blob/main/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.jsx) +> When the data volume exceeds 500,000 lines, ReactMonacoEditor turns off highlighting and other behaviors by default, and the data comparison does not follow the principle of a single variable. + +| Libs Name | 1k lines | 5k lines | 10 thousand lines | 100 thousand lines | 500 thousand lines | 1 million lines | 3 million lines | +| --- | --- | --- | --- | --- | --- | --- | --- | +| JsonViewer | 30.42ms | 30.66ms | 36.87ms | 52.73ms | 111.02ms | 178.81ms | 506.25ms | +| ReactMonacoEditor | 72.01ms | 73.76ms | 76.64ms | 97.89ms | 133.31ms | 202.79ms | 495.53ms | +| Performance improvement | 57.70% | 58.41% | 51.87% | 46.11% | - | - | - | diff --git a/content/plus/jsonviewer/index.md b/content/plus/jsonviewer/index.md new file mode 100644 index 0000000000..13a61119f0 --- /dev/null +++ b/content/plus/jsonviewer/index.md @@ -0,0 +1,206 @@ +--- +localeCode: zh-CN +order: 27 +category: Plus +title: JsonViewer Json编辑器 +icon: doc-jsonviewer +dir: column +noInline: true +brief: 用于展示和编辑 JSON 数据 +showNew: true +--- + +## 使用场景 +JsonViewer 组件可用于 JSON 数据的展示与编辑。 +Semi 重点参考了 [VS Code](https://github.com/microsoft/vscode)的 text-buffer 数据结构设计思路,复用了部分 utils与数据类型定义(Token解析,语言服务等),结合我们的功能/样式定制需求,实现了 JsonViewer 组件, 视觉上会与 Semi Design 体系内的其他组件更协调,对于特定数据类型的定制化渲染定制会更方便。 +相比于直接使用 MonacoEditor,Semi JsonViewer 在工程化构建上做了额外处理,使用更为简单,无需关注 Webpack插件、worker loader等复杂的配置。 +同时由于我们仅关注 Json 数据格式,更轻量化,在开箱即用的同时,拥有更小的体积**(📦 -96%)** ,更极致的加载速度**(🚀 -53.5%)** ,更少的内存占用**(⬇️ 71.6%)**。 +对于五百万行及以下的数据,均可以做到1s内完成数据加载与解析。 +详细的对比数据可查阅 [Performance](#Performance) 章节 +- 如果你仅需要对 Json 做预览/编辑,无需对更复杂的其他编程语言作修改,我们建议你选用 JsonViewer +- 如果你还需要处理其他格式的数据/代码文件,完整的代码编辑器能力(语法高亮、代码不全、错误提示、复杂编辑等)是刚需,构建产物体积不是关注重点,我们建议你选用 Monaco Editor + + +## 代码演示 + +### 如何引入 +JsonViewer 从 v2.71.0 开始支持 +```jsx import +import { JsonViewer } from '@douyinfe/semi-ui'; +``` + +### 基本用法 + +JsonViewer 的基本用法。传入 height 和 width 参数,设置组件的高度和宽度和初始值。通过 value 传入 Json 字符串 + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +class SimpleJsonViewer extends React.Component { + render() { + return ( +
+ +
+ ); + } +} + +render(SimpleJsonViewer); +``` + +### 设置行高 + +配置 options 的 lineHeight 参数,设置固定行高(单位:px, 默认 18)。 + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer, Space } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +class SimpleJsonViewerWithLineHeight extends React.Component { + render() { + return ( +
+
+ +
+
+ +
+
+ +
+
+ ); + } +} + +render(SimpleJsonViewerWithLineHeight); +``` + +### 自动换行 + +配置 options 的 autoWrap 参数,设置为 true 时,组件会根据内容长度自动换行。 + +```jsx live=true dir="column" noInline=true +import React from 'react'; +import { JsonViewer } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0", + "description": "Semi Design is a design system that defines a set of mid_back design and front_end basic components." +}`; +class SimpleJsonViewerWithAutoWrap extends React.Component { + render() { + return ( +
+ +
+ ); + } +} + +render(SimpleJsonViewerWithAutoWrap); +``` + +### 格式化配置 + +配置 options 的 formatOptions 参数,设置组件的格式化配置。 + +- tabSize: number,设置缩进大小为4,表示每级缩进 4 个空格 +- insertSpaces: boolean,true 表示使用空格进行缩进,false 表示使用制表符(Tab) +- eol: string,设置换行符,可以是\n,\r\n, + +```jsx live=true dir="column" noInline=true +import React, { useRef } from 'react'; +import { JsonViewer, Button } from '@douyinfe/semi-ui'; +const data = `{ + "name": "Semi", + "version": "0.0.0" +}`; +function FormatJsonComponent() { + const jsonviewerRef = useRef(); + return ( +
+ +
+ +
+
+ ); +} + +render(FormatJsonComponent); +``` + + +## API 参考 + +### JsonViewer + +| 属性 | 说明 | 类型 | 默认值 | +|-------------------|------------------------------------------------|---------------------------------|--------------| +| value | 展示内容 | string | - | +| height | 高度 | number | - | +| width | 宽度 | number | - | +| className | 类名 | string | - | +| style | 内联样式 | object | - | +| options | 格式化配置 | JsonViewerOptions | - | +| onChange | 内容变化回调 | (value: string) => void | - | + +### JsonViewerOptions + +| 属性 | 说明 | 类型 | 默认值 | +|-------------------|------------------------------------------------|---------------------------------|-----------| +| lineHeight | 行高 | number | 20 | +| autoWrap | 是否自动换行 | boolean | true | +| formatOptions | 格式化配置 | FormattingOptions | - | + +### FormattingOptions + +| 属性 | 说明 | 类型 | 默认值 | +|-------------------|------------------------------------------------|---------------------------------|-----------| +| tabSize | 缩进大小 | number | 4 | +| insertSpaces | 是否使用空格进行缩进 | boolean | true | +| eol | 换行符 | string | '\n' | + +## Methods + +绑定在组件实例上的方法,可以通过 ref 调用实现某些特殊交互 + +| 名称 | 描述 | +|---------|--------| +| getValue() | 获取当前值 | +| format() | 格式化 | + + +### Performance +#### Bundle Size +| 组件 | 体积 | 体积(Gzip) | +| ------------ | --------- | ---------- | +| JsonViewer | 203.14kb | 51.23kb | +| MonacoEditor | 5102.0 KB | 1322.7 KB | + +#### 渲染不同量级数据耗时 +> 注: +> - 测试数据生成方式详情可查阅 [url](https://github.com/DouyinFE/semi-design/blob/main/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.jsx) +> - 当数据量级超出50w行时,ReactMonacoEditor 默认关闭高亮等行为,数据对比不遵循单一变量原则 + +| 组件 | 1k行 | 5k行 | 1w行 | 10w行 | 50w行 | 100w行 | 300w行 | +| ----------------- | ------- | ------- | ------- | ------- | -------- | -------- | -------- | +| JsonViewer | 30.42ms | 30.66ms | 36.87ms | 52.73ms | 111.02ms | 178.81ms | 506.25ms | +| ReactMonacoEditor | 72.01ms | 73.76ms | 76.64ms | 97.89ms | 133.31ms | 202.79ms | 495.53ms | +| 性能提升 | 57.70% | 58.41% | 51.87% | 46.11% | - | - | - | \ No newline at end of file diff --git a/content/plus/lottie/index-en-US.md b/content/plus/lottie/index-en-US.md index 6848c165e8..15144197e2 100644 --- a/content/plus/lottie/index-en-US.md +++ b/content/plus/lottie/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 27 +order: 29 category: Plus title: Lottie Animation icon: doc-lottie diff --git a/content/plus/lottie/index.md b/content/plus/lottie/index.md index 8dd8bfb375..fd84d127f2 100644 --- a/content/plus/lottie/index.md +++ b/content/plus/lottie/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 27 +order: 29 category: Plus title: Lottie 动画 icon: doc-lottie diff --git a/content/show/avatar/index-en-US.md b/content/show/avatar/index-en-US.md index 28fc9488b1..c8ff1778ad 100644 --- a/content/show/avatar/index-en-US.md +++ b/content/show/avatar/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 55 +order: 57 category: Show title: Avatar subTitle: avatar diff --git a/content/show/avatar/index.md b/content/show/avatar/index.md index 8fc6713093..a7f375c184 100644 --- a/content/show/avatar/index.md +++ b/content/show/avatar/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 55 +order: 57 category: 展示类 title: Avatar 头像 icon: doc-avatar diff --git a/content/show/badge/index-en-US.md b/content/show/badge/index-en-US.md index db54f67791..95d52ec535 100644 --- a/content/show/badge/index-en-US.md +++ b/content/show/badge/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 56 +order: 58 category: Show title: Badge subTitle: Badge diff --git a/content/show/badge/index.md b/content/show/badge/index.md index c648b710fe..a3c2c339d0 100644 --- a/content/show/badge/index.md +++ b/content/show/badge/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 56 +order: 58 category: 展示类 title: Badge 徽章 icon: doc-badge diff --git a/content/show/calendar/index-en-US.md b/content/show/calendar/index-en-US.md index e3389a89f6..efd38b1b07 100644 --- a/content/show/calendar/index-en-US.md +++ b/content/show/calendar/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 57 +order: 59 category: Show title: Calendar subTitle: Calendar diff --git a/content/show/calendar/index.md b/content/show/calendar/index.md index 392b67f751..877a308fc7 100644 --- a/content/show/calendar/index.md +++ b/content/show/calendar/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 57 +order: 59 category: 展示类 title: Calendar 日历 icon: doc-calendar diff --git a/content/show/card/index-en-US.md b/content/show/card/index-en-US.md index e98c318b98..6e6b082f87 100644 --- a/content/show/card/index-en-US.md +++ b/content/show/card/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 58 +order: 60 category: Show title: Card subTitle: Card diff --git a/content/show/card/index.md b/content/show/card/index.md index 5bba9ee00f..3ca43a8b8e 100644 --- a/content/show/card/index.md +++ b/content/show/card/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 58 +order: 60 category: 展示类 title: Card 卡片 subTitle: 卡片 diff --git a/content/show/carousel/index-en-US.md b/content/show/carousel/index-en-US.md index c846f79337..468792a14c 100644 --- a/content/show/carousel/index-en-US.md +++ b/content/show/carousel/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 59 +order: 61 category: Show title: Carousel subTitle: Carousel diff --git a/content/show/carousel/index.md b/content/show/carousel/index.md index e0910860b1..80cadbfc14 100644 --- a/content/show/carousel/index.md +++ b/content/show/carousel/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 59 +order: 61 category: 展示类 title: Carousel 轮播图 icon: doc-carousel diff --git a/content/show/chart/index-en-US.md b/content/show/chart/index-en-US.md index ec862931ae..038c55303d 100644 --- a/content/show/chart/index-en-US.md +++ b/content/show/chart/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 77 +order: 79 category: Show title: Data Visualization icon: doc-vchart diff --git a/content/show/chart/index.md b/content/show/chart/index.md index 7f32d7c9fe..673625ef7c 100644 --- a/content/show/chart/index.md +++ b/content/show/chart/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 77 +order: 79 category: 展示类 title: Data Visualization 数据可视化 icon: doc-vchart diff --git a/content/show/collapse/index-en-US.md b/content/show/collapse/index-en-US.md index ab5ca34c05..4804587127 100644 --- a/content/show/collapse/index-en-US.md +++ b/content/show/collapse/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 60 +order: 62 category: Show title: Collapse subTitle: Collapse diff --git a/content/show/collapse/index.md b/content/show/collapse/index.md index 81b3765248..9fc24da381 100644 --- a/content/show/collapse/index.md +++ b/content/show/collapse/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 60 +order: 62 category: 展示类 title: Collapse 折叠面板 icon: doc-accordion diff --git a/content/show/collapsible/index-en-US.md b/content/show/collapsible/index-en-US.md index a186a5fbf0..213b12cc3a 100644 --- a/content/show/collapsible/index-en-US.md +++ b/content/show/collapsible/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 61 +order: 63 category: Show title: Collapsible subTitle: Collapsible diff --git a/content/show/collapsible/index.md b/content/show/collapsible/index.md index cb0956290e..73924c8c19 100644 --- a/content/show/collapsible/index.md +++ b/content/show/collapsible/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 61 +order: 63 category: 展示类 title: Collapsible 折叠 icon: doc-collapsible diff --git a/content/show/descriptions/index-en-US.md b/content/show/descriptions/index-en-US.md index a66d2be3fc..9e7c03cd00 100644 --- a/content/show/descriptions/index-en-US.md +++ b/content/show/descriptions/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 62 +order: 64 category: Show title: Description subTitle: Descriptions diff --git a/content/show/descriptions/index.md b/content/show/descriptions/index.md index f5ed9d9511..577358717e 100644 --- a/content/show/descriptions/index.md +++ b/content/show/descriptions/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 62 +order: 64 category: 展示类 title: Descriptions 描述列表 icon: doc-descriptions diff --git a/content/show/dropdown/index-en-US.md b/content/show/dropdown/index-en-US.md index 12b9939b07..208eb1fa1b 100644 --- a/content/show/dropdown/index-en-US.md +++ b/content/show/dropdown/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 63 +order: 65 category: Show title: Dropdown subTitle: Dropdown diff --git a/content/show/dropdown/index.md b/content/show/dropdown/index.md index fc4caa8aee..7af3b6cd6d 100644 --- a/content/show/dropdown/index.md +++ b/content/show/dropdown/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 63 +order: 65 category: 展示类 title: Dropdown 下拉框 icon: doc-dropdown @@ -344,21 +344,21 @@ function DropdownEvents() { | closeOnEsc | 在 trigger 或 弹出层按 Esc 键是否关闭面板,受控时不生效 | boolean | true | **2.13.0** | | className | 下拉弹层外层样式类名 | string | | | | children | 触发弹出层的 Trigger 元素 | ReactNode | | | -| clickToHide | 在弹出层内点击时是否自动关闭弹出层 | boolean | | **0.24.0** | +| clickToHide | 在弹出层内点击时是否自动关闭弹出层 | boolean | | | | contentClassName | 下拉菜单根元素类名 | string | | | | getPopupContainer | 指定父级 DOM,弹层将会渲染至该 DOM 中,自定义需要设置 `position: relative` 这会改变浮层 DOM 树位置,但不会改变视图渲染位置。 | function():HTMLElement | () => document.body | | | keepDOM | 关闭时是否保留内部组件 DOM 不销毁 | boolean | false | **2.31.0** | | margin | 弹出层计算溢出时的增加的冗余值,详见[issue#549](https://github.com/DouyinFE/semi-design/issues/549),作用同 Tooltip margin | number\|object | | **2.25.0** | | mouseEnterDelay | 鼠标移入 Trigger 后,延迟显示的时间,单位毫秒(仅当 trigger 为 hover/focus 时生效) | number | 50 | | | mouseLeaveDelay | 鼠标移出弹出层后,延迟消失的时间,单位毫秒(仅当 trigger 为 hover/focus 时生效) | number | 50 | | -| menu | 通过传入 JSON Array 来快速配置 Dropdown 内容 | Array | [] | **1.12.0** | +| menu | 通过传入 JSON Array 来快速配置 Dropdown 内容 | Array | [] | | | position | 弹出菜单的位置,常用:"bottom", "bottomLeft", "bottomRight",更多详见[Tooltip 位置](https://semi.design/zh-CN/show/tooltip#%E4%BD%8D%E7%BD%AE) | string | "bottom" | | | render | 弹出层的内容,由 `Dropdown.Menu` 及 `Dropdown.Item`、`Dropdown.Title` 构成 | ReactNode | | | | rePosKey | 可以更新该项值手动触发弹出层的重新定位 | string \| number | | | | spacing | 弹出层与 Trigger 元素(即 Dropdown children)的距离,单位 px | number | 4 | | | style | 弹出层内联样式 | object | | | -| showTick | 是否自动在 active 的 Dropdown.Item 项左侧展示表示选中的勾 | boolean | false | **0.26.0** | -| stopPropagation | 是否阻止弹出层上的点击事件冒泡 | boolean | false | **0.34.0** | +| showTick | 是否自动在 active 的 Dropdown.Item 项左侧展示表示选中的勾 | boolean | false | | +| stopPropagation | 是否阻止弹出层上的点击事件冒泡 | boolean | false | | | trigger | 触发下拉的行为,可选 "hover", "focus", "click", "custom", "contextMenu"(v2.42 后提供) | string | "hover" | | | visible | 是否显示菜单,需配合 trigger custom 使用 | boolean | 无 | | | zIndex | 弹出层 z-index 值 | number | 1050 | | @@ -370,9 +370,9 @@ function DropdownEvents() { | 属性 | 说明 | 类型 | 默认值 | 版本 | | --------- | -------------------------------------------------------------------- | --------- | ------ | ---------- | -| className | 下拉弹层菜单样式类名 | string | | **0.28.0** | +| className | 下拉弹层菜单样式类名 | string | | | | children | 下拉弹层菜单包裹的子元素,一般为 `Dropdown.Item` 或 `Dropdown.Title` | ReactNode | | | -| style | 下拉弹层菜单样式 | object | | **0.28.0** | +| style | 下拉弹层菜单样式 | object | | | ### Dropdown.Item @@ -381,13 +381,13 @@ function DropdownEvents() { | active | 当前项是否处于激活态,激活态时左侧有 √,字体加粗,颜色加深。当 Dropdown 的 showTick 为 false 时,即使 Dropdown.Item 的 active 为 true,√ 也不会展示 | bool | false | | | className | 样式类名 | string | | | | disabled | 是否禁用菜单 | boolean | false | | -| icon | 图标 | ReactNode | | **1.16.0** | +| icon | 图标 | ReactNode | | | | style | 内联样式 | object | | | | type | 类型,可选值:"primary"、"secondary"、"tertiary"、"warning"、"danger" | string | "tertiary" | | | onClick | 单击触发的回调事件 | function | 无 | | | onMouseEnter | MouseEnter 触发的回调事件 | function | 无 | | | onMouseLeave | MouseLeave 触发的回调事件 | function | 无 | | -| onContextMenu | 点击鼠标右键触发的回调事件 | function | 无 | **1.6.0** | +| onContextMenu | 点击鼠标右键触发的回调事件 | function | 无 | | ### Dropdown.Title diff --git a/content/show/empty/index-en-US.md b/content/show/empty/index-en-US.md index bbb64abe49..e770794ded 100644 --- a/content/show/empty/index-en-US.md +++ b/content/show/empty/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 64 +order: 66 category: Show title: Empty subTitle: Empty diff --git a/content/show/empty/index.md b/content/show/empty/index.md index fcda8a3845..3f9d10fa9b 100644 --- a/content/show/empty/index.md +++ b/content/show/empty/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 64 +order: 66 category: 展示类 title: Empty 空状态 icon: doc-empty diff --git a/content/show/highlight/index-en-US.md b/content/show/highlight/index-en-US.md index 2a3f5be3fd..0b28d5b60d 100644 --- a/content/show/highlight/index-en-US.md +++ b/content/show/highlight/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 65 +order: 67 category: Show title: Highlight icon: doc-highlight @@ -71,6 +71,32 @@ import { Highlight } from '@douyinfe/semi-ui'; }; ``` +### Use Different Styles for Different Texts +After v2.71.0, it supports using different highlight styles for different highlighted texts. +The `searchWords` is a string array by default. When an array of objects is passed in, the highlighted text can be specified through `text`, and the `className` and `style` can be specified separately at the same time. + +```jsx live=true dir="column" +import React from 'react'; +import { Highlight } from '@douyinfe/semi-ui'; + +() => { + return ( +

+ +

+ ); +}; +``` + ### Specify the highlight tag diff --git a/content/show/highlight/index.md b/content/show/highlight/index.md index 6100ac0752..29c0cf21ff 100644 --- a/content/show/highlight/index.md +++ b/content/show/highlight/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 65 +order: 67 category: 展示类 title: Highlight 高亮文本 icon: doc-highlight @@ -89,6 +89,32 @@ import { Highlight } from '@douyinfe/semi-ui'; }; ``` +### 不同文本使用差异化样式 +v2.71.0 后,支持针对不同的高亮文本使用不同的高亮样式 +searchWords 默认为字符串数组。当传入对象数组时,可以通过 text指定高亮文本,同时单独指定 className、style + +```jsx live=true dir="column" +import React from 'react'; +import { Highlight } from '@douyinfe/semi-ui'; + +() => { + return ( +

+ +

+ ); +}; +``` + ### 指定高亮标签 @@ -112,16 +138,17 @@ import { Highlight } from '@douyinfe/semi-ui'; }; ``` + ## API 参考 ### Highlight | 属性 | 说明 | 类型 | 默认值 | | ------------ | -------------------------------------------------------- | -------------------------------- | ---------- | -| searchWords | 期望高亮显示的文本 | string[] | '' | +| searchWords | 期望高亮显示的文本(对象数组在v2.71后支持) | string[]\|object[] | [] | | sourceString | 源文本 | string | | | component | 高亮标签 | string | `mark` | -| highlightClassName | 高亮标签的样式类名 | ReactNode | - | -| highlightStyle | 高亮标签的内联样式 | ReactNode | - | +| highlightClassName | 高亮标签的样式类名 | string | - | +| highlightStyle | 高亮标签的内联样式 | CSSProperties | - | | caseSensitive | 是否大小写敏感 | false | - | | autoEscape | 是否自动转义 | true | - | diff --git a/content/show/image/index-en-US.md b/content/show/image/index-en-US.md index 25339611a9..3db4f06935 100644 --- a/content/show/image/index-en-US.md +++ b/content/show/image/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 66 +order: 68 category: Show title: Image icon: doc-image diff --git a/content/show/image/index.md b/content/show/image/index.md index c294032956..5a3a6759d9 100644 --- a/content/show/image/index.md +++ b/content/show/image/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 66 +order: 68 category: 展示类 title: Image 图片 icon: doc-image diff --git a/content/show/list/index-en-US.md b/content/show/list/index-en-US.md index eaade98c69..09c9a85107 100644 --- a/content/show/list/index-en-US.md +++ b/content/show/list/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 67 +order: 69 category: Show title: List subTitle: List diff --git a/content/show/list/index.md b/content/show/list/index.md index 8bb1ba3a56..cce80aee1b 100644 --- a/content/show/list/index.md +++ b/content/show/list/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 67 +order: 69 category: 展示类 title: List 列表 icon: doc-list diff --git a/content/show/modal/index-en-US.md b/content/show/modal/index-en-US.md index 3917fe70f4..1044de8409 100644 --- a/content/show/modal/index-en-US.md +++ b/content/show/modal/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 68 +order: 70 category: Show title: Modal subTitle: Modal diff --git a/content/show/modal/index.md b/content/show/modal/index.md index f8ab824168..abea17cdab 100644 --- a/content/show/modal/index.md +++ b/content/show/modal/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 68 +order: 70 category: 展示类 title: Modal 模态对话框 icon: doc-modal diff --git a/content/show/overflowlist/index-en-US.md b/content/show/overflowlist/index-en-US.md index f3d71dfb94..c9d8634adf 100644 --- a/content/show/overflowlist/index-en-US.md +++ b/content/show/overflowlist/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 69 +order: 71 category: Show title: OverflowList subTitle: OverflowList diff --git a/content/show/overflowlist/index.md b/content/show/overflowlist/index.md index 773b4421ab..56dd30e585 100644 --- a/content/show/overflowlist/index.md +++ b/content/show/overflowlist/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 69 +order: 71 category: 展示类 title: OverflowList 折叠列表 icon: doc-overflowList diff --git a/content/show/popover/index-en-US.md b/content/show/popover/index-en-US.md index 7f19156a6a..03da78c3d9 100644 --- a/content/show/popover/index-en-US.md +++ b/content/show/popover/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 70 +order: 72 category: Show title: Popover subTitle: Popover diff --git a/content/show/popover/index.md b/content/show/popover/index.md index b2e640a7b5..7cc3de7273 100644 --- a/content/show/popover/index.md +++ b/content/show/popover/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 70 +order: 72 category: 展示类 title: Popover 气泡卡片 icon: doc-popover diff --git a/content/show/scrolllist/index-en-US.md b/content/show/scrolllist/index-en-US.md index 897e533fa1..41ea1c751f 100644 --- a/content/show/scrolllist/index-en-US.md +++ b/content/show/scrolllist/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 71 +order: 73 category: Show title: ScrollList subTitle: ScrollList diff --git a/content/show/scrolllist/index.md b/content/show/scrolllist/index.md index 9a43aa134a..a37becd949 100644 --- a/content/show/scrolllist/index.md +++ b/content/show/scrolllist/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 71 +order: 73 category: 展示类 title: ScrollList 滚动列表 icon: doc-scrolllist diff --git a/content/show/sidesheet/index-en-US.md b/content/show/sidesheet/index-en-US.md index 60c5d5cbca..dae578d7c8 100644 --- a/content/show/sidesheet/index-en-US.md +++ b/content/show/sidesheet/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 72 +order: 74 category: Show title: SideSheet subTitle: SideSheet diff --git a/content/show/sidesheet/index.md b/content/show/sidesheet/index.md index 9c962a9878..4cbab1aeaf 100644 --- a/content/show/sidesheet/index.md +++ b/content/show/sidesheet/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 72 +order: 74 category: 展示类 title: SideSheet 滑动侧边栏 icon: doc-sidesheet diff --git a/content/show/table/index-en-US.md b/content/show/table/index-en-US.md index 1363dd1838..8270c9de0a 100644 --- a/content/show/table/index-en-US.md +++ b/content/show/table/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 73 +order: 75 category: Show title: Table subTitle: Table @@ -5429,6 +5429,7 @@ import { Table } from '@douyinfe/semi-ui'; | sortOrder | The controlled property of the sorting, the sorting of this control column can be set to 'ascend'\|'descended '\|false | boolean | false | | sorter | Sorting function, local sorting uses a function (refer to the compareFunction of Array.sort), requiring a server-side sorting can be set to true. **An independent dataIndex must be set for the sort column, and an independent key must be set for each data item in the dataSource** | boolean\|(r1: RecordType, r2: RecordType, sortOrder: 'ascend' \| 'descend') => number | true | | sortIcon |Customize the sort icon. The returned node controls the entire sort button, including ascending and descending buttons. Need to control highlighting behavior based on sortOrder | (props: { sortOrder }) => ReactNode | | **2.50.0** | +| shouldCellUpdate | Self control whether cell should be updated | (props: TableCellProps, prevProps: TableCellProps) => boolean | | **2.71.0** | | title | Column header displays text. When a function is passed in, title will use the return value of the function; when other types are passed in, they will be aggregated with sorter and filter. It needs to be used with useFullRender to obtain parameters such as filter in the function type | string \| ReactNode\|({ filter: ReactNode, sorter: ReactNode, selection: ReactNode }) => ReactNode. | | Function type requires **0.34.0** | | useFullRender | Whether to completely customize the rendering, see [Full Custom Rendering](#Fully-custom-rendering) for usage details, enabling this feature will cause a certain performance loss | boolean | false | **0.34.0** | | width | Column width | string \| number | | @@ -5459,6 +5460,7 @@ type Filter = { | getCheckboxProps | Default property configuration for the selection box | (record: RecordType) => object | | | | hidden | Hide selection column or not | boolean | false | **0.34.0** | | selectedRowKeys | Specifies the key array of the selected item, which needs to work with onChange | string [] | | | +| shouldCellUpdate | Self control whether cell should be updated | (props: TableCellProps, prevProps: TableCellProps) => boolean | | **2.71.0** | | renderCell | Custom rendering checkbox | ({ selected: boolean, record: RecordType, originNode: JSX.Element, inHeader: boolean, disabled: boolean, indeterminate: boolean, index?: number, selectRow?: (selected: boolean, e: Event) => void, selectAll?: (selected: boolean, e: Event) => void }) => ReactNode | | **2.52.0** | | width | Custom list selection box width | string | number | | | onChange | A callback in the event of a change in the selected item. The first parameter will save the row keys selected last time, even if you do paging control or update the dataSource [FAQ](#faq) | (selectedRowKeys: number[]\|string[], selectedRows: RecordType[]) => void | | | diff --git a/content/show/table/index.md b/content/show/table/index.md index ee66bf4608..fcdf31b0f3 100644 --- a/content/show/table/index.md +++ b/content/show/table/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 73 +order: 75 category: 展示类 title: Table 表格 icon: doc-table @@ -5557,6 +5557,7 @@ import { Table } from '@douyinfe/semi-ui'; | sortOrder | 排序的受控属性,外界可用此控制列的排序,可设置为 'ascend'\|'descend'\|false | boolean\| string | false | | sorter | 排序函数,本地排序使用一个函数(参考 Array.sort 的 compareFunction),需要服务端排序可设为 true。**必须给排序列设置一个独立的 dataIndex,必须为 dataSource 里面的每条数据项设置独立的 key** | boolean\|(r1: RecordType, r2: RecordType, sortOrder: 'ascend' \| 'descend') => number | true | | sortIcon | 自定义 sort 图标,返回的节点控制了整个排序按钮,包含升序和降序。需根据 sortOrder 控制高亮行为 | (props: { sortOrder }) => ReactNode | | **2.50.0** | +| shouldCellUpdate | 自定义控制单元格是否渲染。默认 cell 会深对比 props 和 nextProps 是否变化,来决定是否渲染单元格。如果你的 props 中的 record 比较复杂,建议使用 `shouldCellUpdate` 接管单元格的渲染。 | (props: TableCellProps, prevProps: TableCellProps) => boolean | | **2.71.0** | | title | 列头显示文字。传入 function 时,title 将使用函数的返回值;传入其他类型,将会和 sorter、filter 进行聚合。需要搭配 useFullRender 获取函数类型中的 filter 等参数 | ReactNode\|({ filter: ReactNode, sorter: ReactNode, selection: ReactNode }) => ReactNode | | Function 类型需要**0.34.0** | | useFullRender | 是否完全自定义渲染,用法详见[完全自定义渲染](#完全自定义渲染), 开启此功能会造成一定的性能损耗 | boolean | false | **0.34.0** | | width | 列宽度 | string \| number | | @@ -5581,19 +5582,20 @@ type Filter = { ## rowSelection -| 属性 | 说明 | 类型 | 默认值 | 版本 | -|------------------|------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|--------|------------| -| className | 所处列样式名 | string | | | -| disabled | 表头的 `Checkbox` 是否禁用 | boolean | false | **0.32.0** | -| fixed | 把选择框列固定在左边 | boolean | false | | -| getCheckboxProps | 选择框的默认属性配置 | (record: RecordType) => object | | | -| hidden | 是否隐藏选择列 | boolean | false | **0.34.0** | -| renderCell | 自定义渲染勾选框 | ({ selected: boolean, record: RecordType, originNode: JSX.Element, inHeader: boolean, disabled: boolean, indeterminate: boolean, index?: number, selectRow?: (selected: boolean, e: Event) => void, selectAll?: (selected: boolean, e: Event) => void }) => ReactNode | | **2.52.0** | -| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string[] | | | -| width | 自定义列表选择框宽度 | string\|number | | | -| onChange | 选中项发生变化时的回调。第一个参数会保存上次选中的 row keys,即使你做了分页受控或更新了 dataSource [FAQ](#faq) | (selectedRowKeys: number[]\|string[], selectedRows: RecordType[]) => void | | | -| onSelect | 用户手动点击某行选择框的回调 | (record: RecordType, selected: boolean, selectedRows: RecordType[], nativeEvent: MouseEvent) => void | | | -| onSelectAll | 用户手动点击表头选择框的回调,会选中/取消选中 dataSource 里的所有可选行 | (selected: boolean, selectedRows: RecordType[], changedRows: RecordType[]) => void | | | +| 属性 | 说明 | 类型 | 默认值 | 版本 | +|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|------------| +| className | 所处列样式名 | string | | | +| disabled | 表头的 `Checkbox` 是否禁用 | boolean | false | **0.32.0** | +| fixed | 把选择框列固定在左边 | boolean | false | | +| getCheckboxProps | 选择框的默认属性配置 | (record: RecordType) => object | | | +| hidden | 是否隐藏选择列 | boolean | false | **0.34.0** | +| renderCell | 自定义渲染勾选框 | ({ selected: boolean, record: RecordType, originNode: JSX.Element, inHeader: boolean, disabled: boolean, indeterminate: boolean, index?: number, selectRow?: (selected: boolean, e: Event) => void, selectAll?: (selected: boolean, e: Event) => void }) => ReactNode | | **2.52.0** | +| selectedRowKeys | 指定选中项的 key 数组,需要和 onChange 进行配合 | string[] | | | +| shouldCellUpdate | 自定义控制单元格是否渲染。默认 cell 会深对比 props 和 nextProps 是否变化,来决定是否渲染单元格。如果你的 props 中的 record 比较复杂,建议使用 `shouldCellUpdate` 接管单元格的渲染。 | (props: TableCellProps, prevProps: TableCellProps) => boolean | | **2.71.0** | +| width | 自定义列表选择框宽度 | string\|number | | | +| onChange | 选中项发生变化时的回调。第一个参数会保存上次选中的 row keys,即使你做了分页受控或更新了 dataSource [FAQ](#faq) | (selectedRowKeys: number[]\|string[], selectedRows: RecordType[]) => void | | | +| onSelect | 用户手动点击某行选择框的回调 | (record: RecordType, selected: boolean, selectedRows: RecordType[], nativeEvent: MouseEvent) => void | | | +| onSelectAll | 用户手动点击表头选择框的回调,会选中/取消选中 dataSource 里的所有可选行 | (selected: boolean, selectedRows: RecordType[], changedRows: RecordType[]) => void | | | ## scroll diff --git a/content/show/tag/index-en-US.md b/content/show/tag/index-en-US.md index c316c1f613..8d01ed8fd2 100644 --- a/content/show/tag/index-en-US.md +++ b/content/show/tag/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 74 +order: 76 category: Show title: Tag subTitle: Tag diff --git a/content/show/tag/index.md b/content/show/tag/index.md index 477c7b0902..36f46ee9aa 100644 --- a/content/show/tag/index.md +++ b/content/show/tag/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 74 +order: 76 category: 展示类 title: Tag 标签 icon: doc-tag diff --git a/content/show/timeline/index-en-US.md b/content/show/timeline/index-en-US.md index c317c4a3cf..9cd53102d1 100644 --- a/content/show/timeline/index-en-US.md +++ b/content/show/timeline/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 75 +order: 77 category: Show title: Timeline subTitle: Timeline diff --git a/content/show/timeline/index.md b/content/show/timeline/index.md index 9ae8257a02..920ba297e2 100644 --- a/content/show/timeline/index.md +++ b/content/show/timeline/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 75 +order: 77 category: 展示类 title: Timeline 时间轴 icon: doc-timeline diff --git a/content/show/tooltip/index-en-US.md b/content/show/tooltip/index-en-US.md index 3458e252d4..8a57adb687 100644 --- a/content/show/tooltip/index-en-US.md +++ b/content/show/tooltip/index-en-US.md @@ -1,6 +1,6 @@ --- localeCode: en-US -order: 76 +order: 78 category: Show title: Tooltip subTitle: Tooltip diff --git a/content/show/tooltip/index.md b/content/show/tooltip/index.md index 8311e9f9fb..f2f7b146d9 100644 --- a/content/show/tooltip/index.md +++ b/content/show/tooltip/index.md @@ -1,6 +1,6 @@ --- localeCode: zh-CN -order: 76 +order: 78 category: 展示类 title: Tooltip 工具提示 icon: doc-tooltip diff --git a/content/start/changelog/index-en-US.md b/content/start/changelog/index-en-US.md index 7d730e1df2..1a9d95b2b3 100644 --- a/content/start/changelog/index-en-US.md +++ b/content/start/changelog/index-en-US.md @@ -15,10 +15,36 @@ Version:Major.Minor.Patch (follow the **Semver** specification) - **Patch version**: Only include bug fix, the release time is not limited --- + +#### 🎉 2.71.0 (2024-12-06) +- 【Fix】 + - For invisible Tooltips, position calculation is not performed when resizing [#2606](https://github.com/DouyinFE/semi-design/pull/2606) + #### 🎉 2.70.2 (2024-12-04) - 【Fix】 - Fixed the issue that when the Datepicker type is monthRange, the default selected year and month in the panel cannot be selected across the year +#### 🎉 2.71.0-beta.0 (2024-12-02) + +- 【New Component】 + - Add `DragMove` Component,Change the positioning by dragging. [#2595](https://github.com/DouyinFE/semi-design/pull/2595) + - Add `JsonViewer` Component,support the display and editing of JSON data at the million-line level. [#2561](https://github.com/DouyinFE/semi-design/pull/2561) +- 【Feat】 + - Table added shouldCellUpdate API, which is used to customize whether cells need to be re-rendered or not. [#2584](https://github.com/DouyinFE/semi-design/pull/2584) + - Cascader supports the checkRelation API for setting the relevance of options [#2582](https://github.com/DouyinFE/semi-design/issues/2582) + - Highlight supports using different highlight styles for different keywords [#2600](https://github.com/DouyinFE/semi-design/pull/2600) + - `@douyinfe/semi-icons-lab` add new color icons: IconChart、IconChat、IconCodeHighlight、IconLottie、IconMarkdown、IconPincode、IconVersionOne、IconWebComponents、IconJsonViewer [#2583](https://github.com/DouyinFE/semi-design/pull/2583) +- 【Chore】 + - The digital precision of the SVG path in `@douyinfe/semi-icons` has been modified, keeping two decimal places. The volume of the minimized package for all icons has been reduced from 450 kb to 278 kb [#2583](https://github.com/DouyinFE/semi-design/pull/2583) + - The digital precision of the SVG path in `@douyinfe/semi-illustrations` has been modified, keeping two decimal places. The volume of the minimized package for all icons has been reduced from 283k -> 165k [#2602](https://github.com/DouyinFE/semi-design/pull/2602) + - Fixed type error reporting for the Lottie component [#2593](https://github.com/DouyinFE/semi-design/pull/2593) +- 【Perf】 + - The logic related to Select's renderOption will be postponed until after the candidate options are displayed. Reduce unnecessary rendering. [#2598](https://github.com/DouyinFE/semi-design/issues/2598) +- 【Fix】 + - Fixed the problem of incorrect ellipsis calculation when the width of `Typography` with ellipsis in JavaScript is not set. [#2591](https://github.com/DouyinFE/semi-design/issues/2591) + - Fix the error reporting of the `table` in `MarkdownRender` when the syntax of some markdown content is incorrect, and add a fallback attempt. [#2590](https://github.com/DouyinFE/semi-design/pull/2590) + + #### 🎉 2.70.1 (2024-11-25) - 【Fix】 - Fixed the problem that the URL of the file attachment in the Chat component's dialog box was incorrect, causing the file to fail to open when clicking on the file [#2589](https://github.com/DouyinFE/semi-design/pull/2589) diff --git a/content/start/changelog/index.md b/content/start/changelog/index.md index a148e1d5dc..30ae9b2d8e 100644 --- a/content/start/changelog/index.md +++ b/content/start/changelog/index.md @@ -13,10 +13,35 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本 - 修订版本号(patch):仅会进行 bugfix,发布时间不限 - 不同版本间的详细关系,可查阅 [FAQ](/zh-CN/start/faq) + +#### 🎉 2.71.0 (2024-12-06) +- 【Fix】 + - 对于非展示状态的 Tooltip,页面尺寸变化时不做位置计算 [#2606](https://github.com/DouyinFE/semi-design/pull/2606) + #### 🎉 2.70.2 (2024-12-04) - 【Fix】 - 修复 Datepicker 类型为 monthRange 时,面板默认选中的年月无法选中跨年情况 [#2608](https://github.com/DouyinFE/semi-design/pull/2608) +#### 🎉 2.71.0-beta.0 (2024-12-02) + +- 【New Component】 + - 新增 DragMove 组件,通过拖拽改变定位 [#2595](https://github.com/DouyinFE/semi-design/pull/2595) + - 新增 JsonViewer 组件,支持百万行级 JSON 数据的展示与编辑 [#2561](https://github.com/DouyinFE/semi-design/pull/2561) +- 【Feat】 + - Table 新增 shouldCellUpdate API,用于自定义单元格的是否需重新渲染 [#2584](https://github.com/DouyinFE/semi-design/pull/2584) + - Cascader 支持 checkRelation API 用于设置选项关联性 [#2582](https://github.com/DouyinFE/semi-design/issues/2582) + - Highlight Highlight 支持针对不同关键字使用不同高亮样式 [#2600](https://github.com/DouyinFE/semi-design/pull/2600) + - `@douyinfe/semi-icons-lab` 增加新图标: IconChart、IconChat、IconCodeHighlight、IconLottie、IconMarkdown、IconPincode、IconVersionOne、IconWebComponents、IconJsonViewer [#2583](https://github.com/DouyinFE/semi-design/pull/2583) +- 【Chore】 + - 修改 `@douyinfe/semi-icons` 中 SVG Path 数字精度,保留两位小数,全量图标 min 包体积 450 kb -> 278kb [#2583](https://github.com/DouyinFE/semi-design/pull/2583) + - 修改 `@douyinfe/semi-illustrations` SVG Path 数字精度,保留两位小数,减少构建体积,全量插画 min 包体积 283k -> 165k [#2602](https://github.com/DouyinFE/semi-design/pull/2602) + - 修复 Lottie 组件类型报错问题 [#2593](https://github.com/DouyinFE/semi-design/pull/2593) +- 【Perf】 + - Select renderOption 相关的逻辑推迟在候选项展示后再执行, 减少不必要的渲染 [#2598](https://github.com/DouyinFE/semi-design/issues/2598) +- 【Fix】 + - 修复 js 省略 的Typography 未设置宽度时,省略计算错误问题 [#2591](https://github.com/DouyinFE/semi-design/issues/2591) + - 修复 MarkdownRender 的 table 在一些 markdown 内容语法不正确时候的报错, 增加兜底尝试 [#2590](https://github.com/DouyinFE/semi-design/pull/2590) + #### 🎉 2.70.1 (2024-11-25) - 【Fix】 - 修复 Chat 组件对话框中的文件 url 错误导致点击文件无法正确打开文件问题 [#2589](https://github.com/DouyinFE/semi-design/pull/2589) @@ -27,7 +52,7 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本 #### 🎉 2.70.0-beta.0 (2024-11-18) - 【Fix】 - - 当 Transfer 的左侧面板中除去被禁用项外的其他项目都被选中时,操作按钮应当显示取消全选 [#2575](https://github.com/DouyinFE/semi-design/issues/2575) [#2574](https://github.com/DouyinFE/semi-design/pull/2574) + - 当 Transfer 的左侧面板中除去被禁用项外的其他项目都被选中时,操作按钮应当显示取消全选 [#2575](https://github.com/DouyinFE/semi-design/issues/2575) - 修复计算中浮点数导致伸缩框组件尺寸的误差,浏览器拖动导致的最大最小值失效的问题,以及strictMode引起的问题 [@Nathon2Y](https://github.com/Nathon2Y) [#2551](https://github.com/DouyinFE/semi-design/pull/2551) - 修复当单选,搜索框在 trigger 时,TreeSelect 的 placeholder被遮挡问题 ,影响版本 2.61.0-2.69.0 [#2566](https://github.com/DouyinFE/semi-design/pull/2566) - 【Feat】 diff --git a/content/start/getting-started/index.md b/content/start/getting-started/index.md index 7df08a1301..6ea10a226c 100644 --- a/content/start/getting-started/index.md +++ b/content/start/getting-started/index.md @@ -7,9 +7,13 @@ icon: doc-gettingstarted order: 2 --- -## 1、安装 Semi +Semi Design 由抖音前端团队负责维护,提供 React 版本开箱即用的70+ 组件、 Figam Variant UI Kit +你可在任意 React 项目中引入使用 (新项目更推荐通过 Rsbuild、CreateReactApp、Vite 新建),当前支持搭配 React v16、v17、v18 版本使用 + +若你需要使用 prefixCls、主题、CSS Layer等编译时定制能力的场景,我们更推荐使用 Webpack 或 Rspack/Rsbuild 作为工程化构建方案 +(字节跳动用户,若使用的是公司内部相关工程化方案,配置请查阅飞书文档:Semi工程化 FAQ) -Semi 支持搭配 React v16、v17、v18 版本使用 +## 1、安装 Semi ```bash # 使用 npm @@ -25,7 +29,6 @@ pnpm add @douyinfe/semi-ui ## 2、使用组件 在 Webpack、Rspack、create-react-app 或 Vite 项目中使用时,无需进行任何编译项配置,直接使用即可。构建时所有相关资源均会按需打包 -(字节跳动用户,若使用的是公司内部相关工程化方案,配置请查阅飞书文档:Semi工程化 FAQ) ```jsx import React, { Component } from 'react'; @@ -34,8 +37,8 @@ import { Button, Toast } from '@douyinfe/semi-ui'; const SemiApp = () => { return ( - ) -} + ); +}; ``` > 推荐在项目中引入 [reset.css](https://www.npmjs.com/package/reset-css),它可以重置浏览器自带的默认样式,避免不同UA之间的样式差异。 diff --git a/cypress/e2e/cascader.spec.js b/cypress/e2e/cascader.spec.js index e3ff855b9d..d841414c21 100644 --- a/cypress/e2e/cascader.spec.js +++ b/cypress/e2e/cascader.spec.js @@ -128,5 +128,16 @@ describe('cascader', () => { cy.get('.semi-input').type('{esc}', { force: true }); cy.get('.semi-cascader-popover').should('not.exist'); }) + + it('unRelated', () => { + cy.visit('http://127.0.0.1:6006/iframe.html?id=cascader--un-related'); + cy.get('.semi-cascader-selection-tag').should('have.length', 2); + cy.get('.semi-cascader-selection-tag').eq(0).contains('亚洲'); + cy.get('.semi-cascader-selection-tag').eq(1).contains('美国'); + cy.get('.semi-cascader-selection').eq(0).trigger('click'); + cy.get('.semi-checkbox').eq(1).click(); + cy.get('.semi-cascader-selection-tag').should('have.length', 3); + cy.get('.semi-cascader-selection-tag').eq(2).contains('北美洲'); + }) }); \ No newline at end of file diff --git a/gatsby-node.js b/gatsby-node.js index cd5547de83..970c7efe7d 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -112,6 +112,7 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => 'semi-site-header': process.env.SEMI_SITE_HEADER || '@douyinfe/semi-site-header', 'semi-site-banner': process.env.SEMI_SITE_BANNER || '@douyinfe/semi-site-banner', 'univers-webview': process.env.SEMI_SITE_UNIVERS_WEBVIEW || resolve('packages/semi-ui'), + '@douyinfe/semi-json-viewer-core': resolve('packages/semi-json-viewer-core'), '@douyinfe/semi-ui': resolve('packages/semi-ui'), '@douyinfe/semi-foundation': resolve('packages/semi-foundation'), '@douyinfe/semi-icons': resolve('packages/semi-icons/src/'), @@ -155,7 +156,7 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => }, { test: /\.m?js/, - include: [/micromark-util-sanitize-uri/, /mdast-util-from-markdown/, /micromark/, /mdast-util-to-markdown/, /semi-foundation\/node_modules\/@mdx-js/], + include: [/micromark-util-sanitize-uri/, /mdast-util-from-markdown/, /micromark/, /mdast-util-to-markdown/, /semi-foundation\/node_modules\/@mdx-js/, /jsonc-parser/], use: ["esbuild-loader"] }, { @@ -184,7 +185,8 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => test: /\.mjs$/, include: /node_modules/, type: "javascript/auto" - } + }, + { test: /\.worker\.ts$/, use: ['worker-loader', 'ts-loader'] } ], }, plugins: [plugins.extractText(), plugins.define({ diff --git a/jest.config.js b/jest.config.js index b9c285bcd7..adddcfcec8 100644 --- a/jest.config.js +++ b/jest.config.js @@ -64,6 +64,7 @@ let config = { '@douyinfe/semi-foundation(.*)$': '/packages/semi-foundation/$1', '@douyinfe/semi-illustrations(.*)$': '/packages/semi-illustrations/src/$1', '@douyinfe/semi-icons(.*)$': '/packages/semi-icons/src/$1', + '@douyinfe/semi-json-viewer-core(.*)$': '/packages/semi-json-viewer-core/src/$1', // 将semi-animation相关的直接指向它的cjs版本,这样不用再走一次babel-jest的编译 '@douyinfe/semi-animation-styled(.*)$': '/packages/semi-animation-styled', '@douyinfe/semi-animation-react(.*)$': '/packages/semi-animation-react', diff --git a/lerna.json b/lerna.json index 0a010f5c91..0e0f278dfb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "useWorkspaces": true, "npmClient": "yarn", - "version": "2.70.2" + "version": "2.71.1" } diff --git a/package.json b/package.json index 8c19694aab..12b9dfce6e 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "bootstrap": "lerna bootstrap -- --legacy-peer-deps", "docsite": "npm run develop", "pre-develop": "npm run scripts:changelog && node ./scripts/designToken.js ./static/designToken.json", - "develop": "npm run pre-develop && gatsby clean && lerna run build:lib --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design && gatsby develop -H 0.0.0.0 --port=3666 --verbose", + "develop": "npm run pre-develop && gatsby clean && lerna run build:lib --scope @douyinfe/semi-json-viewer-core --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design && gatsby develop -H 0.0.0.0 --port=3666 --verbose", "scripts:changelog": "node scripts/changelog.js", "start": "npm run story", - "pre-story": "lerna exec --scope=@douyinfe/semi-ui --scope=@douyinfe/semi-foundation -- rimraf ./lib && lerna run build:lib --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design", + "pre-story": "lerna exec --scope=@douyinfe/semi-ui --scope=@douyinfe/semi-foundation -- rimraf ./lib && lerna run build:lib --scope @douyinfe/semi-json-viewer-core --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design", "story": "npm run pre-story && sb dev -c ./.storybook/js/ -p 6006", "story:ts": "npm run pre-story && sb dev -c ./.storybook/ts/ -p 6007", "story:ani": "npm run pre-story && sb dev -c ./.storybook/animation/react -p 6008", @@ -35,7 +35,7 @@ "build:css": "lerna run build:css", "build-storybook": "sb build -c ./.storybook/js/ -o ./storybook && cp -r storybook storybook-static", "build-storybook-static": "sb build -c ./.storybook/js/", - "build:gatsbydoc": "lerna run build:lib --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design && cross-env NODE_ENV=production node --max_old_space_size=16384 ./node_modules/gatsby/cli.js build --prefix-paths --verbose && rimraf build && mv public build", + "build:gatsbydoc": "lerna run build:lib --scope @douyinfe/semi-json-viewer-core --scope @douyinfe/semi-webpack-plugin --scope eslint-plugin-semi-design && cross-env NODE_ENV=production node --max_old_space_size=16384 ./node_modules/gatsby/cli.js build --prefix-paths --verbose && rimraf build && mv public build", "build:icon": "lerna run build:icon --scope='@douyinfe/semi-{icons,illustrations}'", "cypress:coverage": "npx wait-on http://127.0.0.1:6006 && ./node_modules/.bin/cypress run", "postcypress:coverage": "yarn coverage:merge", @@ -217,7 +217,8 @@ "webpack": "^5.77.0", "webpack-cli": "^5.1.4", "webpack-dev-server": "^3.11.2", - "webpackbar": "^5.0.0-3" + "webpackbar": "^5.0.0-3", + "worker-loader": "^3.0.8" }, "husky": { "hooks": { @@ -242,5 +243,6 @@ "stylelint" ] }, - "license": "MIT" + "license": "MIT", + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/packages/semi-animation-react/package.json b/packages/semi-animation-react/package.json index 8898a480b8..498370e5e2 100644 --- a/packages/semi-animation-react/package.json +++ b/packages/semi-animation-react/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation-react", - "version": "2.70.2", + "version": "2.71.1", "description": "motion library for semi-ui-react", "keywords": [ "motion", @@ -25,8 +25,8 @@ "prepublishOnly": "npm run build:lib" }, "dependencies": { - "@douyinfe/semi-animation": "2.70.2", - "@douyinfe/semi-animation-styled": "2.70.2", + "@douyinfe/semi-animation": "2.71.1", + "@douyinfe/semi-animation-styled": "2.71.1", "classnames": "^2.2.6" }, "devDependencies": { diff --git a/packages/semi-animation-styled/package.json b/packages/semi-animation-styled/package.json index ed77af3e08..e6617f2ec8 100644 --- a/packages/semi-animation-styled/package.json +++ b/packages/semi-animation-styled/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation-styled", - "version": "2.70.2", + "version": "2.71.1", "description": "semi styled animation", "keywords": [ "semi", diff --git a/packages/semi-animation/package.json b/packages/semi-animation/package.json index 6f1d7d269d..66d6aff397 100644 --- a/packages/semi-animation/package.json +++ b/packages/semi-animation/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation", - "version": "2.70.2", + "version": "2.71.1", "description": "animation base library for semi-ui", "keywords": [ "animation", diff --git a/packages/semi-eslint-plugin/package.json b/packages/semi-eslint-plugin/package.json index 4f56cd8fbb..bcede29f78 100644 --- a/packages/semi-eslint-plugin/package.json +++ b/packages/semi-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-semi-design", - "version": "2.70.2", + "version": "2.71.1", "description": "semi ui eslint plugin", "keywords": [ "semi", diff --git a/packages/semi-foundation/button/iconButton.scss b/packages/semi-foundation/button/iconButton.scss index e6750e8a34..4f17fe018f 100644 --- a/packages/semi-foundation/button/iconButton.scss +++ b/packages/semi-foundation/button/iconButton.scss @@ -35,6 +35,8 @@ $module: #{$prefix}-button; padding-right: $spacing-button_iconOnly_default-paddingRight; padding-top: $spacing-button_iconOnly_default-paddingTop; padding-bottom: $spacing-button_iconOnly_default-paddingRight; + height: $height-button_iconOnly_default; + width: $width-button_iconOnly_default; justify-content: center; align-items: center; @@ -45,6 +47,8 @@ $module: #{$prefix}-button; padding-right: $spacing-button_iconOnly_small-paddingRight; padding-top: $spacing-button_iconOnly_small-paddingTop; padding-bottom: $spacing-button_iconOnly_small-paddingBottom; + height: $height-button_iconOnly_small; + width: $width-button_iconOnly_small; } &-large { @@ -52,6 +56,8 @@ $module: #{$prefix}-button; padding-right: $spacing-button_iconOnly_large-paddingRight; padding-top: $spacing-button_iconOnly_large-paddingTop; padding-bottom: $spacing-button_iconOnly_large-paddingBottom; + height: $height-button_iconOnly_large; + width: $width-button_iconOnly_large; } } } diff --git a/packages/semi-foundation/button/variables.scss b/packages/semi-foundation/button/variables.scss index a16ea06729..00067e38dd 100644 --- a/packages/semi-foundation/button/variables.scss +++ b/packages/semi-foundation/button/variables.scss @@ -154,6 +154,12 @@ $spacing-button_iconOnly_small-paddingLeft: $spacing-extra-tight; // 图标按 $spacing-button_iconOnly_small-paddingRight: $spacing-extra-tight; // 图标按钮右侧内边距 - 小尺寸 $spacing-button_iconOnly_small-paddingTop: $spacing-extra-tight; // 图标按钮顶部内边距 - 小尺寸 $spacing-button_iconOnly_small-paddingBottom: $spacing-extra-tight; // 图标按钮底部内边距 - 小尺寸 +$height-button_iconOnly_small: $height-control-small; // 图标按钮 height - 小尺寸 +$width-button_iconOnly_small: $height-control-small; // 图标按钮 width - 小尺寸 +$height-button_iconOnly_default:$height-control-default; // 图标按钮 height - 默认 +$width-button_iconOnly_default: $height-control-default; // 图标按钮 width - 默认 +$height-button_iconOnly_large: $height-control-large; // 图标按钮 height - 大尺寸 +$width-button_iconOnly_large: $height-control-large; // 图标按钮 width - 大尺寸 // margin $spacing-button_iconOnly_content-marginLeft: $spacing-tight; // 按钮左侧图标距离文字间距 diff --git a/packages/semi-foundation/cascader/constants.ts b/packages/semi-foundation/cascader/constants.ts index d070fc5bf8..54033bdaf5 100644 --- a/packages/semi-foundation/cascader/constants.ts +++ b/packages/semi-foundation/cascader/constants.ts @@ -18,6 +18,8 @@ const strings = { NONE_MERGE_TYPE: 'none', SEARCH_POSITION_TRIGGER: 'trigger', SEARCH_POSITION_CUSTOM: 'custom', + RELATED: 'related', + UN_RELATED: 'unRelated' } as const; const numbers = {}; diff --git a/packages/semi-foundation/cascader/foundation.ts b/packages/semi-foundation/cascader/foundation.ts index 13b6bc6669..0eecaf9dec 100644 --- a/packages/semi-foundation/cascader/foundation.ts +++ b/packages/semi-foundation/cascader/foundation.ts @@ -168,6 +168,7 @@ export interface BasicCascaderProps { enableLeafClick?: boolean; preventScroll?: boolean; virtualizeInSearch?: Virtualize; + checkRelation?: string; onClear?: () => void; triggerRender?: (props: BasicTriggerRenderProps) => any; onListScroll?: (e: any, panel: BasicScrollPanelProps) => void; @@ -591,7 +592,7 @@ export default class CascaderFoundation extends BaseFoundation{ + updateSearching = (isSearching: boolean) => { this._adapter.updateStates({ isSearching: false }); } @@ -772,6 +773,16 @@ export default class CascaderFoundation extends BaseFoundation = new Set(checkedKeys); + let targetStatus: boolean; + const prevCheckedStatus = checkedKeys.has(key); + if (prevCheckedStatus) { + newCheckedKeys.delete(key); + targetStatus = false; + } else { + // 查看是否超出 max + if (isNumber(max)) { + if (checkedKeys.size >= max) { + const checkedEntities: BasicEntity[] = []; + checkedKeys.forEach(itemKey => { + checkedEntities.push(keyEntities[itemKey]); + }); + this._adapter.notifyOnExceed(checkedEntities); + return; + } + } + newCheckedKeys.add(key); + targetStatus = true; + } + if (!this._isControlledComponent()) { + this._adapter.updateStates({ + checkedKeys: newCheckedKeys, + }); + } + + this._notifyChange(newCheckedKeys); + + if (targetStatus) { + this._notifySelect(newCheckedKeys); + } } calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean) { diff --git a/packages/semi-foundation/dragMove/foundation.ts b/packages/semi-foundation/dragMove/foundation.ts new file mode 100644 index 0000000000..d3cfe4dbc9 --- /dev/null +++ b/packages/semi-foundation/dragMove/foundation.ts @@ -0,0 +1,194 @@ +import BaseFoundation, { DefaultAdapter } from '../base/foundation'; + +export function clampValueInRange(value: number, min: number, max: number) { + return Math.min(Math.max(value, min), max); +} + +export interface DragMoveAdapter

, S = Record> extends DefaultAdapter { + getDragElement: () => HTMLElement; + getConstrainer: () => HTMLElement | null; + getHandler: () => HTMLElement; + notifyMouseDown?: (e: MouseEvent) => void; + notifyMouseMove?: (e: MouseEvent) => void; + notifyMouseUp?: (e: MouseEvent) => void; + notifyTouchStart?: (e: TouchEvent) => void; + notifyTouchMove?: (e: TouchEvent) => void; + notifyTouchEnd?: (e: TouchEvent) => void; + notifyTouchCancel?: (e: TouchEvent) => void +} + +export default class DragMoveFoundation

, S = Record> extends BaseFoundation, P, S> { + element: HTMLElement; + xMax: number; + xMin: number; + yMax: number; + yMin: number; + startOffsetX: number; + startOffsetY: number; + + get constrainer() { + return this._adapter.getConstrainer(); + } + + get handler() { + return this._adapter.getHandler(); + } + + constructor(adapter: DragMoveAdapter) { + super({ ...adapter }); + } + + init() { + const element = this._adapter.getDragElement(); + if (!element) { + throw new Error('drag element must be a valid element'); + } + this.element = element; + this.element.style.position = 'absolute'; + this.handler.style.cursor = 'move'; + } + + destroy() { + this._unRegisterEvent(); + } + + _registerDocMouseEvent = () => { + document.addEventListener('mousemove', this._onMouseMove); + document.addEventListener('mouseup', this._onMouseUp); + } + + _unRegisterDocMouseEvent = () => { + document.removeEventListener('mousemove', this._onMouseMove); + document.removeEventListener('mouseup', this._onMouseUp); + } + + _registerDocTouchEvent = () => { + document.addEventListener('touchend', this._onTouchEnd); + document.addEventListener('touchmove', this._onTouchMove); + document.addEventListener('touchcancel', this._onTouchCancel); + } + + _unRegisterDocTouchEvent = () => { + document.removeEventListener('touchend', this._onTouchEnd); + document.removeEventListener('touchmove', this._onTouchMove); + document.removeEventListener('touchcancel', this._onTouchCancel); + } + + _unRegisterEvent() { + this._unRegisterDocMouseEvent(); + + this._unRegisterDocTouchEvent(); + } + + _calcMoveRange() { + // Calculate the range within which an element can move + if (this.constrainer) { + let node = this.element.offsetParent as HTMLElement; + let startX = 0; + let startY = 0; + while (node !== this.constrainer && node !== null) { + startX -= node.offsetLeft; + startY -= node.offsetTop; + node = node.offsetParent as any; + } + this.xMin = startX; + this.xMax = startX + this.constrainer.offsetWidth - this.element.offsetWidth; + this.yMin = startY; + this.yMax = startY + this.constrainer.offsetHeight - this.element.offsetHeight; + } + } + + _allowMove(e: MouseEvent | TouchEvent) { + const { allowMove, allowInputDrag } = this.getProps(); + // When the clicked object is an input or textarea, clicking should be allowed but dragging should not be allowed. + if (!allowInputDrag) { + let target = (e.target as HTMLElement).tagName.toLowerCase(); + if (target === 'input' || target === 'textarea') { + return; + } + } + if (allowMove) { + return allowMove(e, this.element); + } + return true; + } + + _calcOffset = (e: Touch | MouseEvent) => { + this.startOffsetX = e.clientX - this.element.offsetLeft; + this.startOffsetY = e.clientY - this.element.offsetTop; + } + + _preventDefault = (e: MouseEvent | TouchEvent) => { + // prevent default behavior, avoid other element(like img, text) be selected + e.preventDefault(); + } + + onMouseDown = (e: MouseEvent) => { + this._calcMoveRange(); + this._adapter.notifyMouseDown(e); + if (!this._allowMove(e)) { + return; + } + this._registerDocMouseEvent(); + // store origin offset + this._calcOffset(e); + this._preventDefault(e); + } + + onTouchStart = (e: TouchEvent) => { + this._calcMoveRange(); + this._adapter.notifyTouchStart(e); + if (!this._allowMove(e)) { + return; + } + this._registerDocTouchEvent(); + const touch = e.targetTouches[0]; + this._calcOffset(touch); + this._preventDefault(e); + } + + _changePos = (e: Touch | MouseEvent) => { + const { customMove } = this.getProps(); + let newLeft = e.clientX - this.startOffsetX; + let newTop = e.clientY - this.startOffsetY; + if (this.constrainer) { + newLeft = clampValueInRange(newLeft, this.xMin, this.xMax); + newTop = clampValueInRange(newTop, this.yMin, this.yMax); + } + + requestAnimationFrame(() => { + if (customMove) { + customMove(this.element, newTop, newLeft); + return; + } + this.element.style.top = newTop + 'px'; + this.element.style.left = newLeft + 'px'; + }); + } + + _onMouseMove = (e: MouseEvent) => { + this._adapter.notifyMouseMove(e); + this._changePos(e); + } + + _onTouchMove = (e: TouchEvent) => { + this._adapter.notifyTouchMove(e); + const touch = e.targetTouches[0]; + this._changePos(touch); + } + + _onMouseUp = (e: MouseEvent) => { + this._adapter.notifyMouseUp(e); + this._unRegisterDocMouseEvent(); + } + + _onTouchEnd = (e: TouchEvent) => { + this._adapter.notifyTouchEnd(e); + this._unRegisterDocTouchEvent(); + } + + _onTouchCancel = (e: TouchEvent) => { + this._adapter.notifyTouchCancel(e); + this._unRegisterDocTouchEvent(); + } +} diff --git a/packages/semi-foundation/highlight/foundation.ts b/packages/semi-foundation/highlight/foundation.ts new file mode 100644 index 0000000000..a88681d53c --- /dev/null +++ b/packages/semi-foundation/highlight/foundation.ts @@ -0,0 +1,211 @@ +// Modified version based on 'highlight-words-core' +import { isString } from 'lodash'; +import BaseFoundation, { DefaultAdapter } from '../base/foundation'; + +interface HighlightAdapter extends Partial {} + +interface ChunkQuery { + autoEscape?: boolean; + caseSensitive?: boolean; + searchWords: SearchWords; + sourceString: string +} +export interface Chunk { + start: number; + end: number; + highlight: boolean; + className: string; + style: Record +} + +export interface ComplexSearchWord { + text: string; + className?: string; + style?: Record +} + +export type SearchWord = string | ComplexSearchWord | undefined; +export type SearchWords = SearchWord[]; + +const escapeRegExpFn = (string: string) => string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); + +export default class HighlightFoundation extends BaseFoundation { + + constructor(adapter?: HighlightAdapter) { + super({ + ...adapter, + }); + } + + /** + * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. + * + findAll ['z'], 'aaazaaazaaa' + result #=> [ + { start: 0, end: 3, highlight: false } + { start: 3, end: 4, highlight: true } + { start: 4, end: 7, highlight: false } + { start: 7, end: 8, highlight: true } + { start: 8, end: 11, highlight: false } + ] + + findAll ['do', 'dollar'], 'aaa do dollar aaa' + #=> chunks: [ + { start: 4, end: 6 }, + { start: 7, end: 9 }, + { start: 7, end: 13 }, + ] + #=> chunksToHight: [ + { start: 4, end: 6 }, + { start: 7, end: 13 }, + ] + #=> result: [ + { start: 0, end: 4, highlight: false }, + { start: 4, end: 6, highlight: true }, + { start: 6, end: 7, highlight: false }, + { start: 7, end: 13, highlight: true }, + { start: 13, end: 17, highlight: false }, + ] + + * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) + */ + findAll = ({ + autoEscape = true, + caseSensitive = false, + searchWords, + sourceString + }: ChunkQuery) => { + if (isString(searchWords)) { + searchWords = [searchWords]; + } + + const chunks = this.findChunks({ + autoEscape, + caseSensitive, + searchWords, + sourceString + }); + const chunksToHighlight = this.combineChunks({ chunks }); + const result = this.fillInChunks({ + chunksToHighlight, + totalLength: sourceString ? sourceString.length : 0 + }); + return result; + }; + + /** + * Examine text for any matches. + * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). + * @return { start:number, end:number }[] + */ + findChunks = ({ + autoEscape, + caseSensitive, + searchWords, + sourceString + }: ChunkQuery): Chunk[] => ( + searchWords + .map(searchWord => typeof searchWord === 'string' ? { text: searchWord } : searchWord) + .filter(searchWord => searchWord.text) // Remove empty words + .reduce((chunks, searchWord) => { + let searchText = searchWord.text; + if (autoEscape) { + searchText = escapeRegExpFn(searchText); + } + const regex = new RegExp(searchText, caseSensitive ? 'g' : 'gi'); + + let match; + while ((match = regex.exec(sourceString))) { + const start = match.index; + const end = regex.lastIndex; + if (end > start) { + chunks.push({ + highlight: true, + start, + end, + className: searchWord.className, + style: searchWord.style + }); + } + if (match.index === regex.lastIndex) { + regex.lastIndex++; + } + } + return chunks; + }, []) + ); + + /** + * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. + * @return {start:number, end:number}[] + */ + combineChunks = ({ chunks }: { chunks: Chunk[] }): Chunk[] => { + return chunks + .sort((first, second) => first.start - second.start) + .reduce((processedChunks, nextChunk) => { + // First chunk just goes straight in the array... + if (processedChunks.length === 0) { + return [nextChunk]; + } else { + // ... subsequent chunks get checked to see if they overlap... + const prevChunk = processedChunks.pop(); + if (nextChunk.start <= prevChunk.end) { + // It may be the case that prevChunk completely surrounds nextChunk, so take the + // largest of the end indeces. + const endIndex = Math.max(prevChunk.end, nextChunk.end); + processedChunks.push({ + highlight: true, + start: prevChunk.start, + end: endIndex, + className: prevChunk.className || nextChunk.className, + style: { ...prevChunk.style, ...nextChunk.style } + }); + } else { + processedChunks.push(prevChunk, nextChunk); + } + return processedChunks; + } + }, []); + }; + + /** + * Given a set of chunks to highlight, create an additional set of chunks + * to represent the bits of text between the highlighted text. + * @param chunksToHighlight {start:number, end:number}[] + * @param totalLength number + * @return {start:number, end:number, highlight:boolean}[] + */ + fillInChunks = ({ chunksToHighlight, totalLength }: { chunksToHighlight: Chunk[]; totalLength: number }): Chunk[] => { + const allChunks: Chunk[] = []; + const append = (start: number, end: number, highlight: boolean, className?: string, style?: Record) => { + if (end - start > 0) { + allChunks.push({ + start, + end, + highlight, + className, + style + }); + } + }; + + if (chunksToHighlight.length === 0) { + append(0, totalLength, false); + } else { + let lastIndex = 0; + chunksToHighlight.forEach(chunk => { + append(lastIndex, chunk.start, false); + append(chunk.start, chunk.end, true, chunk.className, chunk.style); + lastIndex = chunk.end; + }); + append(lastIndex, totalLength, false); + } + return allChunks; + }; + +} + + + + + diff --git a/packages/semi-foundation/image/image.scss b/packages/semi-foundation/image/image.scss index b0bd418625..0100648d6e 100644 --- a/packages/semi-foundation/image/image.scss +++ b/packages/semi-foundation/image/image.scss @@ -204,6 +204,12 @@ $module: #{$prefix}-image; // transition: transform $transition_duration-image_preview_image_img $transition_delay-image_preview_image_img; z-index: 0; user-select: none; + /** + * In tailwind, the max-width of img/video is set to 100%, + * which will affect the amplification effect of the picture. + * So we need to set max-width to none. + */ + max-width: none; } &-spin { diff --git a/packages/semi-foundation/jsonViewer/constants.ts b/packages/semi-foundation/jsonViewer/constants.ts new file mode 100644 index 0000000000..4642544722 --- /dev/null +++ b/packages/semi-foundation/jsonViewer/constants.ts @@ -0,0 +1,7 @@ +import { BASE_CLASS_PREFIX } from "../base/constants"; + +const cssClasses = { + PREFIX: `${BASE_CLASS_PREFIX}-json-viewer`, +} as const; + +export { cssClasses }; diff --git a/packages/semi-foundation/jsonViewer/foundation.ts b/packages/semi-foundation/jsonViewer/foundation.ts new file mode 100644 index 0000000000..0fad861339 --- /dev/null +++ b/packages/semi-foundation/jsonViewer/foundation.ts @@ -0,0 +1,72 @@ + +import { JsonViewer, JsonViewerOptions } from '@douyinfe/semi-json-viewer-core'; +import BaseFoundation, { DefaultAdapter, noopFunction } from '../base/foundation'; + +export type { JsonViewerOptions }; +export interface JsonViewerAdapter

, S = Record> extends DefaultAdapter { + getEditorRef: () => HTMLElement; + getSearchRef: () => HTMLInputElement; + notifyChange: (value: string) => void; + notifyHover: (value: string, el: HTMLElement) => HTMLElement | undefined; + setSearchOptions: (key: string) => void; + showSearchBar: () => void +} + +class JsonViewerFoundation extends BaseFoundation { + constructor(adapter: JsonViewerAdapter) { + super({ ...JsonViewerFoundation, ...adapter }); + } + + jsonViewer: JsonViewer | null = null; + + init() { + const props = this.getProps(); + const editorRef = this._adapter.getEditorRef(); + this.jsonViewer = new JsonViewer(editorRef, props.value, props.options); + this.jsonViewer.layout(); + this.jsonViewer.emitter.on('contentChanged', (e) => { + this._adapter.notifyChange(this.jsonViewer?.getModel().getValue()); + if (this.getState('showSearchBar')) { + this.search(this._adapter.getSearchRef().value); + } + }); + this.jsonViewer.emitter.on('hoverNode', (e) => { + const el = this._adapter.notifyHover(e.value, e.target); + if (el) { + this.jsonViewer.emitter.emit('renderHoverNode', { el }); + } + }); + } + + search(searchText: string) { + const state = this.getState('searchOptions'); + const { caseSensitive, wholeWord, regex } = state; + this.jsonViewer?.getSearchWidget().search(searchText, caseSensitive, wholeWord, regex); + } + + prevSearch() { + this.jsonViewer?.getSearchWidget().navigateResults(-1); + } + + nextSearch() { + this.jsonViewer?.getSearchWidget().navigateResults(1); + } + + replace(replaceText: string) { + this.jsonViewer?.getSearchWidget().replace(replaceText); + } + + replaceAll(replaceText: string) { + this.jsonViewer?.getSearchWidget().replaceAll(replaceText); + } + + setSearchOptions(key: string) { + this._adapter.setSearchOptions(key); + } + + showSearchBar() { + this._adapter.showSearchBar(); + } +} + +export default JsonViewerFoundation; \ No newline at end of file diff --git a/packages/semi-foundation/jsonViewer/jsonViewer.scss b/packages/semi-foundation/jsonViewer/jsonViewer.scss new file mode 100644 index 0000000000..0ec7c1bf5a --- /dev/null +++ b/packages/semi-foundation/jsonViewer/jsonViewer.scss @@ -0,0 +1,200 @@ +@import './variables.scss'; + +$module: #{$prefix}-json-viewer; + +.#{$module} { + &-background { + background-color: $color-json-viewer-background; + } + + &-string-key { + color: $color-json-viewer-key; + } + + &-string-value { + color: $color-json-viewer-value; + } + + &-keyword { + color: $color-json-viewer-keyword; + } + + &-number { + color: $color-json-viewer-number; + } + + &-delimiter-comma { + color: $color-json-viewer-delimiter-comma; + } + + &-delimiter-bracket-0 { + color: rgba(var(--semi-blue-7), 1); + } + &-delimiter-bracket-1 { + color: rgba(var(--semi-green-7), 1); + } + &-delimiter-bracket-2 { + color: rgba(var(--semi-orange-7), 1); + } + &-delimiter-array-0 { + color: rgba(var(--semi-blue-7), 1); + } + &-delimiter-array-1 { + color: rgba(var(--semi-green-7), 1); + } + &-delimiter-array-2 { + color: rgba(var(--semi-orange-7), 1); + } + + &-search-result { + background-color: $color-json-viewer-search-result-background; + } + + &-current-search-result { + background-color: $color-json-viewer-current-search-result-background !important; + } + + &-folding-icon { + opacity: 0.7; + transition: opacity 0.8s; + color: $color-json-viewer-folding-icon; + } + + &-view-line { + font-family: Menlo, Firecode, Monaco, 'Courier New', monospace; + font-weight: normal; + font-size: 12px; + font-feature-settings: 'liga' 0, 'calt' 0; + font-variation-settings: normal; + letter-spacing: 0px; + color: #237893; + word-wrap: break-word; + white-space: pre-wrap; + } + + &-line-number { + font-family: Menlo, Firecode, Monaco, 'Courier New', monospace; + font-weight: normal; + font-size: 12px; + font-feature-settings: 'liga' 0, 'calt' 0; + font-variation-settings: normal; + letter-spacing: 0px; + color: $color-json-viewer-line-number; + text-align: center; + width: 50px; + } + + &-content-container { + scrollbar-width: none; /* 隐藏滚动条(Firefox) */ + -ms-overflow-style: none; /* 隐藏滚动条(IE 和 Edge) */ + } + + &-content-container::-webkit-scrollbar { + display: none; /* 隐藏滚动条(Webkit 浏览器) */ + } + + &-search-bar-container { + width: 458px; + box-sizing: border-box; + border: 1px solid var(--semi-color-border); + border-radius: var(--semi-border-radius-small); + display: flex; + flex-direction: column; + padding: 8px; + gap: 8px; + background-color: var(--semi-color-bg-0); + } + + &-search-bar { + display: flex; + align-items: flex-start; + gap: 8px; + &-input { + width: 200px; + flex-shrink: 0; + } + .#{$prefix}-button-group { + flex-wrap: nowrap; + } + // next icon btn + .#{$prefix}-button:nth-of-type(1) { + width: 40px; + } + // prev icon btn + .#{$prefix}-button:nth-of-type(2) { + width: 40px; + } + } + + &-replace-bar { + display: flex; + align-items: flex-start; + gap: 8px; + &-input { + width: 261px; + } + // replace btn + .#{$prefix}-button:nth-of-type(1) { + width: 52px; + } + // all replace btn + .#{$prefix}-button:nth-of-type(2) { + width: 80px; + } + } + + &-search-options { + display: flex; + align-items: center; + justify-content: center; + list-style: none; + padding-inline-start: 0; + margin-block-start: 0; + margin-block-end: 0; + gap: 8px; + } + + &-search-options-item { + min-width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + border-radius: var(--semi-border-radius-small); + color: var(--semi-color-text-2); + } + + &-search-options-item:hover { + background-color: var(--semi-color-default); + } + + &-search-options-item-active { + color: var(--semi-color-primary); + background-color: var(--semi-color-primary-light-default); + } + + &-complete-suggestions-container { + border-radius: var(--semi-border-radius-medium); + background-color: var(--semi-color-bg-3); + box-shadow: var(--semi-shadow-elevated); + z-index: 1000; + min-width: 200px; + max-width: 400px; + list-style: none; + padding: 4px 0; + } + + &-complete-container { + position: absolute; + z-index: 1000; + } + + &-complete-suggestions-item { + padding: 8px 16px; + color: var(--semi-color-text-0); + cursor: pointer; + } + + +} diff --git a/packages/semi-foundation/jsonViewer/script/build.js b/packages/semi-foundation/jsonViewer/script/build.js new file mode 100644 index 0000000000..15d505bca6 --- /dev/null +++ b/packages/semi-foundation/jsonViewer/script/build.js @@ -0,0 +1,51 @@ +const esbuild = require('esbuild'); +const path = require('path'); +const fs = require('fs'); + + + + +const compileWorker = async ()=>{ + const workerEntry = path.join(__dirname, "..", "core/src/worker/json.worker.ts"); + + const result = await esbuild.build({ + entryPoints: [workerEntry], + bundle: true, + write: false, + }); + return result.outputFiles[0].text; +}; + + +const buildMain = async ()=>{ + const mainEntry = path.join(__dirname, "..", "core/src/index.ts"); + + const result = await esbuild.build({ + entryPoints: [mainEntry], + bundle: true, + packages: 'external', + write: false, + format: 'esm' + }); + return result.outputFiles[0].text; + +}; + + + +const compile = async ()=>{ + const workerRaw = await compileWorker(); + + const mainRaw = await buildMain(); + + const finalRaw = mainRaw.replaceAll("%WORKER_RAW%", encodeURIComponent(workerRaw)); + + const saveDir = path.join(__dirname, "..", "core/lib"); + + if (!fs.existsSync(saveDir)) { + fs.mkdirSync(saveDir); + } + fs.writeFileSync(path.join(saveDir, "index.js"), finalRaw, 'utf8'); +}; + +compile(); diff --git a/packages/semi-foundation/jsonViewer/variables.scss b/packages/semi-foundation/jsonViewer/variables.scss new file mode 100644 index 0000000000..9620eef398 --- /dev/null +++ b/packages/semi-foundation/jsonViewer/variables.scss @@ -0,0 +1,15 @@ +$color-json-viewer-background: var(--semi-color-default); // JSON背景颜色 +$color-json-viewer-key: rgba(var(--semi-red-5), 1); // JSON key 颜色 +$color-json-viewer-value: rgba(var(--semi-blue-5), 1); +$color-json-viewer-number: rgba(var(--semi-green-5), 1); // JSON number 颜色 +$color-json-viewer-keyword: rgba(var(--semi-blue-5), 1); // JSON keyword 颜色 +$color-json-viewer-delimiter-comma: rgba(var(--semi-blue-6), 1); // JSON delimiter comma 颜色 + + +$color-json-viewer-search-result-background: rgba(var(--semi-green-2), 1); // JSON search result background 颜色 +$color-json-viewer-current-search-result-background: rgba(var(--semi-yellow-4), 1); // JSON current search result background 颜色 + +$color-json-viewer-folding-icon: rgba(var(--semi-blue-7), 1); // JSON folding icon 颜色 + + +$color-json-viewer-line-number: rgba(var(--semi-grey-5), 1); // JSON line number 颜色 diff --git a/packages/semi-foundation/package.json b/packages/semi-foundation/package.json index 8913a4a209..e317b640e0 100644 --- a/packages/semi-foundation/package.json +++ b/packages/semi-foundation/package.json @@ -1,13 +1,14 @@ { "name": "@douyinfe/semi-foundation", - "version": "2.70.2", + "version": "2.71.1", "description": "", "scripts": { "build:lib": "node ./scripts/compileLib.js", "prepublishOnly": "npm run build:lib" }, "dependencies": { - "@douyinfe/semi-animation": "2.70.2", + "@douyinfe/semi-animation": "2.71.1", + "@douyinfe/semi-json-viewer-core": "2.71.1", "@mdx-js/mdx": "^3.0.1", "async-validator": "^3.5.0", "classnames": "^2.2.6", @@ -37,6 +38,7 @@ "@types/prismjs": "^1.26.3", "babel-plugin-lodash": "^3.3.4", "del": "^6.0.0", + "esbuild": "0.24.0", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", "gulp-replace": "^1.1.3", diff --git a/packages/semi-foundation/resizable/foundation.ts b/packages/semi-foundation/resizable/foundation.ts index 462bcbda3f..4bfb6f4243 100644 --- a/packages/semi-foundation/resizable/foundation.ts +++ b/packages/semi-foundation/resizable/foundation.ts @@ -1,15 +1,29 @@ -export { - ResizableHandlerAdapter, +import { ResizableHandlerFoundation, ResizableFoundation, - ResizableAdapter } from './single'; -export { +import { + ResizeGroupFoundation, + ResizeItemFoundation, + ResizeHandlerFoundation +} from './group'; + +import type { ResizableHandlerAdapter, ResizableAdapter } from './single'; +import type { ResizeGroupAdapter, ResizeItemAdapter, ResizeHandlerAdapter } from './group'; + +export type { + ResizableHandlerAdapter, + ResizableAdapter, ResizeGroupAdapter, ResizeItemAdapter, ResizeHandlerAdapter, +}; + +export { + ResizableHandlerFoundation, + ResizableFoundation, ResizeGroupFoundation, ResizeItemFoundation, ResizeHandlerFoundation -} from './group'; +}; \ No newline at end of file diff --git a/packages/semi-foundation/tooltip/foundation.ts b/packages/semi-foundation/tooltip/foundation.ts index d5cb374b7c..164ed13fdf 100644 --- a/packages/semi-foundation/tooltip/foundation.ts +++ b/packages/semi-foundation/tooltip/foundation.ts @@ -191,7 +191,7 @@ export default class Tooltip

, S = Record> e } } - updateStateIfCursorOnTrigger = (trigger: HTMLElement)=>{ + updateStateIfCursorOnTrigger = (trigger: HTMLElement) => { if (trigger?.matches?.(":hover")) { const eventNames = this._adapter.getEventName(); const triggerEventSet = this.getState("triggerEventSet"); @@ -284,6 +284,10 @@ export default class Tooltip

, S = Record> e onResize = () => { // this.log('resize'); // rePosition when window resize + const visible = this.getState('visible'); + if (!visible) { + return; + } this.calcPosition(); }; diff --git a/packages/semi-foundation/tree/tree.scss b/packages/semi-foundation/tree/tree.scss index f1f8ac9fbd..ffc53fdce2 100644 --- a/packages/semi-foundation/tree/tree.scss +++ b/packages/semi-foundation/tree/tree.scss @@ -137,6 +137,8 @@ $module: #{$prefix}-tree; &-highlight { font-weight: $font-tree_option_hightlight-fontWeight; color: $color-tree_option_hightlight-text; + // set inherit to override highlight component default bgc + background-color: inherit; } &-hidden { diff --git a/packages/semi-foundation/tsconfig.json b/packages/semi-foundation/tsconfig.json index a6eed0762d..1b66204020 100644 --- a/packages/semi-foundation/tsconfig.json +++ b/packages/semi-foundation/tsconfig.json @@ -6,7 +6,7 @@ "sourceMap": true, "allowJs": true, "module": "es6", - "lib": ["es7", "dom", "es2017"], + "lib": ["esnext", "dom"], "moduleResolution": "node", "noImplicitAny": false, "forceConsistentCasingInFileNames": true, diff --git a/packages/semi-foundation/utils/getHighlight.ts b/packages/semi-foundation/utils/getHighlight.ts deleted file mode 100644 index f08d5e4bc9..0000000000 --- a/packages/semi-foundation/utils/getHighlight.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Modified version based on 'highlight-words-core' -import { isString } from 'lodash'; - -const escapeRegExpFn = (string: string) => string.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); -interface ChunkQuery { - autoEscape?: boolean; - caseSensitive?: boolean; - searchWords: string[]; - sourceString: string -} -interface Chunk { - start: number; - end: number; - highlight: boolean -} -/** - * Examine text for any matches. - * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). - * @return { start:number, end:number }[] - */ -const findChunks = ({ - autoEscape, - caseSensitive, - searchWords, - sourceString -}: ChunkQuery): Chunk[] => ( - searchWords - .filter(searchWord => searchWord) // Remove empty words - .reduce((chunks, searchWord) => { - if (autoEscape) { - searchWord = escapeRegExpFn(searchWord); - } - const regex = new RegExp(searchWord, caseSensitive ? 'g' : 'gi'); - - let match; - while ((match = regex.exec(sourceString))) { - const start = match.index; - const end = regex.lastIndex; - // We do not return zero-length matches - if (end > start) { - chunks.push({ highlight: false, start, end }); - } - // Prevent browsers like Firefox from getting stuck in an infinite loop - // See http://www.regexguru.com/2008/04/watch-out-for-zero-length-matches/ - if (match.index === regex.lastIndex) { - regex.lastIndex++; - } - } - return chunks; - }, []) -); - -/** - * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. - * @return {start:number, end:number}[] - */ -const combineChunks = ({ chunks }: { chunks: Chunk[] }) => { - chunks = chunks - .sort((first, second) => first.start - second.start) - .reduce((processedChunks, nextChunk) => { - // First chunk just goes straight in the array... - if (processedChunks.length === 0) { - return [nextChunk]; - } else { - // ... subsequent chunks get checked to see if they overlap... - const prevChunk = processedChunks.pop(); - if (nextChunk.start <= prevChunk.end) { - // It may be the case that prevChunk completely surrounds nextChunk, so take the - // largest of the end indeces. - const endIndex = Math.max(prevChunk.end, nextChunk.end); - processedChunks.push({ - highlight: false, - start: prevChunk.start, - end: endIndex - }); - } else { - processedChunks.push(prevChunk, nextChunk); - } - return processedChunks; - } - }, []); - - return chunks; -}; - - -/** - * Given a set of chunks to highlight, create an additional set of chunks - * to represent the bits of text between the highlighted text. - * @param chunksToHighlight {start:number, end:number}[] - * @param totalLength number - * @return {start:number, end:number, highlight:boolean}[] - */ -const fillInChunks = ({ chunksToHighlight, totalLength }: { chunksToHighlight: Chunk[]; totalLength: number }) => { - const allChunks: Chunk[] = []; - const append = (start: number, end: number, highlight: boolean) => { - if (end - start > 0) { - allChunks.push({ - start, - end, - highlight - }); - } - }; - - if (chunksToHighlight.length === 0) { - append(0, totalLength, false); - } else { - let lastIndex = 0; - chunksToHighlight.forEach(chunk => { - append(lastIndex, chunk.start, false); - append(chunk.start, chunk.end, true); - lastIndex = chunk.end; - }); - append(lastIndex, totalLength, false); - } - return allChunks; -}; - - -/** - * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. - * - findAll ['z'], 'aaazaaazaaa' - result #=> [ - { start: 0, end: 3, highlight: false } - { start: 3, end: 4, highlight: true } - { start: 4, end: 7, highlight: false } - { start: 7, end: 8, highlight: true } - { start: 8, end: 11, highlight: false } - ] - - findAll ['do', 'dollar'], 'aaa do dollar aaa' - #=> chunks: [ - { start: 4, end: 6 }, - { start: 7, end: 9 }, - { start: 7, end: 13 }, - ] - #=> chunksToHight: [ - { start: 4, end: 6 }, - { start: 7, end: 13 }, - ] - #=> result: [ - { start: 0, end: 4, highlight: false }, - { start: 4, end: 6, highlight: true }, - { start: 6, end: 7, highlight: false }, - { start: 7, end: 13, highlight: true }, - { start: 13, end: 17, highlight: false }, - ] - - * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) - */ - -const findAll = ({ - autoEscape = true, - caseSensitive = false, - searchWords, - sourceString -}: ChunkQuery) => { - if (isString(searchWords)) { - searchWords = [searchWords]; - } - - const chunks = findChunks({ - autoEscape, - caseSensitive, - searchWords, - sourceString - }); - const chunksToHighlight = combineChunks({ chunks }); - const result = fillInChunks({ - chunksToHighlight, - totalLength: sourceString ? sourceString.length : 0 - }); - return result; -}; - -export { findAll }; \ No newline at end of file diff --git a/packages/semi-icons-lab/README.md b/packages/semi-icons-lab/README.md index 3a5412df06..08f9c8b567 100644 --- a/packages/semi-icons-lab/README.md +++ b/packages/semi-icons-lab/README.md @@ -24,9 +24,8 @@ ReactDOM.render(, root); ``` - ## How to contribute icon to this package - Add the svg file under the path ```src/svgs/```, naming references to other files. -- Run command ```lerna run build:icon --scope @douyinfe/semi-icons```, the corresponding tsx file will be generated under the path ```src/icons```. +- Run command ```lerna run build:icon --scope @douyinfe/semi-icons-lab```, the corresponding tsx file will be generated under the path ```src/icons```. - Add the category and name of the new icon to the ```src/svgs/meta.json``` file. - Finally, run command ```yarn docsite``` and go to the icon page to confirm whether the icon is successfully added. \ No newline at end of file diff --git a/packages/semi-icons-lab/package.json b/packages/semi-icons-lab/package.json index 3c26aa0fe5..ecf1dacefe 100644 --- a/packages/semi-icons-lab/package.json +++ b/packages/semi-icons-lab/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-icons-lab", - "version": "2.70.2", + "version": "2.71.1", "description": "semi icons lab", "keywords": [ "semi", diff --git a/packages/semi-icons-lab/scripts/build-icon.js b/packages/semi-icons-lab/scripts/build-icon.js index 8bf9dad7ed..964583ca48 100644 --- a/packages/semi-icons-lab/scripts/build-icon.js +++ b/packages/semi-icons-lab/scripts/build-icon.js @@ -34,6 +34,12 @@ const svgoPlugins = [ // name: 'convertColors', // params: { currentColor: /^(?!url|none)./ }, // }, + { + name: 'convertPathData', + params: { + floatPrecision: 2 + } + }, { name: 'cleanupListOfValues', active: true, diff --git a/packages/semi-icons-lab/src/icons/IconAccessibility.tsx b/packages/semi-icons-lab/src/icons/IconAccessibility.tsx index fe20cd7973..6aaba5ffaa 100644 --- a/packages/semi-icons-lab/src/icons/IconAccessibility.tsx +++ b/packages/semi-icons-lab/src/icons/IconAccessibility.tsx @@ -16,7 +16,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconAnchor.tsx b/packages/semi-icons-lab/src/icons/IconAnchor.tsx index a20b6375d5..77c910fb95 100644 --- a/packages/semi-icons-lab/src/icons/IconAnchor.tsx +++ b/packages/semi-icons-lab/src/icons/IconAnchor.tsx @@ -13,16 +13,16 @@ function SvgComponent(props: React.SVGProps) { {...props} > - + ) { > diff --git a/packages/semi-icons-lab/src/icons/IconAvatar.tsx b/packages/semi-icons-lab/src/icons/IconAvatar.tsx index 93bb48ddda..dbafb31824 100644 --- a/packages/semi-icons-lab/src/icons/IconAvatar.tsx +++ b/packages/semi-icons-lab/src/icons/IconAvatar.tsx @@ -30,7 +30,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconBackTop.tsx b/packages/semi-icons-lab/src/icons/IconBackTop.tsx index cc932399f3..e7ccc23529 100644 --- a/packages/semi-icons-lab/src/icons/IconBackTop.tsx +++ b/packages/semi-icons-lab/src/icons/IconBackTop.tsx @@ -12,10 +12,7 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - + ); diff --git a/packages/semi-icons-lab/src/icons/IconBadge.tsx b/packages/semi-icons-lab/src/icons/IconBadge.tsx index 8a64cde645..d49afce66f 100644 --- a/packages/semi-icons-lab/src/icons/IconBadge.tsx +++ b/packages/semi-icons-lab/src/icons/IconBadge.tsx @@ -15,7 +15,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconBadgeStar.tsx b/packages/semi-icons-lab/src/icons/IconBadgeStar.tsx index 7475a33a05..f7eacaf3c3 100644 --- a/packages/semi-icons-lab/src/icons/IconBadgeStar.tsx +++ b/packages/semi-icons-lab/src/icons/IconBadgeStar.tsx @@ -12,12 +12,9 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > + - diff --git a/packages/semi-icons-lab/src/icons/IconBreadcrumb.tsx b/packages/semi-icons-lab/src/icons/IconBreadcrumb.tsx index eb6e2c47dc..cbe66700e0 100644 --- a/packages/semi-icons-lab/src/icons/IconBreadcrumb.tsx +++ b/packages/semi-icons-lab/src/icons/IconBreadcrumb.tsx @@ -12,13 +12,10 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - + + - diff --git a/packages/semi-icons-lab/src/icons/IconButton.tsx b/packages/semi-icons-lab/src/icons/IconButton.tsx index 7ea0af2774..b33faca696 100644 --- a/packages/semi-icons-lab/src/icons/IconButton.tsx +++ b/packages/semi-icons-lab/src/icons/IconButton.tsx @@ -12,13 +12,10 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - + diff --git a/packages/semi-icons-lab/src/icons/IconCalendar.tsx b/packages/semi-icons-lab/src/icons/IconCalendar.tsx index 6619a21cd1..fad38af69c 100644 --- a/packages/semi-icons-lab/src/icons/IconCalendar.tsx +++ b/packages/semi-icons-lab/src/icons/IconCalendar.tsx @@ -14,20 +14,20 @@ function SvgComponent(props: React.SVGProps) { > - + diff --git a/packages/semi-icons-lab/src/icons/IconCarousel.tsx b/packages/semi-icons-lab/src/icons/IconCarousel.tsx index 216e607b22..db472e7eb8 100644 --- a/packages/semi-icons-lab/src/icons/IconCarousel.tsx +++ b/packages/semi-icons-lab/src/icons/IconCarousel.tsx @@ -16,7 +16,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconCascader.tsx b/packages/semi-icons-lab/src/icons/IconCascader.tsx index 8ec5db07ea..c8da187e71 100644 --- a/packages/semi-icons-lab/src/icons/IconCascader.tsx +++ b/packages/semi-icons-lab/src/icons/IconCascader.tsx @@ -12,15 +12,9 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconChart.tsx b/packages/semi-icons-lab/src/icons/IconChart.tsx new file mode 100644 index 0000000000..91ce720393 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconChart.tsx @@ -0,0 +1,51 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'chart'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconChat.tsx b/packages/semi-icons-lab/src/icons/IconChat.tsx new file mode 100644 index 0000000000..639424656c --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconChat.tsx @@ -0,0 +1,30 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'chat'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconCheckbox.tsx b/packages/semi-icons-lab/src/icons/IconCheckbox.tsx index 399055e77e..538bbcc8e8 100644 --- a/packages/semi-icons-lab/src/icons/IconCheckbox.tsx +++ b/packages/semi-icons-lab/src/icons/IconCheckbox.tsx @@ -22,7 +22,7 @@ function SvgComponent(props: React.SVGProps) { fill="#4CC3FA" /> ) { + return ( + + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'code-highlight'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconCollapse.tsx b/packages/semi-icons-lab/src/icons/IconCollapse.tsx index 5c9b2d693f..34d86eb83f 100644 --- a/packages/semi-icons-lab/src/icons/IconCollapse.tsx +++ b/packages/semi-icons-lab/src/icons/IconCollapse.tsx @@ -17,13 +17,13 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconCollapsible.tsx b/packages/semi-icons-lab/src/icons/IconCollapsible.tsx index bea6c6b704..d7cf0ac2f2 100644 --- a/packages/semi-icons-lab/src/icons/IconCollapsible.tsx +++ b/packages/semi-icons-lab/src/icons/IconCollapsible.tsx @@ -12,18 +12,12 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - - - - + + + + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconColorPlatte.tsx b/packages/semi-icons-lab/src/icons/IconColorPlatte.tsx index 695dfde01e..5e9fb7cc52 100644 --- a/packages/semi-icons-lab/src/icons/IconColorPlatte.tsx +++ b/packages/semi-icons-lab/src/icons/IconColorPlatte.tsx @@ -13,7 +13,7 @@ function SvgComponent(props: React.SVGProps) { {...props} > ) { diff --git a/packages/semi-icons-lab/src/icons/IconConfig.tsx b/packages/semi-icons-lab/src/icons/IconConfig.tsx index cffe272c29..20ffa3e9b6 100644 --- a/packages/semi-icons-lab/src/icons/IconConfig.tsx +++ b/packages/semi-icons-lab/src/icons/IconConfig.tsx @@ -15,13 +15,13 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconDarkMode.tsx b/packages/semi-icons-lab/src/icons/IconDarkMode.tsx index a6f469e467..dbc08b52dd 100644 --- a/packages/semi-icons-lab/src/icons/IconDarkMode.tsx +++ b/packages/semi-icons-lab/src/icons/IconDarkMode.tsx @@ -16,7 +16,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconDatePicker.tsx b/packages/semi-icons-lab/src/icons/IconDatePicker.tsx index 90bff04143..adaf5bfe96 100644 --- a/packages/semi-icons-lab/src/icons/IconDatePicker.tsx +++ b/packages/semi-icons-lab/src/icons/IconDatePicker.tsx @@ -15,16 +15,16 @@ function SvgComponent(props: React.SVGProps) { - + diff --git a/packages/semi-icons-lab/src/icons/IconDropdown.tsx b/packages/semi-icons-lab/src/icons/IconDropdown.tsx index 0450cac100..7edfc26fd0 100644 --- a/packages/semi-icons-lab/src/icons/IconDropdown.tsx +++ b/packages/semi-icons-lab/src/icons/IconDropdown.tsx @@ -24,7 +24,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconEmpty.tsx b/packages/semi-icons-lab/src/icons/IconEmpty.tsx index 8c2b530b28..0eba769e9b 100644 --- a/packages/semi-icons-lab/src/icons/IconEmpty.tsx +++ b/packages/semi-icons-lab/src/icons/IconEmpty.tsx @@ -13,17 +13,11 @@ function SvgComponent(props: React.SVGProps) { {...props} > - - + + ) { diff --git a/packages/semi-icons-lab/src/icons/IconForm.tsx b/packages/semi-icons-lab/src/icons/IconForm.tsx index 06423f5ad5..e6d2d65970 100644 --- a/packages/semi-icons-lab/src/icons/IconForm.tsx +++ b/packages/semi-icons-lab/src/icons/IconForm.tsx @@ -34,7 +34,7 @@ function SvgComponent(props: React.SVGProps) { @@ -48,11 +48,11 @@ function SvgComponent(props: React.SVGProps) { fill="#DDE3E8" /> diff --git a/packages/semi-icons-lab/src/icons/IconGettingStarted.tsx b/packages/semi-icons-lab/src/icons/IconGettingStarted.tsx index 38c7e03f78..b513cae80b 100644 --- a/packages/semi-icons-lab/src/icons/IconGettingStarted.tsx +++ b/packages/semi-icons-lab/src/icons/IconGettingStarted.tsx @@ -14,7 +14,7 @@ function SvgComponent(props: React.SVGProps) { > diff --git a/packages/semi-icons-lab/src/icons/IconGrid.tsx b/packages/semi-icons-lab/src/icons/IconGrid.tsx index bdf7da970e..b9586db163 100644 --- a/packages/semi-icons-lab/src/icons/IconGrid.tsx +++ b/packages/semi-icons-lab/src/icons/IconGrid.tsx @@ -12,9 +12,9 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - + + + diff --git a/packages/semi-icons-lab/src/icons/IconHeart.tsx b/packages/semi-icons-lab/src/icons/IconHeart.tsx index 980169ee5f..43d3c04894 100644 --- a/packages/semi-icons-lab/src/icons/IconHeart.tsx +++ b/packages/semi-icons-lab/src/icons/IconHeart.tsx @@ -15,11 +15,11 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconHighlight.tsx b/packages/semi-icons-lab/src/icons/IconHighlight.tsx index 03ca16eb5e..852c3abb2b 100644 --- a/packages/semi-icons-lab/src/icons/IconHighlight.tsx +++ b/packages/semi-icons-lab/src/icons/IconHighlight.tsx @@ -14,7 +14,7 @@ function SvgComponent(props: React.SVGProps) { > ) { aria-hidden={true} {...props} > - - + + diff --git a/packages/semi-icons-lab/src/icons/IconInput.tsx b/packages/semi-icons-lab/src/icons/IconInput.tsx index 2f8cd82087..b91f77362d 100644 --- a/packages/semi-icons-lab/src/icons/IconInput.tsx +++ b/packages/semi-icons-lab/src/icons/IconInput.tsx @@ -12,7 +12,7 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - + diff --git a/packages/semi-icons-lab/src/icons/IconInputNumber.tsx b/packages/semi-icons-lab/src/icons/IconInputNumber.tsx index 3d2bf0fd23..9eb152ce0c 100644 --- a/packages/semi-icons-lab/src/icons/IconInputNumber.tsx +++ b/packages/semi-icons-lab/src/icons/IconInputNumber.tsx @@ -13,11 +13,11 @@ function SvgComponent(props: React.SVGProps) { {...props} > - - - + + + diff --git a/packages/semi-icons-lab/src/icons/IconIntro.tsx b/packages/semi-icons-lab/src/icons/IconIntro.tsx index bd96dd4b3a..f9995b098d 100644 --- a/packages/semi-icons-lab/src/icons/IconIntro.tsx +++ b/packages/semi-icons-lab/src/icons/IconIntro.tsx @@ -13,10 +13,10 @@ function SvgComponent(props: React.SVGProps) { {...props} > - + ); } diff --git a/packages/semi-icons-lab/src/icons/IconJsonViewer.tsx b/packages/semi-icons-lab/src/icons/IconJsonViewer.tsx new file mode 100644 index 0000000000..3398675f22 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconJsonViewer.tsx @@ -0,0 +1,46 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'json-viewer'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconList.tsx b/packages/semi-icons-lab/src/icons/IconList.tsx index 08b95fa33c..ca489a0482 100644 --- a/packages/semi-icons-lab/src/icons/IconList.tsx +++ b/packages/semi-icons-lab/src/icons/IconList.tsx @@ -12,18 +12,12 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - - - - + + + + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconLocaleProvider.tsx b/packages/semi-icons-lab/src/icons/IconLocaleProvider.tsx index 4a52cccc43..ed9085ed0a 100644 --- a/packages/semi-icons-lab/src/icons/IconLocaleProvider.tsx +++ b/packages/semi-icons-lab/src/icons/IconLocaleProvider.tsx @@ -16,11 +16,11 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconLottie.tsx b/packages/semi-icons-lab/src/icons/IconLottie.tsx new file mode 100644 index 0000000000..97b9a8f395 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconLottie.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'lottie'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconMarkdown.tsx b/packages/semi-icons-lab/src/icons/IconMarkdown.tsx new file mode 100644 index 0000000000..dc39e3bfd1 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconMarkdown.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'markdown'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconNavigation.tsx b/packages/semi-icons-lab/src/icons/IconNavigation.tsx index da1d3d0637..280b214f60 100644 --- a/packages/semi-icons-lab/src/icons/IconNavigation.tsx +++ b/packages/semi-icons-lab/src/icons/IconNavigation.tsx @@ -14,10 +14,7 @@ function SvgComponent(props: React.SVGProps) { > - + diff --git a/packages/semi-icons-lab/src/icons/IconNotification.tsx b/packages/semi-icons-lab/src/icons/IconNotification.tsx index 6bd5b66a88..9b69bca1df 100644 --- a/packages/semi-icons-lab/src/icons/IconNotification.tsx +++ b/packages/semi-icons-lab/src/icons/IconNotification.tsx @@ -15,19 +15,19 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconOverflow.tsx b/packages/semi-icons-lab/src/icons/IconOverflow.tsx index c994c66cc4..9028789a6b 100644 --- a/packages/semi-icons-lab/src/icons/IconOverflow.tsx +++ b/packages/semi-icons-lab/src/icons/IconOverflow.tsx @@ -19,5 +19,5 @@ function SvgComponent(props: React.SVGProps) { ); } -const IconComponent = convertIcon(SvgComponent, 'overflowList'); +const IconComponent = convertIcon(SvgComponent, 'overflow'); export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconPagination.tsx b/packages/semi-icons-lab/src/icons/IconPagination.tsx index 823a06ac26..1d3b52f710 100644 --- a/packages/semi-icons-lab/src/icons/IconPagination.tsx +++ b/packages/semi-icons-lab/src/icons/IconPagination.tsx @@ -12,10 +12,10 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - - + + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconPincode.tsx b/packages/semi-icons-lab/src/icons/IconPincode.tsx new file mode 100644 index 0000000000..d367796ff0 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconPincode.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'pincode'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconPopconfirm.tsx b/packages/semi-icons-lab/src/icons/IconPopconfirm.tsx index 002f40a443..a26d82c761 100644 --- a/packages/semi-icons-lab/src/icons/IconPopconfirm.tsx +++ b/packages/semi-icons-lab/src/icons/IconPopconfirm.tsx @@ -14,7 +14,7 @@ function SvgComponent(props: React.SVGProps) { > diff --git a/packages/semi-icons-lab/src/icons/IconProgress.tsx b/packages/semi-icons-lab/src/icons/IconProgress.tsx index 73089e98b2..f8d45743c0 100644 --- a/packages/semi-icons-lab/src/icons/IconProgress.tsx +++ b/packages/semi-icons-lab/src/icons/IconProgress.tsx @@ -14,7 +14,7 @@ function SvgComponent(props: React.SVGProps) { > ) { > diff --git a/packages/semi-icons-lab/src/icons/IconScrollList.tsx b/packages/semi-icons-lab/src/icons/IconScrollList.tsx index 9174489176..36ace840fc 100644 --- a/packages/semi-icons-lab/src/icons/IconScrollList.tsx +++ b/packages/semi-icons-lab/src/icons/IconScrollList.tsx @@ -13,14 +13,14 @@ function SvgComponent(props: React.SVGProps) { {...props} > - + - - - + + + ); } -const IconComponent = convertIcon(SvgComponent, 'scrolllist'); +const IconComponent = convertIcon(SvgComponent, 'scroll-list'); export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconSelect.tsx b/packages/semi-icons-lab/src/icons/IconSelect.tsx index 6392cd355d..c003c50944 100644 --- a/packages/semi-icons-lab/src/icons/IconSelect.tsx +++ b/packages/semi-icons-lab/src/icons/IconSelect.tsx @@ -19,10 +19,10 @@ function SvgComponent(props: React.SVGProps) { - + diff --git a/packages/semi-icons-lab/src/icons/IconSideSheet.tsx b/packages/semi-icons-lab/src/icons/IconSideSheet.tsx index fa2b831c9b..b7b916f192 100644 --- a/packages/semi-icons-lab/src/icons/IconSideSheet.tsx +++ b/packages/semi-icons-lab/src/icons/IconSideSheet.tsx @@ -12,8 +12,8 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - + + ); diff --git a/packages/semi-icons-lab/src/icons/IconSpace.tsx b/packages/semi-icons-lab/src/icons/IconSpace.tsx index e088d8c7f9..6eabc7dbfe 100644 --- a/packages/semi-icons-lab/src/icons/IconSpace.tsx +++ b/packages/semi-icons-lab/src/icons/IconSpace.tsx @@ -14,9 +14,9 @@ function SvgComponent(props: React.SVGProps) { > - - - + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconSpin.tsx b/packages/semi-icons-lab/src/icons/IconSpin.tsx index 8ac4074d60..91519e2c5b 100644 --- a/packages/semi-icons-lab/src/icons/IconSpin.tsx +++ b/packages/semi-icons-lab/src/icons/IconSpin.tsx @@ -12,30 +12,12 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - - - - - + + + + + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconSteps.tsx b/packages/semi-icons-lab/src/icons/IconSteps.tsx index 5693af584b..100d91379e 100644 --- a/packages/semi-icons-lab/src/icons/IconSteps.tsx +++ b/packages/semi-icons-lab/src/icons/IconSteps.tsx @@ -13,11 +13,11 @@ function SvgComponent(props: React.SVGProps) { {...props} > - + ); } diff --git a/packages/semi-icons-lab/src/icons/IconTable.tsx b/packages/semi-icons-lab/src/icons/IconTable.tsx index 0965afd4bb..eeeb91cef1 100644 --- a/packages/semi-icons-lab/src/icons/IconTable.tsx +++ b/packages/semi-icons-lab/src/icons/IconTable.tsx @@ -12,15 +12,12 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > - - + + - - + + ); } diff --git a/packages/semi-icons-lab/src/icons/IconTabs.tsx b/packages/semi-icons-lab/src/icons/IconTabs.tsx index ea1740e705..c74164f77a 100644 --- a/packages/semi-icons-lab/src/icons/IconTabs.tsx +++ b/packages/semi-icons-lab/src/icons/IconTabs.tsx @@ -12,12 +12,9 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > + - diff --git a/packages/semi-icons-lab/src/icons/IconTag.tsx b/packages/semi-icons-lab/src/icons/IconTag.tsx index b9d86877dc..b7e8e83d85 100644 --- a/packages/semi-icons-lab/src/icons/IconTag.tsx +++ b/packages/semi-icons-lab/src/icons/IconTag.tsx @@ -15,11 +15,11 @@ function SvgComponent(props: React.SVGProps) { ) { > diff --git a/packages/semi-icons-lab/src/icons/IconTimePicker.tsx b/packages/semi-icons-lab/src/icons/IconTimePicker.tsx index 61b1fb0b6c..a696ce160a 100644 --- a/packages/semi-icons-lab/src/icons/IconTimePicker.tsx +++ b/packages/semi-icons-lab/src/icons/IconTimePicker.tsx @@ -14,14 +14,14 @@ function SvgComponent(props: React.SVGProps) { > - + ); diff --git a/packages/semi-icons-lab/src/icons/IconToast.tsx b/packages/semi-icons-lab/src/icons/IconToast.tsx index 0507a0aaac..7e98f0eb28 100644 --- a/packages/semi-icons-lab/src/icons/IconToast.tsx +++ b/packages/semi-icons-lab/src/icons/IconToast.tsx @@ -14,19 +14,19 @@ function SvgComponent(props: React.SVGProps) { > diff --git a/packages/semi-icons-lab/src/icons/IconTooltip.tsx b/packages/semi-icons-lab/src/icons/IconTooltip.tsx index 0f51399c0f..376e5d7799 100644 --- a/packages/semi-icons-lab/src/icons/IconTooltip.tsx +++ b/packages/semi-icons-lab/src/icons/IconTooltip.tsx @@ -15,13 +15,13 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconTransfer.tsx b/packages/semi-icons-lab/src/icons/IconTransfer.tsx index cafd8c07ed..d7720c73ad 100644 --- a/packages/semi-icons-lab/src/icons/IconTransfer.tsx +++ b/packages/semi-icons-lab/src/icons/IconTransfer.tsx @@ -13,15 +13,15 @@ function SvgComponent(props: React.SVGProps) { {...props} > diff --git a/packages/semi-icons-lab/src/icons/IconTree.tsx b/packages/semi-icons-lab/src/icons/IconTree.tsx index 3c3effe3b8..61cd194d94 100644 --- a/packages/semi-icons-lab/src/icons/IconTree.tsx +++ b/packages/semi-icons-lab/src/icons/IconTree.tsx @@ -17,13 +17,13 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons-lab/src/icons/IconTreeSelect.tsx b/packages/semi-icons-lab/src/icons/IconTreeSelect.tsx index c2724d9e7e..79f1d37db8 100644 --- a/packages/semi-icons-lab/src/icons/IconTreeSelect.tsx +++ b/packages/semi-icons-lab/src/icons/IconTreeSelect.tsx @@ -13,25 +13,13 @@ function SvgComponent(props: React.SVGProps) { {...props} > + + + + + - - - - - diff --git a/packages/semi-icons-lab/src/icons/IconTypography.tsx b/packages/semi-icons-lab/src/icons/IconTypography.tsx index 963b2198d8..9613211543 100644 --- a/packages/semi-icons-lab/src/icons/IconTypography.tsx +++ b/packages/semi-icons-lab/src/icons/IconTypography.tsx @@ -13,11 +13,11 @@ function SvgComponent(props: React.SVGProps) { {...props} > diff --git a/packages/semi-icons-lab/src/icons/IconUpload.tsx b/packages/semi-icons-lab/src/icons/IconUpload.tsx index 07cbcc518e..bec1e2e2ac 100644 --- a/packages/semi-icons-lab/src/icons/IconUpload.tsx +++ b/packages/semi-icons-lab/src/icons/IconUpload.tsx @@ -15,21 +15,16 @@ function SvgComponent(props: React.SVGProps) { - + ); } diff --git a/packages/semi-icons-lab/src/icons/IconVersionOne.tsx b/packages/semi-icons-lab/src/icons/IconVersionOne.tsx new file mode 100644 index 0000000000..6b52ab99f9 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconVersionOne.tsx @@ -0,0 +1,24 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'version-one'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconVersionTwo.tsx b/packages/semi-icons-lab/src/icons/IconVersionTwo.tsx index 70c9e3f9be..5f06a6572c 100644 --- a/packages/semi-icons-lab/src/icons/IconVersionTwo.tsx +++ b/packages/semi-icons-lab/src/icons/IconVersionTwo.tsx @@ -12,20 +12,14 @@ function SvgComponent(props: React.SVGProps) { aria-hidden={true} {...props} > + - - + diff --git a/packages/semi-icons-lab/src/icons/IconWebcomponents.tsx b/packages/semi-icons-lab/src/icons/IconWebcomponents.tsx new file mode 100644 index 0000000000..b1e15517a0 --- /dev/null +++ b/packages/semi-icons-lab/src/icons/IconWebcomponents.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import { convertIcon } from '../components/Icon'; +function SvgComponent(props: React.SVGProps) { + return ( + + + + + + + ); +} +const IconComponent = convertIcon(SvgComponent, 'webcomponents'); +export default IconComponent; diff --git a/packages/semi-icons-lab/src/icons/IconWheelChair.tsx b/packages/semi-icons-lab/src/icons/IconWheelChair.tsx index c53106466e..640e5525a8 100644 --- a/packages/semi-icons-lab/src/icons/IconWheelChair.tsx +++ b/packages/semi-icons-lab/src/icons/IconWheelChair.tsx @@ -13,15 +13,12 @@ function SvgComponent(props: React.SVGProps) { {...props} > + - diff --git a/packages/semi-icons-lab/src/icons/index.ts b/packages/semi-icons-lab/src/icons/index.ts index 8e3c922af6..7620b8deea 100644 --- a/packages/semi-icons-lab/src/icons/index.ts +++ b/packages/semi-icons-lab/src/icons/index.ts @@ -13,7 +13,10 @@ export { default as IconCard } from './IconCard'; export { default as IconCarousel } from './IconCarousel'; export { default as IconCascader } from './IconCascader'; export { default as IconChangelog } from './IconChangelog'; +export { default as IconChart } from './IconChart'; +export { default as IconChat } from './IconChat'; export { default as IconCheckbox } from './IconCheckbox'; +export { default as IconCodeHighlight } from './IconCodeHighlight'; export { default as IconCollapse } from './IconCollapse'; export { default as IconCollapsible } from './IconCollapsible'; export { default as IconColorPlatteNew } from './IconColorPlatteNew'; @@ -35,14 +38,18 @@ export { default as IconImage } from './IconImage'; export { default as IconInputNumber } from './IconInputNumber'; export { default as IconInput } from './IconInput'; export { default as IconIntro } from './IconIntro'; +export { default as IconJsonViewer } from './IconJsonViewer'; export { default as IconLayout } from './IconLayout'; export { default as IconList } from './IconList'; export { default as IconLocaleProvider } from './IconLocaleProvider'; +export { default as IconLottie } from './IconLottie'; +export { default as IconMarkdown } from './IconMarkdown'; export { default as IconModal } from './IconModal'; export { default as IconNavigation } from './IconNavigation'; export { default as IconNotification } from './IconNotification'; export { default as IconOverflow } from './IconOverflow'; export { default as IconPagination } from './IconPagination'; +export { default as IconPincode } from './IconPincode'; export { default as IconPopconfirm } from './IconPopconfirm'; export { default as IconPopover } from './IconPopover'; export { default as IconProgress } from './IconProgress'; @@ -71,5 +78,7 @@ export { default as IconTreeSelect } from './IconTreeSelect'; export { default as IconTree } from './IconTree'; export { default as IconTypography } from './IconTypography'; export { default as IconUpload } from './IconUpload'; +export { default as IconVersionOne } from './IconVersionOne'; export { default as IconVersionTwo } from './IconVersionTwo'; +export { default as IconWebcomponents } from './IconWebcomponents'; export { default as IconWheelChair } from './IconWheelChair'; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAccessibility.d.ts b/packages/semi-icons-lab/src/react/IconAccessibility.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconAccessibility.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAccessibility.js b/packages/semi-icons-lab/src/react/IconAccessibility.js deleted file mode 100644 index bde1e8ffac..0000000000 --- a/packages/semi-icons-lab/src/react/IconAccessibility.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconAccessibility(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 4, - r: 3, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M2 9.5C2 8.67157 2.67157 8 3.5 8H8H16H20.5C21.3284 8 22 8.67157 22 9.5C22 10.3284 21.3284 11 20.5 11H16V15.5V17V21.5C16 22.3284 15.3284 23 14.5 23C13.6716 23 13 22.3284 13 21.5V17C13 16.4477 12.5523 16 12 16C11.4477 16 11 16.4477 11 17V21.5C11 22.3284 10.3284 23 9.5 23C8.67157 23 8 22.3284 8 21.5V17V15.5V11H3.5C2.67157 11 2 10.3284 2 9.5Z", - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconAccessibility); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAnchor.d.ts b/packages/semi-icons-lab/src/react/IconAnchor.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconAnchor.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAnchor.js b/packages/semi-icons-lab/src/react/IconAnchor.js deleted file mode 100644 index 6bea21c485..0000000000 --- a/packages/semi-icons-lab/src/react/IconAnchor.js +++ /dev/null @@ -1,36 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconAnchor(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M6.16667 12H3.66667C3.66667 16.6024 7.39763 20.3333 12 20.3333C16.6024 20.3333 20.3333 16.6024 20.3333 12H17.8333", - stroke: "#AAB2BF", - strokeWidth: 2, - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M12 20.3333V7.83333", - stroke: "#818A9B", - strokeWidth: 2, - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.0016 9.83667C13.7054 9.83667 15.0866 8.45545 15.0866 6.75167C15.0866 5.04787 13.7054 3.66667 12.0016 3.66667C10.2978 3.66667 8.91663 5.04787 8.91663 6.75167C8.91663 8.45545 10.2978 9.83667 12.0016 9.83667Z", - fill: "#324350", - stroke: "#324350", - strokeWidth: 1.25, - strokeLinejoin: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconAnchor); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAutocomplete.d.ts b/packages/semi-icons-lab/src/react/IconAutocomplete.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconAutocomplete.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAutocomplete.js b/packages/semi-icons-lab/src/react/IconAutocomplete.js deleted file mode 100644 index f4116ff9d1..0000000000 --- a/packages/semi-icons-lab/src/react/IconAutocomplete.js +++ /dev/null @@ -1,38 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconAutocomplete(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 4, - width: 22, - height: 16, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M3.0918 16.3105C3.54883 16.3105 3.80273 16.0757 3.98047 15.479L4.46289 14.0063H7.50342L7.99219 15.479C8.16357 16.0693 8.43018 16.3105 8.89355 16.3105C9.38232 16.3105 9.70605 16.0186 9.70605 15.5615C9.70605 15.3838 9.66162 15.1743 9.57275 14.9014L7.38916 8.64258C7.11621 7.83008 6.73535 7.5 6.01807 7.5C5.29443 7.5 4.90723 7.83643 4.63428 8.64258L2.45068 14.9014C2.34277 15.2251 2.29834 15.4219 2.29834 15.5933C2.29834 16.0249 2.62207 16.3105 3.0918 16.3105ZM4.84375 12.7305L5.94824 9.22656H6.03076L7.12891 12.7305H4.84375Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M10.9312 15.1362C10.9312 15.8726 11.3057 16.2344 12.0737 16.2344H14.5366C16.3711 16.2344 17.5518 15.2759 17.5518 13.7905C17.5518 12.6099 16.79 11.7847 15.6221 11.6768V11.6006C16.5488 11.3848 17.1074 10.6802 17.1074 9.70264C17.1074 8.39502 16.1172 7.56982 14.543 7.56982H12.0737C11.3057 7.56982 10.9312 7.93799 10.9312 8.66797V15.1362ZM12.6323 11.1753V8.8584H14.1494C14.9492 8.8584 15.4189 9.29004 15.4189 9.99463C15.4189 10.75 14.9111 11.1753 13.7622 11.1753H12.6323ZM12.6323 14.9458V12.3687H14.2573C15.2603 12.3687 15.8062 12.8701 15.8062 13.689C15.8062 14.5142 15.2539 14.9458 13.9019 14.9458H12.6323Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 19, - y: 6, - width: 2, - height: 12, - rx: 1, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconAutocomplete); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAvatar.d.ts b/packages/semi-icons-lab/src/react/IconAvatar.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconAvatar.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconAvatar.js b/packages/semi-icons-lab/src/react/IconAvatar.js deleted file mode 100644 index 25a9e8347d..0000000000 --- a/packages/semi-icons-lab/src/react/IconAvatar.js +++ /dev/null @@ -1,45 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconAvatar(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("mask", { - id: "mask0_1_3014", - style: { - maskType: "alpha" - }, - maskUnits: "userSpaceOnUse", - x: 1, - y: 1, - width: 22, - height: 22 - }, /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - fill: "#A2845E" - })), /*#__PURE__*/React.createElement("g", { - mask: "url(#mask0_1_3014)" - }, /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M11.9996 17.7963C13.7184 17.7963 15.2479 16.3561 16.0881 14.2048C16.6103 13.9909 17.1072 13.3424 17.334 12.4957C17.629 11.3948 17.5705 10.4118 16.7665 10.1059C16.6885 6.27115 15.1754 4.78714 11.9996 4.78714C8.82412 4.78714 7.31097 6.27097 7.2328 10.1052C6.42711 10.4103 6.36828 11.394 6.66349 12.4957C6.89064 13.3435 7.38849 13.9926 7.91145 14.2056C8.7518 16.3565 10.2811 17.7963 11.9996 17.7963ZM20.0126 23C20.34 23 20.5906 22.7037 20.4686 22.3999C19.6099 20.2625 16.1444 18.6636 12 18.6636C7.85555 18.6636 4.39008 20.2625 3.53142 22.3999C3.40937 22.7037 3.65999 23 3.9874 23H20.0126Z", - fill: "white" - }))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconAvatar); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBackTop.d.ts b/packages/semi-icons-lab/src/react/IconBackTop.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconBackTop.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBackTop.js b/packages/semi-icons-lab/src/react/IconBackTop.js deleted file mode 100644 index 8fa0cf4dce..0000000000 --- a/packages/semi-icons-lab/src/react/IconBackTop.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconBackTop(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2.9685 14.1284L12 6L21.0315 14.1284C21.3721 14.4349 21.1553 15 20.697 15H16V22H8V15H3.30298C2.84474 15 2.62789 14.4349 2.9685 14.1284Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 3, - y: 2, - width: 18, - height: 4, - rx: 1, - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconBackTop); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBadge.d.ts b/packages/semi-icons-lab/src/react/IconBadge.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconBadge.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBadge.js b/packages/semi-icons-lab/src/react/IconBadge.js deleted file mode 100644 index 8204043007..0000000000 --- a/packages/semi-icons-lab/src/react/IconBadge.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconBadge(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M21 11.5018C20.2304 11.8228 19.3859 12 18.5 12C14.9101 12 12 9.08985 12 5.5C12 4.6141 12.1772 3.76959 12.4982 3H5C3.34315 3 2 4.34315 2 6V19C2 20.6569 3.34315 22 5 22H18C19.6569 22 21 20.6569 21 19V11.5018Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("circle", { - cx: 18.5, - cy: 5.5, - r: 4.5, - fill: "#FF7D95" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconBadge); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBadgeStar.d.ts b/packages/semi-icons-lab/src/react/IconBadgeStar.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconBadgeStar.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBadgeStar.js b/packages/semi-icons-lab/src/react/IconBadgeStar.js deleted file mode 100644 index 875a75200c..0000000000 --- a/packages/semi-icons-lab/src/react/IconBadgeStar.js +++ /dev/null @@ -1,24 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconBadgeStar(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12Z", - fill: "#FF7D95" - }), /*#__PURE__*/React.createElement("path", { - d: "M13.3528 17.2568C13.3528 17.1858 13.169 14.6462 13.022 13.7049C13.7755 14.291 15.9443 15.694 15.9994 15.7117C16.2384 15.8538 16.4957 15.9071 16.753 15.8893C17.3779 15.8538 17.9476 15.4454 17.9844 14.6995C18.0579 14.2022 17.8741 13.7582 17.3779 13.5096C17.3227 13.4563 14.9702 12.3552 14.0512 12C14.9702 11.6448 17.286 10.5615 17.3227 10.526C17.819 10.2773 18.0579 9.74454 17.966 9.24727C17.9293 8.6612 17.3963 8.14617 16.7162 8.11066C16.4589 8.0929 16.2384 8.14617 16.0178 8.27049C15.9627 8.28825 13.7755 9.70902 13.022 10.2951C13.169 9.35383 13.3528 6.83197 13.3528 6.76093C13.3528 6.08607 12.7463 5.5 12.0111 5.5C11.2759 5.5 10.651 6.06831 10.6694 6.81421C10.6694 6.86749 10.8532 9.33607 11.0003 10.2773C10.2283 9.69126 8.04118 8.27049 7.96766 8.25273C7.76549 8.12842 7.52656 8.07514 7.26925 8.0929C6.64435 8.12842 6.07459 8.60792 6.03783 9.22951C5.94593 9.72678 6.18487 10.2596 6.66273 10.5082C6.73625 10.5615 9.07042 11.6448 9.98939 12C9.07042 12.3552 6.68111 13.474 6.62597 13.5096C6.16649 13.7404 5.92755 14.1844 6.01945 14.6639C6.05621 15.4454 6.60759 15.8716 7.25087 15.9071C7.50818 15.9249 7.76549 15.8716 8.00442 15.7295C8.05956 15.7117 10.2283 14.3087 10.9819 13.7049C10.8532 14.6639 10.6694 17.1503 10.6694 17.2036C10.651 17.9495 11.2759 18.5 12.0111 18.5C12.7463 18.5 13.3528 17.9139 13.3528 17.2568Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconBadgeStar); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBanner.d.ts b/packages/semi-icons-lab/src/react/IconBanner.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconBanner.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBanner.js b/packages/semi-icons-lab/src/react/IconBanner.js deleted file mode 100644 index 895626970d..0000000000 --- a/packages/semi-icons-lab/src/react/IconBanner.js +++ /dev/null @@ -1,59 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconBanner(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 19, - width: 12, - height: 1, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 7.942, - y: 0.897, - width: 2, - height: 22.2633, - rx: 1, - transform: "rotate(10 7.94241 0.896553)", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 14.085, - y: 1.229, - width: 2, - height: 22.3119, - rx: 1, - transform: "rotate(-10 14.0853 1.22887)", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 3, - width: 22, - height: 14, - rx: 2, - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("rect", { - x: 4, - y: 6, - width: 16, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 4, - y: 11, - width: 9, - height: 2, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconBanner); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBreadcrumb.d.ts b/packages/semi-icons-lab/src/react/IconBreadcrumb.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconBreadcrumb.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconBreadcrumb.js b/packages/semi-icons-lab/src/react/IconBreadcrumb.js deleted file mode 100644 index eda8066da1..0000000000 --- a/packages/semi-icons-lab/src/react/IconBreadcrumb.js +++ /dev/null @@ -1,27 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconBreadcrumb(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M6 4H14L18.0063 10.41C18.6143 11.3828 18.6143 12.6172 18.0063 13.59L14 20H6V4Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M2 7C2 5.34315 3.34315 4 5 4H7L11.0063 10.41C11.6143 11.3828 11.6143 12.6172 11.0063 13.59L7 20H5C3.34315 20 2 18.6569 2 17V7Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M13 20H16.3373C17.3716 20 18.333 19.4671 18.8813 18.59L22.0063 13.59C22.6143 12.6172 22.6143 11.3828 22.0063 10.41L18.8813 5.41C18.333 4.53286 17.3716 4 16.3373 4H13L17.0063 10.41C17.6143 11.3828 17.6143 12.6172 17.0063 13.59L13 20Z", - fill: "#DDE3E8" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconBreadcrumb); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconButton.d.ts b/packages/semi-icons-lab/src/react/IconButton.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconButton.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconButton.js b/packages/semi-icons-lab/src/react/IconButton.js deleted file mode 100644 index d0d7ba2f87..0000000000 --- a/packages/semi-icons-lab/src/react/IconButton.js +++ /dev/null @@ -1,30 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconButton(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2 16.5C2 15.1193 3.11929 14 4.5 14H19.5C20.8807 14 22 15.1193 22 16.5C22 17.8807 20.8807 19 19.5 19H4.5C3.11929 19 2 17.8807 2 16.5Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 8, - y: 12, - width: 8, - height: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M6 5.67391C6 4.73519 6.65356 3.9279 7.58364 3.80089C8.66208 3.65362 10.2149 3.5 12 3.5C13.7851 3.5 15.3379 3.65362 16.4164 3.80089C17.3464 3.9279 18 4.73519 18 5.67391V11C18 11.5523 17.5523 12 17 12H7C6.44772 12 6 11.5523 6 11V5.67391Z", - fill: "#F82C2C" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconButton); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCalendar.d.ts b/packages/semi-icons-lab/src/react/IconCalendar.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCalendar.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCalendar.js b/packages/semi-icons-lab/src/react/IconCalendar.js deleted file mode 100644 index a34d176d99..0000000000 --- a/packages/semi-icons-lab/src/react/IconCalendar.js +++ /dev/null @@ -1,42 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCalendar(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2.75, - y: 2.75, - width: 18.5, - height: 18.5, - rx: 3, - fill: "white", - stroke: "#AAB2BF", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("path", { - d: "M9.39999 16.5817C9.39999 17.4915 10.5413 18.3296 12.0301 18.3296C13.6897 18.3296 14.8587 17.4088 14.8587 16.091C14.8587 15.1371 14.1694 14.3541 13.2541 14.2659V14.1722C14.015 14.0619 14.6271 13.312 14.6271 12.496C14.6271 11.3216 13.5574 10.5 12.0356 10.5C10.5965 10.5 9.5213 11.3105 9.5213 12.1927C9.5213 12.5511 9.77493 12.7992 10.1278 12.7992C10.387 12.7992 10.5799 12.6835 10.7454 12.4078C11.0376 11.9115 11.4622 11.6579 12.008 11.6579C12.7083 11.6579 13.1935 12.0714 13.1935 12.6779C13.1935 13.2845 12.6972 13.7256 12.019 13.7256H11.5063C11.1699 13.7256 10.9328 13.9737 10.9328 14.3045C10.9328 14.6464 11.1754 14.8945 11.5063 14.8945H12.0466C12.8571 14.8945 13.403 15.3576 13.403 16.0414C13.403 16.7251 12.8682 17.1717 12.0411 17.1717C11.4236 17.1717 10.9328 16.9015 10.613 16.3942C10.409 16.0965 10.2271 15.9807 9.98446 15.9807C9.64811 15.9807 9.39999 16.2343 9.39999 16.5817Z", - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - d: "M2 5C2 3.34314 3.34315 2 5 2L19 2C20.6569 2 22 3.34314 22 5V9H2V5Z", - fill: "#F82C2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M9.97348 7.49711C10.2501 7.49711 10.4086 7.31556 10.4086 7.00144V4.11959C10.4086 3.72766 10.204 3.50288 9.84668 3.50288C9.54985 3.50288 9.37982 3.63544 9.20691 4.0072L8.42305 5.76801H8.39135L7.60749 4.01008C7.43458 3.63832 7.26167 3.50288 6.9706 3.50288C6.61901 3.50288 6.39999 3.73631 6.39999 4.11959V7.00144C6.39999 7.3242 6.54409 7.49711 6.81786 7.49711C7.09452 7.49711 7.25302 7.31556 7.25302 7.00144V5.02161H7.29913L7.96484 6.50864C8.0974 6.79394 8.21267 6.89481 8.40864 6.89481C8.60172 6.89481 8.71123 6.79971 8.84668 6.50864L9.51239 5.02161H9.5585V7.00144C9.5585 7.3242 9.70259 7.49711 9.97348 7.49711Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M11.351 7.5C11.6046 7.5 11.7401 7.37031 11.8352 7.03602L11.9879 6.56628H13.3107L13.4605 7.03602C13.5556 7.36167 13.7026 7.5 13.9562 7.5C14.23 7.5 14.4086 7.33861 14.4086 7.08789C14.4086 6.98703 14.3827 6.87175 14.3308 6.71037L13.4634 4.15994C13.3049 3.6902 13.0859 3.50576 12.6709 3.50576C12.2559 3.50576 12.0311 3.69308 11.8755 4.15994L11.0052 6.71037C10.9389 6.90345 10.913 7.01296 10.913 7.10807C10.913 7.33861 11.0916 7.5 11.351 7.5ZM12.1839 5.87752L12.6305 4.3876H12.6767L13.1176 5.87752H12.1839Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M15.9418 7.49711C16.23 7.49711 16.423 7.30115 16.4144 7.01873L16.3971 5.98991L17.3971 4.33285C17.5095 4.14553 17.5556 4.02737 17.5556 3.9121C17.5556 3.67867 17.3712 3.5 17.1291 3.5C16.9389 3.5 16.7862 3.61527 16.6651 3.8487L15.9562 5.16282H15.9216L15.2328 3.84582C15.106 3.60086 14.9735 3.5 14.7689 3.5C14.5066 3.5 14.3279 3.67291 14.3279 3.92939C14.3279 4.04178 14.3683 4.15417 14.4663 4.31844L15.4807 5.98991L15.4605 7.01873C15.4519 7.30115 15.6478 7.49711 15.9418 7.49711Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCalendar); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCard.d.ts b/packages/semi-icons-lab/src/react/IconCard.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCard.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCard.js b/packages/semi-icons-lab/src/react/IconCard.js deleted file mode 100644 index bfa0ef0d87..0000000000 --- a/packages/semi-icons-lab/src/react/IconCard.js +++ /dev/null @@ -1,37 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCard(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 4, - width: 22, - height: 16, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 8, - width: 14, - height: 4, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 14, - width: 8, - height: 2, - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCard); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCascader.d.ts b/packages/semi-icons-lab/src/react/IconCascader.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCascader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCascader.js b/packages/semi-icons-lab/src/react/IconCascader.js deleted file mode 100644 index 39352db07d..0000000000 --- a/packages/semi-icons-lab/src/react/IconCascader.js +++ /dev/null @@ -1,27 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCascader(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2 3.54818C2 2.82211 2.74939 2.33807 3.41122 2.63664L9 5.15789V22L3.17756 19.3733C2.46078 19.05 2 18.3366 2 17.5503V3.54818Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M15 2L20.8224 4.62666C21.5392 4.95002 22 5.6634 22 6.44974V20.4518C22 21.1779 21.2506 21.6619 20.5888 21.3634L15 18.8421V2Z", - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M9 5.15789L15 2V18.8421L9 22V5.15789Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCascader); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconChangelog.d.ts b/packages/semi-icons-lab/src/react/IconChangelog.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconChangelog.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconChangelog.js b/packages/semi-icons-lab/src/react/IconChangelog.js deleted file mode 100644 index cfe62156dd..0000000000 --- a/packages/semi-icons-lab/src/react/IconChangelog.js +++ /dev/null @@ -1,43 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconChangelog(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 20, - height: 20, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 6, - width: 14, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 11, - width: 14, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 16, - width: 10, - height: 2, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconChangelog); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCheckbox.d.ts b/packages/semi-icons-lab/src/react/IconCheckbox.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCheckbox.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCheckbox.js b/packages/semi-icons-lab/src/react/IconCheckbox.js deleted file mode 100644 index fa1a043a27..0000000000 --- a/packages/semi-icons-lab/src/react/IconCheckbox.js +++ /dev/null @@ -1,32 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCheckbox(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1.009, - y: 3.1, - width: 20, - height: 20, - rx: 3, - transform: "rotate(-6 1.00949 3.10003)", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M8.07416 12.9153L11.4236 16.0826L15.6645 8.59828", - stroke: "white", - strokeWidth: 3, - strokeLinecap: "round", - strokeLinejoin: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCheckbox); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCollapse.d.ts b/packages/semi-icons-lab/src/react/IconCollapse.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCollapse.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCollapse.js b/packages/semi-icons-lab/src/react/IconCollapse.js deleted file mode 100644 index 33212308a8..0000000000 --- a/packages/semi-icons-lab/src/react/IconCollapse.js +++ /dev/null @@ -1,42 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCollapse(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 20, - height: 9, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 13, - width: 20, - height: 9, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M17 14.5C16.4477 14.5 16 14.9477 16 15.5V16.5H15C14.4477 16.5 14 16.9477 14 17.5C14 18.0523 14.4477 18.5 15 18.5H16V19.5C16 20.0523 16.4477 20.5 17 20.5C17.5523 20.5 18 20.0523 18 19.5V18.5H19C19.5523 18.5 20 18.0523 20 17.5C20 16.9477 19.5523 16.5 19 16.5H18V15.5C18 14.9477 17.5523 14.5 17 14.5Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M17 3.50003C16.4477 3.50003 16 3.94775 16 4.50003V5.50003H15C14.4477 5.50003 14 5.94775 14 6.50003C14 7.05232 14.4477 7.50003 15 7.50003H16V8.50003C16 9.05232 16.4477 9.50003 17 9.50003C17.5523 9.50003 18 9.05232 18 8.50003V7.50003H19C19.5523 7.50003 20 7.05232 20 6.50003C20 5.94775 19.5523 5.50003 19 5.50003H18V4.50003C18 3.94775 17.5523 3.50003 17 3.50003Z", - fill: "#4CC3FA" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCollapse); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCollapsible.d.ts b/packages/semi-icons-lab/src/react/IconCollapsible.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconCollapsible.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconCollapsible.js b/packages/semi-icons-lab/src/react/IconCollapsible.js deleted file mode 100644 index 60b573cf85..0000000000 --- a/packages/semi-icons-lab/src/react/IconCollapsible.js +++ /dev/null @@ -1,46 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconCollapsible(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2.72361 5.44721C2.39116 4.78231 2.87465 4 3.61803 4H20.382C21.1253 4 21.6088 4.78231 21.2764 5.44721L18 12H6L2.72361 5.44721Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M2.72361 18.5528C2.39116 19.2177 2.87465 20 3.61803 20H20.382C21.1253 20 21.6088 19.2177 21.2764 18.5528L18 12H6L2.72361 18.5528Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M12 2V10", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M9 7L12 10L15 7", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M12 22V14", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M9 17L12 14L15 17", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconCollapsible); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconColorPlatte.d.ts b/packages/semi-icons-lab/src/react/IconColorPlatte.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconColorPlatte.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconColorPlatte.js b/packages/semi-icons-lab/src/react/IconColorPlatte.js deleted file mode 100644 index 9c76fd0c37..0000000000 --- a/packages/semi-icons-lab/src/react/IconColorPlatte.js +++ /dev/null @@ -1,38 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconColorPlatte(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M12 2C6.47778 2 2 6.47778 2 12C2 17.5222 6.47778 22 12 22C12.9222 22 13.6667 21.2556 13.6667 20.3333C13.6667 19.9 13.5056 19.5111 13.2333 19.2167C12.9722 18.9222 12.8167 18.5389 12.8167 18.1111C12.8167 17.1889 13.5611 16.4444 14.4833 16.4444H16.4444C19.5111 16.4444 22 13.9556 22 10.8889C22 5.97778 17.5222 2 12 2Z", - fill: "#DDE3E8", - stroke: "#DDE3E8", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("circle", { - cx: 6, - cy: 12, - r: 2, - fill: "#F82C2C" - }), /*#__PURE__*/React.createElement("circle", { - cx: 10.5, - cy: 7, - r: 2, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("circle", { - cx: 17, - cy: 9, - r: 2, - fill: "#3BCE4A" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconColorPlatte); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconColorPlatteNew.d.ts b/packages/semi-icons-lab/src/react/IconColorPlatteNew.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconColorPlatteNew.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconColorPlatteNew.js b/packages/semi-icons-lab/src/react/IconColorPlatteNew.js deleted file mode 100644 index 82fcf2b90a..0000000000 --- a/packages/semi-icons-lab/src/react/IconColorPlatteNew.js +++ /dev/null @@ -1,23 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconColorPlatteNew(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M23 12C23 15.5421 20.1314 15.9676 17.4879 16.3597C16.0268 16.5765 14.6344 16.783 13.8333 17.5C12.9873 18.2572 13.31 19.3955 13.6062 20.4405C13.9913 21.7992 14.3317 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12ZM20.7083 11.3125C20.7083 12.4516 19.7849 13.375 18.6458 13.375C17.5067 13.375 16.5833 12.4516 16.5833 11.3125C16.5833 10.1734 17.5067 9.25 18.6458 9.25C19.7849 9.25 20.7083 10.1734 20.7083 11.3125ZM14.9792 7.875C16.1183 7.875 17.0417 6.95159 17.0417 5.8125C17.0417 4.67341 16.1183 3.75 14.9792 3.75C13.8401 3.75 12.9167 4.67341 12.9167 5.8125C12.9167 6.95159 13.8401 7.875 14.9792 7.875ZM10.625 5.8125C10.625 6.95159 9.70159 7.875 8.5625 7.875C7.42341 7.875 6.5 6.95159 6.5 5.8125C6.5 4.67341 7.42341 3.75 8.5625 3.75C9.70159 3.75 10.625 4.67341 10.625 5.8125ZM4.89583 13.375C6.03492 13.375 6.95833 12.4516 6.95833 11.3125C6.95833 10.1734 6.03492 9.25 4.89583 9.25C3.75675 9.25 2.83333 10.1734 2.83333 11.3125C2.83333 12.4516 3.75675 13.375 4.89583 13.375Z", - fill: "#0077FA" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconColorPlatteNew); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDarkMode.d.ts b/packages/semi-icons-lab/src/react/IconDarkMode.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconDarkMode.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDarkMode.js b/packages/semi-icons-lab/src/react/IconDarkMode.js deleted file mode 100644 index 8b75420498..0000000000 --- a/packages/semi-icons-lab/src/react/IconDarkMode.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconDarkMode(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18 15.9519C17.5859 16.025 17.1597 16.0631 16.7246 16.0631C12.6984 16.0631 9.43457 12.7992 9.43457 8.77305C9.43457 7.32204 9.85849 5.97005 10.5892 4.83416C7.17112 5.43727 4.57452 8.42192 4.57452 12.013C4.57452 16.0392 7.8384 19.3031 11.8646 19.3031C14.4398 19.3031 16.7031 17.9679 18 15.9519Z", - fill: "#FBCD2C" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconDarkMode); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDatePicker.d.ts b/packages/semi-icons-lab/src/react/IconDatePicker.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconDatePicker.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDatePicker.js b/packages/semi-icons-lab/src/react/IconDatePicker.js deleted file mode 100644 index 70f5de6fa9..0000000000 --- a/packages/semi-icons-lab/src/react/IconDatePicker.js +++ /dev/null @@ -1,44 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconDatePicker(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3038)" - }, /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 4, - width: 22, - height: 16, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M6.5 11H9V13.5H6.5V11ZM12.5 15.5H5.5V10H12.5V15.5ZM12.5 7.5H12V6.5H11V7.5H7V6.5H6V7.5H5.5C4.945 7.5 4.5 7.95 4.5 8.5V15.5C4.5 16.05 4.95 16.5 5.5 16.5H12.5C13.05 16.5 13.5 16.05 13.5 15.5V8.5C13.5 7.95 13.05 7.5 12.5 7.5Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M13.5 12.7929C13.5 11.902 14.5771 11.4558 15.2071 12.0858L23.9142 20.7929C24.5442 21.4228 24.098 22.5 23.2071 22.5H19.2488C18.6797 22.5 18.1376 22.7424 17.7581 23.1665L15.2453 25.9756C14.6333 26.6597 13.5 26.2268 13.5 25.3089V12.7929ZM17.6837 21H22L15 14V24L17.6837 21Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M15 24V14L22 21H17.6837L15 24Z", - fill: "#324350" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3038" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconDatePicker); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDescriptions.d.ts b/packages/semi-icons-lab/src/react/IconDescriptions.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconDescriptions.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDescriptions.js b/packages/semi-icons-lab/src/react/IconDescriptions.js deleted file mode 100644 index e8129cb182..0000000000 --- a/packages/semi-icons-lab/src/react/IconDescriptions.js +++ /dev/null @@ -1,63 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconDescriptions(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2.75, - y: 2.75, - width: 18.5, - height: 18.5, - rx: 3, - fill: "white", - stroke: "#AAB2BF", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 6, - width: 4, - height: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 11, - width: 4, - height: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 16, - width: 2, - height: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 11, - width: 4, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 16, - width: 8, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 6, - width: 8, - height: 2, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconDescriptions); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDivider.d.ts b/packages/semi-icons-lab/src/react/IconDivider.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconDivider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDivider.js b/packages/semi-icons-lab/src/react/IconDivider.js deleted file mode 100644 index 11a30a81f5..0000000000 --- a/packages/semi-icons-lab/src/react/IconDivider.js +++ /dev/null @@ -1,63 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconDivider(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2.75, - y: 2.75, - width: 18.5, - height: 18.5, - rx: 3, - fill: "white", - stroke: "#AAB2BF", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 11, - width: 4, - height: 2, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 15, - y: 11, - width: 4, - height: 2, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 10, - y: 11, - width: 4, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 10, - y: 11, - width: 4, - height: 2, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 16, - width: 14, - height: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 6, - width: 14, - height: 2, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconDivider); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDropdown.d.ts b/packages/semi-icons-lab/src/react/IconDropdown.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconDropdown.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconDropdown.js b/packages/semi-icons-lab/src/react/IconDropdown.js deleted file mode 100644 index 50b1046835..0000000000 --- a/packages/semi-icons-lab/src/react/IconDropdown.js +++ /dev/null @@ -1,31 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconDropdown(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1.009, - y: 3.1, - width: 20, - height: 20, - rx: 3, - transform: "rotate(-6 1.00949 3.10007)", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5.65261 9.58962C6.17396 8.94581 7.11851 8.84653 7.76231 9.36788L12.0918 12.8739L15.5978 8.54433C16.1192 7.90052 17.0637 7.80125 17.7075 8.32259C18.3513 8.84394 18.4506 9.78849 17.9293 10.4323L13.4793 15.9275C12.958 16.5714 12.0134 16.6706 11.3696 16.1493L5.87435 11.6993C5.23054 11.178 5.13127 10.2334 5.65261 9.58962Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconDropdown); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconFaq.d.ts b/packages/semi-icons-lab/src/react/IconFaq.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconFaq.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconFaq.js b/packages/semi-icons-lab/src/react/IconFaq.js deleted file mode 100644 index a62cefceff..0000000000 --- a/packages/semi-icons-lab/src/react/IconFaq.js +++ /dev/null @@ -1,34 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconFaq(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M19 10C20.6569 10 22 11.3431 22 13V18.5V21V23L18.6667 21H8C6.34315 21 5 19.6569 5 18V13C5 11.3431 6.34315 10 8 10H19Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M11.7617 18.043C12.1055 18.043 12.2891 17.8672 12.418 17.4141L12.625 16.7773H14.418L14.6211 17.4141C14.75 17.8555 14.9492 18.043 15.293 18.043C15.6641 18.043 15.9062 17.8242 15.9062 17.4844C15.9062 17.3477 15.8711 17.1914 15.8008 16.9727L14.625 13.5156C14.4102 12.8789 14.1133 12.6289 13.5508 12.6289C12.9883 12.6289 12.6836 12.8828 12.4727 13.5156L11.293 16.9727C11.2031 17.2344 11.168 17.3828 11.168 17.5117C11.168 17.8242 11.4102 18.043 11.7617 18.043ZM12.8906 15.8438L13.4961 13.8242H13.5586L14.1562 15.8438H12.8906Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5 2C3.34315 2 2 3.34315 2 5V8.5V13V17L5.52941 13H16C17.6569 13 19 11.6569 19 10V5C19 3.34315 17.6569 2 16 2H5Z", - fill: "#FF7D95" - }), /*#__PURE__*/React.createElement("path", { - d: "M12.1836 10.6211C12.5039 10.6211 12.7188 10.3945 12.7188 10.082C12.7188 9.94922 12.6953 9.83594 12.5586 9.62891L12.4336 9.45312C12.8281 9.04688 13.0469 8.44922 13.0469 7.67578V7.03906C13.0469 5.50391 12.1641 4.57031 10.6953 4.57031C9.21094 4.57031 8.33984 5.5 8.33984 7.03906V7.67578C8.33984 9.19531 9.19922 10.1172 10.6953 10.1172C10.957 10.1172 11.1914 10.082 11.4102 10.0195L11.5352 10.1914C11.7344 10.4883 11.9375 10.6211 12.1836 10.6211ZM9.62891 7.75391V7.03125C9.62891 6.14844 10.0273 5.625 10.6953 5.625C11.332 5.625 11.7539 6.14844 11.7539 7.03125V7.75391C11.7539 8.08203 11.6914 8.30859 11.582 8.49609L11.4922 8.36719C11.3867 8.25391 11.2695 8.20312 11.1328 8.20312C10.8555 8.20312 10.6602 8.39844 10.6602 8.67578C10.6602 8.77734 10.6992 8.89453 10.75 8.98438L10.832 9.09766C10.7695 9.12109 10.6992 9.13672 10.6289 9.13672C10 9.10156 9.62891 8.59766 9.62891 7.75391Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconFaq); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconForm.d.ts b/packages/semi-icons-lab/src/react/IconForm.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconForm.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconForm.js b/packages/semi-icons-lab/src/react/IconForm.js deleted file mode 100644 index 3ee2271db9..0000000000 --- a/packages/semi-icons-lab/src/react/IconForm.js +++ /dev/null @@ -1,74 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconForm(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3028)" - }, /*#__PURE__*/React.createElement("rect", { - x: 3.051, - y: 2.888, - width: 16, - height: 21, - rx: 2, - transform: "rotate(-6 3.05081 2.88827)", - fill: "#FF7D95" - }), /*#__PURE__*/React.createElement("rect", { - x: 5.249, - y: 4.668, - width: 12, - height: 17, - rx: 1, - transform: "rotate(-6 5.2489 4.66825)", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.3094 0.909647L13.886 0.743932C14.4353 0.686203 14.9273 1.08467 14.9851 1.63393L15.2987 4.61749L7.34248 5.45372L7.0289 2.47015C6.97117 1.92089 7.36963 1.42883 7.91889 1.3711L9.49556 1.20539C9.63945 0.60446 10.1484 0.131264 10.7979 0.0629958C11.4475 -0.00527278 12.0437 0.351766 12.3094 0.909647Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 7.656, - y: 8.437, - width: 8, - height: 2, - transform: "rotate(-6 7.65607 8.43729)", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 8.074, - y: 12.415, - width: 8, - height: 2, - transform: "rotate(-6 8.07417 12.4154)", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 8.492, - y: 16.393, - width: 3.35025, - height: 2, - transform: "rotate(-6 8.49229 16.3935)", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M20.0336 9.94762L15.1077 14.9076C15.0165 14.9977 14.9448 15.1053 14.8969 15.2237L14.0353 17.3532C13.8798 17.7375 14.2655 18.1188 14.6542 17.9651L16.8082 17.1133C16.9279 17.0659 17.0367 16.995 17.1279 16.9049L22.0538 11.9449L20.0336 9.94762Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M22.0538 11.9449L22.7211 11.2731C23.093 10.9054 23.093 10.3092 22.7211 9.94153L22.0477 9.27577C21.6758 8.90808 21.0728 8.90808 20.7009 9.27577L20.0336 9.94762L22.0538 11.9449Z", - fill: "#6A6F7F" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3028" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconForm); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconGettingStarted.d.ts b/packages/semi-icons-lab/src/react/IconGettingStarted.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconGettingStarted.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconGettingStarted.js b/packages/semi-icons-lab/src/react/IconGettingStarted.js deleted file mode 100644 index 22050b9d99..0000000000 --- a/packages/semi-icons-lab/src/react/IconGettingStarted.js +++ /dev/null @@ -1,26 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconGettingStarted(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M16.8983 11.3349C17.2744 11.7121 17.2744 12.2881 16.8983 12.6653C16.3205 13.2449 15.298 14.1515 13.7106 15.1755C12.2711 16.1041 11.033 16.6996 10.1839 17.0552C9.54099 17.3245 8.86333 16.9178 8.77288 16.2267C8.64377 15.2402 8.50004 13.7492 8.50004 12.0001C8.50004 10.251 8.64376 8.76006 8.77287 7.77356C8.86333 7.08239 9.54101 6.67574 10.1839 6.94502C11.033 7.30064 12.2712 7.89619 13.7106 8.82469C15.298 9.84867 16.3204 10.7553 16.8983 11.3349Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconGettingStarted); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconGrid.d.ts b/packages/semi-icons-lab/src/react/IconGrid.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconGrid.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconGrid.js b/packages/semi-icons-lab/src/react/IconGrid.js deleted file mode 100644 index 75862d13c6..0000000000 --- a/packages/semi-icons-lab/src/react/IconGrid.js +++ /dev/null @@ -1,81 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconGrid(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M22 2H2V22H22V2ZM20 4H4V20H20V4Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M22 9H20V15H22V9ZM2 15H4V9H2V15Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M15 22V20H9V22H15ZM9 2V4H15V2H9Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 7, - y: 7, - width: 3, - height: 3, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 7, - y: 10, - width: 3, - height: 4, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 14, - y: 10, - width: 3, - height: 4, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 10, - y: 7, - width: 4, - height: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 10, - y: 14, - width: 4, - height: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 14, - y: 7, - width: 3, - height: 3, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 7, - y: 14, - width: 3, - height: 3, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 14, - y: 14, - width: 3, - height: 3, - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconGrid); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconHeart.d.ts b/packages/semi-icons-lab/src/react/IconHeart.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconHeart.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconHeart.js b/packages/semi-icons-lab/src/react/IconHeart.js deleted file mode 100644 index 461e4bb679..0000000000 --- a/packages/semi-icons-lab/src/react/IconHeart.js +++ /dev/null @@ -1,26 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconHeart(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M20.5 13.9853L12.0147 5.5L12.7574 4.75736C15.1005 2.41421 18.8995 2.41421 21.2426 4.75736C23.5858 7.1005 23.5858 10.8995 21.2426 13.2426L20.5 13.9853Z", - fill: "#F82C2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M11.2426 4.75736C8.89949 2.41421 5.1005 2.41421 2.75736 4.75736C0.414214 7.1005 0.414214 10.8995 2.75736 13.2426L12 22.4853C12 22.4853 17.1834 17.3166 20.5 14C21.8 12.7471 22.34 12 22.66 11C20 14 18.5 12 12.0147 5.5C11.5079 4.99201 11.2426 4.75736 11.2426 4.75736Z", - fill: "#FF7D95" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconHeart); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconHighlight.d.ts b/packages/semi-icons-lab/src/react/IconHighlight.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconHighlight.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconHighlight.js b/packages/semi-icons-lab/src/react/IconHighlight.js deleted file mode 100644 index 3a0a75a159..0000000000 --- a/packages/semi-icons-lab/src/react/IconHighlight.js +++ /dev/null @@ -1,30 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconHighlight(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 3, - y: 8, - width: 18, - height: 8, - rx: 1, - fill: "#FAC800" - }), /*#__PURE__*/React.createElement("path", { - d: "M4.44346 4.44341C4.2627 4.62417 4.16115 4.86934 4.16115 5.12498V8.18054C4.16115 8.43618 4.2627 8.68134 4.44346 8.86211C4.62423 9.04287 4.86939 9.14442 5.12503 9.14442C5.38067 9.14442 5.62584 9.04287 5.80661 8.86211C5.98737 8.68134 6.08892 8.43618 6.08892 8.18054V6.08887H11.0361V17.9111H8.94448C8.68884 17.9111 8.44367 18.0126 8.26291 18.1934C8.08214 18.3742 7.98059 18.6193 7.98059 18.875C7.98059 19.1306 8.08214 19.3758 8.26291 19.5566L8.40433 19.4151L8.26291 19.5566C8.44367 19.7373 8.68884 19.8389 8.94448 19.8389H15.0556C15.3112 19.8389 15.5564 19.7373 15.7372 19.5566C15.9179 19.3758 16.0195 19.1306 16.0195 18.875C16.0195 18.6193 15.9179 18.3742 15.7372 18.1934C15.5564 18.0126 15.3112 17.9111 15.0556 17.9111H12.9639V6.08887H17.9111V8.18054C17.9111 8.43617 18.0127 8.68134 18.1935 8.86211C18.3742 9.04287 18.6194 9.14442 18.875 9.14442C19.1307 9.14442 19.3758 9.04287 19.5566 8.86211C19.7374 8.68134 19.8389 8.43617 19.8389 8.18054V5.12498C19.8389 4.86934 19.7374 4.62417 19.5566 4.44341C19.3758 4.26264 19.1307 4.16109 18.875 4.16109H5.12503C4.86939 4.16109 4.62423 4.26264 4.44346 4.44341Z", - fill: "#6A6F7F", - stroke: "#6A6F7F", - strokeWidth: 0.4 - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconHighlight); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconImage.d.ts b/packages/semi-icons-lab/src/react/IconImage.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconImage.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconImage.js b/packages/semi-icons-lab/src/react/IconImage.js deleted file mode 100644 index 215bf8d206..0000000000 --- a/packages/semi-icons-lab/src/react/IconImage.js +++ /dev/null @@ -1,29 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconImage(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M4 4H11V11H4V4Z", - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M3 11H20V20H3V11Z", - fill: "#3BCE4A" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5 2C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V5C22 3.34315 20.6569 2 19 2H5ZM10 7.5C10 8.88071 8.88071 10 7.5 10C6.11929 10 5 8.88071 5 7.5C5 6.11929 6.11929 5 7.5 5C8.88071 5 10 6.11929 10 7.5ZM16.7071 11.7071C16.3166 11.3166 15.6834 11.3166 15.2929 11.7071L11 16L9.70711 14.7071C9.31658 14.3166 8.68342 14.3166 8.29289 14.7071L5 18V19H19V14L16.7071 11.7071Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconImage); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconInput.d.ts b/packages/semi-icons-lab/src/react/IconInput.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconInput.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconInput.js b/packages/semi-icons-lab/src/react/IconInput.js deleted file mode 100644 index b96ef9c07b..0000000000 --- a/packages/semi-icons-lab/src/react/IconInput.js +++ /dev/null @@ -1,93 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconInput(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M12 8.5C12 8.5 12.5 6 11 4C9.5 2 8 2 8 2", - stroke: "#AAB2BF", - strokeWidth: 2, - strokeLinecap: "round" - }), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 6, - width: 22, - height: 15, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 3, - y: 8, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 8, - y: 8, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 13, - y: 8, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 18, - y: 8, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 3, - y: 12, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 8, - y: 12, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 13, - y: 12, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 18, - y: 12, - width: 3, - height: 3, - rx: 1.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 17, - width: 12, - height: 2, - rx: 1, - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconInput); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconInputNumber.d.ts b/packages/semi-icons-lab/src/react/IconInputNumber.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconInputNumber.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconInputNumber.js b/packages/semi-icons-lab/src/react/IconInputNumber.js deleted file mode 100644 index 99b1fa2254..0000000000 --- a/packages/semi-icons-lab/src/react/IconInputNumber.js +++ /dev/null @@ -1,37 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconInputNumber(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 4, - width: 22, - height: 16, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M15 4H20C21.6569 4 23 5.34315 23 7V17C23 18.6569 21.6569 20 20 20H15V4Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M19 7.5L21 10.5H17L19 7.5Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M19 16.5L17 13.5H21L19 16.5Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M8.35791 15.7759C7.39307 15.7759 6.70752 15.1792 6.70752 14.354C6.70752 13.5225 7.39307 12.9194 8.35791 12.9194C9.31641 12.9194 10.0083 13.5225 10.0083 14.354C10.0083 15.1792 9.31641 15.7759 8.35791 15.7759ZM8.35791 11.7261C7.55811 11.7261 6.98682 11.1992 6.98682 10.4756C6.98682 9.7583 7.55811 9.24414 8.35791 9.24414C9.15771 9.24414 9.729 9.7583 9.729 10.4756C9.729 11.2056 9.15771 11.7261 8.35791 11.7261ZM8.33887 17.0137C10.3447 17.0137 11.7095 15.979 11.7095 14.4619C11.7095 13.3955 10.9795 12.5322 9.89404 12.3101V12.2148C10.8208 11.9292 11.3667 11.2056 11.3667 10.2915C11.3667 8.9458 10.1289 8 8.35791 8C6.58691 8 5.34912 8.9458 5.34912 10.2915C5.34912 11.2119 5.88867 11.9292 6.81543 12.2148V12.3101C5.72363 12.5322 5 13.3955 5 14.4683C5 15.9917 6.33936 17.0137 8.33887 17.0137Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconInputNumber); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconIntro.d.ts b/packages/semi-icons-lab/src/react/IconIntro.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconIntro.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconIntro.js b/packages/semi-icons-lab/src/react/IconIntro.js deleted file mode 100644 index 9d31c85541..0000000000 --- a/packages/semi-icons-lab/src/react/IconIntro.js +++ /dev/null @@ -1,24 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconIntro(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M3.12591 8.09927C2.41427 8.66858 2 9.53052 2 10.4419V19C2 20.6569 3.34315 22 5 22H9V16C9 14.3431 10.3431 13 12 13C13.6569 13 15 14.3431 15 16V22H19C20.6569 22 22 20.6569 22 19V10.4419C22 9.53052 21.5857 8.66858 20.8741 8.09927L13.2494 1.99951C12.519 1.41516 11.481 1.41516 10.7506 1.99951L3.12591 8.09927Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M9 15V22H15V15C15 13.3431 13.6569 12 12 12C10.3431 12 9 13.3431 9 15Z", - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconIntro); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconLayout.d.ts b/packages/semi-icons-lab/src/react/IconLayout.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconLayout.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconLayout.js b/packages/semi-icons-lab/src/react/IconLayout.js deleted file mode 100644 index f503e24bac..0000000000 --- a/packages/semi-icons-lab/src/react/IconLayout.js +++ /dev/null @@ -1,49 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconLayout(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 20, - height: 20, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 5, - width: 14, - height: 4, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 11, - width: 8, - height: 3, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 16, - width: 8, - height: 3, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 11, - width: 4, - height: 8, - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconLayout); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconList.d.ts b/packages/semi-icons-lab/src/react/IconList.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconList.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconList.js b/packages/semi-icons-lab/src/react/IconList.js deleted file mode 100644 index 494209b2fb..0000000000 --- a/packages/semi-icons-lab/src/react/IconList.js +++ /dev/null @@ -1,36 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconList(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2 4.00003C2 3.44775 2.44772 3.00003 3 3.00003H6V8.00003H3C2.44772 8.00003 2 7.55232 2 7.00003V4.00003Z", - fill: "#0077FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M8 3.00003H21C21.5523 3.00003 22 3.44775 22 4.00003V7.00003C22 7.55232 21.5523 8.00003 21 8.00003H8V3.00003Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M2 11C2 10.4477 2.44772 10 3 10H6V15H3C2.44772 15 2 14.5523 2 14V11Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M8 10H21C21.5523 10 22 10.4477 22 11V14C22 14.5523 21.5523 15 21 15H8V10Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M2 18C2 17.4477 2.44772 17 3 17H6V22H3C2.44772 22 2 21.5523 2 21V18Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M8 17H21C21.5523 17 22 17.4477 22 18V21C22 21.5523 21.5523 22 21 22H8V17Z", - fill: "#DDE3E8" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconList); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconLocaleProvider.d.ts b/packages/semi-icons-lab/src/react/IconLocaleProvider.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconLocaleProvider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconLocaleProvider.js b/packages/semi-icons-lab/src/react/IconLocaleProvider.js deleted file mode 100644 index 713fe37963..0000000000 --- a/packages/semi-icons-lab/src/react/IconLocaleProvider.js +++ /dev/null @@ -1,33 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconLocaleProvider(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 20, - height: 20, - rx: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M8.40092 4.14168C7.89573 4.43335 7.72264 5.07933 8.01431 5.58452L8.26474 6.01828H5.12664C4.50441 6.01828 4 6.49116 4 7.0745C4 7.65784 4.50441 8.13073 5.12664 8.13073L6.46453 8.13073C6.46453 9.85786 7.05673 11.4467 8.04915 12.7052C7.2723 13.1546 6.37034 13.4119 5.4083 13.4119C4.82496 13.4119 4.35207 13.8848 4.35207 14.4681C4.35207 15.0514 4.82496 15.5243 5.4083 15.5243C6.97917 15.5243 8.43562 15.0344 9.63321 14.1991C10.8308 15.0344 12.2872 15.5243 13.8581 15.5243C14.4415 15.5243 14.9143 15.0514 14.9143 14.4681C14.9143 13.8848 14.4415 13.4119 13.8581 13.4119C12.8961 13.4119 11.9941 13.1546 11.2173 12.7052C12.2097 11.4467 12.8019 9.85786 12.8019 8.13073L14.1398 8.13073C14.762 8.13073 15.2664 7.65784 15.2664 7.0745C15.2664 6.49116 14.762 6.01828 14.1398 6.01828H10.704L9.84375 4.52829C9.55208 4.0231 8.9061 3.85001 8.40092 4.14168ZM10.6894 8.13073H8.57698C8.57698 9.31986 8.96999 10.4172 9.63321 11.2999C10.2964 10.4172 10.6894 9.31986 10.6894 8.13073Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M13.0025 19C13.5829 19 13.8928 18.7078 14.1105 17.9545L14.46 16.8961H17.4872L17.8302 17.9545C18.0478 18.6883 18.3842 19 18.9646 19C19.5911 19 20 18.6364 20 18.0714C20 17.8442 19.9406 17.5844 19.8219 17.2208L17.8368 11.474C17.474 10.4156 16.9728 10 16.0231 10C15.0734 10 14.5589 10.4221 14.2028 11.474L12.211 17.2208C12.0594 17.6558 12 17.9026 12 18.1169C12 18.6364 12.4089 19 13.0025 19ZM14.9085 15.3442L15.9308 11.987H16.0363L17.0453 15.3442H14.9085Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconLocaleProvider); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconModal.d.ts b/packages/semi-icons-lab/src/react/IconModal.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconModal.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconModal.js b/packages/semi-icons-lab/src/react/IconModal.js deleted file mode 100644 index b53ff0c971..0000000000 --- a/packages/semi-icons-lab/src/react/IconModal.js +++ /dev/null @@ -1,46 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconModal(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 20, - height: 20, - rx: 3, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 4, - y: 6, - width: 16, - height: 12, - rx: 1, - fill: "white" - }), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 13, - width: 5, - height: 3, - rx: 1, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 13, - y: 13, - width: 5, - height: 3, - rx: 1, - fill: "#4CC3FA" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconModal); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconNavigation.d.ts b/packages/semi-icons-lab/src/react/IconNavigation.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconNavigation.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconNavigation.js b/packages/semi-icons-lab/src/react/IconNavigation.js deleted file mode 100644 index ca4219dee3..0000000000 --- a/packages/semi-icons-lab/src/react/IconNavigation.js +++ /dev/null @@ -1,35 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconNavigation(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3057)" - }, /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - transform: "rotate(-45 12 12)", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M4.95413 12.237L16.8183 6.92269L12.2377 19.089L10.5096 13.6288L4.95413 12.237Z", - fill: "#324350" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3057" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconNavigation); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconNotification.d.ts b/packages/semi-icons-lab/src/react/IconNotification.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconNotification.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconNotification.js b/packages/semi-icons-lab/src/react/IconNotification.js deleted file mode 100644 index 8b8b57eb8f..0000000000 --- a/packages/semi-icons-lab/src/react/IconNotification.js +++ /dev/null @@ -1,45 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconNotification(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3040)" - }, /*#__PURE__*/React.createElement("circle", { - cx: 13.0623, - cy: 19.0623, - r: 2.78627, - transform: "rotate(-6 13.0623 19.0623)", - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - d: "M11.1644 0.963222C10.1698 1.06775 9.22759 1.66954 9.33212 2.66406L9.40414 3.34932C6.9001 4.28223 5.74125 6.76612 6.03349 9.54657L6.34708 12.5301C6.62564 15.1805 5.19578 16.309 3.98171 17.8708C3.40154 18.6171 4.00123 19.8152 4.94133 19.7164L21.1505 18.0128C22.0906 17.914 22.428 16.6173 21.7054 16.0079C20.1932 14.7327 18.5599 13.9261 18.2813 11.2758L17.9678 8.29223C17.6755 5.51178 16.0255 3.32311 13.3822 2.9312L13.3102 2.24595C13.2057 1.25143 12.1589 0.858691 11.1644 0.963222Z", - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M18.4225 4.90871C18.1055 4.37727 17.58 3.92471 16.5455 3.39693C16.0536 3.14593 15.8583 2.54364 16.1093 2.05169C16.3603 1.55974 16.9625 1.36441 17.4545 1.61541C18.6397 2.22014 19.5461 2.88833 20.1401 3.88414C20.7233 4.86184 20.9283 6.02907 20.9988 7.45683C21.026 8.00844 20.601 8.4777 20.0494 8.50495C19.4977 8.5322 19.0285 8.10712 19.0012 7.55551C18.9355 6.22478 18.7503 5.45827 18.4225 4.90871Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M3.35465 12.6789C3.49632 12.005 3.46085 11.2839 3.21465 10.2268C3.08937 9.68896 3.42385 9.15136 3.96174 9.02608C4.49963 8.9008 5.03723 9.23528 5.16251 9.77317C5.44466 10.9846 5.53602 12.024 5.31188 13.0904C5.09077 14.1422 4.58176 15.1262 3.83488 16.259C3.53088 16.7201 2.91065 16.8474 2.44956 16.5434C1.98848 16.2394 1.86114 15.6192 2.16515 15.1581C2.8605 14.1034 3.20995 13.3674 3.35465 12.6789Z", - fill: "#DDE3E8" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3040" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconNotification); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPagination.d.ts b/packages/semi-icons-lab/src/react/IconPagination.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconPagination.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPagination.js b/packages/semi-icons-lab/src/react/IconPagination.js deleted file mode 100644 index 2197a6d4b6..0000000000 --- a/packages/semi-icons-lab/src/react/IconPagination.js +++ /dev/null @@ -1,36 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconPagination(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M1 8C1 6.34315 2.34315 5 4 5H12V19H4C2.34315 19 1 17.6569 1 16V8Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M8 9L5 12L8 15", - stroke: "white", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M12 5H20C21.6569 5 23 6.34315 23 8V16C23 17.6569 21.6569 19 20 19H12V5Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M16 9L19 12L16 15", - stroke: "#AAB2BF", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconPagination); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPopconfirm.d.ts b/packages/semi-icons-lab/src/react/IconPopconfirm.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconPopconfirm.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPopconfirm.js b/packages/semi-icons-lab/src/react/IconPopconfirm.js deleted file mode 100644 index 75c2f87aa7..0000000000 --- a/packages/semi-icons-lab/src/react/IconPopconfirm.js +++ /dev/null @@ -1,42 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconPopconfirm(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 8, - width: 17, - height: 14, - rx: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M8.46515 2.29217C8.23247 1.90171 7.66701 1.90171 7.43432 2.29217L5.82062 5H4C2.89543 5 2 5.89543 2 7V17C2 18.1046 2.89543 19 4 19H17C18.1046 19 19 18.1046 19 17V7C19 5.89543 18.1046 5 17 5H10.0789L8.46515 2.29217Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 7, - y: 13, - width: 4, - height: 3, - rx: 1, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 13, - y: 13, - width: 4, - height: 3, - rx: 1, - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconPopconfirm); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPopover.d.ts b/packages/semi-icons-lab/src/react/IconPopover.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconPopover.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconPopover.js b/packages/semi-icons-lab/src/react/IconPopover.js deleted file mode 100644 index 7873ae82e2..0000000000 --- a/packages/semi-icons-lab/src/react/IconPopover.js +++ /dev/null @@ -1,39 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconPopover(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 9, - y: 9, - width: 13, - height: 13, - rx: 2, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 7, - width: 12, - height: 12, - rx: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 8, - y: 2, - width: 11, - height: 11, - rx: 2, - fill: "#DDE3E8" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconPopover); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconProgress.d.ts b/packages/semi-icons-lab/src/react/IconProgress.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconProgress.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconProgress.js b/packages/semi-icons-lab/src/react/IconProgress.js deleted file mode 100644 index aa867ae21a..0000000000 --- a/packages/semi-icons-lab/src/react/IconProgress.js +++ /dev/null @@ -1,29 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconProgress(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 8, - stroke: "#3BCE4A", - strokeWidth: 6 - }), /*#__PURE__*/React.createElement("path", { - d: "M12.1378 4C16.48 4 20 7.58172 20 12C20 16.4183 16.48 20 12.1378 20C9.65493 20 7.44087 18.8289 6 17", - stroke: "#3BCE4A", - strokeWidth: 6, - strokeLinecap: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconProgress); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconRadio.d.ts b/packages/semi-icons-lab/src/react/IconRadio.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconRadio.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconRadio.js b/packages/semi-icons-lab/src/react/IconRadio.js deleted file mode 100644 index 18e5eb9896..0000000000 --- a/packages/semi-icons-lab/src/react/IconRadio.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconRadio(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 11, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 5, - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconRadio); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconRating.d.ts b/packages/semi-icons-lab/src/react/IconRating.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconRating.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconRating.js b/packages/semi-icons-lab/src/react/IconRating.js deleted file mode 100644 index 032d930996..0000000000 --- a/packages/semi-icons-lab/src/react/IconRating.js +++ /dev/null @@ -1,32 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconRating(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3049)" - }, /*#__PURE__*/React.createElement("path", { - d: "M7.92633 5.50269C8.1449 4.94209 8.8675 4.79102 9.29235 5.21711L12.9092 8.84444L18.04 9.10898C18.6461 9.14023 19.0164 9.78822 18.7357 10.3262L16.3729 14.8549L17.6749 19.73C17.8341 20.3259 17.313 20.8821 16.708 20.7621L11.6182 19.7524L7.35916 22.7165C6.85292 23.0688 6.15267 22.768 6.05977 22.1582L5.29971 17.1698L1.32061 13.967C0.847879 13.5865 0.927602 12.8444 1.47037 12.573L6.06555 10.2752L7.92633 5.50269Z", - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M19.9373 1.13616C20.1413 0.97521 20.4435 1.07701 20.5085 1.32861L21.0619 3.47049L22.9147 4.69129C23.1335 4.83549 23.1297 5.1578 22.9075 5.29675L21.0371 6.46633L20.4556 8.56653C20.3845 8.82324 20.0688 8.91638 19.8697 8.73936L18.1952 7.25006L15.9609 7.42226C15.6953 7.44273 15.5003 7.17753 15.5991 6.93015L16.4072 4.9063L15.626 2.84325C15.5332 2.59816 15.7252 2.33925 15.9867 2.3569L18.2005 2.50634L19.9373 1.13616Z", - fill: "#DDE3E8" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3049" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconRating); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconScrollList.d.ts b/packages/semi-icons-lab/src/react/IconScrollList.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconScrollList.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconScrollList.js b/packages/semi-icons-lab/src/react/IconScrollList.js deleted file mode 100644 index 4ca9f225b3..0000000000 --- a/packages/semi-icons-lab/src/react/IconScrollList.js +++ /dev/null @@ -1,52 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconScrollList(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2.75, - y: 2.75, - width: 18.5, - height: 18.5, - rx: 3, - fill: "white", - stroke: "#AAB2BF", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("path", { - d: "M16 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H16V2Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 3.5, - y: 7, - width: 12.5, - height: 5, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M3.5 17H16V20.5H5.5C4.39543 20.5 3.5 19.6046 3.5 18.5V17Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M18.9991 4L20.2981 6.25H17.7L18.9991 4Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M18.999 20.25L17.7 18H20.2981L18.999 20.25Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 18, - y: 8, - width: 2, - height: 6, - rx: 1, - fill: "#DDE3E8" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconScrollList); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSelect.d.ts b/packages/semi-icons-lab/src/react/IconSelect.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSelect.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSelect.js b/packages/semi-icons-lab/src/react/IconSelect.js deleted file mode 100644 index 386b26b035..0000000000 --- a/packages/semi-icons-lab/src/react/IconSelect.js +++ /dev/null @@ -1,55 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSelect(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3050)" - }, /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 16, - height: 5, - rx: 0.5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 17, - width: 16, - height: 5, - rx: 0.5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 9, - width: 16, - height: 6, - rx: 0.5, - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.5 10.7929C12.5 9.902 13.5771 9.45583 14.2071 10.0858L22.9142 18.7929C23.5442 19.4229 23.098 20.5 22.2071 20.5H18.2488C17.6797 20.5 17.1376 20.7424 16.7581 21.1666L14.2453 23.9756C13.6333 24.6598 12.5 24.2269 12.5 23.3089V10.7929ZM16.6837 19H21L14 12V22L16.6837 19Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M14 22V12L21 19H16.6837L14 22Z", - fill: "#324350" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3050" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSelect); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSideSheet.d.ts b/packages/semi-icons-lab/src/react/IconSideSheet.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSideSheet.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSideSheet.js b/packages/semi-icons-lab/src/react/IconSideSheet.js deleted file mode 100644 index 31fc2ce6ac..0000000000 --- a/packages/semi-icons-lab/src/react/IconSideSheet.js +++ /dev/null @@ -1,31 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSideSheet(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2 5C2 3.34315 3.34315 2 5 2H14V22H5C3.34315 22 2 20.6569 2 19V5Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M14 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H14V2Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 8, - width: 2, - height: 8, - rx: 1, - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSideSheet); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSkeleton.d.ts b/packages/semi-icons-lab/src/react/IconSkeleton.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSkeleton.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSkeleton.js b/packages/semi-icons-lab/src/react/IconSkeleton.js deleted file mode 100644 index 12ca3cae37..0000000000 --- a/packages/semi-icons-lab/src/react/IconSkeleton.js +++ /dev/null @@ -1,54 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSkeleton(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 11, - width: 21, - height: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 15, - width: 21, - height: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 2, - width: 12, - height: 3, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 11, - y: 6, - width: 9, - height: 3, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 19, - width: 11, - height: 3, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 7, - height: 7, - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSkeleton); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSlider.d.ts b/packages/semi-icons-lab/src/react/IconSlider.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSlider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSlider.js b/packages/semi-icons-lab/src/react/IconSlider.js deleted file mode 100644 index 586342fbe1..0000000000 --- a/packages/semi-icons-lab/src/react/IconSlider.js +++ /dev/null @@ -1,54 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSlider(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 4, - width: 17, - height: 2, - rx: 1, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 11, - width: 18, - height: 2, - rx: 1, - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("rect", { - x: 5, - y: 18, - width: 17, - height: 2, - rx: 1, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("circle", { - cx: 5.5, - cy: 5, - r: 3.5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("circle", { - cx: 18.5, - cy: 12, - r: 3.5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("circle", { - cx: 5.5, - cy: 19, - r: 3.5, - fill: "#DDE3E8" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSlider); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSpace.d.ts b/packages/semi-icons-lab/src/react/IconSpace.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSpace.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSpace.js b/packages/semi-icons-lab/src/react/IconSpace.js deleted file mode 100644 index fbf9890c4c..0000000000 --- a/packages/semi-icons-lab/src/react/IconSpace.js +++ /dev/null @@ -1,49 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSpace(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 2, - width: 2, - height: 20, - rx: 1, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 21, - y: 2, - width: 2, - height: 20, - rx: 1, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M6 12L18 12", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M15 9L18 12L15 15", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("path", { - d: "M9 9L6 12L9 15", - stroke: "#4CC3FA", - strokeWidth: 2, - strokeLinecap: "round", - strokeLinejoin: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSpace); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSpin.d.ts b/packages/semi-icons-lab/src/react/IconSpin.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSpin.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSpin.js b/packages/semi-icons-lab/src/react/IconSpin.js deleted file mode 100644 index 82e42f2422..0000000000 --- a/packages/semi-icons-lab/src/react/IconSpin.js +++ /dev/null @@ -1,36 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSpin(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M13.5 2.5C13.5 1.67157 12.8284 1 12 1C11.1716 1 10.5 1.67157 10.5 2.5V6.49999C10.5 7.32841 11.1716 7.99999 12 7.99999C12.8284 7.99999 13.5 7.32841 13.5 6.49999V2.5Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M13.5 17.5C13.5 16.6716 12.8284 16 12 16C11.1716 16 10.5 16.6716 10.5 17.5V21.5C10.5 22.3284 11.1716 23 12 23C12.8284 23 13.5 22.3284 13.5 21.5V17.5Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M4.52273 5.95097C3.80529 5.53675 2.88791 5.78256 2.47369 6.5C2.05948 7.21744 2.30529 8.13483 3.02273 8.54904L6.48682 10.549C7.20426 10.9632 8.12165 10.7174 8.53586 10C8.95007 9.28256 8.70426 8.36517 7.98682 7.95096L4.52273 5.95097Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M17.5131 13.451C16.7957 13.0368 15.8783 13.2826 15.4641 14C15.0499 14.7174 15.2957 15.6348 16.0131 16.049L19.4772 18.049C20.1947 18.4633 21.1121 18.2175 21.5263 17.5C21.9405 16.7826 21.6947 15.8652 20.9772 15.451L17.5131 13.451Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M3.02273 15.451C2.30529 15.8652 2.05948 16.7826 2.47369 17.5C2.88791 18.2174 3.80529 18.4633 4.52273 18.049L7.98682 16.049C8.70426 15.6348 8.95007 14.7174 8.53586 14C8.12165 13.2826 7.20426 13.0368 6.48682 13.451L3.02273 15.451Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M16.0131 7.95097C15.2957 8.36518 15.0499 9.28256 15.4641 10C15.8783 10.7174 16.7957 10.9633 17.5131 10.549L20.9772 8.54903C21.6947 8.13482 21.9405 7.21743 21.5263 6.5C21.1121 5.78256 20.1947 5.53674 19.4772 5.95096L16.0131 7.95097Z", - fill: "#FF7D95" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSpin); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSteps.d.ts b/packages/semi-icons-lab/src/react/IconSteps.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSteps.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSteps.js b/packages/semi-icons-lab/src/react/IconSteps.js deleted file mode 100644 index e66250d4a3..0000000000 --- a/packages/semi-icons-lab/src/react/IconSteps.js +++ /dev/null @@ -1,30 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSteps(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M14 10C14 9.44772 14.4477 9 15 9H20C20.5523 9 21 9.44772 21 10V21C21 21.5523 20.5523 22 20 22H3C2.44772 22 2 21.5523 2 21V18C2 17.4477 2.44772 17 3 17H7.5C7.77614 17 8 16.7761 8 16.5V14C8 13.4477 8.44772 13 9 13H13.5C13.7761 13 14 12.7761 14 12.5V10Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 16, - y: 5, - width: 2, - height: 4, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M23 5L16 2V8L23 5Z", - fill: "#F82C2C" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSteps); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSwitch.d.ts b/packages/semi-icons-lab/src/react/IconSwitch.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconSwitch.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconSwitch.js b/packages/semi-icons-lab/src/react/IconSwitch.js deleted file mode 100644 index b66d441aa6..0000000000 --- a/packages/semi-icons-lab/src/react/IconSwitch.js +++ /dev/null @@ -1,42 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconSwitch(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 1, - width: 20, - height: 10, - rx: 5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("circle", { - cx: 7.5, - cy: 5.99997, - r: 3.5, - fill: "white" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 13, - width: 20, - height: 10, - rx: 5, - fill: "#3BCE4A" - }), /*#__PURE__*/React.createElement("circle", { - cx: 16.5, - cy: 18, - r: 3.5, - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconSwitch); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTable.d.ts b/packages/semi-icons-lab/src/react/IconTable.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTable.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTable.js b/packages/semi-icons-lab/src/react/IconTable.js deleted file mode 100644 index 296abe94d6..0000000000 --- a/packages/semi-icons-lab/src/react/IconTable.js +++ /dev/null @@ -1,42 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTable(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2.00001 5.00003C2.00001 3.89546 2.89544 3.00003 4.00001 3.00003H11V8.00003H2.00001V5.00003Z", - fill: "#3BCE4A" - }), /*#__PURE__*/React.createElement("path", { - d: "M13 3.00003H20C21.1046 3.00003 22 3.89546 22 5.00003V8.00003H13V3.00003Z", - fill: "#3BCE4A" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 10, - width: 9, - height: 5, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 13, - y: 10, - width: 9, - height: 5, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M2.00001 17H11V22H4.00001C2.89544 22 2.00001 21.1046 2.00001 20V17Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M13 17H22V20C22 21.1046 21.1046 22 20 22H13V17Z", - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTable); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTabs.d.ts b/packages/semi-icons-lab/src/react/IconTabs.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTabs.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTabs.js b/packages/semi-icons-lab/src/react/IconTabs.js deleted file mode 100644 index 632a5498dd..0000000000 --- a/packages/semi-icons-lab/src/react/IconTabs.js +++ /dev/null @@ -1,36 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTabs(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M12 5.99997C12 4.8954 12.8954 3.99997 14 3.99997H19C20.1046 3.99997 21 4.8954 21 5.99997V11C21 12.1045 20.1046 13 19 13H14C12.8954 13 12 12.1045 12 11V5.99997Z", - fill: "#818A9B" - }), /*#__PURE__*/React.createElement("path", { - d: "M3.99999 1.99997C2.89542 1.99997 1.99999 2.8954 1.99999 3.99997L1.99999 20C1.99999 21.1045 2.89542 22 3.99999 22H20C21.1046 22 22 21.1045 22 20V9.99997C22 8.8954 21.1046 7.99997 20 7.99997H14C12.8954 7.99997 12 7.10454 12 5.99997V3.99997C12 2.8954 11.1046 1.99997 9.99999 1.99997L3.99999 1.99997Z", - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 12, - width: 12, - height: 2, - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 6, - y: 16, - width: 9, - height: 2, - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTabs); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTag.d.ts b/packages/semi-icons-lab/src/react/IconTag.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTag.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTag.js b/packages/semi-icons-lab/src/react/IconTag.js deleted file mode 100644 index 05cd1b7e15..0000000000 --- a/packages/semi-icons-lab/src/react/IconTag.js +++ /dev/null @@ -1,28 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTag(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M13.2427 3.34314C12.1819 3.34314 11.1644 3.76457 10.4143 4.51471L1.68637 13.2426C0.905324 14.0237 0.905324 15.29 1.68637 16.0711L7.34323 21.7279C8.12427 22.509 9.3906 22.509 10.1717 21.7279L18.8996 13C19.6497 12.2498 20.0711 11.2324 20.0711 10.1716V5.34314C20.0711 4.23857 19.1757 3.34314 18.0711 3.34314L13.2427 3.34314ZM13.0001 7.58578C12.219 8.36683 12.219 9.63316 13.0001 10.4142C13.7811 11.1953 15.0475 11.1953 15.8285 10.4142C16.6096 9.63316 16.6096 8.36683 15.8285 7.58578C15.0475 6.80473 13.7811 6.80473 13.0001 7.58578Z", - fill: "#F82C2C" - }), /*#__PURE__*/React.createElement("path", { - d: "M14.85 8.40001C16.05 6.90001 19.7 4.7 21.5 6.5C23.75 8.75 20 12.5 20 16C20 18.4739 22.15 19 22.85 19", - stroke: "#AAB2BF", - strokeWidth: 1.5, - strokeLinecap: "round" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTag); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTagInput.d.ts b/packages/semi-icons-lab/src/react/IconTagInput.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTagInput.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTagInput.js b/packages/semi-icons-lab/src/react/IconTagInput.js deleted file mode 100644 index 795a17c99f..0000000000 --- a/packages/semi-icons-lab/src/react/IconTagInput.js +++ /dev/null @@ -1,31 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTagInput(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 1, - y: 4, - width: 22, - height: 16, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M4.0918 16.4052C4.54883 16.4052 4.80273 16.1704 4.98047 15.5737L5.46289 14.101H8.50342L8.99219 15.5737C9.16357 16.164 9.43018 16.4052 9.89355 16.4052C10.3823 16.4052 10.7061 16.1133 10.7061 15.6562C10.7061 15.4785 10.6616 15.269 10.5728 14.9961L8.38916 8.73727C8.11621 7.92477 7.73535 7.5947 7.01807 7.5947C6.29443 7.5947 5.90723 7.93112 5.63428 8.73727L3.45068 14.9961C3.34277 15.3198 3.29834 15.5166 3.29834 15.688C3.29834 16.1196 3.62207 16.4052 4.0918 16.4052ZM5.84375 12.8252L6.94824 9.32126H7.03076L8.12891 12.8252H5.84375Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M20.1213 9.87865C19.7308 9.48812 19.0976 9.48812 18.7071 9.87865L18 10.5858L17.2929 9.87865C16.9024 9.48812 16.2692 9.48812 15.8787 9.87865C15.4882 10.2692 15.4882 10.9023 15.8787 11.2929L16.5858 12L15.8787 12.7071C15.4882 13.0976 15.4882 13.7308 15.8787 14.1213C16.2692 14.5118 16.9024 14.5118 17.2929 14.1213L18 13.4142L18.7071 14.1213C19.0976 14.5118 19.7308 14.5118 20.1213 14.1213C20.5118 13.7308 20.5118 13.0976 20.1213 12.7071L19.4142 12L20.1213 11.2929C20.5118 10.9023 20.5118 10.2692 20.1213 9.87865Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTagInput); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTimePicker.d.ts b/packages/semi-icons-lab/src/react/IconTimePicker.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTimePicker.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTimePicker.js b/packages/semi-icons-lab/src/react/IconTimePicker.js deleted file mode 100644 index 8bf6bed01a..0000000000 --- a/packages/semi-icons-lab/src/react/IconTimePicker.js +++ /dev/null @@ -1,45 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTimePicker(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 10.25, - fill: "white", - stroke: "#AAB2BF", - strokeWidth: 1.5 - }), /*#__PURE__*/React.createElement("path", { - d: "M14.5 6.5L12 12L17 17.5", - stroke: "#6A6F7F", - strokeWidth: 2.5, - strokeLinecap: "round", - strokeLinejoin: "round" - }), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 2, - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - d: "M13 11.625L12 12L5 15", - stroke: "#FBCD2C", - strokeLinecap: "round" - }), /*#__PURE__*/React.createElement("circle", { - cx: 12, - cy: 12, - r: 1, - fill: "#FBCD2C" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTimePicker); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconToast.d.ts b/packages/semi-icons-lab/src/react/IconToast.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconToast.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconToast.js b/packages/semi-icons-lab/src/react/IconToast.js deleted file mode 100644 index 53a80fbb3b..0000000000 --- a/packages/semi-icons-lab/src/react/IconToast.js +++ /dev/null @@ -1,49 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconToast(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("g", { - clipPath: "url(#clip0_1_3058)" - }, /*#__PURE__*/React.createElement("path", { - d: "M0.817818 4.5455C0.412129 5.00207 0.353969 5.92994 0.42002 6.55837L0.759737 9.79057C0.86798 10.8204 1.74149 11.5727 2.71077 11.4708L2.94477 11.4462L3.84633 20.024C4.04232 21.8887 5.14137 22.7787 7.13041 22.5697L18.0702 21.4198C21.0537 21.1063 21.9437 20.0072 21.7477 18.1425L20.8462 9.56472C21.8154 9.46285 22.7475 8.5208 22.6392 7.49094L22.2995 4.25874C22.2147 3.4518 21.8898 2.79537 21.2172 2.40144C19.8694 1.61209 16.2497 0.495504 10.9024 1.05752C5.34314 1.64183 1.72654 3.52281 0.817818 4.5455Z", - fill: "#FBCD2C" - }), /*#__PURE__*/React.createElement("circle", { - cx: 7.21108, - cy: 8.98682, - r: 1.5, - transform: "rotate(-6 7.21108 8.98682)", - fill: "#324350" - }), /*#__PURE__*/React.createElement("circle", { - cx: 16.1618, - cy: 8.04605, - r: 1.5, - transform: "rotate(-6 16.1618 8.04605)", - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - d: "M12.4704 15.9754C14.6674 15.7444 16.2613 13.7762 16.0304 11.5792C16.0304 11.5792 14.9836 11.1864 12 11.5C9.01643 11.8136 8.07418 12.4154 8.07418 12.4154C8.30509 14.6124 10.2733 16.2063 12.4704 15.9754Z", - fill: "#324350" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M14.6727 15.0199C14.0749 15.539 13.3175 15.8863 12.4704 15.9753C11.6232 16.0644 10.8101 15.8821 10.1175 15.4986C10.3199 14.4983 11.1508 13.7008 12.2195 13.5885C13.2882 13.4762 14.2667 14.0835 14.6727 15.0199Z", - fill: "#FF2969" - })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", { - id: "clip0_1_3058" - }, /*#__PURE__*/React.createElement("rect", { - width: 24, - height: 24, - fill: "white" - })))); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconToast); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTooltip.d.ts b/packages/semi-icons-lab/src/react/IconTooltip.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTooltip.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTooltip.js b/packages/semi-icons-lab/src/react/IconTooltip.js deleted file mode 100644 index cae4504238..0000000000 --- a/packages/semi-icons-lab/src/react/IconTooltip.js +++ /dev/null @@ -1,34 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTooltip(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M3.29164 3.86668C2.026 3.99971 1.10784 5.13355 1.24086 6.39919L2.44517 17.8574C2.57819 19.123 3.71203 20.0412 4.97767 19.9082L9.08038 19.477L12.5439 22.2817C12.7912 22.4819 13.1539 22.4438 13.3542 22.1966L16.1589 18.733L20.4463 18.2824C21.7119 18.1493 22.6301 17.0155 22.4971 15.7499L21.2927 4.29165C21.1597 3.02601 20.0259 2.10784 18.7602 2.24087L3.29164 3.86668Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M11.4608 8.56884C10.9071 8.62704 10.5067 9.13593 10.5666 9.70549C10.6265 10.275 10.2261 10.7839 9.6724 10.8421C9.11868 10.9003 8.62127 10.4858 8.56141 9.91624C8.38182 8.20757 9.58287 6.68088 11.244 6.50629C12.9052 6.33169 14.3974 7.57531 14.577 9.28398C14.6689 10.1589 14.3122 10.8684 13.9927 11.3353C13.8289 11.5746 13.6556 11.7783 13.5175 11.9341C13.4509 12.0092 13.401 12.0643 13.3618 12.1076C13.3042 12.1712 13.2698 12.2092 13.24 12.2471L12.6442 13.0044C12.295 13.4483 11.6598 13.5155 11.2259 13.1539C10.7921 12.7923 10.7234 12.1394 11.0727 11.6955L11.6688 10.9377C11.7427 10.8438 11.8536 10.721 11.9427 10.6223C11.9728 10.589 12.0004 10.5584 12.0233 10.5326C12.14 10.4009 12.2484 10.271 12.3409 10.1357C12.5339 9.85365 12.5882 9.65108 12.5718 9.49474C12.5119 8.92518 12.0145 8.51064 11.4608 8.56884Z", - fill: "white" - }), /*#__PURE__*/React.createElement("circle", { - cx: 12.0566, - cy: 15.1576, - r: 1.2, - transform: "rotate(-6 12.0566 15.1576)", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTooltip); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTransfer.d.ts b/packages/semi-icons-lab/src/react/IconTransfer.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTransfer.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTransfer.js b/packages/semi-icons-lab/src/react/IconTransfer.js deleted file mode 100644 index 29156a20b5..0000000000 --- a/packages/semi-icons-lab/src/react/IconTransfer.js +++ /dev/null @@ -1,27 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTransfer(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M7.07021 20.351L1.58652 15.9687C1.28595 15.7285 1.28595 15.2715 1.58652 15.0313L7.07021 10.649C7.39763 10.3874 7.88235 10.6205 7.88235 11.0396L7.88235 13.3L13.55 13.3C13.7985 13.3 14 13.5015 14 13.75L14 17.25C14 17.4985 13.7985 17.7 13.55 17.7L7.88235 17.7L7.88235 19.9604C7.88235 20.3795 7.39763 20.6126 7.07021 20.351Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M13.807 5.62764L21.3911 11.5264C21.6999 11.7666 21.6999 12.2334 21.3911 12.4736L13.807 18.3724C13.4785 18.6278 13 18.3938 13 17.9777L13 14.8L7.5 14.8C7.22386 14.8 7 14.5761 7 14.3L7 9.7C7 9.42386 7.22386 9.2 7.5 9.2L13 9.2L13 6.02232C13 5.60625 13.4785 5.3722 13.807 5.62764Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M14.807 4.62764L22.3911 10.5264C22.6999 10.7666 22.6999 11.2334 22.3911 11.4736L14.807 17.3724C14.4785 17.6278 14 17.3938 14 16.9777L14 13.8L8.5 13.8C8.22386 13.8 8 13.5761 8 13.3L8 8.7C8 8.42386 8.22386 8.2 8.5 8.2L14 8.2L14 5.02232C14 4.60625 14.4785 4.3722 14.807 4.62764Z", - fill: "#4CC3FA" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTransfer); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTree.d.ts b/packages/semi-icons-lab/src/react/IconTree.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTree.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTree.js b/packages/semi-icons-lab/src/react/IconTree.js deleted file mode 100644 index c3119439c7..0000000000 --- a/packages/semi-icons-lab/src/react/IconTree.js +++ /dev/null @@ -1,49 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTree(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 9, - y: 16, - width: 13, - height: 5, - rx: 0.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("rect", { - x: 9, - y: 9, - width: 13, - height: 5, - rx: 0.5, - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5 6C5.55228 6 6 6.44772 6 7V18H7C7.55228 18 8 18.4477 8 19C8 19.5523 7.55228 20 7 20H5C4.44772 20 4 19.5523 4 19V7C4 6.44772 4.44772 6 5 6Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M5 12C5 11.4477 5.44772 11 6 11H7C7.55228 11 8 11.4477 8 12C8 12.5523 7.55228 13 7 13H6C5.44772 13 5 12.5523 5 12Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 2, - width: 15, - height: 5, - rx: 0.5, - fill: "#4CC3FA" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTree); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTreeSelect.d.ts b/packages/semi-icons-lab/src/react/IconTreeSelect.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTreeSelect.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTreeSelect.js b/packages/semi-icons-lab/src/react/IconTreeSelect.js deleted file mode 100644 index c89de21cfa..0000000000 --- a/packages/semi-icons-lab/src/react/IconTreeSelect.js +++ /dev/null @@ -1,43 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTreeSelect(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("rect", { - x: 2, - y: 10, - width: 20, - height: 12, - rx: 2, - fill: "#DDE3E8" - }), /*#__PURE__*/React.createElement("path", { - d: "M8 13C8 12.4477 8.44772 12 9 12H19C19.5523 12 20 12.4477 20 13V14C20 14.5523 19.5523 15 19 15H9C8.44772 15 8 14.5523 8 14V13Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M4 13C4 12.4477 4.44772 12 5 12H6C6.55228 12 7 12.4477 7 13V14C7 14.5523 6.55228 15 6 15H5C4.44772 15 4 14.5523 4 14V13Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M10 18C10 17.4477 10.4477 17 11 17H19C19.5523 17 20 17.4477 20 18V19C20 19.5523 19.5523 20 19 20H11C10.4477 20 10 19.5523 10 19V18Z", - fill: "#AAB2BF" - }), /*#__PURE__*/React.createElement("path", { - d: "M2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V6C22 7.10457 21.1046 8 20 8H4C2.89543 8 2 7.10457 2 6V4Z", - fill: "#3BCE4A" - }), /*#__PURE__*/React.createElement("path", { - d: "M14 2H20C21.1046 2 22 2.89543 22 4V6C22 7.10457 21.1046 8 20 8H14V2Z", - fill: "#818A9B" - }), /*#__PURE__*/React.createElement("path", { - d: "M18.416 6.07597C18.2181 6.37284 17.7819 6.37284 17.584 6.07597L16.5182 4.47736C16.2967 4.14508 16.5349 3.70001 16.9343 3.70001L19.0657 3.70001C19.4651 3.70001 19.7033 4.14508 19.4818 4.47736L18.416 6.07597Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTreeSelect); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTypography.d.ts b/packages/semi-icons-lab/src/react/IconTypography.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconTypography.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconTypography.js b/packages/semi-icons-lab/src/react/IconTypography.js deleted file mode 100644 index d4866fd7c8..0000000000 --- a/packages/semi-icons-lab/src/react/IconTypography.js +++ /dev/null @@ -1,24 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconTypography(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M2.84766 19.1289C3.62109 19.1289 4.05078 18.7314 4.35156 17.7217L5.16797 15.2295H10.3135L11.1406 17.7217C11.4307 18.7207 11.8818 19.1289 12.666 19.1289C13.4932 19.1289 14.041 18.6348 14.041 17.8613C14.041 17.5605 13.9658 17.2061 13.8154 16.7441L10.1201 6.15234C9.6582 4.77734 9.01367 4.21875 7.7998 4.21875C6.5752 4.21875 5.91992 4.78809 5.45801 6.15234L1.7627 16.7441C1.58008 17.292 1.50488 17.625 1.50488 17.915C1.50488 18.6455 2.05273 19.1289 2.84766 19.1289ZM5.8125 13.0703L7.68164 7.14062H7.82129L9.67969 13.0703H5.8125Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M16.9307 15.9849C16.9307 15.1777 17.5244 14.6953 18.5264 14.6953H20.4189V15.7158C20.4189 16.6436 19.5933 17.3672 18.5356 17.3672C17.5801 17.3672 16.9307 16.8013 16.9307 15.9849ZM20.521 18.0273V17.7476V18.0908C20.5952 18.731 21.022 19.0928 21.6714 19.0928C22.4321 19.0928 22.8589 18.6196 22.8589 17.7847V12.4038C22.8589 10.2236 21.4116 8.99902 18.8325 8.99902C17.7563 8.99902 16.9307 9.18457 16.3091 9.50928C15.4463 9.94531 15.0474 10.5298 15.0474 11.105C15.0474 11.606 15.3813 11.9678 15.9194 11.9678C16.3184 11.9678 16.5781 11.8657 16.8564 11.6431C17.4038 11.1514 17.9326 10.873 18.6748 10.873C19.7974 10.873 20.4189 11.3926 20.4189 12.3853V13.1924H18.0811C15.8452 13.1924 14.5 14.3149 14.5 16.1333C14.5 17.9238 15.7988 19.1299 17.7192 19.1299C18.9253 19.1299 20.02 18.9087 20.521 18.0273Z", - fill: "#AAB2BF" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconTypography); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconUpload.d.ts b/packages/semi-icons-lab/src/react/IconUpload.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconUpload.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconUpload.js b/packages/semi-icons-lab/src/react/IconUpload.js deleted file mode 100644 index c4a7fc3f13..0000000000 --- a/packages/semi-icons-lab/src/react/IconUpload.js +++ /dev/null @@ -1,33 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconUpload(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M14 2L20 8V20C20 21.1046 19.1046 22 18 22H6C4.89543 22 4 21.1046 4 20V4C4 2.89543 4.89543 2 6 2H14Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M12.7071 9.29289C12.3166 8.90237 11.6834 8.90237 11.2929 9.29289L8.29289 12.2929C7.90237 12.6834 7.90237 13.3166 8.29289 13.7071C8.68342 14.0976 9.31658 14.0976 9.70711 13.7071L11 12.4142V17C11 17.5523 11.4477 18 12 18C12.5523 18 13 17.5523 13 17V12.4142L14.2929 13.7071C14.6834 14.0976 15.3166 14.0976 15.7071 13.7071C16.0976 13.3166 16.0976 12.6834 15.7071 12.2929L12.7071 9.29289Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - fillRule: "evenodd", - clipRule: "evenodd", - d: "M20 8L14 2V6C14 7.10457 14.8954 8 16 8L20 8Z", - fill: "#324350" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconUpload); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconVersionTwo.d.ts b/packages/semi-icons-lab/src/react/IconVersionTwo.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconVersionTwo.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconVersionTwo.js b/packages/semi-icons-lab/src/react/IconVersionTwo.js deleted file mode 100644 index 518e932cac..0000000000 --- a/packages/semi-icons-lab/src/react/IconVersionTwo.js +++ /dev/null @@ -1,30 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconVersionTwo(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M19 2H5C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V5C22 3.34315 20.6569 2 19 2Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M4.05114 16.8466H10.0341V15.5256H6.23295V15.4659L7.73722 13.9361C9.43324 12.3082 9.90199 11.5156 9.90199 10.5312C9.90199 9.0696 8.71307 8 6.95739 8C5.22727 8 4 9.07386 4 10.7315H5.50426C5.50426 9.84091 6.06676 9.28267 6.93608 9.28267C7.76705 9.28267 8.38494 9.78977 8.38494 10.6122C8.38494 11.3409 7.94176 11.8608 7.08097 12.7344L4.05114 15.7045V16.8466Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M11.9916 16.9403C12.4944 16.9403 12.9248 16.5227 12.9291 16.0028C12.9248 15.4915 12.4944 15.0739 11.9916 15.0739C11.4717 15.0739 11.0498 15.4915 11.0541 16.0028C11.0498 16.5227 11.4717 16.9403 11.9916 16.9403Z", - fill: "white" - }), /*#__PURE__*/React.createElement("path", { - d: "M16.9107 17.0128C19.0159 17.017 20.273 15.3551 20.273 12.4915C20.273 9.64489 19.0073 8 16.9107 8C14.8141 8 13.5528 9.64062 13.5485 12.4915C13.5485 15.3509 14.8056 17.0128 16.9107 17.0128ZM16.9107 15.679C15.8241 15.679 15.1423 14.5881 15.1465 12.4915C15.1508 10.4119 15.8284 9.31676 16.9107 9.31676C17.9974 9.31676 18.6749 10.4119 18.6792 12.4915C18.6792 14.5881 18.0016 15.679 16.9107 15.679Z", - fill: "white" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconVersionTwo); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconWheelChair.d.ts b/packages/semi-icons-lab/src/react/IconWheelChair.d.ts deleted file mode 100644 index c87806b874..0000000000 --- a/packages/semi-icons-lab/src/react/IconWheelChair.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as React from "react"; - -declare const Component: React.ForwardRefExoticComponent>; - -export default Component; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/IconWheelChair.js b/packages/semi-icons-lab/src/react/IconWheelChair.js deleted file mode 100644 index d71aa04d7e..0000000000 --- a/packages/semi-icons-lab/src/react/IconWheelChair.js +++ /dev/null @@ -1,27 +0,0 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -import * as React from "react"; - -function IconWheelChair(props, svgRef) { - return /*#__PURE__*/React.createElement("svg", _extends({ - viewBox: "0 0 24 24", - fill: "none", - xmlns: "http://www.w3.org/2000/svg", - width: "1em", - height: "1em", - focusable: false, - ref: svgRef - }, props), /*#__PURE__*/React.createElement("path", { - d: "M6.9425 8.65613C6.91241 8.54178 6.79002 8.47819 6.68046 8.52266C3.9356 9.63702 2 12.3298 2 15.4746C2 19.6168 5.35786 22.9746 9.5 22.9746C13.2245 22.9746 16.315 20.2597 16.9003 16.7009C16.9199 16.5815 16.8264 16.4746 16.7055 16.4746H14.0482C13.9548 16.4746 13.8743 16.5395 13.8504 16.6298C13.3404 18.5554 11.5859 19.9746 9.5 19.9746C7.01472 19.9746 5 17.9599 5 15.4746C5 13.7065 6.0197 12.1766 7.50311 11.4409C7.59068 11.3974 7.63804 11.2992 7.61316 11.2046L6.9425 8.65613Z", - fill: "#4CC3FA" - }), /*#__PURE__*/React.createElement("path", { - d: "M13 3C13 4.10457 12.1046 5 11 5C9.89543 5 9 4.10457 9 3C9 1.89543 9.89543 1 11 1C12.1046 1 13 1.89543 13 3Z", - fill: "#6A6F7F" - }), /*#__PURE__*/React.createElement("path", { - d: "M9.7068 13.7916C9.94218 14.712 10.781 15.3184 11.692 15.296C11.7343 15.2986 11.777 15.3 11.82 15.3H17.6037C17.6969 15.3 17.7777 15.3644 17.7986 15.4553L19.1839 21.4917C19.4001 22.4338 20.339 23.0222 21.281 22.806C22.223 22.5898 22.8114 21.6509 22.5952 20.7089L20.7662 12.7389C20.63 12.1452 20.2066 11.692 19.6764 11.4921C19.4168 11.3689 19.1264 11.3 18.82 11.3H13.3536C13.2623 11.3 13.1825 11.2381 13.1599 11.1495L12.9297 10.2496C12.8974 10.1231 12.9929 10 13.1235 10H16.75C17.4404 10 18 9.44036 18 8.75C18 8.05964 17.4404 7.5 16.75 7.5H12.25C12.2422 7.5 12.2344 7.50007 12.2266 7.50021L12.0955 6.98763C11.8219 5.9175 10.7325 5.27184 9.66236 5.54551C8.59223 5.81918 7.94657 6.90854 8.22024 7.97867L9.7068 13.7916Z", - fill: "#6A6F7F" - })); -} - -const ForwardRef = /*#__PURE__*/React.forwardRef(IconWheelChair); -export default ForwardRef; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/index.d.ts b/packages/semi-icons-lab/src/react/index.d.ts deleted file mode 100644 index ef4cb020e6..0000000000 --- a/packages/semi-icons-lab/src/react/index.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -export { default as IconTagInput } from './IconTagInput'; -export { default as IconHeart } from './IconHeart'; -export { default as IconRadio } from './IconRadio'; -export { default as IconPopconfirm } from './IconPopconfirm'; -export { default as IconPagination } from './IconPagination'; -export { default as IconSpace } from './IconSpace'; -export { default as IconDescriptions } from './IconDescriptions'; -export { default as IconList } from './IconList'; -export { default as IconUpload } from './IconUpload'; -export { default as IconForm } from './IconForm'; -export { default as IconBackTop } from './IconBackTop'; -export { default as IconSelect } from './IconSelect'; -export { default as IconSkeleton } from './IconSkeleton'; -export { default as IconRating } from './IconRating'; -export { default as IconCard } from './IconCard'; -export { default as IconLocaleProvider } from './IconLocaleProvider'; -export { default as IconVersionTwo } from './IconVersionTwo'; -export { default as IconTreeSelect } from './IconTreeSelect'; -export { default as IconInput } from './IconInput'; -export { default as IconCheckbox } from './IconCheckbox'; -export { default as IconProgress } from './IconProgress'; -export { default as IconBadgeStar } from './IconBadgeStar'; -export { default as IconNavigation } from './IconNavigation'; -export { default as IconTooltip } from './IconTooltip'; -export { default as IconAccessibility } from './IconAccessibility'; -export { default as IconSpin } from './IconSpin'; -export { default as IconWheelChair } from './IconWheelChair'; -export { default as IconBadge } from './IconBadge'; -export { default as IconCascader } from './IconCascader'; -export { default as IconDarkMode } from './IconDarkMode'; -export { default as IconAnchor } from './IconAnchor'; -export { default as IconCollapse } from './IconCollapse'; -export { default as IconImage } from './IconImage'; -export { default as IconTable } from './IconTable'; -export { default as IconPopover } from './IconPopover'; -export { default as IconTypography } from './IconTypography'; -export { default as IconSteps } from './IconSteps'; -export { default as IconBreadcrumb } from './IconBreadcrumb'; -export { default as IconHighlight } from './IconHighlight'; -export { default as IconDropdown } from './IconDropdown'; -export { default as IconTag } from './IconTag'; -export { default as IconTree } from './IconTree'; -export { default as IconSwitch } from './IconSwitch'; -export { default as IconGrid } from './IconGrid'; -export { default as IconCalendar } from './IconCalendar'; -export { default as IconSlider } from './IconSlider'; -export { default as IconLayout } from './IconLayout'; -export { default as IconNotification } from './IconNotification'; -export { default as IconChangelog } from './IconChangelog'; -export { default as IconToast } from './IconToast'; -export { default as IconDivider } from './IconDivider'; -export { default as IconButton } from './IconButton'; -export { default as IconModal } from './IconModal'; -export { default as IconTimePicker } from './IconTimePicker'; -export { default as IconScrollList } from './IconScrollList'; -export { default as IconInputNumber } from './IconInputNumber'; -export { default as IconTabs } from './IconTabs'; -export { default as IconIntro } from './IconIntro'; -export { default as IconAutocomplete } from './IconAutocomplete'; -export { default as IconCollapsible } from './IconCollapsible'; -export { default as IconGettingStarted } from './IconGettingStarted'; -export { default as IconDatePicker } from './IconDatePicker'; -export { default as IconSideSheet } from './IconSideSheet'; -export { default as IconTransfer } from './IconTransfer'; -export { default as IconBanner } from './IconBanner'; -export { default as IconFaq } from './IconFaq'; -export { default as IconAvatar } from './IconAvatar'; -export { default as IconColorPlatteNew } from './IconColorPlatteNew'; -export { default as IconColorPlatte } from './IconColorPlatte'; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/react/index.js b/packages/semi-icons-lab/src/react/index.js deleted file mode 100644 index ef4cb020e6..0000000000 --- a/packages/semi-icons-lab/src/react/index.js +++ /dev/null @@ -1,69 +0,0 @@ -export { default as IconTagInput } from './IconTagInput'; -export { default as IconHeart } from './IconHeart'; -export { default as IconRadio } from './IconRadio'; -export { default as IconPopconfirm } from './IconPopconfirm'; -export { default as IconPagination } from './IconPagination'; -export { default as IconSpace } from './IconSpace'; -export { default as IconDescriptions } from './IconDescriptions'; -export { default as IconList } from './IconList'; -export { default as IconUpload } from './IconUpload'; -export { default as IconForm } from './IconForm'; -export { default as IconBackTop } from './IconBackTop'; -export { default as IconSelect } from './IconSelect'; -export { default as IconSkeleton } from './IconSkeleton'; -export { default as IconRating } from './IconRating'; -export { default as IconCard } from './IconCard'; -export { default as IconLocaleProvider } from './IconLocaleProvider'; -export { default as IconVersionTwo } from './IconVersionTwo'; -export { default as IconTreeSelect } from './IconTreeSelect'; -export { default as IconInput } from './IconInput'; -export { default as IconCheckbox } from './IconCheckbox'; -export { default as IconProgress } from './IconProgress'; -export { default as IconBadgeStar } from './IconBadgeStar'; -export { default as IconNavigation } from './IconNavigation'; -export { default as IconTooltip } from './IconTooltip'; -export { default as IconAccessibility } from './IconAccessibility'; -export { default as IconSpin } from './IconSpin'; -export { default as IconWheelChair } from './IconWheelChair'; -export { default as IconBadge } from './IconBadge'; -export { default as IconCascader } from './IconCascader'; -export { default as IconDarkMode } from './IconDarkMode'; -export { default as IconAnchor } from './IconAnchor'; -export { default as IconCollapse } from './IconCollapse'; -export { default as IconImage } from './IconImage'; -export { default as IconTable } from './IconTable'; -export { default as IconPopover } from './IconPopover'; -export { default as IconTypography } from './IconTypography'; -export { default as IconSteps } from './IconSteps'; -export { default as IconBreadcrumb } from './IconBreadcrumb'; -export { default as IconHighlight } from './IconHighlight'; -export { default as IconDropdown } from './IconDropdown'; -export { default as IconTag } from './IconTag'; -export { default as IconTree } from './IconTree'; -export { default as IconSwitch } from './IconSwitch'; -export { default as IconGrid } from './IconGrid'; -export { default as IconCalendar } from './IconCalendar'; -export { default as IconSlider } from './IconSlider'; -export { default as IconLayout } from './IconLayout'; -export { default as IconNotification } from './IconNotification'; -export { default as IconChangelog } from './IconChangelog'; -export { default as IconToast } from './IconToast'; -export { default as IconDivider } from './IconDivider'; -export { default as IconButton } from './IconButton'; -export { default as IconModal } from './IconModal'; -export { default as IconTimePicker } from './IconTimePicker'; -export { default as IconScrollList } from './IconScrollList'; -export { default as IconInputNumber } from './IconInputNumber'; -export { default as IconTabs } from './IconTabs'; -export { default as IconIntro } from './IconIntro'; -export { default as IconAutocomplete } from './IconAutocomplete'; -export { default as IconCollapsible } from './IconCollapsible'; -export { default as IconGettingStarted } from './IconGettingStarted'; -export { default as IconDatePicker } from './IconDatePicker'; -export { default as IconSideSheet } from './IconSideSheet'; -export { default as IconTransfer } from './IconTransfer'; -export { default as IconBanner } from './IconBanner'; -export { default as IconFaq } from './IconFaq'; -export { default as IconAvatar } from './IconAvatar'; -export { default as IconColorPlatteNew } from './IconColorPlatteNew'; -export { default as IconColorPlatte } from './IconColorPlatte'; \ No newline at end of file diff --git a/packages/semi-icons-lab/src/svgs/chart.svg b/packages/semi-icons-lab/src/svgs/chart.svg new file mode 100644 index 0000000000..f18b1f5867 --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/chart.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/packages/semi-icons-lab/src/svgs/chat.svg b/packages/semi-icons-lab/src/svgs/chat.svg new file mode 100644 index 0000000000..9f93faaeec --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/chat.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/code-highlight.svg b/packages/semi-icons-lab/src/svgs/code-highlight.svg new file mode 100644 index 0000000000..b8665b2fad --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/code-highlight.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/json-viewer.svg b/packages/semi-icons-lab/src/svgs/json-viewer.svg new file mode 100644 index 0000000000..acda2cb650 --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/json-viewer.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/lottie.svg b/packages/semi-icons-lab/src/svgs/lottie.svg new file mode 100644 index 0000000000..fe1bfb53ec --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/lottie.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/markdown.svg b/packages/semi-icons-lab/src/svgs/markdown.svg new file mode 100644 index 0000000000..d50acb6584 --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/markdown.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/meta.json b/packages/semi-icons-lab/src/svgs/meta.json index b80a0f7984..6d72ea6a59 100644 --- a/packages/semi-icons-lab/src/svgs/meta.json +++ b/packages/semi-icons-lab/src/svgs/meta.json @@ -12,12 +12,12 @@ { "name": "calendar", "category": "Common" }, { "name": "card", "category": "Common" }, { "name": "cascader", "category": "Common" }, - { - "name": "carousel", - "category": "Common" - }, + { "name": "carousel", "category": "Common" }, { "name": "changelog", "category": "Common" }, + { "name": "chart", "category": "Common" }, + { "name": "chat", "category": "Common" }, { "name": "checkbox", "category": "Common" }, + { "name": "code-highlight", "category": "Common" }, { "name": "collapse", "category": "Common" }, { "name": "collapsible", "category": "Common" }, { "name": "color-platte-new", "category": "Common" }, @@ -45,18 +45,21 @@ { "name": "input-number", "category": "Common" }, { "name": "input", "category": "Common" }, { "name": "intro", "category": "Common" }, + { + "name": "json-viewer", + "category": "Common" + }, { "name": "layout", "category": "Common" }, { "name": "list", "category": "Common" }, { "name": "locale-provider", "category": "Common" }, + { "name": "lottie", "category": "Common" }, + { "name": "markdown", "category": "Common" }, { "name": "modal", "category": "Common" }, { "name": "navigation", "category": "Common" }, { "name": "notification", "category": "Common" }, - { "name": "overflow", "category": "Common" }, - { - "name": "pagination", - "category": "Common" - }, + { "name": "pagination", "category": "Common" }, + { "name": "pincode", "category": "Common" }, { "name": "popconfirm", "category": "Common" }, { "name": "popover", "category": "Common" }, { "name": "progress", "category": "Common" }, @@ -91,6 +94,7 @@ { "name": "tree", "category": "Common" }, { "name": "typography", "category": "Common" }, { "name": "upload", "category": "Common" }, + { "name": "version-one", "category": "Common" }, { "name": "version-two", "category": "Common" }, { "name": "wheel-chair", "category": "Common" } ] diff --git a/packages/semi-icons-lab/src/svgs/pincode.svg b/packages/semi-icons-lab/src/svgs/pincode.svg new file mode 100644 index 0000000000..b533e4e71f --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/pincode.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/semi-icons-lab/src/svgs/version-one.svg b/packages/semi-icons-lab/src/svgs/version-one.svg new file mode 100644 index 0000000000..9f03d99699 --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/version-one.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/semi-icons-lab/src/svgs/webcomponents.svg b/packages/semi-icons-lab/src/svgs/webcomponents.svg new file mode 100644 index 0000000000..197c628c45 --- /dev/null +++ b/packages/semi-icons-lab/src/svgs/webcomponents.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/semi-icons/package.json b/packages/semi-icons/package.json index 520d790f9e..92148ac260 100644 --- a/packages/semi-icons/package.json +++ b/packages/semi-icons/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-icons", - "version": "2.70.2", + "version": "2.71.1", "description": "semi icons", "keywords": [ "semi", diff --git a/packages/semi-icons/scripts/build-icon.js b/packages/semi-icons/scripts/build-icon.js index 86de831e3d..8cd1fa4599 100644 --- a/packages/semi-icons/scripts/build-icon.js +++ b/packages/semi-icons/scripts/build-icon.js @@ -34,6 +34,12 @@ const svgoPlugins = [ name: 'convertColors', params: { currentColor: /^(?!url|none)./ }, }, + { + name: 'convertPathData', + params: { + floatPrecision: 2 + } + }, { name: 'cleanupListOfValues', active: true, diff --git a/packages/semi-icons/src/icons/IconAbsoluteStroked.tsx b/packages/semi-icons/src/icons/IconAbsoluteStroked.tsx index 2d9002e8ed..52f5307720 100644 --- a/packages/semi-icons/src/icons/IconAbsoluteStroked.tsx +++ b/packages/semi-icons/src/icons/IconAbsoluteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'absolute_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconActivity.tsx b/packages/semi-icons/src/icons/IconActivity.tsx index e2a78e4387..68b81b0e04 100644 --- a/packages/semi-icons/src/icons/IconActivity.tsx +++ b/packages/semi-icons/src/icons/IconActivity.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'activity'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlarm.tsx b/packages/semi-icons/src/icons/IconAlarm.tsx index fd2ec32151..cd701ef6dd 100644 --- a/packages/semi-icons/src/icons/IconAlarm.tsx +++ b/packages/semi-icons/src/icons/IconAlarm.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'alarm'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlertCircle.tsx b/packages/semi-icons/src/icons/IconAlertCircle.tsx index 3921a054e2..2edb29873c 100644 --- a/packages/semi-icons/src/icons/IconAlertCircle.tsx +++ b/packages/semi-icons/src/icons/IconAlertCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'alert_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlertTriangle.tsx b/packages/semi-icons/src/icons/IconAlertTriangle.tsx index c3d31d44a3..a772efa238 100644 --- a/packages/semi-icons/src/icons/IconAlertTriangle.tsx +++ b/packages/semi-icons/src/icons/IconAlertTriangle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'alert_triangle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignBottom.tsx b/packages/semi-icons/src/icons/IconAlignBottom.tsx index 6a99252655..fe406e5452 100644 --- a/packages/semi-icons/src/icons/IconAlignBottom.tsx +++ b/packages/semi-icons/src/icons/IconAlignBottom.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_bottom'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignCenter.tsx b/packages/semi-icons/src/icons/IconAlignCenter.tsx index ce3c524ca9..ac3456b53b 100644 --- a/packages/semi-icons/src/icons/IconAlignCenter.tsx +++ b/packages/semi-icons/src/icons/IconAlignCenter.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_center'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignCenterVertical.tsx b/packages/semi-icons/src/icons/IconAlignCenterVertical.tsx index 0f91e5ac8d..a2389e52c8 100644 --- a/packages/semi-icons/src/icons/IconAlignCenterVertical.tsx +++ b/packages/semi-icons/src/icons/IconAlignCenterVertical.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_center_vertical'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignHCenterStroked.tsx b/packages/semi-icons/src/icons/IconAlignHCenterStroked.tsx index a84f578483..4a184a911a 100644 --- a/packages/semi-icons/src/icons/IconAlignHCenterStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignHCenterStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_h_center_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignHLeftStroked.tsx b/packages/semi-icons/src/icons/IconAlignHLeftStroked.tsx index 6986f36c67..148ff62e59 100644 --- a/packages/semi-icons/src/icons/IconAlignHLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignHLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_h_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignHRightStroked.tsx b/packages/semi-icons/src/icons/IconAlignHRightStroked.tsx index 04bceaa33d..2d477691eb 100644 --- a/packages/semi-icons/src/icons/IconAlignHRightStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignHRightStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_h_right_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignJustify.tsx b/packages/semi-icons/src/icons/IconAlignJustify.tsx index bcbb8234bb..8a5a6dad44 100644 --- a/packages/semi-icons/src/icons/IconAlignJustify.tsx +++ b/packages/semi-icons/src/icons/IconAlignJustify.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_justify'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignLeft.tsx b/packages/semi-icons/src/icons/IconAlignLeft.tsx index 4ef6b0b376..71f95c8a51 100644 --- a/packages/semi-icons/src/icons/IconAlignLeft.tsx +++ b/packages/semi-icons/src/icons/IconAlignLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignRight.tsx b/packages/semi-icons/src/icons/IconAlignRight.tsx index df40008b29..3faea6a180 100644 --- a/packages/semi-icons/src/icons/IconAlignRight.tsx +++ b/packages/semi-icons/src/icons/IconAlignRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignTop.tsx b/packages/semi-icons/src/icons/IconAlignTop.tsx index ba46d94e42..d4dc3f7a4d 100644 --- a/packages/semi-icons/src/icons/IconAlignTop.tsx +++ b/packages/semi-icons/src/icons/IconAlignTop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_top'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignVBotStroked.tsx b/packages/semi-icons/src/icons/IconAlignVBotStroked.tsx index 7768b03f2d..b5ff0c0c15 100644 --- a/packages/semi-icons/src/icons/IconAlignVBotStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignVBotStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_v_bot_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignVBottomStroked.tsx b/packages/semi-icons/src/icons/IconAlignVBottomStroked.tsx index 65e8f8f41e..062f56fade 100644 --- a/packages/semi-icons/src/icons/IconAlignVBottomStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignVBottomStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_v_bottom_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignVCenterStroked.tsx b/packages/semi-icons/src/icons/IconAlignVCenterStroked.tsx index 172991da1e..56d347f433 100644 --- a/packages/semi-icons/src/icons/IconAlignVCenterStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignVCenterStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_v_center_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAlignVTopStroked.tsx b/packages/semi-icons/src/icons/IconAlignVTopStroked.tsx index 98fe14d282..d9ec5d8869 100644 --- a/packages/semi-icons/src/icons/IconAlignVTopStroked.tsx +++ b/packages/semi-icons/src/icons/IconAlignVTopStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'align_v_top_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconApartment.tsx b/packages/semi-icons/src/icons/IconApartment.tsx index 1ca02424a7..845fe833ee 100644 --- a/packages/semi-icons/src/icons/IconApartment.tsx +++ b/packages/semi-icons/src/icons/IconApartment.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'apartment'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAppCenter.tsx b/packages/semi-icons/src/icons/IconAppCenter.tsx index e6b6ef7ce4..c8523a5b08 100644 --- a/packages/semi-icons/src/icons/IconAppCenter.tsx +++ b/packages/semi-icons/src/icons/IconAppCenter.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'app_center'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconApps.tsx b/packages/semi-icons/src/icons/IconApps.tsx index 39eb86e058..d05963041b 100644 --- a/packages/semi-icons/src/icons/IconApps.tsx +++ b/packages/semi-icons/src/icons/IconApps.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + + + + + - - - - - - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'apps'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArchive.tsx b/packages/semi-icons/src/icons/IconArchive.tsx index 9057a714a3..360ecca4ed 100644 --- a/packages/semi-icons/src/icons/IconArchive.tsx +++ b/packages/semi-icons/src/icons/IconArchive.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'archive'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowDown.tsx b/packages/semi-icons/src/icons/IconArrowDown.tsx index af6b2a0caa..958b0462ad 100644 --- a/packages/semi-icons/src/icons/IconArrowDown.tsx +++ b/packages/semi-icons/src/icons/IconArrowDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowDownLeft.tsx b/packages/semi-icons/src/icons/IconArrowDownLeft.tsx index b5f6f68b94..a283fe6b29 100644 --- a/packages/semi-icons/src/icons/IconArrowDownLeft.tsx +++ b/packages/semi-icons/src/icons/IconArrowDownLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_down_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowDownRight.tsx b/packages/semi-icons/src/icons/IconArrowDownRight.tsx index 4c285aef6c..6548403a6a 100644 --- a/packages/semi-icons/src/icons/IconArrowDownRight.tsx +++ b/packages/semi-icons/src/icons/IconArrowDownRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_down_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowLeft.tsx b/packages/semi-icons/src/icons/IconArrowLeft.tsx index 1305e5ed4f..e232dd6d34 100644 --- a/packages/semi-icons/src/icons/IconArrowLeft.tsx +++ b/packages/semi-icons/src/icons/IconArrowLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowRight.tsx b/packages/semi-icons/src/icons/IconArrowRight.tsx index 06e69e8ab6..6a52ed8fb7 100644 --- a/packages/semi-icons/src/icons/IconArrowRight.tsx +++ b/packages/semi-icons/src/icons/IconArrowRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowUp.tsx b/packages/semi-icons/src/icons/IconArrowUp.tsx index c6de7f646a..a16bc3c059 100644 --- a/packages/semi-icons/src/icons/IconArrowUp.tsx +++ b/packages/semi-icons/src/icons/IconArrowUp.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_up'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowUpLeft.tsx b/packages/semi-icons/src/icons/IconArrowUpLeft.tsx index c48e5bd593..00eb41908f 100644 --- a/packages/semi-icons/src/icons/IconArrowUpLeft.tsx +++ b/packages/semi-icons/src/icons/IconArrowUpLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_up_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArrowUpRight.tsx b/packages/semi-icons/src/icons/IconArrowUpRight.tsx index 7919011357..1f145744c8 100644 --- a/packages/semi-icons/src/icons/IconArrowUpRight.tsx +++ b/packages/semi-icons/src/icons/IconArrowUpRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'arrow_up_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconArticle.tsx b/packages/semi-icons/src/icons/IconArticle.tsx index 441007fb23..4d6a3e6a03 100644 --- a/packages/semi-icons/src/icons/IconArticle.tsx +++ b/packages/semi-icons/src/icons/IconArticle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'article'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAscend.tsx b/packages/semi-icons/src/icons/IconAscend.tsx index daf2a5ea70..60558a3196 100644 --- a/packages/semi-icons/src/icons/IconAscend.tsx +++ b/packages/semi-icons/src/icons/IconAscend.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'ascend'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconAt.tsx b/packages/semi-icons/src/icons/IconAt.tsx index f2a009a6dd..0fdeab1c24 100644 --- a/packages/semi-icons/src/icons/IconAt.tsx +++ b/packages/semi-icons/src/icons/IconAt.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'at'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBackTop.tsx b/packages/semi-icons/src/icons/IconBackTop.tsx index aeeb7c4e19..5ecdb5da20 100644 --- a/packages/semi-icons/src/icons/IconBackTop.tsx +++ b/packages/semi-icons/src/icons/IconBackTop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'back_top'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBackward.tsx b/packages/semi-icons/src/icons/IconBackward.tsx index bcc5c52d8f..07975d4836 100644 --- a/packages/semi-icons/src/icons/IconBackward.tsx +++ b/packages/semi-icons/src/icons/IconBackward.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'backward'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBarChartHStroked.tsx b/packages/semi-icons/src/icons/IconBarChartHStroked.tsx index e4da3eac68..64e855ba22 100644 --- a/packages/semi-icons/src/icons/IconBarChartHStroked.tsx +++ b/packages/semi-icons/src/icons/IconBarChartHStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bar_chart_h_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBarChartVStroked.tsx b/packages/semi-icons/src/icons/IconBarChartVStroked.tsx index 017419ec57..71ffc7ae64 100644 --- a/packages/semi-icons/src/icons/IconBarChartVStroked.tsx +++ b/packages/semi-icons/src/icons/IconBarChartVStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bar_chart_v_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBeaker.tsx b/packages/semi-icons/src/icons/IconBeaker.tsx index 8c85cb17d9..b460199535 100644 --- a/packages/semi-icons/src/icons/IconBeaker.tsx +++ b/packages/semi-icons/src/icons/IconBeaker.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'beaker'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBell.tsx b/packages/semi-icons/src/icons/IconBell.tsx index b5666df853..21a7a26c49 100644 --- a/packages/semi-icons/src/icons/IconBell.tsx +++ b/packages/semi-icons/src/icons/IconBell.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'bell'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBellStroked.tsx b/packages/semi-icons/src/icons/IconBellStroked.tsx index c4cbafa1d9..4ed93206fa 100644 --- a/packages/semi-icons/src/icons/IconBellStroked.tsx +++ b/packages/semi-icons/src/icons/IconBellStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bell_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBold.tsx b/packages/semi-icons/src/icons/IconBold.tsx index 73034f65d8..87fd45d4dc 100644 --- a/packages/semi-icons/src/icons/IconBold.tsx +++ b/packages/semi-icons/src/icons/IconBold.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bold'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBolt.tsx b/packages/semi-icons/src/icons/IconBolt.tsx index 5a40d76eb9..11924d13f8 100644 --- a/packages/semi-icons/src/icons/IconBolt.tsx +++ b/packages/semi-icons/src/icons/IconBolt.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'bolt'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookH5Stroked.tsx b/packages/semi-icons/src/icons/IconBookH5Stroked.tsx index d560f2f1a5..361e3f5c2f 100644 --- a/packages/semi-icons/src/icons/IconBookH5Stroked.tsx +++ b/packages/semi-icons/src/icons/IconBookH5Stroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'book_h5_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookOpenStroked.tsx b/packages/semi-icons/src/icons/IconBookOpenStroked.tsx index f96a5d176a..7becc3540b 100644 --- a/packages/semi-icons/src/icons/IconBookOpenStroked.tsx +++ b/packages/semi-icons/src/icons/IconBookOpenStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'book_open_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookStroked.tsx b/packages/semi-icons/src/icons/IconBookStroked.tsx index 16930f5ac4..2bbb59e146 100644 --- a/packages/semi-icons/src/icons/IconBookStroked.tsx +++ b/packages/semi-icons/src/icons/IconBookStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'book_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookmark.tsx b/packages/semi-icons/src/icons/IconBookmark.tsx index 9afdb0fed1..9ed30c80d7 100644 --- a/packages/semi-icons/src/icons/IconBookmark.tsx +++ b/packages/semi-icons/src/icons/IconBookmark.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'bookmark'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookmarkAddStroked.tsx b/packages/semi-icons/src/icons/IconBookmarkAddStroked.tsx index bdadb0e9be..e53e58211f 100644 --- a/packages/semi-icons/src/icons/IconBookmarkAddStroked.tsx +++ b/packages/semi-icons/src/icons/IconBookmarkAddStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bookmark_add_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBookmarkDeleteStroked.tsx b/packages/semi-icons/src/icons/IconBookmarkDeleteStroked.tsx index 66cc603243..efab9ba270 100644 --- a/packages/semi-icons/src/icons/IconBookmarkDeleteStroked.tsx +++ b/packages/semi-icons/src/icons/IconBookmarkDeleteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bookmark_delete_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBottomCenterStroked.tsx b/packages/semi-icons/src/icons/IconBottomCenterStroked.tsx index cbf0a9913d..b5f53d1eac 100644 --- a/packages/semi-icons/src/icons/IconBottomCenterStroked.tsx +++ b/packages/semi-icons/src/icons/IconBottomCenterStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bottom_center_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBottomLeftStroked.tsx b/packages/semi-icons/src/icons/IconBottomLeftStroked.tsx index 9ba82d2716..7c2ed960dc 100644 --- a/packages/semi-icons/src/icons/IconBottomLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconBottomLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bottom_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBottomRightStroked.tsx b/packages/semi-icons/src/icons/IconBottomRightStroked.tsx index 4e28e80f0c..362fb52573 100644 --- a/packages/semi-icons/src/icons/IconBottomRightStroked.tsx +++ b/packages/semi-icons/src/icons/IconBottomRightStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bottom_right_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBox.tsx b/packages/semi-icons/src/icons/IconBox.tsx index f600f01f29..162996f1f5 100644 --- a/packages/semi-icons/src/icons/IconBox.tsx +++ b/packages/semi-icons/src/icons/IconBox.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'box'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBrackets.tsx b/packages/semi-icons/src/icons/IconBrackets.tsx index 09a1bea7a2..f146540860 100644 --- a/packages/semi-icons/src/icons/IconBrackets.tsx +++ b/packages/semi-icons/src/icons/IconBrackets.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'brackets'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBranch.tsx b/packages/semi-icons/src/icons/IconBranch.tsx index 59a1ebd931..bf6e462f5e 100644 --- a/packages/semi-icons/src/icons/IconBranch.tsx +++ b/packages/semi-icons/src/icons/IconBranch.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'branch'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBriefStroked.tsx b/packages/semi-icons/src/icons/IconBriefStroked.tsx index 4cc2deae13..1009c466f1 100644 --- a/packages/semi-icons/src/icons/IconBriefStroked.tsx +++ b/packages/semi-icons/src/icons/IconBriefStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'brief_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBriefcase.tsx b/packages/semi-icons/src/icons/IconBriefcase.tsx index 797d4338c0..270e88aa2f 100644 --- a/packages/semi-icons/src/icons/IconBriefcase.tsx +++ b/packages/semi-icons/src/icons/IconBriefcase.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'briefcase'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBulb.tsx b/packages/semi-icons/src/icons/IconBulb.tsx index 077b611544..9ca887e2da 100644 --- a/packages/semi-icons/src/icons/IconBulb.tsx +++ b/packages/semi-icons/src/icons/IconBulb.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bulb'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconButtonStroked.tsx b/packages/semi-icons/src/icons/IconButtonStroked.tsx index 5a15a0a3ed..90f25d193a 100644 --- a/packages/semi-icons/src/icons/IconButtonStroked.tsx +++ b/packages/semi-icons/src/icons/IconButtonStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'button_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconBytedanceLogo.tsx b/packages/semi-icons/src/icons/IconBytedanceLogo.tsx index f0c6eb900e..eb660e1340 100644 --- a/packages/semi-icons/src/icons/IconBytedanceLogo.tsx +++ b/packages/semi-icons/src/icons/IconBytedanceLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'bytedance_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCalendar.tsx b/packages/semi-icons/src/icons/IconCalendar.tsx index cf174a537e..3daeb7aace 100644 --- a/packages/semi-icons/src/icons/IconCalendar.tsx +++ b/packages/semi-icons/src/icons/IconCalendar.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'calendar'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCalendarClock.tsx b/packages/semi-icons/src/icons/IconCalendarClock.tsx index 7da32383f1..8423f4f77b 100644 --- a/packages/semi-icons/src/icons/IconCalendarClock.tsx +++ b/packages/semi-icons/src/icons/IconCalendarClock.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > + - - - + + ); } - const IconComponent = convertIcon(SvgComponent, 'calendar_clock'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCalendarStroked.tsx b/packages/semi-icons/src/icons/IconCalendarStroked.tsx index 8205228550..9b24dbeb7c 100644 --- a/packages/semi-icons/src/icons/IconCalendarStroked.tsx +++ b/packages/semi-icons/src/icons/IconCalendarStroked.tsx @@ -1,14 +1,13 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'calendar_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCamera.tsx b/packages/semi-icons/src/icons/IconCamera.tsx index 04d6e6bd9b..7259713cf4 100644 --- a/packages/semi-icons/src/icons/IconCamera.tsx +++ b/packages/semi-icons/src/icons/IconCamera.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'camera'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCandlestickChartStroked.tsx b/packages/semi-icons/src/icons/IconCandlestickChartStroked.tsx index a701b01e38..293eae4875 100644 --- a/packages/semi-icons/src/icons/IconCandlestickChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconCandlestickChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'candlestick_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCaretdown.tsx b/packages/semi-icons/src/icons/IconCaretdown.tsx index 27cf36de9c..224e2fbcca 100644 --- a/packages/semi-icons/src/icons/IconCaretdown.tsx +++ b/packages/semi-icons/src/icons/IconCaretdown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'caretdown'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCaretup.tsx b/packages/semi-icons/src/icons/IconCaretup.tsx index 83b66f59c6..77813615a7 100644 --- a/packages/semi-icons/src/icons/IconCaretup.tsx +++ b/packages/semi-icons/src/icons/IconCaretup.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'caretup'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCarouselStroked.tsx b/packages/semi-icons/src/icons/IconCarouselStroked.tsx index 4f2a55f884..a7d4f6d2d5 100644 --- a/packages/semi-icons/src/icons/IconCarouselStroked.tsx +++ b/packages/semi-icons/src/icons/IconCarouselStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'carousel_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCart.tsx b/packages/semi-icons/src/icons/IconCart.tsx index 359599d5d2..6563f78f8d 100644 --- a/packages/semi-icons/src/icons/IconCart.tsx +++ b/packages/semi-icons/src/icons/IconCart.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'cart'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCaseSensitive.tsx b/packages/semi-icons/src/icons/IconCaseSensitive.tsx index 3e3b4ae7e4..c484ecaadf 100644 --- a/packages/semi-icons/src/icons/IconCaseSensitive.tsx +++ b/packages/semi-icons/src/icons/IconCaseSensitive.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'case_sensitive'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCenterLeftStroked.tsx b/packages/semi-icons/src/icons/IconCenterLeftStroked.tsx index 5c3d651524..5254d71aee 100644 --- a/packages/semi-icons/src/icons/IconCenterLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconCenterLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'center_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCenterRightStroked.tsx b/packages/semi-icons/src/icons/IconCenterRightStroked.tsx index b43e6be946..2021efdad4 100644 --- a/packages/semi-icons/src/icons/IconCenterRightStroked.tsx +++ b/packages/semi-icons/src/icons/IconCenterRightStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'center_right_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChainStroked.tsx b/packages/semi-icons/src/icons/IconChainStroked.tsx index 4959af7b59..b257d3fb71 100644 --- a/packages/semi-icons/src/icons/IconChainStroked.tsx +++ b/packages/semi-icons/src/icons/IconChainStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chain_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCheckChoiceStroked.tsx b/packages/semi-icons/src/icons/IconCheckChoiceStroked.tsx index de14b6e57b..4343bd4ef4 100644 --- a/packages/semi-icons/src/icons/IconCheckChoiceStroked.tsx +++ b/packages/semi-icons/src/icons/IconCheckChoiceStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'check_choice_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCheckCircleStroked.tsx b/packages/semi-icons/src/icons/IconCheckCircleStroked.tsx index f530a2a743..75f2fc5150 100644 --- a/packages/semi-icons/src/icons/IconCheckCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconCheckCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'check_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCheckList.tsx b/packages/semi-icons/src/icons/IconCheckList.tsx index 19daa6a85a..82f579ef67 100644 --- a/packages/semi-icons/src/icons/IconCheckList.tsx +++ b/packages/semi-icons/src/icons/IconCheckList.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'check_list'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCheckboxIndeterminate.tsx b/packages/semi-icons/src/icons/IconCheckboxIndeterminate.tsx index 93e17a93e2..f6e3a6c4ea 100644 --- a/packages/semi-icons/src/icons/IconCheckboxIndeterminate.tsx +++ b/packages/semi-icons/src/icons/IconCheckboxIndeterminate.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'checkbox_indeterminate'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCheckboxTick.tsx b/packages/semi-icons/src/icons/IconCheckboxTick.tsx index 0008e12095..39c716a490 100644 --- a/packages/semi-icons/src/icons/IconCheckboxTick.tsx +++ b/packages/semi-icons/src/icons/IconCheckboxTick.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'checkbox_tick'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChecklistStroked.tsx b/packages/semi-icons/src/icons/IconChecklistStroked.tsx index bb37036fe5..8e3bc1270c 100644 --- a/packages/semi-icons/src/icons/IconChecklistStroked.tsx +++ b/packages/semi-icons/src/icons/IconChecklistStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'checklist_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronDown.tsx b/packages/semi-icons/src/icons/IconChevronDown.tsx index c226ac1f5a..9ac8450b76 100644 --- a/packages/semi-icons/src/icons/IconChevronDown.tsx +++ b/packages/semi-icons/src/icons/IconChevronDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronDownStroked.tsx b/packages/semi-icons/src/icons/IconChevronDownStroked.tsx index 804bf3c4de..a7a5921905 100644 --- a/packages/semi-icons/src/icons/IconChevronDownStroked.tsx +++ b/packages/semi-icons/src/icons/IconChevronDownStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_down_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronLeft.tsx b/packages/semi-icons/src/icons/IconChevronLeft.tsx index 946bfaccb1..1cab938e53 100644 --- a/packages/semi-icons/src/icons/IconChevronLeft.tsx +++ b/packages/semi-icons/src/icons/IconChevronLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronRight.tsx b/packages/semi-icons/src/icons/IconChevronRight.tsx index bfc29e1d6b..cb2a671934 100644 --- a/packages/semi-icons/src/icons/IconChevronRight.tsx +++ b/packages/semi-icons/src/icons/IconChevronRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronRightStroked.tsx b/packages/semi-icons/src/icons/IconChevronRightStroked.tsx index 3bf5155a23..80ceec84c4 100644 --- a/packages/semi-icons/src/icons/IconChevronRightStroked.tsx +++ b/packages/semi-icons/src/icons/IconChevronRightStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_right_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronUp.tsx b/packages/semi-icons/src/icons/IconChevronUp.tsx index 844c604975..ae11d524c6 100644 --- a/packages/semi-icons/src/icons/IconChevronUp.tsx +++ b/packages/semi-icons/src/icons/IconChevronUp.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_up'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconChevronUpDown.tsx b/packages/semi-icons/src/icons/IconChevronUpDown.tsx index 347fee80f6..5f9b78742e 100644 --- a/packages/semi-icons/src/icons/IconChevronUpDown.tsx +++ b/packages/semi-icons/src/icons/IconChevronUpDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'chevron_up_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconClear.tsx b/packages/semi-icons/src/icons/IconClear.tsx index 4596a4caf6..1dd932cd3a 100644 --- a/packages/semi-icons/src/icons/IconClear.tsx +++ b/packages/semi-icons/src/icons/IconClear.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'clear'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconClock.tsx b/packages/semi-icons/src/icons/IconClock.tsx index 95fd200254..0bdb5934ca 100644 --- a/packages/semi-icons/src/icons/IconClock.tsx +++ b/packages/semi-icons/src/icons/IconClock.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'clock'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconClose.tsx b/packages/semi-icons/src/icons/IconClose.tsx index 66ac931868..6d4dc03d6d 100644 --- a/packages/semi-icons/src/icons/IconClose.tsx +++ b/packages/semi-icons/src/icons/IconClose.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'close'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCloud.tsx b/packages/semi-icons/src/icons/IconCloud.tsx index c33e936a55..1ee46ad3b6 100644 --- a/packages/semi-icons/src/icons/IconCloud.tsx +++ b/packages/semi-icons/src/icons/IconCloud.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'cloud'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCloudStroked.tsx b/packages/semi-icons/src/icons/IconCloudStroked.tsx index 4a0cb4f10b..0ffb9581f5 100644 --- a/packages/semi-icons/src/icons/IconCloudStroked.tsx +++ b/packages/semi-icons/src/icons/IconCloudStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'cloud_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCloudUploadStroked.tsx b/packages/semi-icons/src/icons/IconCloudUploadStroked.tsx index 7e38479e26..2ba6769ec6 100644 --- a/packages/semi-icons/src/icons/IconCloudUploadStroked.tsx +++ b/packages/semi-icons/src/icons/IconCloudUploadStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'cloud_upload_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCode.tsx b/packages/semi-icons/src/icons/IconCode.tsx index 8c0d6ad5ac..e30eec58eb 100644 --- a/packages/semi-icons/src/icons/IconCode.tsx +++ b/packages/semi-icons/src/icons/IconCode.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'code'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCodeStroked.tsx b/packages/semi-icons/src/icons/IconCodeStroked.tsx index af3e605656..606defedd0 100644 --- a/packages/semi-icons/src/icons/IconCodeStroked.tsx +++ b/packages/semi-icons/src/icons/IconCodeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'code_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCoinMoneyStroked.tsx b/packages/semi-icons/src/icons/IconCoinMoneyStroked.tsx index 0911ccae8a..8be3deda98 100644 --- a/packages/semi-icons/src/icons/IconCoinMoneyStroked.tsx +++ b/packages/semi-icons/src/icons/IconCoinMoneyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'coin_money_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconColorPalette.tsx b/packages/semi-icons/src/icons/IconColorPalette.tsx index 555fa82dbf..39ebaad88a 100644 --- a/packages/semi-icons/src/icons/IconColorPalette.tsx +++ b/packages/semi-icons/src/icons/IconColorPalette.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'color_palette'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconColumnsStroked.tsx b/packages/semi-icons/src/icons/IconColumnsStroked.tsx index 179284e8b3..ae0a3572f4 100644 --- a/packages/semi-icons/src/icons/IconColumnsStroked.tsx +++ b/packages/semi-icons/src/icons/IconColumnsStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'columns_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCommand.tsx b/packages/semi-icons/src/icons/IconCommand.tsx index c650a8b5c5..1d3a089660 100644 --- a/packages/semi-icons/src/icons/IconCommand.tsx +++ b/packages/semi-icons/src/icons/IconCommand.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'command'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconComment.tsx b/packages/semi-icons/src/icons/IconComment.tsx index 950b3318e4..f358743c18 100644 --- a/packages/semi-icons/src/icons/IconComment.tsx +++ b/packages/semi-icons/src/icons/IconComment.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'comment'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCommentStroked.tsx b/packages/semi-icons/src/icons/IconCommentStroked.tsx index f350485c56..c84dc2390b 100644 --- a/packages/semi-icons/src/icons/IconCommentStroked.tsx +++ b/packages/semi-icons/src/icons/IconCommentStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'comment_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconComponent.tsx b/packages/semi-icons/src/icons/IconComponent.tsx index 0792a3e4fe..62ed1e6e68 100644 --- a/packages/semi-icons/src/icons/IconComponent.tsx +++ b/packages/semi-icons/src/icons/IconComponent.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - - + + + + ); } - const IconComponent = convertIcon(SvgComponent, 'component'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconComponentPlaceholderStroked.tsx b/packages/semi-icons/src/icons/IconComponentPlaceholderStroked.tsx index 92b44cd34a..2bcd52ac12 100644 --- a/packages/semi-icons/src/icons/IconComponentPlaceholderStroked.tsx +++ b/packages/semi-icons/src/icons/IconComponentPlaceholderStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'component_placeholder_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconComponentStroked.tsx b/packages/semi-icons/src/icons/IconComponentStroked.tsx index 886fe4d180..e967fc2ddc 100644 --- a/packages/semi-icons/src/icons/IconComponentStroked.tsx +++ b/packages/semi-icons/src/icons/IconComponentStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'component_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconConfigStroked.tsx b/packages/semi-icons/src/icons/IconConfigStroked.tsx index b6f93a28e1..c73e8066f0 100644 --- a/packages/semi-icons/src/icons/IconConfigStroked.tsx +++ b/packages/semi-icons/src/icons/IconConfigStroked.tsx @@ -1,37 +1,80 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( - - - - - - - - - + + + + + + + + + - + ); } - const IconComponent = convertIcon(SvgComponent, 'config_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconConnectionPoint1.tsx b/packages/semi-icons/src/icons/IconConnectionPoint1.tsx index f06e936adb..ff922231fb 100644 --- a/packages/semi-icons/src/icons/IconConnectionPoint1.tsx +++ b/packages/semi-icons/src/icons/IconConnectionPoint1.tsx @@ -1,14 +1,13 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'connection_point_1'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconConnectionPoint2.tsx b/packages/semi-icons/src/icons/IconConnectionPoint2.tsx index f1fc2af542..9e69ca00b4 100644 --- a/packages/semi-icons/src/icons/IconConnectionPoint2.tsx +++ b/packages/semi-icons/src/icons/IconConnectionPoint2.tsx @@ -1,14 +1,13 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'connection_point_2'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconContrast.tsx b/packages/semi-icons/src/icons/IconContrast.tsx index 8892f8bf2b..7005e712d4 100644 --- a/packages/semi-icons/src/icons/IconContrast.tsx +++ b/packages/semi-icons/src/icons/IconContrast.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'contrast'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCopy.tsx b/packages/semi-icons/src/icons/IconCopy.tsx index d3e1101e2c..740629a744 100644 --- a/packages/semi-icons/src/icons/IconCopy.tsx +++ b/packages/semi-icons/src/icons/IconCopy.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - + + ); } - const IconComponent = convertIcon(SvgComponent, 'copy'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCopyAdd.tsx b/packages/semi-icons/src/icons/IconCopyAdd.tsx index bf82e13485..194b1f2bb0 100644 --- a/packages/semi-icons/src/icons/IconCopyAdd.tsx +++ b/packages/semi-icons/src/icons/IconCopyAdd.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'copy_add'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCopyStroked.tsx b/packages/semi-icons/src/icons/IconCopyStroked.tsx index 6bdbf16be8..994d4ae094 100644 --- a/packages/semi-icons/src/icons/IconCopyStroked.tsx +++ b/packages/semi-icons/src/icons/IconCopyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'copy_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCornerRadiusStroked.tsx b/packages/semi-icons/src/icons/IconCornerRadiusStroked.tsx index b8668c35db..741a2e72f3 100644 --- a/packages/semi-icons/src/icons/IconCornerRadiusStroked.tsx +++ b/packages/semi-icons/src/icons/IconCornerRadiusStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'corner_radius_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCreditCard.tsx b/packages/semi-icons/src/icons/IconCreditCard.tsx index 1cbda7b94d..d6ad8f82c6 100644 --- a/packages/semi-icons/src/icons/IconCreditCard.tsx +++ b/packages/semi-icons/src/icons/IconCreditCard.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'credit_card'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCrop.tsx b/packages/semi-icons/src/icons/IconCrop.tsx index d67c5838c9..ffe33645d7 100644 --- a/packages/semi-icons/src/icons/IconCrop.tsx +++ b/packages/semi-icons/src/icons/IconCrop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'crop'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCrossCircleStroked.tsx b/packages/semi-icons/src/icons/IconCrossCircleStroked.tsx index a3e4ed8da7..111768e81b 100644 --- a/packages/semi-icons/src/icons/IconCrossCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconCrossCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'cross_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCrossStroked.tsx b/packages/semi-icons/src/icons/IconCrossStroked.tsx index 6cf0a00568..67a3415fd8 100644 --- a/packages/semi-icons/src/icons/IconCrossStroked.tsx +++ b/packages/semi-icons/src/icons/IconCrossStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'cross_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCrown.tsx b/packages/semi-icons/src/icons/IconCrown.tsx index 590a41cb46..b2a161b712 100644 --- a/packages/semi-icons/src/icons/IconCrown.tsx +++ b/packages/semi-icons/src/icons/IconCrown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'crown'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCustomerSupport.tsx b/packages/semi-icons/src/icons/IconCustomerSupport.tsx index 21429c4a31..c28d433f01 100644 --- a/packages/semi-icons/src/icons/IconCustomerSupport.tsx +++ b/packages/semi-icons/src/icons/IconCustomerSupport.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'customer_support'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCustomerSupportStroked.tsx b/packages/semi-icons/src/icons/IconCustomerSupportStroked.tsx index 527eb316c5..98330f1d0b 100644 --- a/packages/semi-icons/src/icons/IconCustomerSupportStroked.tsx +++ b/packages/semi-icons/src/icons/IconCustomerSupportStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'customer_support_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconCustomize.tsx b/packages/semi-icons/src/icons/IconCustomize.tsx index 227c11910a..74fff8aaac 100644 --- a/packages/semi-icons/src/icons/IconCustomize.tsx +++ b/packages/semi-icons/src/icons/IconCustomize.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'customize'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDelete.tsx b/packages/semi-icons/src/icons/IconDelete.tsx index f3d51c7e08..ac055326b5 100644 --- a/packages/semi-icons/src/icons/IconDelete.tsx +++ b/packages/semi-icons/src/icons/IconDelete.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'delete'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDeleteStroked.tsx b/packages/semi-icons/src/icons/IconDeleteStroked.tsx index c3d0a28014..b4566cc109 100644 --- a/packages/semi-icons/src/icons/IconDeleteStroked.tsx +++ b/packages/semi-icons/src/icons/IconDeleteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'delete_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDescend.tsx b/packages/semi-icons/src/icons/IconDescend.tsx index e14892e860..0c96708b48 100644 --- a/packages/semi-icons/src/icons/IconDescend.tsx +++ b/packages/semi-icons/src/icons/IconDescend.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { > + - ); } - const IconComponent = convertIcon(SvgComponent, 'descend'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDescend2.tsx b/packages/semi-icons/src/icons/IconDescend2.tsx index 59c96c667f..6a8622d0b3 100644 --- a/packages/semi-icons/src/icons/IconDescend2.tsx +++ b/packages/semi-icons/src/icons/IconDescend2.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'descend2'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDesktop.tsx b/packages/semi-icons/src/icons/IconDesktop.tsx index 518bbb1aa1..3a6e963108 100644 --- a/packages/semi-icons/src/icons/IconDesktop.tsx +++ b/packages/semi-icons/src/icons/IconDesktop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - - + + ); } - const IconComponent = convertIcon(SvgComponent, 'desktop'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDisc.tsx b/packages/semi-icons/src/icons/IconDisc.tsx index 9ceeaaa236..427f36384e 100644 --- a/packages/semi-icons/src/icons/IconDisc.tsx +++ b/packages/semi-icons/src/icons/IconDisc.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'disc'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDislikeThumb.tsx b/packages/semi-icons/src/icons/IconDislikeThumb.tsx index b6cd7ca5e1..9a9c029fe9 100644 --- a/packages/semi-icons/src/icons/IconDislikeThumb.tsx +++ b/packages/semi-icons/src/icons/IconDislikeThumb.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'dislike_thumb'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDivide.tsx b/packages/semi-icons/src/icons/IconDivide.tsx index 57797f940e..2b92bbf426 100644 --- a/packages/semi-icons/src/icons/IconDivide.tsx +++ b/packages/semi-icons/src/icons/IconDivide.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'divide'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDongchediLogo.tsx b/packages/semi-icons/src/icons/IconDongchediLogo.tsx index 9c6d4ff6f8..bd02e47430 100644 --- a/packages/semi-icons/src/icons/IconDongchediLogo.tsx +++ b/packages/semi-icons/src/icons/IconDongchediLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'dongchedi_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDoubleChevronLeft.tsx b/packages/semi-icons/src/icons/IconDoubleChevronLeft.tsx index ae0221e094..1a83636ba4 100644 --- a/packages/semi-icons/src/icons/IconDoubleChevronLeft.tsx +++ b/packages/semi-icons/src/icons/IconDoubleChevronLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'double_chevron_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDoubleChevronRight.tsx b/packages/semi-icons/src/icons/IconDoubleChevronRight.tsx index 462d949e4b..115ab4983b 100644 --- a/packages/semi-icons/src/icons/IconDoubleChevronRight.tsx +++ b/packages/semi-icons/src/icons/IconDoubleChevronRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'double_chevron_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDownCircleStroked.tsx b/packages/semi-icons/src/icons/IconDownCircleStroked.tsx index 646753dd4e..c2f6b3420a 100644 --- a/packages/semi-icons/src/icons/IconDownCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconDownCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'down_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDownload.tsx b/packages/semi-icons/src/icons/IconDownload.tsx index 7c41b3e74e..2ca9f2de30 100644 --- a/packages/semi-icons/src/icons/IconDownload.tsx +++ b/packages/semi-icons/src/icons/IconDownload.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'download'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDownloadStroked.tsx b/packages/semi-icons/src/icons/IconDownloadStroked.tsx index b437686055..f85c2bd930 100644 --- a/packages/semi-icons/src/icons/IconDownloadStroked.tsx +++ b/packages/semi-icons/src/icons/IconDownloadStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'download_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconDuration.tsx b/packages/semi-icons/src/icons/IconDuration.tsx index 140e282993..b54a223464 100644 --- a/packages/semi-icons/src/icons/IconDuration.tsx +++ b/packages/semi-icons/src/icons/IconDuration.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'duration'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEdit.tsx b/packages/semi-icons/src/icons/IconEdit.tsx index 5bc2a1be5c..f7928a9998 100644 --- a/packages/semi-icons/src/icons/IconEdit.tsx +++ b/packages/semi-icons/src/icons/IconEdit.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'edit'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEdit2Stroked.tsx b/packages/semi-icons/src/icons/IconEdit2Stroked.tsx index ee23f51cd9..3bd9130ff9 100644 --- a/packages/semi-icons/src/icons/IconEdit2Stroked.tsx +++ b/packages/semi-icons/src/icons/IconEdit2Stroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'edit_2_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEditStroked.tsx b/packages/semi-icons/src/icons/IconEditStroked.tsx index b9c4eb7e72..79d22b84c3 100644 --- a/packages/semi-icons/src/icons/IconEditStroked.tsx +++ b/packages/semi-icons/src/icons/IconEditStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'edit_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconElementStroked.tsx b/packages/semi-icons/src/icons/IconElementStroked.tsx index ff34701e8c..e702ce2fce 100644 --- a/packages/semi-icons/src/icons/IconElementStroked.tsx +++ b/packages/semi-icons/src/icons/IconElementStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'element_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEmoji.tsx b/packages/semi-icons/src/icons/IconEmoji.tsx index 6304130e73..24d930e5eb 100644 --- a/packages/semi-icons/src/icons/IconEmoji.tsx +++ b/packages/semi-icons/src/icons/IconEmoji.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'emoji'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconExit.tsx b/packages/semi-icons/src/icons/IconExit.tsx index 18b020dd91..4f7bb3b85d 100644 --- a/packages/semi-icons/src/icons/IconExit.tsx +++ b/packages/semi-icons/src/icons/IconExit.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'exit'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconExpand.tsx b/packages/semi-icons/src/icons/IconExpand.tsx index 6fc1e0cd0b..9fe3168913 100644 --- a/packages/semi-icons/src/icons/IconExpand.tsx +++ b/packages/semi-icons/src/icons/IconExpand.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'expand'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconExport.tsx b/packages/semi-icons/src/icons/IconExport.tsx index a4a0c8e664..0481ca22f7 100644 --- a/packages/semi-icons/src/icons/IconExport.tsx +++ b/packages/semi-icons/src/icons/IconExport.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'export'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconExternalOpen.tsx b/packages/semi-icons/src/icons/IconExternalOpen.tsx index 856b283e46..b4de753e8f 100644 --- a/packages/semi-icons/src/icons/IconExternalOpen.tsx +++ b/packages/semi-icons/src/icons/IconExternalOpen.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'external_open'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconExternalOpenStroked.tsx b/packages/semi-icons/src/icons/IconExternalOpenStroked.tsx index 1dd7e86b9d..3a1f1abe53 100644 --- a/packages/semi-icons/src/icons/IconExternalOpenStroked.tsx +++ b/packages/semi-icons/src/icons/IconExternalOpenStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'external_open_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEyeClosed.tsx b/packages/semi-icons/src/icons/IconEyeClosed.tsx index 969d2677f8..f174ceb9ec 100644 --- a/packages/semi-icons/src/icons/IconEyeClosed.tsx +++ b/packages/semi-icons/src/icons/IconEyeClosed.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'eye_closed'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEyeClosedSolid.tsx b/packages/semi-icons/src/icons/IconEyeClosedSolid.tsx index bb3409c429..1f62fdb517 100644 --- a/packages/semi-icons/src/icons/IconEyeClosedSolid.tsx +++ b/packages/semi-icons/src/icons/IconEyeClosedSolid.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'eye_closed_solid'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEyeOpened.tsx b/packages/semi-icons/src/icons/IconEyeOpened.tsx index 26e6258b67..56009ba003 100644 --- a/packages/semi-icons/src/icons/IconEyeOpened.tsx +++ b/packages/semi-icons/src/icons/IconEyeOpened.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'eye_opened'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconEyedropper.tsx b/packages/semi-icons/src/icons/IconEyedropper.tsx index dc662d074f..3e9b0c8c22 100644 --- a/packages/semi-icons/src/icons/IconEyedropper.tsx +++ b/packages/semi-icons/src/icons/IconEyedropper.tsx @@ -15,7 +15,7 @@ function SvgComponent(props: React.SVGProps) { diff --git a/packages/semi-icons/src/icons/IconFacebook.tsx b/packages/semi-icons/src/icons/IconFacebook.tsx index 3d640db070..40e87be994 100644 --- a/packages/semi-icons/src/icons/IconFacebook.tsx +++ b/packages/semi-icons/src/icons/IconFacebook.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'facebook'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFaceuLogo.tsx b/packages/semi-icons/src/icons/IconFaceuLogo.tsx index e888f2f6b5..39174cc547 100644 --- a/packages/semi-icons/src/icons/IconFaceuLogo.tsx +++ b/packages/semi-icons/src/icons/IconFaceuLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'faceu_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFastForward.tsx b/packages/semi-icons/src/icons/IconFastForward.tsx index 50a4ea1d23..665048a58d 100644 --- a/packages/semi-icons/src/icons/IconFastForward.tsx +++ b/packages/semi-icons/src/icons/IconFastForward.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'fast_forward'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFastFoward.tsx b/packages/semi-icons/src/icons/IconFastFoward.tsx index 858779d34b..17b4670a71 100644 --- a/packages/semi-icons/src/icons/IconFastFoward.tsx +++ b/packages/semi-icons/src/icons/IconFastFoward.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'fast_foward'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFavoriteList.tsx b/packages/semi-icons/src/icons/IconFavoriteList.tsx index b50747b512..44919a0674 100644 --- a/packages/semi-icons/src/icons/IconFavoriteList.tsx +++ b/packages/semi-icons/src/icons/IconFavoriteList.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'favorite_list'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFeishuLogo.tsx b/packages/semi-icons/src/icons/IconFeishuLogo.tsx index abe4a9e64f..f7d7c6ae1f 100644 --- a/packages/semi-icons/src/icons/IconFeishuLogo.tsx +++ b/packages/semi-icons/src/icons/IconFeishuLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > + + - - ); } - const IconComponent = convertIcon(SvgComponent, 'feishu_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFemale.tsx b/packages/semi-icons/src/icons/IconFemale.tsx index b626183b2c..fb34f557d3 100644 --- a/packages/semi-icons/src/icons/IconFemale.tsx +++ b/packages/semi-icons/src/icons/IconFemale.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'female'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFigma.tsx b/packages/semi-icons/src/icons/IconFigma.tsx index 1242e64f9b..6e4a341f67 100644 --- a/packages/semi-icons/src/icons/IconFigma.tsx +++ b/packages/semi-icons/src/icons/IconFigma.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'figma'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFile.tsx b/packages/semi-icons/src/icons/IconFile.tsx index fabceacfbe..40db7dae6f 100644 --- a/packages/semi-icons/src/icons/IconFile.tsx +++ b/packages/semi-icons/src/icons/IconFile.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'file'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFillStroked.tsx b/packages/semi-icons/src/icons/IconFillStroked.tsx index 4d386acd96..de6ebf2f94 100644 --- a/packages/semi-icons/src/icons/IconFillStroked.tsx +++ b/packages/semi-icons/src/icons/IconFillStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'fill_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFilledArrowDown.tsx b/packages/semi-icons/src/icons/IconFilledArrowDown.tsx index 75414dfd50..bf59329427 100644 --- a/packages/semi-icons/src/icons/IconFilledArrowDown.tsx +++ b/packages/semi-icons/src/icons/IconFilledArrowDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'filled_arrow_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFilledArrowUp.tsx b/packages/semi-icons/src/icons/IconFilledArrowUp.tsx index fe6d27d8ee..6d01a175b0 100644 --- a/packages/semi-icons/src/icons/IconFilledArrowUp.tsx +++ b/packages/semi-icons/src/icons/IconFilledArrowUp.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'filled_arrow_up'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFilpVertical.tsx b/packages/semi-icons/src/icons/IconFilpVertical.tsx index f94a1c4f00..d437d872df 100644 --- a/packages/semi-icons/src/icons/IconFilpVertical.tsx +++ b/packages/semi-icons/src/icons/IconFilpVertical.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'filp_vertical'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFilter.tsx b/packages/semi-icons/src/icons/IconFilter.tsx index a0a3f71c89..5c1594ab42 100644 --- a/packages/semi-icons/src/icons/IconFilter.tsx +++ b/packages/semi-icons/src/icons/IconFilter.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'filter'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFingerLeftStroked.tsx b/packages/semi-icons/src/icons/IconFingerLeftStroked.tsx index bd3d1893fc..d8f8c3e4e9 100644 --- a/packages/semi-icons/src/icons/IconFingerLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconFingerLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'finger_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFixedStroked.tsx b/packages/semi-icons/src/icons/IconFixedStroked.tsx index 6638362c67..b244906db9 100644 --- a/packages/semi-icons/src/icons/IconFixedStroked.tsx +++ b/packages/semi-icons/src/icons/IconFixedStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'fixed_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFlag.tsx b/packages/semi-icons/src/icons/IconFlag.tsx index 04abe229ea..8a3970b5ea 100644 --- a/packages/semi-icons/src/icons/IconFlag.tsx +++ b/packages/semi-icons/src/icons/IconFlag.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'flag'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFlipHorizontal.tsx b/packages/semi-icons/src/icons/IconFlipHorizontal.tsx index 2b057776e7..3620c67130 100644 --- a/packages/semi-icons/src/icons/IconFlipHorizontal.tsx +++ b/packages/semi-icons/src/icons/IconFlipHorizontal.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'flip_horizontal'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFlowChartStroked.tsx b/packages/semi-icons/src/icons/IconFlowChartStroked.tsx index e4f02dcd1e..4f98cc550a 100644 --- a/packages/semi-icons/src/icons/IconFlowChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconFlowChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'flow_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFolder.tsx b/packages/semi-icons/src/icons/IconFolder.tsx index e371f9d7d6..5fc4ad4d07 100644 --- a/packages/semi-icons/src/icons/IconFolder.tsx +++ b/packages/semi-icons/src/icons/IconFolder.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'folder'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFolderOpen.tsx b/packages/semi-icons/src/icons/IconFolderOpen.tsx index 1c0c27cf2d..b893c04053 100644 --- a/packages/semi-icons/src/icons/IconFolderOpen.tsx +++ b/packages/semi-icons/src/icons/IconFolderOpen.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'folder_open'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFolderStroked.tsx b/packages/semi-icons/src/icons/IconFolderStroked.tsx index 60ead7f02f..a695bd1231 100644 --- a/packages/semi-icons/src/icons/IconFolderStroked.tsx +++ b/packages/semi-icons/src/icons/IconFolderStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'folder_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFollowStroked.tsx b/packages/semi-icons/src/icons/IconFollowStroked.tsx index f8fe6da36f..077f8108e8 100644 --- a/packages/semi-icons/src/icons/IconFollowStroked.tsx +++ b/packages/semi-icons/src/icons/IconFollowStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'follow_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFont.tsx b/packages/semi-icons/src/icons/IconFont.tsx index be2fa2bc19..3ece3313e8 100644 --- a/packages/semi-icons/src/icons/IconFont.tsx +++ b/packages/semi-icons/src/icons/IconFont.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'font'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFontColor.tsx b/packages/semi-icons/src/icons/IconFontColor.tsx index 0db11cacb9..afa69d03f6 100644 --- a/packages/semi-icons/src/icons/IconFontColor.tsx +++ b/packages/semi-icons/src/icons/IconFontColor.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'font_color'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconForward.tsx b/packages/semi-icons/src/icons/IconForward.tsx index fdc93caeeb..d05cacfb33 100644 --- a/packages/semi-icons/src/icons/IconForward.tsx +++ b/packages/semi-icons/src/icons/IconForward.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'forward'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconForwardStroked.tsx b/packages/semi-icons/src/icons/IconForwardStroked.tsx index 253029b3fd..45fcb0f631 100644 --- a/packages/semi-icons/src/icons/IconForwardStroked.tsx +++ b/packages/semi-icons/src/icons/IconForwardStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'forward_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconFullScreenStroked.tsx b/packages/semi-icons/src/icons/IconFullScreenStroked.tsx index f0e5d64a17..dc352921bb 100644 --- a/packages/semi-icons/src/icons/IconFullScreenStroked.tsx +++ b/packages/semi-icons/src/icons/IconFullScreenStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'full_screen_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGallery.tsx b/packages/semi-icons/src/icons/IconGallery.tsx index d12823f0d9..6f96d6eba4 100644 --- a/packages/semi-icons/src/icons/IconGallery.tsx +++ b/packages/semi-icons/src/icons/IconGallery.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'gallery'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGift.tsx b/packages/semi-icons/src/icons/IconGift.tsx index 4f544a614e..6c4b39cb48 100644 --- a/packages/semi-icons/src/icons/IconGift.tsx +++ b/packages/semi-icons/src/icons/IconGift.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'gift'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGiftStroked.tsx b/packages/semi-icons/src/icons/IconGiftStroked.tsx index 63d3c69353..f277fa4c99 100644 --- a/packages/semi-icons/src/icons/IconGiftStroked.tsx +++ b/packages/semi-icons/src/icons/IconGiftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'gift_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGit.tsx b/packages/semi-icons/src/icons/IconGit.tsx index e31ef54e90..353ca8de95 100644 --- a/packages/semi-icons/src/icons/IconGit.tsx +++ b/packages/semi-icons/src/icons/IconGit.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'git'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGithubLogo.tsx b/packages/semi-icons/src/icons/IconGithubLogo.tsx index 46d7d702b6..cec5b86d34 100644 --- a/packages/semi-icons/src/icons/IconGithubLogo.tsx +++ b/packages/semi-icons/src/icons/IconGithubLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'github_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGitlabLogo.tsx b/packages/semi-icons/src/icons/IconGitlabLogo.tsx index 8fac2bccd4..b6b88f445f 100644 --- a/packages/semi-icons/src/icons/IconGitlabLogo.tsx +++ b/packages/semi-icons/src/icons/IconGitlabLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'gitlab_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGlobe.tsx b/packages/semi-icons/src/icons/IconGlobe.tsx index ed714561f3..3876de7e91 100644 --- a/packages/semi-icons/src/icons/IconGlobe.tsx +++ b/packages/semi-icons/src/icons/IconGlobe.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'globe'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGlobeStroke.tsx b/packages/semi-icons/src/icons/IconGlobeStroke.tsx index 022df35673..67ce645bf0 100644 --- a/packages/semi-icons/src/icons/IconGlobeStroke.tsx +++ b/packages/semi-icons/src/icons/IconGlobeStroke.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'globe_stroke'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGridRectangle.tsx b/packages/semi-icons/src/icons/IconGridRectangle.tsx index 60aa7bb307..3161e17aaf 100644 --- a/packages/semi-icons/src/icons/IconGridRectangle.tsx +++ b/packages/semi-icons/src/icons/IconGridRectangle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'grid-rectangle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGridSquare.tsx b/packages/semi-icons/src/icons/IconGridSquare.tsx index 6cf4b9977c..836c4e3f42 100644 --- a/packages/semi-icons/src/icons/IconGridSquare.tsx +++ b/packages/semi-icons/src/icons/IconGridSquare.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'grid-square'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGridStroked.tsx b/packages/semi-icons/src/icons/IconGridStroked.tsx index e7e52cdf4e..92151a92a3 100644 --- a/packages/semi-icons/src/icons/IconGridStroked.tsx +++ b/packages/semi-icons/src/icons/IconGridStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'grid_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGridView.tsx b/packages/semi-icons/src/icons/IconGridView.tsx index e72105ffdb..916cc80d34 100644 --- a/packages/semi-icons/src/icons/IconGridView.tsx +++ b/packages/semi-icons/src/icons/IconGridView.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - - + + + + ); } - const IconComponent = convertIcon(SvgComponent, 'grid_view'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconGridView1.tsx b/packages/semi-icons/src/icons/IconGridView1.tsx index 010ac8f454..22da2733b2 100644 --- a/packages/semi-icons/src/icons/IconGridView1.tsx +++ b/packages/semi-icons/src/icons/IconGridView1.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'grid_view1'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH1.tsx b/packages/semi-icons/src/icons/IconH1.tsx index 1c78a3a9a4..2633bdb7fb 100644 --- a/packages/semi-icons/src/icons/IconH1.tsx +++ b/packages/semi-icons/src/icons/IconH1.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h1'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH2.tsx b/packages/semi-icons/src/icons/IconH2.tsx index 807935ab94..808a2d5bd0 100644 --- a/packages/semi-icons/src/icons/IconH2.tsx +++ b/packages/semi-icons/src/icons/IconH2.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h2'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH3.tsx b/packages/semi-icons/src/icons/IconH3.tsx index 0c2532509a..3c5c19ede7 100644 --- a/packages/semi-icons/src/icons/IconH3.tsx +++ b/packages/semi-icons/src/icons/IconH3.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h3'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH4.tsx b/packages/semi-icons/src/icons/IconH4.tsx index dd10b3c32d..41096a45f6 100644 --- a/packages/semi-icons/src/icons/IconH4.tsx +++ b/packages/semi-icons/src/icons/IconH4.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h4'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH5.tsx b/packages/semi-icons/src/icons/IconH5.tsx index 189ab64913..2456fae540 100644 --- a/packages/semi-icons/src/icons/IconH5.tsx +++ b/packages/semi-icons/src/icons/IconH5.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h5'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH6.tsx b/packages/semi-icons/src/icons/IconH6.tsx index db065e9edd..569d5b479e 100644 --- a/packages/semi-icons/src/icons/IconH6.tsx +++ b/packages/semi-icons/src/icons/IconH6.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h6'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH7.tsx b/packages/semi-icons/src/icons/IconH7.tsx index abe66a1cd7..25bec54899 100644 --- a/packages/semi-icons/src/icons/IconH7.tsx +++ b/packages/semi-icons/src/icons/IconH7.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h7'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH8.tsx b/packages/semi-icons/src/icons/IconH8.tsx index c870fa6f7c..456959e595 100644 --- a/packages/semi-icons/src/icons/IconH8.tsx +++ b/packages/semi-icons/src/icons/IconH8.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h8'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconH9.tsx b/packages/semi-icons/src/icons/IconH9.tsx index f0c493b9e7..10a5a6c9cd 100644 --- a/packages/semi-icons/src/icons/IconH9.tsx +++ b/packages/semi-icons/src/icons/IconH9.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'h9'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHandle.tsx b/packages/semi-icons/src/icons/IconHandle.tsx index 6d5024501f..66015c987b 100644 --- a/packages/semi-icons/src/icons/IconHandle.tsx +++ b/packages/semi-icons/src/icons/IconHandle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - - - - + + + + + + ); } - const IconComponent = convertIcon(SvgComponent, 'handle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHash.tsx b/packages/semi-icons/src/icons/IconHash.tsx index 4448bdc840..511d4c9bef 100644 --- a/packages/semi-icons/src/icons/IconHash.tsx +++ b/packages/semi-icons/src/icons/IconHash.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'hash'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHeartStroked.tsx b/packages/semi-icons/src/icons/IconHeartStroked.tsx index 2e882f2572..350468243f 100644 --- a/packages/semi-icons/src/icons/IconHeartStroked.tsx +++ b/packages/semi-icons/src/icons/IconHeartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'heart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHelm.tsx b/packages/semi-icons/src/icons/IconHelm.tsx index 1818a0e082..6aec43b63f 100644 --- a/packages/semi-icons/src/icons/IconHelm.tsx +++ b/packages/semi-icons/src/icons/IconHelm.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'helm'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHelpCircle.tsx b/packages/semi-icons/src/icons/IconHelpCircle.tsx index 0e96db86dc..25f3718fd5 100644 --- a/packages/semi-icons/src/icons/IconHelpCircle.tsx +++ b/packages/semi-icons/src/icons/IconHelpCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'help_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHelpCircleStroked.tsx b/packages/semi-icons/src/icons/IconHelpCircleStroked.tsx index 0d517eaf5a..d2b771b68e 100644 --- a/packages/semi-icons/src/icons/IconHelpCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconHelpCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'help_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHistogram.tsx b/packages/semi-icons/src/icons/IconHistogram.tsx index 9c08c7d5b1..6b5e8e4ec4 100644 --- a/packages/semi-icons/src/icons/IconHistogram.tsx +++ b/packages/semi-icons/src/icons/IconHistogram.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'histogram'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHistory.tsx b/packages/semi-icons/src/icons/IconHistory.tsx index 231a395e7a..67795102b8 100644 --- a/packages/semi-icons/src/icons/IconHistory.tsx +++ b/packages/semi-icons/src/icons/IconHistory.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'history'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHn.tsx b/packages/semi-icons/src/icons/IconHn.tsx index e26332fa47..f0ce147854 100644 --- a/packages/semi-icons/src/icons/IconHn.tsx +++ b/packages/semi-icons/src/icons/IconHn.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'hn'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHome.tsx b/packages/semi-icons/src/icons/IconHome.tsx index aeb32933ca..9b1c297779 100644 --- a/packages/semi-icons/src/icons/IconHome.tsx +++ b/packages/semi-icons/src/icons/IconHome.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'home'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHomeStroked.tsx b/packages/semi-icons/src/icons/IconHomeStroked.tsx index 2341def132..2590b19c28 100644 --- a/packages/semi-icons/src/icons/IconHomeStroked.tsx +++ b/packages/semi-icons/src/icons/IconHomeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'home_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHorn.tsx b/packages/semi-icons/src/icons/IconHorn.tsx index e3441a6cd0..b1960d15dc 100644 --- a/packages/semi-icons/src/icons/IconHorn.tsx +++ b/packages/semi-icons/src/icons/IconHorn.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'horn'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHourglass.tsx b/packages/semi-icons/src/icons/IconHourglass.tsx index 3d4060487c..0ec73a817e 100644 --- a/packages/semi-icons/src/icons/IconHourglass.tsx +++ b/packages/semi-icons/src/icons/IconHourglass.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'hourglass'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconHourglassStroked.tsx b/packages/semi-icons/src/icons/IconHourglassStroked.tsx index 430b070526..c5dab62c74 100644 --- a/packages/semi-icons/src/icons/IconHourglassStroked.tsx +++ b/packages/semi-icons/src/icons/IconHourglassStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'hourglass_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIdCard.tsx b/packages/semi-icons/src/icons/IconIdCard.tsx index 070b176d13..e753ffce2c 100644 --- a/packages/semi-icons/src/icons/IconIdCard.tsx +++ b/packages/semi-icons/src/icons/IconIdCard.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'id_card'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIdentity.tsx b/packages/semi-icons/src/icons/IconIdentity.tsx index 47be3d3611..806125cdc1 100644 --- a/packages/semi-icons/src/icons/IconIdentity.tsx +++ b/packages/semi-icons/src/icons/IconIdentity.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'identity'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconImage.tsx b/packages/semi-icons/src/icons/IconImage.tsx index 89909ee23c..785f7a256a 100644 --- a/packages/semi-icons/src/icons/IconImage.tsx +++ b/packages/semi-icons/src/icons/IconImage.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'image'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconImageStroked.tsx b/packages/semi-icons/src/icons/IconImageStroked.tsx index 680524a1c5..aa94050b76 100644 --- a/packages/semi-icons/src/icons/IconImageStroked.tsx +++ b/packages/semi-icons/src/icons/IconImageStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'image_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconImport.tsx b/packages/semi-icons/src/icons/IconImport.tsx index 5a8e10a6fe..f69d3b4666 100644 --- a/packages/semi-icons/src/icons/IconImport.tsx +++ b/packages/semi-icons/src/icons/IconImport.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + - ); } - const IconComponent = convertIcon(SvgComponent, 'import'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInbox.tsx b/packages/semi-icons/src/icons/IconInbox.tsx index fb0589b99a..df79a7c22e 100644 --- a/packages/semi-icons/src/icons/IconInbox.tsx +++ b/packages/semi-icons/src/icons/IconInbox.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'inbox'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIndenpentCornersStroked.tsx b/packages/semi-icons/src/icons/IconIndenpentCornersStroked.tsx index ffedae8468..02b833cfa9 100644 --- a/packages/semi-icons/src/icons/IconIndenpentCornersStroked.tsx +++ b/packages/semi-icons/src/icons/IconIndenpentCornersStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'indenpent_corners_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIndentLeft.tsx b/packages/semi-icons/src/icons/IconIndentLeft.tsx index 68be4dd988..fec80ee0a1 100644 --- a/packages/semi-icons/src/icons/IconIndentLeft.tsx +++ b/packages/semi-icons/src/icons/IconIndentLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'indent_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIndentRight.tsx b/packages/semi-icons/src/icons/IconIndentRight.tsx index 03eef31219..4885e6f75b 100644 --- a/packages/semi-icons/src/icons/IconIndentRight.tsx +++ b/packages/semi-icons/src/icons/IconIndentRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'indent_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIndependentCornersStroked.tsx b/packages/semi-icons/src/icons/IconIndependentCornersStroked.tsx index a0ce085c80..6eb9123f11 100644 --- a/packages/semi-icons/src/icons/IconIndependentCornersStroked.tsx +++ b/packages/semi-icons/src/icons/IconIndependentCornersStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'independent_corners_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInfoCircle.tsx b/packages/semi-icons/src/icons/IconInfoCircle.tsx index ea894aefa4..38e1c718f1 100644 --- a/packages/semi-icons/src/icons/IconInfoCircle.tsx +++ b/packages/semi-icons/src/icons/IconInfoCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'info_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInherit.tsx b/packages/semi-icons/src/icons/IconInherit.tsx index 050f35c9c1..267aa86e2b 100644 --- a/packages/semi-icons/src/icons/IconInherit.tsx +++ b/packages/semi-icons/src/icons/IconInherit.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'inherit'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInheritStroked.tsx b/packages/semi-icons/src/icons/IconInheritStroked.tsx index e3b1ab7289..9617fb3bd3 100644 --- a/packages/semi-icons/src/icons/IconInheritStroked.tsx +++ b/packages/semi-icons/src/icons/IconInheritStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'inherit_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInnerSectionStroked.tsx b/packages/semi-icons/src/icons/IconInnerSectionStroked.tsx index 2ab89490cf..ac8a4b3da2 100644 --- a/packages/semi-icons/src/icons/IconInnerSectionStroked.tsx +++ b/packages/semi-icons/src/icons/IconInnerSectionStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'inner_section_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInstagram.tsx b/packages/semi-icons/src/icons/IconInstagram.tsx index 8db3e7a4b5..b3fd719002 100644 --- a/packages/semi-icons/src/icons/IconInstagram.tsx +++ b/packages/semi-icons/src/icons/IconInstagram.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'instagram'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInteractiveStroked.tsx b/packages/semi-icons/src/icons/IconInteractiveStroked.tsx index 037886f86d..64fae488e0 100644 --- a/packages/semi-icons/src/icons/IconInteractiveStroked.tsx +++ b/packages/semi-icons/src/icons/IconInteractiveStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'interactive_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconInviteStroked.tsx b/packages/semi-icons/src/icons/IconInviteStroked.tsx index e4fb1691fc..05ec0581cc 100644 --- a/packages/semi-icons/src/icons/IconInviteStroked.tsx +++ b/packages/semi-icons/src/icons/IconInviteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'invite_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconIssueStroked.tsx b/packages/semi-icons/src/icons/IconIssueStroked.tsx index 2c73a2f7a9..f8b3768e15 100644 --- a/packages/semi-icons/src/icons/IconIssueStroked.tsx +++ b/packages/semi-icons/src/icons/IconIssueStroked.tsx @@ -1,31 +1,44 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( - - - + + + - + ); } - const IconComponent = convertIcon(SvgComponent, 'issue_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconItalic.tsx b/packages/semi-icons/src/icons/IconItalic.tsx index b7a5e33cf5..fcf9ef9c16 100644 --- a/packages/semi-icons/src/icons/IconItalic.tsx +++ b/packages/semi-icons/src/icons/IconItalic.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'italic'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconJianying.tsx b/packages/semi-icons/src/icons/IconJianying.tsx index 42fe3f4872..2efaa9ec03 100644 --- a/packages/semi-icons/src/icons/IconJianying.tsx +++ b/packages/semi-icons/src/icons/IconJianying.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'jianying'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconKanban.tsx b/packages/semi-icons/src/icons/IconKanban.tsx index b7e92be186..695203e928 100644 --- a/packages/semi-icons/src/icons/IconKanban.tsx +++ b/packages/semi-icons/src/icons/IconKanban.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'kanban'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconKey.tsx b/packages/semi-icons/src/icons/IconKey.tsx index 57df542925..47453cadd6 100644 --- a/packages/semi-icons/src/icons/IconKey.tsx +++ b/packages/semi-icons/src/icons/IconKey.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'key'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconKeyStroked.tsx b/packages/semi-icons/src/icons/IconKeyStroked.tsx index 49441d6e23..2a5098d06f 100644 --- a/packages/semi-icons/src/icons/IconKeyStroked.tsx +++ b/packages/semi-icons/src/icons/IconKeyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'key_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLanguage.tsx b/packages/semi-icons/src/icons/IconLanguage.tsx index 873cc857bb..04bc6f1dee 100644 --- a/packages/semi-icons/src/icons/IconLanguage.tsx +++ b/packages/semi-icons/src/icons/IconLanguage.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'language'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLayers.tsx b/packages/semi-icons/src/icons/IconLayers.tsx index eea34df00a..1905b7f2ac 100644 --- a/packages/semi-icons/src/icons/IconLayers.tsx +++ b/packages/semi-icons/src/icons/IconLayers.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'layers'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLeftCircleStroked.tsx b/packages/semi-icons/src/icons/IconLeftCircleStroked.tsx index f03c70dac3..842e9cd0e1 100644 --- a/packages/semi-icons/src/icons/IconLeftCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconLeftCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'left_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLightningStroked.tsx b/packages/semi-icons/src/icons/IconLightningStroked.tsx index f1e96d9647..89efc0748a 100644 --- a/packages/semi-icons/src/icons/IconLightningStroked.tsx +++ b/packages/semi-icons/src/icons/IconLightningStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'lightning_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLikeHeart.tsx b/packages/semi-icons/src/icons/IconLikeHeart.tsx index 5d71832317..93e4591cdf 100644 --- a/packages/semi-icons/src/icons/IconLikeHeart.tsx +++ b/packages/semi-icons/src/icons/IconLikeHeart.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'like_heart'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLikeThumb.tsx b/packages/semi-icons/src/icons/IconLikeThumb.tsx index c57e91f103..99e38e2426 100644 --- a/packages/semi-icons/src/icons/IconLikeThumb.tsx +++ b/packages/semi-icons/src/icons/IconLikeThumb.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'like_thumb'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLineChartStroked.tsx b/packages/semi-icons/src/icons/IconLineChartStroked.tsx index bd407e7647..0201c681be 100644 --- a/packages/semi-icons/src/icons/IconLineChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconLineChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'line_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLineHeight.tsx b/packages/semi-icons/src/icons/IconLineHeight.tsx index 304c4d3fe0..f546d95eb4 100644 --- a/packages/semi-icons/src/icons/IconLineHeight.tsx +++ b/packages/semi-icons/src/icons/IconLineHeight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'line_height'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLink.tsx b/packages/semi-icons/src/icons/IconLink.tsx index 77aebcb4c5..f94a15c4e4 100644 --- a/packages/semi-icons/src/icons/IconLink.tsx +++ b/packages/semi-icons/src/icons/IconLink.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'link'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconList.tsx b/packages/semi-icons/src/icons/IconList.tsx index 3ac4072402..ce075198ea 100644 --- a/packages/semi-icons/src/icons/IconList.tsx +++ b/packages/semi-icons/src/icons/IconList.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'list'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconListView.tsx b/packages/semi-icons/src/icons/IconListView.tsx index 126f9032da..5263e6382b 100644 --- a/packages/semi-icons/src/icons/IconListView.tsx +++ b/packages/semi-icons/src/icons/IconListView.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'list_view'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLive.tsx b/packages/semi-icons/src/icons/IconLive.tsx index f762cd8b98..a0232f4403 100644 --- a/packages/semi-icons/src/icons/IconLive.tsx +++ b/packages/semi-icons/src/icons/IconLive.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'live'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLoading.tsx b/packages/semi-icons/src/icons/IconLoading.tsx index 6c988248ef..731d1346e2 100644 --- a/packages/semi-icons/src/icons/IconLoading.tsx +++ b/packages/semi-icons/src/icons/IconLoading.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { @@ -29,6 +28,5 @@ function SvgComponent(props: React.SVGProps) { ); } - const IconComponent = convertIcon(SvgComponent, 'loading'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLock.tsx b/packages/semi-icons/src/icons/IconLock.tsx index 8c70bb023a..6c40dc99b3 100644 --- a/packages/semi-icons/src/icons/IconLock.tsx +++ b/packages/semi-icons/src/icons/IconLock.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'lock'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLockStroked.tsx b/packages/semi-icons/src/icons/IconLockStroked.tsx index d3cebb84f7..1b36ae907c 100644 --- a/packages/semi-icons/src/icons/IconLockStroked.tsx +++ b/packages/semi-icons/src/icons/IconLockStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'lock_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconLoopTextStroked.tsx b/packages/semi-icons/src/icons/IconLoopTextStroked.tsx index dce42ed021..428230b677 100644 --- a/packages/semi-icons/src/icons/IconLoopTextStroked.tsx +++ b/packages/semi-icons/src/icons/IconLoopTextStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'loop_text_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMail.tsx b/packages/semi-icons/src/icons/IconMail.tsx index c1a5344c15..b9f0668b87 100644 --- a/packages/semi-icons/src/icons/IconMail.tsx +++ b/packages/semi-icons/src/icons/IconMail.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'mail'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMailStroked.tsx b/packages/semi-icons/src/icons/IconMailStroked.tsx index 87312d93eb..ade94735e4 100644 --- a/packages/semi-icons/src/icons/IconMailStroked.tsx +++ b/packages/semi-icons/src/icons/IconMailStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'mail_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMailStroked1.tsx b/packages/semi-icons/src/icons/IconMailStroked1.tsx index dd0a059e64..064ea15c3b 100644 --- a/packages/semi-icons/src/icons/IconMailStroked1.tsx +++ b/packages/semi-icons/src/icons/IconMailStroked1.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'mail_stroked_1'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMale.tsx b/packages/semi-icons/src/icons/IconMale.tsx index 7d58e005ca..d4083eacfb 100644 --- a/packages/semi-icons/src/icons/IconMale.tsx +++ b/packages/semi-icons/src/icons/IconMale.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'male'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMapPin.tsx b/packages/semi-icons/src/icons/IconMapPin.tsx index fe00d85c9e..51df9377e8 100644 --- a/packages/semi-icons/src/icons/IconMapPin.tsx +++ b/packages/semi-icons/src/icons/IconMapPin.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'map_pin'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMapPinStroked.tsx b/packages/semi-icons/src/icons/IconMapPinStroked.tsx index 4caa7bfa74..6f72c815d4 100644 --- a/packages/semi-icons/src/icons/IconMapPinStroked.tsx +++ b/packages/semi-icons/src/icons/IconMapPinStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'map_pin_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMarginLeftStroked.tsx b/packages/semi-icons/src/icons/IconMarginLeftStroked.tsx index 079e783e48..4d0f799ea4 100644 --- a/packages/semi-icons/src/icons/IconMarginLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconMarginLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'margin_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMarginStroked.tsx b/packages/semi-icons/src/icons/IconMarginStroked.tsx index 1d1b03fb49..0b87cd8c4f 100644 --- a/packages/semi-icons/src/icons/IconMarginStroked.tsx +++ b/packages/semi-icons/src/icons/IconMarginStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'margin_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMark.tsx b/packages/semi-icons/src/icons/IconMark.tsx index cb2cc65107..43d84a4aa0 100644 --- a/packages/semi-icons/src/icons/IconMark.tsx +++ b/packages/semi-icons/src/icons/IconMark.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'mark'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMaximize.tsx b/packages/semi-icons/src/icons/IconMaximize.tsx index 027ebf220d..2d1d58291c 100644 --- a/packages/semi-icons/src/icons/IconMaximize.tsx +++ b/packages/semi-icons/src/icons/IconMaximize.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'maximize'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMember.tsx b/packages/semi-icons/src/icons/IconMember.tsx index 77acd09c9e..648209cf31 100644 --- a/packages/semi-icons/src/icons/IconMember.tsx +++ b/packages/semi-icons/src/icons/IconMember.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'member'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMenu.tsx b/packages/semi-icons/src/icons/IconMenu.tsx index 70b151219e..4f2c98ac65 100644 --- a/packages/semi-icons/src/icons/IconMenu.tsx +++ b/packages/semi-icons/src/icons/IconMenu.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { > + - ); } - const IconComponent = convertIcon(SvgComponent, 'menu'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMicrophone.tsx b/packages/semi-icons/src/icons/IconMicrophone.tsx index 7a918ae1a6..c91ba51cf5 100644 --- a/packages/semi-icons/src/icons/IconMicrophone.tsx +++ b/packages/semi-icons/src/icons/IconMicrophone.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + - - + ); } - const IconComponent = convertIcon(SvgComponent, 'microphone'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMicrophoneOff.tsx b/packages/semi-icons/src/icons/IconMicrophoneOff.tsx index b5d6c77a26..639cb8879d 100644 --- a/packages/semi-icons/src/icons/IconMicrophoneOff.tsx +++ b/packages/semi-icons/src/icons/IconMicrophoneOff.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + - + ); } - const IconComponent = convertIcon(SvgComponent, 'microphone_off'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMinimize.tsx b/packages/semi-icons/src/icons/IconMinimize.tsx index 0d4b493601..aadb288750 100644 --- a/packages/semi-icons/src/icons/IconMinimize.tsx +++ b/packages/semi-icons/src/icons/IconMinimize.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'minimize'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMinus.tsx b/packages/semi-icons/src/icons/IconMinus.tsx index a1206ceb59..2ecb93cd78 100644 --- a/packages/semi-icons/src/icons/IconMinus.tsx +++ b/packages/semi-icons/src/icons/IconMinus.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'minus'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMinusCircle.tsx b/packages/semi-icons/src/icons/IconMinusCircle.tsx index 4bd527ac28..4b8379b4b6 100644 --- a/packages/semi-icons/src/icons/IconMinusCircle.tsx +++ b/packages/semi-icons/src/icons/IconMinusCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'minus_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMinusCircleStroked.tsx b/packages/semi-icons/src/icons/IconMinusCircleStroked.tsx index c9193d8bfc..315a8e88ad 100644 --- a/packages/semi-icons/src/icons/IconMinusCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconMinusCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'minus_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMinusStroked.tsx b/packages/semi-icons/src/icons/IconMinusStroked.tsx index f25a017cac..9408da29d0 100644 --- a/packages/semi-icons/src/icons/IconMinusStroked.tsx +++ b/packages/semi-icons/src/icons/IconMinusStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'minus_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconModalStroked.tsx b/packages/semi-icons/src/icons/IconModalStroked.tsx index c9f73574f5..0b8e9be076 100644 --- a/packages/semi-icons/src/icons/IconModalStroked.tsx +++ b/packages/semi-icons/src/icons/IconModalStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'modal_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMoneyExchangeStroked.tsx b/packages/semi-icons/src/icons/IconMoneyExchangeStroked.tsx index dcf7dc64df..c618023418 100644 --- a/packages/semi-icons/src/icons/IconMoneyExchangeStroked.tsx +++ b/packages/semi-icons/src/icons/IconMoneyExchangeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'money_exchange_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMonitorStroked.tsx b/packages/semi-icons/src/icons/IconMonitorStroked.tsx index 5e00492768..325c8afd6b 100644 --- a/packages/semi-icons/src/icons/IconMonitorStroked.tsx +++ b/packages/semi-icons/src/icons/IconMonitorStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'monitor_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMoon.tsx b/packages/semi-icons/src/icons/IconMoon.tsx index 4089f29f89..13dc435f6c 100644 --- a/packages/semi-icons/src/icons/IconMoon.tsx +++ b/packages/semi-icons/src/icons/IconMoon.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'moon'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMore.tsx b/packages/semi-icons/src/icons/IconMore.tsx index fa5143de38..3baa186361 100644 --- a/packages/semi-icons/src/icons/IconMore.tsx +++ b/packages/semi-icons/src/icons/IconMore.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'more'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMoreStroked.tsx b/packages/semi-icons/src/icons/IconMoreStroked.tsx index 7a722a6451..0b74ddfbb8 100644 --- a/packages/semi-icons/src/icons/IconMoreStroked.tsx +++ b/packages/semi-icons/src/icons/IconMoreStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - - + + + ); } - const IconComponent = convertIcon(SvgComponent, 'more_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMusic.tsx b/packages/semi-icons/src/icons/IconMusic.tsx index 8a578e890f..d00e6e3d66 100644 --- a/packages/semi-icons/src/icons/IconMusic.tsx +++ b/packages/semi-icons/src/icons/IconMusic.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'music'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMusicNoteStroked.tsx b/packages/semi-icons/src/icons/IconMusicNoteStroked.tsx index 179012982e..43fa0a50f8 100644 --- a/packages/semi-icons/src/icons/IconMusicNoteStroked.tsx +++ b/packages/semi-icons/src/icons/IconMusicNoteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'music_note_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconMute.tsx b/packages/semi-icons/src/icons/IconMute.tsx index f9a1cbda39..2befe26359 100644 --- a/packages/semi-icons/src/icons/IconMute.tsx +++ b/packages/semi-icons/src/icons/IconMute.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'mute'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconNineGridStroked.tsx b/packages/semi-icons/src/icons/IconNineGridStroked.tsx index 605f4e99c3..c0cfc24d22 100644 --- a/packages/semi-icons/src/icons/IconNineGridStroked.tsx +++ b/packages/semi-icons/src/icons/IconNineGridStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'nine_grid_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconNoteMoneyStroked.tsx b/packages/semi-icons/src/icons/IconNoteMoneyStroked.tsx index 4a91f1b560..a997501d4d 100644 --- a/packages/semi-icons/src/icons/IconNoteMoneyStroked.tsx +++ b/packages/semi-icons/src/icons/IconNoteMoneyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'note_money_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconOption.tsx b/packages/semi-icons/src/icons/IconOption.tsx index 345b5765e2..da84de930a 100644 --- a/packages/semi-icons/src/icons/IconOption.tsx +++ b/packages/semi-icons/src/icons/IconOption.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'option'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconOrderedList.tsx b/packages/semi-icons/src/icons/IconOrderedList.tsx index b3d1a68d21..f56bb1c56c 100644 --- a/packages/semi-icons/src/icons/IconOrderedList.tsx +++ b/packages/semi-icons/src/icons/IconOrderedList.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ordered_list'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconOrderedListStroked.tsx b/packages/semi-icons/src/icons/IconOrderedListStroked.tsx index 821a17c853..b1d03b861a 100644 --- a/packages/semi-icons/src/icons/IconOrderedListStroked.tsx +++ b/packages/semi-icons/src/icons/IconOrderedListStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ordered_list_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPaperclip.tsx b/packages/semi-icons/src/icons/IconPaperclip.tsx index 82df89eda6..24bdfac95c 100644 --- a/packages/semi-icons/src/icons/IconPaperclip.tsx +++ b/packages/semi-icons/src/icons/IconPaperclip.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'paperclip'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPause.tsx b/packages/semi-icons/src/icons/IconPause.tsx index b55dea4e0d..59c4bc0f1b 100644 --- a/packages/semi-icons/src/icons/IconPause.tsx +++ b/packages/semi-icons/src/icons/IconPause.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - - + + ); } - const IconComponent = convertIcon(SvgComponent, 'pause'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPercentage.tsx b/packages/semi-icons/src/icons/IconPercentage.tsx index 25333b8761..cae16417ff 100644 --- a/packages/semi-icons/src/icons/IconPercentage.tsx +++ b/packages/semi-icons/src/icons/IconPercentage.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'percentage'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPhone.tsx b/packages/semi-icons/src/icons/IconPhone.tsx index c5491a41a5..ff11fe8cf0 100644 --- a/packages/semi-icons/src/icons/IconPhone.tsx +++ b/packages/semi-icons/src/icons/IconPhone.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'phone'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPhoneStroke.tsx b/packages/semi-icons/src/icons/IconPhoneStroke.tsx index 89c87f66fe..fb5783017d 100644 --- a/packages/semi-icons/src/icons/IconPhoneStroke.tsx +++ b/packages/semi-icons/src/icons/IconPhoneStroke.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'phone_stroke'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPieChart2Stroked.tsx b/packages/semi-icons/src/icons/IconPieChart2Stroked.tsx index 3ad1403890..c4e6c3342a 100644 --- a/packages/semi-icons/src/icons/IconPieChart2Stroked.tsx +++ b/packages/semi-icons/src/icons/IconPieChart2Stroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'pie_chart_2_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPieChartStroked.tsx b/packages/semi-icons/src/icons/IconPieChartStroked.tsx index 1ef14a0e21..9aba6a891b 100644 --- a/packages/semi-icons/src/icons/IconPieChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconPieChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'pie_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPiechartH5Stroked.tsx b/packages/semi-icons/src/icons/IconPiechartH5Stroked.tsx index 4fc145cf8e..7f63c6cd47 100644 --- a/packages/semi-icons/src/icons/IconPiechartH5Stroked.tsx +++ b/packages/semi-icons/src/icons/IconPiechartH5Stroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'piechart_h5_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPipixiaLogo.tsx b/packages/semi-icons/src/icons/IconPipixiaLogo.tsx index d5fb537389..3d0602a56e 100644 --- a/packages/semi-icons/src/icons/IconPipixiaLogo.tsx +++ b/packages/semi-icons/src/icons/IconPipixiaLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'pipixia_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlay.tsx b/packages/semi-icons/src/icons/IconPlay.tsx index 5fb4ab8c43..43a3ffc2a3 100644 --- a/packages/semi-icons/src/icons/IconPlay.tsx +++ b/packages/semi-icons/src/icons/IconPlay.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'play'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlayCircle.tsx b/packages/semi-icons/src/icons/IconPlayCircle.tsx index 0ff452f02c..8ecaa89205 100644 --- a/packages/semi-icons/src/icons/IconPlayCircle.tsx +++ b/packages/semi-icons/src/icons/IconPlayCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'play_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlus.tsx b/packages/semi-icons/src/icons/IconPlus.tsx index 8c493017fb..8213c21f52 100644 --- a/packages/semi-icons/src/icons/IconPlus.tsx +++ b/packages/semi-icons/src/icons/IconPlus.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'plus'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlusCircle.tsx b/packages/semi-icons/src/icons/IconPlusCircle.tsx index 1b0264c0c0..5fdee20480 100644 --- a/packages/semi-icons/src/icons/IconPlusCircle.tsx +++ b/packages/semi-icons/src/icons/IconPlusCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'plus_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlusCircleStroked.tsx b/packages/semi-icons/src/icons/IconPlusCircleStroked.tsx index ebd2f29699..2d525e90c6 100644 --- a/packages/semi-icons/src/icons/IconPlusCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconPlusCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'plus_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPlusStroked.tsx b/packages/semi-icons/src/icons/IconPlusStroked.tsx index abc507e325..cb0fde5e01 100644 --- a/packages/semi-icons/src/icons/IconPlusStroked.tsx +++ b/packages/semi-icons/src/icons/IconPlusStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'plus_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPriceTag.tsx b/packages/semi-icons/src/icons/IconPriceTag.tsx index 0821e18cfe..85796f0cb7 100644 --- a/packages/semi-icons/src/icons/IconPriceTag.tsx +++ b/packages/semi-icons/src/icons/IconPriceTag.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'price_tag'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPrint.tsx b/packages/semi-icons/src/icons/IconPrint.tsx index e2f4a54ee3..b736fa0189 100644 --- a/packages/semi-icons/src/icons/IconPrint.tsx +++ b/packages/semi-icons/src/icons/IconPrint.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'print'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPrizeStroked.tsx b/packages/semi-icons/src/icons/IconPrizeStroked.tsx index 9fe20a9c17..f7f5e18e2d 100644 --- a/packages/semi-icons/src/icons/IconPrizeStroked.tsx +++ b/packages/semi-icons/src/icons/IconPrizeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'prize_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPulse.tsx b/packages/semi-icons/src/icons/IconPulse.tsx index c94df5cd37..f1af6796d3 100644 --- a/packages/semi-icons/src/icons/IconPulse.tsx +++ b/packages/semi-icons/src/icons/IconPulse.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'pulse'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconPuzzle.tsx b/packages/semi-icons/src/icons/IconPuzzle.tsx index 06b4626a04..0fbd8611cb 100644 --- a/packages/semi-icons/src/icons/IconPuzzle.tsx +++ b/packages/semi-icons/src/icons/IconPuzzle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'puzzle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconQingyan.tsx b/packages/semi-icons/src/icons/IconQingyan.tsx index be533596b8..626b8ad2a8 100644 --- a/packages/semi-icons/src/icons/IconQingyan.tsx +++ b/packages/semi-icons/src/icons/IconQingyan.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'qingyan'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconQrCode.tsx b/packages/semi-icons/src/icons/IconQrCode.tsx index cafb776f5d..7aef9368f8 100644 --- a/packages/semi-icons/src/icons/IconQrCode.tsx +++ b/packages/semi-icons/src/icons/IconQrCode.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'qr_code'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconQuit.tsx b/packages/semi-icons/src/icons/IconQuit.tsx index 45978702ed..097ec6dea4 100644 --- a/packages/semi-icons/src/icons/IconQuit.tsx +++ b/packages/semi-icons/src/icons/IconQuit.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'quit'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconQuote.tsx b/packages/semi-icons/src/icons/IconQuote.tsx index f822e24af8..eefa356e1f 100644 --- a/packages/semi-icons/src/icons/IconQuote.tsx +++ b/packages/semi-icons/src/icons/IconQuote.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'quote'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRadio.tsx b/packages/semi-icons/src/icons/IconRadio.tsx index 805bec3f52..08351a7e9d 100644 --- a/packages/semi-icons/src/icons/IconRadio.tsx +++ b/packages/semi-icons/src/icons/IconRadio.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'radio'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRankingCardStroked.tsx b/packages/semi-icons/src/icons/IconRankingCardStroked.tsx index c87d4dc5c0..0e6df6d12a 100644 --- a/packages/semi-icons/src/icons/IconRankingCardStroked.tsx +++ b/packages/semi-icons/src/icons/IconRankingCardStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ranking_card_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRealSizeStroked.tsx b/packages/semi-icons/src/icons/IconRealSizeStroked.tsx index 0f0faa1bef..1fed1e17f2 100644 --- a/packages/semi-icons/src/icons/IconRealSizeStroked.tsx +++ b/packages/semi-icons/src/icons/IconRealSizeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'real_size_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRedo.tsx b/packages/semi-icons/src/icons/IconRedo.tsx index 2d911e1d51..82492f3ba8 100644 --- a/packages/semi-icons/src/icons/IconRedo.tsx +++ b/packages/semi-icons/src/icons/IconRedo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'redo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRedoStroked.tsx b/packages/semi-icons/src/icons/IconRedoStroked.tsx index 8c6c2753a8..6b98f2cf75 100644 --- a/packages/semi-icons/src/icons/IconRedoStroked.tsx +++ b/packages/semi-icons/src/icons/IconRedoStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'redo_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRefresh.tsx b/packages/semi-icons/src/icons/IconRefresh.tsx index f3e4711042..4fbc38bf6f 100644 --- a/packages/semi-icons/src/icons/IconRefresh.tsx +++ b/packages/semi-icons/src/icons/IconRefresh.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'refresh'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRefresh2.tsx b/packages/semi-icons/src/icons/IconRefresh2.tsx index 6a8459f6a8..7c5432447b 100644 --- a/packages/semi-icons/src/icons/IconRefresh2.tsx +++ b/packages/semi-icons/src/icons/IconRefresh2.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'refresh2'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRegExp.tsx b/packages/semi-icons/src/icons/IconRegExp.tsx index ab7e4804a3..ea7f33f562 100644 --- a/packages/semi-icons/src/icons/IconRegExp.tsx +++ b/packages/semi-icons/src/icons/IconRegExp.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'reg_exp'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconReply.tsx b/packages/semi-icons/src/icons/IconReply.tsx index f08afd33c2..d342e68978 100644 --- a/packages/semi-icons/src/icons/IconReply.tsx +++ b/packages/semi-icons/src/icons/IconReply.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'reply'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconReplyStroked.tsx b/packages/semi-icons/src/icons/IconReplyStroked.tsx index 2d69ecbace..8960785f16 100644 --- a/packages/semi-icons/src/icons/IconReplyStroked.tsx +++ b/packages/semi-icons/src/icons/IconReplyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'reply_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconResso.tsx b/packages/semi-icons/src/icons/IconResso.tsx index b7e8ced7e3..b1a11de9f5 100644 --- a/packages/semi-icons/src/icons/IconResso.tsx +++ b/packages/semi-icons/src/icons/IconResso.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'resso'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRestart.tsx b/packages/semi-icons/src/icons/IconRestart.tsx index 12a5ad4ab0..6f02b72805 100644 --- a/packages/semi-icons/src/icons/IconRestart.tsx +++ b/packages/semi-icons/src/icons/IconRestart.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + - ); } - const IconComponent = convertIcon(SvgComponent, 'restart'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRingChartStroked.tsx b/packages/semi-icons/src/icons/IconRingChartStroked.tsx index fad8858a98..7da5980ec7 100644 --- a/packages/semi-icons/src/icons/IconRingChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconRingChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ring_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRotate.tsx b/packages/semi-icons/src/icons/IconRotate.tsx index f370518f23..64356be535 100644 --- a/packages/semi-icons/src/icons/IconRotate.tsx +++ b/packages/semi-icons/src/icons/IconRotate.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'rotate'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRotationStroked.tsx b/packages/semi-icons/src/icons/IconRotationStroked.tsx index a54d9a5d24..78f62cf245 100644 --- a/packages/semi-icons/src/icons/IconRotationStroked.tsx +++ b/packages/semi-icons/src/icons/IconRotationStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'rotation_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRoute.tsx b/packages/semi-icons/src/icons/IconRoute.tsx index fb65597f1c..66bc91d557 100644 --- a/packages/semi-icons/src/icons/IconRoute.tsx +++ b/packages/semi-icons/src/icons/IconRoute.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'route'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconRowsStroked.tsx b/packages/semi-icons/src/icons/IconRowsStroked.tsx index 6ea887adef..d738e98154 100644 --- a/packages/semi-icons/src/icons/IconRowsStroked.tsx +++ b/packages/semi-icons/src/icons/IconRowsStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'rows_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSafe.tsx b/packages/semi-icons/src/icons/IconSafe.tsx index 7e5ea39f9c..e2ff7dc50b 100644 --- a/packages/semi-icons/src/icons/IconSafe.tsx +++ b/packages/semi-icons/src/icons/IconSafe.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'safe'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSave.tsx b/packages/semi-icons/src/icons/IconSave.tsx index ce4a24d8ea..e44b968cb4 100644 --- a/packages/semi-icons/src/icons/IconSave.tsx +++ b/packages/semi-icons/src/icons/IconSave.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'save'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSaveStroked.tsx b/packages/semi-icons/src/icons/IconSaveStroked.tsx index d816c7f71c..93e934ca4c 100644 --- a/packages/semi-icons/src/icons/IconSaveStroked.tsx +++ b/packages/semi-icons/src/icons/IconSaveStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'save_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconScan.tsx b/packages/semi-icons/src/icons/IconScan.tsx index 5a84f11904..4ce1a69840 100644 --- a/packages/semi-icons/src/icons/IconScan.tsx +++ b/packages/semi-icons/src/icons/IconScan.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'scan'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconScissors.tsx b/packages/semi-icons/src/icons/IconScissors.tsx index 3df6e1e342..44173e0aea 100644 --- a/packages/semi-icons/src/icons/IconScissors.tsx +++ b/packages/semi-icons/src/icons/IconScissors.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'scissors'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSearch.tsx b/packages/semi-icons/src/icons/IconSearch.tsx index 56afaa93f9..42e30dcce2 100644 --- a/packages/semi-icons/src/icons/IconSearch.tsx +++ b/packages/semi-icons/src/icons/IconSearch.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'search'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSearchStroked.tsx b/packages/semi-icons/src/icons/IconSearchStroked.tsx index da399aa283..d46652f1ac 100644 --- a/packages/semi-icons/src/icons/IconSearchStroked.tsx +++ b/packages/semi-icons/src/icons/IconSearchStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'search_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSectionStroked.tsx b/packages/semi-icons/src/icons/IconSectionStroked.tsx index 2ed2cd7bc3..18fc2fa0d2 100644 --- a/packages/semi-icons/src/icons/IconSectionStroked.tsx +++ b/packages/semi-icons/src/icons/IconSectionStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'section_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSemiLogo.tsx b/packages/semi-icons/src/icons/IconSemiLogo.tsx index 2e8b4e094e..e21a4033ef 100644 --- a/packages/semi-icons/src/icons/IconSemiLogo.tsx +++ b/packages/semi-icons/src/icons/IconSemiLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'semi_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSend.tsx b/packages/semi-icons/src/icons/IconSend.tsx index 7598975d2f..cdc48d7575 100644 --- a/packages/semi-icons/src/icons/IconSend.tsx +++ b/packages/semi-icons/src/icons/IconSend.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'send'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSendMsgStroked.tsx b/packages/semi-icons/src/icons/IconSendMsgStroked.tsx index d8f530183a..105a9c937c 100644 --- a/packages/semi-icons/src/icons/IconSendMsgStroked.tsx +++ b/packages/semi-icons/src/icons/IconSendMsgStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'send_msg_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSendStroked.tsx b/packages/semi-icons/src/icons/IconSendStroked.tsx index aa13c610d7..5c30629b0a 100644 --- a/packages/semi-icons/src/icons/IconSendStroked.tsx +++ b/packages/semi-icons/src/icons/IconSendStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'send_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconServer.tsx b/packages/semi-icons/src/icons/IconServer.tsx index 1a43e01717..703a06efc5 100644 --- a/packages/semi-icons/src/icons/IconServer.tsx +++ b/packages/semi-icons/src/icons/IconServer.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'server'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconServerStroked.tsx b/packages/semi-icons/src/icons/IconServerStroked.tsx index 62114193c9..07aac9b621 100644 --- a/packages/semi-icons/src/icons/IconServerStroked.tsx +++ b/packages/semi-icons/src/icons/IconServerStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'server_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSetting.tsx b/packages/semi-icons/src/icons/IconSetting.tsx index 82a016d00e..42d53edf6b 100644 --- a/packages/semi-icons/src/icons/IconSetting.tsx +++ b/packages/semi-icons/src/icons/IconSetting.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'setting'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSettingStroked.tsx b/packages/semi-icons/src/icons/IconSettingStroked.tsx index 22aa7784e0..1dc4a6933e 100644 --- a/packages/semi-icons/src/icons/IconSettingStroked.tsx +++ b/packages/semi-icons/src/icons/IconSettingStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'setting_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShareMoneyStroked.tsx b/packages/semi-icons/src/icons/IconShareMoneyStroked.tsx index f7e366ba29..69f5653a70 100644 --- a/packages/semi-icons/src/icons/IconShareMoneyStroked.tsx +++ b/packages/semi-icons/src/icons/IconShareMoneyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'share_money_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShareStroked.tsx b/packages/semi-icons/src/icons/IconShareStroked.tsx index 15d1dfd57f..f707931a0d 100644 --- a/packages/semi-icons/src/icons/IconShareStroked.tsx +++ b/packages/semi-icons/src/icons/IconShareStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'share_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShield.tsx b/packages/semi-icons/src/icons/IconShield.tsx index babf763307..0569ed438b 100644 --- a/packages/semi-icons/src/icons/IconShield.tsx +++ b/packages/semi-icons/src/icons/IconShield.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'shield'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShieldStroked.tsx b/packages/semi-icons/src/icons/IconShieldStroked.tsx index 139e2f72df..b2277803e8 100644 --- a/packages/semi-icons/src/icons/IconShieldStroked.tsx +++ b/packages/semi-icons/src/icons/IconShieldStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ) { ); } - const IconComponent = convertIcon(SvgComponent, 'shield_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShift.tsx b/packages/semi-icons/src/icons/IconShift.tsx index 63f5067cc9..27d6ec52d5 100644 --- a/packages/semi-icons/src/icons/IconShift.tsx +++ b/packages/semi-icons/src/icons/IconShift.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'shift'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShoppingBag.tsx b/packages/semi-icons/src/icons/IconShoppingBag.tsx index 2cc65847c8..c88bcba32f 100644 --- a/packages/semi-icons/src/icons/IconShoppingBag.tsx +++ b/packages/semi-icons/src/icons/IconShoppingBag.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'shopping_bag'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShrink.tsx b/packages/semi-icons/src/icons/IconShrink.tsx index b5fb2ff799..6a02319464 100644 --- a/packages/semi-icons/src/icons/IconShrink.tsx +++ b/packages/semi-icons/src/icons/IconShrink.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'shrink'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconShrinkScreenStroked.tsx b/packages/semi-icons/src/icons/IconShrinkScreenStroked.tsx index 7e930a7fb2..cd33eb5ddc 100644 --- a/packages/semi-icons/src/icons/IconShrinkScreenStroked.tsx +++ b/packages/semi-icons/src/icons/IconShrinkScreenStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'shrink_screen_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSidebar.tsx b/packages/semi-icons/src/icons/IconSidebar.tsx index c137e9427e..5187bd7460 100644 --- a/packages/semi-icons/src/icons/IconSidebar.tsx +++ b/packages/semi-icons/src/icons/IconSidebar.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'sidebar'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSignal.tsx b/packages/semi-icons/src/icons/IconSignal.tsx index e82c77530c..d4c122b7d4 100644 --- a/packages/semi-icons/src/icons/IconSignal.tsx +++ b/packages/semi-icons/src/icons/IconSignal.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'signal'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSimilarity.tsx b/packages/semi-icons/src/icons/IconSimilarity.tsx index 63d59aee62..4c56489e3c 100644 --- a/packages/semi-icons/src/icons/IconSimilarity.tsx +++ b/packages/semi-icons/src/icons/IconSimilarity.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'similarity'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmallTriangleDown.tsx b/packages/semi-icons/src/icons/IconSmallTriangleDown.tsx index 7ebf0e6e58..328c55d45f 100644 --- a/packages/semi-icons/src/icons/IconSmallTriangleDown.tsx +++ b/packages/semi-icons/src/icons/IconSmallTriangleDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'small_triangle_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmallTriangleLeft.tsx b/packages/semi-icons/src/icons/IconSmallTriangleLeft.tsx index 4e1fac2341..53b3a6c78a 100644 --- a/packages/semi-icons/src/icons/IconSmallTriangleLeft.tsx +++ b/packages/semi-icons/src/icons/IconSmallTriangleLeft.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'small_triangle_left'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmallTriangleRight.tsx b/packages/semi-icons/src/icons/IconSmallTriangleRight.tsx index d5687bf37a..b926ebafb4 100644 --- a/packages/semi-icons/src/icons/IconSmallTriangleRight.tsx +++ b/packages/semi-icons/src/icons/IconSmallTriangleRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'small_triangle_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmallTriangleTop.tsx b/packages/semi-icons/src/icons/IconSmallTriangleTop.tsx index a1916b1ae4..120275e45d 100644 --- a/packages/semi-icons/src/icons/IconSmallTriangleTop.tsx +++ b/packages/semi-icons/src/icons/IconSmallTriangleTop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'small_triangle_top'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmartphoneCheckStroked.tsx b/packages/semi-icons/src/icons/IconSmartphoneCheckStroked.tsx index f466501a41..86512c9ffa 100644 --- a/packages/semi-icons/src/icons/IconSmartphoneCheckStroked.tsx +++ b/packages/semi-icons/src/icons/IconSmartphoneCheckStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'smartphone_check_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSmartphoneStroked.tsx b/packages/semi-icons/src/icons/IconSmartphoneStroked.tsx index 1095f33277..53ceca561a 100644 --- a/packages/semi-icons/src/icons/IconSmartphoneStroked.tsx +++ b/packages/semi-icons/src/icons/IconSmartphoneStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'smartphone_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSong.tsx b/packages/semi-icons/src/icons/IconSong.tsx index 149fa82e15..148d0c470b 100644 --- a/packages/semi-icons/src/icons/IconSong.tsx +++ b/packages/semi-icons/src/icons/IconSong.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'song'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSonicStroked.tsx b/packages/semi-icons/src/icons/IconSonicStroked.tsx index 29ecb60fe8..6ffe8048a5 100644 --- a/packages/semi-icons/src/icons/IconSonicStroked.tsx +++ b/packages/semi-icons/src/icons/IconSonicStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'sonic_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSort.tsx b/packages/semi-icons/src/icons/IconSort.tsx index 039d309b36..6cb210f2bd 100644 --- a/packages/semi-icons/src/icons/IconSort.tsx +++ b/packages/semi-icons/src/icons/IconSort.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'sort'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSortStroked.tsx b/packages/semi-icons/src/icons/IconSortStroked.tsx index f8591beb4a..7d77e77b9f 100644 --- a/packages/semi-icons/src/icons/IconSortStroked.tsx +++ b/packages/semi-icons/src/icons/IconSortStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'sort_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSourceControl.tsx b/packages/semi-icons/src/icons/IconSourceControl.tsx index f03a261366..432cdb4164 100644 --- a/packages/semi-icons/src/icons/IconSourceControl.tsx +++ b/packages/semi-icons/src/icons/IconSourceControl.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'source_control'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSpin.tsx b/packages/semi-icons/src/icons/IconSpin.tsx index 874355f898..54ee891e48 100644 --- a/packages/semi-icons/src/icons/IconSpin.tsx +++ b/packages/semi-icons/src/icons/IconSpin.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { @@ -40,6 +39,5 @@ function SvgComponent(props: React.SVGProps) { ); } - const IconComponent = convertIcon(SvgComponent, 'spin'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStackBarChartStroked.tsx b/packages/semi-icons/src/icons/IconStackBarChartStroked.tsx index fbd0169980..c5530415e7 100644 --- a/packages/semi-icons/src/icons/IconStackBarChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconStackBarChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'stack_bar_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStar.tsx b/packages/semi-icons/src/icons/IconStar.tsx index 937373ba15..a3bc0d994e 100644 --- a/packages/semi-icons/src/icons/IconStar.tsx +++ b/packages/semi-icons/src/icons/IconStar.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'star'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStarStroked.tsx b/packages/semi-icons/src/icons/IconStarStroked.tsx index c9530d2e83..4aa5660c7e 100644 --- a/packages/semi-icons/src/icons/IconStarStroked.tsx +++ b/packages/semi-icons/src/icons/IconStarStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'star_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStop.tsx b/packages/semi-icons/src/icons/IconStop.tsx index 368fc64272..738e68b917 100644 --- a/packages/semi-icons/src/icons/IconStop.tsx +++ b/packages/semi-icons/src/icons/IconStop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'stop'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStopwatchStroked.tsx b/packages/semi-icons/src/icons/IconStopwatchStroked.tsx index e76bfbdd73..6029aaba87 100644 --- a/packages/semi-icons/src/icons/IconStopwatchStroked.tsx +++ b/packages/semi-icons/src/icons/IconStopwatchStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'stopwatch_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStoryStroked.tsx b/packages/semi-icons/src/icons/IconStoryStroked.tsx index 21e411b0a5..305575192c 100644 --- a/packages/semi-icons/src/icons/IconStoryStroked.tsx +++ b/packages/semi-icons/src/icons/IconStoryStroked.tsx @@ -1,14 +1,13 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'story_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStorysStroked.tsx b/packages/semi-icons/src/icons/IconStorysStroked.tsx deleted file mode 100644 index 77a891b84d..0000000000 --- a/packages/semi-icons/src/icons/IconStorysStroked.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import { convertIcon } from '../components/Icon'; -function SvgComponent(props: React.SVGProps) { - return ( - - - - ); -} -const IconComponent = convertIcon(SvgComponent, 'storys_stroked'); -export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconStrikeThrough.tsx b/packages/semi-icons/src/icons/IconStrikeThrough.tsx index 6f32bd55f3..ccb7723e7f 100644 --- a/packages/semi-icons/src/icons/IconStrikeThrough.tsx +++ b/packages/semi-icons/src/icons/IconStrikeThrough.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'strike_through'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSun.tsx b/packages/semi-icons/src/icons/IconSun.tsx index 7b2bfda4cb..b93134ad67 100644 --- a/packages/semi-icons/src/icons/IconSun.tsx +++ b/packages/semi-icons/src/icons/IconSun.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + + + + + - - - - - - - + + ); } - const IconComponent = convertIcon(SvgComponent, 'sun'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconSync.tsx b/packages/semi-icons/src/icons/IconSync.tsx index da0c8dc1b8..f2cd652043 100644 --- a/packages/semi-icons/src/icons/IconSync.tsx +++ b/packages/semi-icons/src/icons/IconSync.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'sync'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTabArrowStroked.tsx b/packages/semi-icons/src/icons/IconTabArrowStroked.tsx index 20e310c484..862b36480f 100644 --- a/packages/semi-icons/src/icons/IconTabArrowStroked.tsx +++ b/packages/semi-icons/src/icons/IconTabArrowStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tab_arrow_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTabsStroked.tsx b/packages/semi-icons/src/icons/IconTabsStroked.tsx index af60cede88..9a3fe218dc 100644 --- a/packages/semi-icons/src/icons/IconTabsStroked.tsx +++ b/packages/semi-icons/src/icons/IconTabsStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tabs_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTaskMoneyStroked.tsx b/packages/semi-icons/src/icons/IconTaskMoneyStroked.tsx index 517b490052..0da30d451f 100644 --- a/packages/semi-icons/src/icons/IconTaskMoneyStroked.tsx +++ b/packages/semi-icons/src/icons/IconTaskMoneyStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'task_money_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTemplate.tsx b/packages/semi-icons/src/icons/IconTemplate.tsx index 0085a1fb6c..9dc630ab62 100644 --- a/packages/semi-icons/src/icons/IconTemplate.tsx +++ b/packages/semi-icons/src/icons/IconTemplate.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'template'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTemplateStroked.tsx b/packages/semi-icons/src/icons/IconTemplateStroked.tsx index b801687e52..e1b99f3e17 100644 --- a/packages/semi-icons/src/icons/IconTemplateStroked.tsx +++ b/packages/semi-icons/src/icons/IconTemplateStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'template_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTerminal.tsx b/packages/semi-icons/src/icons/IconTerminal.tsx index e0aa6441d7..fd52824d8d 100644 --- a/packages/semi-icons/src/icons/IconTerminal.tsx +++ b/packages/semi-icons/src/icons/IconTerminal.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'terminal'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTestScoreStroked.tsx b/packages/semi-icons/src/icons/IconTestScoreStroked.tsx index 67f1e1a467..6fb0d327ce 100644 --- a/packages/semi-icons/src/icons/IconTestScoreStroked.tsx +++ b/packages/semi-icons/src/icons/IconTestScoreStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'test_score_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconText.tsx b/packages/semi-icons/src/icons/IconText.tsx index fbe84d5cdd..ebdc3611c5 100644 --- a/packages/semi-icons/src/icons/IconText.tsx +++ b/packages/semi-icons/src/icons/IconText.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'text'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTextRectangle.tsx b/packages/semi-icons/src/icons/IconTextRectangle.tsx index 93e20141b1..931f380ee4 100644 --- a/packages/semi-icons/src/icons/IconTextRectangle.tsx +++ b/packages/semi-icons/src/icons/IconTextRectangle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'text_rectangle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTextStroked.tsx b/packages/semi-icons/src/icons/IconTextStroked.tsx index 2f9e9019e1..5149f12316 100644 --- a/packages/semi-icons/src/icons/IconTextStroked.tsx +++ b/packages/semi-icons/src/icons/IconTextStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'text_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconThumbUpStroked.tsx b/packages/semi-icons/src/icons/IconThumbUpStroked.tsx index 0135524268..4e0103161c 100644 --- a/packages/semi-icons/src/icons/IconThumbUpStroked.tsx +++ b/packages/semi-icons/src/icons/IconThumbUpStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'thumb_up_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTick.tsx b/packages/semi-icons/src/icons/IconTick.tsx index 3c86f68f1a..b1b0357bd8 100644 --- a/packages/semi-icons/src/icons/IconTick.tsx +++ b/packages/semi-icons/src/icons/IconTick.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tick'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTickCircle.tsx b/packages/semi-icons/src/icons/IconTickCircle.tsx index a6023db7ed..a0dfcdf439 100644 --- a/packages/semi-icons/src/icons/IconTickCircle.tsx +++ b/packages/semi-icons/src/icons/IconTickCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tick_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTicketCodeExchangeStroked.tsx b/packages/semi-icons/src/icons/IconTicketCodeExchangeStroked.tsx index f0c9b5f1b1..f0f1f10350 100644 --- a/packages/semi-icons/src/icons/IconTicketCodeExchangeStroked.tsx +++ b/packages/semi-icons/src/icons/IconTicketCodeExchangeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ticket_code_exchange_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTicketCodeStroked.tsx b/packages/semi-icons/src/icons/IconTicketCodeStroked.tsx index 7b123882d9..b37f609af0 100644 --- a/packages/semi-icons/src/icons/IconTicketCodeStroked.tsx +++ b/packages/semi-icons/src/icons/IconTicketCodeStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'ticket_code_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTiktokLogo.tsx b/packages/semi-icons/src/icons/IconTiktokLogo.tsx index 37c7e4c3f7..00e32cd48b 100644 --- a/packages/semi-icons/src/icons/IconTiktokLogo.tsx +++ b/packages/semi-icons/src/icons/IconTiktokLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tiktok_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTop.tsx b/packages/semi-icons/src/icons/IconTop.tsx index e5b6a711e3..102da7f039 100644 --- a/packages/semi-icons/src/icons/IconTop.tsx +++ b/packages/semi-icons/src/icons/IconTop.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'top'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTopCenterStroked.tsx b/packages/semi-icons/src/icons/IconTopCenterStroked.tsx index 67e082c31f..741ba7259a 100644 --- a/packages/semi-icons/src/icons/IconTopCenterStroked.tsx +++ b/packages/semi-icons/src/icons/IconTopCenterStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'top_center_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTopLeftStroked.tsx b/packages/semi-icons/src/icons/IconTopLeftStroked.tsx index d7814723b0..1087ffbafc 100644 --- a/packages/semi-icons/src/icons/IconTopLeftStroked.tsx +++ b/packages/semi-icons/src/icons/IconTopLeftStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'top_left_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTopRightStroked.tsx b/packages/semi-icons/src/icons/IconTopRightStroked.tsx index 1c69ce5e8d..82ac3268e8 100644 --- a/packages/semi-icons/src/icons/IconTopRightStroked.tsx +++ b/packages/semi-icons/src/icons/IconTopRightStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'top_right_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTopbuzzLogo.tsx b/packages/semi-icons/src/icons/IconTopbuzzLogo.tsx index 40786f7728..35e862ac9f 100644 --- a/packages/semi-icons/src/icons/IconTopbuzzLogo.tsx +++ b/packages/semi-icons/src/icons/IconTopbuzzLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'topbuzz_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconToutiaoLogo.tsx b/packages/semi-icons/src/icons/IconToutiaoLogo.tsx index 6ad1ad99b3..8e1a26ed8c 100644 --- a/packages/semi-icons/src/icons/IconToutiaoLogo.tsx +++ b/packages/semi-icons/src/icons/IconToutiaoLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'toutiao_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTransparentStroked.tsx b/packages/semi-icons/src/icons/IconTransparentStroked.tsx index fc9eee0753..f16bb947e2 100644 --- a/packages/semi-icons/src/icons/IconTransparentStroked.tsx +++ b/packages/semi-icons/src/icons/IconTransparentStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'transparent_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTreeTriangleDown.tsx b/packages/semi-icons/src/icons/IconTreeTriangleDown.tsx index 1c852c44c7..244e75284c 100644 --- a/packages/semi-icons/src/icons/IconTreeTriangleDown.tsx +++ b/packages/semi-icons/src/icons/IconTreeTriangleDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'tree_triangle_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTreeTriangleRight.tsx b/packages/semi-icons/src/icons/IconTreeTriangleRight.tsx index f9a8bc2d01..1afb75f0a0 100644 --- a/packages/semi-icons/src/icons/IconTreeTriangleRight.tsx +++ b/packages/semi-icons/src/icons/IconTreeTriangleRight.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'tree_triangle_right'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTriangleArrow.tsx b/packages/semi-icons/src/icons/IconTriangleArrow.tsx index 873619fd1d..295974d339 100644 --- a/packages/semi-icons/src/icons/IconTriangleArrow.tsx +++ b/packages/semi-icons/src/icons/IconTriangleArrow.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + @@ -27,6 +23,5 @@ function SvgComponent(props: React.SVGProps) { ); } - const IconComponent = convertIcon(SvgComponent, 'triangle_arrow'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTriangleArrowVertical.tsx b/packages/semi-icons/src/icons/IconTriangleArrowVertical.tsx index 8dbe03e190..14ccd480b7 100644 --- a/packages/semi-icons/src/icons/IconTriangleArrowVertical.tsx +++ b/packages/semi-icons/src/icons/IconTriangleArrowVertical.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'triangle_arrow_vertical'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTriangleDown.tsx b/packages/semi-icons/src/icons/IconTriangleDown.tsx index 06e403f6b0..295bcda91f 100644 --- a/packages/semi-icons/src/icons/IconTriangleDown.tsx +++ b/packages/semi-icons/src/icons/IconTriangleDown.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'triangle_down'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTriangleUp.tsx b/packages/semi-icons/src/icons/IconTriangleUp.tsx index 27b57cf4f0..bdba835ac2 100644 --- a/packages/semi-icons/src/icons/IconTriangleUp.tsx +++ b/packages/semi-icons/src/icons/IconTriangleUp.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'triangle_up'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTrueFalseStroked.tsx b/packages/semi-icons/src/icons/IconTrueFalseStroked.tsx index 7abc52215c..bc4615ed9d 100644 --- a/packages/semi-icons/src/icons/IconTrueFalseStroked.tsx +++ b/packages/semi-icons/src/icons/IconTrueFalseStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'true_false_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTvCheckedStroked.tsx b/packages/semi-icons/src/icons/IconTvCheckedStroked.tsx index 05bfc4352f..303b9320ed 100644 --- a/packages/semi-icons/src/icons/IconTvCheckedStroked.tsx +++ b/packages/semi-icons/src/icons/IconTvCheckedStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'tv_checked_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTwitter.tsx b/packages/semi-icons/src/icons/IconTwitter.tsx index 08e7a290e1..b5384d33d4 100644 --- a/packages/semi-icons/src/icons/IconTwitter.tsx +++ b/packages/semi-icons/src/icons/IconTwitter.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'twitter'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconTypograph.tsx b/packages/semi-icons/src/icons/IconTypograph.tsx index e87508ace1..4bea976c2f 100644 --- a/packages/semi-icons/src/icons/IconTypograph.tsx +++ b/packages/semi-icons/src/icons/IconTypograph.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'typograph'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUnChainStroked.tsx b/packages/semi-icons/src/icons/IconUnChainStroked.tsx index 2883474b88..ddfa45ff27 100644 --- a/packages/semi-icons/src/icons/IconUnChainStroked.tsx +++ b/packages/semi-icons/src/icons/IconUnChainStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'un_chain_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUnderline.tsx b/packages/semi-icons/src/icons/IconUnderline.tsx index f77191f405..c7e73f37af 100644 --- a/packages/semi-icons/src/icons/IconUnderline.tsx +++ b/packages/semi-icons/src/icons/IconUnderline.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + ); } - const IconComponent = convertIcon(SvgComponent, 'underline'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUndo.tsx b/packages/semi-icons/src/icons/IconUndo.tsx index 4034244f62..8c5ae9d4a6 100644 --- a/packages/semi-icons/src/icons/IconUndo.tsx +++ b/packages/semi-icons/src/icons/IconUndo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'undo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUnlink.tsx b/packages/semi-icons/src/icons/IconUnlink.tsx index eb674f483e..d0176e4c41 100644 --- a/packages/semi-icons/src/icons/IconUnlink.tsx +++ b/packages/semi-icons/src/icons/IconUnlink.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { @@ -31,6 +30,5 @@ function SvgComponent(props: React.SVGProps) { ); } - const IconComponent = convertIcon(SvgComponent, 'unlink'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUnlock.tsx b/packages/semi-icons/src/icons/IconUnlock.tsx index 42682201de..dc48a150af 100644 --- a/packages/semi-icons/src/icons/IconUnlock.tsx +++ b/packages/semi-icons/src/icons/IconUnlock.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'unlock'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUnlockStroked.tsx b/packages/semi-icons/src/icons/IconUnlockStroked.tsx index 88aa418f09..e96af86764 100644 --- a/packages/semi-icons/src/icons/IconUnlockStroked.tsx +++ b/packages/semi-icons/src/icons/IconUnlockStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'unlock_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUpload.tsx b/packages/semi-icons/src/icons/IconUpload.tsx index b6db130280..3b0f31e3cb 100644 --- a/packages/semi-icons/src/icons/IconUpload.tsx +++ b/packages/semi-icons/src/icons/IconUpload.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'upload'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUploadError.tsx b/packages/semi-icons/src/icons/IconUploadError.tsx index 4ae64eed69..0c2ffd115b 100644 --- a/packages/semi-icons/src/icons/IconUploadError.tsx +++ b/packages/semi-icons/src/icons/IconUploadError.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'upload_error'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUser.tsx b/packages/semi-icons/src/icons/IconUser.tsx index ad245c8a16..d1fd5657e2 100644 --- a/packages/semi-icons/src/icons/IconUser.tsx +++ b/packages/semi-icons/src/icons/IconUser.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'user'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserAdd.tsx b/packages/semi-icons/src/icons/IconUserAdd.tsx index 0e44466a9d..2d51ee55b3 100644 --- a/packages/semi-icons/src/icons/IconUserAdd.tsx +++ b/packages/semi-icons/src/icons/IconUserAdd.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { @@ -41,6 +40,5 @@ function SvgComponent(props: React.SVGProps) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_add'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserCardPhone.tsx b/packages/semi-icons/src/icons/IconUserCardPhone.tsx index 56d205e024..398617b5ba 100644 --- a/packages/semi-icons/src/icons/IconUserCardPhone.tsx +++ b/packages/semi-icons/src/icons/IconUserCardPhone.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_card_phone'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserCardVideo.tsx b/packages/semi-icons/src/icons/IconUserCardVideo.tsx index 26a0812760..5310750c76 100644 --- a/packages/semi-icons/src/icons/IconUserCardVideo.tsx +++ b/packages/semi-icons/src/icons/IconUserCardVideo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_card_video'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserCircle.tsx b/packages/semi-icons/src/icons/IconUserCircle.tsx index 83106dffff..c54f234e99 100644 --- a/packages/semi-icons/src/icons/IconUserCircle.tsx +++ b/packages/semi-icons/src/icons/IconUserCircle.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_circle'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserCircleStroked.tsx b/packages/semi-icons/src/icons/IconUserCircleStroked.tsx index 59a5387c69..4a8543dc77 100644 --- a/packages/semi-icons/src/icons/IconUserCircleStroked.tsx +++ b/packages/semi-icons/src/icons/IconUserCircleStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_circle_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserGroup.tsx b/packages/semi-icons/src/icons/IconUserGroup.tsx index b48dbc76cc..0898805974 100644 --- a/packages/semi-icons/src/icons/IconUserGroup.tsx +++ b/packages/semi-icons/src/icons/IconUserGroup.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_group'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserListStroked.tsx b/packages/semi-icons/src/icons/IconUserListStroked.tsx index afbcc0cd8e..c6805ac0ce 100644 --- a/packages/semi-icons/src/icons/IconUserListStroked.tsx +++ b/packages/semi-icons/src/icons/IconUserListStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_list_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserSetting.tsx b/packages/semi-icons/src/icons/IconUserSetting.tsx index 1d66e99540..c64e7a6117 100644 --- a/packages/semi-icons/src/icons/IconUserSetting.tsx +++ b/packages/semi-icons/src/icons/IconUserSetting.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'user_setting'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconUserStroked.tsx b/packages/semi-icons/src/icons/IconUserStroked.tsx index 18880dfd1e..f5497813dc 100644 --- a/packages/semi-icons/src/icons/IconUserStroked.tsx +++ b/packages/semi-icons/src/icons/IconUserStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'user_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVennChartStroked.tsx b/packages/semi-icons/src/icons/IconVennChartStroked.tsx index a3f598f8a4..2107654000 100644 --- a/packages/semi-icons/src/icons/IconVennChartStroked.tsx +++ b/packages/semi-icons/src/icons/IconVennChartStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'venn_chart_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVerify.tsx b/packages/semi-icons/src/icons/IconVerify.tsx index 82edb5b607..8d9ad4d052 100644 --- a/packages/semi-icons/src/icons/IconVerify.tsx +++ b/packages/semi-icons/src/icons/IconVerify.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'verify'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVersionStroked.tsx b/packages/semi-icons/src/icons/IconVersionStroked.tsx index a23dac9d14..1c0b71bd47 100644 --- a/packages/semi-icons/src/icons/IconVersionStroked.tsx +++ b/packages/semi-icons/src/icons/IconVersionStroked.tsx @@ -1,14 +1,13 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { + ); } - const IconComponent = convertIcon(SvgComponent, 'version_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVideo.tsx b/packages/semi-icons/src/icons/IconVideo.tsx index 9f63c7ca39..9c9d454b74 100644 --- a/packages/semi-icons/src/icons/IconVideo.tsx +++ b/packages/semi-icons/src/icons/IconVideo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'video'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVideoDouyinStroked.tsx b/packages/semi-icons/src/icons/IconVideoDouyinStroked.tsx index cb1600397a..3df11463b2 100644 --- a/packages/semi-icons/src/icons/IconVideoDouyinStroked.tsx +++ b/packages/semi-icons/src/icons/IconVideoDouyinStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'video_douyin_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVideoListStroked.tsx b/packages/semi-icons/src/icons/IconVideoListStroked.tsx index 38a0204ff6..4d2d15afec 100644 --- a/packages/semi-icons/src/icons/IconVideoListStroked.tsx +++ b/packages/semi-icons/src/icons/IconVideoListStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'video_list_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVideoStroked.tsx b/packages/semi-icons/src/icons/IconVideoStroked.tsx index 35ec0bcad6..a215e17c88 100644 --- a/packages/semi-icons/src/icons/IconVideoStroked.tsx +++ b/packages/semi-icons/src/icons/IconVideoStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'video_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVideoUrlStroked.tsx b/packages/semi-icons/src/icons/IconVideoUrlStroked.tsx index fff897ca9b..6772fcd554 100644 --- a/packages/semi-icons/src/icons/IconVideoUrlStroked.tsx +++ b/packages/semi-icons/src/icons/IconVideoUrlStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'video_url_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVigoLogo.tsx b/packages/semi-icons/src/icons/IconVigoLogo.tsx index 3f68282c8f..a5301416e1 100644 --- a/packages/semi-icons/src/icons/IconVigoLogo.tsx +++ b/packages/semi-icons/src/icons/IconVigoLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'vigo_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVolume1.tsx b/packages/semi-icons/src/icons/IconVolume1.tsx index 8fb0aa0161..f6cf17be7d 100644 --- a/packages/semi-icons/src/icons/IconVolume1.tsx +++ b/packages/semi-icons/src/icons/IconVolume1.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'volume_1'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVolume2.tsx b/packages/semi-icons/src/icons/IconVolume2.tsx index f3d285ade7..eac3492ac6 100644 --- a/packages/semi-icons/src/icons/IconVolume2.tsx +++ b/packages/semi-icons/src/icons/IconVolume2.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'volume_2'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVolumnSilent.tsx b/packages/semi-icons/src/icons/IconVolumnSilent.tsx index f204d88cf0..3c431eae54 100644 --- a/packages/semi-icons/src/icons/IconVolumnSilent.tsx +++ b/packages/semi-icons/src/icons/IconVolumnSilent.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'volumn_silent'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVoteStroked.tsx b/packages/semi-icons/src/icons/IconVoteStroked.tsx index bca9cef406..08fdcaff43 100644 --- a/packages/semi-icons/src/icons/IconVoteStroked.tsx +++ b/packages/semi-icons/src/icons/IconVoteStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'vote_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconVoteVideoStroked.tsx b/packages/semi-icons/src/icons/IconVoteVideoStroked.tsx index 4ab21df4db..fe9797cc34 100644 --- a/packages/semi-icons/src/icons/IconVoteVideoStroked.tsx +++ b/packages/semi-icons/src/icons/IconVoteVideoStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'vote_video_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconWeibo.tsx b/packages/semi-icons/src/icons/IconWeibo.tsx index 737d364b09..f1900bbd59 100644 --- a/packages/semi-icons/src/icons/IconWeibo.tsx +++ b/packages/semi-icons/src/icons/IconWeibo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'weibo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconWholeWord.tsx b/packages/semi-icons/src/icons/IconWholeWord.tsx index a0c153f895..dc288c6df0 100644 --- a/packages/semi-icons/src/icons/IconWholeWord.tsx +++ b/packages/semi-icons/src/icons/IconWholeWord.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'whole_word'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconWifi.tsx b/packages/semi-icons/src/icons/IconWifi.tsx index 0fd332c8f8..0e6209d38b 100644 --- a/packages/semi-icons/src/icons/IconWifi.tsx +++ b/packages/semi-icons/src/icons/IconWifi.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'wifi'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconWindowAdaptionStroked.tsx b/packages/semi-icons/src/icons/IconWindowAdaptionStroked.tsx index 7c53f80825..88779be97a 100644 --- a/packages/semi-icons/src/icons/IconWindowAdaptionStroked.tsx +++ b/packages/semi-icons/src/icons/IconWindowAdaptionStroked.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'window_adaption_stroked'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconWrench.tsx b/packages/semi-icons/src/icons/IconWrench.tsx index da318fe714..c74d78bd8c 100644 --- a/packages/semi-icons/src/icons/IconWrench.tsx +++ b/packages/semi-icons/src/icons/IconWrench.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'wrench'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconXiguaLogo.tsx b/packages/semi-icons/src/icons/IconXiguaLogo.tsx index 876589a725..199135d67f 100644 --- a/packages/semi-icons/src/icons/IconXiguaLogo.tsx +++ b/packages/semi-icons/src/icons/IconXiguaLogo.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { ); } - const IconComponent = convertIcon(SvgComponent, 'xigua_logo'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/IconYoutube.tsx b/packages/semi-icons/src/icons/IconYoutube.tsx index 8760e741dd..5f691a7fd3 100644 --- a/packages/semi-icons/src/icons/IconYoutube.tsx +++ b/packages/semi-icons/src/icons/IconYoutube.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { convertIcon } from '../components/Icon'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > ); } - const IconComponent = convertIcon(SvgComponent, 'youtube'); export default IconComponent; diff --git a/packages/semi-icons/src/icons/index.ts b/packages/semi-icons/src/icons/index.ts index d31d779bf5..05f483f524 100644 --- a/packages/semi-icons/src/icons/index.ts +++ b/packages/semi-icons/src/icons/index.ts @@ -144,8 +144,8 @@ export { default as IconExternalOpen } from './IconExternalOpen'; export { default as IconExternalOpenStroked } from './IconExternalOpenStroked'; export { default as IconEyeClosed } from './IconEyeClosed'; export { default as IconEyeClosedSolid } from './IconEyeClosedSolid'; -export { default as IconEyedropper } from "./IconEyedropper"; export { default as IconEyeOpened } from './IconEyeOpened'; +export { default as IconEyedropper } from './IconEyedropper'; export { default as IconFacebook } from './IconFacebook'; export { default as IconFaceuLogo } from './IconFaceuLogo'; export { default as IconFastForward } from './IconFastForward'; @@ -442,4 +442,4 @@ export { default as IconWifi } from './IconWifi'; export { default as IconWindowAdaptionStroked } from './IconWindowAdaptionStroked'; export { default as IconWrench } from './IconWrench'; export { default as IconXiguaLogo } from './IconXiguaLogo'; -export { default as IconYoutube } from './IconYoutube'; +export { default as IconYoutube } from './IconYoutube'; \ No newline at end of file diff --git a/packages/semi-icons/src/svgs/storys_stroked.svg b/packages/semi-icons/src/svgs/story_stroked.svg similarity index 100% rename from packages/semi-icons/src/svgs/storys_stroked.svg rename to packages/semi-icons/src/svgs/story_stroked.svg diff --git a/packages/semi-illustrations/package.json b/packages/semi-illustrations/package.json index bf6b963e67..c65fa5ba14 100644 --- a/packages/semi-illustrations/package.json +++ b/packages/semi-illustrations/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-illustrations", - "version": "2.70.2", + "version": "2.71.1", "description": "semi illustrations", "keywords": [ "semi", diff --git a/packages/semi-illustrations/scripts/build-illustration.js b/packages/semi-illustrations/scripts/build-illustration.js index aaebc98bbf..c7bfc60948 100644 --- a/packages/semi-illustrations/scripts/build-illustration.js +++ b/packages/semi-illustrations/scripts/build-illustration.js @@ -10,6 +10,12 @@ const entryDir = resolve(__dirname, '../src/svgs'); const outDir = resolve(__dirname, '../src/illustrations'); const svgoPlugins = [ + { + name: 'convertPathData', + params: { + floatPrecision: 2 + } + }, { name: 'cleanupListOfValues', active: true, @@ -22,6 +28,7 @@ const svgoPlugins = [ name: 'removeViewBox', active: false, }, + ]; build(entryDir, outDir, 'Illustration', '', svgoPlugins, { typescript: true }); \ No newline at end of file diff --git a/packages/semi-illustrations/src/illustrations/IllustrationConstruction.tsx b/packages/semi-illustrations/src/illustrations/IllustrationConstruction.tsx index a26452cd9b..69cbbbd9cd 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationConstruction.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationConstruction.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + - + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationConstructionDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationConstructionDark.tsx index ba0362054c..50922527c9 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationConstructionDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationConstructionDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { @@ -48,107 +47,99 @@ function SvgComponent(props: React.SVGProps) { - + - + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationFailure.tsx b/packages/semi-illustrations/src/illustrations/IllustrationFailure.tsx index b2e53e675d..c7722b55f9 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationFailure.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationFailure.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { > - + - + - + ) { fill="white" /> + + - - - + - + - + @@ -304,5 +311,4 @@ function SvgComponent(props: React.SVGProps) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationFailureDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationFailureDark.tsx index aef68785bb..c39d4e566b 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationFailureDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationFailureDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + - + - + ) { fill="#C6CACD" /> + - - + - + @@ -309,5 +304,4 @@ function SvgComponent(props: React.SVGProps) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationIdle.tsx b/packages/semi-illustrations/src/illustrations/IllustrationIdle.tsx index 19096c050f..e85c091505 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationIdle.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationIdle.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + + + + + - - - - - + - - + + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationIdleDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationIdleDark.tsx index b1dbd3500c..7144002ffc 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationIdleDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationIdleDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + + + + + - - - - + - - - - + + + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoAccess.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoAccess.tsx index 2f82330ce5..276192fa10 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoAccess.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoAccess.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - + + - ) { ) { transform="rotate(-4.93845 80.6886 61.9548)" stroke="#C6CACD" /> + - ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoAccessDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoAccessDark.tsx index 9467958c01..b00feb0536 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoAccessDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoAccessDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > - + ) { ) { transform="rotate(-4.93845 80.6887 61.9553)" stroke="#6B7075" /> + - ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoContent.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoContent.tsx index fdbcb64227..d3a7fa6fdc 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoContent.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoContent.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoContentDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoContentDark.tsx index e5257c14df..6617ced03f 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoContentDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoContentDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + - + @@ -78,34 +73,33 @@ function SvgComponent(props: React.SVGProps) { - + ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoResult.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoResult.tsx index 9b1ca3ec50..6cd785a36a 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoResult.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoResult.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { {...props} > + - - + - + - + ) { ) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNoResultDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNoResultDark.tsx index 4da7f59b1c..052cfb17d8 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNoResultDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNoResultDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { aria-hidden={true} {...props} > + - - + - + - + ) { ) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNotFound.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNotFound.tsx index 55e196e5a5..201cd8670d 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNotFound.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNotFound.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { + - @@ -83,17 +79,16 @@ function SvgComponent(props: React.SVGProps) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationNotFoundDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationNotFoundDark.tsx index 6737516616..2393d2c574 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationNotFoundDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationNotFoundDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { + - @@ -85,17 +81,16 @@ function SvgComponent(props: React.SVGProps) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationSuccess.tsx b/packages/semi-illustrations/src/illustrations/IllustrationSuccess.tsx index 63aba5e0e9..520d90ce70 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationSuccess.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationSuccess.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + ) { ) { ) { ); } - export default SvgComponent; diff --git a/packages/semi-illustrations/src/illustrations/IllustrationSuccessDark.tsx b/packages/semi-illustrations/src/illustrations/IllustrationSuccessDark.tsx index ddd73cc2e6..19f26a9d4d 100644 --- a/packages/semi-illustrations/src/illustrations/IllustrationSuccessDark.tsx +++ b/packages/semi-illustrations/src/illustrations/IllustrationSuccessDark.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; - function SvgComponent(props: React.SVGProps) { return ( ) { - + ) { ) { ) { ); } - export default SvgComponent; diff --git a/packages/semi-json-viewer-core/package.json b/packages/semi-json-viewer-core/package.json new file mode 100644 index 0000000000..7da1629b22 --- /dev/null +++ b/packages/semi-json-viewer-core/package.json @@ -0,0 +1,56 @@ +{ + "name": "@douyinfe/semi-json-viewer-core", + "version": "2.71.1", + "description": "", + "main": "lib/index.js", + "module": "lib/index.js", + "typings": "src/index.ts", + "scripts": { + "build:lib": "node ./script/compileLib.js", + "prepublishOnly": "npm run build:lib" + }, + "files": [ + "dist/*", + "lib/*" + ], + "dependencies": { + "jsonc-parser": "^3.3.1" + }, + "devDependencies": { + "esbuild": "^0.24.0" + }, + "sideEffects": [ + "*.scss", + "*.css", + "lib/es/index.js", + "./index.ts" + ], + "keywords": [ + "bytedance douyin design system", + "semi design to any design", + "a11y react component library", + "design to code", + "code to design", + "3000+ design token", + "dark mode", + "semi design", + "design ops", + "modern design system", + "figma ui kit" + ], + "homepage": "https://semi.design", + "bugs": { + "url": "https://github.com/DouyinFE/semi-design/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/DouyinFE/semi-design" + }, + "_unpkg": true, + "unpkgFiles": [ + "dist/css", + "dist/umd/*.js" + ], + "author": "", + "license": "MIT" +} diff --git a/packages/semi-json-viewer-core/script/compileLib.js b/packages/semi-json-viewer-core/script/compileLib.js new file mode 100644 index 0000000000..c939c8bd3b --- /dev/null +++ b/packages/semi-json-viewer-core/script/compileLib.js @@ -0,0 +1,50 @@ +const esbuild = require('esbuild'); +const path = require('path'); +const fs = require('fs'); + + +const compileWorker = async ()=>{ + const workerEntry = path.join(__dirname, "..", "src/worker/json.worker.ts"); + + const result = await esbuild.build({ + entryPoints: [workerEntry], + bundle: true, + write: false, + minify: true, + }); + return result.outputFiles[0].text; +}; + + +const buildMain = async ()=>{ + const mainEntry = path.join(__dirname, "..", "src/index.ts"); + + const result = await esbuild.build({ + entryPoints: [mainEntry], + bundle: true, + packages: 'external', + write: false, + format: 'esm' + }); + return result.outputFiles[0].text; + +}; + + + +const compile = async ()=>{ + const workerRaw = await compileWorker(); + + const mainRaw = await buildMain(); + + const finalRaw = mainRaw.replaceAll("%WORKER_RAW%", encodeURIComponent(workerRaw)); + + const saveDir = path.join(__dirname, "..", "lib"); + + if (!fs.existsSync(saveDir)) { + fs.mkdirSync(saveDir); + } + fs.writeFileSync(path.join(saveDir, "index.js"), finalRaw, 'utf8'); +}; + +compile(); diff --git a/packages/semi-json-viewer-core/src/common/async.ts b/packages/semi-json-viewer-core/src/common/async.ts new file mode 100644 index 0000000000..9bafaa2dda --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/async.ts @@ -0,0 +1,15 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ +export function runWhenGlobalIdle(callback: (idleDeadline: IdleDeadline) => void) { + const handler = window.requestIdleCallback(callback); + let disposed = false; + + return { + dispose: () => { + if (disposed) { + return; + } + disposed = true; + window.cancelIdleCallback(handler); + }, + }; +} diff --git a/packages/semi-json-viewer-core/src/common/charCode.ts b/packages/semi-json-viewer-core/src/common/charCode.ts new file mode 100644 index 0000000000..f0accf6f25 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/charCode.ts @@ -0,0 +1,443 @@ +/** reference from https://github.com/microsoft/vscode */ +/** + * An inlined enum containing useful character codes (to be used with String.charCodeAt). + * Please leave the const keyword such that it gets inlined when compiled to JavaScript! + */ +export const enum CharCode { + Null = 0, + /** + * The `\b` character. + */ + Backspace = 8, + /** + * The `\t` character. + */ + Tab = 9, + /** + * The `\n` character. + */ + LineFeed = 10, + /** + * The `\r` character. + */ + CarriageReturn = 13, + Space = 32, + /** + * The `!` character. + */ + ExclamationMark = 33, + /** + * The `"` character. + */ + DoubleQuote = 34, + /** + * The `#` character. + */ + Hash = 35, + /** + * The `$` character. + */ + DollarSign = 36, + /** + * The `%` character. + */ + PercentSign = 37, + /** + * The `&` character. + */ + Ampersand = 38, + /** + * The `'` character. + */ + SingleQuote = 39, + /** + * The `(` character. + */ + OpenParen = 40, + /** + * The `)` character. + */ + CloseParen = 41, + /** + * The `*` character. + */ + Asterisk = 42, + /** + * The `+` character. + */ + Plus = 43, + /** + * The `,` character. + */ + Comma = 44, + /** + * The `-` character. + */ + Dash = 45, + /** + * The `.` character. + */ + Period = 46, + /** + * The `/` character. + */ + Slash = 47, + + Digit0 = 48, + Digit1 = 49, + Digit2 = 50, + Digit3 = 51, + Digit4 = 52, + Digit5 = 53, + Digit6 = 54, + Digit7 = 55, + Digit8 = 56, + Digit9 = 57, + + /** + * The `:` character. + */ + Colon = 58, + /** + * The `;` character. + */ + Semicolon = 59, + /** + * The `<` character. + */ + LessThan = 60, + /** + * The `=` character. + */ + Equals = 61, + /** + * The `>` character. + */ + GreaterThan = 62, + /** + * The `?` character. + */ + QuestionMark = 63, + /** + * The `@` character. + */ + AtSign = 64, + + A = 65, + B = 66, + C = 67, + D = 68, + E = 69, + F = 70, + G = 71, + H = 72, + I = 73, + J = 74, + K = 75, + L = 76, + M = 77, + N = 78, + O = 79, + P = 80, + Q = 81, + R = 82, + S = 83, + T = 84, + U = 85, + V = 86, + W = 87, + X = 88, + Y = 89, + Z = 90, + + /** + * The `[` character. + */ + OpenSquareBracket = 91, + /** + * The `\` character. + */ + Backslash = 92, + /** + * The `]` character. + */ + CloseSquareBracket = 93, + /** + * The `^` character. + */ + Caret = 94, + /** + * The `_` character. + */ + Underline = 95, + /** + * The ``(`)`` character. + */ + BackTick = 96, + + a = 97, + b = 98, + c = 99, + d = 100, + e = 101, + f = 102, + g = 103, + h = 104, + i = 105, + j = 106, + k = 107, + l = 108, + m = 109, + n = 110, + o = 111, + p = 112, + q = 113, + r = 114, + s = 115, + t = 116, + u = 117, + v = 118, + w = 119, + x = 120, + y = 121, + z = 122, + + /** + * The `{` character. + */ + OpenCurlyBrace = 123, + /** + * The `|` character. + */ + Pipe = 124, + /** + * The `}` character. + */ + CloseCurlyBrace = 125, + /** + * The `~` character. + */ + Tilde = 126, + + /** + * The   (no-break space) character. + * Unicode Character 'NO-BREAK SPACE' (U+00A0) + */ + NoBreakSpace = 160, + + U_Combining_Grave_Accent = 0x0300, // U+0300 Combining Grave Accent + U_Combining_Acute_Accent = 0x0301, // U+0301 Combining Acute Accent + U_Combining_Circumflex_Accent = 0x0302, // U+0302 Combining Circumflex Accent + U_Combining_Tilde = 0x0303, // U+0303 Combining Tilde + U_Combining_Macron = 0x0304, // U+0304 Combining Macron + U_Combining_Overline = 0x0305, // U+0305 Combining Overline + U_Combining_Breve = 0x0306, // U+0306 Combining Breve + U_Combining_Dot_Above = 0x0307, // U+0307 Combining Dot Above + U_Combining_Diaeresis = 0x0308, // U+0308 Combining Diaeresis + U_Combining_Hook_Above = 0x0309, // U+0309 Combining Hook Above + U_Combining_Ring_Above = 0x030a, // U+030A Combining Ring Above + U_Combining_Double_Acute_Accent = 0x030b, // U+030B Combining Double Acute Accent + U_Combining_Caron = 0x030c, // U+030C Combining Caron + U_Combining_Vertical_Line_Above = 0x030d, // U+030D Combining Vertical Line Above + U_Combining_Double_Vertical_Line_Above = 0x030e, // U+030E Combining Double Vertical Line Above + U_Combining_Double_Grave_Accent = 0x030f, // U+030F Combining Double Grave Accent + U_Combining_Candrabindu = 0x0310, // U+0310 Combining Candrabindu + U_Combining_Inverted_Breve = 0x0311, // U+0311 Combining Inverted Breve + U_Combining_Turned_Comma_Above = 0x0312, // U+0312 Combining Turned Comma Above + U_Combining_Comma_Above = 0x0313, // U+0313 Combining Comma Above + U_Combining_Reversed_Comma_Above = 0x0314, // U+0314 Combining Reversed Comma Above + U_Combining_Comma_Above_Right = 0x0315, // U+0315 Combining Comma Above Right + U_Combining_Grave_Accent_Below = 0x0316, // U+0316 Combining Grave Accent Below + U_Combining_Acute_Accent_Below = 0x0317, // U+0317 Combining Acute Accent Below + U_Combining_Left_Tack_Below = 0x0318, // U+0318 Combining Left Tack Below + U_Combining_Right_Tack_Below = 0x0319, // U+0319 Combining Right Tack Below + U_Combining_Left_Angle_Above = 0x031a, // U+031A Combining Left Angle Above + U_Combining_Horn = 0x031b, // U+031B Combining Horn + U_Combining_Left_Half_Ring_Below = 0x031c, // U+031C Combining Left Half Ring Below + U_Combining_Up_Tack_Below = 0x031d, // U+031D Combining Up Tack Below + U_Combining_Down_Tack_Below = 0x031e, // U+031E Combining Down Tack Below + U_Combining_Plus_Sign_Below = 0x031f, // U+031F Combining Plus Sign Below + U_Combining_Minus_Sign_Below = 0x0320, // U+0320 Combining Minus Sign Below + U_Combining_Palatalized_Hook_Below = 0x0321, // U+0321 Combining Palatalized Hook Below + U_Combining_Retroflex_Hook_Below = 0x0322, // U+0322 Combining Retroflex Hook Below + U_Combining_Dot_Below = 0x0323, // U+0323 Combining Dot Below + U_Combining_Diaeresis_Below = 0x0324, // U+0324 Combining Diaeresis Below + U_Combining_Ring_Below = 0x0325, // U+0325 Combining Ring Below + U_Combining_Comma_Below = 0x0326, // U+0326 Combining Comma Below + U_Combining_Cedilla = 0x0327, // U+0327 Combining Cedilla + U_Combining_Ogonek = 0x0328, // U+0328 Combining Ogonek + U_Combining_Vertical_Line_Below = 0x0329, // U+0329 Combining Vertical Line Below + U_Combining_Bridge_Below = 0x032a, // U+032A Combining Bridge Below + U_Combining_Inverted_Double_Arch_Below = 0x032b, // U+032B Combining Inverted Double Arch Below + U_Combining_Caron_Below = 0x032c, // U+032C Combining Caron Below + U_Combining_Circumflex_Accent_Below = 0x032d, // U+032D Combining Circumflex Accent Below + U_Combining_Breve_Below = 0x032e, // U+032E Combining Breve Below + U_Combining_Inverted_Breve_Below = 0x032f, // U+032F Combining Inverted Breve Below + U_Combining_Tilde_Below = 0x0330, // U+0330 Combining Tilde Below + U_Combining_Macron_Below = 0x0331, // U+0331 Combining Macron Below + U_Combining_Low_Line = 0x0332, // U+0332 Combining Low Line + U_Combining_Double_Low_Line = 0x0333, // U+0333 Combining Double Low Line + U_Combining_Tilde_Overlay = 0x0334, // U+0334 Combining Tilde Overlay + U_Combining_Short_Stroke_Overlay = 0x0335, // U+0335 Combining Short Stroke Overlay + U_Combining_Long_Stroke_Overlay = 0x0336, // U+0336 Combining Long Stroke Overlay + U_Combining_Short_Solidus_Overlay = 0x0337, // U+0337 Combining Short Solidus Overlay + U_Combining_Long_Solidus_Overlay = 0x0338, // U+0338 Combining Long Solidus Overlay + U_Combining_Right_Half_Ring_Below = 0x0339, // U+0339 Combining Right Half Ring Below + U_Combining_Inverted_Bridge_Below = 0x033a, // U+033A Combining Inverted Bridge Below + U_Combining_Square_Below = 0x033b, // U+033B Combining Square Below + U_Combining_Seagull_Below = 0x033c, // U+033C Combining Seagull Below + U_Combining_X_Above = 0x033d, // U+033D Combining X Above + U_Combining_Vertical_Tilde = 0x033e, // U+033E Combining Vertical Tilde + U_Combining_Double_Overline = 0x033f, // U+033F Combining Double Overline + U_Combining_Grave_Tone_Mark = 0x0340, // U+0340 Combining Grave Tone Mark + U_Combining_Acute_Tone_Mark = 0x0341, // U+0341 Combining Acute Tone Mark + U_Combining_Greek_Perispomeni = 0x0342, // U+0342 Combining Greek Perispomeni + U_Combining_Greek_Koronis = 0x0343, // U+0343 Combining Greek Koronis + U_Combining_Greek_Dialytika_Tonos = 0x0344, // U+0344 Combining Greek Dialytika Tonos + U_Combining_Greek_Ypogegrammeni = 0x0345, // U+0345 Combining Greek Ypogegrammeni + U_Combining_Bridge_Above = 0x0346, // U+0346 Combining Bridge Above + U_Combining_Equals_Sign_Below = 0x0347, // U+0347 Combining Equals Sign Below + U_Combining_Double_Vertical_Line_Below = 0x0348, // U+0348 Combining Double Vertical Line Below + U_Combining_Left_Angle_Below = 0x0349, // U+0349 Combining Left Angle Below + U_Combining_Not_Tilde_Above = 0x034a, // U+034A Combining Not Tilde Above + U_Combining_Homothetic_Above = 0x034b, // U+034B Combining Homothetic Above + U_Combining_Almost_Equal_To_Above = 0x034c, // U+034C Combining Almost Equal To Above + U_Combining_Left_Right_Arrow_Below = 0x034d, // U+034D Combining Left Right Arrow Below + U_Combining_Upwards_Arrow_Below = 0x034e, // U+034E Combining Upwards Arrow Below + U_Combining_Grapheme_Joiner = 0x034f, // U+034F Combining Grapheme Joiner + U_Combining_Right_Arrowhead_Above = 0x0350, // U+0350 Combining Right Arrowhead Above + U_Combining_Left_Half_Ring_Above = 0x0351, // U+0351 Combining Left Half Ring Above + U_Combining_Fermata = 0x0352, // U+0352 Combining Fermata + U_Combining_X_Below = 0x0353, // U+0353 Combining X Below + U_Combining_Left_Arrowhead_Below = 0x0354, // U+0354 Combining Left Arrowhead Below + U_Combining_Right_Arrowhead_Below = 0x0355, // U+0355 Combining Right Arrowhead Below + U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below = 0x0356, // U+0356 Combining Right Arrowhead And Up Arrowhead Below + U_Combining_Right_Half_Ring_Above = 0x0357, // U+0357 Combining Right Half Ring Above + U_Combining_Dot_Above_Right = 0x0358, // U+0358 Combining Dot Above Right + U_Combining_Asterisk_Below = 0x0359, // U+0359 Combining Asterisk Below + U_Combining_Double_Ring_Below = 0x035a, // U+035A Combining Double Ring Below + U_Combining_Zigzag_Above = 0x035b, // U+035B Combining Zigzag Above + U_Combining_Double_Breve_Below = 0x035c, // U+035C Combining Double Breve Below + U_Combining_Double_Breve = 0x035d, // U+035D Combining Double Breve + U_Combining_Double_Macron = 0x035e, // U+035E Combining Double Macron + U_Combining_Double_Macron_Below = 0x035f, // U+035F Combining Double Macron Below + U_Combining_Double_Tilde = 0x0360, // U+0360 Combining Double Tilde + U_Combining_Double_Inverted_Breve = 0x0361, // U+0361 Combining Double Inverted Breve + U_Combining_Double_Rightwards_Arrow_Below = 0x0362, // U+0362 Combining Double Rightwards Arrow Below + U_Combining_Latin_Small_Letter_A = 0x0363, // U+0363 Combining Latin Small Letter A + U_Combining_Latin_Small_Letter_E = 0x0364, // U+0364 Combining Latin Small Letter E + U_Combining_Latin_Small_Letter_I = 0x0365, // U+0365 Combining Latin Small Letter I + U_Combining_Latin_Small_Letter_O = 0x0366, // U+0366 Combining Latin Small Letter O + U_Combining_Latin_Small_Letter_U = 0x0367, // U+0367 Combining Latin Small Letter U + U_Combining_Latin_Small_Letter_C = 0x0368, // U+0368 Combining Latin Small Letter C + U_Combining_Latin_Small_Letter_D = 0x0369, // U+0369 Combining Latin Small Letter D + U_Combining_Latin_Small_Letter_H = 0x036a, // U+036A Combining Latin Small Letter H + U_Combining_Latin_Small_Letter_M = 0x036b, // U+036B Combining Latin Small Letter M + U_Combining_Latin_Small_Letter_R = 0x036c, // U+036C Combining Latin Small Letter R + U_Combining_Latin_Small_Letter_T = 0x036d, // U+036D Combining Latin Small Letter T + U_Combining_Latin_Small_Letter_V = 0x036e, // U+036E Combining Latin Small Letter V + U_Combining_Latin_Small_Letter_X = 0x036f, // U+036F Combining Latin Small Letter X + + /** + * Unicode Character 'LINE SEPARATOR' (U+2028) + * http://www.fileformat.info/info/unicode/char/2028/index.htm + */ + LINE_SEPARATOR = 0x2028, + /** + * Unicode Character 'PARAGRAPH SEPARATOR' (U+2029) + * http://www.fileformat.info/info/unicode/char/2029/index.htm + */ + PARAGRAPH_SEPARATOR = 0x2029, + /** + * Unicode Character 'NEXT LINE' (U+0085) + * http://www.fileformat.info/info/unicode/char/0085/index.htm + */ + NEXT_LINE = 0x0085, + + // http://www.fileformat.info/info/unicode/category/Sk/list.htm + U_CIRCUMFLEX = 0x005e, // U+005E CIRCUMFLEX + U_GRAVE_ACCENT = 0x0060, // U+0060 GRAVE ACCENT + U_DIAERESIS = 0x00a8, // U+00A8 DIAERESIS + U_MACRON = 0x00af, // U+00AF MACRON + U_ACUTE_ACCENT = 0x00b4, // U+00B4 ACUTE ACCENT + U_CEDILLA = 0x00b8, // U+00B8 CEDILLA + U_MODIFIER_LETTER_LEFT_ARROWHEAD = 0x02c2, // U+02C2 MODIFIER LETTER LEFT ARROWHEAD + U_MODIFIER_LETTER_RIGHT_ARROWHEAD = 0x02c3, // U+02C3 MODIFIER LETTER RIGHT ARROWHEAD + U_MODIFIER_LETTER_UP_ARROWHEAD = 0x02c4, // U+02C4 MODIFIER LETTER UP ARROWHEAD + U_MODIFIER_LETTER_DOWN_ARROWHEAD = 0x02c5, // U+02C5 MODIFIER LETTER DOWN ARROWHEAD + U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING = 0x02d2, // U+02D2 MODIFIER LETTER CENTRED RIGHT HALF RING + U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING = 0x02d3, // U+02D3 MODIFIER LETTER CENTRED LEFT HALF RING + U_MODIFIER_LETTER_UP_TACK = 0x02d4, // U+02D4 MODIFIER LETTER UP TACK + U_MODIFIER_LETTER_DOWN_TACK = 0x02d5, // U+02D5 MODIFIER LETTER DOWN TACK + U_MODIFIER_LETTER_PLUS_SIGN = 0x02d6, // U+02D6 MODIFIER LETTER PLUS SIGN + U_MODIFIER_LETTER_MINUS_SIGN = 0x02d7, // U+02D7 MODIFIER LETTER MINUS SIGN + U_BREVE = 0x02d8, // U+02D8 BREVE + U_DOT_ABOVE = 0x02d9, // U+02D9 DOT ABOVE + U_RING_ABOVE = 0x02da, // U+02DA RING ABOVE + U_OGONEK = 0x02db, // U+02DB OGONEK + U_SMALL_TILDE = 0x02dc, // U+02DC SMALL TILDE + U_DOUBLE_ACUTE_ACCENT = 0x02dd, // U+02DD DOUBLE ACUTE ACCENT + U_MODIFIER_LETTER_RHOTIC_HOOK = 0x02de, // U+02DE MODIFIER LETTER RHOTIC HOOK + U_MODIFIER_LETTER_CROSS_ACCENT = 0x02df, // U+02DF MODIFIER LETTER CROSS ACCENT + U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR = 0x02e5, // U+02E5 MODIFIER LETTER EXTRA-HIGH TONE BAR + U_MODIFIER_LETTER_HIGH_TONE_BAR = 0x02e6, // U+02E6 MODIFIER LETTER HIGH TONE BAR + U_MODIFIER_LETTER_MID_TONE_BAR = 0x02e7, // U+02E7 MODIFIER LETTER MID TONE BAR + U_MODIFIER_LETTER_LOW_TONE_BAR = 0x02e8, // U+02E8 MODIFIER LETTER LOW TONE BAR + U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR = 0x02e9, // U+02E9 MODIFIER LETTER EXTRA-LOW TONE BAR + U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK = 0x02ea, // U+02EA MODIFIER LETTER YIN DEPARTING TONE MARK + U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK = 0x02eb, // U+02EB MODIFIER LETTER YANG DEPARTING TONE MARK + U_MODIFIER_LETTER_UNASPIRATED = 0x02ed, // U+02ED MODIFIER LETTER UNASPIRATED + U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD = 0x02ef, // U+02EF MODIFIER LETTER LOW DOWN ARROWHEAD + U_MODIFIER_LETTER_LOW_UP_ARROWHEAD = 0x02f0, // U+02F0 MODIFIER LETTER LOW UP ARROWHEAD + U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD = 0x02f1, // U+02F1 MODIFIER LETTER LOW LEFT ARROWHEAD + U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD = 0x02f2, // U+02F2 MODIFIER LETTER LOW RIGHT ARROWHEAD + U_MODIFIER_LETTER_LOW_RING = 0x02f3, // U+02F3 MODIFIER LETTER LOW RING + U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT = 0x02f4, // U+02F4 MODIFIER LETTER MIDDLE GRAVE ACCENT + U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT = 0x02f5, // U+02F5 MODIFIER LETTER MIDDLE DOUBLE GRAVE ACCENT + U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT = 0x02f6, // U+02F6 MODIFIER LETTER MIDDLE DOUBLE ACUTE ACCENT + U_MODIFIER_LETTER_LOW_TILDE = 0x02f7, // U+02F7 MODIFIER LETTER LOW TILDE + U_MODIFIER_LETTER_RAISED_COLON = 0x02f8, // U+02F8 MODIFIER LETTER RAISED COLON + U_MODIFIER_LETTER_BEGIN_HIGH_TONE = 0x02f9, // U+02F9 MODIFIER LETTER BEGIN HIGH TONE + U_MODIFIER_LETTER_END_HIGH_TONE = 0x02fa, // U+02FA MODIFIER LETTER END HIGH TONE + U_MODIFIER_LETTER_BEGIN_LOW_TONE = 0x02fb, // U+02FB MODIFIER LETTER BEGIN LOW TONE + U_MODIFIER_LETTER_END_LOW_TONE = 0x02fc, // U+02FC MODIFIER LETTER END LOW TONE + U_MODIFIER_LETTER_SHELF = 0x02fd, // U+02FD MODIFIER LETTER SHELF + U_MODIFIER_LETTER_OPEN_SHELF = 0x02fe, // U+02FE MODIFIER LETTER OPEN SHELF + U_MODIFIER_LETTER_LOW_LEFT_ARROW = 0x02ff, // U+02FF MODIFIER LETTER LOW LEFT ARROW + U_GREEK_LOWER_NUMERAL_SIGN = 0x0375, // U+0375 GREEK LOWER NUMERAL SIGN + U_GREEK_TONOS = 0x0384, // U+0384 GREEK TONOS + U_GREEK_DIALYTIKA_TONOS = 0x0385, // U+0385 GREEK DIALYTIKA TONOS + U_GREEK_KORONIS = 0x1fbd, // U+1FBD GREEK KORONIS + U_GREEK_PSILI = 0x1fbf, // U+1FBF GREEK PSILI + U_GREEK_PERISPOMENI = 0x1fc0, // U+1FC0 GREEK PERISPOMENI + U_GREEK_DIALYTIKA_AND_PERISPOMENI = 0x1fc1, // U+1FC1 GREEK DIALYTIKA AND PERISPOMENI + U_GREEK_PSILI_AND_VARIA = 0x1fcd, // U+1FCD GREEK PSILI AND VARIA + U_GREEK_PSILI_AND_OXIA = 0x1fce, // U+1FCE GREEK PSILI AND OXIA + U_GREEK_PSILI_AND_PERISPOMENI = 0x1fcf, // U+1FCF GREEK PSILI AND PERISPOMENI + U_GREEK_DASIA_AND_VARIA = 0x1fdd, // U+1FDD GREEK DASIA AND VARIA + U_GREEK_DASIA_AND_OXIA = 0x1fde, // U+1FDE GREEK DASIA AND OXIA + U_GREEK_DASIA_AND_PERISPOMENI = 0x1fdf, // U+1FDF GREEK DASIA AND PERISPOMENI + U_GREEK_DIALYTIKA_AND_VARIA = 0x1fed, // U+1FED GREEK DIALYTIKA AND VARIA + U_GREEK_DIALYTIKA_AND_OXIA = 0x1fee, // U+1FEE GREEK DIALYTIKA AND OXIA + U_GREEK_VARIA = 0x1fef, // U+1FEF GREEK VARIA + U_GREEK_OXIA = 0x1ffd, // U+1FFD GREEK OXIA + U_GREEK_DASIA = 0x1ffe, // U+1FFE GREEK DASIA + + U_IDEOGRAPHIC_FULL_STOP = 0x3002, // U+3002 IDEOGRAPHIC FULL STOP + U_LEFT_CORNER_BRACKET = 0x300c, // U+300C LEFT CORNER BRACKET + U_RIGHT_CORNER_BRACKET = 0x300d, // U+300D RIGHT CORNER BRACKET + U_LEFT_BLACK_LENTICULAR_BRACKET = 0x3010, // U+3010 LEFT BLACK LENTICULAR BRACKET + U_RIGHT_BLACK_LENTICULAR_BRACKET = 0x3011, // U+3011 RIGHT BLACK LENTICULAR BRACKET + + U_OVERLINE = 0x203e, // Unicode Character 'OVERLINE' + + /** + * UTF-8 BOM + * Unicode Character 'ZERO WIDTH NO-BREAK SPACE' (U+FEFF) + * http://www.fileformat.info/info/unicode/char/feff/index.htm + */ + UTF8_BOM = 65279, + + U_FULLWIDTH_SEMICOLON = 0xff1b, // U+FF1B FULLWIDTH SEMICOLON + U_FULLWIDTH_COMMA = 0xff0c, // U+FF0C FULLWIDTH COMMA +} diff --git a/packages/semi-json-viewer-core/src/common/characterClassifier.ts b/packages/semi-json-viewer-core/src/common/characterClassifier.ts new file mode 100644 index 0000000000..eb24be16e7 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/characterClassifier.ts @@ -0,0 +1,81 @@ +/** reference from https://github.com/microsoft/vscode */ +import { toUint8 } from './uint'; + +/** + * A fast character classifier that uses a compact array for ASCII values. + */ +export class CharacterClassifier { + /** + * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code). + */ + protected readonly _asciiMap: Uint8Array; + + /** + * The entire map (sparse array). + */ + protected readonly _map: Map; + + protected readonly _defaultValue: number; + + constructor(_defaultValue: T) { + const defaultValue = toUint8(_defaultValue); + + this._defaultValue = defaultValue; + this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue); + this._map = new Map(); + } + + private static _createAsciiMap(defaultValue: number): Uint8Array { + const asciiMap = new Uint8Array(256); + asciiMap.fill(defaultValue); + return asciiMap; + } + + public set(charCode: number, _value: T): void { + const value = toUint8(_value); + + if (charCode >= 0 && charCode < 256) { + this._asciiMap[charCode] = value; + } else { + this._map.set(charCode, value); + } + } + + public get(charCode: number): T { + if (charCode >= 0 && charCode < 256) { + return this._asciiMap[charCode]; + } else { + return (this._map.get(charCode) || this._defaultValue); + } + } + + public clear() { + this._asciiMap.fill(this._defaultValue); + this._map.clear(); + } +} + +const enum BooleanEnum { + False = 0, + True = 1, +} + +export class CharacterSet { + private readonly _actual: CharacterClassifier; + + constructor() { + this._actual = new CharacterClassifier(BooleanEnum.False); + } + + public add(charCode: number): void { + this._actual.set(charCode, BooleanEnum.True); + } + + public has(charCode: number): boolean { + return this._actual.get(charCode) === BooleanEnum.True; + } + + public clear(): void { + return this._actual.clear(); + } +} diff --git a/packages/semi-json-viewer-core/src/common/dom.ts b/packages/semi-json-viewer-core/src/common/dom.ts new file mode 100644 index 0000000000..dcafa0d758 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/dom.ts @@ -0,0 +1,34 @@ +/** + * create element + * @param tag tagName + * @param className className + * @returns element + */ +export function elt(tag: string, className: string, style?: { [key: string]: string }): HTMLElement { + const el = document.createElement(tag); + el.className = className; + if (style) { + setStyles(el, style); + } + return el; +} + +/** + * set styles + * @param element element + * @param styles styles + */ +export function setStyles(element: HTMLElement, styles: { [key: string]: string }) { + for (const [key, value] of Object.entries(styles)) { + element.style[key as any] = value; + } +} + +/** + * get line element by child node + * @param node node + * @returns line element + */ +export function getLineElement(node: Node): HTMLElement | null { + return node.parentElement?.closest('[data-line-element="true"]') || null; +} diff --git a/packages/semi-json-viewer-core/src/common/emitter.ts b/packages/semi-json-viewer-core/src/common/emitter.ts new file mode 100644 index 0000000000..0194c7fe32 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/emitter.ts @@ -0,0 +1,62 @@ +import { GlobalEvents } from './emitterEvents'; +import { getCurrentNameSpaceId } from './nameSpace'; + +type EventHandler = (event: T) => void; + +const emitterMap = new Map>(); + +export class Emitter> { + public listeners: { [K in keyof Events]?: EventHandler[] } = {}; + + constructor() {} + + public on(event: K, listener: EventHandler): void { + if (!this.listeners[event]) { + this.listeners[event] = []; + } + this.listeners[event]?.push(listener); + } + + public off(event: K, listener: EventHandler): void { + if (!this.listeners[event]) return; + + this.listeners[event] = this.listeners[event]?.filter(l => l !== listener); + } + + public dispose() { + this.listeners = {}; + } + + public removeAllListeners() { + this.listeners = {}; + } + + public emit(event: K, data: Events[K]): void { + if (!this.listeners[event]) return; + + for (const listener of this.listeners[event]!) { + listener(data); + } + } +} + +export const getEmitter = () => { + const currentNameSpaceId = getCurrentNameSpaceId(); + if (!currentNameSpaceId) { + throw new Error('currentNameSpaceId is not set'); + } + let emitter = emitterMap.get(currentNameSpaceId); + if (!emitter) { + emitter = new Emitter(); + emitterMap.set(currentNameSpaceId, emitter); + } + return emitter; +}; + +export const disposeEmitter = (id: string) => { + const emitter = emitterMap.get(id); + if (emitter) { + emitter.dispose(); + emitterMap.delete(id); + } +}; diff --git a/packages/semi-json-viewer-core/src/common/emitterEvents.ts b/packages/semi-json-viewer-core/src/common/emitterEvents.ts new file mode 100644 index 0000000000..87b197b0ca --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/emitterEvents.ts @@ -0,0 +1,51 @@ +import { JsonDocument } from '../service/parse'; +import { Diagnostic } from '../service/jsonTypes'; + +export interface GlobalEvents { + tokensChanged: IModelTokensChangedEvent; + contentChanged: IModelContentChangeEvent | IModelContentChangeEvent[]; + problemsChanged: IProblemsChangedEvent; + hoverNode: IHoverNodeEvent; + renderHoverNode: IRenderHoverNodeEvent +} + +interface IRange { + startLineNumber: number; + + startColumn: number; + + endLineNumber: number; + + endColumn: number +} + +export interface IModelTokensChangedEvent { + range: { + from: number; + to: number + } +} + +export interface IModelContentChangeEvent { + type: 'insert' | 'delete' | 'replace'; + range: IRange; + rangeOffset: number; + rangeLength: number; + oldText: string; + newText: string; + keepPosition?: { lineNumber: number; column: number } +} + +export interface IProblemsChangedEvent { + root: JsonDocument; + problems: Diagnostic[] +} + +export interface IRenderHoverNodeEvent { + el: HTMLElement +} + +export interface IHoverNodeEvent { + value: string; + target: HTMLElement +} diff --git a/packages/semi-json-viewer-core/src/common/map.ts b/packages/semi-json-viewer-core/src/common/map.ts new file mode 100644 index 0000000000..30a7979c7c --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/map.ts @@ -0,0 +1,480 @@ +/** reference from https://github.com/microsoft/vscode */ +interface Item { + previous: Item | undefined; + next: Item | undefined; + key: K; + value: V +} + +export const enum Touch { + None = 0, + AsOld = 1, + AsNew = 2 +} + +export class LinkedMap implements Map { + readonly [Symbol.toStringTag] = 'LinkedMap'; + + private _map: Map>; + private _head: Item | undefined; + private _tail: Item | undefined; + private _size: number; + + private _state: number; + + constructor() { + this._map = new Map>(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state = 0; + } + + clear(): void { + this._map.clear(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + this._state++; + } + + isEmpty(): boolean { + return !this._head && !this._tail; + } + + get size(): number { + return this._size; + } + + get first(): V | undefined { + return this._head?.value; + } + + get last(): V | undefined { + return this._tail?.value; + } + + has(key: K): boolean { + return this._map.has(key); + } + + get(key: K, touch: Touch = Touch.None): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + if (touch !== Touch.None) { + this.touch(item, touch); + } + return item.value; + } + + set(key: K, value: V, touch: Touch = Touch.None): this { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== Touch.None) { + this.touch(item, touch); + } + } else { + item = { key, value, next: undefined, previous: undefined }; + switch (touch) { + case Touch.None: + this.addItemLast(item); + break; + case Touch.AsOld: + this.addItemFirst(item); + break; + case Touch.AsNew: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + return this; + } + + delete(key: K): boolean { + return !!this.remove(key); + } + + remove(key: K): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + + shift(): V | undefined { + if (!this._head && !this._tail) { + return undefined; + } + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + + forEach( + callbackfn: (value: V, key: K, map: LinkedMap) => void, + thisArg?: any + ): void { + const state = this._state; + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + if (this._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + current = current.next; + } + } + + keys(): IterableIterator { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.key, done: false }; + current = current.next; + return result; + } else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + + values(): IterableIterator { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result = { value: current.value, done: false }; + current = current.next; + return result; + } else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + + entries(): IterableIterator<[K, V]> { + const map = this; + const state = this._state; + let current = this._head; + const iterator: IterableIterator<[K, V]> = { + [Symbol.iterator]() { + return iterator; + }, + next(): IteratorResult<[K, V]> { + if (map._state !== state) { + throw new Error(`LinkedMap got modified during iteration.`); + } + if (current) { + const result: IteratorResult<[K, V]> = { + value: [current.key, current.value], + done: false + }; + current = current.next; + return result; + } else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + + [Symbol.iterator](): IterableIterator<[K, V]> { + return this.entries(); + } + + protected trimOld(newSize: number) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._head; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.next; + currentSize--; + } + this._head = current; + this._size = currentSize; + if (current) { + current.previous = undefined; + } + this._state++; + } + + protected trimNew(newSize: number) { + if (newSize >= this.size) { + return; + } + if (newSize === 0) { + this.clear(); + return; + } + let current = this._tail; + let currentSize = this.size; + while (current && currentSize > newSize) { + this._map.delete(current.key); + current = current.previous; + currentSize--; + } + this._tail = current; + this._size = currentSize; + if (current) { + current.next = undefined; + } + this._state++; + } + + private addItemFirst(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error('Invalid list'); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + this._state++; + } + + private addItemLast(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error('Invalid list'); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + this._state++; + } + + private removeItem(item: Item): void { + if (item === this._head && item === this._tail) { + this._head = undefined; + this._tail = undefined; + } else if (item === this._head) { + // This can only happen if size === 1 which is handled + // by the case above. + if (!item.next) { + throw new Error('Invalid list'); + } + item.next.previous = undefined; + this._head = item.next; + } else if (item === this._tail) { + // This can only happen if size === 1 which is handled + // by the case above. + if (!item.previous) { + throw new Error('Invalid list'); + } + item.previous.next = undefined; + this._tail = item.previous; + } else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error('Invalid list'); + } + next.previous = previous; + previous.next = next; + } + item.next = undefined; + item.previous = undefined; + this._state++; + } + + private touch(item: Item, touch: Touch): void { + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + if (touch !== Touch.AsOld && touch !== Touch.AsNew) { + return; + } + + if (touch === Touch.AsOld) { + if (item === this._head) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item + if (item === this._tail) { + // previous must be defined since item was not head but is tail + // So there are more than on item in the map + previous!.next = undefined; + this._tail = previous; + } else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + + // Insert the node at head + item.previous = undefined; + item.next = this._head; + this._head.previous = item; + this._head = item; + this._state++; + } else if (touch === Touch.AsNew) { + if (item === this._tail) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item. + if (item === this._head) { + // next must be defined since item was not tail but is head + // So there are more than on item in the map + next!.previous = undefined; + this._head = next; + } else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + item.next = undefined; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + this._state++; + } + } + + toJSON(): [K, V][] { + const data: [K, V][] = []; + + this.forEach((value, key) => { + data.push([key, value]); + }); + + return data; + } + + fromJSON(data: [K, V][]): void { + this.clear(); + + for (const [key, value] of data) { + this.set(key, value); + } + } +} + +abstract class Cache extends LinkedMap { + protected _limit: number; + protected _ratio: number; + + constructor(limit: number, ratio: number = 1) { + super(); + this._limit = limit; + this._ratio = Math.min(Math.max(0, ratio), 1); + } + + get limit(): number { + return this._limit; + } + + set limit(limit: number) { + this._limit = limit; + this.checkTrim(); + } + + get ratio(): number { + return this._ratio; + } + + set ratio(ratio: number) { + this._ratio = Math.min(Math.max(0, ratio), 1); + this.checkTrim(); + } + + override get(key: K, touch: Touch = Touch.AsNew): V | undefined { + return super.get(key, touch); + } + + peek(key: K): V | undefined { + return super.get(key, Touch.None); + } + + override set(key: K, value: V): this { + super.set(key, value, Touch.AsNew); + return this; + } + + protected checkTrim() { + if (this.size > this._limit) { + this.trim(Math.round(this._limit * this._ratio)); + } + } + + protected abstract trim(newSize: number): void; +} + +export class LRUCache extends Cache { + constructor(limit: number, ratio: number = 1) { + super(limit, ratio); + } + + protected override trim(newSize: number) { + this.trimOld(newSize); + } + + override set(key: K, value: V): this { + super.set(key, value); + this.checkTrim(); + return this; + } +} diff --git a/packages/semi-json-viewer-core/src/common/model.ts b/packages/semi-json-viewer-core/src/common/model.ts new file mode 100644 index 0000000000..f20e375aff --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/model.ts @@ -0,0 +1,64 @@ +/** reference from https://github.com/microsoft/vscode */ +import { WordCharacterClassifier } from './wordCharacterClassifier'; +import { Range } from './range'; +export const enum EndOfLinePreference { + /** + * Use the end of line character identified in the text buffer. + */ + TextDefined = 0, + /** + * Use line feed (\n) as the end of line character. + */ + LF = 1, + /** + * Use carriage return and line feed (\r\n) as the end of line character. + */ + CRLF = 2, +} + +export class FindMatch { + _findMatchBrand: void = undefined; + + public readonly range: Range; + public readonly matches: string[] | null; + + /** + * @internal + */ + constructor(range: Range, matches: string[] | null) { + this.range = range; + this.matches = matches; + } +} +/** + * Text snapshot that works like an iterator. + * Will try to return chunks of roughly ~64KB size. + * Will return null when finished. + */ +export interface ITextSnapshot { + read(): string | null +} + +/** + * @internal + */ +export class SearchData { + /** + * The regex to search for. Always defined. + */ + public readonly regex: RegExp; + /** + * The word separator classifier. + */ + public readonly wordSeparators: WordCharacterClassifier | null; + /** + * The simple string to search for (if possible). + */ + public readonly simpleSearch: string | null; + + constructor(regex: RegExp, wordSeparators: WordCharacterClassifier | null, simpleSearch: string | null) { + this.regex = regex; + this.wordSeparators = wordSeparators; + this.simpleSearch = simpleSearch; + } +} diff --git a/packages/semi-json-viewer-core/src/common/nameSpace.ts b/packages/semi-json-viewer-core/src/common/nameSpace.ts new file mode 100644 index 0000000000..785643ef19 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/nameSpace.ts @@ -0,0 +1,9 @@ +let currentNameSpaceId: string = 'default'; + +export function setCurrentNameSpaceId(id: string) { + currentNameSpaceId = id; +} + +export function getCurrentNameSpaceId() { + return currentNameSpaceId; +} diff --git a/packages/semi-json-viewer-core/src/common/position.ts b/packages/semi-json-viewer-core/src/common/position.ts new file mode 100644 index 0000000000..3cb85a5006 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/position.ts @@ -0,0 +1,35 @@ +/** based on https://github.com/microsoft/vscode with modifications for custom requirements */ + +/** + * A position in the editor. This interface is suitable for serialization. + */ +export interface IPosition { + /** + * line number (starts at 1) + */ + readonly lineNumber: number; + /** + * column (the first character in a line is between column 1 and column 2) + */ + readonly column: number +} + +/** + * A position in the editor. + */ +export class Position { + /** + * line number (starts at 1) + */ + public readonly lineNumber: number; + /** + * column (the first character in a line is between column 1 and column 2) + */ + public readonly column: number; + + constructor(lineNumber: number, column: number) { + this.lineNumber = lineNumber; + this.column = column; + } + +} diff --git a/packages/semi-json-viewer-core/src/common/range.ts b/packages/semi-json-viewer-core/src/common/range.ts new file mode 100644 index 0000000000..0318f29524 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/range.ts @@ -0,0 +1,146 @@ +/** based on https://github.com/microsoft/vscode with modifications for custom requirements */ + +import { IPosition, Position } from './position'; + +/** + * A range in the editor. This interface is suitable for serialization. + */ +export interface IRange { + /** + * Line number on which the range starts (starts at 1). + */ + readonly startLineNumber: number; + /** + * Column on which the range starts in line `startLineNumber` (starts at 1). + */ + readonly startColumn: number; + /** + * Line number on which the range ends. + */ + readonly endLineNumber: number; + /** + * Column on which the range ends in line `endLineNumber`. + */ + readonly endColumn: number +} + +/** + * A range in the editor. (startLineNumber,startColumn) is <= (endLineNumber,endColumn) + */ +export class Range { + /** + * Line number on which the range starts (starts at 1). + */ + public readonly startLineNumber: number; + /** + * Column on which the range starts in line `startLineNumber` (starts at 1). + */ + public readonly startColumn: number; + /** + * Line number on which the range ends. + */ + public readonly endLineNumber: number; + /** + * Column on which the range ends in line `endLineNumber`. + */ + public readonly endColumn: number; + + constructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) { + if (startLineNumber > endLineNumber || (startLineNumber === endLineNumber && startColumn > endColumn)) { + this.startLineNumber = endLineNumber; + this.startColumn = endColumn; + this.endLineNumber = startLineNumber; + this.endColumn = startColumn; + } else { + this.startLineNumber = startLineNumber; + this.startColumn = startColumn; + this.endLineNumber = endLineNumber; + this.endColumn = endColumn; + } + } + + static create(start: IPosition, end: IPosition): Range { + return new Range(start.lineNumber, start.column, end.lineNumber, end.column); + } + + /** + * Test if the two ranges are intersecting. If the ranges are touching it returns true. + */ + public static areIntersecting(a: IRange, b: IRange): boolean { + // Check if `a` is before `b` + if ( + a.endLineNumber < b.startLineNumber || + (a.endLineNumber === b.startLineNumber && a.endColumn <= b.startColumn) + ) { + return false; + } + + // Check if `b` is before `a` + if ( + b.endLineNumber < a.startLineNumber || + (b.endLineNumber === a.startLineNumber && b.endColumn <= a.startColumn) + ) { + return false; + } + + // These ranges must intersect + return true; + } + + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + public plusRange(range: IRange): Range { + return Range.plusRange(this, range); + } + + /** + * A reunion of the two ranges. + * The smallest position will be used as the start point, and the largest one as the end point. + */ + public static plusRange(a: IRange, b: IRange): Range { + let startLineNumber: number; + let startColumn: number; + let endLineNumber: number; + let endColumn: number; + + if (b.startLineNumber < a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = b.startColumn; + } else if (b.startLineNumber === a.startLineNumber) { + startLineNumber = b.startLineNumber; + startColumn = Math.min(b.startColumn, a.startColumn); + } else { + startLineNumber = a.startLineNumber; + startColumn = a.startColumn; + } + + if (b.endLineNumber > a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = b.endColumn; + } else if (b.endLineNumber === a.endLineNumber) { + endLineNumber = b.endLineNumber; + endColumn = Math.max(b.endColumn, a.endColumn); + } else { + endLineNumber = a.endLineNumber; + endColumn = a.endColumn; + } + + return new Range(startLineNumber, startColumn, endLineNumber, endColumn); + } + + /** + * Return the start position (which will be before or equal to the end position) + */ + public getStartPosition(): Position { + return Range.getStartPosition(this); + } + + /** + * Return the start position (which will be before or equal to the end position) + */ + public static getStartPosition(range: IRange): Position { + return new Position(range.startLineNumber, range.startColumn); + } +} diff --git a/packages/semi-json-viewer-core/src/common/stopWatch.ts b/packages/semi-json-viewer-core/src/common/stopWatch.ts new file mode 100644 index 0000000000..60a3ed2860 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/stopWatch.ts @@ -0,0 +1,41 @@ +/** reference from https://github.com/microsoft/vscode */ +// fake definition so that the valid layers check won't trip on this +declare const globalThis: { performance?: { now(): number } }; + +const hasPerformanceNow = globalThis.performance && typeof globalThis.performance.now === 'function'; + +export class StopWatch { + private _startTime: number; + private _stopTime: number; + + private readonly _now: () => number; + + public static create(highResolution?: boolean): StopWatch { + return new StopWatch(highResolution); + } + + constructor(highResolution?: boolean) { + this._now = + hasPerformanceNow && highResolution === false + ? Date.now + : globalThis.performance?.now.bind(globalThis.performance); + this._startTime = this._now(); + this._stopTime = -1; + } + + public stop(): void { + this._stopTime = this._now(); + } + + public reset(): void { + this._startTime = this._now(); + this._stopTime = -1; + } + + public elapsed(): number { + if (this._stopTime !== -1) { + return this._stopTime - this._startTime; + } + return this._now() - this._startTime; + } +} diff --git a/packages/semi-json-viewer-core/src/common/strings.ts b/packages/semi-json-viewer-core/src/common/strings.ts new file mode 100644 index 0000000000..77c375a8be --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/strings.ts @@ -0,0 +1,140 @@ +/** reference from https://github.com/microsoft/vscode */ + +import { CharCode } from './charCode'; + +/** + * Escapes regular expression characters in a given string + * 转义正则表达式中的特殊字符。它将输入字符串中的正则表达式特殊字符(如 \ { } * + ? | ^ $ . [ ] ( ))前面加上反斜杠, + * 以确保这些字符被视为普通字符而不是正则表达式的元字符 + */ +export function escapeRegExpCharacters(value: string): string { + // eslint-disable-next-line no-useless-escape + return value.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g, '\\$&'); +} + +/** + * 检查给定的字符码是否表示一个高代理项(high surrogate)。 + * 高代理项是用于表示Unicode扩展字符的一部分,通常与低代理项一起使用。 + * 在JavaScript中,字符码可以通过 `str.charCodeAt(index)` 方法获取。 + * + * @param {number} charCode - 要检查的字符码。 + * @returns {boolean} - 如果字符码表示一个高代理项,则返回 true,否则返回 false。 + */ +export function isHighSurrogate(charCode: number): boolean { + return 0xd800 <= charCode && charCode <= 0xdbff; +} + +/** + * 检查给定的字符码是否表示一个低代理项(low surrogate)。 + * 低代理项是用于表示Unicode扩展字符的一部分,通常与高代理项一起使用。 + * 在JavaScript中,字符码可以通过 `str.charCodeAt(index)` 方法获取。 + * + * @param {number} charCode - 要检查的字符码。 + * @returns {boolean} - 如果字符码表示一个低代理项,则返回 true,否则返回 false。 + */ +export function isLowSurrogate(charCode: number): boolean { + return 0xdc00 <= charCode && charCode <= 0xdfff; +} + +/** + * 计算一个Unicode代码点(code point),它由一个高代理项(high surrogate)和一个低代理项(low surrogate)组成。 + * 在JavaScript中,Unicode代码点可以通过 `str.codePointAt(index)` 方法获取。 + * + * @param {number} highSurrogate - 高代理项的字符码。 + * @param {number} lowSurrogate - 低代理项的字符码。 + * @returns {number} - 计算得到的Unicode代码点。 + */ +export function computeCodePoint(highSurrogate: number, lowSurrogate: number): number { + return ((highSurrogate - 0xd800) << 10) + (lowSurrogate - 0xdc00) + 0x10000; +} + +/** + * 获取一个字符串中下一个Unicode代码点(code point)。 + * 在JavaScript中,Unicode代码点可以通过 `str.codePointAt(index)` 方法获取。 + * + * @param {string} str - 要检查的字符串。 + * @param {number} len - 字符串的长度。 + * @param {number} offset - 当前检查的索引位置。 + * @returns {number} - 下一个Unicode代码点。 + */ +export function getNextCodePoint(str: string, len: number, offset: number): number { + const charCode = str.charCodeAt(offset); + if (isHighSurrogate(charCode) && offset + 1 < len) { + const nextCharCode = str.charCodeAt(offset + 1); + if (isLowSurrogate(nextCharCode)) { + return computeCodePoint(charCode, nextCharCode); + } + } + return charCode; +} + +/** + * 表示正则表达式选项的接口。 + */ +export interface RegExpOptions { + matchCase?: boolean; + wholeWord?: boolean; + multiline?: boolean; + global?: boolean; + unicode?: boolean +} + +/** + * 创建一个正则表达式对象,根据给定的搜索字符串和选项进行配置。 + * + * @param {string} searchString - 要搜索的字符串。 + * @param {boolean} isRegex - 是否使用正则表达式。 + * @param {RegExpOptions} options - 正则表达式选项。 + * @returns {RegExp} - 创建的正则表达式对象。 + */ +export function createRegExp(searchString: string, isRegex: boolean, options: RegExpOptions = {}): RegExp { + if (!searchString) { + throw new Error('Cannot create regex from empty string'); + } + if (!isRegex) { + searchString = escapeRegExpCharacters(searchString); + } + if (options.wholeWord) { + if (!/\B/.test(searchString.charAt(0))) { + searchString = '\\b' + searchString; + } + if (!/\B/.test(searchString.charAt(searchString.length - 1))) { + searchString = searchString + '\\b'; + } + } + let modifiers = ''; + if (options.global) { + modifiers += 'g'; + } + if (!options.matchCase) { + modifiers += 'i'; + } + if (options.multiline) { + modifiers += 'm'; + } + if (options.unicode) { + modifiers += 'u'; + } + + return new RegExp(searchString, modifiers); +} + +export function getLeadingWhitespace(str: string, start: number = 0, end: number = str.length): string { + for (let i = start; i < end; i++) { + const chCode = str.charCodeAt(i); + if (chCode !== CharCode.Space && chCode !== CharCode.Tab) { + return str.substring(start, i); + } + } + return str.substring(start, end); +} + +export function firstNonWhitespaceIndex(str: string): number { + for (let i = 0, len = str.length; i < len; i++) { + const chCode = str.charCodeAt(i); + if (chCode !== CharCode.Space && chCode !== CharCode.Tab) { + return i; + } + } + return -1; +} diff --git a/packages/semi-json-viewer-core/src/common/uint.ts b/packages/semi-json-viewer-core/src/common/uint.ts new file mode 100644 index 0000000000..15dc4bc01d --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/uint.ts @@ -0,0 +1,56 @@ +/** reference from https://github.com/microsoft/vscode */ + +export const enum Constants { + /** + * MAX SMI (SMall Integer) as defined in v8. + * one bit is lost for boxing/unboxing flag. + * one bit is lost for sign flag. + * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values + */ + MAX_SAFE_SMALL_INTEGER = 1 << 30, + + /** + * MIN SMI (SMall Integer) as defined in v8. + * one bit is lost for boxing/unboxing flag. + * one bit is lost for sign flag. + * See https://thibaultlaurens.github.io/javascript/2013/04/29/how-the-v8-engine-works/#tagged-values + */ + MIN_SAFE_SMALL_INTEGER = -(1 << 30), + + /** + * Max unsigned integer that fits on 8 bits. + */ + MAX_UINT_8 = 255, // 2^8 - 1 + + /** + * Max unsigned integer that fits on 16 bits. + */ + MAX_UINT_16 = 65535, // 2^16 - 1 + + /** + * Max unsigned integer that fits on 32 bits. + */ + MAX_UINT_32 = 4294967295, // 2^32 - 1 + + UNICODE_SUPPLEMENTARY_PLANE_BEGIN = 0x010000, +} + +export function toUint8(v: number): number { + if (v < 0) { + return 0; + } + if (v > Constants.MAX_UINT_8) { + return Constants.MAX_UINT_8; + } + return v | 0; +} + +export function toUint32(v: number): number { + if (v < 0) { + return 0; + } + if (v > Constants.MAX_UINT_32) { + return Constants.MAX_UINT_32; + } + return v | 0; +} diff --git a/packages/semi-json-viewer-core/src/common/utils.ts b/packages/semi-json-viewer-core/src/common/utils.ts new file mode 100644 index 0000000000..2792a21610 --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/utils.ts @@ -0,0 +1,7 @@ +export function isObject(val: any): val is Record { + return typeof val === 'object' && val !== null && !Array.isArray(val); +} + +export function isNumber(val: any): val is number { + return typeof val === 'number'; +} \ No newline at end of file diff --git a/packages/semi-json-viewer-core/src/common/wordCharacterClassifier.ts b/packages/semi-json-viewer-core/src/common/wordCharacterClassifier.ts new file mode 100644 index 0000000000..57e8499a3f --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/wordCharacterClassifier.ts @@ -0,0 +1,113 @@ +/** reference from https://github.com/microsoft/vscode */ + +import { CharCode } from './charCode'; +import { LRUCache } from './map'; +import { CharacterClassifier } from './characterClassifier'; + +export const enum WordCharacterClass { + Regular = 0, + Whitespace = 1, + WordSeparator = 2, +} + +export class WordCharacterClassifier extends CharacterClassifier { + public readonly intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]; + private readonly _segmenter: Intl.Segmenter | null = null; + private _cachedLine: string | null = null; + private _cachedSegments: IntlWordSegmentData[] = []; + + constructor(wordSeparators: string, intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]) { + super(WordCharacterClass.Regular); + this.intlSegmenterLocales = intlSegmenterLocales; + if (this.intlSegmenterLocales.length > 0) { + this._segmenter = new Intl.Segmenter(this.intlSegmenterLocales, { + granularity: 'word', + }); + } else { + this._segmenter = null; + } + + for (let i = 0, len = wordSeparators.length; i < len; i++) { + this.set(wordSeparators.charCodeAt(i), WordCharacterClass.WordSeparator); + } + + this.set(CharCode.Space, WordCharacterClass.Whitespace); + this.set(CharCode.Tab, WordCharacterClass.Whitespace); + } + + public findPrevIntlWordBeforeOrAtOffset(line: string, offset: number): IntlWordSegmentData | null { + let candidate: IntlWordSegmentData | null = null; + for (const segment of this._getIntlSegmenterWordsOnLine(line)) { + if (segment.index > offset) { + break; + } + candidate = segment; + } + return candidate; + } + + public findNextIntlWordAtOrAfterOffset(lineContent: string, offset: number): IntlWordSegmentData | null { + for (const segment of this._getIntlSegmenterWordsOnLine(lineContent)) { + if (segment.index < offset) { + continue; + } + return segment; + } + return null; + } + + private _getIntlSegmenterWordsOnLine(line: string): IntlWordSegmentData[] { + if (!this._segmenter) { + return []; + } + + // Check if the line has changed from the previous call + if (this._cachedLine === line) { + return this._cachedSegments; + } + + // Update the cache with the new line + this._cachedLine = line; + this._cachedSegments = this._filterWordSegments(this._segmenter.segment(line)); + + return this._cachedSegments; + } + + private _filterWordSegments(segments: Intl.Segments): IntlWordSegmentData[] { + const result: IntlWordSegmentData[] = []; + for (const segment of segments) { + if (this._isWordLike(segment)) { + result.push(segment); + } + } + return result; + } + + private _isWordLike(segment: Intl.SegmentData): segment is IntlWordSegmentData { + if (segment.isWordLike) { + return true; + } + return false; + } +} + +export interface IntlWordSegmentData extends Intl.SegmentData { + isWordLike: true +} + +const wordClassifierCache = new LRUCache(10); + +type UnicodeBCP47LocaleIdentifier = string; + +export function getMapForWordSeparators( + wordSeparators: string, + intlSegmenterLocales: UnicodeBCP47LocaleIdentifier[] +): WordCharacterClassifier { + const key = `${wordSeparators}/${intlSegmenterLocales.join(',')}`; + let result = wordClassifierCache.get(key)!; + if (!result) { + result = new WordCharacterClassifier(wordSeparators, intlSegmenterLocales); + wordClassifierCache.set(key, result); + } + return result; +} diff --git a/packages/semi-json-viewer-core/src/common/worker.ts b/packages/semi-json-viewer-core/src/common/worker.ts new file mode 100644 index 0000000000..bc27597aac --- /dev/null +++ b/packages/semi-json-viewer-core/src/common/worker.ts @@ -0,0 +1,6 @@ +const isWebWorker = + typeof self === 'object' && self.constructor && self.constructor.name === 'DedicatedWorkerGlobalScope'; + +export function isInWorkerThread(): boolean { + return isWebWorker; +} diff --git a/packages/semi-json-viewer-core/src/index.ts b/packages/semi-json-viewer-core/src/index.ts new file mode 100644 index 0000000000..e7ff7f2cb6 --- /dev/null +++ b/packages/semi-json-viewer-core/src/index.ts @@ -0,0 +1 @@ +export * from './json-viewer/jsonViewer'; diff --git a/packages/semi-json-viewer-core/src/json-viewer/jsonViewer.ts b/packages/semi-json-viewer-core/src/json-viewer/jsonViewer.ts new file mode 100644 index 0000000000..800bbfe2cb --- /dev/null +++ b/packages/semi-json-viewer-core/src/json-viewer/jsonViewer.ts @@ -0,0 +1,68 @@ +import { View } from '../view/view'; +import { JSONModel } from '../model/jsonModel'; +import { disposeEmitter, Emitter, getEmitter } from '../common/emitter'; +import { createModel } from '../model'; +import { disposeWorkerManager, getJsonWorkerManager, JsonWorkerManager } from '../worker/jsonWorkerManager'; +import { CompletionItem } from '../service/jsonTypes'; +import { GlobalEvents } from '../common/emitterEvents'; +import { setCurrentNameSpaceId } from '../common/nameSpace'; +/** + * JsonViewer 主类 + */ +export interface JsonViewerOptions { + lineHeight?: number; + autoWrap?: boolean; + formatOptions?: FormattingOptions; + completionOptions?: CompletionOptions +} + +export interface CompletionOptions { + staticCompletions?: CompletionItem[] +} + +export interface FormattingOptions { + tabSize?: number; + insertSpaces?: boolean; + eol?: string +} + +export class JsonViewer { + private _container: HTMLElement; + private _jsonModel: JSONModel; + private _view: View; + private _jsonWorkerManager: JsonWorkerManager | null = null; + public emitter: Emitter; + private _id: string = `jsonviewer-${Math.random().toString(36).substr(2, 9)}`; + + constructor(container: HTMLElement, value: string, options?: JsonViewerOptions) { + setCurrentNameSpaceId(this._id); + this.emitter = getEmitter(); + this._container = container; + this._jsonModel = createModel(value); + this._jsonWorkerManager = getJsonWorkerManager(); + this._jsonWorkerManager.init(value); + this._view = new View(container, this._jsonModel, options); + } + + layout() { + this._view.layout(); + } + + getModel() { + return this._jsonModel; + } + + getSearchWidget() { + return this._view.searchWidget; + } + + format() { + this._view.editWidget.format(); + } + + dispose() { + disposeEmitter(this._id); + disposeWorkerManager(this._id); + this._view.dispose(); + } +} diff --git a/packages/semi-json-viewer-core/src/model/command.ts b/packages/semi-json-viewer-core/src/model/command.ts new file mode 100644 index 0000000000..694c4dd166 --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/command.ts @@ -0,0 +1,113 @@ +import { JSONModel } from './jsonModel'; +import { IModelContentChangeEvent } from '../common/emitterEvents'; + +export interface Command { + execute(): void; + undo(): void; + readonly operation: IModelContentChangeEvent | IModelContentChangeEvent[]; + readonly oldPos: { lineNumber: number; column: number }; + readonly newPos: { lineNumber: number; column: number } +} + +export abstract class BaseCommand implements Command { + public readonly oldPos: { lineNumber: number; column: number }; + public readonly newPos: { lineNumber: number; column: number }; + + constructor(protected model: JSONModel, public readonly operation: IModelContentChangeEvent) { + this.oldPos = { ...model.lastChangeBufferPos }; + this.model.updateLastChangeBufferPos(operation); + this.newPos = { ...model.lastChangeBufferPos }; + } + + abstract execute(): void; + abstract undo(): void; + + protected updateBufferPos(isUndo: boolean): void { + this.model.lastChangeBufferPos = { + ...(isUndo ? this.oldPos : this.newPos), + }; + } +} + +export class InsertCommand extends BaseCommand { + execute(): void { + this.model.pieceTree.insert(this.operation.rangeOffset, this.operation.newText); + this.updateBufferPos(false); + } + + undo(): void { + this.model.pieceTree.delete(this.operation.rangeOffset, this.operation.newText.length); + this.updateBufferPos(true); + } +} + +export class DeleteCommand extends BaseCommand { + execute(): void { + this.model.pieceTree.delete(this.operation.rangeOffset, this.operation.rangeLength); + this.updateBufferPos(false); + } + + undo(): void { + this.model.pieceTree.insert(this.operation.rangeOffset, this.operation.oldText); + this.updateBufferPos(true); + } +} + +export class ReplaceCommand extends BaseCommand { + execute(): void { + this.model.pieceTree.delete(this.operation.rangeOffset, this.operation.oldText.length); + this.model.pieceTree.insert(this.operation.rangeOffset, this.operation.newText); + this.updateBufferPos(false); + } + + undo(): void { + this.model.pieceTree.delete(this.operation.rangeOffset, this.operation.newText.length); + this.model.pieceTree.insert(this.operation.rangeOffset, this.operation.oldText); + this.updateBufferPos(true); + } +} + +export class MultiCommand implements Command { + public readonly oldPos: { lineNumber: number; column: number }; + public readonly newPos: { lineNumber: number; column: number }; + + constructor(private model: JSONModel, public readonly operation: IModelContentChangeEvent[]) { + this.oldPos = { ...model.lastChangeBufferPos }; + // operation.forEach(op => this.model.updateLastChangeBufferPos(op)); + this.newPos = { ...model.lastChangeBufferPos }; + } + + execute(): void { + for (let i = 0; i < this.operation.length; i++) { + const op = this.operation[i]; + switch (op.type) { + case 'insert': + this.model.pieceTree.insert(op.rangeOffset, op.newText); + break; + case 'delete': + this.model.pieceTree.delete(op.rangeOffset, op.rangeLength); + break; + case 'replace': + this.model.pieceTree.delete(op.rangeOffset, op.oldText.length); + this.model.pieceTree.insert(op.rangeOffset, op.newText); + break; + } + } + this.model.lastChangeBufferPos = { ...this.newPos }; + } + + undo(): void { + for (let i = this.operation.length - 1; i >= 0; i--) { + const op = this.operation[i]; + if (op.newText && op.oldText) { + this.model.pieceTree.delete(op.rangeOffset, op.newText.length); + this.model.pieceTree.insert(op.rangeOffset, op.oldText); + } else if (op.newText) { + this.model.pieceTree.delete(op.rangeOffset, op.newText.length); + } else { + this.model.pieceTree.insert(op.rangeOffset, op.oldText); + } + } + this.model.lastChangeBufferPos = { ...this.oldPos }; + } +} diff --git a/packages/semi-json-viewer-core/src/model/foldingModel.ts b/packages/semi-json-viewer-core/src/model/foldingModel.ts new file mode 100644 index 0000000000..031671f2b2 --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/foldingModel.ts @@ -0,0 +1,138 @@ +import { JSONModel } from './jsonModel'; +import { getFoldingRanges, FoldingRange } from '../service/jsonService'; +import { Emitter, getEmitter } from '../common/emitter'; +import { getJsonWorkerManager, JsonWorkerManager } from '../worker/jsonWorkerManager'; +import { GlobalEvents } from '../common/emitterEvents'; + +/** + * 折叠模型,管理JSON的折叠范围 + */ +//TODO 修改range数据结构 +export class FoldingModel { + private _jsonModel: JSONModel; + private _foldingRanges: FoldingRange[] = []; + private _collapsedRanges: Map = new Map(); // startLine -> endLine + private _jsonWorkerManager: JsonWorkerManager = getJsonWorkerManager(); + private emitter: Emitter = getEmitter(); + constructor(jsonModel: JSONModel) { + this._jsonModel = jsonModel; + this.updateFoldingRanges(); + this.emitter.on('problemsChanged', e => { + this.updateFoldingRanges(); + }); + } + + public updateFoldingRanges(): void { + this._jsonWorkerManager.foldRange().then(ranges => { + this._foldingRanges = ranges; + this.updateCollapsedRanges(); + }); + } + + private updateCollapsedRanges(): void { + const newCollapsedRanges = new Map(); + + for (const [startLine, endLine] of this._collapsedRanges) { + const range = this._foldingRanges.find(r => r.startLine === startLine); + if (range) { + newCollapsedRanges.set(startLine, range.endLine); + } + } + + this._collapsedRanges = newCollapsedRanges; + } + + public getFoldingRanges(): FoldingRange[] { + return this._foldingRanges; + } + + public toggleFoldingRange(startLine: number): void { + if (this._collapsedRanges.has(startLine)) { + this._collapsedRanges.delete(startLine); + } else { + const range = this._foldingRanges.find(r => r.startLine === startLine); + if (range) { + this._collapsedRanges.set(startLine, range.endLine); + } + } + } + + public isCollapsed(lineNumber: number): boolean { + return this._collapsedRanges.has(lineNumber); + } + + public isLineCollapsed(lineNumber: number): boolean { + if (this._collapsedRanges.has(lineNumber)) { + return false; + } + for (const [startLine, endLine] of this._collapsedRanges) { + if (lineNumber > startLine && lineNumber <= endLine) { + return true; + } + } + return false; + } + + public getVisibleLineNumber(actualLineNumber: number): number { + let visibleLine = actualLineNumber; + for (const [startLine, endLine] of this._collapsedRanges) { + if (startLine < actualLineNumber) { + if (endLine < actualLineNumber) { + visibleLine -= endLine - startLine; + } else if (actualLineNumber > startLine) { + return -1; + } + } else { + break; + } + } + return visibleLine; + } + + public getNextVisibleLine(actualLineNumber: number): number { + for (const [startLine, endLine] of this._collapsedRanges) { + if (actualLineNumber >= startLine && actualLineNumber <= endLine) { + return actualLineNumber === startLine ? startLine + 1 : endLine + 1; + } + } + return actualLineNumber + 1; + } + + public getActualLineNumber(visibleLineNumber: number): number { + let actualLine = visibleLineNumber; + for (const [startLine, endLine] of this._collapsedRanges) { + if (startLine < actualLine) { + actualLine += endLine - startLine; + } else { + break; + } + } + return actualLine; + } + + public isFoldable(lineNumber: number): boolean { + return this._foldingRanges.some(range => range.startLine === lineNumber); + } + + public expandLine(lineNumber: number): void { + for (const [startLine, endLine] of this._collapsedRanges) { + if (lineNumber > startLine && lineNumber <= endLine) { + this._collapsedRanges.delete(startLine); + } + } + } + + public getVisibleLineCount(): number { + let visibleCount = 0; + let lineNumber = 1; + + while (lineNumber <= this._jsonModel.getLineCount()) { + if (!this.isLineCollapsed(lineNumber)) { + visibleCount++; + } + lineNumber = this.getNextVisibleLine(lineNumber); + } + + return visibleCount; + } +} diff --git a/packages/semi-json-viewer-core/src/model/index.ts b/packages/semi-json-viewer-core/src/model/index.ts new file mode 100644 index 0000000000..3189188012 --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/index.ts @@ -0,0 +1,5 @@ +import { JSONModel } from './jsonModel'; + +export function createModel(text: string, normalizeEOL: boolean = true): JSONModel { + return new JSONModel(text, normalizeEOL); +} diff --git a/packages/semi-json-viewer-core/src/model/jsonModel.ts b/packages/semi-json-viewer-core/src/model/jsonModel.ts new file mode 100644 index 0000000000..8dd66cdaba --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/jsonModel.ts @@ -0,0 +1,326 @@ +import { GlobalEvents, IModelContentChangeEvent } from '../common/emitterEvents'; +import { DefaultEndOfLine, PieceTreeBase, PieceTreeTextBufferBuilder } from '../pieceTreeTextBuffer'; +import { Range } from '../common/range'; +import { Emitter, getEmitter } from '../common/emitter'; +import { Position } from '../common/position'; +import { EndOfLinePreference, FindMatch, SearchData } from '../common/model'; +import { SearchParams, TextModelSearch } from './textModelSearch'; +import { getJsonWorkerManager, JsonWorkerManager } from '../worker/jsonWorkerManager'; +import { isInWorkerThread } from '../common/worker'; +import { Command, DeleteCommand, InsertCommand, MultiCommand, ReplaceCommand } from './command'; + +/** + * JSONModel 类用于管理 JSON 数据模型 + */ +export class JSONModel { + private _pieceTree: PieceTreeBase; + private _normalizeEOL: boolean; + private _undoStack: Command[] = []; + private _redoStack: Command[] = []; + private readonly MAX_STACK_SIZE = 20; + public lastChangeBufferPos = { + lineNumber: 1, + column: 1, + }; + + private _jsonWorkerManager: JsonWorkerManager | null = null; + private emitter: Emitter | null = null; + + constructor(value: string, normalizeEOL: boolean = true) { + this._normalizeEOL = normalizeEOL; + this._pieceTree = this.createTextBuffer(value); + if (!isInWorkerThread()) { + this._jsonWorkerManager = getJsonWorkerManager(); + this.emitter = getEmitter(); + } + } + + get pieceTree() { + return this._pieceTree; + } + + createTextBufferFactory(value: string) { + const builder = new PieceTreeTextBufferBuilder(); + builder.acceptChunk(value); + return builder.finish(this._normalizeEOL); + } + + createTextBuffer(value: string) { + return this.createTextBufferFactory(value).create(DefaultEndOfLine.LF); + } + + /** + * 获取行数 + * @returns 行数 + */ + getLineCount(): number { + return this._pieceTree.getLineCount(); + } + + /** + * 获取行内容 + * @param lineNumber 行号 + * @returns 行内容 + */ + getLineContent(lineNumber: number): string { + return this._pieceTree.getLineContent(lineNumber); + } + + /** + * 获取行长度 + * @param lineNumber 行号 + * @returns 行内容 + */ + getLineLength(lineNumber: number): number { + return this._pieceTree.getLineLength(lineNumber); + } + + /** + * 获取偏移 + * @param lineNumber 行号 + * @param column 列号 + * @returns 行偏移 + */ + getOffsetAt(lineNumber: number, column: number): number { + return this._pieceTree.getOffsetAt(lineNumber, column); + } + + positionAt(offset: number): Position { + offset = Math.min(this._pieceTree.getLength(), Math.max(0, offset)); + return this._pieceTree.getPositionAt(offset); + } + + private _createCommand(op: IModelContentChangeEvent | IModelContentChangeEvent[]): Command { + if (Array.isArray(op)) { + return new MultiCommand(this, op); + } + switch (op.type) { + case 'insert': + return new InsertCommand(this, op); + case 'delete': + return new DeleteCommand(this, op); + case 'replace': + return new ReplaceCommand(this, op); + default: + throw new Error('Unknown operation type'); + } + } + + applyOperation(op: IModelContentChangeEvent | IModelContentChangeEvent[]) { + this._redoStack = []; + const command = this._createCommand(op); + this.pushUndoStack(command); + command.execute(); + + if (!isInWorkerThread()) { + this.emitter?.emit('contentChanged', op); + } + if (this._jsonWorkerManager) { + this._jsonWorkerManager + .updateModel(op) + .then(res => { + return this._jsonWorkerManager?.validate(); + }) + .then(result => { + this.emitter?.emit('problemsChanged', { + problems: result.problems, + root: result.root, + }); + }); + } + } + + updateLastChangeBufferPos(op: IModelContentChangeEvent) { + if (op.keepPosition) { + this.lastChangeBufferPos = op.keepPosition; + return; + } + switch (op.type) { + case 'insert': + this.lastChangeBufferPos.column += op.newText.length; + break; + case 'delete': + if (this.lastChangeBufferPos.column === 1) { + this.lastChangeBufferPos.lineNumber -= 1; + this.lastChangeBufferPos.column = this.getLineLength(this.lastChangeBufferPos.lineNumber) + 1; + } else { + const startColumn = op.range.startColumn; + const newColumn = op.rangeLength === 1 ? startColumn - 1 : startColumn; + this.lastChangeBufferPos.column = newColumn; + } + break; + case 'replace': + const newLineNumber = op.range.startLineNumber; + const newColumn = op.range.startColumn + op.newText.length; + this.lastChangeBufferPos.lineNumber = newLineNumber; + this.lastChangeBufferPos.column = newColumn; + break; + } + } + + pushUndoStack(command: Command) { + this._undoStack.push(command); + if (this._undoStack.length > this.MAX_STACK_SIZE) { + this._undoStack.shift(); + } + } + + pushRedoStack(command: Command) { + this._redoStack.push(command); + if (this._redoStack.length > this.MAX_STACK_SIZE) { + this._redoStack.shift(); + } + } + + canUndo(): boolean { + return this._undoStack.length > 0; + } + + canRedo(): boolean { + return this._redoStack.length > 0; + } + + undo() { + if (!this.canUndo()) return; + + const command = this._undoStack.pop()!; + command.undo(); + this._redoStack.push(command); + this.emitter?.emit('contentChanged', command.operation); + } + + redo() { + if (!this.canRedo()) return; + + const command = this._redoStack.pop()!; + command.execute(); + this._undoStack.push(command); + this.emitter?.emit('contentChanged', command.operation); + } + + + /** + * 获取值 + * @returns 值 + */ + getValue(): string { + return this._pieceTree.getValueInRange({ + startLineNumber: 1, + startColumn: 1, + endLineNumber: this._pieceTree.getLineCount(), + endColumn: this._pieceTree.getLineContent(this._pieceTree.getLineCount()).length + 1, + } as Range); + } + + /** + * 设置值 + * @param value 值 + */ + setValue(value: string): void { + const builder = new PieceTreeTextBufferBuilder(); + builder.acceptChunk(value); + this._pieceTree = builder.finish(this._normalizeEOL).create(1); + } + + getEOL() { + return this._pieceTree.getEOL(); + } + + private _getEndOfLine(eol: EndOfLinePreference): string { + switch (eol) { + case EndOfLinePreference.LF: + return '\n'; + case EndOfLinePreference.CRLF: + return '\r\n'; + case EndOfLinePreference.TextDefined: + return this.getEOL(); + default: + throw new Error('Unknown EOL preference'); + } + } + + getValueInRange(range: Range, eol: EndOfLinePreference = EndOfLinePreference.TextDefined) { + return this._pieceTree.getValueInRange(range, this._getEndOfLine(eol)); + } + + getFullModelRange(): Range { + const lineCount = this.getLineCount(); + return new Range(1, 1, lineCount, this.getLineLength(lineCount) + 1); + } + + findMatchesLineByLine( + searchRange: Range, + searchData: SearchData, + captureMatches: boolean, + limitResultCount: number + ) { + return this._pieceTree.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); + } + + /** + * 查找匹配 + * @param searchString 搜索字符串 + * @param rawSearchScope 搜索范围 + * @param isRegex 是否为正则表达式 + * @param matchCase 是否匹配大小写 + * @param wordSeparators 分隔符 + * @param captureMatches 是否捕获匹配 + * @param limitResultCount 限制结果数量 + * @returns 匹配结果 + * Based on https://github.com/microsoft/vscode with modifications for custom requirements + */ + findMatches( + searchString: string, + rawSearchScope: unknown, + isRegex: boolean, + matchCase: boolean, + wordSeparators: string | null, + captureMatches: boolean, + limitResultCount: number = Infinity + ) { + let searchRanges: Range[] | null = null; + + if (searchRanges === null) { + searchRanges = [this.getFullModelRange()]; + } + + searchRanges = searchRanges.sort( + (d1, d2) => d1.startLineNumber - d2.startLineNumber || d1.startColumn - d2.startColumn + ); + + const uniqueSearchRanges: Range[] = []; + uniqueSearchRanges.push( + searchRanges.reduce((prev, curr) => { + if (Range.areIntersecting(prev, curr)) { + return prev.plusRange(curr); + } + + uniqueSearchRanges.push(prev); + return curr; + }) + ); + + let matchMapper: (value: Range, index: number, array: Range[]) => FindMatch[]; + if (!isRegex && searchString.indexOf('\n') < 0) { + // not regex, not multi line + const searchParams = new SearchParams(searchString, isRegex, matchCase, wordSeparators); + const searchData = searchParams.parseSearchRequest(); + if (!searchData) { + return []; + } + + matchMapper = (searchRange: Range) => + this.findMatchesLineByLine(searchRange, searchData, captureMatches, limitResultCount); + } else { + matchMapper = (searchRange: Range) => + TextModelSearch.findMatches( + this, + new SearchParams(searchString, isRegex, matchCase, wordSeparators), + searchRange, + captureMatches, + limitResultCount + ); + } + return uniqueSearchRanges.map(matchMapper).reduce((arr, matches: FindMatch[]) => arr.concat(matches), []); + } +} diff --git a/packages/semi-json-viewer-core/src/model/selectionModel.ts b/packages/semi-json-viewer-core/src/model/selectionModel.ts new file mode 100644 index 0000000000..c659c3869f --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/selectionModel.ts @@ -0,0 +1,151 @@ +import { JSONModel } from './jsonModel'; +import { View } from '../view/view'; +import { getLineElement } from '../common/dom'; +import { Position } from '../common/position'; + +/** + * 选择模型,管理JSON的选中范围和选中状态 + */ +export class SelectionModel { + private _row: number; + private _col: number; + public startRow: number; + public startCol: number; + public endRow: number; + public endCol: number; + public isCollapsed: boolean; + public isSelectedAll: boolean = false; + private _view: View; + private _jsonModel: JSONModel; + constructor(row: number, col: number, view: View, jsonModel: JSONModel) { + this._row = row; + this._col = col; + this._view = view; + this.startRow = row; + this.startCol = col; + this.endRow = row; + this.endCol = col; + this.isCollapsed = true; + this._jsonModel = jsonModel; + } + + + updateSelection(row: number, col: number) { + this._row = row; + this._col = col; + } + + getSelection() { + return { + row: this._row, + col: this._col, + }; + } + + getPosition(): Position { + return { + lineNumber: this._row, + column: this._col, + } as Position; + } + + public updateFromSelection() { + const selection = window.getSelection(); + if (!selection || selection.rangeCount === 0) return; + + const range = selection.getRangeAt(0); + this.isCollapsed = range.collapsed; + const startContainer = range.startContainer; + const endContainer = range.endContainer; + + let { row: row1, col: col1 } = this.convertRangeToModelPosition(startContainer, selection, true); + let { row: row2, col: col2 } = this.convertRangeToModelPosition(endContainer, selection, false); + if (row1 > row2) { + [row1, row2] = [row2, row1]; + [col1, col2] = [col2, col1]; + } else if (row1 === row2 && col1 > col2) { + [col1, col2] = [col2, col1]; + } + + this._row = row1; + this._col = col1; + this.startRow = row1; + this.startCol = col1; + this.endRow = row2; + this.endCol = col2; + this._jsonModel.lastChangeBufferPos = { + lineNumber: this._row, + column: this._col, + }; + } + + public toViewPosition() { + const selection = window.getSelection(); + + if (!selection) return; + const range = new Range(); + + if (this.isSelectedAll) { + range.setStartBefore(this._view.scrollDom.firstChild!); + range.setEndAfter(this._view.scrollDom.lastChild!); + selection.removeAllRanges(); + selection.addRange(range); + return; + } + const row = this._jsonModel.lastChangeBufferPos.lineNumber; + const col = this._jsonModel.lastChangeBufferPos.column - 1; + + if (row < this._view.startLineNumber || row > this._view.startLineNumber + this._view.visibleLineCount) { + selection.removeAllRanges(); + return; + } + const lineElement = this._view.getLineElement(row); + if (!lineElement) return; + if (col === 0) { + range.setStart(lineElement, 0); + range.setEnd(lineElement, 0); + } else { + let offset = col; + for (let i = 0; i < lineElement.childNodes.length; i++) { + const childNode = lineElement.childNodes[i]; + if (childNode.textContent && offset <= childNode.textContent.length) { + range.setStart(childNode.childNodes[0], offset); + range.setEnd(childNode.childNodes[0], offset); + break; + } + offset -= (childNode as Text).textContent?.length || 0; + } + } + + if (!selection) return; + selection.removeAllRanges(); + selection.addRange(range); + } + + convertRangeToModelPosition(node: Node, selection: Selection, isStart: boolean) { + let row = 1; + let col = 0; + if (!node) return { row, col }; + let lineElement: HTMLElement | null; + if (node instanceof HTMLElement) { + lineElement = node.closest('.semi-json-viewer-view-line'); + } else { + lineElement = getLineElement(node); + if (!lineElement) return { row, col }; + let totalOffset = 0; + for (let i = 0; i < lineElement.childNodes.length; i++) { + const childNode = lineElement.childNodes[i]; + + if (childNode === node.parentElement) { + totalOffset += isStart ? selection.anchorOffset : selection.focusOffset; + break; + } + totalOffset += childNode.textContent?.length || 0; + } + + col = totalOffset; + } + row = (lineElement as any).lineNumber || 1; + return { row, col: col + 1 }; + } +} diff --git a/packages/semi-json-viewer-core/src/model/textModelSearch.ts b/packages/semi-json-viewer-core/src/model/textModelSearch.ts new file mode 100644 index 0000000000..f907ce6691 --- /dev/null +++ b/packages/semi-json-viewer-core/src/model/textModelSearch.ts @@ -0,0 +1,529 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ +import { CharCode } from '../common/charCode'; +import { + getMapForWordSeparators, + WordCharacterClass, + WordCharacterClassifier, +} from '../common/wordCharacterClassifier'; +import { FindMatch } from '../common/model'; +import { Range } from '../common/range'; +import { EndOfLinePreference, SearchData } from '../common/model'; +import { createRegExp, getNextCodePoint } from '../common/strings'; +import { JSONModel } from './jsonModel'; +const LIMIT_FIND_COUNT = 999; + + +class LineFeedCounter { + private readonly _lineFeedsOffsets: number[]; + + constructor(text: string) { + const lineFeedsOffsets: number[] = []; + let lineFeedsOffsetsLen = 0; + for (let i = 0, textLen = text.length; i < textLen; i++) { + if (text.charCodeAt(i) === CharCode.LineFeed) { + lineFeedsOffsets[lineFeedsOffsetsLen++] = i; + } + } + this._lineFeedsOffsets = lineFeedsOffsets; + } + + public findLineFeedCountBeforeOffset(offset: number): number { + const lineFeedsOffsets = this._lineFeedsOffsets; + let min = 0; + let max = lineFeedsOffsets.length - 1; + + if (max === -1) { + // no line feeds + return 0; + } + + if (offset <= lineFeedsOffsets[0]) { + // before first line feed + return 0; + } + + while (min < max) { + const mid = min + (((max - min) / 2) >> 0); + + if (lineFeedsOffsets[mid] >= offset) { + max = mid - 1; + } else { + if (lineFeedsOffsets[mid + 1] >= offset) { + // bingo! + min = mid; + max = mid; + } else { + min = mid + 1; + } + } + } + return min + 1; + } +} + +export class TextModelSearch { + public static findMatches( + model: JSONModel, + searchParams: SearchParams, + searchRange: Range, + captureMatches: boolean, + limitResultCount: number + ) { + const searchData = searchParams.parseSearchRequest(); + if (!searchData) return []; + if (searchData.regex.multiline) { + return this._doFindMatchesMultiline( + model, + searchRange, + new Searcher(searchData.wordSeparators, searchData.regex), + captureMatches, + limitResultCount + ); + } + return this._doFindMatchesLineByLine(model, searchRange, searchData, captureMatches, limitResultCount); + } + + private static _doFindMatchesMultiline( + model: JSONModel, + searchRange: Range, + searcher: Searcher, + captureMatches: boolean, + limitResultCount: number + ): FindMatch[] { + const pos = searchRange.getStartPosition(); + const deltaOffset = model.getOffsetAt(pos.lineNumber, pos.column); + // We always execute multiline search over the lines joined with \n + // This makes it that \n will match the EOL for both CRLF and LF models + // We compensate for offset errors in `_getMultilineMatchRange` + const text = model.getValueInRange(searchRange, EndOfLinePreference.LF); + const lfCounter = model.getEOL() === '\r\n' ? new LineFeedCounter(text) : null; + + const result: FindMatch[] = []; + let counter = 0; + + let m: RegExpExecArray | null; + searcher.reset(0); + while ((m = searcher.next(text))) { + result[counter++] = createFindMatch( + this._getMultilineMatchRange(model, deltaOffset, text, lfCounter, m.index, m[0]), + m, + captureMatches + ); + if (counter >= limitResultCount) { + return result; + } + } + + return result; + } + + /** + * Multiline search always executes on the lines concatenated with \n. + * We must therefore compensate for the count of \n in case the model is CRLF + */ + private static _getMultilineMatchRange( + model: JSONModel, + deltaOffset: number, + text: string, + lfCounter: LineFeedCounter | null, + matchIndex: number, + match0: string + ): Range { + let startOffset: number; + let lineFeedCountBeforeMatch = 0; + if (lfCounter) { + lineFeedCountBeforeMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex); + startOffset = deltaOffset + matchIndex + lineFeedCountBeforeMatch /* add as many \r as there were \n */; + } else { + startOffset = deltaOffset + matchIndex; + } + + let endOffset: number; + if (lfCounter) { + const lineFeedCountBeforeEndOfMatch = lfCounter.findLineFeedCountBeforeOffset(matchIndex + match0.length); + const lineFeedCountInMatch = lineFeedCountBeforeEndOfMatch - lineFeedCountBeforeMatch; + endOffset = startOffset + match0.length + lineFeedCountInMatch /* add as many \r as there were \n */; + } else { + endOffset = startOffset + match0.length; + } + + const startPosition = model.positionAt(startOffset); + const endPosition = model.positionAt(endOffset); + return new Range(startPosition.lineNumber, startPosition.column, endPosition.lineNumber, endPosition.column); + } + + private static _doFindMatchesLineByLine( + model: JSONModel, + searchRange: Range, + searchData: SearchData, + captureMatches: boolean, + limitResultCount: number + ) { + const res: FindMatch[] = []; + let resLen = 0; + if (searchRange.startLineNumber === searchRange.endLineNumber) { + const text = model + .getLineContent(searchRange.startLineNumber) + .substring(searchRange.startColumn - 1, searchRange.endColumn - 1); + resLen = this._findMatchesInLine( + searchData, + text, + searchRange.startLineNumber, + searchRange.startColumn - 1, + resLen, + res, + captureMatches, + limitResultCount + ); + } + const text = model.getLineContent(searchRange.startLineNumber).substring(searchRange.startColumn - 1); + resLen = this._findMatchesInLine( + searchData, + text, + searchRange.startLineNumber, + searchRange.startColumn - 1, + resLen, + res, + captureMatches, + limitResultCount + ); + + // Collect results from middle lines + for ( + let lineNumber = searchRange.startLineNumber + 1; + lineNumber < searchRange.endLineNumber && resLen < limitResultCount; + lineNumber++ + ) { + resLen = this._findMatchesInLine( + searchData, + model.getLineContent(lineNumber), + lineNumber, + 0, + resLen, + res, + captureMatches, + limitResultCount + ); + } + + // Collect results from last line + if (resLen < limitResultCount) { + const text = model.getLineContent(searchRange.endLineNumber).substring(0, searchRange.endColumn - 1); + resLen = this._findMatchesInLine( + searchData, + text, + searchRange.endLineNumber, + 0, + resLen, + res, + captureMatches, + limitResultCount + ); + } + + return res; + } + + private static _findMatchesInLine( + searchData: SearchData, + text: string, + lineNumber: number, + deltaOffset: number, + resultLen: number, + result: FindMatch[], + captureMatches: boolean, + limitResultCount: number + ) { + const wordSeparators = searchData.wordSeparators; + if (!captureMatches && searchData.simpleSearch) { + const searchString = searchData.simpleSearch; + const searchStringLen = searchString.length; + const textLength = text.length; + let lastMatchIndex = -searchStringLen; + while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { + if ( + !wordSeparators || + isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen) + ) { + result[resultLen++] = new FindMatch( + new Range( + lineNumber, + lastMatchIndex + 1 + deltaOffset, + lineNumber, + lastMatchIndex + 1 + searchStringLen + deltaOffset + ), + null + ); + if (resultLen >= limitResultCount) return resultLen; + } + } + } + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + let m: RegExpExecArray | null; + searcher.reset(0); + do { + m = searcher.next(text); + if (m) { + result[resultLen++] = createFindMatch( + new Range( + lineNumber, + m.index + 1 + deltaOffset, + lineNumber, + m.index + 1 + m[0].length + deltaOffset + ), + m, + captureMatches + ); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + return resultLen; + } +} + +export class SearchParams { + public readonly searchString: string; + public readonly isRegex: boolean; + public readonly matchCase: boolean; + public readonly wordSeparators: string | null; + + constructor(searchString: string, isRegex: boolean, matchCase: boolean, wordSeparators: string | null) { + this.searchString = searchString; + this.isRegex = isRegex; + this.matchCase = matchCase; + this.wordSeparators = wordSeparators; + } + + public parseSearchRequest(): SearchData | null { + if (this.searchString === '') { + return null; + } + + // Try to create a RegExp out of the params + let multiline: boolean; + if (this.isRegex) { + multiline = isMultilineRegexSource(this.searchString); + } else { + multiline = this.searchString.indexOf('\n') >= 0; + } + + let regex: RegExp | null = null; + try { + regex = createRegExp(this.searchString, this.isRegex, { + matchCase: this.matchCase, + wholeWord: false, + multiline: multiline, + global: true, + unicode: true, + }); + } catch (err) { + return null; + } + + if (!regex) { + return null; + } + + let canUseSimpleSearch = !this.isRegex && !multiline; + if (canUseSimpleSearch && this.searchString.toLowerCase() !== this.searchString.toUpperCase()) { + // casing might make a difference + canUseSimpleSearch = this.matchCase; + } + + return new SearchData( + regex, + this.wordSeparators ? getMapForWordSeparators(this.wordSeparators, []) : null, + canUseSimpleSearch ? this.searchString : null + ); + } +} + +export function isMultilineRegexSource(searchString: string): boolean { + if (!searchString || searchString.length === 0) { + return false; + } + + for (let i = 0, len = searchString.length; i < len; i++) { + const chCode = searchString.charCodeAt(i); + + if (chCode === CharCode.LineFeed) { + return true; + } + + if (chCode === CharCode.Backslash) { + // move to next char + i++; + + if (i >= len) { + // string ends with a \ + break; + } + + const nextChCode = searchString.charCodeAt(i); + if (nextChCode === CharCode.n || nextChCode === CharCode.r || nextChCode === CharCode.W) { + return true; + } + } + } + + return false; +} + +function leftIsWordBounday( + wordSeparators: WordCharacterClassifier, + text: string, + textLength: number, + matchStartIndex: number, + matchLength: number +): boolean { + if (matchStartIndex === 0) { + // Match starts at start of string + return true; + } + + const charBefore = text.charCodeAt(matchStartIndex - 1); + if (wordSeparators.get(charBefore) !== WordCharacterClass.Regular) { + // The character before the match is a word separator + return true; + } + + if (charBefore === CharCode.CarriageReturn || charBefore === CharCode.LineFeed) { + // The character before the match is line break or carriage return. + return true; + } + + if (matchLength > 0) { + const firstCharInMatch = text.charCodeAt(matchStartIndex); + if (wordSeparators.get(firstCharInMatch) !== WordCharacterClass.Regular) { + // The first character inside the match is a word separator + return true; + } + } + + return false; +} + +function rightIsWordBounday( + wordSeparators: WordCharacterClassifier, + text: string, + textLength: number, + matchStartIndex: number, + matchLength: number +): boolean { + if (matchStartIndex + matchLength === textLength) { + // Match ends at end of string + return true; + } + + const charAfter = text.charCodeAt(matchStartIndex + matchLength); + if (wordSeparators.get(charAfter) !== WordCharacterClass.Regular) { + // The character after the match is a word separator + return true; + } + + if (charAfter === CharCode.CarriageReturn || charAfter === CharCode.LineFeed) { + // The character after the match is line break or carriage return. + return true; + } + + if (matchLength > 0) { + const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1); + if (wordSeparators.get(lastCharInMatch) !== WordCharacterClass.Regular) { + // The last character in the match is a word separator + return true; + } + } + + return false; +} + +export function isValidMatch( + wordSeparators: WordCharacterClassifier, + text: string, + textLength: number, + matchStartIndex: number, + matchLength: number +): boolean { + return ( + leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) && + rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) + ); +} + +export class Searcher { + public readonly _wordSeparators: WordCharacterClassifier | null; + private readonly _searchRegex: RegExp; + private _prevMatchStartIndex: number; + private _prevMatchLength: number; + + constructor(wordSeparators: WordCharacterClassifier | null, searchRegex: RegExp) { + this._wordSeparators = wordSeparators; + this._searchRegex = searchRegex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + + public reset(lastIndex: number): void { + this._searchRegex.lastIndex = lastIndex; + this._prevMatchStartIndex = -1; + this._prevMatchLength = 0; + } + + public next(text: string): RegExpExecArray | null { + const textLength = text.length; + + let m: RegExpExecArray | null; + do { + if (this._prevMatchStartIndex + this._prevMatchLength === textLength) { + // Reached the end of the line + return null; + } + + m = this._searchRegex.exec(text); + if (!m) { + return null; + } + + const matchStartIndex = m.index; + const matchLength = m[0].length; + if (matchStartIndex === this._prevMatchStartIndex && matchLength === this._prevMatchLength) { + if (matchLength === 0) { + // the search result is an empty string and won't advance `regex.lastIndex`, so `regex.exec` will stuck here + // we attempt to recover from that by advancing by two if surrogate pair found and by one otherwise + if (getNextCodePoint(text, textLength, this._searchRegex.lastIndex) > 0xffff) { + this._searchRegex.lastIndex += 2; + } else { + this._searchRegex.lastIndex += 1; + } + continue; + } + // Exit early if the regex matches the same range twice + return null; + } + this._prevMatchStartIndex = matchStartIndex; + this._prevMatchLength = matchLength; + + if ( + !this._wordSeparators || + isValidMatch(this._wordSeparators, text, textLength, matchStartIndex, matchLength) + ) { + return m; + } + } while (m); + + return null; + } +} + +export function createFindMatch(range: Range, rawMatches: RegExpExecArray, captureMatches: boolean): FindMatch { + if (!captureMatches) { + return new FindMatch(range, null); + } + const matches: string[] = []; + for (let i = 0, len = rawMatches.length; i < len; i++) { + matches[i] = rawMatches[i]; + } + return new FindMatch(range, matches); +} diff --git a/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/index.ts b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/index.ts new file mode 100644 index 0000000000..2822c6f633 --- /dev/null +++ b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/index.ts @@ -0,0 +1,2 @@ +export * from './pieceTreeBase'; +export * from './pieceTreeTextBufferBuilder'; diff --git a/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeBase.ts b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeBase.ts new file mode 100644 index 0000000000..858888cd1a --- /dev/null +++ b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeBase.ts @@ -0,0 +1,2028 @@ +/** reference from https://github.com/microsoft/vscode */ + +import { CharCode } from '../common/charCode'; +import { Position } from '../common/position'; +import { Range } from '../common/range'; +import { FindMatch, ITextSnapshot, SearchData } from '../common/model'; +import { + NodeColor, + SENTINEL, + TreeNode, + fixInsert, + leftest, + rbDelete, + righttest, + updateTreeMetadata, +} from './rbTreeBase'; +import { Searcher, createFindMatch, isValidMatch } from '../model/textModelSearch'; + +// const lfRegex = new RegExp(/\r\n|\r|\n/g); +const AverageBufferSize = 65535; + +function createUintArray(arr: number[]): Uint32Array | Uint16Array { + let r; + if (arr[arr.length - 1] < 65536) { + r = new Uint16Array(arr.length); + } else { + r = new Uint32Array(arr.length); + } + r.set(arr, 0); + return r; +} + +class LineStarts { + constructor( + public readonly lineStarts: Uint32Array | Uint16Array | number[], + public readonly cr: number, + public readonly lf: number, + public readonly crlf: number, + public readonly isBasicASCII: boolean + ) {} +} + +export function createLineStartsFast(str: string, readonly: boolean = true): Uint32Array | Uint16Array | number[] { + const r: number[] = [0]; + let rLength = 1; + + for (let i = 0, len = str.length; i < len; i++) { + const chr = str.charCodeAt(i); + + if (chr === CharCode.CarriageReturn) { + if (i + 1 < len && str.charCodeAt(i + 1) === CharCode.LineFeed) { + // \r\n... case + r[rLength++] = i + 2; + i++; // skip \n + } else { + // \r... case + r[rLength++] = i + 1; + } + } else if (chr === CharCode.LineFeed) { + r[rLength++] = i + 1; + } + } + if (readonly) { + return createUintArray(r); + } else { + return r; + } +} + +export function createLineStarts(r: number[], str: string): LineStarts { + r.length = 0; + r[0] = 0; + let rLength = 1; + let cr = 0, + lf = 0, + crlf = 0; + let isBasicASCII = true; + for (let i = 0, len = str.length; i < len; i++) { + const chr = str.charCodeAt(i); + + if (chr === CharCode.CarriageReturn) { + if (i + 1 < len && str.charCodeAt(i + 1) === CharCode.LineFeed) { + // \r\n... case + crlf++; + r[rLength++] = i + 2; + i++; // skip \n + } else { + cr++; + // \r... case + r[rLength++] = i + 1; + } + } else if (chr === CharCode.LineFeed) { + lf++; + r[rLength++] = i + 1; + } else { + if (isBasicASCII) { + if (chr !== CharCode.Tab && (chr < 32 || chr > 126)) { + isBasicASCII = false; + } + } + } + } + const result = new LineStarts(createUintArray(r), cr, lf, crlf, isBasicASCII); + r.length = 0; + + return result; +} + +interface NodePosition { + /** + * Piece Index + */ + node: TreeNode; + /** + * remainder in current piece. + */ + remainder: number; + /** + * node start offset in document. + */ + nodeStartOffset: number +} + +export interface BufferCursor { + /** + * Line number in current buffer + */ + line: number; + /** + * Column number in current buffer + */ + column: number +} + +export class Piece { + readonly bufferIndex: number; + readonly start: BufferCursor; + readonly end: BufferCursor; + readonly length: number; + readonly lineFeedCnt: number; + + constructor(bufferIndex: number, start: BufferCursor, end: BufferCursor, lineFeedCnt: number, length: number) { + this.bufferIndex = bufferIndex; + this.start = start; + this.end = end; + this.lineFeedCnt = lineFeedCnt; + this.length = length; + } +} + +export class StringBuffer { + buffer: string; + lineStarts: Uint32Array | Uint16Array | number[]; + + constructor(buffer: string, lineStarts: Uint32Array | Uint16Array | number[]) { + this.buffer = buffer; + this.lineStarts = lineStarts; + } +} + +/** + * Readonly snapshot for piece tree. + * In a real multiple thread environment, to make snapshot reading always work correctly, we need to + * 1. Make TreeNode.piece immutable, then reading and writing can run in parallel. + * 2. TreeNode/Buffers normalization should not happen during snapshot reading. + */ +class PieceTreeSnapshot implements ITextSnapshot { + private readonly _pieces: Piece[]; + private _index: number; + private readonly _tree: PieceTreeBase; + private readonly _BOM: string; + + constructor(tree: PieceTreeBase, BOM: string) { + this._pieces = []; + this._tree = tree; + this._BOM = BOM; + this._index = 0; + if (tree.root !== SENTINEL) { + tree.iterate(tree.root, node => { + if (node !== SENTINEL) { + this._pieces.push(node.piece); + } + return true; + }); + } + } + + read(): string | null { + if (this._pieces.length === 0) { + if (this._index === 0) { + this._index++; + return this._BOM; + } else { + return null; + } + } + + if (this._index > this._pieces.length - 1) { + return null; + } + + if (this._index === 0) { + return this._BOM + this._tree.getPieceContent(this._pieces[this._index++]); + } + return this._tree.getPieceContent(this._pieces[this._index++]); + } +} + +interface CacheEntry { + node: TreeNode; + nodeStartOffset: number; + nodeStartLineNumber?: number +} + +class PieceTreeSearchCache { + private readonly _limit: number; + private _cache: CacheEntry[]; + + constructor(limit: number) { + this._limit = limit; + this._cache = []; + } + + public get(offset: number): CacheEntry | null { + for (let i = this._cache.length - 1; i >= 0; i--) { + const nodePos = this._cache[i]; + if (nodePos.nodeStartOffset <= offset && nodePos.nodeStartOffset + nodePos.node.piece.length >= offset) { + return nodePos; + } + } + return null; + } + + public get2( + lineNumber: number + ): { + node: TreeNode; + nodeStartOffset: number; + nodeStartLineNumber: number + } | null { + for (let i = this._cache.length - 1; i >= 0; i--) { + const nodePos = this._cache[i]; + if ( + nodePos.nodeStartLineNumber && + nodePos.nodeStartLineNumber < lineNumber && + nodePos.nodeStartLineNumber + nodePos.node.piece.lineFeedCnt >= lineNumber + ) { + return < + { + node: TreeNode; + nodeStartOffset: number; + nodeStartLineNumber: number + } + >nodePos; + } + } + return null; + } + + public set(nodePosition: CacheEntry) { + if (this._cache.length >= this._limit) { + this._cache.shift(); + } + this._cache.push(nodePosition); + } + + public validate(offset: number) { + let hasInvalidVal = false; + const tmp: Array = this._cache; + for (let i = 0; i < tmp.length; i++) { + const nodePos = tmp[i]!; + if (nodePos.node.parent === null || nodePos.nodeStartOffset >= offset) { + tmp[i] = null; + hasInvalidVal = true; + continue; + } + } + + if (hasInvalidVal) { + const newArr: CacheEntry[] = []; + for (const entry of tmp) { + if (entry !== null) { + newArr.push(entry); + } + } + + this._cache = newArr; + } + } +} + +export class PieceTreeBase { + root!: TreeNode; + protected _buffers!: StringBuffer[]; // 0 is change buffer, others are readonly original buffer. + protected _lineCnt!: number; + protected _length!: number; + protected _EOL!: '\r\n' | '\n'; + protected _EOLLength!: number; + protected _EOLNormalized!: boolean; + private _lastChangeBufferPos!: BufferCursor; + private _searchCache!: PieceTreeSearchCache; + private _lastVisitedLine!: { lineNumber: number; value: string }; + + constructor(chunks: StringBuffer[], eol: '\r\n' | '\n', eolNormalized: boolean) { + this.create(chunks, eol, eolNormalized); + } + + create(chunks: StringBuffer[], eol: '\r\n' | '\n', eolNormalized: boolean) { + this._buffers = [new StringBuffer('', [0])]; + this._lastChangeBufferPos = { line: 0, column: 0 }; + this.root = SENTINEL; + this._lineCnt = 1; + this._length = 0; + this._EOL = eol; + this._EOLLength = eol.length; + this._EOLNormalized = eolNormalized; + + let lastNode: TreeNode | null = null; + for (let i = 0, len = chunks.length; i < len; i++) { + if (chunks[i].buffer.length > 0) { + if (!chunks[i].lineStarts) { + chunks[i].lineStarts = createLineStartsFast(chunks[i].buffer); + } + + const piece = new Piece( + i + 1, + { line: 0, column: 0 }, + { + line: chunks[i].lineStarts.length - 1, + column: chunks[i].buffer.length - chunks[i].lineStarts[chunks[i].lineStarts.length - 1], + }, + chunks[i].lineStarts.length - 1, + chunks[i].buffer.length + ); + this._buffers.push(chunks[i]); + lastNode = this.rbInsertRight(lastNode, piece); + } + } + + this._searchCache = new PieceTreeSearchCache(1); + this._lastVisitedLine = { lineNumber: 0, value: '' }; + this.computeBufferMetadata(); + } + + normalizeEOL(eol: '\r\n' | '\n') { + const averageBufferSize = AverageBufferSize; + const min = averageBufferSize - Math.floor(averageBufferSize / 3); + const max = min * 2; + + let tempChunk = ''; + let tempChunkLen = 0; + const chunks: StringBuffer[] = []; + + this.iterate(this.root, node => { + const str = this.getNodeContent(node); + const len = str.length; + if (tempChunkLen <= min || tempChunkLen + len < max) { + tempChunk += str; + tempChunkLen += len; + return true; + } + + // flush anyways + const text = tempChunk.replace(/\r\n|\r|\n/g, eol); + chunks.push(new StringBuffer(text, createLineStartsFast(text))); + tempChunk = str; + tempChunkLen = len; + return true; + }); + + if (tempChunkLen > 0) { + const text = tempChunk.replace(/\r\n|\r|\n/g, eol); + chunks.push(new StringBuffer(text, createLineStartsFast(text))); + } + + this.create(chunks, eol, true); + } + + // #region Buffer API + public getEOL(): '\r\n' | '\n' { + return this._EOL; + } + + public setEOL(newEOL: '\r\n' | '\n'): void { + this._EOL = newEOL; + this._EOLLength = this._EOL.length; + this.normalizeEOL(newEOL); + } + + public createSnapshot(BOM: string): ITextSnapshot { + return new PieceTreeSnapshot(this, BOM); + } + + public equal(other: PieceTreeBase): boolean { + if (this.getLength() !== other.getLength()) { + return false; + } + if (this.getLineCount() !== other.getLineCount()) { + return false; + } + + let offset = 0; + const ret = this.iterate(this.root, node => { + if (node === SENTINEL) { + return true; + } + const str = this.getNodeContent(node); + const len = str.length; + const startPosition = other.nodeAt(offset); + const endPosition = other.nodeAt(offset + len); + const val = other.getValueInRange2(startPosition, endPosition); + + offset += len; + return str === val; + }); + + return ret; + } + + public getOffsetAt(lineNumber: number, column: number): number { + let leftLen = 0; // inorder + + let x = this.root; + + while (x !== SENTINEL) { + if (x.left !== SENTINEL && x.lf_left + 1 >= lineNumber) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt + 1 >= lineNumber) { + leftLen += x.size_left; + // lineNumber >= 2 + const accumualtedValInCurrentIndex = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + return (leftLen += accumualtedValInCurrentIndex + column - 1); + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + leftLen += x.size_left + x.piece.length; + x = x.right; + } + } + + return leftLen; + } + + public getPositionAt(offset: number): Position { + offset = Math.floor(offset); + offset = Math.max(0, offset); + + let x = this.root; + let lfCnt = 0; + const originalOffset = offset; + + while (x !== SENTINEL) { + if (x.size_left !== 0 && x.size_left >= offset) { + x = x.left; + } else if (x.size_left + x.piece.length >= offset) { + const out = this.getIndexOf(x, offset - x.size_left); + + lfCnt += x.lf_left + out.index; + + if (out.index === 0) { + const lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); + const column = originalOffset - lineStartOffset; + return new Position(lfCnt + 1, column + 1); + } + + return new Position(lfCnt + 1, out.remainder + 1); + } else { + offset -= x.size_left + x.piece.length; + lfCnt += x.lf_left + x.piece.lineFeedCnt; + + if (x.right === SENTINEL) { + // last node + const lineStartOffset = this.getOffsetAt(lfCnt + 1, 1); + const column = originalOffset - offset - lineStartOffset; + return new Position(lfCnt + 1, column + 1); + } else { + x = x.right; + } + } + } + + return new Position(1, 1); + } + + public getValueInRange(range: Range, eol?: string): string { + if (range.startLineNumber === range.endLineNumber && range.startColumn === range.endColumn) { + return ''; + } + + const startPosition = this.nodeAt2(range.startLineNumber, range.startColumn); + const endPosition = this.nodeAt2(range.endLineNumber, range.endColumn); + + const value = this.getValueInRange2(startPosition, endPosition); + if (eol) { + if (eol !== this._EOL || !this._EOLNormalized) { + return value.replace(/\r\n|\r|\n/g, eol); + } + + if (eol === this.getEOL() && this._EOLNormalized) { + // if (eol === '\r\n') {} + return value; + } + return value.replace(/\r\n|\r|\n/g, eol); + } + return value; + } + + public getValueInRange2(startPosition: NodePosition, endPosition: NodePosition): string { + if (startPosition.node === endPosition.node) { + const node = startPosition.node; + const buffer = this._buffers[node.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); + return buffer.substring(startOffset + startPosition.remainder, startOffset + endPosition.remainder); + } + + let x = startPosition.node; + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + let ret = buffer.substring(startOffset + startPosition.remainder, startOffset + x.piece.length); + + x = x.next(); + while (x !== SENTINEL) { + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + + if (x === endPosition.node) { + ret += buffer.substring(startOffset, startOffset + endPosition.remainder); + break; + } else { + ret += buffer.substr(startOffset, x.piece.length); + } + + x = x.next(); + } + + return ret; + } + + public getLinesContent(): string[] { + const lines: string[] = []; + let linesLength = 0; + let currentLine = ''; + let danglingCR = false; + + this.iterate(this.root, node => { + if (node === SENTINEL) { + return true; + } + + const piece = node.piece; + let pieceLength = piece.length; + if (pieceLength === 0) { + return true; + } + + const buffer = this._buffers[piece.bufferIndex].buffer; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + + const pieceStartLine = piece.start.line; + const pieceEndLine = piece.end.line; + let pieceStartOffset = lineStarts[pieceStartLine] + piece.start.column; + + if (danglingCR) { + if (buffer.charCodeAt(pieceStartOffset) === CharCode.LineFeed) { + // pretend the \n was in the previous piece.. + pieceStartOffset++; + pieceLength--; + } + lines[linesLength++] = currentLine; + currentLine = ''; + danglingCR = false; + if (pieceLength === 0) { + return true; + } + } + + if (pieceStartLine === pieceEndLine) { + // this piece has no new lines + if ( + !this._EOLNormalized && + buffer.charCodeAt(pieceStartOffset + pieceLength - 1) === CharCode.CarriageReturn + ) { + danglingCR = true; + currentLine += buffer.substr(pieceStartOffset, pieceLength - 1); + } else { + currentLine += buffer.substr(pieceStartOffset, pieceLength); + } + return true; + } + + // add the text before the first line start in this piece + currentLine += this._EOLNormalized + ? buffer.substring( + pieceStartOffset, + Math.max(pieceStartOffset, lineStarts[pieceStartLine + 1] - this._EOLLength) + ) + : buffer.substring(pieceStartOffset, lineStarts[pieceStartLine + 1]).replace(/(\r\n|\r|\n)$/, ''); + lines[linesLength++] = currentLine; + + for (let line = pieceStartLine + 1; line < pieceEndLine; line++) { + currentLine = this._EOLNormalized + ? buffer.substring(lineStarts[line], lineStarts[line + 1] - this._EOLLength) + : buffer.substring(lineStarts[line], lineStarts[line + 1]).replace(/(\r\n|\r|\n)$/, ''); + lines[linesLength++] = currentLine; + } + + if ( + !this._EOLNormalized && + buffer.charCodeAt(lineStarts[pieceEndLine] + piece.end.column - 1) === CharCode.CarriageReturn + ) { + danglingCR = true; + if (piece.end.column === 0) { + // The last line ended with a \r, let's undo the push, it will be pushed by next iteration + linesLength--; + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column - 1); + } + } else { + currentLine = buffer.substr(lineStarts[pieceEndLine], piece.end.column); + } + + return true; + }); + + if (danglingCR) { + lines[linesLength++] = currentLine; + currentLine = ''; + } + + lines[linesLength++] = currentLine; + return lines; + } + + public getLength(): number { + return this._length; + } + + public getLineCount(): number { + return this._lineCnt; + } + + public getLineContent(lineNumber: number): string { + if (this._lastVisitedLine.lineNumber === lineNumber) { + return this._lastVisitedLine.value; + } + + this._lastVisitedLine.lineNumber = lineNumber; + + if (lineNumber === this._lineCnt) { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber); + } else if (this._EOLNormalized) { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber, this._EOLLength); + } else { + this._lastVisitedLine.value = this.getLineRawContent(lineNumber).replace(/(\r\n|\r|\n)$/, ''); + } + + return this._lastVisitedLine.value; + } + + private _getCharCode(nodePos: NodePosition): number { + if (nodePos.remainder === nodePos.node.piece.length) { + // the char we want to fetch is at the head of next node. + const matchingNode = nodePos.node.next(); + if (!matchingNode) { + return 0; + } + + const buffer = this._buffers[matchingNode.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start); + return buffer.buffer.charCodeAt(startOffset); + } else { + const buffer = this._buffers[nodePos.node.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start); + const targetOffset = startOffset + nodePos.remainder; + + return buffer.buffer.charCodeAt(targetOffset); + } + } + + public getLineCharCode(lineNumber: number, index: number): number { + const nodePos = this.nodeAt2(lineNumber, index + 1); + return this._getCharCode(nodePos); + } + + public getLineLength(lineNumber: number): number { + if (lineNumber === this.getLineCount()) { + const startOffset = this.getOffsetAt(lineNumber, 1); + return this.getLength() - startOffset; + } + return this.getOffsetAt(lineNumber + 1, 1) - this.getOffsetAt(lineNumber, 1) - this._EOLLength; + } + + public getCharCode(offset: number): number { + const nodePos = this.nodeAt(offset); + return this._getCharCode(nodePos); + } + + public getNearestChunk(offset: number): string { + const nodePos = this.nodeAt(offset); + if (nodePos.remainder === nodePos.node.piece.length) { + // the offset is at the head of next node. + const matchingNode = nodePos.node.next(); + if (!matchingNode || matchingNode === SENTINEL) { + return ''; + } + + const buffer = this._buffers[matchingNode.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(matchingNode.piece.bufferIndex, matchingNode.piece.start); + return buffer.buffer.substring(startOffset, startOffset + matchingNode.piece.length); + } else { + const buffer = this._buffers[nodePos.node.piece.bufferIndex]; + const startOffset = this.offsetInBuffer(nodePos.node.piece.bufferIndex, nodePos.node.piece.start); + const targetOffset = startOffset + nodePos.remainder; + const targetEnd = startOffset + nodePos.node.piece.length; + return buffer.buffer.substring(targetOffset, targetEnd); + } + } + + public findMatchesInNode( + node: TreeNode, + searcher: Searcher, + startLineNumber: number, + startColumn: number, + startCursor: BufferCursor, + endCursor: BufferCursor, + searchData: SearchData, + captureMatches: boolean, + limitResultCount: number, + resultLen: number, + result: FindMatch[] + ) { + const buffer = this._buffers[node.piece.bufferIndex]; + const startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start); + const start = this.offsetInBuffer(node.piece.bufferIndex, startCursor); + const end = this.offsetInBuffer(node.piece.bufferIndex, endCursor); + + let m: RegExpExecArray | null; + // Reset regex to search from the beginning + const ret: BufferCursor = { line: 0, column: 0 }; + let searchText: string; + let offsetInBuffer: (offset: number) => number; + + if (searcher._wordSeparators) { + searchText = buffer.buffer.substring(start, end); + offsetInBuffer = (offset: number) => offset + start; + searcher.reset(0); + } else { + searchText = buffer.buffer; + offsetInBuffer = (offset: number) => offset; + searcher.reset(start); + } + + do { + m = searcher.next(searchText); + + if (m) { + if (offsetInBuffer(m.index) >= end) { + return resultLen; + } + this.positionInBuffer(node, offsetInBuffer(m.index) - startOffsetInBuffer, ret); + const lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret); + const retStartColumn = + ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1; + const retEndColumn = retStartColumn + m[0].length; + result[resultLen++] = createFindMatch( + new Range( + startLineNumber + lineFeedCnt, + retStartColumn, + startLineNumber + lineFeedCnt, + retEndColumn + ), + m, + captureMatches + ); + + if (offsetInBuffer(m.index) + m[0].length >= end) { + return resultLen; + } + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + + return resultLen; + } + + public findMatchesLineByLine( + searchRange: Range, + searchData: SearchData, + captureMatches: boolean, + limitResultCount: number + ): FindMatch[] { + const result: FindMatch[] = []; + let resultLen = 0; + const searcher = new Searcher(searchData.wordSeparators, searchData.regex); + + let startPosition = this.nodeAt2(searchRange.startLineNumber, searchRange.startColumn); + if (startPosition === null) { + return []; + } + const endPosition = this.nodeAt2(searchRange.endLineNumber, searchRange.endColumn); + if (endPosition === null) { + return []; + } + let start = this.positionInBuffer(startPosition.node, startPosition.remainder); + const end = this.positionInBuffer(endPosition.node, endPosition.remainder); + + if (startPosition.node === endPosition.node) { + this.findMatchesInNode( + startPosition.node, + searcher, + searchRange.startLineNumber, + searchRange.startColumn, + start, + end, + searchData, + captureMatches, + limitResultCount, + resultLen, + result + ); + return result; + } + + let startLineNumber = searchRange.startLineNumber; + + let currentNode = startPosition.node; + while (currentNode !== endPosition.node) { + const lineBreakCnt = this.getLineFeedCnt(currentNode.piece.bufferIndex, start, currentNode.piece.end); + + if (lineBreakCnt >= 1) { + // last line break position + const lineStarts = this._buffers[currentNode.piece.bufferIndex].lineStarts; + const startOffsetInBuffer = this.offsetInBuffer(currentNode.piece.bufferIndex, currentNode.piece.start); + const nextLineStartOffset = lineStarts[start.line + lineBreakCnt]; + const startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; + resultLen = this.findMatchesInNode( + currentNode, + searcher, + startLineNumber, + startColumn, + start, + this.positionInBuffer(currentNode, nextLineStartOffset - startOffsetInBuffer), + searchData, + captureMatches, + limitResultCount, + resultLen, + result + ); + + if (resultLen >= limitResultCount) { + return result; + } + + startLineNumber += lineBreakCnt; + } + + const startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; + // search for the remaining content + if (startLineNumber === searchRange.endLineNumber) { + const text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine( + searchData, + searcher, + text, + searchRange.endLineNumber, + startColumn, + resultLen, + result, + captureMatches, + limitResultCount + ); + return result; + } + + resultLen = this._findMatchesInLine( + searchData, + searcher, + this.getLineContent(startLineNumber).substr(startColumn), + startLineNumber, + startColumn, + resultLen, + result, + captureMatches, + limitResultCount + ); + + if (resultLen >= limitResultCount) { + return result; + } + + startLineNumber++; + startPosition = this.nodeAt2(startLineNumber, 1); + currentNode = startPosition.node; + start = this.positionInBuffer(startPosition.node, startPosition.remainder); + } + + if (startLineNumber === searchRange.endLineNumber) { + const startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn - 1 : 0; + const text = this.getLineContent(startLineNumber).substring(startColumn, searchRange.endColumn - 1); + resultLen = this._findMatchesInLine( + searchData, + searcher, + text, + searchRange.endLineNumber, + startColumn, + resultLen, + result, + captureMatches, + limitResultCount + ); + return result; + } + + const startColumn = startLineNumber === searchRange.startLineNumber ? searchRange.startColumn : 1; + resultLen = this.findMatchesInNode( + endPosition.node, + searcher, + startLineNumber, + startColumn, + start, + end, + searchData, + captureMatches, + limitResultCount, + resultLen, + result + ); + return result; + } + + private _findMatchesInLine( + searchData: SearchData, + searcher: Searcher, + text: string, + lineNumber: number, + deltaOffset: number, + resultLen: number, + result: FindMatch[], + captureMatches: boolean, + limitResultCount: number + ): number { + const wordSeparators = searchData.wordSeparators; + if (!captureMatches && searchData.simpleSearch) { + const searchString = searchData.simpleSearch; + const searchStringLen = searchString.length; + const textLength = text.length; + + let lastMatchIndex = -searchStringLen; + while ((lastMatchIndex = text.indexOf(searchString, lastMatchIndex + searchStringLen)) !== -1) { + if ( + !wordSeparators || + isValidMatch(wordSeparators, text, textLength, lastMatchIndex, searchStringLen) + ) { + result[resultLen++] = new FindMatch( + new Range( + lineNumber, + lastMatchIndex + 1 + deltaOffset, + lineNumber, + lastMatchIndex + 1 + searchStringLen + deltaOffset + ), + null + ); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } + return resultLen; + } + + let m: RegExpExecArray | null; + // Reset regex to search from the beginning + searcher.reset(0); + do { + m = searcher.next(text); + if (m) { + result[resultLen++] = createFindMatch( + new Range( + lineNumber, + m.index + 1 + deltaOffset, + lineNumber, + m.index + 1 + m[0].length + deltaOffset + ), + m, + captureMatches + ); + if (resultLen >= limitResultCount) { + return resultLen; + } + } + } while (m); + return resultLen; + } + + // #endregion + + // #region Piece Table + public insert(offset: number, value: string, eolNormalized: boolean = false): void { + this._EOLNormalized = this._EOLNormalized && eolNormalized; + this._lastVisitedLine.lineNumber = 0; + this._lastVisitedLine.value = ''; + + if (this.root !== SENTINEL) { + const { node, remainder, nodeStartOffset } = this.nodeAt(offset); + const piece = node.piece; + const bufferIndex = piece.bufferIndex; + const insertPosInBuffer = this.positionInBuffer(node, remainder); + if ( + node.piece.bufferIndex === 0 && + piece.end.line === this._lastChangeBufferPos.line && + piece.end.column === this._lastChangeBufferPos.column && + nodeStartOffset + piece.length === offset && + value.length < AverageBufferSize + ) { + // changed buffer + this.appendToNode(node, value); + this.computeBufferMetadata(); + return; + } + + if (nodeStartOffset === offset) { + this.insertContentToNodeLeft(value, node); + this._searchCache.validate(offset); + } else if (nodeStartOffset + node.piece.length > offset) { + // we are inserting into the middle of a node. + const nodesToDel: TreeNode[] = []; + let newRightPiece = new Piece( + piece.bufferIndex, + insertPosInBuffer, + piece.end, + this.getLineFeedCnt(piece.bufferIndex, insertPosInBuffer, piece.end), + this.offsetInBuffer(bufferIndex, piece.end) - this.offsetInBuffer(bufferIndex, insertPosInBuffer) + ); + + if (this.shouldCheckCRLF() && this.endWithCR(value)) { + const headOfRight = this.nodeCharCodeAt(node, remainder); + + if (headOfRight === 10 /** \n */) { + const newStart: BufferCursor = { + line: newRightPiece.start.line + 1, + column: 0, + }; + newRightPiece = new Piece( + newRightPiece.bufferIndex, + newStart, + newRightPiece.end, + this.getLineFeedCnt(newRightPiece.bufferIndex, newStart, newRightPiece.end), + newRightPiece.length - 1 + ); + + value += '\n'; + } + } + + // reuse node for content before insertion point. + if (this.shouldCheckCRLF() && this.startWithLF(value)) { + const tailOfLeft = this.nodeCharCodeAt(node, remainder - 1); + if (tailOfLeft === 13 /** \r */) { + const previousPos = this.positionInBuffer(node, remainder - 1); + this.deleteNodeTail(node, previousPos); + value = '\r' + value; + + if (node.piece.length === 0) { + nodesToDel.push(node); + } + } else { + this.deleteNodeTail(node, insertPosInBuffer); + } + } else { + this.deleteNodeTail(node, insertPosInBuffer); + } + + const newPieces = this.createNewPieces(value); + if (newRightPiece.length > 0) { + this.rbInsertRight(node, newRightPiece); + } + + let tmpNode = node; + for (let k = 0; k < newPieces.length; k++) { + tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); + } + this.deleteNodes(nodesToDel); + } else { + this.insertContentToNodeRight(value, node); + } + } else { + // insert new node + const pieces = this.createNewPieces(value); + let node = this.rbInsertLeft(null, pieces[0]); + + for (let k = 1; k < pieces.length; k++) { + node = this.rbInsertRight(node, pieces[k]); + } + } + + // todo, this is too brutal. Total line feed count should be updated the same way as lf_left. + this.computeBufferMetadata(); + } + + public delete(offset: number, cnt: number): void { + this._lastVisitedLine.lineNumber = 0; + this._lastVisitedLine.value = ''; + + if (cnt <= 0 || this.root === SENTINEL) { + return; + } + + const startPosition = this.nodeAt(offset); + const endPosition = this.nodeAt(offset + cnt); + const startNode = startPosition.node; + const endNode = endPosition.node; + + if (startNode === endNode) { + const startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder); + const endSplitPosInBuffer = this.positionInBuffer(startNode, endPosition.remainder); + + if (startPosition.nodeStartOffset === offset) { + if (cnt === startNode.piece.length) { + // delete node + const next = startNode.next(); + rbDelete(this, startNode); + this.validateCRLFWithPrevNode(next); + this.computeBufferMetadata(); + return; + } + this.deleteNodeHead(startNode, endSplitPosInBuffer); + this._searchCache.validate(offset); + this.validateCRLFWithPrevNode(startNode); + this.computeBufferMetadata(); + return; + } + + if (startPosition.nodeStartOffset + startNode.piece.length === offset + cnt) { + this.deleteNodeTail(startNode, startSplitPosInBuffer); + this.validateCRLFWithNextNode(startNode); + this.computeBufferMetadata(); + return; + } + + // delete content in the middle, this node will be splitted to nodes + this.shrinkNode(startNode, startSplitPosInBuffer, endSplitPosInBuffer); + this.computeBufferMetadata(); + return; + } + + const nodesToDel: TreeNode[] = []; + + const startSplitPosInBuffer = this.positionInBuffer(startNode, startPosition.remainder); + this.deleteNodeTail(startNode, startSplitPosInBuffer); + this._searchCache.validate(offset); + if (startNode.piece.length === 0) { + nodesToDel.push(startNode); + } + + // update last touched node + const endSplitPosInBuffer = this.positionInBuffer(endNode, endPosition.remainder); + this.deleteNodeHead(endNode, endSplitPosInBuffer); + if (endNode.piece.length === 0) { + nodesToDel.push(endNode); + } + + // delete nodes in between + const secondNode = startNode.next(); + for (let node = secondNode; node !== SENTINEL && node !== endNode; node = node.next()) { + nodesToDel.push(node); + } + + const prev = startNode.piece.length === 0 ? startNode.prev() : startNode; + this.deleteNodes(nodesToDel); + this.validateCRLFWithNextNode(prev); + this.computeBufferMetadata(); + } + + private insertContentToNodeLeft(value: string, node: TreeNode) { + // we are inserting content to the beginning of node + const nodesToDel: TreeNode[] = []; + if (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) { + // move `\n` to new node. + + const piece = node.piece; + const newStart: BufferCursor = { line: piece.start.line + 1, column: 0 }; + const nPiece = new Piece( + piece.bufferIndex, + newStart, + piece.end, + this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end), + piece.length - 1 + ); + + node.piece = nPiece; + + value += '\n'; + updateTreeMetadata(this, node, -1, -1); + + if (node.piece.length === 0) { + nodesToDel.push(node); + } + } + + const newPieces = this.createNewPieces(value); + let newNode = this.rbInsertLeft(node, newPieces[newPieces.length - 1]); + for (let k = newPieces.length - 2; k >= 0; k--) { + newNode = this.rbInsertLeft(newNode, newPieces[k]); + } + this.validateCRLFWithPrevNode(newNode); + this.deleteNodes(nodesToDel); + } + + private insertContentToNodeRight(value: string, node: TreeNode) { + // we are inserting to the right of this node. + if (this.adjustCarriageReturnFromNext(value, node)) { + // move \n to the new node. + value += '\n'; + } + + const newPieces = this.createNewPieces(value); + const newNode = this.rbInsertRight(node, newPieces[0]); + let tmpNode = newNode; + + for (let k = 1; k < newPieces.length; k++) { + tmpNode = this.rbInsertRight(tmpNode, newPieces[k]); + } + + this.validateCRLFWithPrevNode(newNode); + } + + private positionInBuffer(node: TreeNode, remainder: number): BufferCursor; + private positionInBuffer(node: TreeNode, remainder: number, ret: BufferCursor): null; + private positionInBuffer(node: TreeNode, remainder: number, ret?: BufferCursor): BufferCursor | null { + const piece = node.piece; + const bufferIndex = node.piece.bufferIndex; + const lineStarts = this._buffers[bufferIndex].lineStarts; + + const startOffset = lineStarts[piece.start.line] + piece.start.column; + + const offset = startOffset + remainder; + + // binary search offset between startOffset and endOffset + let low = piece.start.line; + let high = piece.end.line; + + let mid: number = 0; + let midStop: number = 0; + let midStart: number = 0; + + while (low <= high) { + mid = (low + (high - low) / 2) | 0; + midStart = lineStarts[mid]; + + if (mid === high) { + break; + } + + midStop = lineStarts[mid + 1]; + + if (offset < midStart) { + high = mid - 1; + } else if (offset >= midStop) { + low = mid + 1; + } else { + break; + } + } + + if (ret) { + ret.line = mid; + ret.column = offset - midStart; + return null; + } + + return { + line: mid, + column: offset - midStart, + }; + } + + private getLineFeedCnt(bufferIndex: number, start: BufferCursor, end: BufferCursor): number { + // we don't need to worry about start: abc\r|\n, or abc|\r, or abc|\n, or abc|\r\n doesn't change the fact that, there is one line break after start. + // now let's take care of end: abc\r|\n, if end is in between \r and \n, we need to add line feed count by 1 + if (end.column === 0) { + return end.line - start.line; + } + + const lineStarts = this._buffers[bufferIndex].lineStarts; + if (end.line === lineStarts.length - 1) { + // it means, there is no \n after end, otherwise, there will be one more lineStart. + return end.line - start.line; + } + + const nextLineStartOffset = lineStarts[end.line + 1]; + const endOffset = lineStarts[end.line] + end.column; + if (nextLineStartOffset > endOffset + 1) { + // there are more than 1 character after end, which means it can't be \n + return end.line - start.line; + } + // endOffset + 1 === nextLineStartOffset + // character at endOffset is \n, so we check the character before first + // if character at endOffset is \r, end.column is 0 and we can't get here. + const previousCharOffset = endOffset - 1; // end.column > 0 so it's okay. + const buffer = this._buffers[bufferIndex].buffer; + + if (buffer.charCodeAt(previousCharOffset) === 13) { + return end.line - start.line + 1; + } else { + return end.line - start.line; + } + } + + private offsetInBuffer(bufferIndex: number, cursor: BufferCursor): number { + const lineStarts = this._buffers[bufferIndex].lineStarts; + return lineStarts[cursor.line] + cursor.column; + } + + private deleteNodes(nodes: TreeNode[]): void { + for (let i = 0; i < nodes.length; i++) { + rbDelete(this, nodes[i]); + } + } + + private createNewPieces(text: string): Piece[] { + if (text.length > AverageBufferSize) { + // the content is large, operations like substring, charCode becomes slow + // so here we split it into smaller chunks, just like what we did for CR/LF normalization + const newPieces: Piece[] = []; + while (text.length > AverageBufferSize) { + const lastChar = text.charCodeAt(AverageBufferSize - 1); + let splitText; + if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) { + // last character is \r or a high surrogate => keep it back + splitText = text.substring(0, AverageBufferSize - 1); + text = text.substring(AverageBufferSize - 1); + } else { + splitText = text.substring(0, AverageBufferSize); + text = text.substring(AverageBufferSize); + } + + const lineStarts = createLineStartsFast(splitText); + newPieces.push( + new Piece( + this._buffers.length /* buffer index */, + { line: 0, column: 0 }, + { + line: lineStarts.length - 1, + column: splitText.length - lineStarts[lineStarts.length - 1], + }, + lineStarts.length - 1, + splitText.length + ) + ); + this._buffers.push(new StringBuffer(splitText, lineStarts)); + } + + const lineStarts = createLineStartsFast(text); + newPieces.push( + new Piece( + this._buffers.length /* buffer index */, + { line: 0, column: 0 }, + { + line: lineStarts.length - 1, + column: text.length - lineStarts[lineStarts.length - 1], + }, + lineStarts.length - 1, + text.length + ) + ); + this._buffers.push(new StringBuffer(text, lineStarts)); + + return newPieces; + } + + let startOffset = this._buffers[0].buffer.length; + const lineStarts = createLineStartsFast(text, false); + + let start = this._lastChangeBufferPos; + if ( + this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 1] === startOffset && + startOffset !== 0 && + this.startWithLF(text) && + this.endWithCR(this._buffers[0].buffer) // todo, we can check this._lastChangeBufferPos's column as it's the last one + ) { + this._lastChangeBufferPos = { + line: this._lastChangeBufferPos.line, + column: this._lastChangeBufferPos.column + 1, + }; + start = this._lastChangeBufferPos; + + for (let i = 0; i < lineStarts.length; i++) { + lineStarts[i] += startOffset + 1; + } + + this._buffers[0].lineStarts = ( this._buffers[0].lineStarts).concat(lineStarts.slice(1)); + this._buffers[0].buffer += '_' + text; + startOffset += 1; + } else { + if (startOffset !== 0) { + for (let i = 0; i < lineStarts.length; i++) { + lineStarts[i] += startOffset; + } + } + this._buffers[0].lineStarts = ( this._buffers[0].lineStarts).concat(lineStarts.slice(1)); + this._buffers[0].buffer += text; + } + + const endOffset = this._buffers[0].buffer.length; + const endIndex = this._buffers[0].lineStarts.length - 1; + const endColumn = endOffset - this._buffers[0].lineStarts[endIndex]; + const endPos = { line: endIndex, column: endColumn }; + const newPiece = new Piece( + 0 /** todo@peng */, + start, + endPos, + this.getLineFeedCnt(0, start, endPos), + endOffset - startOffset + ); + this._lastChangeBufferPos = endPos; + return [newPiece]; + } + + public getLinesRawContent(): string { + return this.getContentOfSubTree(this.root); + } + + public getLineRawContent(lineNumber: number, endOffset: number = 0): string { + let x = this.root; + + let ret = ''; + const cache = this._searchCache.get2(lineNumber); + if (cache) { + x = cache.node; + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + if (cache.nodeStartLineNumber + x.piece.lineFeedCnt === lineNumber) { + ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); + } else { + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber); + return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset); + } + } else { + let nodeStartOffset = 0; + const originalLineNumber = lineNumber; + while (x !== SENTINEL) { + if (x.left !== SENTINEL && x.lf_left >= lineNumber - 1) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + nodeStartOffset += x.size_left; + this._searchCache.set({ + node: x, + nodeStartOffset, + nodeStartLineNumber: originalLineNumber - (lineNumber - 1 - x.lf_left), + }); + + return buffer.substring( + startOffset + prevAccumulatedValue, + startOffset + accumulatedValue - endOffset + ); + } else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { + const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const buffer = this._buffers[x.piece.bufferIndex].buffer; + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + + ret = buffer.substring(startOffset + prevAccumulatedValue, startOffset + x.piece.length); + break; + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + } + + // search in order, to find the node contains end column + x = x.next(); + while (x !== SENTINEL) { + const buffer = this._buffers[x.piece.bufferIndex].buffer; + + if (x.piece.lineFeedCnt > 0) { + const accumulatedValue = this.getAccumulatedValue(x, 0); + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + + ret += buffer.substring(startOffset, startOffset + accumulatedValue - endOffset); + return ret; + } else { + const startOffset = this.offsetInBuffer(x.piece.bufferIndex, x.piece.start); + ret += buffer.substr(startOffset, x.piece.length); + } + + x = x.next(); + } + + return ret; + } + + private computeBufferMetadata() { + let x = this.root; + + let lfCnt = 1; + let len = 0; + + while (x !== SENTINEL) { + lfCnt += x.lf_left + x.piece.lineFeedCnt; + len += x.size_left + x.piece.length; + x = x.right; + } + + this._lineCnt = lfCnt; + this._length = len; + this._searchCache.validate(this._length); + } + + // #region node operations + private getIndexOf(node: TreeNode, accumulatedValue: number): { index: number; remainder: number } { + const piece = node.piece; + const pos = this.positionInBuffer(node, accumulatedValue); + const lineCnt = pos.line - piece.start.line; + + if ( + this.offsetInBuffer(piece.bufferIndex, piece.end) - this.offsetInBuffer(piece.bufferIndex, piece.start) === + accumulatedValue + ) { + // we are checking the end of this node, so a CRLF check is necessary. + const realLineCnt = this.getLineFeedCnt(node.piece.bufferIndex, piece.start, pos); + if (realLineCnt !== lineCnt) { + // aha yes, CRLF + return { index: realLineCnt, remainder: 0 }; + } + } + + return { index: lineCnt, remainder: pos.column }; + } + + private getAccumulatedValue(node: TreeNode, index: number) { + if (index < 0) { + return 0; + } + const piece = node.piece; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + const expectedLineStartIndex = piece.start.line + index + 1; + if (expectedLineStartIndex > piece.end.line) { + return lineStarts[piece.end.line] + piece.end.column - lineStarts[piece.start.line] - piece.start.column; + } else { + return lineStarts[expectedLineStartIndex] - lineStarts[piece.start.line] - piece.start.column; + } + } + + private deleteNodeTail(node: TreeNode, pos: BufferCursor) { + const piece = node.piece; + const originalLFCnt = piece.lineFeedCnt; + const originalEndOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + + const newEnd = pos; + const newEndOffset = this.offsetInBuffer(piece.bufferIndex, newEnd); + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); + + const lf_delta = newLineFeedCnt - originalLFCnt; + const size_delta = newEndOffset - originalEndOffset; + const newLength = piece.length + size_delta; + + node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); + + updateTreeMetadata(this, node, size_delta, lf_delta); + } + + private deleteNodeHead(node: TreeNode, pos: BufferCursor) { + const piece = node.piece; + const originalLFCnt = piece.lineFeedCnt; + const originalStartOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + + const newStart = pos; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); + const newStartOffset = this.offsetInBuffer(piece.bufferIndex, newStart); + const lf_delta = newLineFeedCnt - originalLFCnt; + const size_delta = originalStartOffset - newStartOffset; + const newLength = piece.length + size_delta; + node.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); + + updateTreeMetadata(this, node, size_delta, lf_delta); + } + + private shrinkNode(node: TreeNode, start: BufferCursor, end: BufferCursor) { + const piece = node.piece; + const originalStartPos = piece.start; + const originalEndPos = piece.end; + + // old piece, originalStartPos, start + const oldLength = piece.length; + const oldLFCnt = piece.lineFeedCnt; + const newEnd = start; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, piece.start, newEnd); + const newLength = + this.offsetInBuffer(piece.bufferIndex, start) - this.offsetInBuffer(piece.bufferIndex, originalStartPos); + + node.piece = new Piece(piece.bufferIndex, piece.start, newEnd, newLineFeedCnt, newLength); + + updateTreeMetadata(this, node, newLength - oldLength, newLineFeedCnt - oldLFCnt); + + // new right piece, end, originalEndPos + const newPiece = new Piece( + piece.bufferIndex, + end, + originalEndPos, + this.getLineFeedCnt(piece.bufferIndex, end, originalEndPos), + this.offsetInBuffer(piece.bufferIndex, originalEndPos) - this.offsetInBuffer(piece.bufferIndex, end) + ); + + const newNode = this.rbInsertRight(node, newPiece); + this.validateCRLFWithPrevNode(newNode); + } + + private appendToNode(node: TreeNode, value: string): void { + if (this.adjustCarriageReturnFromNext(value, node)) { + value += '\n'; + } + + const hitCRLF = this.shouldCheckCRLF() && this.startWithLF(value) && this.endWithCR(node); + const startOffset = this._buffers[0].buffer.length; + this._buffers[0].buffer += value; + const lineStarts = createLineStartsFast(value, false); + for (let i = 0; i < lineStarts.length; i++) { + lineStarts[i] += startOffset; + } + if (hitCRLF) { + const prevStartOffset = this._buffers[0].lineStarts[this._buffers[0].lineStarts.length - 2]; + ( this._buffers[0].lineStarts).pop(); + // _lastChangeBufferPos is already wrong + this._lastChangeBufferPos = { + line: this._lastChangeBufferPos.line - 1, + column: startOffset - prevStartOffset, + }; + } + + this._buffers[0].lineStarts = ( this._buffers[0].lineStarts).concat(lineStarts.slice(1)); + const endIndex = this._buffers[0].lineStarts.length - 1; + const endColumn = this._buffers[0].buffer.length - this._buffers[0].lineStarts[endIndex]; + const newEnd = { line: endIndex, column: endColumn }; + const newLength = node.piece.length + value.length; + const oldLineFeedCnt = node.piece.lineFeedCnt; + const newLineFeedCnt = this.getLineFeedCnt(0, node.piece.start, newEnd); + const lf_delta = newLineFeedCnt - oldLineFeedCnt; + + node.piece = new Piece(node.piece.bufferIndex, node.piece.start, newEnd, newLineFeedCnt, newLength); + + this._lastChangeBufferPos = newEnd; + updateTreeMetadata(this, node, value.length, lf_delta); + } + + private nodeAt(offset: number): NodePosition { + let x = this.root; + const cache = this._searchCache.get(offset); + if (cache) { + return { + node: cache.node, + nodeStartOffset: cache.nodeStartOffset, + remainder: offset - cache.nodeStartOffset, + }; + } + + let nodeStartOffset = 0; + + while (x !== SENTINEL) { + if (x.size_left > offset) { + x = x.left; + } else if (x.size_left + x.piece.length >= offset) { + nodeStartOffset += x.size_left; + const ret = { + node: x, + remainder: offset - x.size_left, + nodeStartOffset, + }; + this._searchCache.set(ret); + return ret; + } else { + offset -= x.size_left + x.piece.length; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + + return null!; + } + + private nodeAt2(lineNumber: number, column: number): NodePosition { + let x = this.root; + let nodeStartOffset = 0; + + while (x !== SENTINEL) { + if (x.left !== SENTINEL && x.lf_left >= lineNumber - 1) { + x = x.left; + } else if (x.lf_left + x.piece.lineFeedCnt > lineNumber - 1) { + const prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + const accumulatedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 1); + nodeStartOffset += x.size_left; + + return { + node: x, + remainder: Math.min(prevAccumualtedValue + column - 1, accumulatedValue), + nodeStartOffset, + }; + } else if (x.lf_left + x.piece.lineFeedCnt === lineNumber - 1) { + const prevAccumualtedValue = this.getAccumulatedValue(x, lineNumber - x.lf_left - 2); + if (prevAccumualtedValue + column - 1 <= x.piece.length) { + return { + node: x, + remainder: prevAccumualtedValue + column - 1, + nodeStartOffset, + }; + } else { + column -= x.piece.length - prevAccumualtedValue; + break; + } + } else { + lineNumber -= x.lf_left + x.piece.lineFeedCnt; + nodeStartOffset += x.size_left + x.piece.length; + x = x.right; + } + } + + // search in order, to find the node contains position.column + x = x.next(); + while (x !== SENTINEL) { + if (x.piece.lineFeedCnt > 0) { + const accumulatedValue = this.getAccumulatedValue(x, 0); + const nodeStartOffset = this.offsetOfNode(x); + return { + node: x, + remainder: Math.min(column - 1, accumulatedValue), + nodeStartOffset, + }; + } else { + if (x.piece.length >= column - 1) { + const nodeStartOffset = this.offsetOfNode(x); + return { + node: x, + remainder: column - 1, + nodeStartOffset, + }; + } else { + column -= x.piece.length; + } + } + + x = x.next(); + } + + return null!; + } + + private nodeCharCodeAt(node: TreeNode, offset: number): number { + if (node.piece.lineFeedCnt < 1) { + return -1; + } + const buffer = this._buffers[node.piece.bufferIndex]; + const newOffset = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start) + offset; + return buffer.buffer.charCodeAt(newOffset); + } + + private offsetOfNode(node: TreeNode): number { + if (!node) { + return 0; + } + let pos = node.size_left; + while (node !== this.root) { + if (node.parent.right === node) { + pos += node.parent.size_left + node.parent.piece.length; + } + + node = node.parent; + } + + return pos; + } + + // #endregion + + // #region CRLF + private shouldCheckCRLF() { + return !(this._EOLNormalized && this._EOL === '\n'); + } + + private startWithLF(val: string | TreeNode): boolean { + if (typeof val === 'string') { + return val.charCodeAt(0) === 10; + } + + if (val === SENTINEL || val.piece.lineFeedCnt === 0) { + return false; + } + + const piece = val.piece; + const lineStarts = this._buffers[piece.bufferIndex].lineStarts; + const line = piece.start.line; + const startOffset = lineStarts[line] + piece.start.column; + if (line === lineStarts.length - 1) { + // last line, so there is no line feed at the end of this line + return false; + } + const nextLineOffset = lineStarts[line + 1]; + if (nextLineOffset > startOffset + 1) { + return false; + } + return this._buffers[piece.bufferIndex].buffer.charCodeAt(startOffset) === 10; + } + + private endWithCR(val: string | TreeNode): boolean { + if (typeof val === 'string') { + return val.charCodeAt(val.length - 1) === 13; + } + + if (val === SENTINEL || val.piece.lineFeedCnt === 0) { + return false; + } + + return this.nodeCharCodeAt(val, val.piece.length - 1) === 13; + } + + private validateCRLFWithPrevNode(nextNode: TreeNode) { + if (this.shouldCheckCRLF() && this.startWithLF(nextNode)) { + const node = nextNode.prev(); + if (this.endWithCR(node)) { + this.fixCRLF(node, nextNode); + } + } + } + + private validateCRLFWithNextNode(node: TreeNode) { + if (this.shouldCheckCRLF() && this.endWithCR(node)) { + const nextNode = node.next(); + if (this.startWithLF(nextNode)) { + this.fixCRLF(node, nextNode); + } + } + } + + private fixCRLF(prev: TreeNode, next: TreeNode) { + const nodesToDel: TreeNode[] = []; + // update node + const lineStarts = this._buffers[prev.piece.bufferIndex].lineStarts; + let newEnd: BufferCursor; + if (prev.piece.end.column === 0) { + // it means, last line ends with \r, not \r\n + newEnd = { + line: prev.piece.end.line - 1, + column: lineStarts[prev.piece.end.line] - lineStarts[prev.piece.end.line - 1] - 1, + }; + } else { + // \r\n + newEnd = { line: prev.piece.end.line, column: prev.piece.end.column - 1 }; + } + + const prevNewLength = prev.piece.length - 1; + const prevNewLFCnt = prev.piece.lineFeedCnt - 1; + prev.piece = new Piece(prev.piece.bufferIndex, prev.piece.start, newEnd, prevNewLFCnt, prevNewLength); + + updateTreeMetadata(this, prev, -1, -1); + if (prev.piece.length === 0) { + nodesToDel.push(prev); + } + + // update nextNode + const newStart: BufferCursor = { + line: next.piece.start.line + 1, + column: 0, + }; + const newLength = next.piece.length - 1; + const newLineFeedCnt = this.getLineFeedCnt(next.piece.bufferIndex, newStart, next.piece.end); + next.piece = new Piece(next.piece.bufferIndex, newStart, next.piece.end, newLineFeedCnt, newLength); + + updateTreeMetadata(this, next, -1, -1); + if (next.piece.length === 0) { + nodesToDel.push(next); + } + + // create new piece which contains \r\n + const pieces = this.createNewPieces('\r\n'); + this.rbInsertRight(prev, pieces[0]); + // delete empty nodes + + for (let i = 0; i < nodesToDel.length; i++) { + rbDelete(this, nodesToDel[i]); + } + } + + private adjustCarriageReturnFromNext(value: string, node: TreeNode): boolean { + if (this.shouldCheckCRLF() && this.endWithCR(value)) { + const nextNode = node.next(); + if (this.startWithLF(nextNode)) { + // move `\n` forward + value += '\n'; + + if (nextNode.piece.length === 1) { + rbDelete(this, nextNode); + } else { + const piece = nextNode.piece; + const newStart: BufferCursor = { + line: piece.start.line + 1, + column: 0, + }; + const newLength = piece.length - 1; + const newLineFeedCnt = this.getLineFeedCnt(piece.bufferIndex, newStart, piece.end); + nextNode.piece = new Piece(piece.bufferIndex, newStart, piece.end, newLineFeedCnt, newLength); + + updateTreeMetadata(this, nextNode, -1, -1); + } + return true; + } + } + + return false; + } + + // #endregion + + // #endregion + + // #region Tree operations + iterate(node: TreeNode, callback: (node: TreeNode) => boolean): boolean { + if (node === SENTINEL) { + return callback(SENTINEL); + } + + const leftRet = this.iterate(node.left, callback); + if (!leftRet) { + return leftRet; + } + + return callback(node) && this.iterate(node.right, callback); + } + + private getNodeContent(node: TreeNode) { + if (node === SENTINEL) { + return ''; + } + const buffer = this._buffers[node.piece.bufferIndex]; + const piece = node.piece; + const startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + const endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + const currentContent = buffer.buffer.substring(startOffset, endOffset); + return currentContent; + } + + getPieceContent(piece: Piece) { + const buffer = this._buffers[piece.bufferIndex]; + const startOffset = this.offsetInBuffer(piece.bufferIndex, piece.start); + const endOffset = this.offsetInBuffer(piece.bufferIndex, piece.end); + const currentContent = buffer.buffer.substring(startOffset, endOffset); + return currentContent; + } + + /** + * node node + * / \ / \ + * a b <---- a b + * / + * z + */ + private rbInsertRight(node: TreeNode | null, p: Piece): TreeNode { + const z = new TreeNode(p, NodeColor.Red); + z.left = SENTINEL; + z.right = SENTINEL; + z.parent = SENTINEL; + z.size_left = 0; + z.lf_left = 0; + + const x = this.root; + if (x === SENTINEL) { + this.root = z; + z.color = NodeColor.Black; + } else if (node!.right === SENTINEL) { + node!.right = z; + z.parent = node!; + } else { + const nextNode = leftest(node!.right); + nextNode.left = z; + z.parent = nextNode; + } + + fixInsert(this, z); + return z; + } + + /** + * node node + * / \ / \ + * a b ----> a b + * \ + * z + */ + private rbInsertLeft(node: TreeNode | null, p: Piece): TreeNode { + const z = new TreeNode(p, NodeColor.Red); + z.left = SENTINEL; + z.right = SENTINEL; + z.parent = SENTINEL; + z.size_left = 0; + z.lf_left = 0; + + if (this.root === SENTINEL) { + this.root = z; + z.color = NodeColor.Black; + } else if (node!.left === SENTINEL) { + node!.left = z; + z.parent = node!; + } else { + const prevNode = righttest(node!.left); // a + prevNode.right = z; + z.parent = prevNode; + } + + fixInsert(this, z); + return z; + } + + private getContentOfSubTree(node: TreeNode): string { + let str = ''; + + this.iterate(node, node => { + str += this.getNodeContent(node); + return true; + }); + + return str; + } + // #endregion +} diff --git a/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts new file mode 100644 index 0000000000..cb8a53c46f --- /dev/null +++ b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts @@ -0,0 +1,166 @@ +/** reference from https://github.com/microsoft/vscode */ + +import { CharCode } from '../common/charCode'; +import { StringBuffer, createLineStarts, createLineStartsFast, PieceTreeBase } from './pieceTreeBase'; + +export const UTF8_BOM_CHARACTER = String.fromCharCode(CharCode.UTF8_BOM); + +export function startsWithUTF8BOM(str: string): boolean { + return !!(str && str.length > 0 && str.charCodeAt(0) === CharCode.UTF8_BOM); +} + +export const enum DefaultEndOfLine { + /** + * Use line feed (\n) as the end of line character. + */ + LF = 1, + /** + * Use carriage return and line feed (\r\n) as the end of line character. + */ + CRLF = 2, +} + +export class PieceTreeTextBufferFactory { + constructor( + private readonly _chunks: StringBuffer[], + private readonly _bom: string, + private readonly _cr: number, + private readonly _lf: number, + private readonly _crlf: number, + private readonly _normalizeEOL: boolean + ) {} + + private _getEOL(defaultEOL: DefaultEndOfLine): '\r\n' | '\n' { + const totalEOLCount = this._cr + this._lf + this._crlf; + const totalCRCount = this._cr + this._crlf; + if (totalEOLCount === 0) { + // This is an empty file or a file with precisely one line + return defaultEOL === DefaultEndOfLine.LF ? '\n' : '\r\n'; + } + if (totalCRCount > totalEOLCount / 2) { + // More than half of the file contains \r\n ending lines + return '\r\n'; + } + // At least one line more ends in \n + return '\n'; + } + + public create(defaultEOL: DefaultEndOfLine): PieceTreeBase { + const eol = this._getEOL(defaultEOL); + const chunks = this._chunks; + + if ( + this._normalizeEOL && + ((eol === '\r\n' && (this._cr > 0 || this._lf > 0)) || (eol === '\n' && (this._cr > 0 || this._crlf > 0))) + ) { + // Normalize pieces + for (let i = 0, len = chunks.length; i < len; i++) { + const str = chunks[i].buffer.replace(/\r\n|\r|\n/g, eol); + const newLineStart = createLineStartsFast(str); + chunks[i] = new StringBuffer(str, newLineStart); + } + } + + return new PieceTreeBase(chunks, eol, this._normalizeEOL); + } + + public getFirstLineText(lengthLimit: number): string { + return this._chunks[0].buffer.substr(0, 100).split(/\r\n|\r|\n/)[0]; + } +} + +export class PieceTreeTextBufferBuilder { + private readonly chunks: StringBuffer[]; + private BOM: string; + + private _hasPreviousChar: boolean; + private _previousChar: number; + private readonly _tmpLineStarts: number[]; + + private cr: number; + private lf: number; + private crlf: number; + + constructor() { + this.chunks = []; + this.BOM = ''; + + this._hasPreviousChar = false; + this._previousChar = 0; + this._tmpLineStarts = []; + + this.cr = 0; + this.lf = 0; + this.crlf = 0; + } + + public acceptChunk(chunk: string): void { + if (chunk.length === 0) { + return; + } + + if (this.chunks.length === 0) { + if (startsWithUTF8BOM(chunk)) { + this.BOM = UTF8_BOM_CHARACTER; + chunk = chunk.substr(1); + } + } + + const lastChar = chunk.charCodeAt(chunk.length - 1); + if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xd800 && lastChar <= 0xdbff)) { + // last character is \r or a high surrogate => keep it back + this._acceptChunk1(chunk.substr(0, chunk.length - 1), false); + this._hasPreviousChar = true; + this._previousChar = lastChar; + } else { + this._acceptChunk1(chunk, false); + this._hasPreviousChar = false; + this._previousChar = lastChar; + } + } + + private _acceptChunk1(chunk: string, allowEmptyStrings: boolean): void { + if (!allowEmptyStrings && chunk.length === 0) { + // Nothing to do + return; + } + + if (this._hasPreviousChar) { + this._acceptChunk2(String.fromCharCode(this._previousChar) + chunk); + } else { + this._acceptChunk2(chunk); + } + } + + private _acceptChunk2(chunk: string): void { + const lineStarts = createLineStarts(this._tmpLineStarts, chunk); + + this.chunks.push(new StringBuffer(chunk, lineStarts.lineStarts)); + this.cr += lineStarts.cr; + this.lf += lineStarts.lf; + this.crlf += lineStarts.crlf; + } + + public finish(normalizeEOL: boolean = true): PieceTreeTextBufferFactory { + this._finish(); + return new PieceTreeTextBufferFactory(this.chunks, this.BOM, this.cr, this.lf, this.crlf, normalizeEOL); + } + + private _finish(): void { + if (this.chunks.length === 0) { + this._acceptChunk1('', true); + } + + if (this._hasPreviousChar) { + this._hasPreviousChar = false; + // recreate last chunk + const lastChunk = this.chunks[this.chunks.length - 1]; + lastChunk.buffer += String.fromCharCode(this._previousChar); + const newLineStarts = createLineStartsFast(lastChunk.buffer); + lastChunk.lineStarts = newLineStarts; + if (this._previousChar === CharCode.CarriageReturn) { + this.cr++; + } + } + } +} diff --git a/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/rbTreeBase.ts b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/rbTreeBase.ts new file mode 100644 index 0000000000..0203782ed0 --- /dev/null +++ b/packages/semi-json-viewer-core/src/pieceTreeTextBuffer/rbTreeBase.ts @@ -0,0 +1,421 @@ +/** reference from https://github.com/microsoft/vscode */ +/* eslint-disable @typescript-eslint/no-this-alias */ + +import { Piece, PieceTreeBase } from './pieceTreeBase'; + +export class TreeNode { + parent: TreeNode; + left: TreeNode; + right: TreeNode; + color: NodeColor; + + // Piece + piece: Piece; + size_left: number; // size of the left subtree (not inorder) + lf_left: number; // line feeds cnt in the left subtree (not in order) + + constructor(piece: Piece, color: NodeColor) { + this.piece = piece; + this.color = color; + this.size_left = 0; + this.lf_left = 0; + this.parent = this; + this.left = this; + this.right = this; + } + + public next(): TreeNode { + if (this.right !== SENTINEL) { + return leftest(this.right); + } + + let node: TreeNode = this; + + while (node.parent !== SENTINEL) { + if (node.parent.left === node) { + break; + } + + node = node.parent; + } + + if (node.parent === SENTINEL) { + return SENTINEL; + } else { + return node.parent; + } + } + + public prev(): TreeNode { + if (this.left !== SENTINEL) { + return righttest(this.left); + } + + let node: TreeNode = this; + + while (node.parent !== SENTINEL) { + if (node.parent.right === node) { + break; + } + + node = node.parent; + } + + if (node.parent === SENTINEL) { + return SENTINEL; + } else { + return node.parent; + } + } + + public detach(): void { + this.parent = null!; + this.left = null!; + this.right = null!; + } +} + +export const enum NodeColor { + Black = 0, + Red = 1, +} + +export const SENTINEL: TreeNode = new TreeNode(null!, NodeColor.Black); +SENTINEL.parent = SENTINEL; +SENTINEL.left = SENTINEL; +SENTINEL.right = SENTINEL; +SENTINEL.color = NodeColor.Black; + +export function leftest(node: TreeNode): TreeNode { + while (node.left !== SENTINEL) { + node = node.left; + } + return node; +} + +export function righttest(node: TreeNode): TreeNode { + while (node.right !== SENTINEL) { + node = node.right; + } + return node; +} + +function calculateSize(node: TreeNode): number { + if (node === SENTINEL) { + return 0; + } + + return node.size_left + node.piece.length + calculateSize(node.right); +} + +function calculateLF(node: TreeNode): number { + if (node === SENTINEL) { + return 0; + } + + return node.lf_left + node.piece.lineFeedCnt + calculateLF(node.right); +} + +function resetSentinel(): void { + SENTINEL.parent = SENTINEL; +} + +export function leftRotate(tree: PieceTreeBase, x: TreeNode) { + const y = x.right; + + // fix size_left + y.size_left += x.size_left + (x.piece ? x.piece.length : 0); + y.lf_left += x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); + x.right = y.left; + + if (y.left !== SENTINEL) { + y.left.parent = x; + } + y.parent = x.parent; + if (x.parent === SENTINEL) { + tree.root = y; + } else if (x.parent.left === x) { + x.parent.left = y; + } else { + x.parent.right = y; + } + y.left = x; + x.parent = y; +} + +export function rightRotate(tree: PieceTreeBase, y: TreeNode) { + const x = y.left; + y.left = x.right; + if (x.right !== SENTINEL) { + x.right.parent = y; + } + x.parent = y.parent; + + // fix size_left + y.size_left -= x.size_left + (x.piece ? x.piece.length : 0); + y.lf_left -= x.lf_left + (x.piece ? x.piece.lineFeedCnt : 0); + + if (y.parent === SENTINEL) { + tree.root = x; + } else if (y === y.parent.right) { + y.parent.right = x; + } else { + y.parent.left = x; + } + + x.right = y; + y.parent = x; +} + +export function rbDelete(tree: PieceTreeBase, z: TreeNode) { + let x: TreeNode; + let y: TreeNode; + + if (z.left === SENTINEL) { + y = z; + x = y.right; + } else if (z.right === SENTINEL) { + y = z; + x = y.left; + } else { + y = leftest(z.right); + x = y.right; + } + + if (y === tree.root) { + tree.root = x; + + // if x is null, we are removing the only node + x.color = NodeColor.Black; + z.detach(); + resetSentinel(); + tree.root.parent = SENTINEL; + + return; + } + + const yWasRed = y.color === NodeColor.Red; + + if (y === y.parent.left) { + y.parent.left = x; + } else { + y.parent.right = x; + } + + if (y === z) { + x.parent = y.parent; + recomputeTreeMetadata(tree, x); + } else { + if (y.parent === z) { + x.parent = y; + } else { + x.parent = y.parent; + } + + // as we make changes to x's hierarchy, update size_left of subtree first + recomputeTreeMetadata(tree, x); + + y.left = z.left; + y.right = z.right; + y.parent = z.parent; + y.color = z.color; + + if (z === tree.root) { + tree.root = y; + } else { + if (z === z.parent.left) { + z.parent.left = y; + } else { + z.parent.right = y; + } + } + + if (y.left !== SENTINEL) { + y.left.parent = y; + } + if (y.right !== SENTINEL) { + y.right.parent = y; + } + // update metadata + // we replace z with y, so in this sub tree, the length change is z.item.length + y.size_left = z.size_left; + y.lf_left = z.lf_left; + recomputeTreeMetadata(tree, y); + } + + z.detach(); + + if (x.parent.left === x) { + const newSizeLeft = calculateSize(x); + const newLFLeft = calculateLF(x); + if (newSizeLeft !== x.parent.size_left || newLFLeft !== x.parent.lf_left) { + const delta = newSizeLeft - x.parent.size_left; + const lf_delta = newLFLeft - x.parent.lf_left; + x.parent.size_left = newSizeLeft; + x.parent.lf_left = newLFLeft; + updateTreeMetadata(tree, x.parent, delta, lf_delta); + } + } + + recomputeTreeMetadata(tree, x.parent); + + if (yWasRed) { + resetSentinel(); + return; + } + + // RB-DELETE-FIXUP + let w: TreeNode; + while (x !== tree.root && x.color === NodeColor.Black) { + if (x === x.parent.left) { + w = x.parent.right; + + if (w.color === NodeColor.Red) { + w.color = NodeColor.Black; + x.parent.color = NodeColor.Red; + leftRotate(tree, x.parent); + w = x.parent.right; + } + + if (w.left.color === NodeColor.Black && w.right.color === NodeColor.Black) { + w.color = NodeColor.Red; + x = x.parent; + } else { + if (w.right.color === NodeColor.Black) { + w.left.color = NodeColor.Black; + w.color = NodeColor.Red; + rightRotate(tree, w); + w = x.parent.right; + } + + w.color = x.parent.color; + x.parent.color = NodeColor.Black; + w.right.color = NodeColor.Black; + leftRotate(tree, x.parent); + x = tree.root; + } + } else { + w = x.parent.left; + + if (w.color === NodeColor.Red) { + w.color = NodeColor.Black; + x.parent.color = NodeColor.Red; + rightRotate(tree, x.parent); + w = x.parent.left; + } + + if (w.left.color === NodeColor.Black && w.right.color === NodeColor.Black) { + w.color = NodeColor.Red; + x = x.parent; + } else { + if (w.left.color === NodeColor.Black) { + w.right.color = NodeColor.Black; + w.color = NodeColor.Red; + leftRotate(tree, w); + w = x.parent.left; + } + + w.color = x.parent.color; + x.parent.color = NodeColor.Black; + w.left.color = NodeColor.Black; + rightRotate(tree, x.parent); + x = tree.root; + } + } + } + x.color = NodeColor.Black; + resetSentinel(); +} + +export function fixInsert(tree: PieceTreeBase, x: TreeNode) { + recomputeTreeMetadata(tree, x); + + while (x !== tree.root && x.parent.color === NodeColor.Red) { + if (x.parent === x.parent.parent.left) { + const y = x.parent.parent.right; + + if (y.color === NodeColor.Red) { + x.parent.color = NodeColor.Black; + y.color = NodeColor.Black; + x.parent.parent.color = NodeColor.Red; + x = x.parent.parent; + } else { + if (x === x.parent.right) { + x = x.parent; + leftRotate(tree, x); + } + + x.parent.color = NodeColor.Black; + x.parent.parent.color = NodeColor.Red; + rightRotate(tree, x.parent.parent); + } + } else { + const y = x.parent.parent.left; + + if (y.color === NodeColor.Red) { + x.parent.color = NodeColor.Black; + y.color = NodeColor.Black; + x.parent.parent.color = NodeColor.Red; + x = x.parent.parent; + } else { + if (x === x.parent.left) { + x = x.parent; + rightRotate(tree, x); + } + x.parent.color = NodeColor.Black; + x.parent.parent.color = NodeColor.Red; + leftRotate(tree, x.parent.parent); + } + } + } + + tree.root.color = NodeColor.Black; +} + +export function updateTreeMetadata(tree: PieceTreeBase, x: TreeNode, delta: number, lineFeedCntDelta: number): void { + // node length change or line feed count change + while (x !== tree.root && x !== SENTINEL) { + if (x.parent.left === x) { + x.parent.size_left += delta; + x.parent.lf_left += lineFeedCntDelta; + } + + x = x.parent; + } +} + +export function recomputeTreeMetadata(tree: PieceTreeBase, x: TreeNode) { + let delta = 0; + let lf_delta = 0; + if (x === tree.root) { + return; + } + + // go upwards till the node whose left subtree is changed. + while (x !== tree.root && x === x.parent.right) { + x = x.parent; + } + + if (x === tree.root) { + // well, it means we add a node to the end (inorder) + return; + } + + // x is the node whose right subtree is changed. + x = x.parent; + + delta = calculateSize(x.left) - x.size_left; + lf_delta = calculateLF(x.left) - x.lf_left; + x.size_left += delta; + x.lf_left += lf_delta; + + // go upwards till root. O(logN) + while (x !== tree.root && (delta !== 0 || lf_delta !== 0)) { + if (x.parent.left === x) { + x.parent.size_left += delta; + x.parent.lf_left += lf_delta; + } + + x = x.parent; + } +} diff --git a/packages/semi-json-viewer-core/src/service/completion.ts b/packages/semi-json-viewer-core/src/service/completion.ts new file mode 100644 index 0000000000..fa3a0fbf24 --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/completion.ts @@ -0,0 +1,526 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ +import { Position } from '../common/position'; +import { JSONModel } from '../model/jsonModel'; +import { JsonDocument } from './parse'; +import { Range } from '../common/range'; +import * as Json from 'jsonc-parser'; +import * as Parser from './parse'; +import { + ASTNode, + CompletionItem, + CompletionItemKind, + CompletionList, + InsertTextFormat, + ObjectASTNode, + PropertyASTNode, + TextEdit, +} from './jsonTypes'; +import { CompletionsCollector, JSONCompletionItem } from './contribution'; +import { CompletionOptions } from '../json-viewer/jsonViewer'; + +/** + * Json补全功能的核心实现 + */ +export class JSONCompletion { + private _options: CompletionOptions | null; + + constructor(options: CompletionOptions | null) { + this._options = options; + } + + public doCompletion(jsonModel: JSONModel, position: Position, doc: JsonDocument) { + const result: CompletionList = { + items: [], + isIncomplete: false, + }; + const text = jsonModel.getValue(); + + const offset = jsonModel.getOffsetAt(position.lineNumber, position.column); + + let node = doc.getNodeFromOffset(offset, true); + + if (node && offset === node.offset + node.length && offset > 0) { + const ch = text[offset - 1]; + if ((node.type === 'object' && ch === '}') || (node.type === 'array' && ch === ']')) { + node = node.parent; + } + } + + const currentWord = this.getCurrentWord(jsonModel, offset); + let overwriteRange: Range; + if ( + node && + (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') + ) { + overwriteRange = Range.create( + jsonModel.positionAt(node.offset), + jsonModel.positionAt(node.offset + node.length) + ); + } else { + let overwriteStart = offset - currentWord.length; + if (overwriteStart > 0 && text[overwriteStart - 1] === '"') { + overwriteStart--; + } + overwriteRange = Range.create(jsonModel.positionAt(overwriteStart), position); + } + const proposed = new Map(); + + const collector: CompletionsCollector = { + add: (suggestion: JSONCompletionItem) => { + let label = suggestion.label; + const existing = proposed.get(label); + if (!existing) { + label = label.replace(/[\n]/g, '↵'); + if (label.length > 60) { + const shortenedLabel = label.substring(0, 57).trim() + '...'; + if (!proposed.has(shortenedLabel)) { + label = shortenedLabel; + } + } + suggestion.textEdit = TextEdit.replace(overwriteRange as Range, suggestion.insertText); + suggestion.label = label; + proposed.set(label, suggestion); + result.items.push(suggestion); + } else { + if (!existing.documentation) { + existing.documentation = suggestion.documentation; + } + if (!existing.detail) { + existing.detail = suggestion.detail; + } + if (!existing.labelDetails) { + existing.labelDetails = suggestion.labelDetails; + } + } + }, + setAsIncomplete: () => { + result.isIncomplete = true; + }, + error: (message: string) => { + console.error(message); + }, + getNumberOfProposals: () => { + return result.items.length; + }, + }; + + return Promise.resolve().then(() => { + const collectionPromises: Promise[] = []; + + let addValue = true; + let currentKey = ''; + + let currentProperty: PropertyASTNode | undefined = undefined; + if (node) { + if (node.type === 'string') { + const parent = node.parent; + if (parent && parent.type === 'property' && parent.keyNode === node) { + addValue = !parent.valueNode; + currentProperty = parent; + currentKey = text.substr(node.offset + 1, node.length - 2); + if (parent) { + node = parent.parent; + } + } + } + } + + if (node && node.type === 'object') { + if (node.offset === offset) { + return result; + } + const properties = node.properties; + properties.forEach(p => { + if (!currentProperty || currentProperty !== p) { + proposed.set(p.keyNode.value, CompletionItem.create('__')); + } + }); + let separatorAfter = ''; + if (addValue) { + separatorAfter = this.evaluateSeparatorAfter( + jsonModel, + jsonModel.getOffsetAt(overwriteRange.endLineNumber, overwriteRange.endColumn) + ); + } + + // property proposals without schema + this.getSchemaLessPropertyCompletions(doc, node, currentKey, collector, currentWord); + + // const location = Parser.getNodePath(node); + if (currentWord.length > 0 && text.charAt(offset - currentWord.length - 1) !== '"') { + collector.add({ + kind: CompletionItemKind.Property, + label: this.getLabelForValue(currentWord), + insertText: this.getInsertTextForProperty(currentWord, undefined, false, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '', + }); + collector.setAsIncomplete(); + } + } + const types: { [type: string]: boolean } = {}; + + // value proposals without schema + this.getSchemaLessValueCompletions(doc, node, offset, jsonModel, collector); + + return Promise.all(collectionPromises).then(() => { + if (collector.getNumberOfProposals() === 0) { + let offsetForSeparator = offset; + if ( + node && + (node.type === 'string' || + node.type === 'number' || + node.type === 'boolean' || + node.type === 'null') + ) { + offsetForSeparator = node.offset + node.length; + } + const separatorAfter = this.evaluateSeparatorAfter(jsonModel, offsetForSeparator); + this.addFillerValueCompletions(types, separatorAfter, collector); + } else if (this._options?.staticCompletions) { + this._options.staticCompletions.forEach(item => { + collector.add({ + label: item.label, + insertText: item.insertText || item.label, + documentation: item.documentation || '', + }); + }); + } + return result; + }); + }); + } + + /** + * 获取光标位置前的当前单词 + * @param jsonModel + * @param offset + * @returns + */ + private getCurrentWord(jsonModel: JSONModel, offset: number) { + let i = offset - 1; + const text = jsonModel.getValue(); + while (i >= 0 && ' \t\n\r\v":{[,]}'.indexOf(text.charAt(i)) === -1) { + i--; + } + return text.substring(i + 1, offset); + } + + private evaluateSeparatorAfter(jsonModel: JSONModel, offset: number) { + const scanner = Json.createScanner(jsonModel.getValue(), true); + scanner.setPosition(offset); + const token = scanner.scan(); + switch (token) { + case Json.SyntaxKind.CommaToken: + case Json.SyntaxKind.CloseBraceToken: + case Json.SyntaxKind.CloseBracketToken: + case Json.SyntaxKind.EOF: + return ''; + default: + return ','; + } + } + + private getLabelForValue(value: any): string { + return JSON.stringify(value); + } + + private getInsertTextForPlainText(text: string): string { + return text.replace(/[\\\$\}]/g, '\\$&'); // escape $, \ and } + } + + private getInsertTextForValue(value: any, separatorAfter: string): string { + const text = JSON.stringify(value, null, '\t'); + if (text === '{}') { + return '{$1}' + separatorAfter; + } else if (text === '[]') { + return '[$1]' + separatorAfter; + } + return this.getInsertTextForPlainText(text + separatorAfter); + } + + private getFilterTextForValue(value: any): string { + return JSON.stringify(value); + } + + private getInsertTextForProperty( + key: string, + propertySchema: undefined, + addValue: boolean, + separatorAfter: string + ): string { + const propertyText = this.getInsertTextForValue(key, ''); + if (!addValue) { + return propertyText; + } + const resultText = propertyText + ': '; + + let value; + const nValueProposals = 0; + if (propertySchema) { + //TODO + } + if (!value || nValueProposals > 1) { + value = '$1'; + } + return resultText + value + separatorAfter; + } + + private getSchemaLessPropertyCompletions( + doc: Parser.JsonDocument, + node: ASTNode, + currentKey: string, + collector: CompletionsCollector, + currentWord: string + ): void { + const collectCompletionsForSimilarObject = (obj: ObjectASTNode) => { + obj.properties.forEach(p => { + const key = p.keyNode.value; + if (key.toLowerCase().startsWith(currentWord.toLowerCase()) && currentWord !== '') { + collector.add({ + kind: CompletionItemKind.Property, + label: key, + insertText: this.getInsertTextForValue(key, ''), + insertTextFormat: InsertTextFormat.Snippet, + filterText: this.getFilterTextForValue(key), + documentation: '', + }); + } + }); + }; + if (node.parent) { + if (node.parent.type === 'property') { + // if the object is a property value, check the tree for other objects that hang under a property of the same name + const parentKey = node.parent.keyNode.value; + doc.visit(n => { + if ( + n.type === 'property' && + n !== node.parent && + n.keyNode.value === parentKey && + n.valueNode && + n.valueNode.type === 'object' + ) { + collectCompletionsForSimilarObject(n.valueNode); + } + return true; + }); + } else if (node.parent.type === 'array') { + // if the object is in an array, use all other array elements as similar objects + node.parent.items.forEach(n => { + if (n.type === 'object' && n !== node) { + collectCompletionsForSimilarObject(n); + } + }); + } + } + // else if (node.type === 'object') { + // collector.add({ + // kind: CompletionItemKind.Property, + // label: '$schema', + // insertText: this.getInsertTextForProperty( + // '$schema', + // undefined, + // true, + // '' + // ), + // insertTextFormat: InsertTextFormat.Snippet, + // documentation: '', + // filterText: this.getFilterTextForValue('$schema') + // }); + // } + } + + private addFillerValueCompletions( + types: { [type: string]: boolean }, + separatorAfter: string, + collector: CompletionsCollector + ): void { + if (types['object']) { + collector.add({ + kind: this.getSuggestionKind('object'), + label: '{}', + insertText: this.getInsertTextForGuessedValue({}, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + detail: 'New object', + documentation: '', + }); + } + if (types['array']) { + collector.add({ + kind: this.getSuggestionKind('array'), + label: '[]', + insertText: this.getInsertTextForGuessedValue([], separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + detail: 'New array', + documentation: '', + }); + } + } + + private getInsertTextForGuessedValue(value: any, separatorAfter: string): string { + switch (typeof value) { + case 'object': + if (value === null) { + return '${1:null}' + separatorAfter; + } + return this.getInsertTextForValue(value, separatorAfter); + case 'string': + let snippetValue = JSON.stringify(value); + snippetValue = snippetValue.substr(1, snippetValue.length - 2); // remove quotes + snippetValue = this.getInsertTextForPlainText(snippetValue); // escape \ and } + return '"${1:' + snippetValue + '}"' + separatorAfter; + case 'number': + case 'boolean': + return '${1:' + JSON.stringify(value) + '}' + separatorAfter; + } + return this.getInsertTextForValue(value, separatorAfter); + } + + private getSuggestionKind(type: any): CompletionItemKind { + if (Array.isArray(type)) { + const array = type; + type = array.length > 0 ? array[0] : undefined; + } + if (!type) { + return CompletionItemKind.Value; + } + switch (type) { + case 'string': + return CompletionItemKind.Value; + case 'object': + return CompletionItemKind.Module; + case 'property': + return CompletionItemKind.Property; + default: + return CompletionItemKind.Value; + } + } + + private getSchemaLessValueCompletions( + doc: Parser.JsonDocument, + node: ASTNode | undefined, + offset: number, + jsonModel: JSONModel, + collector: CompletionsCollector + ): void { + let offsetForSeparator = offset; + if ( + node && + (node.type === 'string' || node.type === 'number' || node.type === 'boolean' || node.type === 'null') + ) { + offsetForSeparator = node.offset + node.length; + node = node.parent; + } + + if (!node) { + // collector.add({ + // kind: this.getSuggestionKind('object'), + // label: 'Empty object', + // insertText: this.getInsertTextForValue({}, ''), + // insertTextFormat: InsertTextFormat.Snippet, + // documentation: '' + // }); + // collector.add({ + // kind: this.getSuggestionKind('array'), + // label: 'Empty array', + // insertText: this.getInsertTextForValue([], ''), + // insertTextFormat: InsertTextFormat.Snippet, + // documentation: '' + // }); + return; + } + const separatorAfter = this.evaluateSeparatorAfter(jsonModel, offsetForSeparator); + const collectSuggestionsForValues = (value: ASTNode) => { + if (value.parent && !Parser.contains(value.parent, offset, true)) { + collector.add({ + kind: this.getSuggestionKind(value.type), + label: this.getLabelTextForMatchingNode(value, jsonModel), + insertText: this.getInsertTextForMatchingNode(value, jsonModel, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '', + }); + } + if (value.type === 'boolean') { + this.addBooleanValueCompletion(!value.value, separatorAfter, collector); + } + }; + + if (node.type === 'property') { + if (offset > (node.colonOffset || 0)) { + const valueNode = node.valueNode; + if ( + valueNode && + (offset > valueNode.offset + valueNode.length || + valueNode.type === 'object' || + valueNode.type === 'array') + ) { + return; + } + // suggest values at the same key + const parentKey = node.keyNode.value; + doc.visit(n => { + if (n.type === 'property' && n.keyNode.value === parentKey && n.valueNode) { + collectSuggestionsForValues(n.valueNode); + } + return true; + }); + // if (parentKey === '$schema' && node.parent && !node.parent.parent) { + // this.addDollarSchemaCompletions(separatorAfter, collector); + // } + } + } + if (node.type === 'array') { + if (node.parent && node.parent.type === 'property') { + // suggest items of an array at the same key + const parentKey = node.parent.keyNode.value; + doc.visit(n => { + if ( + n.type === 'property' && + n.keyNode.value === parentKey && + n.valueNode && + n.valueNode.type === 'array' + ) { + n.valueNode.items.forEach(collectSuggestionsForValues); + } + return true; + }); + } else { + // suggest items in the same array + node.items.forEach(collectSuggestionsForValues); + } + } + } + private getLabelTextForMatchingNode(node: ASTNode, jsonModel: JSONModel): string { + switch (node.type) { + case 'array': + return '[]'; + case 'object': + return '{}'; + default: + const content = jsonModel.getValue().substr(node.offset, node.length); + return content; + } + } + + private getInsertTextForMatchingNode(node: ASTNode, jsonModel: JSONModel, separatorAfter: string): string { + switch (node.type) { + case 'array': + return this.getInsertTextForValue([], separatorAfter); + case 'object': + return this.getInsertTextForValue({}, separatorAfter); + default: + const content = jsonModel.getValue().substr(node.offset, node.length) + separatorAfter; + return this.getInsertTextForPlainText(content); + } + } + + private addBooleanValueCompletion(value: boolean, separatorAfter: string, collector: CompletionsCollector): void { + collector.add({ + kind: this.getSuggestionKind('boolean'), + label: value ? 'true' : 'false', + insertText: this.getInsertTextForValue(value, separatorAfter), + insertTextFormat: InsertTextFormat.Snippet, + documentation: '', + }); + } +} diff --git a/packages/semi-json-viewer-core/src/service/contribution.ts b/packages/semi-json-viewer-core/src/service/contribution.ts new file mode 100644 index 0000000000..30282447a3 --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/contribution.ts @@ -0,0 +1,11 @@ +/** reference from https://github.com/microsoft/vscode-json-languageservice */ +import { CompletionItem } from './jsonTypes'; + +export type JSONCompletionItem = CompletionItem & { insertText: string }; + +export interface CompletionsCollector { + add(suggestion: JSONCompletionItem & { insertText: string }): void; + error(message: string): void; + setAsIncomplete(): void; + getNumberOfProposals(): number +} diff --git a/packages/semi-json-viewer-core/src/service/getRange.ts b/packages/semi-json-viewer-core/src/service/getRange.ts new file mode 100644 index 0000000000..41844bbaa8 --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/getRange.ts @@ -0,0 +1,55 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ + +import { JSONModel } from '../model/jsonModel'; +import { createScanner, SyntaxKind, ScanError } from 'jsonc-parser'; +import { FoldingRange } from './jsonService'; +/** + * 获取json括号折叠信息 + * @param jsonModel + * @returns + */ +export function getFoldingRanges(jsonModel: JSONModel) { + const ranges: FoldingRange[] = []; + const nestingLevels: number[] = []; + const stack: FoldingRange[] = []; + let prevStart = -1; + const scanner = createScanner(jsonModel.getValue(), false); + let token = scanner.scan(); + + function addRange(range: FoldingRange) { + ranges.push(range); + nestingLevels.push(stack.length); + } + + while (token !== SyntaxKind.EOF) { + switch (token) { + case SyntaxKind.OpenBraceToken: + case SyntaxKind.OpenBracketToken: { + const startLine = jsonModel.positionAt(scanner.getPosition()).lineNumber; + const range: FoldingRange = { + startLine, + endLine: startLine, + kind: token === SyntaxKind.OpenBraceToken ? 'object' : 'array', + }; + stack.push(range); + break; + } + case SyntaxKind.CloseBraceToken: + case SyntaxKind.CloseBracketToken: { + const kind = token === SyntaxKind.CloseBraceToken ? 'object' : 'array'; + if (stack.length > 0 && stack[stack.length - 1].kind === kind) { + const range = stack.pop(); + const line = jsonModel.positionAt(scanner.getTokenOffset()).lineNumber; + if (range && line > range.startLine + 1 && prevStart !== range.startLine) { + range.endLine = line - 1; + addRange(range); + prevStart = range.startLine; + } + } + break; + } + } + token = scanner.scan(); + } + return ranges; +} diff --git a/packages/semi-json-viewer-core/src/service/jsonService.ts b/packages/semi-json-viewer-core/src/service/jsonService.ts new file mode 100644 index 0000000000..c2ddb3a6fb --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/jsonService.ts @@ -0,0 +1,32 @@ +import { JSONModel } from '../model/jsonModel'; +import { format, FormattingOptions } from 'jsonc-parser'; +import { JsonDocument, parseJson } from './parse'; +import { Diagnostic } from './jsonTypes'; +export { getFoldingRanges } from './getRange'; + +/** + * Json 服务,提供json格式化、补全、折叠等功能 + */ + +export interface FoldingRange { + startLine: number; + endLine: number; + kind: 'object' | 'array' +} + +export function formatJson(jsonModel: JSONModel, options: FormattingOptions) { + const edits = format(jsonModel.getValue(), undefined, options); + return edits; +} + +export function doValidate(jsonModel: JSONModel) { + const { root, problems } = parseJson(jsonModel); + return { + problems, + root, + }; +} + +export function parseJsonAst(jsonModel: JSONModel) { + return parseJson(jsonModel).root; +} diff --git a/packages/semi-json-viewer-core/src/service/jsonTypes.ts b/packages/semi-json-viewer-core/src/service/jsonTypes.ts new file mode 100644 index 0000000000..aa4811ddb1 --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/jsonTypes.ts @@ -0,0 +1,236 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ +import { Position } from '../common/position'; +import { Range } from '../common/range'; +/** + * Error codes used by diagnostics + */ +export enum ErrorCode { + Undefined = 0, + EnumValueMismatch = 1, + Deprecated = 2, + UnexpectedEndOfComment = 0x101, + UnexpectedEndOfString = 0x102, + UnexpectedEndOfNumber = 0x103, + InvalidUnicode = 0x104, + InvalidEscapeCharacter = 0x105, + InvalidCharacter = 0x106, + PropertyExpected = 0x201, + CommaExpected = 0x202, + ColonExpected = 0x203, + ValueExpected = 0x204, + CommaOrCloseBacketExpected = 0x205, + CommaOrCloseBraceExpected = 0x206, + TrailingComma = 0x207, + DuplicateKey = 0x208, + CommentNotPermitted = 0x209, + PropertyKeysMustBeDoublequoted = 0x210, + SchemaResolveError = 0x300, + SchemaUnsupportedFeature = 0x301, +} + +export type ASTNode = + | ObjectASTNode + | PropertyASTNode + | ArrayASTNode + | StringASTNode + | NumberASTNode + | BooleanASTNode + | NullASTNode; + +export interface BaseASTNode { + readonly type: 'object' | 'array' | 'property' | 'string' | 'number' | 'boolean' | 'null'; + readonly parent?: ASTNode; + readonly offset: number; + readonly length: number; + readonly children?: ASTNode[]; + readonly value?: string | boolean | number | null +} +export interface ObjectASTNode extends BaseASTNode { + readonly type: 'object'; + readonly properties: PropertyASTNode[]; + readonly children: ASTNode[] +} +export interface PropertyASTNode extends BaseASTNode { + readonly type: 'property'; + readonly keyNode: StringASTNode; + readonly valueNode?: ASTNode; + readonly colonOffset?: number; + readonly children: ASTNode[] +} +export interface ArrayASTNode extends BaseASTNode { + readonly type: 'array'; + readonly items: ASTNode[]; + readonly children: ASTNode[] +} +export interface StringASTNode extends BaseASTNode { + readonly type: 'string'; + readonly value: string +} +export interface NumberASTNode extends BaseASTNode { + readonly type: 'number'; + readonly value: number; + readonly isInteger: boolean +} +export interface BooleanASTNode extends BaseASTNode { + readonly type: 'boolean'; + readonly value: boolean +} +export interface NullASTNode extends BaseASTNode { + readonly type: 'null'; + readonly value: null +} + +export class Diagnostic { + readonly message: string; + readonly code: ErrorCode; + readonly range: ErrRange; + + constructor(message: string, code: ErrorCode, range: ErrRange) { + this.message = message; + this.code = code; + this.range = range; + } + + static create(message: string, code: ErrorCode, range: ErrRange) { + return new Diagnostic(message, code, range); + } +} + +export class ErrRange { + readonly start: Position; + readonly end: Position; + + constructor(start: Position, end: Position) { + this.start = start; + this.end = end; + } + static create(start: Position, end: Position) { + return new ErrRange(start, end); + } +} + +export type MarkupKind = 'plaintext' | 'markdown'; + +export interface MarkupContent { + kind: MarkupKind; + + value: string +} + +export interface CompletionItemLabelDetails { + detail?: string; + description?: string +} + +export namespace CompletionItemKind { + export const Text: 1 = 1; + export const Method: 2 = 2; + export const Function: 3 = 3; + export const Constructor: 4 = 4; + export const Field: 5 = 5; + export const Variable: 6 = 6; + export const Class: 7 = 7; + export const Interface: 8 = 8; + export const Module: 9 = 9; + export const Property: 10 = 10; + export const Unit: 11 = 11; + export const Value: 12 = 12; + export const Enum: 13 = 13; + export const Keyword: 14 = 14; + export const Snippet: 15 = 15; + export const Color: 16 = 16; + export const File: 17 = 17; + export const Reference: 18 = 18; + export const Folder: 19 = 19; + export const EnumMember: 20 = 20; + export const Constant: 21 = 21; + export const Struct: 22 = 22; + export const Event: 23 = 23; + export const Operator: 24 = 24; + export const TypeParameter: 25 = 25; +} + +export type CompletionItemKind = + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18 + | 19 + | 20 + | 21 + | 22 + | 23 + | 24 + | 25; + +export namespace InsertTextFormat { + /** + * The primary text to be inserted is treated as a plain string. + */ + export const PlainText: 1 = 1; + + /** + * The primary text to be inserted is treated as a snippet. + * + * A snippet can define tab stops and placeholders with `$1`, `$2` + * and `${3:foo}`. `$0` defines the final tab stop, it defaults to + * the end of the snippet. Placeholders with equal identifiers are linked, + * that is typing in one will update others too. + * + * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax + */ + export const Snippet: 2 = 2; +} + +export type InsertTextFormat = 1 | 2; + +export interface TextEdit { + range: Range; + + newText: string +} + +export namespace TextEdit { + export function replace(range: Range, newText: string): TextEdit { + return { + range, + newText, + }; + } +} + +export interface CompletionItem { + label: string; + detail?: string; + labelDetails?: CompletionItemLabelDetails; + documentation?: string | MarkupContent; + kind?: CompletionItemKind; + insertText?: string; + insertTextFormat?: InsertTextFormat; + filterText?: string; + textEdit?: TextEdit +} +export namespace CompletionItem { + export function create(label: string): CompletionItem { + return { label }; + } +} + +export interface CompletionList { + items: CompletionItem[]; + isIncomplete: boolean +} diff --git a/packages/semi-json-viewer-core/src/service/parse.ts b/packages/semi-json-viewer-core/src/service/parse.ts new file mode 100644 index 0000000000..94b4218cf4 --- /dev/null +++ b/packages/semi-json-viewer-core/src/service/parse.ts @@ -0,0 +1,518 @@ +/** Based on https://github.com/microsoft/vscode-json-languageservice with modifications for custom requirements */ +import * as Json from 'jsonc-parser'; +import { JSONModel } from '../model/jsonModel'; +import { + ArrayASTNode, + ASTNode, + BooleanASTNode, + Diagnostic, + ErrorCode, + ErrRange, + NullASTNode, + NumberASTNode, + ObjectASTNode, + PropertyASTNode, + StringASTNode, +} from './jsonTypes'; +import { isObject, isNumber } from '../common/utils'; +/** + * Json 解析服务,提供json解析(AST)、获取节点值、获取节点路径等功能 + */ + +export function getNodeValue(node: ASTNode): any { + return Json.getNodeValue(node); +} + +export function getNodePath(node: ASTNode): Json.JSONPath { + return Json.getNodePath(node); +} + +export function contains(node: ASTNode, offset: number, includeRightBound = false): boolean { + return ( + (offset >= node.offset && offset < node.offset + node.length) || + (includeRightBound && offset === node.offset + node.length) + ); +} + +export abstract class ASTNodeImpl { + public abstract readonly type: 'object' | 'property' | 'array' | 'number' | 'boolean' | 'null' | 'string'; + + public offset: number; + public length: number; + public readonly parent: ASTNode | undefined; + + constructor(parent: ASTNode | undefined, offset: number, length: number = 0) { + this.offset = offset; + this.length = length; + this.parent = parent; + } + + public get children(): ASTNode[] { + return []; + } + + public toString(): string { + return ( + 'type: ' + + this.type + + ' (' + + this.offset + + '/' + + this.length + + ')' + + (this.parent ? ' parent: {' + this.parent.toString() + '}' : '') + ); + } +} + +export class NullASTNodeImpl extends ASTNodeImpl implements NullASTNode { + public type: 'null' = 'null'; + public value: null = null; + constructor(parent: ASTNode | undefined, offset: number) { + super(parent, offset); + } +} + +export class BooleanASTNodeImpl extends ASTNodeImpl implements BooleanASTNode { + public type: 'boolean' = 'boolean'; + public value: boolean; + + constructor(parent: ASTNode | undefined, boolValue: boolean, offset: number) { + super(parent, offset); + this.value = boolValue; + } +} + +export class ArrayASTNodeImpl extends ASTNodeImpl implements ArrayASTNode { + public type: 'array' = 'array'; + public items: ASTNode[]; + + constructor(parent: ASTNode | undefined, offset: number) { + super(parent, offset); + this.items = []; + } + + public get children(): ASTNode[] { + return this.items; + } +} +export class NumberASTNodeImpl extends ASTNodeImpl implements NumberASTNode { + public type: 'number' = 'number'; + public isInteger: boolean; + public value: number; + + constructor(parent: ASTNode | undefined, offset: number) { + super(parent, offset); + this.isInteger = true; + this.value = Number.NaN; + } +} + +export class ObjectASTNodeImpl extends ASTNodeImpl implements ObjectASTNode { + public type: 'object' = 'object'; + public properties: PropertyASTNode[]; + + constructor(parent: ASTNode | undefined, offset: number) { + super(parent, offset); + + this.properties = []; + } + + public get children(): ASTNode[] { + return this.properties; + } +} + +export class StringASTNodeImpl extends ASTNodeImpl implements StringASTNode { + public type: 'string' = 'string'; + public value: string; + + constructor(parent: ASTNode | undefined, offset: number, length?: number) { + super(parent, offset, length); + this.value = ''; + } +} + +export class PropertyASTNodeImpl extends ASTNodeImpl implements PropertyASTNode { + public type: 'property' = 'property'; + public keyNode: StringASTNode; + public valueNode?: ASTNode; + public colonOffset: number; + + constructor(parent: ObjectASTNode | undefined, offset: number, keyNode: StringASTNode) { + super(parent, offset); + this.colonOffset = -1; + this.keyNode = keyNode; + } + + public get children(): ASTNode[] { + return this.valueNode ? [this.keyNode, this.valueNode] : [this.keyNode]; + } +} + +export class JsonDocument { + public readonly root: ASTNode | undefined; + constructor(root: ASTNode | undefined) { + this.root = root; + } + + public getNodeFromOffset(offset: number, includeRightBound = false): ASTNode | undefined { + if (!this.root) { + return undefined; + } + return Json.findNodeAtOffset(this.root, offset, includeRightBound); + } + + public visit(visitor: (node: ASTNode) => boolean): void { + if (this.root) { + const doVisit = (node: ASTNode): boolean => { + let ctn = visitor(node); + const children = node.children; + if (Array.isArray(children)) { + for (let i = 0; i < children.length && ctn; i++) { + ctn = doVisit(children[i]); + } + } + return ctn; + }; + doVisit(this.root); + } + } +} + +export function parseJson(jsonModel: JSONModel) { + const problems: Diagnostic[] = []; + let lastProblemOffset = -1; + const text = jsonModel.getValue(); + const scanner = Json.createScanner(text, false); + function _scanNext(): Json.SyntaxKind { + while (true) { + const token = scanner.scan(); + _checkScanError(); + + switch (token) { + case Json.SyntaxKind.LineBreakTrivia: + case Json.SyntaxKind.Trivia: + break; + default: + return token; + } + } + } + + function _checkScanError(): boolean { + switch (scanner.getTokenError()) { + case Json.ScanError.InvalidUnicode: + _error('Invalid unicode sequence in string.', ErrorCode.InvalidUnicode); + return true; + case Json.ScanError.InvalidEscapeCharacter: + _error('Invalid escape character in string.', ErrorCode.InvalidEscapeCharacter); + return true; + case Json.ScanError.UnexpectedEndOfNumber: + _error('Unexpected end of number.', ErrorCode.UnexpectedEndOfNumber); + return true; + case Json.ScanError.UnexpectedEndOfComment: + _error('Unexpected end of comment.', ErrorCode.UnexpectedEndOfComment); + return true; + case Json.ScanError.UnexpectedEndOfString: + _error('Unexpected end of string.', ErrorCode.UnexpectedEndOfString); + return true; + case Json.ScanError.InvalidCharacter: + _error('Invalid characters in string. Control characters must be escaped.', ErrorCode.InvalidCharacter); + return true; + } + return false; + } + + function _errorAtRange(message: string, code: ErrorCode, startOffset: number, endOffset: number) { + if (problems.length === 0 || startOffset !== lastProblemOffset) { + const range = ErrRange.create(jsonModel.positionAt(startOffset), jsonModel.positionAt(endOffset)); + problems.push(Diagnostic.create(message, code, range)); + lastProblemOffset = startOffset; + } + return; + } + + function _finalize(node: T, scanNext: boolean): T { + node.length = scanner.getTokenOffset() + scanner.getTokenLength() - node.offset; + + if (scanNext) { + _scanNext(); + } + + return node; + } + + function _error( + message: string, + code: ErrorCode, + node: T | undefined = undefined, + skipUntilAfter: Json.SyntaxKind[] = [], + skipUntil: Json.SyntaxKind[] = [] + ): T | undefined { + let start = scanner.getTokenOffset(); + let end = scanner.getPosition() + scanner.getTokenLength(); + if (start === end && start > 0) { + start--; + while (start > 0 && /\s/.test(text.charAt(start))) { + start--; + } + end = start + 1; + } + _errorAtRange(message, code, start, end); + if (node) { + _finalize(node, false); + } + if (skipUntilAfter.length + skipUntil.length > 0) { + let token = scanner.getToken(); + while (token !== Json.SyntaxKind.EOF) { + if (skipUntilAfter.indexOf(token) !== -1) { + _scanNext(); + break; + } else if (skipUntil.indexOf(token) !== -1) { + break; + } + token = _scanNext(); + } + } + return node; + } + + function _parseArray(parent: ASTNode | undefined): ArrayASTNode | undefined { + if (scanner.getToken() !== Json.SyntaxKind.OpenBracketToken) { + return undefined; + } + const node = new ArrayASTNodeImpl(parent, scanner.getTokenOffset()); + _scanNext(); + + let needComma = false; + while (scanner.getToken() !== Json.SyntaxKind.CloseBracketToken && scanner.getToken() !== Json.SyntaxKind.EOF) { + if (scanner.getToken() === Json.SyntaxKind.CommaToken) { + if (!needComma) { + _error('Value expected.', ErrorCode.ValueExpected); + } + const commaOffset = scanner.getTokenOffset(); + _scanNext(); + if (scanner.getToken() === Json.SyntaxKind.CloseBracketToken) { + if (needComma) { + _errorAtRange('Trailing comma', ErrorCode.TrailingComma, commaOffset, commaOffset + 1); + } + continue; + } + } else if (needComma) { + _error('Comma expected.', ErrorCode.CommaExpected, undefined, [], [Json.SyntaxKind.CloseBracketToken]); + break; + } + const item = _parseValue(node); + if (!item) { + _error('Value expected.', ErrorCode.ValueExpected, undefined, [], [Json.SyntaxKind.CloseBracketToken]); + break; + } else { + node.items.push(item); + } + needComma = true; + } + + if (scanner.getToken() !== Json.SyntaxKind.CloseBracketToken) { + return _error('Expected comma or closing bracket', ErrorCode.CommaOrCloseBraceExpected, node); + } + return _finalize(node, true); + } + + const keyPlaceholder = new StringASTNodeImpl(undefined, 0, 0); + + function _parseProperty( + parent: ObjectASTNode | undefined, + keysSeen: { [key: string]: PropertyASTNode | boolean } + ): PropertyASTNode | undefined { + const node = new PropertyASTNodeImpl(parent, scanner.getTokenOffset(), keyPlaceholder); + let key = _parseString(node); + if (!key) { + if (scanner.getToken() === Json.SyntaxKind.Unknown) { + // give a more helpful error message + _error('Property keys must be doublequoted', ErrorCode.PropertyKeysMustBeDoublequoted); + const keyNode = new StringASTNodeImpl(node, scanner.getTokenOffset(), scanner.getTokenLength()); + keyNode.value = scanner.getTokenValue(); + key = keyNode; + _scanNext(); // consume Unknown + } else { + return undefined; + } + } + node.keyNode = key; + + // For JSON files that forbid code comments, there is a convention to use the key name "//" to add comments. + // Multiple instances of "//" are okay. + if (key.value !== '//') { + const seen = keysSeen[key.value]; + if (seen) { + _errorAtRange( + 'Duplicate object key', + ErrorCode.DuplicateKey, + node.keyNode.offset, + node.keyNode.offset + node.keyNode.length + ); + if (isObject(seen)) { + _errorAtRange( + 'Duplicate object key', + ErrorCode.DuplicateKey, + seen.keyNode.offset, + seen.keyNode.offset + seen.keyNode.length + ); + } + keysSeen[key.value] = true; // if the same key is duplicate again, avoid duplicate error reporting + } else { + keysSeen[key.value] = node; + } + } + + if (scanner.getToken() === Json.SyntaxKind.ColonToken) { + node.colonOffset = scanner.getTokenOffset(); + _scanNext(); // consume ColonToken + } else { + _error('Colon expected', ErrorCode.ColonExpected); + if ( + scanner.getToken() === Json.SyntaxKind.StringLiteral && + jsonModel.positionAt(key.offset + key.length).lineNumber < + jsonModel.positionAt(scanner.getTokenOffset()).lineNumber + ) { + node.length = key.length; + return node; + } + } + const value = _parseValue(node); + if (!value) { + return _error( + 'Value expected', + ErrorCode.ValueExpected, + node, + [], + [Json.SyntaxKind.CloseBraceToken, Json.SyntaxKind.CommaToken] + ); + } + node.valueNode = value; + node.length = value.offset + value.length - node.offset; + return node; + } + + function _parseObject(parent: ASTNode | undefined): ObjectASTNode | undefined { + if (scanner.getToken() !== Json.SyntaxKind.OpenBraceToken) { + return undefined; + } + const node = new ObjectASTNodeImpl(parent, scanner.getTokenOffset()); + const keysSeen: any = Object.create(null); + _scanNext(); // consume OpenBraceToken + let needsComma = false; + + while (scanner.getToken() !== Json.SyntaxKind.CloseBraceToken && scanner.getToken() !== Json.SyntaxKind.EOF) { + if (scanner.getToken() === Json.SyntaxKind.CommaToken) { + if (!needsComma) { + _error('Property expected', ErrorCode.PropertyExpected); + } + const commaOffset = scanner.getTokenOffset(); + _scanNext(); // consume comma + if (scanner.getToken() === Json.SyntaxKind.CloseBraceToken) { + if (needsComma) { + _errorAtRange('Trailing comma', ErrorCode.TrailingComma, commaOffset, commaOffset + 1); + } + continue; + } + } else if (needsComma) { + _error('Expected comma', ErrorCode.CommaExpected); + } + const property = _parseProperty(node, keysSeen); + if (!property) { + _error( + 'Property expected', + ErrorCode.PropertyExpected, + undefined, + [], + [Json.SyntaxKind.CloseBraceToken, Json.SyntaxKind.CommaToken] + ); + } else { + node.properties.push(property); + } + needsComma = true; + } + + if (scanner.getToken() !== Json.SyntaxKind.CloseBraceToken) { + return _error('Expected comma or closing brace', ErrorCode.CommaOrCloseBraceExpected, node); + } + return _finalize(node, true); + } + + function _parseString(parent: ASTNode | undefined): StringASTNode | undefined { + if (scanner.getToken() !== Json.SyntaxKind.StringLiteral) { + return undefined; + } + + const node = new StringASTNodeImpl(parent, scanner.getTokenOffset()); + node.value = scanner.getTokenValue(); + + return _finalize(node, true); + } + + function _parseNumber(parent: ASTNode | undefined): NumberASTNode | undefined { + if (scanner.getToken() !== Json.SyntaxKind.NumericLiteral) { + return undefined; + } + + const node = new NumberASTNodeImpl(parent, scanner.getTokenOffset()); + if (scanner.getTokenError() === Json.ScanError.None) { + const tokenValue = scanner.getTokenValue(); + try { + const numberValue = JSON.parse(tokenValue); + if (!isNumber(numberValue)) { + return _error('Invalid number format.', ErrorCode.Undefined, node); + } + node.value = numberValue; + } catch (e) { + return _error('Invalid number format.', ErrorCode.Undefined, node); + } + node.isInteger = tokenValue.indexOf('.') === -1; + } + return _finalize(node, true); + } + + function _parseLiteral(parent: ASTNode | undefined): ASTNode | undefined { + let node: ASTNodeImpl; + switch (scanner.getToken()) { + case Json.SyntaxKind.NullKeyword: + return _finalize(new NullASTNodeImpl(parent, scanner.getTokenOffset()), true); + case Json.SyntaxKind.TrueKeyword: + return _finalize(new BooleanASTNodeImpl(parent, true, scanner.getTokenOffset()), true); + case Json.SyntaxKind.FalseKeyword: + return _finalize(new BooleanASTNodeImpl(parent, false, scanner.getTokenOffset()), true); + default: + return undefined; + } + } + + function _parseValue(parent: ASTNode | undefined): ASTNode | undefined { + return ( + _parseArray(parent) || + _parseObject(parent) || + _parseString(parent) || + _parseNumber(parent) || + _parseLiteral(parent) + ); + } + + let _root: ASTNode | undefined = undefined; + + const token = _scanNext(); + + if (token !== Json.SyntaxKind.EOF) { + _root = _parseValue(_root); + if (!_root) { + _error('Expected a JSON object, array or literal', ErrorCode.Undefined); + } else if (scanner.getToken() !== Json.SyntaxKind.EOF) { + _error('End of file expected.', ErrorCode.Undefined); + } + } + + return { + problems, + root: new JsonDocument(_root), + }; +} diff --git a/packages/semi-json-viewer-core/src/tokens/index.md b/packages/semi-json-viewer-core/src/tokens/index.md new file mode 100644 index 0000000000..7bfe0c54bf --- /dev/null +++ b/packages/semi-json-viewer-core/src/tokens/index.md @@ -0,0 +1,43 @@ +# JSON Viewer Tokens 模块总结 + +## 核心功能 +这个模块主要负责 JSON 文本的词法分析(tokenization)和语法高亮,基于 VS Code 的实现进行了定制化改造。 + +## 主要模块 + +### 1. tokenize.ts +- 定义了基础的词法分析支持接口和状态管理 +- 实现了 JSON 的词法分析器,可以识别以下类型的 token: + - 分隔符 (括号、冒号、逗号等) + - 关键字 (null, true, false) + - 字符串 + - 数字 + - 注释 (行注释和块注释) +- 支持多层级的括号颜色区分 + +### 2. tokenizationJsonModelPart.ts +- 管理整个文档的词法分析状态 +- 提供了 token 存储和更新的接口 +- 处理文档内容变化时的 token 重新计算 + +### 3. jsonModelToken.ts +- 实现了带状态追踪的词法分析器 +- 提供了后台分析的功能,通过 `IdleDeadline` 来避免阻塞主线程 +- 包含了 token 状态的缓存管理 +- 实现了增量式的词法分析,只重新分析发生变化的部分 + +### 4. offsetRange.ts +- 提供了处理偏移量范围的工具类 +- 支持范围的各种运算操作: + - 合并 (join) + - 相交 (intersect) + - 偏移 (delta) + - 包含判断等 +- 用于精确控制需要重新分析的文本范围 + +## 工作流程 +1. 当 JSON 文本发生变化时,系统会标记受影响的行号范围 +2. 后台分析器会在空闲时间对这些行进行重新分析 +3. 分析结果会被缓存,并触发界面更新 +4. 整个过程是增量式的,只处理必要的部分,保证了性能 + diff --git a/packages/semi-json-viewer-core/src/tokens/jsonModelToken.ts b/packages/semi-json-viewer-core/src/tokens/jsonModelToken.ts new file mode 100644 index 0000000000..a141bc50cd --- /dev/null +++ b/packages/semi-json-viewer-core/src/tokens/jsonModelToken.ts @@ -0,0 +1,306 @@ +/** reference from https://github.com/microsoft/vscode */ +import { JSONModel } from '../model/jsonModel'; +import { JSONState, JsonTokenizationSupport } from './tokenize'; +import { OffsetRange } from './offsetRange'; +import { runWhenGlobalIdle } from '../common/async'; +import { IBackgroundTokenizationStore } from './tokenizationJsonModelPart'; +import { StopWatch } from '../common/stopWatch'; + +export class TokenizerWithStateStore { + private readonly initialState: JSONState; + public readonly store: TrackingTokenizationStateStore; + constructor(lineCount: number, public readonly tokenizationSupport: JsonTokenizationSupport) { + this.initialState = tokenizationSupport.getInitialState(); + this.store = new TrackingTokenizationStateStore(lineCount); + } + + public getStartState(lineNumber: number): JSONState { + return this.store.getStartState(lineNumber, this.initialState); + } + + public getFirstInvalidLine(): { + lineNumber: number; + startState: JSONState + } | null { + return this.store.getFirstInvalidLine(this.initialState); + } +} + +export class JsonTokenizerWithStateStoreAndModel extends TokenizerWithStateStore { + constructor( + lineCount: number, + tokenizationSupport: JsonTokenizationSupport, + public readonly _jsonModel: JSONModel + ) { + super(lineCount, tokenizationSupport); + } + + public updateTokensUntilLine(lineNumber: number, backgroundTokenizationStore: IBackgroundTokenizationStore): void { + while (true) { + const lineToTokenize = this.getFirstInvalidLine(); + + if (!lineToTokenize || lineToTokenize.lineNumber > lineNumber) { + break; + } + + const text = this._jsonModel.getLineContent(lineToTokenize.lineNumber); + const result = this.tokenizationSupport.tokenize(text, lineToTokenize.startState); + backgroundTokenizationStore.setTokens(lineToTokenize.lineNumber, result.tokens); + + this.store.setEndState(lineToTokenize.lineNumber, result.endState); + } + } +} + +export class TrackingTokenizationStateStore { + private readonly _tokenizationStateStore = new TokenizationStateStore(); + private readonly _invalidatedLines = new RangePriorityQueue(); + constructor(private lineCount: number) { + this._invalidatedLines.addRange(new OffsetRange(1, lineCount + 1)); + } + + public getEndState(lineNumber: number): JSONState { + return this._tokenizationStateStore.getEndState(lineNumber); + } + + public setEndState(lineNumber: number, state: JSONState): boolean { + this._invalidatedLines.delete(lineNumber); + const result = this._tokenizationStateStore.setEndState(lineNumber, state); + if (result && lineNumber < this.lineCount) { + this._invalidatedLines.addRange(new OffsetRange(lineNumber + 1, lineNumber + 2)); + } + return result; + } + + public getStartState(lineNumber: number, initialState: JSONState): JSONState { + if (lineNumber === 1) { + return initialState; + } + return this.getEndState(lineNumber - 1); + } + + public getFirstInvalidEndStateLineNumber(): number | null { + return this._invalidatedLines.min; + } + + public getFirstInvalidLine( + initialState: JSONState + ): { + lineNumber: number; + startState: JSONState + } | null { + const lineNumber = this.getFirstInvalidEndStateLineNumber(); + if (lineNumber === null) { + return null; + } + const startState = this.getStartState(lineNumber, initialState); + if (!startState) { + throw new Error('Start state must be defined'); + } + return { + lineNumber, + startState: this.getStartState(lineNumber, initialState), + }; + } + + public allStatesValid(): boolean { + return this._invalidatedLines.min === null; + } + + public invalidateRange({ from, to }: { from: number; to: number }): void { + this._invalidatedLines.addRange(new OffsetRange(from, to)); + } +} + +export class TokenizationStateStore { + private readonly _lineEndState = new Array(); + + public getEndState(lineNumber: number): JSONState { + return this._lineEndState[lineNumber]; + } + + public setEndState(lineNumber: number, state: JSONState): boolean { + const oldState = this._lineEndState[lineNumber]; + if (oldState && oldState.equals(state)) { + return false; + } + this._lineEndState[lineNumber] = state; + return true; + } +} + +export class RangePriorityQueue { + private readonly _ranges: OffsetRange[] = []; + + public getRange(): OffsetRange[] { + return this._ranges; + } + + public addRange(range: OffsetRange): void { + OffsetRange.addRange(range, this._ranges); + } + + public get min(): number | null { + return this._ranges[0]?.start ?? null; + } + /** + * 现有的范围集合中添加一个新的范围 + * @param range + * @param newLength + */ + public addRangeAndResize(range: OffsetRange, newLength: number): void { + // 找到第一个可能与新范围相交的范围 + let idxFirstMightBeIntersecting = 0; + while ( + !( + idxFirstMightBeIntersecting >= this._ranges.length || + range.start <= this._ranges[idxFirstMightBeIntersecting].endExclusive + ) + ) { + idxFirstMightBeIntersecting++; + } + // 找到第一个在新范围之后,且与新范围不相交的范围 + let idxFirstIsAfter = idxFirstMightBeIntersecting; + while (!(idxFirstIsAfter >= this._ranges.length || range.endExclusive < this._ranges[idxFirstIsAfter].start)) { + idxFirstIsAfter++; + } + // 计算新范围与旧范围的差值 + const delta = newLength - range.length; + // 将所有在新范围之后的范围进行调整 + + for (let i = idxFirstIsAfter; i < this._ranges.length; i++) { + this._ranges[i] = this._ranges[i].delta(delta); + } + + if (idxFirstMightBeIntersecting === idxFirstIsAfter) { + const newRange = new OffsetRange(range.start, range.start + newLength); + if (!newRange.isEmpty) { + this._ranges.splice(idxFirstMightBeIntersecting, 0, newRange); + } + } else { + const start = Math.min(range.start, this._ranges[idxFirstMightBeIntersecting].start); + const endEx = Math.max(range.endExclusive, this._ranges[idxFirstIsAfter - 1].endExclusive); + // 创建一个新的范围,并将其添加到范围集合中 + const newRange = new OffsetRange(start, endEx + delta); + if (!newRange.isEmpty) { + this._ranges.splice( + idxFirstMightBeIntersecting, + idxFirstIsAfter - idxFirstMightBeIntersecting, + newRange + ); + } else { + this._ranges.splice(idxFirstMightBeIntersecting, idxFirstIsAfter - idxFirstMightBeIntersecting); + } + } + } + /** + * 删除一个值 + * @param value + */ + public delete(value: number): void { + // 找到第一个包含该值的范围 + const idx = this._ranges.findIndex(r => r.contains(value)); + if (idx !== -1) { + const range = this._ranges[idx]; + // 如果该值正好是范围的开始 + if (range.start === value) { + //如果范围长度为1,直接删除整个范围。 + //否则,将范围的起始点向后移动一位。 + if (range.endExclusive === value + 1) { + this._ranges.splice(idx, 1); + } else { + this._ranges[idx] = new OffsetRange(value + 1, range.endExclusive); + } + } else { + // 如果该值在范围的中间 + // 如果该值正好是范围的结束 + if (range.endExclusive === value + 1) { + this._ranges[idx] = new OffsetRange(range.start, value); + } else { + // 否则,将范围分成两个范围 + this._ranges.splice( + idx, + 1, + new OffsetRange(range.start, value), + new OffsetRange(value + 1, range.endExclusive) + ); + } + } + } + } +} + +export class JsonBackgroundTokenizer { + constructor( + private readonly _jsonTokenizerWithStateStoreAndModel: JsonTokenizerWithStateStoreAndModel, + private readonly _backgroundTokenizationStore: IBackgroundTokenizationStore + ) {} + + public handleChanges(): void { + this._beginBackgroundTokenization(); + } + + private _beginBackgroundTokenization(): void { + runWhenGlobalIdle((deadline: IdleDeadline) => { + this._backgroundTokenizeWithDeadline(deadline); + }); + } + + private _backgroundTokenizeWithDeadline(deadline: IdleDeadline): void { + const endTime = Date.now() + deadline.timeRemaining(); + + const execute = () => { + if (!this._hasLinesToTokenize()) return; + this._backgroundTokenize(); + + if (Date.now() < endTime) { + setTimeout(execute); + } else { + this._beginBackgroundTokenization(); + } + }; + execute(); + } + + private _backgroundTokenize(): void { + const lineCount = this._jsonTokenizerWithStateStoreAndModel._jsonModel.getLineCount(); + const stopWatch = StopWatch.create(true); + do { + if (stopWatch.elapsed() > 1) { + break; + } + const tokenizedNumber = this._tokenizeOneInvalidLine(); + if (tokenizedNumber > lineCount) { + break; + } + } while (this._hasLinesToTokenize()); + } + + private _hasLinesToTokenize(): boolean { + if (!this._jsonTokenizerWithStateStoreAndModel) { + return false; + } + return !this._jsonTokenizerWithStateStoreAndModel.store.allStatesValid(); + } + + private _tokenizeOneInvalidLine(): number { + const firstInvalidLine = this._jsonTokenizerWithStateStoreAndModel.getFirstInvalidLine(); + + if (!firstInvalidLine) { + return this._jsonTokenizerWithStateStoreAndModel._jsonModel.getLineCount() + 1; + } + //TODO builder + this._jsonTokenizerWithStateStoreAndModel.updateTokensUntilLine( + firstInvalidLine.lineNumber, + this._backgroundTokenizationStore + ); + return firstInvalidLine.lineNumber; + } + + public requestTokens({ from, to }: { from: number; to: number }): void { + this._jsonTokenizerWithStateStoreAndModel.store.invalidateRange({ + from: from === 1 ? 1 : from - 1, + to: to + 1, + }); + } +} diff --git a/packages/semi-json-viewer-core/src/tokens/offsetRange.ts b/packages/semi-json-viewer-core/src/tokens/offsetRange.ts new file mode 100644 index 0000000000..25bbe69827 --- /dev/null +++ b/packages/semi-json-viewer-core/src/tokens/offsetRange.ts @@ -0,0 +1,238 @@ +/** reference from https://github.com/microsoft/vscode */ +export interface IOffsetRange { + readonly start: number; + readonly endExclusive: number +} + +/** + * A range of offsets (0-based). + */ +export class OffsetRange implements IOffsetRange { + public static addRange(range: OffsetRange, sortedRanges: OffsetRange[]): void { + let i = 0; + while (i < sortedRanges.length && sortedRanges[i].endExclusive < range.start) { + i++; + } + let j = i; + while (j < sortedRanges.length && sortedRanges[j].start <= range.endExclusive) { + j++; + } + if (i === j) { + sortedRanges.splice(i, 0, range); + } else { + const start = Math.min(range.start, sortedRanges[i].start); + const end = Math.max(range.endExclusive, sortedRanges[j - 1].endExclusive); + sortedRanges.splice(i, j - i, new OffsetRange(start, end)); + } + } + + public static tryCreate(start: number, endExclusive: number): OffsetRange | undefined { + if (start > endExclusive) { + return undefined; + } + return new OffsetRange(start, endExclusive); + } + + public static ofLength(length: number): OffsetRange { + return new OffsetRange(0, length); + } + + public static ofStartAndLength(start: number, length: number): OffsetRange { + return new OffsetRange(start, start + length); + } + + constructor(public readonly start: number, public readonly endExclusive: number) { + if (start > endExclusive) { + throw new Error(`Invalid range: ${this.toString()}`); + } + } + + get isEmpty(): boolean { + return this.start === this.endExclusive; + } + + public delta(offset: number): OffsetRange { + return new OffsetRange(this.start + offset, this.endExclusive + offset); + } + + public deltaStart(offset: number): OffsetRange { + return new OffsetRange(this.start + offset, this.endExclusive); + } + + public deltaEnd(offset: number): OffsetRange { + return new OffsetRange(this.start, this.endExclusive + offset); + } + + public get length(): number { + return this.endExclusive - this.start; + } + + public toString() { + return `[${this.start}, ${this.endExclusive})`; + } + + public equals(other: OffsetRange): boolean { + return this.start === other.start && this.endExclusive === other.endExclusive; + } + + public containsRange(other: OffsetRange): boolean { + return this.start <= other.start && other.endExclusive <= this.endExclusive; + } + + public contains(offset: number): boolean { + return this.start <= offset && offset < this.endExclusive; + } + + /** + * for all numbers n: range1.contains(n) or range2.contains(n) => range1.join(range2).contains(n) + * The joined range is the smallest range that contains both ranges. + */ + public join(other: OffsetRange): OffsetRange { + return new OffsetRange(Math.min(this.start, other.start), Math.max(this.endExclusive, other.endExclusive)); + } + + /** + * for all numbers n: range1.contains(n) and range2.contains(n) <=> range1.intersect(range2).contains(n) + * + * The resulting range is empty if the ranges do not intersect, but touch. + * If the ranges don't even touch, the result is undefined. + */ + public intersect(other: OffsetRange): OffsetRange | undefined { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + if (start <= end) { + return new OffsetRange(start, end); + } + return undefined; + } + + public intersects(other: OffsetRange): boolean { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start < end; + } + + public intersectsOrTouches(other: OffsetRange): boolean { + const start = Math.max(this.start, other.start); + const end = Math.min(this.endExclusive, other.endExclusive); + return start <= end; + } + + public isBefore(other: OffsetRange): boolean { + return this.endExclusive <= other.start; + } + + public isAfter(other: OffsetRange): boolean { + return this.start >= other.endExclusive; + } + + public slice(arr: T[]): T[] { + return arr.slice(this.start, this.endExclusive); + } + + public substring(str: string): string { + return str.substring(this.start, this.endExclusive); + } + + /** + * Returns the given value if it is contained in this instance, otherwise the closest value that is contained. + * The range must not be empty. + */ + public clip(value: number): number { + if (this.isEmpty) { + throw new Error(`Invalid clipping range: ${this.toString()}`); + } + return Math.max(this.start, Math.min(this.endExclusive - 1, value)); + } + + /** + * Returns `r := value + k * length` such that `r` is contained in this range. + * The range must not be empty. + * + * E.g. `[5, 10).clipCyclic(10) === 5`, `[5, 10).clipCyclic(11) === 6` and `[5, 10).clipCyclic(4) === 9`. + */ + public clipCyclic(value: number): number { + if (this.isEmpty) { + throw new Error(`Invalid clipping range: ${this.toString()}`); + } + if (value < this.start) { + return this.endExclusive - ((this.start - value) % this.length); + } + if (value >= this.endExclusive) { + return this.start + ((value - this.start) % this.length); + } + return value; + } + + public map(f: (offset: number) => T): T[] { + const result: T[] = []; + for (let i = this.start; i < this.endExclusive; i++) { + result.push(f(i)); + } + return result; + } + + public forEach(f: (offset: number) => void): void { + for (let i = this.start; i < this.endExclusive; i++) { + f(i); + } + } +} + +export class OffsetRangeSet { + private readonly _sortedRanges: OffsetRange[] = []; + + public addRange(range: OffsetRange): void { + let i = 0; + while (i < this._sortedRanges.length && this._sortedRanges[i].endExclusive < range.start) { + i++; + } + let j = i; + while (j < this._sortedRanges.length && this._sortedRanges[j].start <= range.endExclusive) { + j++; + } + if (i === j) { + this._sortedRanges.splice(i, 0, range); + } else { + const start = Math.min(range.start, this._sortedRanges[i].start); + const end = Math.max(range.endExclusive, this._sortedRanges[j - 1].endExclusive); + this._sortedRanges.splice(i, j - i, new OffsetRange(start, end)); + } + } + + public toString(): string { + return this._sortedRanges.map(r => r.toString()).join(', '); + } + + /** + * Returns of there is a value that is contained in this instance and the given range. + */ + public intersectsStrict(other: OffsetRange): boolean { + // TODO use binary search + let i = 0; + while (i < this._sortedRanges.length && this._sortedRanges[i].endExclusive <= other.start) { + i++; + } + return i < this._sortedRanges.length && this._sortedRanges[i].start < other.endExclusive; + } + + public intersectWithRange(other: OffsetRange): OffsetRangeSet { + // TODO use binary search + slice + const result = new OffsetRangeSet(); + for (const range of this._sortedRanges) { + const intersection = range.intersect(other); + if (intersection) { + result.addRange(intersection); + } + } + return result; + } + + public intersectWithRangeLength(other: OffsetRange): number { + return this.intersectWithRange(other).length; + } + + public get length(): number { + return this._sortedRanges.reduce((prev, cur) => prev + cur.length, 0); + } +} diff --git a/packages/semi-json-viewer-core/src/tokens/tokenizationJsonModelPart.ts b/packages/semi-json-viewer-core/src/tokens/tokenizationJsonModelPart.ts new file mode 100644 index 0000000000..889e9661d9 --- /dev/null +++ b/packages/semi-json-viewer-core/src/tokens/tokenizationJsonModelPart.ts @@ -0,0 +1,114 @@ +/** Based on https://github.com/microsoft/vscode with modifications for custom requirements */ +import { JSONModel } from '../model/jsonModel'; +import { JsonBackgroundTokenizer, JsonTokenizerWithStateStoreAndModel } from './jsonModelToken'; +import { Token } from './tokenize'; +import { createTokenizationSupport } from './tokenize'; +import { GlobalEvents, IModelContentChangeEvent } from '../common/emitterEvents'; +import { Emitter, getEmitter } from '../common/emitter'; + +export interface IBackgroundTokenizationStore { + setTokens(lineNumber: number, tokens: Token[]): void + + // setEndState(lineNumber: number, state: JSONState): void; + + /** + * Should be called to indicate that the background tokenization has finished for now. + * (This triggers bracket pair colorization to re-parse the bracket pairs with token information) + */ + // backgroundTokenizationFinished(): void; +} + +export class TokenizationJsonModelPart { + private readonly tokens: GrammarTokens; + private _jsonModel: JSONModel | null = null; + private emitter: Emitter = getEmitter(); + constructor(jsonModel: JSONModel) { + this._jsonModel = jsonModel; + this.tokens = new GrammarTokens(this._jsonModel); + } + + public getLineTokens(lineNumber: number): Token[] { + return this.tokens.getLineTokens(lineNumber); + } + + public handleDidChangeContent(e: IModelContentChangeEvent) { + this.tokens.handleDidChangeContent(e); + } + + public forceTokenize(lineNumber: number) { + this.tokens.forceTokenize(lineNumber); + } + + public requestTokens(range: { from: number; to: number }) { + this.tokens.backgroundTokenizer?.requestTokens(range); + } +} + +export class GrammarTokens { + private _tokens: Map = new Map(); + private _tokenizer: JsonTokenizerWithStateStoreAndModel | null = null; + private _backgroundTokenizer: JsonBackgroundTokenizer | null = null; + private _jsonModel: JSONModel; + private emitter: Emitter = getEmitter(); + constructor(jsonModel: JSONModel) { + this._jsonModel = jsonModel; + this.emitter.on('contentChanged', (e: IModelContentChangeEvent | IModelContentChangeEvent[]) => { + let from = 0; + let to = this._jsonModel.getLineCount(); + if (Array.isArray(e)) { + from = e[e.length - 1].range.startLineNumber; + } else { + from = e.range.startLineNumber; + } + this._backgroundTokenizer?.requestTokens({ + from, + to, + }); + this._backgroundTokenizer?.handleChanges(); + }); + this.resetTokenization(); + } + + public get backgroundTokenizer() { + return this._backgroundTokenizer; + } + + public resetTokenization() { + this._tokens.clear(); + const JsonTokenizationSupport = createTokenizationSupport(true); + const initialState = JsonTokenizationSupport.getInitialState(); + if (JsonTokenizationSupport && initialState) { + this._tokenizer = new JsonTokenizerWithStateStoreAndModel( + this._jsonModel.getLineCount(), + JsonTokenizationSupport, + this._jsonModel + ); + } + + const b: IBackgroundTokenizationStore = { + setTokens: (lineNumber: number, tokens: Token[]) => { + this._tokens.set(lineNumber, tokens); + }, + }; + if (this._tokenizer) { + this._backgroundTokenizer = new JsonBackgroundTokenizer(this._tokenizer, b); + this._backgroundTokenizer.handleChanges(); + } + } + public getLineTokens(lineNumber: number): Token[] { + return this._tokens.get(lineNumber) || []; + } + + public handleDidChangeContent(e: IModelContentChangeEvent) { + this._backgroundTokenizer?.handleChanges(); + } + + public forceTokenize(lineNumber: number) { + const b: IBackgroundTokenizationStore = { + setTokens: (lineNumber: number, tokens: Token[]) => { + this._tokens.set(lineNumber, tokens); + }, + }; + this._tokenizer?.updateTokensUntilLine(lineNumber, b); + } +} diff --git a/packages/semi-json-viewer-core/src/tokens/tokenize.ts b/packages/semi-json-viewer-core/src/tokens/tokenize.ts new file mode 100644 index 0000000000..cf79c66587 --- /dev/null +++ b/packages/semi-json-viewer-core/src/tokens/tokenize.ts @@ -0,0 +1,282 @@ +/** Based on https://github.com/microsoft/vscode with modifications for custom requirements */ +import * as json from 'jsonc-parser'; + +export interface Token { + scopes: string; + startIndex: number +} + +export interface JsonTokenizationSupport { + getInitialState(): JSONState; + tokenize(line: string, state: JSONState): TokenizationResult +} + +export class TokenizationResult { + constructor(public readonly tokens: Token[], public readonly endState: JSONState) {} +} + +export function createTokenizationSupport(supportComments: boolean): JsonTokenizationSupport { + return { + getInitialState: () => new JSONState(null, null, false, null), + tokenize: (line: string, state?: JSONState) => tokenize(supportComments, line, state), + }; +} +export interface IState { + clone(): IState; + equals(other: IState): boolean +} + +export const TOKEN_DELIM_OBJECT = 'semi-json-viewer-delimiter-bracket'; +export const TOKEN_DELIM_ARRAY = 'semi-json-viewer-delimiter-array'; +export const TOKEN_DELIM_COLON = 'semi-json-viewer-delimiter-colon'; +export const TOKEN_DELIM_COMMA = 'semi-json-viewer-delimiter-comma'; +export const TOKEN_VALUE_BOOLEAN = 'semi-json-viewer-keyword'; +export const TOKEN_VALUE_NULL = 'semi-json-viewer-keyword'; +export const TOKEN_VALUE_STRING = 'semi-json-viewer-string-value'; +export const TOKEN_VALUE_NUMBER = 'semi-json-viewer-number'; +export const TOKEN_PROPERTY_NAME = 'semi-json-viewer-string-key'; +export const TOKEN_COMMENT_BLOCK = 'semi-json-viewer-comment-block'; +export const TOKEN_COMMENT_LINE = 'semi-json-viewer-comment-line'; + +const enum JSONParent { + Object = 0, + Array = 1, +} + +class ParentsStack { + constructor( + public readonly parent: ParentsStack | null, + public readonly type: JSONParent, + public readonly depth: number + ) {} + + public static pop(parents: ParentsStack | null): ParentsStack | null { + if (parents) { + return parents.parent; + } + return null; + } + + public static push(parents: ParentsStack | null, type: JSONParent): ParentsStack { + return new ParentsStack(parents, type, parents ? parents.depth + 1 : 0); + } + + public static equals(a: ParentsStack | null, b: ParentsStack | null): boolean { + if (!a && !b) { + return true; + } + if (!a || !b) { + return false; + } + while (a && b) { + if (a.type !== b.type || a.depth !== b.depth) { + return false; + } + a = a.parent; + b = b.parent; + } + return a === null && b === null; + } +} + +export class JSONState { + private _state: IState | null; + + public scanError: ScanError | null; + public lastWasColon: boolean; + public parents: ParentsStack | null; + + constructor( + state: IState | null, + scanError: ScanError | null, + lastWasColon: boolean, + parents: ParentsStack | null + ) { + this._state = state; + this.scanError = scanError; + this.lastWasColon = lastWasColon; + this.parents = parents; + } + + public clone(): JSONState { + return new JSONState(this._state, this.scanError, this.lastWasColon, this.parents); + } + + public equals(other: IState): boolean { + if (other === this) { + return true; + } + if (!other || !(other instanceof JSONState)) { + return false; + } + return ( + this.scanError === other.scanError && + this.lastWasColon === other.lastWasColon && + ParentsStack.equals(this.parents, other.parents) + ); + } + + public getStateData(): IState | null { + return this._state; + } + + public setStateData(state: IState): void { + this._state = state; + } +} + +const enum ScanError { + None = 0, + UnexpectedEndOfComment = 1, + UnexpectedEndOfString = 2, + UnexpectedEndOfNumber = 3, + InvalidUnicode = 4, + InvalidEscapeCharacter = 5, + InvalidCharacter = 6, +} + +const enum SyntaxKind { + OpenBraceToken = 1, + CloseBraceToken = 2, + OpenBracketToken = 3, + CloseBracketToken = 4, + CommaToken = 5, + ColonToken = 6, + NullKeyword = 7, + TrueKeyword = 8, + FalseKeyword = 9, + StringLiteral = 10, + NumericLiteral = 11, + LineCommentTrivia = 12, + BlockCommentTrivia = 13, + LineBreakTrivia = 14, + Trivia = 15, + Unknown = 16, + EOF = 17, +} + +function tokenize(comments: boolean, line: string, state: JSONState, offsetDelta: number = 0) { + // handle multiline strings and block comments + let numberOfInsertedCharacters = 0; + let adjustOffset = false; + + switch (state.scanError) { + case ScanError.UnexpectedEndOfString: + line = '"' + line; + numberOfInsertedCharacters = 1; + break; + case ScanError.UnexpectedEndOfComment: + line = '/*' + line; + numberOfInsertedCharacters = 2; + break; + } + + const scanner = json.createScanner(line); + let lastWasColon = state.lastWasColon; + let parents = state.parents; + + const ret = { + tokens: [], + endState: state.clone(), + }; + + while (true) { + let offset = offsetDelta + scanner.getPosition(); + let type = ''; + + const kind = (scanner.scan()); + if (kind === SyntaxKind.EOF) { + break; + } + + // Check that the scanner has advanced + if (offset === offsetDelta + scanner.getPosition()) { + throw new Error('Scanner did not advance, next 3 characters are: ' + line.substr(scanner.getPosition(), 3)); + } + + // In case we inserted /* or " character, we need to + // adjust the offset of all tokens (except the first) + if (adjustOffset) { + offset -= numberOfInsertedCharacters; + } + adjustOffset = numberOfInsertedCharacters > 0; + + // brackets and type + switch (kind) { + case SyntaxKind.OpenBraceToken: + parents = ParentsStack.push(parents, JSONParent.Object); + //TODO: 颜色根据depth变化 目前写死层级最大为3 + type = `${TOKEN_DELIM_OBJECT}-${parents ? parents.depth % 3 : 0}`; + lastWasColon = false; + break; + case SyntaxKind.CloseBraceToken: + type = `${TOKEN_DELIM_OBJECT}-${parents ? parents.depth % 3 : 0}`; + parents = ParentsStack.pop(parents); + lastWasColon = false; + break; + case SyntaxKind.OpenBracketToken: + parents = ParentsStack.push(parents, JSONParent.Array); + type = `${TOKEN_DELIM_ARRAY}-${parents ? parents.depth % 3 : 0}`; + lastWasColon = false; + break; + case SyntaxKind.CloseBracketToken: + type = `${TOKEN_DELIM_ARRAY}-${parents ? parents.depth % 3 : 0}`; + parents = ParentsStack.pop(parents); + lastWasColon = false; + break; + case SyntaxKind.ColonToken: + type = TOKEN_DELIM_COLON; + lastWasColon = true; + break; + case SyntaxKind.CommaToken: + type = TOKEN_DELIM_COMMA; + lastWasColon = false; + break; + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + type = TOKEN_VALUE_BOOLEAN; + lastWasColon = false; + break; + case SyntaxKind.NullKeyword: + type = TOKEN_VALUE_NULL; + lastWasColon = false; + break; + case SyntaxKind.StringLiteral: + const currentParent = parents ? parents.type : JSONParent.Object; + const inArray = currentParent === JSONParent.Array; + type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME; + lastWasColon = false; + break; + case SyntaxKind.NumericLiteral: + type = TOKEN_VALUE_NUMBER; + lastWasColon = false; + break; + } + + // comments, iff enabled + if (comments) { + switch (kind) { + case SyntaxKind.LineCommentTrivia: + type = TOKEN_COMMENT_LINE; + break; + case SyntaxKind.BlockCommentTrivia: + type = TOKEN_COMMENT_BLOCK; + break; + } + } + + ret.endState = new JSONState( + state.getStateData(), + (scanner.getTokenError()), + lastWasColon, + parents + ); + // @ts-ignore + ret.tokens.push({ + startIndex: offset, + scopes: type, + }); + } + + return ret; +} diff --git a/packages/semi-json-viewer-core/src/view/complete/completeWidget.ts b/packages/semi-json-viewer-core/src/view/complete/completeWidget.ts new file mode 100644 index 0000000000..61f9aa94f6 --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/complete/completeWidget.ts @@ -0,0 +1,206 @@ +import { GlobalEvents, IModelContentChangeEvent } from '../../common/emitterEvents'; +import { elt, setStyles } from '../../common/dom'; +import { JSONModel } from '../../model/jsonModel'; +import { CompletionItem, CompletionItemKind, TextEdit } from '../../service/jsonTypes'; +import { View } from '../view'; +import { Emitter, getEmitter } from '../../common/emitter'; +import { doValidate, parseJsonAst } from '../../service/jsonService'; +import { JSONCompletion } from '../../service/completion'; +import { SelectionModel } from '../../model/selectionModel'; +import { Position } from '../../common/position'; + +/** + * CompleteWidget 类用于管理 JSON Viewer 中的补全功能 + */ +export class CompleteWidget { + private _view: View; + private _jsonModel: JSONModel; + private _selectionModel: SelectionModel; + private _container: HTMLElement; + private _suggestionsContainer: HTMLElement; + private _selectedIndex: number = 0; + private _suggestions: CompletionItem[] = []; + public isVisible: boolean = false; + private emitter: Emitter = getEmitter(); + + constructor(view: View, jsonModel: JSONModel, selectionModel: SelectionModel) { + this._view = view; + this._jsonModel = jsonModel; + this._selectionModel = selectionModel; + + this._container = this.createCompleteContainer(); + this._suggestionsContainer = this.createSuggestionsContainer(); + this._container.appendChild(this._suggestionsContainer); + this._view.jsonViewerDom.appendChild(this._container); + + this._attachEventListeners(); + } + + private _attachEventListeners() { + const shouldTrigger = (e: IModelContentChangeEvent): boolean => { + // 不是插入操作,不触发 + if (e.type !== 'insert') { + return false; + } + // 不是单个字符,不触发 + if (e.newText.length !== 1) { + return false; + } + // 是空白字符(空格、制表符、换行等),不触发 + if (/\s/.test(e.newText)) { + return false; + } + return true; + }; + + this.emitter.on('contentChanged', e => { + // 如果是批量操作,直接返回 + if (Array.isArray(e)) { + return; + } + + if (!shouldTrigger(e)) { + // 不符合触发条件时,隐藏补全框 + this.hide(); + return; + } + + this._fetchCompletions(); + }); + } + + private _fetchCompletions() { + const root = parseJsonAst(this._jsonModel); + const position = { + lineNumber: this._jsonModel.lastChangeBufferPos.lineNumber, + column: this._jsonModel.lastChangeBufferPos.column, + } as Position; + new JSONCompletion(this._view.options?.completionOptions || null) + .doCompletion(this._jsonModel, position, root) + .then(completions => { + this._suggestions = completions.items || []; + this.show(); + }); + } + + private _calculatePosition(): { x: number; y: number } { + const selection = window.getSelection(); + if (!selection || !selection.rangeCount) return { x: 0, y: 0 }; + + const range = selection.getRangeAt(0); + const rect = range.getBoundingClientRect(); + + // 获取编辑器容器的位置 + const editorRect = this._view.contentDom.getBoundingClientRect(); + + // 计算补全框的位置(相对于编辑器容器) + const x = rect.left - editorRect.left + 50; + const y = rect.bottom - editorRect.top; + return { x, y }; + } + + private createCompleteContainer(): HTMLElement { + const className = 'semi-json-viewer-complete-container'; + const container = elt('div', className); + setStyles(container, { + display: 'none', + }); + return container; + } + + private createSuggestionsContainer(): HTMLElement { + const className = 'semi-json-viewer-complete-suggestions-container'; + const container = elt('div', className); + setStyles(container, { + maxHeight: '200px', + overflowY: 'auto', + }); + return container; + } + + public show() { + if (this._suggestions.length === 0) { + return; + } + const { x, y } = this._calculatePosition(); + if (x < 0 || y < 0) { + return; + } + this.isVisible = true; + // 更新位置和内容 + setStyles(this._container, { + left: `${x}px`, + top: `${y}px`, + display: 'block', + }); + + // 清空并添加新的建议 + this._suggestionsContainer.innerHTML = ''; + this._renderCompletions(); + } + + public _handleKeyDown = (e: KeyboardEvent) => { + switch (e.key) { + case 'ArrowDown': + e.preventDefault(); + this._selectedIndex = (this._selectedIndex + 1) % this._suggestions.length; + this._renderCompletions(); + break; + case 'ArrowUp': + e.preventDefault(); + this._selectedIndex = (this._selectedIndex - 1 + this._suggestions.length) % this._suggestions.length; + this._renderCompletions(); + break; + case 'Enter': + case 'Tab': + e.preventDefault(); + const selectedItem = this._suggestions[this._selectedIndex]; + const { textEdit } = selectedItem; + if (!textEdit) { + return; + } + const { range } = textEdit; + const startOffset = this._jsonModel.getOffsetAt(range.startLineNumber, range.startColumn); + + const endOffset = this._jsonModel.getOffsetAt(range.endLineNumber, range.endColumn); + + const op: IModelContentChangeEvent = { + type: 'replace', + range: { + startLineNumber: range.startLineNumber, + startColumn: range.startColumn, + endLineNumber: range.endLineNumber, + endColumn: range.endColumn, + }, + rangeLength: endOffset - startOffset, + rangeOffset: startOffset, + oldText: this._jsonModel.getValueInRange(range), + newText: textEdit?.newText || '', + }; + this._jsonModel.applyOperation(op); + this.hide(); + break; + } + }; + + private _renderCompletions() { + const className = 'semi-json-viewer-complete-suggestions-item'; + this._suggestionsContainer.innerHTML = this._suggestions + .map( + (item, index) => ` +

  • + ${item.label} +
  • + ` + ) + .join(''); + } + + public hide() { + this.isVisible = false; + this._container.style.display = 'none'; + this._suggestions = []; + } +} diff --git a/packages/semi-json-viewer-core/src/view/edit/editWidget.ts b/packages/semi-json-viewer-core/src/view/edit/editWidget.ts new file mode 100644 index 0000000000..ddbbddc4a4 --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/edit/editWidget.ts @@ -0,0 +1,413 @@ +import { SelectionModel } from '../../model/selectionModel'; +import { View } from '../view'; +import { JSONModel } from '../../model/jsonModel'; +import { applyEdits, Edit } from 'jsonc-parser'; +import { getJsonWorkerManager, JsonWorkerManager } from '../../worker/jsonWorkerManager'; +import { FoldingModel } from '../../model/foldingModel'; +import { Emitter, getEmitter } from '../../common/emitter'; +import { GlobalEvents, IModelContentChangeEvent } from '../../common/emitterEvents'; +import { Range } from '../../common/range'; +import { IndentAction, processJsonEnterAction } from './getEnterAction'; +import { firstNonWhitespaceIndex, getLeadingWhitespace } from '../../common/strings'; +/** + * EditWidget 类用于管理 JSON Viewer 中的编辑功能 + */ +export class EditWidget { + private _view: View; + private _selectionModel: SelectionModel; + private _jsonModel: JSONModel; + private _foldingModel: FoldingModel; + private _autoClosingPairs: Record = { + '{': '}', + '[': ']', + '(': ')', + '"': '"', + }; + private emitter: Emitter = getEmitter(); + constructor( + view: View, + jsonModel: JSONModel, + selectionModel: SelectionModel, + foldingModel: FoldingModel, + private _jsonWorkerManager: JsonWorkerManager = getJsonWorkerManager() + ) { + this._view = view; + this._jsonModel = jsonModel; + this._selectionModel = selectionModel; + this._foldingModel = foldingModel; + + this.attachEventListeners(); + } + + private attachEventListeners() { + this._jsonWorkerManager.validate().then(result => { + this.emitter.emit('problemsChanged', { + problems: result.problems, + root: result.root, + }); + }); + + this._view.contentDom.addEventListener('beforeinput', (e: InputEvent) => { + this._handleBeforeInput(e); + }); + + this._view.contentDom.addEventListener('keydown', (e: KeyboardEvent) => { + this._handleKeyDown(e); + }); + } + + private _handleBeforeInput(e: InputEvent) { + e.preventDefault(); + this._selectionModel.updateFromSelection(); + const startRow = this._selectionModel.startRow; + const startCol = this._selectionModel.startCol; + const endRow = this._selectionModel.endRow; + const endCol = this._selectionModel.endCol; + const startOffset = this._jsonModel.getOffsetAt(startRow, startCol); + const endOffset = this._jsonModel.getOffsetAt(endRow, endCol); + const op: IModelContentChangeEvent = { + type: 'insert', + range: { + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + }, + rangeOffset: startOffset, + rangeLength: endOffset - startOffset, + oldText: '', + newText: '', + }; + + switch (e.inputType) { + case 'insertText': + if (this._selectionModel.isCollapsed) { + op.type = 'insert'; + } else { + op.type = 'replace'; + } + op.newText = e.data || ''; + op.oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + if (this._autoClosingPairs[op.newText]) { + op.newText += this._autoClosingPairs[op.newText]; + op.keepPosition = { + lineNumber: startRow, + column: endCol + 1, + }; + } + break; + case 'insertParagraph': + op.newText = '\n'; + op.keepPosition = { + lineNumber: startRow + 1, + column: 1, + }; + const enterAction = processJsonEnterAction(this._jsonModel, { + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + if (enterAction) { + if (enterAction.indentAction === IndentAction.Indent) { + op.newText = '\n' + this.normalizeIndentation(enterAction.appendText + enterAction.indentation) || ''; + op.keepPosition = { + lineNumber: startRow + 1, + column: enterAction.appendText.length + enterAction.indentation.length + 1, + }; + } else { + const normalIndent = this.normalizeIndentation(enterAction.indentation); + const increasedIndent = this.normalizeIndentation(enterAction.indentation + enterAction.appendText); + op.newText = '\n' + increasedIndent + '\n' + normalIndent; + op.keepPosition = { + lineNumber: startRow + 1, + column: increasedIndent.length + 1, + }; + } + } else { + const lineText = this._jsonModel.getLineContent(startRow); + const indentation = getLeadingWhitespace(lineText).substring(0, startCol - 1); + op.newText = '\n' + this.normalizeIndentation(indentation) || ''; + op.keepPosition = { + lineNumber: startRow + 1, + column: indentation.length + 1, + }; + } + break; + case 'deleteContentBackward': + let oldText = ''; + if (this._selectionModel.isCollapsed) { + op.rangeOffset = startOffset - 1; + oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: startCol - 1, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + } else { + oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + } + op.oldText = oldText; + op.type = 'delete'; + op.rangeLength = oldText.length; + break; + case 'insertFromPaste': + const pasteData = e.dataTransfer?.getData('text/plain'); + op.type = 'replace'; + op.newText = pasteData || ''; + op.oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + break; + } + if (this._selectionModel.isSelectedAll) { + op.range = { + startLineNumber: 1, + startColumn: 1, + endLineNumber: this._jsonModel.getLineCount(), + endColumn: this._jsonModel.getLineLength(this._jsonModel.getLineCount()), + }; + op.rangeOffset = 0; + op.rangeLength = this._jsonModel.getValue().length; + op.oldText = this._jsonModel.getValue(); + } + this._selectionModel.isSelectedAll = false; + + this._jsonModel.applyOperation(op); + } + + public format() { + this._jsonWorkerManager + .formatJson( + this._view.options?.formatOptions || { + tabSize: 2, + insertSpaces: true, + } + ) + .then((edits: Edit[]) => { + const newValue = applyEdits(this._jsonModel.getValue(), edits); + const op: IModelContentChangeEvent = { + type: 'replace', + range: { + startLineNumber: 1, + startColumn: 1, + endLineNumber: this._jsonModel.getLineCount(), + endColumn: this._jsonModel.getLineLength(this._jsonModel.getLineCount()) + 1, + }, + rangeOffset: 0, + rangeLength: this._jsonModel.getValue().length, + oldText: this._jsonModel.getValue(), + newText: newValue, + }; + this._jsonModel.applyOperation(op); + }); + } + + private normalizeIndentation(str: string) { + const indentSize = this._view.options?.formatOptions?.tabSize || 4; + const insertSpaces = !!this._view.options?.formatOptions?.insertSpaces; + let firstIndex = firstNonWhitespaceIndex(str); + if (firstIndex === -1) { + firstIndex = str.length; + } + return ( + this._normalizeIndentationFromWhitespace(str.substring(0, firstIndex), indentSize, insertSpaces) + + str.substring(firstIndex) + ); + } + + private _normalizeIndentationFromWhitespace(str: string, indentSize: number, insertSpaces: boolean) { + let spacesCnt = 0; + for (let i = 0; i < str.length; i++) { + if (str.charAt(i) === '\t') { + spacesCnt = this.nextIndentTabStop(spacesCnt, indentSize); + } else { + spacesCnt++; + } + } + + let result = ''; + if (!insertSpaces) { + const tabsCnt = Math.floor(spacesCnt / indentSize); + spacesCnt = spacesCnt % indentSize; + for (let i = 0; i < tabsCnt; i++) { + result += '\t'; + } + } + + for (let i = 0; i < spacesCnt; i++) { + result += ' '; + } + + return result; + } + + private nextIndentTabStop(spacesCnt: number, indentSize: number) { + return spacesCnt + indentSize - (spacesCnt % indentSize); + } + + private _handleKeyDown(e: KeyboardEvent) { + this._selectionModel.updateFromSelection(); + const startRow = this._selectionModel.startRow; + const startCol = this._selectionModel.startCol; + const endRow = this._selectionModel.endRow; + const endCol = this._selectionModel.endCol; + const startOffset = this._jsonModel.getOffsetAt(startRow, startCol); + const endOffset = this._jsonModel.getOffsetAt(endRow, endCol); + switch (e.key) { + case 'Tab': + if (this._view.completeWidget.isVisible) { + e.preventDefault(); + this._view.completeWidget._handleKeyDown(e); + return; + } + e.preventDefault(); + let insertText = ''; + + if (this._view.options?.formatOptions?.insertSpaces) { + const tabSize = this._view.options?.formatOptions?.tabSize || 4; + for (let i = 0; i < tabSize; i++) { + insertText += ' '; + } + } else { + insertText = '\t'; + } + const op: IModelContentChangeEvent = { + type: 'insert', + range: { + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + }, + rangeOffset: startOffset, + rangeLength: endOffset - startOffset, + oldText: '', + newText: insertText, + }; + this._jsonModel.applyOperation(op); + break; + case 'f': + if (e.shiftKey && e.metaKey) { + e.preventDefault(); + this.format(); + } + break; + case 'ArrowRight': + case 'ArrowLeft': + if (this._view.completeWidget.isVisible) { + this._view.completeWidget.hide(); + } + break; + case 'ArrowDown': + case 'ArrowUp': + if (this._view.completeWidget.isVisible) { + e.preventDefault(); + this._view.completeWidget._handleKeyDown(e); + } + break; + case 'Enter': + if (this._view.completeWidget.isVisible) { + e.preventDefault(); + this._view.completeWidget._handleKeyDown(e); + } + break; + case 'a': + if (e.metaKey) { + this._selectionModel.isSelectedAll = true; + } + break; + case 'x': + if (e.metaKey) { + e.preventDefault(); + this._cutHandler(); + } + break; + case 'z': + if (e.metaKey && !e.shiftKey) { + e.preventDefault(); + this._jsonModel.undo(); + } else { + e.preventDefault(); + this._jsonModel.redo(); + } + break; + } + } + + private _cutHandler() { + const startRow = this._selectionModel.startRow; + const startCol = this._selectionModel.startCol; + const endRow = this._selectionModel.endRow; + const endCol = this._selectionModel.endCol; + let startOffset; + let oldText = ''; + const op: IModelContentChangeEvent = { + type: 'replace', + range: { + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + }, + rangeOffset: 0, + rangeLength: 0, + oldText: '', + newText: '', + }; + if (!this._selectionModel.isCollapsed) { + oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: startCol, + endLineNumber: endRow, + endColumn: endCol, + } as Range); + startOffset = this._jsonModel.getOffsetAt(startRow, startCol); + } else { + oldText = this._jsonModel.getValueInRange({ + startLineNumber: startRow, + startColumn: 1, + endLineNumber: endRow, + endColumn: this._jsonModel.getLineLength(endRow) + 1, + } as Range); + op.range = { + startLineNumber: startRow, + startColumn: 1, + endLineNumber: endRow, + endColumn: this._jsonModel.getLineLength(endRow) + 1, + }; + startOffset = this._jsonModel.getOffsetAt(startRow, 1); + } + + op.oldText = oldText; + op.rangeOffset = startOffset; + op.rangeLength = oldText.length; + + if (this._selectionModel.isSelectedAll) { + op.range = { + startLineNumber: 1, + startColumn: 1, + endLineNumber: this._jsonModel.getLineCount(), + endColumn: this._jsonModel.getLineLength(this._jsonModel.getLineCount()) + 1, + }; + op.rangeOffset = 0; + op.rangeLength = this._jsonModel.getValue().length; + op.oldText = this._jsonModel.getValue(); + } + navigator.clipboard.writeText(op.oldText); + this._jsonModel.applyOperation(op); + } +} diff --git a/packages/semi-json-viewer-core/src/view/edit/getEnterAction.ts b/packages/semi-json-viewer-core/src/view/edit/getEnterAction.ts new file mode 100644 index 0000000000..82c27311d4 --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/edit/getEnterAction.ts @@ -0,0 +1,89 @@ +/** based on https://github.com/microsoft/vscode with modifications for custom requirements */ +import { JSONModel } from '../../model/jsonModel'; +import { Range } from '../../common/range'; +import * as strings from '../../common/strings'; +export enum IndentAction { + None = 0, + Indent = 1, + IndentOutdent = 2, + Outdent = 3, +} + +interface JsonEnterResult { + indentAction: IndentAction; + appendText?: string; + removeText?: number +} + +export function getIndentationAtPosition(model: JSONModel, lineNumber: number, column: number) { + const lineText = model.getLineContent(lineNumber); + let indentation = strings.getLeadingWhitespace(lineText); + if (indentation.length > column - 1) { + indentation = indentation.substring(0, column - 1); + } + return indentation; +} + +export function processJsonEnterAction(model: JSONModel, range: Range) { + // 获取上下文信息 + const currentLineText = model.getLineContent(range.startLineNumber); + const beforeText = currentLineText.substring(0, range.startColumn - 1); + const afterText = currentLineText.substring(range.startColumn - 1); + const previousLineText = range.startLineNumber > 1 ? model.getLineContent(range.startLineNumber - 1) : ''; + + // 获取回车处理结果 + const enterResult: JsonEnterResult | null = onEnter(beforeText, afterText, previousLineText); + if (!enterResult) { + return null; + } + const indentAction = enterResult.indentAction; + let appendText = enterResult.appendText; + const removeText = enterResult.removeText || 0; + if (!appendText) { + if (indentAction === IndentAction.Indent || indentAction === IndentAction.IndentOutdent) { + appendText = '\t'; + } else { + appendText = ''; + } + } else if (indentAction === IndentAction.Indent) { + appendText = '\t' + appendText; + } + + let indentation = getIndentationAtPosition(model, range.startLineNumber, range.startColumn); + if (removeText) { + indentation = indentation.substring(0, indentation.length - removeText); + } + + return { + indentAction: indentAction, + appendText: appendText, + removeText: removeText, + indentation: indentation, + }; +} + +function onEnter(beforeText: string, afterText: string, previousLineText: string) { + const brackets = [ + { open: '{', openRegExp: /\{\s*$/, close: '}', closeRegExp: /^\s*\}/ }, + { open: '[', openRegExp: /\[\s*$/, close: ']', closeRegExp: /^\s*\]/ }, + ]; + if (beforeText.length > 0 && afterText.length > 0) { + for (let i = 0, len = brackets.length; i < len; i++) { + const bracket = brackets[i]; + if (bracket.openRegExp.test(beforeText) && bracket.closeRegExp.test(afterText)) { + return { indentAction: IndentAction.IndentOutdent }; + } + } + } + + if (beforeText.length > 0) { + for (let i = 0, len = brackets.length; i < len; i++) { + const bracket = brackets[i]; + if (bracket.openRegExp.test(beforeText)) { + return { indentAction: IndentAction.Indent }; + } + } + } + + return null; +} diff --git a/packages/semi-json-viewer-core/src/view/fold/foldWidget.ts b/packages/semi-json-viewer-core/src/view/fold/foldWidget.ts new file mode 100644 index 0000000000..faee0caca4 --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/fold/foldWidget.ts @@ -0,0 +1,99 @@ +import { elt, setStyles } from '../../common/dom'; +import { View } from '../view'; +import { FoldingModel } from '../../model/foldingModel'; + +/** + * FoldWidget 类用于管理 JSON Viewer 中的折叠功能 + */ +export class FoldWidget { + private _view: View; + private _foldingModel: FoldingModel; + + constructor(view: View, foldingModel: FoldingModel) { + this._view = view; + this._foldingModel = foldingModel; + this._attachEventListeners(); + } + + private _attachEventListeners() { + this._view.lineScrollDom.addEventListener('mouseover', e => { + this._handleLineNumberHover(e); + }); + this._view.lineScrollDom.addEventListener('mouseleave', () => { + this._handleLineNumberContainerLeave(); + }); + } + + private _handleLineNumberHover(e: MouseEvent) { + this._showFoldingIcon(); + } + + private _handleLineNumberContainerLeave() { + this.removeAllFoldingIcons(); + } + + private _showFoldingIcon() { + const lineNumberElement = this._view.lineScrollDom.children; + for (let i = 0; i < lineNumberElement.length; i++) { + const element: HTMLElement = lineNumberElement[i] as HTMLElement; + if (this._foldingModel.isFoldable(Number(element.dataset.lineNumber))) { + element.appendChild(this._createFoldingIcon(Number(element.dataset.lineNumber))); + } + } + } + + private _createFoldSvg(isCollapsed: boolean): SVGElement { + const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + svg.setAttribute('viewBox', '0 0 24 24'); + svg.setAttribute('fill', 'none'); + svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); + svg.setAttribute('width', '1em'); + svg.setAttribute('height', '1em'); + if (isCollapsed) { + svg.setAttribute('transform', 'rotate(270)'); + } + const path = document.createElementNS('http://www.w3.org/2000/svg', 'path'); + const d = 'M21.8329 6.59139L12.8063 18.9004C12.4068 19.4452 11.5931 19.4452 11.1935 18.9004L2.16693 6.59139C1.68255 5.93086 2.15424 5.00003 2.97334 5.00003L21.0265 5.00003C21.8456 5.00003 22.3173 5.93087 21.8329 6.59139Z'; + path.setAttribute('d', d); + path.setAttribute('fill', 'var(--semi-color-tertiary)'); + svg.appendChild(path); + return svg; + } + + private _createFoldingIcon(lineNumber: number): HTMLElement { + const foldingIconClass = 'semi-json-viewer-folding-icon'; + + const foldingIcon = elt('span', foldingIconClass); + const isCollapsed = this._foldingModel.isCollapsed(lineNumber); + foldingIcon.appendChild(this._createFoldSvg(isCollapsed)); + setStyles(foldingIcon, { + position: 'absolute', + right: '0', + top: '0', + width: '40%', + height: '100%', + cursor: 'pointer', + zIndex: '1', + userSelect: 'none', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }); + + foldingIcon.addEventListener('mousedown', e => { + e.preventDefault(); // 防止文本选择 + e.stopPropagation(); + this._foldingModel.toggleFoldingRange(lineNumber); + this._view.scalingCellSizeAndPositionManager.resetCell(0); + this._view.layout(); + }); + + return foldingIcon; + } + + removeAllFoldingIcons() { + const foldingIconClass = 'semi-json-viewer-folding-icon'; + const foldingIcons = this._view.lineScrollDom.querySelectorAll(`.${foldingIconClass}`); + foldingIcons.forEach(icon => icon.remove()); + } +} diff --git a/packages/semi-json-viewer-core/src/view/hover/hoverWidget.ts b/packages/semi-json-viewer-core/src/view/hover/hoverWidget.ts new file mode 100644 index 0000000000..e6dbf2fbff --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/hover/hoverWidget.ts @@ -0,0 +1,121 @@ +import { View } from '../view'; +import { Emitter, getEmitter } from '../../common/emitter'; +import { elt, setStyles } from '../../common/dom'; +import { GlobalEvents } from '../../common/emitterEvents'; +/** + * HoverWidget 类用于管理 JSON Viewer 中的悬浮提示功能 + * 当鼠标悬停在字符串值上时,显示一个自定义的提示框 + */ +export class HoverWidget { + private _view: View; + private _hoverDom: HTMLElement | null = null; + private _tooltipDom: HTMLElement; + private _hoverTimer: number | null = null; + private emitter: Emitter = getEmitter(); + + constructor(view: View) { + this._view = view; + + this._tooltipDom = this._createTooltipDom(); + this._view.jsonViewerDom.appendChild(this._tooltipDom); + this._attachEventListeners(); + } + + private _attachEventListeners() { + this._view.contentDom.addEventListener('mousemove', e => { + if (e.target instanceof HTMLSpanElement && e.target.classList.contains('semi-json-viewer-string-value')) { + if (this._hoverDom === e.target) { + return; + } + this._clearHoverTimer(); + this._hideTooltip(); + + this._hoverDom = e.target; + this._hoverTimer = window.setTimeout(() => { + if (this._hoverDom) { + this.emitter.emit('hoverNode', { + value: this._hoverDom.textContent ?? '', + target: this._hoverDom, + }); + } + }, 700); + } + }); + + this._view.contentDom.addEventListener('mouseout', e => { + const relatedTarget = e.relatedTarget as Node; + if (!this._tooltipDom.contains(relatedTarget)) { + this._clearHoverTimer(); + this._hideTooltip(); + } + }); + + this._tooltipDom.addEventListener('mouseleave', e => { + const relatedTarget = e.relatedTarget as Node; + if (!this._hoverDom?.contains(relatedTarget)) { + this._hideTooltip(); + } + }); + + this.emitter.on('renderHoverNode', e => { + this.render(e.el); + }); + } + + private _clearHoverTimer() { + if (this._hoverTimer) { + window.clearTimeout(this._hoverTimer); + this._hoverTimer = null; + } + } + + private _hideTooltip() { + setStyles(this._tooltipDom, { + visibility: 'hidden', + }); + this._tooltipDom.innerHTML = ''; + this._hoverDom = null; + } + + private _createTooltipDom() { + const div = elt('div', 'hover-container'); + setStyles(div, { + visibility: 'hidden', + position: 'absolute', + zIndex: '1000', + }); + return div; + } + + render(el: HTMLElement) { + if (!this._hoverDom) return; + this._tooltipDom.innerHTML = ''; + this._tooltipDom.appendChild(el); + + // 获取必要的位置信息 + const hoverRect = this._hoverDom.getBoundingClientRect(); + const editorRect = this._view.contentDom.getBoundingClientRect(); + const tooltipRect = this._tooltipDom.getBoundingClientRect(); + + // 计算水平居中位置 + let left = hoverRect.left - editorRect.left + (hoverRect.width + tooltipRect.width) / 2; + // 确保不会超出左边界 + left = Math.max(5, left); + // 确保不会超出右边界 + left = Math.min(left, editorRect.width - tooltipRect.width - 5); + + // 默认显示在上方,距离元素5px + let top = hoverRect.top - editorRect.top - tooltipRect.height; + + // 如果超出顶部,则显示在下方 + if (hoverRect.top - tooltipRect.height - 5 < editorRect.top) { + top = hoverRect.top - editorRect.top + hoverRect.height; + } + + setStyles(this._tooltipDom, { + visibility: 'visible', + top: `${top}px`, + left: `${left}px`, + }); + } +} diff --git a/packages/semi-json-viewer-core/src/view/search/searchWidget.ts b/packages/semi-json-viewer-core/src/view/search/searchWidget.ts new file mode 100644 index 0000000000..b740617bca --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/search/searchWidget.ts @@ -0,0 +1,153 @@ +import { FindMatch } from '../../common/model'; +import { View } from '../view'; +import { JSONModel } from '../../model/jsonModel'; +import { IModelContentChangeEvent } from '../../common/emitterEvents'; + +/** + * SearchWidget 类用于管理 JSON Viewer 中的查找和替换功能 + */ +export class SearchWidget { + private _view: View; + private _searchInput: HTMLInputElement; + private _replaceInput: HTMLInputElement; + private _container: HTMLElement; + private _jsonModel: JSONModel; + //TODO: 修改searchResults存储数据结构 + public searchResults: FindMatch[] | null = null; + public _currentResultIndex: number = -1; + public matchCase: boolean = false; + public wordSeparators: string | null = null; + public isRegex: boolean = false; + private _searchDiv: HTMLElement; + private _replaceDiv: HTMLElement; + + constructor(view: View, jsonModel: JSONModel) { + this._view = view; + this._jsonModel = jsonModel; + } + + public search(searchText: string, caseSensitive: boolean, wholeWord: boolean, regex: boolean): void { + this._currentResultIndex = -1; + const isRegex = regex; + const matchCase = caseSensitive; + const wordSeparators = !wholeWord ? this.wordSeparators : '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'; + const searchScope = null; // 搜索整个文档 + const captureMatches = false; + const limitResultCount = Infinity; + this.searchResults = this._jsonModel.findMatches( + searchText, + searchScope, + isRegex, + matchCase, + wordSeparators, + captureMatches, + limitResultCount + ); + + this._view.layout(); + } + + public replace(replaceText: string): void { + if (!replaceText || !this.searchResults) return; + if (this._currentResultIndex < 0) { + this._currentResultIndex = 0; + } + const currentMatch = this.searchResults[this._currentResultIndex]; + const startOffset = this._jsonModel.getOffsetAt( + currentMatch.range.startLineNumber, + currentMatch.range.startColumn + ); + const endOffset = this._jsonModel.getOffsetAt( + currentMatch.range.endLineNumber, + currentMatch.range.endColumn + ); + const op: IModelContentChangeEvent = { + range: currentMatch.range, + newText: replaceText, + oldText: this._jsonModel.getValueInRange(currentMatch.range), + type: 'replace', + rangeOffset: startOffset, + rangeLength: endOffset - startOffset, + }; + this.searchResults.splice(this._currentResultIndex, 1); + + this._jsonModel.applyOperation(op); + } + + public replaceAll(replaceText: string): void { + if (!replaceText || !this.searchResults) return; + const op: IModelContentChangeEvent[] = []; + for (let i = this.searchResults.length - 1; i >= 0; i--) { + const match = this.searchResults[i]; + const startOffset = this._jsonModel.getOffsetAt(match.range.startLineNumber, match.range.startColumn); + const endOffset = this._jsonModel.getOffsetAt(match.range.endLineNumber, match.range.endColumn); + op.push({ + range: match.range, + newText: replaceText, + oldText: this._jsonModel.getValueInRange(match.range), + type: 'replace', + rangeOffset: startOffset, + rangeLength: endOffset - startOffset, + }); + } + this.searchResults = null; + this._jsonModel.applyOperation(op); + } + + public navigateResults(direction: number): void { + if (!this.searchResults || this.searchResults.length === 0) return; + + this._currentResultIndex += direction; + if (this._currentResultIndex < 0) { + this._currentResultIndex = this.searchResults.length - 1; + } else if (this._currentResultIndex >= this.searchResults.length) { + this._currentResultIndex = 0; + } + const currentMatch = this.searchResults[this._currentResultIndex]; + if (!currentMatch) return; + if ( + currentMatch.range.startLineNumber > this._view.startLineNumber + this._view.visibleLineCount || + currentMatch.range.startLineNumber < this._view.startLineNumber + ) { + this._view.scrollToLine(currentMatch.range.startLineNumber); + } else { + this._view.layout(); + } + } + + public binarySearchByLine(targetLine: number): FindMatch[] | null { + const matches: FindMatch[] = []; + if (!this.searchResults) return null; + // 二分查找第一个匹配的位置 + let left = 0; + let right = this.searchResults.length - 1; + + while (left <= right) { + const mid = Math.floor((left + right) / 2); + const currentLine = this.searchResults[mid].range.startLineNumber; + + if (currentLine === targetLine) { + // 找到匹配项,收集所有相同行号的结果 + let i = mid; + while (i >= 0 && this.searchResults[i].range.startLineNumber === targetLine) { + matches.unshift(this.searchResults[i]); + i--; + } + i = mid + 1; + while (i < this.searchResults.length && this.searchResults[i].range.startLineNumber === targetLine) { + matches.push(this.searchResults[i]); + i++; + } + return matches; + } + + if (currentLine < targetLine) { + left = mid + 1; + } else { + right = mid - 1; + } + } + + return matches; + } +} diff --git a/packages/semi-json-viewer-core/src/view/view.ts b/packages/semi-json-viewer-core/src/view/view.ts new file mode 100644 index 0000000000..420bcd7def --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/view.ts @@ -0,0 +1,493 @@ +import { JSONModel } from '../model/jsonModel'; +import { elt, setStyles } from '../common/dom'; +import { Token } from '../tokens/tokenize'; +import { Emitter, getEmitter } from '../common/emitter'; +import { SelectionModel } from '../model/selectionModel'; +import { JsonViewerOptions } from '../json-viewer/jsonViewer'; +import { getJsonWorkerManager, JsonWorkerManager } from '../worker/jsonWorkerManager'; +import { FoldingModel } from '../model/foldingModel'; +import { SearchWidget } from './search/searchWidget'; +import { EditWidget } from './edit/editWidget'; +import { FindMatch } from '../common/model'; +import { FoldWidget } from './fold/foldWidget'; +import { TokenizationJsonModelPart } from '../tokens/tokenizationJsonModelPart'; +import { ScalingCellSizeAndPositionManager } from './virtualized/ScalingCellSizeAndPositionManager'; +import { CompleteWidget } from './complete/completeWidget'; +import { HoverWidget } from './hover/hoverWidget'; +import { GlobalEvents } from '../common/emitterEvents'; +//TODO 实现ViewModel抽离代码 + +/** + * View 类用于管理 JSON Viewer 的视图 + */ +export class View { + private _jsonModel: JSONModel; + private _selectionModel: SelectionModel; + private _foldingModel: FoldingModel; + + private _options: JsonViewerOptions | undefined; + public _lineHeight: number; + + private _container: HTMLElement; + private _jsonViewerDom: HTMLElement; + private _lineNumberDom: HTMLElement; + private _lineScrollDom: HTMLElement; + private _contentDom: HTMLElement; + private _scrollDom: HTMLElement; + + public startLineNumber: number = 1; + public visibleLineCount: number = 0; + + private _verticalOffsetAdjustment: number = 0; + + private _searchWidget: SearchWidget; + private _editWidget: EditWidget; + private _foldWidget: FoldWidget; + private _completeWidget: CompleteWidget; + private _hoverWidget: HoverWidget; + private _jsonWorkerManager: JsonWorkerManager = getJsonWorkerManager(); + private _tokenizationJsonModelPart: TokenizationJsonModelPart; + private _scalingCellSizeAndPositionManager: ScalingCellSizeAndPositionManager; + + private _measuredHeights: { [index: number]: number } = {}; + + private emitter: Emitter = getEmitter(); + + constructor(container: HTMLElement, model: JSONModel, options?: JsonViewerOptions) { + this._container = container; + this._jsonModel = model; + this._selectionModel = new SelectionModel(1, 0, this, model); + this._foldingModel = new FoldingModel(model); + + this._lineHeight = options?.lineHeight || 20; + this._options = options; + + this._jsonViewerDom = this.createRenderContainer(); + this._lineNumberDom = this.createLineNumberContainer(); + this._contentDom = this.createContentContainer(); + this._scrollDom = this.createScrollElement(); + this._lineScrollDom = this.createLineScrollContainerElement(); + + this._contentDom.appendChild(this._scrollDom); + this._lineNumberDom.appendChild(this._lineScrollDom); + this._jsonViewerDom.appendChild(this._lineNumberDom); + this._jsonViewerDom.appendChild(this._contentDom); + this._container.appendChild(this._jsonViewerDom); + + this._searchWidget = new SearchWidget(this, this._jsonModel); + this._foldWidget = new FoldWidget(this, this._foldingModel); + this._editWidget = new EditWidget(this, this._jsonModel, this._selectionModel, this._foldingModel); + this._completeWidget = new CompleteWidget(this, this._jsonModel, this._selectionModel); + this._hoverWidget = new HoverWidget(this); + + this._tokenizationJsonModelPart = new TokenizationJsonModelPart(this._jsonModel); + + this._scalingCellSizeAndPositionManager = new ScalingCellSizeAndPositionManager({ + cellCount: this._jsonModel.getLineCount(), + cellSizeGetter: ({ index }) => this.getCellSize(index), + estimatedCellSize: this._lineHeight, + }); + + this._attachEventListeners(); + } + + get tokenizationJsonModelPart() { + return this._tokenizationJsonModelPart; + } + + get contentDom() { + return this._contentDom; + } + + get jsonViewerDom() { + return this._jsonViewerDom; + } + + get scrollDom() { + return this._scrollDom; + } + + get lineScrollDom() { + return this._lineScrollDom; + } + + get options() { + return this._options; + } + + get completeWidget() { + return this._completeWidget; + } + + get editWidget() { + return this._editWidget; + } + + get scalingCellSizeAndPositionManager() { + return this._scalingCellSizeAndPositionManager; + } + + get searchWidget() { + return this._searchWidget; + } + + public dispose() { + this._container.removeChild(this._jsonViewerDom); + } + + private _attachEventListeners() { + this._jsonViewerDom.addEventListener('scroll', e => { + this.onScroll(this._jsonViewerDom.scrollTop); + }); + + this._contentDom.addEventListener('click', e => { + e.preventDefault(); + this._selectionModel.isSelectedAll = false; + this._selectionModel.updateFromSelection(); + }); + + this.emitter.on('contentChanged', () => { + this.resetScalingManagerConfigAndCell(0); + this.layout(); + }); + } + + public getLineElement(lineNumber: number): HTMLElement | null { + const visibleLineNumber = this._foldingModel.getVisibleLineNumber(lineNumber); + if ( + visibleLineNumber > this.visibleLineCount + this.startLineNumber || + visibleLineNumber < this.startLineNumber + ) + return null; + return this._scrollDom.children[ + visibleLineNumber - this._foldingModel.getVisibleLineNumber(this.startLineNumber) + ] as HTMLElement; + } + + public updateVisibleRange(start: number, end: number) { + this.startLineNumber = start; + this.visibleLineCount = end - start + 1; + } + + public onScroll(scrollTop: number) { + this._jsonViewerDom.scrollTop = scrollTop; + this.layout(); + } + + public scrollToLine(lineNumber: number): void { + const visibleLineNumber = this._foldingModel.getVisibleLineNumber(lineNumber); + const scrollTop = (visibleLineNumber - 1) * this._lineHeight; + this._contentDom.scrollTop = scrollTop; + this.onScroll(scrollTop); + } + + private createRenderContainer(): HTMLElement { + const renderContainer = elt('div', 'json-viewer-container'); + setStyles(renderContainer, { + position: 'relative', + height: '100%', + width: '100%', + overflow: 'auto', + }); + return renderContainer; + } + + private createLineNumberContainer(): HTMLElement { + const lineNumberClass = 'semi-json-viewer-line-number-container'; + const lineNumberContainer = elt('div', lineNumberClass); + setStyles(lineNumberContainer, { + position: 'absolute', + left: '0', + top: '0', + width: '50px', + }); + return lineNumberContainer; + } + + private createLineScrollContainerElement(): HTMLElement { + const lineScrollContainer = elt('div', 'line-scroll-container'); + setStyles(lineScrollContainer, { + position: 'absolute', + top: '0', + left: '0', + height: `${this._lineHeight * this._jsonModel.getLineCount()}px`, + width: '100%', + overflow: 'hidden', + }); + return lineScrollContainer; + } + + private createContentContainer(): HTMLElement { + const contentClass = 'semi-json-viewer-content-container'; + const contentContainer = elt('div', contentClass); + setStyles(contentContainer, { + position: 'absolute', + left: '50px', + top: '0', + right: '0', + overflowX: 'auto', + overflowY: 'scroll', + outline: 'none', + }); + contentContainer.contentEditable = 'true'; + contentContainer.style.caretColor = 'black'; + contentContainer.spellcheck = false; + return contentContainer; + } + + private createLineNumberElement(actualLineNumber: number, visibleLineNumber: number): HTMLElement { + const lineNumberClass = 'semi-json-viewer-line-number'; + const lineNumberElement = elt('div', lineNumberClass); + const rowDatum = this._scalingCellSizeAndPositionManager.getSizeAndPositionOfCell(visibleLineNumber); + setStyles(lineNumberElement, { + position: 'absolute', + width: '50px', + height: `${this._lineHeight}px`, + lineHeight: `${this._lineHeight}px`, + top: `${rowDatum.offset + this._verticalOffsetAdjustment}px`, + }); + const lineNumber = elt('span', 'line-number-text', { + position: 'absolute', + left: '0', + top: '0', + textAlign: 'right', + width: '60%', + height: '100%', + }); + lineNumber.innerHTML = actualLineNumber.toString(); + lineNumberElement.appendChild(lineNumber); + lineNumberElement.dataset.lineNumber = actualLineNumber.toString(); + return lineNumberElement; + } + + private createScrollElement(): HTMLElement { + const scrollEl = elt('div', 'lines-content'); + + setStyles(scrollEl, { + position: 'relative', + overflow: 'scroll', + top: '0', + left: '0', + tabSize: (this._options?.formatOptions?.tabSize || 4).toString(), + height: `${this._lineHeight * this._jsonModel.getLineCount()}px`, + }); + if (this._options?.autoWrap) { + scrollEl.style.width = '100%'; + } + return scrollEl; + } + + private createLineContentElement( + lineContent: string, + actualLineNumber: number, + visibleLineNumber: number + ): HTMLElement { + const rowDatum = this._scalingCellSizeAndPositionManager.getSizeAndPositionOfCell(visibleLineNumber); + const lineElementClass = 'semi-json-viewer-view-line'; + const lineElement = elt('div', lineElementClass); + lineElement.setAttribute('data-line-element', 'true'); + setStyles(lineElement, { + lineHeight: `${this._lineHeight}px`, + width: '100%', + position: 'absolute', + top: `${rowDatum.offset + this._verticalOffsetAdjustment}px`, + }); + if (!this._options?.autoWrap) { + lineElement.style.height = `${this._lineHeight}px`; + } + lineElement.innerHTML = lineContent; + lineElement.dataset.lineNumber = actualLineNumber.toString(); + // @ts-ignore + lineElement.lineNumber = actualLineNumber; + return lineElement; + } + + private getCellSize(index: number): number { + if (this._options?.autoWrap) { + return this._measuredHeights[index] || this._lineHeight; + } + return this._lineHeight; + } + + private _measureAndUpdateItemHeight(item: HTMLElement, index: number) { + const height = item.offsetHeight; + const width = item.textContent?.length * 10; + if (!this._options?.autoWrap && width > this._scrollDom.offsetWidth) { + this._scrollDom.style.width = `${width}px`; + } + if (height === 0) { + item.style.height = `${this._lineHeight}px`; + return; + } + if (height !== this._measuredHeights[index]) { + this._measuredHeights[index] = height; + this._scalingCellSizeAndPositionManager.resetCell(index); + this._scrollDom.style.height = `${this._scalingCellSizeAndPositionManager.getTotalSize()}px`; + } + } + + private clearContainers() { + this._lineScrollDom.innerHTML = ''; + this._scrollDom.innerHTML = ''; + } + + public resetScalingManagerConfigAndCell(index: number) { + this._scalingCellSizeAndPositionManager.configure({ + cellCount: this._jsonModel.getLineCount(), + cellSizeGetter: ({ index }) => this.getCellSize(index), + estimatedCellSize: this._lineHeight, + }); + this._scalingCellSizeAndPositionManager.resetCell(index); + } + + public layout() { + this.clearContainers(); + + const visibleLineCount = this._foldingModel.getVisibleLineCount(); + this._scalingCellSizeAndPositionManager.configure({ + cellCount: visibleLineCount, + cellSizeGetter: ({ index }) => this.getCellSize(index), + estimatedCellSize: this._lineHeight, + }); + + const visibleRange = this._scalingCellSizeAndPositionManager.getVisibleCellRange({ + containerSize: this._container.clientHeight, + offset: this._jsonViewerDom.scrollTop, + }); + + const verticalOffsetAdjustment = this._scalingCellSizeAndPositionManager.getOffsetAdjustment({ + containerSize: this._container.clientHeight, + offset: this._jsonViewerDom.scrollTop, + }); + this._verticalOffsetAdjustment = verticalOffsetAdjustment; + this.renderVisibleLines(visibleRange.start!, visibleRange.stop!); + this.updateVisibleRange(visibleRange.start! + 1, visibleRange.stop! + 1); + + this._selectionModel.toViewPosition(); + this._completeWidget.show(); + const totalSize = this._scalingCellSizeAndPositionManager.getTotalSize(); + this._scrollDom.style.height = `${totalSize}px`; + this._lineScrollDom.style.height = `${totalSize}px`; + } + + private renderVisibleLines(startVisibleLine: number, endVisibleLine: number) { + this._tokenizationJsonModelPart.forceTokenize(endVisibleLine + 1); + let actualLineNumber = this._foldingModel.getActualLineNumber(startVisibleLine + 1); + let visibleLineNumber = startVisibleLine; + while (visibleLineNumber <= endVisibleLine && actualLineNumber <= this._jsonModel.getLineCount()) { + if (!this._foldingModel.isLineCollapsed(actualLineNumber)) { + this.renderLine(actualLineNumber, visibleLineNumber); + visibleLineNumber++; + } + actualLineNumber = this._foldingModel.getNextVisibleLine(actualLineNumber); + } + } + + private renderLine(actualLineNumber: number, visibleLineNumber: number) { + // const cache = this._domCache.get(actualLineNumber); + // if (cache) { + // return; + // } + const line = this._jsonModel.getLineContent(actualLineNumber); + + const tokens = this._tokenizationJsonModelPart.getLineTokens(actualLineNumber); + + const lineNumberElement = this.renderLineNumber(actualLineNumber, visibleLineNumber); + const lineElement = this.renderLineContent(actualLineNumber, visibleLineNumber, tokens, line); + // this._domCache.set(actualLineNumber, { + // lineElement, + // lineNumberElement + // }); + } + + + private renderLineNumber(actualLineNumber: number, visibleLineNumber: number) { + const lineNumberElement = this.createLineNumberElement(actualLineNumber, visibleLineNumber); + this._lineScrollDom.appendChild(lineNumberElement); + return lineNumberElement; + } + + private renderLineContent(actualLineNumber: number, visibleLineNumber: number, tokens: Token[], line: string) { + const lineContent = this.renderTokensWithHighlight(tokens, line, actualLineNumber); + const lineElement = this.createLineContentElement(lineContent, actualLineNumber, visibleLineNumber); + this._scrollDom.appendChild(lineElement); + + // this._options?.autoWrap && + this._measureAndUpdateItemHeight(lineElement, visibleLineNumber); + return lineElement; + } + + private renderTokensWithHighlight(tokens: Token[], text: string, lineNumber: number): string { + let html = ''; + let currentOffset = 0; + + const searchResults = this._searchWidget.binarySearchByLine(lineNumber); + for (let i = 0; i < tokens.length; i++) { + const token = tokens[i]; + const start = token.startIndex; + const end = i + 1 < tokens.length ? tokens[i + 1].startIndex : text.length; + let content = text.substring(start, end); + + if (searchResults && searchResults.length > 0) { + html += this.highlightContent(content, currentOffset, searchResults, token.scopes); + } else { + content = this.escapeHtml(content); + html += `${content}`; + } + + currentOffset += content.length; + } + + return html; + } + + private highlightContent(content: string, offset: number, searchResults: FindMatch[], tokenClass: string): string { + let result = ''; + let lastIndex = 0; + + for (const match of searchResults) { + const startIndex = Math.max(0, match.range.startColumn - 1 - offset); + const endIndex = Math.min(content.length, match.range.endColumn - 1 - offset); + + if (startIndex >= content.length || endIndex <= 0) continue; + + if (startIndex > lastIndex) { + result += `${this.escapeHtml( + content.substring(lastIndex, startIndex) + )}`; + } + + const highlightedText = this.escapeHtml(content.substring(startIndex, endIndex)); + const currentMatch = this._searchWidget.searchResults?.[this._searchWidget._currentResultIndex]; + const searchResultClass = 'semi-json-viewer-search-result'; + const currentSearchResultClass = 'semi-json-viewer-current-search-result'; + if ( + match.range.startLineNumber === currentMatch?.range.startLineNumber && + match.range.endLineNumber === currentMatch?.range.endLineNumber && + match.range.startColumn === currentMatch?.range.startColumn && + match.range.endColumn === currentMatch?.range.endColumn + ) { + result += `${highlightedText}`; + } else { + result += `${highlightedText}`; + } + + lastIndex = endIndex; + } + + if (lastIndex < content.length) { + result += `${this.escapeHtml(content.substring(lastIndex))}`; + } + + return result; + } + + private escapeHtml(text: string): string { + return text + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/ /g, ' ') + .replace(/\t/g, ' '); + } +} diff --git a/packages/semi-json-viewer-core/src/view/virtualized/CellSizeAndPositionManager.ts b/packages/semi-json-viewer-core/src/view/virtualized/CellSizeAndPositionManager.ts new file mode 100644 index 0000000000..3504130827 --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/virtualized/CellSizeAndPositionManager.ts @@ -0,0 +1,213 @@ +//reference from https://github.com/bvaughn/react-virtualized +import { Alignment, CellSizeGetter, VisibleCellRange } from './types'; + +type CellSizeAndPositionManagerParams = { + cellCount: number; + cellSizeGetter: CellSizeGetter; + estimatedCellSize: number +}; + +type GetUpdatedOffsetForIndex = { + align: Alignment; + containerSize: number; + currentOffset: number; + targetIndex: number +}; + +type SizeAndPositionData = { + offset: number; + size: number +}; + +type GetVisibleCellRangeParams = { + containerSize: number; + offset: number +}; + +export class CellSizeAndPositionManager { + private _cellCount: number; + private _cellSizeGetter: CellSizeGetter; + private _estimatedCellSize: number; + + private _lastMeasuredIndex = -1; + private _cellSizeAndPositionData: Record = {}; + private _lastBatchedIndex = -1; + + constructor(params: CellSizeAndPositionManagerParams) { + this._cellCount = params.cellCount; + this._cellSizeGetter = params.cellSizeGetter; + this._estimatedCellSize = params.estimatedCellSize; + } + + areOffsetsAdjusted() { + return false; + } + + configure(params: CellSizeAndPositionManagerParams) { + this._cellCount = params.cellCount; + this._cellSizeGetter = params.cellSizeGetter; + this._estimatedCellSize = params.estimatedCellSize; + } + + getCellCount() { + return this._cellCount; + } + + getEstimatedCellSize() { + return this._estimatedCellSize; + } + + getLastMeasuredIndex() { + return this._lastMeasuredIndex; + } + + getOffsetAdjustment() { + return 0; + } + + getSizeAndPositionOfCell(index: number): SizeAndPositionData { + if (index < 0 || index >= this._cellCount) { + throw new Error('index out of bounds'); + } + + if (index > this._lastMeasuredIndex) { + const lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell(); + let offset = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size; + for (let i = this._lastMeasuredIndex + 1; i <= index; i++) { + const size = this._cellSizeGetter({ index: i }); + if (size === undefined || isNaN(size)) { + throw new Error('invalid size'); + } else if (size === null) { + this._cellSizeAndPositionData[i] = { + offset, + size: 0, + }; + this._lastBatchedIndex = index; + } else { + this._cellSizeAndPositionData[i] = { + offset, + size, + }; + offset += size; + this._lastMeasuredIndex = index; + } + } + } + return this._cellSizeAndPositionData[index]; + } + + getSizeAndPositionOfLastMeasuredCell(): SizeAndPositionData { + return this._lastMeasuredIndex >= 0 + ? this._cellSizeAndPositionData[this._lastMeasuredIndex] + : { offset: 0, size: 0 }; + } + + getTotalSize(): number { + const lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell(); + const totalSizeOfMeasuredCells = lastMeasuredCellSizeAndPosition.offset + lastMeasuredCellSizeAndPosition.size; + const numUnmeasuredCells = this._cellCount - this._lastMeasuredIndex - 1; + const totalSizeOfUnmeasuredCells = numUnmeasuredCells * this._estimatedCellSize; + return totalSizeOfMeasuredCells + totalSizeOfUnmeasuredCells; + } + + getUpdatedOffsetForIndex({ align, containerSize, currentOffset, targetIndex }: GetUpdatedOffsetForIndex) { + if (currentOffset < 0) { + return 0; + } + const datum = this.getSizeAndPositionOfCell(targetIndex); + const maxOffset = datum.offset; + const minOffset = maxOffset - containerSize + datum.size; + let idealOffset = currentOffset; + switch (align) { + case 'start': + idealOffset = maxOffset; + break; + case 'end': + idealOffset = minOffset; + break; + case 'center': + idealOffset = maxOffset - (containerSize - datum.size) / 2; + break; + default: + idealOffset = Math.max(minOffset, Math.min(maxOffset, currentOffset)); + break; + } + const totalSize = this.getTotalSize(); + return Math.max(0, Math.min(idealOffset, totalSize - containerSize)); + } + + getVisibleCellRange(params: GetVisibleCellRangeParams): VisibleCellRange { + const containerSize = params.containerSize; + let offset = params.offset; + const totalSize = this.getTotalSize(); + if (totalSize === 0) { + return {}; + } + const maxOffset = offset + containerSize; + const start = this._findNearestCell(offset); + const datum = this.getSizeAndPositionOfCell(start); + + offset = datum.offset + datum.size; + + let stop = start; + while (offset < maxOffset && stop < this._cellCount - 1) { + stop++; + offset += this.getSizeAndPositionOfCell(stop).size; + } + return { + start, + stop, + }; + } + + private _binarySearch(high: number, low: number, offset: number): number { + while (low <= high) { + const middle = low + Math.floor((high - low) / 2); + const currentOffset = this.getSizeAndPositionOfCell(middle).offset; + + if (currentOffset === offset) { + return middle; + } else if (currentOffset < offset) { + low = middle + 1; + } else if (currentOffset > offset) { + high = middle - 1; + } + } + + if (low > 0) { + return low - 1; + } else { + return 0; + } + } + + resetCell(index: number): void { + this._lastMeasuredIndex = Math.min(this._lastMeasuredIndex, index - 1); + } + + private _exponentialSearch(index: number, offset: number): number { + let interval = 1; + + while (index < this._cellCount && this.getSizeAndPositionOfCell(index).offset < offset) { + index += interval; + interval *= 2; + } + + return this._binarySearch(Math.min(index, this._cellCount - 1), Math.floor(index / 2), offset); + } + + private _findNearestCell(offset: number) { + if (isNaN(offset)) { + throw new Error('offset is NaN'); + } + offset = Math.max(0, offset); + const lastMeasuredCellSizeAndPosition = this.getSizeAndPositionOfLastMeasuredCell(); + const lastMeasuredIndex = Math.max(0, this._lastMeasuredIndex); + + if (lastMeasuredCellSizeAndPosition.offset >= offset) { + return this._binarySearch(lastMeasuredIndex, 0, offset); + } else { + return this._exponentialSearch(lastMeasuredIndex, offset); + } + } +} diff --git a/packages/semi-json-viewer-core/src/view/virtualized/ScalingCellSizeAndPositionManager.ts b/packages/semi-json-viewer-core/src/view/virtualized/ScalingCellSizeAndPositionManager.ts new file mode 100644 index 0000000000..1533536afd --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/virtualized/ScalingCellSizeAndPositionManager.ts @@ -0,0 +1,189 @@ +//reference from https://github.com/bvaughn/react-virtualized +import { CellSizeAndPositionManager } from './CellSizeAndPositionManager'; +import { CellSizeGetter, Alignment, VisibleCellRange } from './types'; + +type Params = { + maxScrollSize?: number; + cellCount: number; + cellSizeGetter: CellSizeGetter; + estimatedCellSize: number +}; + +type ContainerSizeAndOffset = { + containerSize: number; + offset: number +}; + +const DEFAULT_MAX_ELEMENT_SIZE = 1500000; +const CHROME_MAX_ELEMENT_SIZE = 1.67771e7; + +const isBrowser = () => typeof window !== 'undefined'; +// @ts-ignore +const isChrome = () => !!window.chrome; + +export const getMaxElementSize = (): number => { + if (isBrowser()) { + if (isChrome()) { + return CHROME_MAX_ELEMENT_SIZE; + } + } + return DEFAULT_MAX_ELEMENT_SIZE; +}; + +export class ScalingCellSizeAndPositionManager { + private _maxScrollSize: number; + private _cellSizeAndPositionManager: CellSizeAndPositionManager; + + constructor({ maxScrollSize = getMaxElementSize(), cellCount, cellSizeGetter, estimatedCellSize }: Params) { + this._maxScrollSize = maxScrollSize; + this._cellSizeAndPositionManager = new CellSizeAndPositionManager({ + cellCount, + cellSizeGetter, + estimatedCellSize, + }); + } + + areOffsetsAdjusted() { + return this._cellSizeAndPositionManager.getTotalSize() > this._maxScrollSize; + } + + configure(params: { cellCount: number; estimatedCellSize: number; cellSizeGetter: CellSizeGetter }) { + this._cellSizeAndPositionManager.configure(params); + } + + getCellCount(): number { + return this._cellSizeAndPositionManager.getCellCount(); + } + + getEstimatedCellSize(): number { + return this._cellSizeAndPositionManager.getEstimatedCellSize(); + } + + getLastMeasuredIndex(): number { + return this._cellSizeAndPositionManager.getLastMeasuredIndex(); + } + + getOffsetAdjustment({ containerSize, offset }: ContainerSizeAndOffset) { + const totalSize = this._cellSizeAndPositionManager.getTotalSize(); + + const safeTotalSize = this.getTotalSize(); + + const offsetPercentage = this._getOffsetPercentage({ + containerSize, + offset, + totalSize: safeTotalSize, + }); + return Math.round(offsetPercentage * (safeTotalSize - totalSize)); + } + + getTotalSize(): number { + return Math.min(this._maxScrollSize, this._cellSizeAndPositionManager.getTotalSize()); + } + getSizeAndPositionOfCell(index: number) { + return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index); + } + + getSizeAndPositionOfLastMeasuredCell() { + return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell(); + } + + getVisibleCellRange({ + containerSize, + offset, // safe + }: ContainerSizeAndOffset): VisibleCellRange { + offset = this._safeOffsetToOffset({ + containerSize, + offset, + }); + + return this._cellSizeAndPositionManager.getVisibleCellRange({ + containerSize, + offset, + }); + } + + resetCell(index: number): void { + this._cellSizeAndPositionManager.resetCell(index); + } + + getUpdatedOffsetForIndex({ + align = 'auto', + containerSize, + currentOffset, // safe + targetIndex, + }: { + align: Alignment; + containerSize: number; + currentOffset: number; + targetIndex: number + }) { + currentOffset = this._safeOffsetToOffset({ + containerSize, + offset: currentOffset, + }); + + const offset = this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({ + align, + containerSize, + currentOffset, + targetIndex, + }); + + return this._offsetToSafeOffset({ + containerSize, + offset, + }); + } + + private _getOffsetPercentage({ + containerSize, + offset, // safe + totalSize, + }: { + containerSize: number; + offset: number; + totalSize: number + }) { + return totalSize <= containerSize ? 0 : offset / (totalSize - containerSize); + } + + private _offsetToSafeOffset({ + containerSize, + offset, // unsafe + }: ContainerSizeAndOffset): number { + const totalSize = this._cellSizeAndPositionManager.getTotalSize(); + const safeTotalSize = this.getTotalSize(); + + if (totalSize === safeTotalSize) { + return offset; + } else { + const offsetPercentage = this._getOffsetPercentage({ + containerSize, + offset, + totalSize, + }); + + return Math.round(offsetPercentage * (safeTotalSize - containerSize)); + } + } + + private _safeOffsetToOffset({ + containerSize, + offset, // safe + }: ContainerSizeAndOffset): number { + const totalSize = this._cellSizeAndPositionManager.getTotalSize(); + const safeTotalSize = this.getTotalSize(); + + if (totalSize === safeTotalSize) { + return offset; + } else { + const offsetPercentage = this._getOffsetPercentage({ + containerSize, + offset, + totalSize: safeTotalSize, + }); + + return Math.round(offsetPercentage * (totalSize - containerSize)); + } + } +} diff --git a/packages/semi-json-viewer-core/src/view/virtualized/types.ts b/packages/semi-json-viewer-core/src/view/virtualized/types.ts new file mode 100644 index 0000000000..023b29f41b --- /dev/null +++ b/packages/semi-json-viewer-core/src/view/virtualized/types.ts @@ -0,0 +1,10 @@ +export type CellSizeGetter = (params: { index: number }) => number; + +export type CellSize = CellSizeGetter | number; + +export type Alignment = 'auto' | 'end' | 'start' | 'center'; + +export type VisibleCellRange = { + start?: number; + stop?: number +}; diff --git a/packages/semi-json-viewer-core/src/worker/json.worker.ts b/packages/semi-json-viewer-core/src/worker/json.worker.ts new file mode 100644 index 0000000000..4aaeb58cf6 --- /dev/null +++ b/packages/semi-json-viewer-core/src/worker/json.worker.ts @@ -0,0 +1,40 @@ +import { FormattingOptions } from 'jsonc-parser'; +import { JsonWorker } from './jsonWorker'; + +let jsonWorker: JsonWorker | null = null; + +self.onmessage = (e: MessageEvent) => { + const { method, params, messageId } = e.data; + + if (method === 'init') { + jsonWorker = new JsonWorker(params.value); + self.postMessage({ messageId, result: 'Worker initialized' }); + return; + } + + if (!jsonWorker) { + self.postMessage({ messageId, error: 'Worker not initialized' }); + return; + } + + let result; + switch (method) { + case 'updateModel': + jsonWorker.updateModel(params.op); + result = jsonWorker.getModel()?.getValue(); + break; + case 'format': + result = jsonWorker.format(params.options as FormattingOptions); + break; + case 'foldRange': + result = jsonWorker.foldRange(); + break; + case 'validate': + result = jsonWorker.validate(); + break; + default: + result = { error: 'Unknown method' }; + } + + self.postMessage({ messageId, result }); +}; diff --git a/packages/semi-json-viewer-core/src/worker/jsonWorker.ts b/packages/semi-json-viewer-core/src/worker/jsonWorker.ts new file mode 100644 index 0000000000..bc41fbcfbd --- /dev/null +++ b/packages/semi-json-viewer-core/src/worker/jsonWorker.ts @@ -0,0 +1,42 @@ +import { formatJson, getFoldingRanges, doValidate, parseJsonAst } from '../service/jsonService'; +import { JSONModel } from '../model/jsonModel'; +import { FormattingOptions } from 'jsonc-parser'; +import { createModel } from '../model'; +import { IModelContentChangeEvent } from '../common/emitterEvents'; + +export class JsonWorker { + private _model: JSONModel | null = null; + + constructor(value: string) { + this._model = createModel(value); + } + + getModel() { + return this._model; + } + + format(options: FormattingOptions) { + if (!this._model) throw new Error('Model not initialized'); + return formatJson(this._model, options); + } + + foldRange() { + if (!this._model) throw new Error('Model not initialized'); + return getFoldingRanges(this._model); + } + + validate() { + if (!this._model) throw new Error('Model not initialized'); + return doValidate(this._model); + } + + updateModel(op: IModelContentChangeEvent | IModelContentChangeEvent[]) { + this._model?.applyOperation(op); + return op; + } + + parse() { + if (!this._model) throw new Error('Model not initialized'); + return parseJsonAst(this._model); + } +} diff --git a/packages/semi-json-viewer-core/src/worker/jsonWorkerManager.ts b/packages/semi-json-viewer-core/src/worker/jsonWorkerManager.ts new file mode 100644 index 0000000000..ed764da377 --- /dev/null +++ b/packages/semi-json-viewer-core/src/worker/jsonWorkerManager.ts @@ -0,0 +1,100 @@ +import { IModelContentChangeEvent } from '../common/emitterEvents'; +import { FormattingOptions } from 'jsonc-parser'; +import { getCurrentNameSpaceId } from '../common/nameSpace'; + +//TODO 修改封装方式 + +/** + * JsonWorkerManager 类用于管理 JSON Worker + */ +type WorkerMethod = 'init' | 'updateModel' | 'format' | 'foldRange' | 'validate'; +type WorkerParams = { + value?: string; + options?: FormattingOptions; + op?: IModelContentChangeEvent | IModelContentChangeEvent[] +}; + +const workerManagerMap = new Map(); + +export class JsonWorkerManager { + private _worker: Worker; + private _callbacks: Map void>; + + constructor() { + const workerRaw = decodeURIComponent('%WORKER_RAW%'); + const blob = new Blob([workerRaw], { type: 'application/javascript' }); + const workerURL = URL.createObjectURL(blob); + this._worker = new Worker(workerURL); + this._callbacks = new Map(); + + this._worker.onmessage = this._handleWorkerMessage.bind(this); + } + + async init(value: string) { + await this._sendRequest('init', { value }); + } + + updateModel(op: IModelContentChangeEvent | IModelContentChangeEvent[]) { + return this._sendRequest('updateModel', { op }); + } + + formatJson(options: FormattingOptions) { + return this._sendRequest('format', { options }); + } + + foldRange() { + return this._sendRequest('foldRange', {}); + } + + validate() { + return this._sendRequest('validate', {}); + } + + private _sendRequest(method: WorkerMethod, params: WorkerParams): Promise { + return new Promise((resolve, reject) => { + const messageId = Date.now() + Math.random(); + this._callbacks.set(messageId, resolve); + this._worker.postMessage({ messageId, method, params }); + }); + } + + private _handleWorkerMessage(event: MessageEvent) { + const { messageId, result, error } = event.data; + const callback = this._callbacks.get(messageId); + if (callback) { + if (error) { + callback(new Error(error)); + } else { + callback(result); + } + this._callbacks.delete(messageId); + } + } + + public dispose() { + this._worker.terminate(); + this._callbacks.clear(); + } +} + +export function getJsonWorkerManager() { + const currentNameSpaceId = getCurrentNameSpaceId(); + if (!currentNameSpaceId) { + throw new Error('No active worker ID set'); + } + + let workerManager = workerManagerMap.get(currentNameSpaceId); + if (!workerManager) { + workerManager = new JsonWorkerManager(); + workerManagerMap.set(currentNameSpaceId, workerManager); + } + return workerManager; +} + +export function disposeWorkerManager(id: string) { + const workerManager = workerManagerMap.get(id); + if (workerManager) { + workerManagerMap.delete(id); + workerManager.dispose(); + } +} diff --git a/packages/semi-next/package.json b/packages/semi-next/package.json index ccdc313d35..24e0c3e826 100644 --- a/packages/semi-next/package.json +++ b/packages/semi-next/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-next", - "version": "2.70.2", + "version": "2.71.1", "description": "Plugin that support Semi Design in Next.js", "author": "伍浩威 ", "homepage": "", @@ -22,7 +22,7 @@ "typescript": "^4" }, "dependencies": { - "@douyinfe/semi-webpack-plugin": "2.70.2" + "@douyinfe/semi-webpack-plugin": "2.71.1" }, "gitHead": "eb34a4f25f002bb4cbcfa51f3df93bed868c831a" } diff --git a/packages/semi-rspack/package.json b/packages/semi-rspack/package.json index 616a5c6303..8633674f2a 100644 --- a/packages/semi-rspack/package.json +++ b/packages/semi-rspack/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-rspack-plugin", - "version": "2.70.2", + "version": "2.71.1", "description": "", "homepage": "", "license": "MIT", diff --git a/packages/semi-scss-compile/package.json b/packages/semi-scss-compile/package.json index 013d6a4b1b..c63bcf69e2 100644 --- a/packages/semi-scss-compile/package.json +++ b/packages/semi-scss-compile/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-scss-compile", - "version": "2.70.2", + "version": "2.71.1", "description": "compile semi scss to css", "author": "daiqiang@bytedance.com", "license": "MIT", diff --git a/packages/semi-theme-default/package.json b/packages/semi-theme-default/package.json index cc83beed13..3fd58051fc 100644 --- a/packages/semi-theme-default/package.json +++ b/packages/semi-theme-default/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-theme-default", - "version": "2.70.2", + "version": "2.71.1", "description": "semi-theme-default", "keywords": [ "semi-theme", diff --git a/packages/semi-ui/_utils/index.tsx b/packages/semi-ui/_utils/index.tsx index 8f6d6dd0d5..d40892eae2 100644 --- a/packages/semi-ui/_utils/index.tsx +++ b/packages/semi-ui/_utils/index.tsx @@ -1,7 +1,6 @@ import React from 'react'; import { cloneDeepWith, set, get } from 'lodash'; import warning from '@douyinfe/semi-foundation/utils/warning'; -import { findAll } from '@douyinfe/semi-foundation/utils/getHighlight'; import { isHTMLElement } from '@douyinfe/semi-foundation/utils/dom'; import semiGlobal from "./semi-global"; /** @@ -66,48 +65,6 @@ export function cloneDeep(value: any, customizer?: (value: any) => any) { return undefined; }); } - -/** - * [getHighLightTextHTML description] - * - * @param {string} sourceString [source content text] - * @param {Array} searchWords [keywords to be highlighted] - * @param {object} option - * @param {true} option.highlightTag [The tag wrapped by the highlighted content, mark is used by default] - * @param {true} option.highlightClassName - * @param {true} option.highlightStyle - * @param {boolean} option.caseSensitive - * - * @return {Array} - */ -export const getHighLightTextHTML = ({ - sourceString = '', - searchWords = [], - option = { autoEscape: true, caseSensitive: false } -}: GetHighLightTextHTMLProps) => { - const chunks: HighLightTextHTMLChunk[] = findAll({ sourceString, searchWords, ...option }); - const markEle = option.highlightTag || 'mark'; - const highlightClassName = option.highlightClassName || ''; - const highlightStyle = option.highlightStyle || {}; - return chunks.map((chunk: HighLightTextHTMLChunk, index: number) => { - const { end, start, highlight } = chunk; - const text = sourceString.substr(start, end - start); - if (highlight) { - return React.createElement( - markEle, - { - style: highlightStyle, - className: highlightClassName, - key: text + index - }, - text - ); - } else { - return text; - } - }); -}; - export interface RegisterMediaQueryOption { match?: (e: MediaQueryList | MediaQueryListEvent) => void; unmatch?: (e: MediaQueryList | MediaQueryListEvent) => void; @@ -140,25 +97,6 @@ export const registerMediaQuery = (media: string, { match, unmatch, callInInit = } return () => undefined; }; -export interface GetHighLightTextHTMLProps { - sourceString?: string; - searchWords?: string[]; - option: HighLightTextHTMLOption -} - -export interface HighLightTextHTMLOption { - highlightTag?: string; - highlightClassName?: string; - highlightStyle?: React.CSSProperties; - caseSensitive: boolean; - autoEscape: boolean -} - -export interface HighLightTextHTMLChunk { - start?: number; - end?: number; - highlight?: any -} /** * Determine whether the incoming element is a built-in icon diff --git a/packages/semi-ui/autoComplete/option.tsx b/packages/semi-ui/autoComplete/option.tsx index 6fd07a9843..76158f4075 100644 --- a/packages/semi-ui/autoComplete/option.tsx +++ b/packages/semi-ui/autoComplete/option.tsx @@ -5,7 +5,7 @@ import { isString } from 'lodash'; import { cssClasses } from '@douyinfe/semi-foundation/autoComplete/constants'; import LocaleConsumer from '../locale/localeConsumer'; import { IconTick } from '@douyinfe/semi-icons'; -import { getHighLightTextHTML } from '../_utils/index'; +import Highlight from '../highlight'; import { Locale } from '../locale/interface'; import { BasicOptionProps } from '@douyinfe/semi-foundation/autoComplete/optionFoundation'; @@ -19,15 +19,6 @@ export interface OptionProps extends BasicOptionProps { className?: string; style?: React.CSSProperties } -interface renderOptionContentArgument { - config: { - searchWords: any; - sourceString: React.ReactNode - }; - children: React.ReactNode; - inputValue: string; - prefixCls: string -} class Option extends PureComponent { static isSelectOption = true; @@ -62,9 +53,13 @@ class Option extends PureComponent { } } - renderOptionContent({ config, children, inputValue, prefixCls }: renderOptionContentArgument) { + renderOptionContent({ children, inputValue, prefixCls }) { if (isString(children) && inputValue) { - return getHighLightTextHTML(config as any); + return (); } return children; } @@ -129,13 +124,6 @@ class Option extends PureComponent { }); } - const config = { - searchWords: inputValue, - sourceString: children, - option: { - highlightClassName: `${prefixCls}-keyword` - } - }; return ( // eslint-disable-next-line jsx-a11y/interactive-supports-focus,jsx-a11y/click-events-have-key-events
    {
    ) : null} - {isString(children) ?
    {this.renderOptionContent({ children, config, inputValue, prefixCls })}
    : children} + {isString(children) ?
    {this.renderOptionContent({ children, inputValue, prefixCls })}
    : children} ); } diff --git a/packages/semi-ui/cascader/_story/cascader.stories.jsx b/packages/semi-ui/cascader/_story/cascader.stories.jsx index ecdcbcde7d..4730eae117 100644 --- a/packages/semi-ui/cascader/_story/cascader.stories.jsx +++ b/packages/semi-ui/cascader/_story/cascader.stories.jsx @@ -2442,4 +2442,32 @@ export const CustomExpandIcon = () => { /> ); +} + +export const UnRelated = () => { + const [value, setValue] = useState([ + [ "yazhou" ], + [ "beimeizhou", "meiguo"], + ]); + + const onChange = useCallback((value) => { + setValue(value); + }, []) + + const onSelect = useCallback((value) => { + console.log('onSelect', value); + }, []) + + return ( + + ) } \ No newline at end of file diff --git a/packages/semi-ui/cascader/index.tsx b/packages/semi-ui/cascader/index.tsx index 1357dd971d..774ebfadc1 100644 --- a/packages/semi-ui/cascader/index.tsx +++ b/packages/semi-ui/cascader/index.tsx @@ -219,6 +219,7 @@ class Cascader extends BaseComponent { enableLeafClick: false, 'aria-label': 'Cascader', searchPosition: strings.SEARCH_POSITION_TRIGGER, + checkRelation: strings.RELATED, }) options: any; @@ -429,7 +430,7 @@ class Cascader extends BaseComponent { } static getDerivedStateFromProps(props: CascaderProps, prevState: CascaderState) { - const { multiple, value, defaultValue, onChangeWithObject, leafOnly, autoMergeValue } = props; + const { multiple, value, defaultValue, onChangeWithObject, leafOnly, autoMergeValue, checkRelation } = props; const { prevProps } = prevState; let keyEntities = prevState.keyEntities || {}; const newState: Partial = {}; @@ -498,18 +499,22 @@ class Cascader extends BaseComponent { if (isSet(realKeys)) { realKeys = [...realKeys]; } - const calRes = calcCheckedKeys(realKeys, keyEntities); - const checkedKeys = new Set(calRes.checkedKeys); - const halfCheckedKeys = new Set(calRes.halfCheckedKeys); - // disableStrictly - if (props.disableStrictly) { - newState.disabledKeys = calcDisabledKeys(keyEntities); + if (checkRelation === strings.RELATED) { + const calRes = calcCheckedKeys(realKeys, keyEntities); + const checkedKeys = new Set(calRes.checkedKeys); + const halfCheckedKeys = new Set(calRes.halfCheckedKeys); + // disableStrictly + if (props.disableStrictly) { + newState.disabledKeys = calcDisabledKeys(keyEntities); + } + const isLeafOnlyMerge = calcMergeType(autoMergeValue, leafOnly) === strings.LEAF_ONLY_MERGE_TYPE; + newState.checkedKeys = checkedKeys; + newState.halfCheckedKeys = halfCheckedKeys; + newState.resolvedCheckedKeys = new Set(normalizeKeyList(checkedKeys, keyEntities, isLeafOnlyMerge)); + } else { + newState.checkedKeys = new Set(realKeys); } - const isLeafOnlyMerge = calcMergeType(autoMergeValue, leafOnly) === strings.LEAF_ONLY_MERGE_TYPE; newState.prevProps = props; - newState.checkedKeys = checkedKeys; - newState.halfCheckedKeys = halfCheckedKeys; - newState.resolvedCheckedKeys = new Set(normalizeKeyList(checkedKeys, keyEntities, isLeafOnlyMerge)); } } return newState; @@ -594,10 +599,11 @@ class Cascader extends BaseComponent { }; renderTagInput() { - const { size, disabled, placeholder, maxTagCount, showRestTagsPopover, restTagsPopoverProps } = this.props; + const { size, disabled, placeholder, maxTagCount, showRestTagsPopover, restTagsPopoverProps, checkRelation } = this.props; const { inputValue, checkedKeys, keyEntities, resolvedCheckedKeys } = this.state; const tagInputcls = cls(`${prefixcls}-tagInput-wrapper`); - const realKeys = this.mergeType === strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys; + const realKeys = this.mergeType === strings.NONE_MERGE_TYPE || checkRelation === strings.UN_RELATED ? + checkedKeys : resolvedCheckedKeys; return ( { }; renderMultipleTags = () => { - const { autoMergeValue, maxTagCount } = this.props; + const { autoMergeValue, maxTagCount, checkRelation } = this.props; const { checkedKeys, resolvedCheckedKeys } = this.state; - const realKeys = this.mergeType === strings.NONE_MERGE_TYPE ? checkedKeys : resolvedCheckedKeys; + const realKeys = this.mergeType === strings.NONE_MERGE_TYPE || checkRelation === strings.UN_RELATED ? + checkedKeys : resolvedCheckedKeys; const displayTag: Array = []; const hiddenTag: Array = []; [...realKeys].forEach((checkedKey, idx) => { diff --git a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx index 692063b8bf..c7aab9010c 100644 --- a/packages/semi-ui/chat/chatBox/chatBoxContent.tsx +++ b/packages/semi-ui/chat/chatBox/chatBoxContent.tsx @@ -39,7 +39,7 @@ const ChatBoxContent = (props: ChatBoxContentProps) => { [`${PREFIX_CHAT_BOX}-content-user`]: (bubble && isUser) || userBubble, [`${PREFIX_CHAT_BOX}-content-error`]: status === MESSAGE_STATUS.ERROR && (bubble || userBubble) }); - }, [role, status]); + }, [role, status, mode]); const node = useMemo(() => { if (status === MESSAGE_STATUS.LOADING) { diff --git a/packages/semi-ui/chat/chatBox/index.tsx b/packages/semi-ui/chat/chatBox/index.tsx index db11fe42d4..9bc1f151f0 100644 --- a/packages/semi-ui/chat/chatBox/index.tsx +++ b/packages/semi-ui/chat/chatBox/index.tsx @@ -65,7 +65,7 @@ const ChatBox = React.memo((props: ChatBoxProps) => { customMarkDownComponents={customMarkDownComponents} customRenderFunc={renderChatBoxContent} />); - }, [message, info, renderChatBoxContent]); + }, [message, info, renderChatBoxContent, mode]); const actionNode = useMemo(() => { return ( { + + return ( + <> +
    + +
    Drag me
    +
    + +
    + + ) +} + +export const Callback = () => { + + const onMouseMove = useCallback((e) => { + console.log('onMouseMove', e); + }, []); + + const onMouseDown = useCallback((e) => { + console.log('onMouseDown', e); + }, []); + + const onMouseUp = useCallback((e) => { + console.log('onMouseUp', e); + }) + + return ( +
    + +
    Drag me
    +
    +
    + ) +} + +export const Constrain = () => { + const containerRef = React.useRef(); + + return ( +
    + constrainer + { + return containerRef.current; + }} + > +
    Drag me
    +
    +
    + ) +} + + +export const Handler = () => { + const handlerRef = React.useRef(); + const containerRef = React.useRef(); + + return ( +
    + constrainer + handlerRef.current} + constrainer={() => containerRef.current} + > +
    +
    +
    +
    +
    + ) +} + +export const MultipleLayer = () => { + const constrainRef = React.useRef(); + + return ( + <> +
    + Constrain node, relative position +
    + Relative position + constrainRef.current}> +
    Drag me
    +
    +
    +
    + + ); +} + +export const MultipleLayer2 = () => { + const constrainRef = React.useRef(); + + return ( + <> +
    + Constrain node, relative position +
    + Absolute position + constrainRef.current}> +
    Drag me
    +
    +
    +
    + + ); +} + +export const HasInput = () => { + return ( + <> +
    + +
    Drag me + +
    +
    +
    + + ) +} + +export const CustomMove = () => { + const containerRef = React.useRef(); + const elementRef = React.useRef(); + const startPoint = React.useRef(); + + const customMove = useCallback((element, top, left) => { + // 此处可以做一些其他的效果,比如设置 bottom/right 而不是设置 top,left + if (left + 100 > containerRef.current.offsetWidth) { + element.style.right = `${containerRef.current.offsetWidth - left - element.offsetWidth}px` + element.style.left = 'auto'; + } else { + element.style.left = left + 'px'; + } + element.style.top = top + 'px'; + }, []) + + const onMouseDown = useCallback((e) => { + startPoint.current = { + x: e.clientX, + y: e.clientY, + } + }, []); + + const onMouseUp = useCallback((e) => { + if (startPoint.current) { + const { x, y } = startPoint.current; + if (Math.abs(e.clientX - x) < 5 && Math.abs(e.clientY - y) < 5) { + if (elementRef.current.style.width === '60px') { + elementRef.current.style.width = '100px'; + } else { + elementRef.current.style.width = '60px'; + } + } + } + startPoint.current = null; + }, []); + + return ( + <> + 蓝色色块可点击改变宽度,100px/50px +
    + 使用 customMove 自定义位置,保证在 container 边缘时候,改变宽度前后, 蓝色色块不会超出 container +
    + constrainer + containerRef.current} + customMove={customMove} + > +
    Drag me
    +
    +
    + + ) +} + +export const SemiComponent = () => { + const ref = React.useRef(); + return ( + + + + ); +} \ No newline at end of file diff --git a/packages/semi-ui/dragMove/_story/dragMove.stories.tsx b/packages/semi-ui/dragMove/_story/dragMove.stories.tsx new file mode 100644 index 0000000000..a3e366311f --- /dev/null +++ b/packages/semi-ui/dragMove/_story/dragMove.stories.tsx @@ -0,0 +1,29 @@ +import React, { useEffect} from 'react'; +import { storiesOf } from '@storybook/react'; +import DragMove from '../index'; + +export const Demo = () => { + const handlerRef = React.useRef(); + + return ( + +
    +
    Drag me
    +
    +
    + ) +} + +const stories = storiesOf('DragMove', module); + +stories.add('DragMove', () => ); diff --git a/packages/semi-ui/dragMove/index.ts b/packages/semi-ui/dragMove/index.ts new file mode 100644 index 0000000000..10a3a5f499 --- /dev/null +++ b/packages/semi-ui/dragMove/index.ts @@ -0,0 +1,151 @@ +import DragMoveFoundation, { DragMoveAdapter } from '@douyinfe/semi-foundation/dragMove/foundation'; +import BaseComponent from '../_base/baseComponent'; +import { ReactNode } from 'react'; +import PropTypes from 'prop-types'; +import React from 'react'; +import { isHTMLElement } from '../_base/reactUtils'; +import ReactDOM from 'react-dom'; + +export interface DragMoveProps { + // The element that triggers the drag event,default is element + handler?: () => ReactNode; + // The element that constrains the movement range, This element requires relative positioning + constrainer?: () => ReactNode | 'parent'; + children?: ReactNode | undefined | any; + onMouseDown?: (e: MouseEvent) => void; + onMouseMove?: (e: MouseEvent) => void; + onMouseUp?: (e: MouseEvent) => void; + onTouchStart?: (e: TouchEvent) => void; + onTouchMove?: (e: TouchEvent) => void; + onTouchEnd?: (e: TouchEvent) => void; + onTouchCancel?: (e: TouchEvent) => void; + // Determine whether dragging is triggered when the mouse is pressed. + // Return true to trigger dragging. Return false to not trigger dragging. + allowMove?: (e: MouseEvent | TouchEvent, element: HTMLElement) => boolean; + // customize move behavior + customMove?: (e: HTMLElement, top: number, left: number) => void +} + +export default class DragMove extends BaseComponent { + + static propTypes = { + children: PropTypes.node, + handler: PropTypes.func, + allowInputDrag: PropTypes.bool, + constrainNode: PropTypes.func, + onMouseDown: PropTypes.func, + onMouseMove: PropTypes.func, + onMouseUp: PropTypes.func, + onTouchStart: PropTypes.func, + onTouchMove: PropTypes.func, + onTouchEnd: PropTypes.func, + onTouchCancel: PropTypes.func, + } + + static __SemiComponentName__ = "DragMove"; + + static defaultProps = { + allowInputDrag: false, + }; + + constructor(props: DragMoveProps) { + super(props); + this.elementRef = React.createRef(); + this.foundation = new DragMoveFoundation(this.adapter); + } + + elementRef: React.RefObject; + foundation: DragMoveFoundation; + + get adapter(): DragMoveAdapter { + return { + ...super.adapter, + getDragElement: () => { + let elementDom = this.elementRef.current; + if (!isHTMLElement(elementDom)) { + elementDom = ReactDOM.findDOMNode(elementDom as React.ReactInstance); + } + return elementDom as HTMLElement; + }, + getConstrainer: () => { + const { constrainer } = this.props; + if (typeof constrainer === 'string' && constrainer === 'parent') { + return (this.elementRef.current as HTMLElement)?.parentNode as HTMLElement; + } else if (typeof constrainer === 'function') { + return constrainer() as any; + } else { + return null; + } + }, + getHandler: () => { + const { handler } = this.props; + if (typeof handler === 'function') { + return handler() as any; + } else { + return this.adapter.getDragElement() as HTMLElement; + } + }, + notifyMouseDown: (e: MouseEvent) => { + this.props.onMouseDown && this.props.onMouseDown(e); + }, + notifyMouseMove: (e: MouseEvent) => { + this.props.onMouseMove && this.props.onMouseMove(e); + }, + notifyMouseUp: (e: MouseEvent) => { + this.props.onMouseUp && this.props.onMouseUp(e); + }, + notifyTouchStart: (e: TouchEvent) => { + this.props.onTouchStart && this.props.onTouchStart(e); + }, + notifyTouchMove: (e: TouchEvent) => { + this.props.onTouchMove && this.props.onTouchMove(e); + }, + notifyTouchEnd: (e: TouchEvent) => { + this.props.onTouchEnd && this.props.onTouchEnd(e); + }, + notifyTouchCancel: (e: TouchEvent) => { + this.props.onTouchCancel && this.props.onTouchCancel(e); + }, + }; + } + + componentDidMount(): void { + this.foundation.init(); + } + + componentWillUnmount(): void { + this.foundation.destroy(); + } + + render() { + const { children } = this.props; + const newChildren = React.cloneElement(children, { + ref: (node: React.ReactNode) => { + (this.elementRef as any).current = node; + // Call the original ref, if any + const { ref } = children as any; + if (typeof ref === 'function') { + ref(node); + } else if (ref && typeof ref === 'object') { + ref.current = node; + } + }, + onMouseDown: (e: MouseEvent) => { + this.foundation.onMouseDown(e); + const { onMouseDown } = children.props; + if (typeof onMouseDown === 'function') { + onMouseDown(e); + } + }, + onTouchStart: (e: TouchEvent) => { + this.foundation.onTouchStart(e); + const { onMouseMove } = children.props; + if (typeof onMouseMove === 'function') { + onMouseMove(e); + } + }, + }); + return newChildren; + } +} + \ No newline at end of file diff --git a/packages/semi-ui/highlight/_story/highlight.stories.jsx b/packages/semi-ui/highlight/_story/highlight.stories.jsx index c776022186..e412256bec 100644 --- a/packages/semi-ui/highlight/_story/highlight.stories.jsx +++ b/packages/semi-ui/highlight/_story/highlight.stories.jsx @@ -1,8 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom'; - -import { Skeleton, Avatar, Button, ButtonGroup, Spin, Highlight } from '../../index'; - +import { Highlight } from '../../index'; const searchWords = ['do', 'dollar']; const sourceString = 'aaa do dollar aaa'; @@ -11,7 +9,7 @@ export default { title: 'Highlight' } -export const HighlightTag = () => ( +export const HighlightBase = () => (

    (

    ); -HighlightTag.story = { - name: 'different tag', -}; export const HighlightStyle = () => (

    @@ -36,6 +31,29 @@ export const HighlightStyle = () => (

    ); -HighlightStyle.story = { - name: 'custom style', +export const HighlightClassName = () => ( +

    + +

    +); + +export const MutilpleSearchWords = () => { + return ( + + ) }; + diff --git a/packages/semi-ui/highlight/index.tsx b/packages/semi-ui/highlight/index.tsx index 6a6d7e8c18..25a8a59513 100644 --- a/packages/semi-ui/highlight/index.tsx +++ b/packages/semi-ui/highlight/index.tsx @@ -2,14 +2,32 @@ import React, { PureComponent } from 'react'; import cls from 'classnames'; import PropTypes, { string } from 'prop-types'; import { cssClasses } from '@douyinfe/semi-foundation/highlight/constants'; -import { getHighLightTextHTML } from '../_utils/index'; +import HighlightFoundation from '@douyinfe/semi-foundation/highlight/foundation'; +import type { SearchWords, Chunk } from '@douyinfe/semi-foundation/highlight/foundation'; + import '@douyinfe/semi-foundation/highlight/highlight.scss'; +interface GetHighLightTextHTMLProps { + sourceString?: string; + searchWords?: SearchWords; + option: HighLightTextHTMLOption +} + +interface HighLightTextHTMLOption { + highlightTag?: string; + highlightClassName?: string; + highlightStyle?: React.CSSProperties; + caseSensitive: boolean; + autoEscape: boolean +} + +interface HighLightTextHTMLChunk extends Chunk { } + export interface HighlightProps { autoEscape?: boolean; caseSensitive?: boolean; sourceString?: string; - searchWords?: Array; + searchWords?: SearchWords; highlightStyle?: React.CSSProperties; highlightClassName?: string; component?: string @@ -38,6 +56,34 @@ class Highlight extends PureComponent { sourceString: '', }; + getHighLightTextHTML = ({ + sourceString = '', + searchWords = [], + option = { autoEscape: true, caseSensitive: false } + }: GetHighLightTextHTMLProps) => { + const chunks: HighLightTextHTMLChunk[] = new HighlightFoundation().findAll({ sourceString, searchWords, ...option }); + const markEle = option.highlightTag || 'mark'; + const highlightClassName = option.highlightClassName || ''; + const highlightStyle = option.highlightStyle || {}; + return chunks.map((chunk: HighLightTextHTMLChunk, index: number) => { + const { end, start, highlight, style, className } = chunk; + const text = sourceString.substr(start, end - start); + if (highlight) { + return React.createElement( + markEle, + { + style: { ...highlightStyle, ...style }, + className: `${highlightClassName} ${className || ''}`.trim(), + key: text + index + }, + text + ); + } else { + return text; + } + }); + }; + render() { const { searchWords, @@ -62,7 +108,7 @@ class Highlight extends PureComponent { }; return ( - getHighLightTextHTML({ sourceString, searchWords, option }) + this.getHighLightTextHTML({ sourceString, searchWords, option }) ); } } diff --git a/packages/semi-ui/index.ts b/packages/semi-ui/index.ts index 83e3384b36..687008f69c 100644 --- a/packages/semi-ui/index.ts +++ b/packages/semi-ui/index.ts @@ -122,3 +122,6 @@ export { ResizeHandler, ResizeGroup } from './resizable'; + +export { default as JsonViewer } from './jsonViewer'; +export { default as DragMove } from './dragMove'; diff --git a/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.jsx b/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.jsx new file mode 100644 index 0000000000..37461a87d3 --- /dev/null +++ b/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.jsx @@ -0,0 +1,95 @@ +import React, { useState, useEffect, useRef } from 'react'; + +import JsonViewer from '../index'; +import Button from '../../button'; +export default { + title: 'JsonViewer', +}; + +const baseStr = `{ + "min_position": 1, + "has_more_items": true, + "items_html": "Bike", + "new_latent_count": 0, + "data": { + "length": 22, + "text": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + "numericalArray": [23, 29, 28, 26, 23], + "StringArray": ["Oxygen", "Oxygen", "Oxygen", "Carbon"], + "multipleTypesArray": 3, + "objArray": [ + {}, + { + "class": "upper", + "name": "Mark", + "age": 7 + }, + { + "class": "upper", + "name": "Tom", + "age": 1 + }, + { + "class": "lower", + "name": "Jerry", + "age": 5 + }, + { + "class": "lower", + "name": "Alice", + "age": 3 + } + ] +}`; + +export const DefaultJsonViewer = () => { + const hoverHandler = (value, target) => { + const el = document.createElement('div'); + el.style.backgroundColor = '#f5f5f5'; + el.style.width = '100px'; + el.style.height = '100px'; + el.style.border = '1px solid #0080ff'; + if (value.startsWith('"http')) { + const img = document.createElement('img'); + const regex = /["']/g; + const src = value.replace(regex, ''); + img.src = src; + el.appendChild(img); + } else { + el.innerHTML = 'This is a self -defined rendering of the user'; + } + return el; + }; + + const onChangeHandler = value => { + console.log(value, 'value'); + }; + + const [autoWrap, setAutoWrap] = useState(true); + const [lineHeight, setLineHeight] = useState(20); + const jsonviewerRef = useRef(null); + + return ( + <> + + + + + + ); +}; diff --git a/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.tsx b/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.tsx new file mode 100644 index 0000000000..663de093f6 --- /dev/null +++ b/packages/semi-ui/jsonViewer/_story/jsonViewer.stories.tsx @@ -0,0 +1,59 @@ +import React from "react" +import JsonViewer from "../index" + + + +export default { + title: 'JsonViewer', +} + +const baseStr = `{ + "min_position": 9, + "has_more_items": true, + "items_html": "Bike", + "new_latent_count": 0, + "data": { + "length": 22, + "text": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." + }, + "numericalArray": [ + 23, + 29, + 28, + 26, + 23 + ], + "StringArray": [ + "Oxygen", + "Oxygen", + "Oxygen", + "Carbon" + ], + "multipleTypesArray": 3, + "objArray": [ + { + + }, + { + "class": "upper", + "age": 7 + }, + { + "class": "upper", + "age": 1 + }, + { + "class": "lower", + "age": 5 + }, + { + "class": "lower", + "age": 3 + } + ] + }`; + +export const DefaultJsonViewer = () => { + + return +} \ No newline at end of file diff --git a/packages/semi-ui/jsonViewer/_story/utils.ts b/packages/semi-ui/jsonViewer/_story/utils.ts new file mode 100644 index 0000000000..2cb77a6b68 --- /dev/null +++ b/packages/semi-ui/jsonViewer/_story/utils.ts @@ -0,0 +1,61 @@ +type JsonValue = string | number | boolean | JsonObject | JsonArray; +interface JsonObject { + [key: string]: JsonValue +} +type JsonArray = Array; + +export function generateJsonString(count: number, nested: number): string { + function generateRandomString(): string { + const length = Math.floor(Math.random() * 20) + 5; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + return Array.from({ length }, () => characters[Math.floor(Math.random() * characters.length)]).join(''); + } + + function generateRandomObject(depth: number): JsonObject { + const obj: JsonObject = {}; + const prefixes = ['id', 'name', 'value', 'data', 'item']; + + // 始终生成5个键值对,每种类型各一个 + obj[`${prefixes[0]}`] = Math.floor(Math.random() * 1000); // number + obj[`${prefixes[1]}`] = generateRandomString(); // string + obj[`${prefixes[2]}`] = Math.random() > 0.5; // boolean + if (depth < nested) { + obj[`${prefixes[3]}`] = generateJsonArray(depth + 1); // array + obj[`${prefixes[4]}`] = generateRandomObject(depth + 1); // object + } else { + // 在达到最大深度时,用基本类型替代 + obj[`${prefixes[3]}`] = Math.floor(Math.random() * 1000); // 用number替代array + obj[`${prefixes[4]}`] = generateRandomString(); // 用string替代object + } + return obj; + } + + function generateJsonArray(depth: number): JsonArray { + const array: JsonArray = []; + + // 始终生成5个元素,每种类型各一个 + array.push(Math.floor(Math.random() * 1000)); // number + array.push(generateRandomString()); // string + array.push(Math.random() > 0.5); // boolean + if (depth < nested) { + array.push(generateJsonArray(depth + 1)); // array + array.push(generateRandomObject(depth + 1)); // object + } else { + // 在达到最大深度时,用基本类型替代 + array.push(Math.floor(Math.random() * 1000)); // 用number替代array + array.push(generateRandomString()); // 用string替代object + } + return array; + } + + function generateJson(): JsonObject[] { + const json: JsonObject[] = []; + for (let i = 0; i < count; i++) { + json.push(generateRandomObject(1)); + } + return json; + } + + const json = generateJson(); + return JSON.stringify(json, null, 4); // 格式化输出 +} diff --git a/packages/semi-ui/jsonViewer/index.tsx b/packages/semi-ui/jsonViewer/index.tsx new file mode 100644 index 0000000000..90cf12a6a5 --- /dev/null +++ b/packages/semi-ui/jsonViewer/index.tsx @@ -0,0 +1,302 @@ +import React from 'react'; +import classNames from 'classnames'; +import JsonViewerFoundation, { + JsonViewerOptions, + JsonViewerAdapter, +} from '@douyinfe/semi-foundation/jsonViewer/foundation'; +import '@douyinfe/semi-foundation/jsonViewer/jsonViewer.scss'; +import { cssClasses } from '@douyinfe/semi-foundation/jsonViewer/constants'; +import ButtonGroup from '../button/buttonGroup'; +import Button from '../button'; +import Input from '../input'; +import DragMove from '../dragMove'; +import { + IconCaseSensitive, + IconChevronLeft, + IconChevronRight, + IconClose, + IconRegExp, + IconSearch, + IconWholeWord, +} from '@douyinfe/semi-icons'; +import BaseComponent, { BaseProps } from '../_base/baseComponent'; +const prefixCls = cssClasses.PREFIX; + +export type { JsonViewerOptions }; +export interface JsonViewerProps extends BaseProps { + value: string; + width: number; + height: number; + className?: string; + style?: React.CSSProperties; + onChange?: (value: string) => void; + renderTooltip?: (value: string, el: HTMLElement) => HTMLElement; + options?: JsonViewerOptions +} + +export interface JsonViewerState { + searchOptions: SearchOptions; + showSearchBar: boolean +} + +interface SearchOptions { + caseSensitive: boolean; + wholeWord: boolean; + regex: boolean +} + +class JsonViewerCom extends BaseComponent { + static defaultProps: Partial = { + width: 400, + height: 400, + value: '', + }; + + private editorRef: React.RefObject; + private searchInputRef: React.RefObject; + private replaceInputRef: React.RefObject; + + foundation: JsonViewerFoundation; + + constructor(props: JsonViewerProps) { + super(props); + this.editorRef = React.createRef(); + this.searchInputRef = React.createRef(); + this.replaceInputRef = React.createRef(); + this.foundation = new JsonViewerFoundation(this.adapter); + this.state = { + searchOptions: { + caseSensitive: false, + wholeWord: false, + regex: false, + }, + showSearchBar: false, + }; + } + + componentDidMount() { + this.foundation.init(); + } + + componentDidUpdate(prevProps: JsonViewerProps): void { + if (prevProps.options !== this.props.options) { + this.foundation.jsonViewer.dispose(); + this.foundation.init(); + } + } + + get adapter(): JsonViewerAdapter { + return { + ...super.adapter, + getEditorRef: () => this.editorRef.current, + getSearchRef: () => this.searchInputRef.current, + notifyChange: value => { + this.props.onChange?.(value); + }, + notifyHover: (value, el) => { + const res = this.props.renderTooltip?.(value, el); + return res; + }, + setSearchOptions: (key: string) => { + this.setState( + { + searchOptions: { + ...this.state.searchOptions, + [key]: !this.state.searchOptions[key], + }, + }, + () => { + this.searchHandler(); + } + ); + }, + showSearchBar: () => { + this.setState({ showSearchBar: !this.state.showSearchBar }); + }, + }; + } + + getValue() { + return this.foundation.jsonViewer.getModel().getValue(); + } + + format() { + this.foundation.jsonViewer.format(); + } + + getStyle() { + const { width, height } = this.props; + return { + width, + height, + }; + } + + searchHandler = () => { + const value = this.searchInputRef.current?.value; + this.foundation.search(value); + }; + + changeSearchOptions = (key: string) => { + this.foundation.setSearchOptions(key); + }; + + renderSearchBox() { + return ( +
    + {this.renderSearchBar()} + {this.renderReplaceBar()} +
    + ); + } + + renderSearchOptions() { + const searchOptionItems = [ + { + key: 'caseSensitive', + icon: IconCaseSensitive, + }, + { + key: 'regex', + icon: IconRegExp, + }, + { + key: 'wholeWord', + icon: IconWholeWord, + }, + ]; + + return ( +
      + {searchOptionItems.map(({ key, icon: Icon }) => ( +
    • + this.changeSearchOptions(key)} /> +
    • + ))} +
    + ); + } + + renderSearchBar() { + return ( +
    + { + e.preventDefault(); + this.searchHandler(); + this.searchInputRef.current?.focus(); + }} + ref={this.searchInputRef} + /> + {this.renderSearchOptions()} + +
    + ); + } + + renderReplaceBar() { + return ( +
    + { + e.preventDefault(); + }} + ref={this.replaceInputRef} + /> + + +
    + ); + } + + render() { + let isDragging = false; + const { width, className, style, ...rest } = this.props; + return ( + <> +
    +
    + { + isDragging = false; + }} + onMouseMove={() => { + isDragging = true; + }} + > +
    + {!this.state.showSearchBar ? ( +
    +
    +
    + + ); + } +} + +export default JsonViewerCom; diff --git a/packages/semi-ui/markdownRender/components/table.tsx b/packages/semi-ui/markdownRender/components/table.tsx index 35dc43c376..cfac8f8f7e 100644 --- a/packages/semi-ui/markdownRender/components/table.tsx +++ b/packages/semi-ui/markdownRender/components/table.tsx @@ -6,27 +6,27 @@ import { omit } from 'lodash'; -const table = (props: PropsWithChildren)=>{ +const table = (props: PropsWithChildren) => { const { children } = props; const toArray = value => Array.isArray(value) ? value : [value]; const columnsFiber = toArray(get(children[0], 'props.children.props.children')); const dataFiber = toArray(get(children[1], 'props.children')); - const titles: string[] = columnsFiber.map(item=>item?.props?.children || ""); + const titles: string[] = columnsFiber.map(item => item?.props?.children || ""); const tableDataSource: any[] = []; for (let i = 0;i < dataFiber.length;i++) { let item: Record = { key: String(i) }; - dataFiber[i]?.props.children.forEach((child, index)=>{ + dataFiber[i]?.props.children?.forEach?.((child, index) => { item[titles[index]] = child?.props?.children ?? ""; }); tableDataSource.push(item); } - return { + return
    { return { title, dataIndex: title diff --git a/packages/semi-ui/package.json b/packages/semi-ui/package.json index 13d471b8fe..5391fca521 100644 --- a/packages/semi-ui/package.json +++ b/packages/semi-ui/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-ui", - "version": "2.70.2", + "version": "2.71.1", "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.", "main": "lib/cjs/index.js", "module": "lib/es/index.js", @@ -20,18 +20,19 @@ "@dnd-kit/core": "^6.0.8", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", - "@douyinfe/semi-animation": "2.70.2", - "@douyinfe/semi-animation-react": "2.70.2", - "@douyinfe/semi-foundation": "2.70.2", - "@douyinfe/semi-icons": "2.70.2", - "@douyinfe/semi-illustrations": "2.70.2", - "@douyinfe/semi-theme-default": "2.70.2", + "@douyinfe/semi-animation": "2.71.1", + "@douyinfe/semi-animation-react": "2.71.1", + "@douyinfe/semi-foundation": "2.71.1", + "@douyinfe/semi-icons": "2.71.1", + "@douyinfe/semi-illustrations": "2.71.1", + "@douyinfe/semi-theme-default": "2.71.1", "async-validator": "^3.5.0", "classnames": "^2.2.6", "copy-text-to-clipboard": "^2.1.1", "date-fns": "^2.29.3", "date-fns-tz": "^1.3.8", "fast-copy": "^3.0.1 ", + "jsonc-parser": "^3.3.1", "lodash": "^4.17.21", "prop-types": "^15.7.2", "react-resizable": "^3.0.5", diff --git a/packages/semi-ui/select/__test__/select.test.js b/packages/semi-ui/select/__test__/select.test.js index a0f2e5a72e..cba79f2779 100644 --- a/packages/semi-ui/select/__test__/select.test.js +++ b/packages/semi-ui/select/__test__/select.test.js @@ -369,7 +369,7 @@ describe('Select', () => { }); it('innerTopSlot', () => { - let innerTopSlot =
    inner
    ; + let innerTopSlot =
    inner
    ; let props = { innerTopSlot: innerTopSlot, defaultOpen: true, @@ -379,7 +379,7 @@ describe('Select', () => { }); it('outerTopSlot', () => { - let outerTopSlot =
    outer
    ; + let outerTopSlot =
    outer
    ; let props = { outerTopSlot: outerTopSlot, defaultOpen: true, @@ -390,7 +390,7 @@ describe('Select', () => { // TODO it('innerBottomSlot', () => { - let innerBottomSlot =
    inner
    ; + let innerBottomSlot =
    inner
    ; let props = { innerBottomSlot: innerBottomSlot, defaultOpen: true, @@ -400,7 +400,7 @@ describe('Select', () => { }); it('outerBottomSlot', () => { - let outerBottomSlot =
    outer
    ; + let outerBottomSlot =
    outer
    ; let props = { outerBottomSlot: outerBottomSlot, defaultOpen: true, diff --git a/packages/semi-ui/select/index.tsx b/packages/semi-ui/select/index.tsx index 0a9f87d9ff..08fbe874ad 100644 --- a/packages/semi-ui/select/index.tsx +++ b/packages/semi-ui/select/index.tsx @@ -1508,7 +1508,6 @@ class Select extends BaseComponent { dropdownMargin, } = this.props; const { isOpen, optionKey } = this.state; - const optionList = this.renderOptions(children); const selection = this.renderSelection(); return ( { autoAdjustOverflow={autoAdjustOverflow} mouseLeaveDelay={mouseLeaveDelay} mouseEnterDelay={mouseEnterDelay} - // transformFromCenter TODO: check no such property zIndex={zIndex} ref={this.optionsRef} - content={optionList} + content={() => this.renderOptions(children)} visible={isOpen} trigger="custom" rePosKey={optionKey} diff --git a/packages/semi-ui/select/option.tsx b/packages/semi-ui/select/option.tsx index 379c9bb1ff..fa6d0963e4 100644 --- a/packages/semi-ui/select/option.tsx +++ b/packages/semi-ui/select/option.tsx @@ -5,7 +5,7 @@ import { isString } from 'lodash'; import { cssClasses } from '@douyinfe/semi-foundation/select/constants'; import LocaleConsumer from '../locale/localeConsumer'; import { IconTick } from '@douyinfe/semi-icons'; -import { getHighLightTextHTML } from '../_utils/index'; +import Highlight, { HighlightProps } from '../highlight'; import { Locale } from '../locale/interface'; import getDataAttr from '@douyinfe/semi-foundation/utils/getDataAttr'; import type { BasicOptionProps } from '@douyinfe/semi-foundation/select/optionFoundation'; @@ -20,15 +20,6 @@ export interface OptionProps extends BasicOptionProps { className?: string; style?: React.CSSProperties } -interface renderOptionContentArgument { - config: { - searchWords: any; - sourceString: React.ReactNode - }; - children: React.ReactNode; - inputValue: string; - prefixCls: string -} class Option extends PureComponent { static isSelectOption = true; @@ -63,9 +54,15 @@ class Option extends PureComponent { } } - renderOptionContent({ config, children, inputValue, prefixCls }: renderOptionContentArgument) { + renderOptionContent({ config, children, inputValue, prefixCls }) { if (isString(children) && inputValue) { - return getHighLightTextHTML(config as any); + return ( + + ); } return children; } @@ -139,12 +136,11 @@ class Option extends PureComponent { } const config = { - searchWords: inputValue, + searchWords: [inputValue], sourceString: children, - option: { - highlightClassName: `${prefixCls}-keyword` - } + highlightClassName: `${prefixCls}-keyword` }; + return ( // eslint-disable-next-line jsx-a11y/interactive-supports-focus,jsx-a11y/click-events-have-key-events
    { + const { checked, index } = options; + const newData = cloneDeep(data); + newData[index].completeStatus = checked; + setData(newData); + }; + + const src = 'https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/root-web-sites/bag.jpeg'; + + const shouldCellUpdate: ColumnProps['shouldCellUpdate'] = (props, prevProps) => { + return props.record !== prevProps.record; + }; + + const columns: ColumnProps[] = [ + { + title: '需求标题', + dataIndex: 'featureTitle', + render: (text, record, index) => ( + + {text} + + ), + filterIcon:
    test
    , + shouldCellUpdate + }, + { + title: '文档', + dataIndex: 'doc', + width: 150, + render: (text, record, index) => ( + + {text} + + ), + shouldCellUpdate + }, + { + title: '需求状态', + dataIndex: 'featureStatus', + width: 100, + render: (text, record, index) => ( + + + {text} + + + ), + shouldCellUpdate + }, + { + title: '优先级', + dataIndex: 'priority', + render: (text, record, index) => {text}, + shouldCellUpdate + }, + { + title: 'PM', + dataIndex: 'pm', + render: (text, record, index) => ( + + Hi ByteDancer, this is a popover. +
    We have 2 lines. + + } + key={index} + > + + {text} + +
    + ), + shouldCellUpdate + }, + { + title: '产品线', + dataIndex: 'productLine', + render: (text, record, index) => ( + + + {text} + + + ), + shouldCellUpdate + }, + { + title: '前端', + dataIndex: 'fe', + render: (text, record, index) => ( + + Hi ByteDancer, this is a popover. +
    We have 2 lines. + + } + key={index} + > + {text} +
    + ), + shouldCellUpdate + }, + { + title: '服务端', + dataIndex: 'server', + render: (text, record, index) => ( + + Hi ByteDancer, this is a popover. +
    We have 2 lines. + + } + key={index} + > + {text} +
    + ), + shouldCellUpdate + }, + { + title: '创建时间', + dataIndex: 'createTime', + render: (text, record, index) => ( + { + console.log('click createTime', record); + }} + > + {text} + + ), + shouldCellUpdate + }, + { + title: '完成时间', + dataIndex: 'completeTime', + render: (text, record, index) => ( + { + console.log('click completeTime', record); + }} + > + {text} + + ), + shouldCellUpdate + }, + { + title: '完成状态', + dataIndex: 'completeStatus', + render: (text, record, index) => ( + handleSwitchChange({ checked, record, index })} + > + ), + shouldCellUpdate + }, + ]; + + useEffect(() => { + const getData = () => { + const data = Array.from( + { + length: count, + }, + (_, key) => { + const rowRandom = Math.round(Math.random() * 1000); + const prioritySet = ['P0', 'P1', 'P2']; + const priority = prioritySet[Math.round(Math.random() * 2)]; + const featureStatusSet = ['待埋点', '开始', '待需详评', '测试', '已完成']; + const featureStatus = featureStatusSet[Math.round(Math.random() * 4)]; + const doc = 'https://semi.design'; + const createTime = new Date().valueOf(); + return { + key, + featureTitle: `需求-${rowRandom}`, + doc, + featureStatus, + priority, + pm: 'Li', + productLine: 'Hotsoon', + fe: '姜鹏志', + server: 'ZhuYi', + createTime, + completeTime: createTime + rowRandom, + completeStatus: false, + }; + } + ); + return data; + }; + + const newData = getData(); + setData(newData); + }, [count]); + + const scroll = { y: 500 }; + + return ( + <> +
    + +
    +
    + + ); +} diff --git a/packages/semi-ui/table/_story/Perf/index.jsx b/packages/semi-ui/table/_story/Perf/index.jsx index 5bef39b12f..6a49b0ef36 100644 --- a/packages/semi-ui/table/_story/Perf/index.jsx +++ b/packages/semi-ui/table/_story/Perf/index.jsx @@ -5,4 +5,5 @@ export { default as ControlledSelection } from './Render/controlledSelection'; export { default as PerfContext } from './Render/context'; export { default as PerfComplexRender } from './Render/complex'; export { default as PerfResizableSelection } from './Render/resizableSelection'; -export { default as PerfOnRow } from './Render/onRow'; \ No newline at end of file +export { default as PerfOnRow } from './Render/onRow'; +export { default as DeepEqual } from './DeepEqual'; \ No newline at end of file diff --git a/packages/semi-ui/table/_story/table.stories.jsx b/packages/semi-ui/table/_story/table.stories.jsx index 6b85803718..4a327842bd 100644 --- a/packages/semi-ui/table/_story/table.stories.jsx +++ b/packages/semi-ui/table/_story/table.stories.jsx @@ -38,6 +38,7 @@ import { PerfRender, PerfResizableSelection, PerfVirtualized, + DeepEqual } from './Perf'; import RenderPagination from './RenderPagination'; import ControlledSortOrder from './ControlledSortOrder'; @@ -123,6 +124,8 @@ export { } from './v2'; export { default as FixSelectAll325 } from './Demos/rowSelection'; +export { DeepEqual }; + // empty table const emptyColumn = [ diff --git a/packages/semi-ui/table/interface.ts b/packages/semi-ui/table/interface.ts index 89ea50bca6..2b3d47da64 100644 --- a/packages/semi-ui/table/interface.ts +++ b/packages/semi-ui/table/interface.ts @@ -21,6 +21,7 @@ import type { BaseEllipsis } from '@douyinfe/semi-foundation/table/foundation'; import type { ColumnFilterProps } from './ColumnFilter'; +import { TableCellProps } from './TableCell'; export interface TableProps = any> extends BaseProps { bordered?: boolean; @@ -116,7 +117,11 @@ export interface ColumnProps = any> { onHeaderCell?: OnHeaderCell; ellipsis?: BaseEllipsis; resize?: boolean; - showSortTip?: boolean + showSortTip?: boolean; + /** + * self control whether to update cell for performance reasons + */ + shouldCellUpdate?: (props: TableCellProps, prevProps: TableCellProps) => boolean } export type Align = BaseAlign; @@ -250,7 +255,11 @@ export interface RowSelectionProps { onSelectAll?: RowSelectionOnSelectAll; onCell?: ColumnProps['onCell']; onHeaderCell?: ColumnProps['onHeaderCell']; - renderCell?: RowSelectionRenderCell + renderCell?: RowSelectionRenderCell; + /** + * self control whether to update cell for performance reasons + */ + shouldCellUpdate?: (props: TableCellProps, prevProps: TableCellProps) => boolean } export type RowSelectionRenderCell = (renderCellArgs: { diff --git a/packages/semi-ui/tree/_story/tree.stories.jsx b/packages/semi-ui/tree/_story/tree.stories.jsx index 4131b813e9..fb0a3f2a1c 100644 --- a/packages/semi-ui/tree/_story/tree.stories.jsx +++ b/packages/semi-ui/tree/_story/tree.stories.jsx @@ -207,17 +207,6 @@ const treeDataWithIcon = [ }, ]; -const OneLevelData = [ - { - label: '亚洲', - key: 'yazhou', - }, - { - label: '北美洲', - key: 'beimeizhou', - }, -] - let opts = { content: 'Hi, Bytedance dance dance', duration: 3, @@ -3094,14 +3083,6 @@ export const ShowLine = () => { defaultExpandAll disableStrictly /> - <>单选,单层节点 - console.log(args)} - /> ) } diff --git a/packages/semi-ui/tree/treeNode.tsx b/packages/semi-ui/tree/treeNode.tsx index e33cd4c0c3..a052bf5ec9 100644 --- a/packages/semi-ui/tree/treeNode.tsx +++ b/packages/semi-ui/tree/treeNode.tsx @@ -9,7 +9,7 @@ import { Checkbox } from '../checkbox'; import TreeContext, { TreeContextValue } from './treeContext'; import Spin from '../spin'; import { TreeNodeProps, TreeNodeState } from './interface'; -import { getHighLightTextHTML } from '../_utils/index'; +import Highlight from '../highlight'; import Indent from './indent'; const prefixcls = cssClasses.PREFIX_OPTION; @@ -203,7 +203,7 @@ export default class TreeNode extends PureComponent; } @@ -218,8 +218,7 @@ export default class TreeNode extends PureComponent ); } - // when leaf node 's level is 0, no switcher - if (showLine && level) { + if (showLine) { return this.renderSwitcher(); } return ( @@ -302,14 +301,14 @@ export default class TreeNode extends PureComponent + ); } else { return label; } diff --git a/packages/semi-webpack/package.json b/packages/semi-webpack/package.json index 391be8ab7e..eff00850b3 100644 --- a/packages/semi-webpack/package.json +++ b/packages/semi-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-webpack-plugin", - "version": "2.70.2", + "version": "2.71.1", "description": "", "author": "伍浩威 ", "homepage": "", diff --git a/scripts/collectTestCode.js b/scripts/collectTestCode.js index c95c9e7cb4..6c61f0304b 100644 --- a/scripts/collectTestCode.js +++ b/scripts/collectTestCode.js @@ -1,39 +1,63 @@ -const fs = require('fs'); +const fs = require('fs').promises; const path = require('path'); -function countLinesInFile(filePath) { - const fileContent = fs.readFileSync(filePath, 'utf-8'); +async function countLinesInFile(filePath) { + const fileContent = await fs.readFile(filePath, 'utf-8'); const lines = fileContent.split('\n'); return lines.length; } -function countTestFilesLines(directoryPath) { +async function countTestFilesLines(directoryPath) { let totalLines = 0; + const folderLineCounts = {}; + + try { + const files = await fs.readdir(directoryPath); + + for (const file of files) { + const filePath = path.join(directoryPath, file); + const stats = await fs.stat(filePath); + + if (stats.isDirectory()) { + const testDirectoryPath = path.join(filePath, '__test__'); + if (await fs.access(testDirectoryPath).then(() => true).catch(() => false)) { + const testFiles = await fs.readdir(testDirectoryPath); + let folderLines = 0; + + for (const testFile of testFiles) { + if (testFile.endsWith('.test.js')) { + const testFilePath = path.join(testDirectoryPath, testFile); + const linesInFile = await countLinesInFile(testFilePath); + folderLines += linesInFile; + } + } - const files = fs.readdirSync(directoryPath); - - files.forEach(file => { - const filePath = path.join(directoryPath, file); - const stats = fs.statSync(filePath); - - if (stats.isDirectory()) { - const testDirectoryPath = path.join(filePath, '__test__'); - if (fs.existsSync(testDirectoryPath)) { - const testFiles = fs.readdirSync(testDirectoryPath); - testFiles.forEach(testFile => { - if (testFile.endsWith('.test.js')) { - const testFilePath = path.join(testDirectoryPath, testFile); - totalLines += countLinesInFile(testFilePath); + if (folderLines > 0) { + folderLineCounts[file] = folderLines; + totalLines += folderLines; } - }); + } } } - }); + } catch (error) { + console.error(`Error reading directory ${directoryPath}:`, error); + } - return totalLines; + return { totalLines, folderLineCounts }; } -const semiUiDirectoryPath = './packages/semi-ui'; // 替换成 semi-ui 文件夹的实际路径 -const totalTestLines = countTestFilesLines(semiUiDirectoryPath); +(async () => { + const semiUiDirectoryPath = './packages/semi-ui'; // 替换成 semi-ui 文件夹的实际路径 + const { totalLines, folderLineCounts } = await countTestFilesLines(semiUiDirectoryPath); + + console.log(`Total lines in test files: ${totalLines}`); + console.log('Lines in each folder (sorted):'); + + // 将文件夹按行数排序 + const sortedFolders = Object.entries(folderLineCounts).sort(([, linesA], [, linesB]) => linesB - linesA); -console.log(`Total lines in test files: ${totalTestLines}`); \ No newline at end of file + // 输出排序后的结果 + for (const [folder, lines] of sortedFolders) { + console.log(` ${folder}: ${lines} lines`); + } +})(); \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index dce754c421..281cdc2149 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,22 +2,22 @@ https://juejin.cn/post/7267418854124699702 - 2024-12-04T07:16:43.175Z + 2024-12-11T09:35:17.316Z weekly https://medium.com/front-end-weekly/how-we-test-semi-design-component-libraries-64b854f63b65 - 2024-12-04T07:16:41.977Z + 2024-12-11T09:35:17.026Z weekly https://mp.weixin.qq.com/s/noHoWRuA25PgqFNcurhIUA - 2024-12-04T07:16:46.183Z + 2024-12-11T09:35:18.513Z weekly https://mp.weixin.qq.com/s/O3js-SZDNPEOjGxh-aAkbw - 2024-12-04T07:16:44.352Z + 2024-12-11T09:35:18.161Z weekly @@ -784,82 +784,82 @@ https://semi.design/dsm/landing - 2024-12-04T07:16:51.551Z + 2024-12-11T09:35:25.413Z weekly https://semi.design/en-US/basic/divider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/grid - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/icon - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/layout - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/space - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/tokens - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/basic/typography - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/banner - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/notification - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/popconfirm - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/progress - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/skeleton - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/spin - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/feedback/toast - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/autocomplete - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly @@ -869,362 +869,362 @@ https://semi.design/en-US/input/cascader - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/checkbox - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/datepicker - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/form - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/input - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/inputnumber - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/radio - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/rating - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/select - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/slider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/switch - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/taginput - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/timepicker - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/transfer - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/treeselect - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/input/upload - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/anchor - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/backtop - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/breadcrumb - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/navigation - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/pagination - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/steps - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/tabs - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/navigation/tree - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/other/configprovider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/other/locale - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/avatar - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/badge - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/calendar - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/card - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/carousel - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/collapse - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/collapsible - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/descriptions - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/dropdown - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/empty - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/highlight - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/image - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/list - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/modal - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/overflowlist - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/popover - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/scrolllist - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/sidesheet - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/table - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/tag - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/timeline - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/show/tooltip - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/accessibility - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/changelog - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/customize-theme - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/dark-mode - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/faq - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/getting-started - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/introduction - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/overview - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/en-US/start/update-to-v2 - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/divider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/grid - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/icon - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/layout - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/space - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/tokens - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/basic/typography - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/banner - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/notification - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/popconfirm - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/progress - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/skeleton - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/spin - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/feedback/toast - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/autocomplete - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly @@ -1234,287 +1234,287 @@ https://semi.design/zh-CN/input/cascader - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/checkbox - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/datepicker - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/form - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/input - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/inputnumber - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/radio - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/rating - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/select - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/slider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/switch - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/taginput - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/timepicker - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/transfer - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/treeselect - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/input/upload - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/anchor - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/backtop - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/breadcrumb - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/navigation - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/pagination - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/steps - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/tabs - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/navigation/tree - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/other/configprovider - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/other/locale - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/avatar - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/badge - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/calendar - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/card - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/carousel - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/collapse - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/collapsible - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/descriptions - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/dropdown - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/empty - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/highlight - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/image - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/list - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/modal - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/overflowlist - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/popover - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/scrolllist - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/sidesheet - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/table - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/tag - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/timeline - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/show/tooltip - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/accessibility - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/changelog - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/customize-theme - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/dark-mode - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/faq - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/getting-started - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/introduction - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/overview - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly https://semi.design/zh-CN/start/update-to-v2 - 2024-12-04T07:05:18.000Z + 2024-12-11T09:31:26.000Z weekly diff --git a/src/components/PageAnchor/index.jsx b/src/components/PageAnchor/index.jsx index e12ef162e6..25a22bac9f 100644 --- a/src/components/PageAnchor/index.jsx +++ b/src/components/PageAnchor/index.jsx @@ -17,7 +17,7 @@ const makeAnchorOfToken = data => { const PageAnchor = props => { const { data = [], slug } = props; - const skipCondition = ['accessibility', 'dark-mode', 'customize-theme', 'content-guidelines', 'getting-started', 'design-to-code', 'chart'].some(item => slug.includes(item)); + const skipCondition = ['introduction', 'accessibility', 'dark-mode', 'customize-theme', 'content-guidelines', 'getting-started', 'design-to-code', 'chart'].some(item => slug.includes(item)); let flag = false; const makeAnchor = data => { diff --git a/src/images/docIcons/doc-jsonviewer.svg b/src/images/docIcons/doc-jsonviewer.svg new file mode 100644 index 0000000000..acda2cb650 --- /dev/null +++ b/src/images/docIcons/doc-jsonviewer.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/syncRegistry.sh b/syncRegistry.sh index 85c15a3df9..0ecaf5e392 100755 --- a/syncRegistry.sh +++ b/syncRegistry.sh @@ -17,4 +17,5 @@ python -m webbrowser https://$url/sync/@douyinfe/semi-rspack-plugin python -m webbrowser https://$url/sync/@douyinfe/semi-scss-compile python -m webbrowser https://$url/sync/@douyinfe/semi-theme-default python -m webbrowser https://$url/sync/@douyinfe/semi-webpack-plugin +python -m webbrowser https://$url/sync/@douyinfe/semi-json-viewer-core diff --git a/yarn.lock b/yarn.lock index bb86c17c20..4f54a5615d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1829,6 +1829,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz#d1bc06aedb6936b3b6d313bf809a5a40387d2b7f" integrity sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA== +"@esbuild/aix-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz#b57697945b50e99007b4c2521507dc613d4a648c" + integrity sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw== + "@esbuild/android-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz#cf91e86df127aa3d141744edafcba0abdc577d23" @@ -1849,6 +1854,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz#7ad65a36cfdb7e0d429c353e00f680d737c2aed4" integrity sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA== +"@esbuild/android-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz#1add7e0af67acefd556e407f8497e81fddad79c0" + integrity sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w== + "@esbuild/android-arm@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.16.17.tgz#025b6246d3f68b7bbaa97069144fb5fb70f2fff2" @@ -1869,6 +1879,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.12.tgz#b0c26536f37776162ca8bde25e42040c203f2824" integrity sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w== +"@esbuild/android-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.24.0.tgz#ab7263045fa8e090833a8e3c393b60d59a789810" + integrity sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew== + "@esbuild/android-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.16.17.tgz#c820e0fef982f99a85c4b8bfdd582835f04cd96e" @@ -1889,6 +1904,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.12.tgz#cb13e2211282012194d89bf3bfe7721273473b3d" integrity sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew== +"@esbuild/android-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.24.0.tgz#e8f8b196cfdfdd5aeaebbdb0110983460440e705" + integrity sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ== + "@esbuild/darwin-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz#edef4487af6b21afabba7be5132c26d22379b220" @@ -1909,6 +1929,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz#cbee41e988020d4b516e9d9e44dd29200996275e" integrity sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g== +"@esbuild/darwin-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz#2d0d9414f2acbffd2d86e98253914fca603a53dd" + integrity sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw== + "@esbuild/darwin-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz#42829168730071c41ef0d028d8319eea0e2904b4" @@ -1929,6 +1954,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz#e37d9633246d52aecf491ee916ece709f9d5f4cd" integrity sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A== +"@esbuild/darwin-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz#33087aab31a1eb64c89daf3d2cf8ce1775656107" + integrity sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA== + "@esbuild/freebsd-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz#1f4af488bfc7e9ced04207034d398e793b570a27" @@ -1949,6 +1979,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz#1ee4d8b682ed363b08af74d1ea2b2b4dbba76487" integrity sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA== +"@esbuild/freebsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz#bb76e5ea9e97fa3c753472f19421075d3a33e8a7" + integrity sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA== + "@esbuild/freebsd-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz#636306f19e9bc981e06aa1d777302dad8fddaf72" @@ -1969,6 +2004,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz#37a693553d42ff77cd7126764b535fb6cc28a11c" integrity sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg== +"@esbuild/freebsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz#e0e2ce9249fdf6ee29e5dc3d420c7007fa579b93" + integrity sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ== + "@esbuild/linux-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz#a003f7ff237c501e095d4f3a09e58fc7b25a4aca" @@ -1989,6 +2029,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz#be9b145985ec6c57470e0e051d887b09dddb2d4b" integrity sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA== +"@esbuild/linux-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz#d1b2aa58085f73ecf45533c07c82d81235388e75" + integrity sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g== + "@esbuild/linux-arm@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz#b591e6a59d9c4fe0eeadd4874b157ab78cf5f196" @@ -2009,6 +2054,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz#207ecd982a8db95f7b5279207d0ff2331acf5eef" integrity sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w== +"@esbuild/linux-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz#8e4915df8ea3e12b690a057e77a47b1d5935ef6d" + integrity sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw== + "@esbuild/linux-ia32@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz#24333a11027ef46a18f57019450a5188918e2a54" @@ -2029,6 +2079,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz#d0d86b5ca1562523dc284a6723293a52d5860601" integrity sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA== +"@esbuild/linux-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz#8200b1110666c39ab316572324b7af63d82013fb" + integrity sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA== + "@esbuild/linux-loong64@0.14.54": version "0.14.54" resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028" @@ -2054,6 +2109,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz#9a37f87fec4b8408e682b528391fa22afd952299" integrity sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA== +"@esbuild/linux-loong64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz#6ff0c99cf647504df321d0640f0d32e557da745c" + integrity sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g== + "@esbuild/linux-mips64el@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz#4e5967a665c38360b0a8205594377d4dcf9c3726" @@ -2074,6 +2134,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz#4ddebd4e6eeba20b509d8e74c8e30d8ace0b89ec" integrity sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w== +"@esbuild/linux-mips64el@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz#3f720ccd4d59bfeb4c2ce276a46b77ad380fa1f3" + integrity sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA== + "@esbuild/linux-ppc64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz#206443a02eb568f9fdf0b438fbd47d26e735afc8" @@ -2094,6 +2159,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz#adb67dadb73656849f63cd522f5ecb351dd8dee8" integrity sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg== +"@esbuild/linux-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz#9d6b188b15c25afd2e213474bf5f31e42e3aa09e" + integrity sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ== + "@esbuild/linux-riscv64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz#c351e433d009bf256e798ad048152c8d76da2fc9" @@ -2114,6 +2184,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz#11bc0698bf0a2abf8727f1c7ace2112612c15adf" integrity sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg== +"@esbuild/linux-riscv64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz#f989fdc9752dfda286c9cd87c46248e4dfecbc25" + integrity sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw== + "@esbuild/linux-s390x@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz#661f271e5d59615b84b6801d1c2123ad13d9bd87" @@ -2134,6 +2209,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz#e86fb8ffba7c5c92ba91fc3b27ed5a70196c3cc8" integrity sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg== +"@esbuild/linux-s390x@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz#29ebf87e4132ea659c1489fce63cd8509d1c7319" + integrity sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g== + "@esbuild/linux-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz#e4ba18e8b149a89c982351443a377c723762b85f" @@ -2154,6 +2234,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz#5f37cfdc705aea687dfe5dfbec086a05acfe9c78" integrity sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg== +"@esbuild/linux-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz#4af48c5c0479569b1f359ffbce22d15f261c0cef" + integrity sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA== + "@esbuild/netbsd-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz#7d4f4041e30c5c07dd24ffa295c73f06038ec775" @@ -2174,6 +2259,16 @@ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz#29da566a75324e0d0dd7e47519ba2f7ef168657b" integrity sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA== +"@esbuild/netbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz#1ae73d23cc044a0ebd4f198334416fb26c31366c" + integrity sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg== + +"@esbuild/openbsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz#5d904a4f5158c89859fd902c427f96d6a9e632e2" + integrity sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg== + "@esbuild/openbsd-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz#970fa7f8470681f3e6b1db0cc421a4af8060ec35" @@ -2194,6 +2289,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz#306c0acbdb5a99c95be98bdd1d47c916e7dc3ff0" integrity sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw== +"@esbuild/openbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz#4c8aa88c49187c601bae2971e71c6dc5e0ad1cdf" + integrity sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q== + "@esbuild/sunos-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz#abc60e7c4abf8b89fb7a4fe69a1484132238022c" @@ -2214,6 +2314,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz#0933eaab9af8b9b2c930236f62aae3fc593faf30" integrity sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA== +"@esbuild/sunos-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz#8ddc35a0ea38575fa44eda30a5ee01ae2fa54dd4" + integrity sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA== + "@esbuild/win32-arm64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz#7b0ff9e8c3265537a7a7b1fd9a24e7bd39fcd87a" @@ -2234,6 +2339,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz#773bdbaa1971b36db2f6560088639ccd1e6773ae" integrity sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A== +"@esbuild/win32-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz#6e79c8543f282c4539db684a207ae0e174a9007b" + integrity sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA== + "@esbuild/win32-ia32@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz#e90fe5267d71a7b7567afdc403dfd198c292eb09" @@ -2254,6 +2364,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz#000516cad06354cc84a73f0943a4aa690ef6fd67" integrity sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ== +"@esbuild/win32-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz#057af345da256b7192d18b676a02e95d0fa39103" + integrity sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw== + "@esbuild/win32-x64@0.16.17": version "0.16.17" resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz#c5a1a4bfe1b57f0c3e61b29883525c6da3e5c091" @@ -2274,6 +2389,11 @@ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz#c57c8afbb4054a3ab8317591a0b7320360b444ae" integrity sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA== +"@esbuild/win32-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz#168ab1c7e1c318b922637fad8f339d48b01e1244" + integrity sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA== + "@eslint/eslintrc@^0.4.3": version "0.4.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-0.4.3.tgz#9e42981ef035beb3dd49add17acb96e8ff6f394c" @@ -11483,6 +11603,36 @@ esbuild-windows-arm64@0.14.54: resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz#937d15675a15e4b0e4fafdbaa3a01a776a2be982" integrity sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg== +esbuild@0.24.0, esbuild@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.24.0.tgz#f2d470596885fcb2e91c21eb3da3b3c89c0b55e7" + integrity sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.24.0" + "@esbuild/android-arm" "0.24.0" + "@esbuild/android-arm64" "0.24.0" + "@esbuild/android-x64" "0.24.0" + "@esbuild/darwin-arm64" "0.24.0" + "@esbuild/darwin-x64" "0.24.0" + "@esbuild/freebsd-arm64" "0.24.0" + "@esbuild/freebsd-x64" "0.24.0" + "@esbuild/linux-arm" "0.24.0" + "@esbuild/linux-arm64" "0.24.0" + "@esbuild/linux-ia32" "0.24.0" + "@esbuild/linux-loong64" "0.24.0" + "@esbuild/linux-mips64el" "0.24.0" + "@esbuild/linux-ppc64" "0.24.0" + "@esbuild/linux-riscv64" "0.24.0" + "@esbuild/linux-s390x" "0.24.0" + "@esbuild/linux-x64" "0.24.0" + "@esbuild/netbsd-x64" "0.24.0" + "@esbuild/openbsd-arm64" "0.24.0" + "@esbuild/openbsd-x64" "0.24.0" + "@esbuild/sunos-x64" "0.24.0" + "@esbuild/win32-arm64" "0.24.0" + "@esbuild/win32-ia32" "0.24.0" + "@esbuild/win32-x64" "0.24.0" + esbuild@^0.14.47: version "0.14.54" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.54.tgz#8b44dcf2b0f1a66fc22459943dccf477535e9aa2" @@ -17006,6 +17156,11 @@ json5@^2.1.2, json5@^2.1.3, json5@^2.2.0, json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" + integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -27817,6 +27972,14 @@ worker-farm@^1.7.0: dependencies: errno "~0.1.7" +worker-loader@^3.0.8: + version "3.0.8" + resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-3.0.8.tgz#5fc5cda4a3d3163d9c274a4e3a811ce8b60dbb37" + integrity sha512-XQyQkIFeRVC7f7uRhFdNMe/iJOdO6zxAaR3EWbDp45v3mDhrTi+++oswKNxShUNjPC/1xUp5DB29YKLhFo129g== + dependencies: + loader-utils "^2.0.0" + schema-utils "^3.0.0" + "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"