diff --git a/package.json b/package.json index 0685ed40..396f940a 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@types/vscode": "^1.77.0", "@typescript-eslint/typescript-estree": "^6.0.0", "@vscode-use/createwebview": "^0.0.10", - "@vscode-use/utils": "^0.0.56", + "@vscode-use/utils": "^0.0.61", "@vue/compiler-sfc": "^3.3.4", "axios": "^1.6.0", "bing-translate-api": "^2.9.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4ffbad25..1830f64a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^0.0.10 version: 0.0.10 '@vscode-use/utils': - specifier: ^0.0.56 - version: 0.0.56 + specifier: ^0.0.61 + version: 0.0.61 '@vue/compiler-sfc': specifier: ^3.3.4 version: 3.3.4 @@ -863,8 +863,8 @@ packages: engines: {vscode: ^1.77.0} dev: true - /@vscode-use/utils@0.0.56: - resolution: {integrity: sha512-2neX569sIpnfQeXYxq9nQYZA3zoIARDIwTBQV/WdyglmIpLbelpeDjwSOjZhZaN6m11VYtAfIGkksOugJFQkxA==} + /@vscode-use/utils@0.0.61: + resolution: {integrity: sha512-vRRICRlIZUAI3z+P90oqPhrlkXYDVpDOMWC+dASVnTH2ZMdJcd9TTxLc073nK9AL54c2LOAxeE6nf+Q0Otvvyw==} engines: {vscode: ^1.77.0} dev: true diff --git a/scripts/generateIndex.ts b/scripts/generateIndex.ts index 71c6b66e..c9f46e8a 100644 --- a/scripts/generateIndex.ts +++ b/scripts/generateIndex.ts @@ -4,14 +4,21 @@ const fg = require('fast-glob') const fsp = require('node:fs/promises') export async function run() { - const folder = 'src/ui/arcoDesignVue' - const name = 'arcoDesignVue2' + const folder = 'src/ui/antDesignVue' + const name = 'antDesignVue4' const isHyphen = true /** 生成的模板中的使用是 true ? a-affix : AAfix */ const url = path.resolve(root, `${folder}/${name}`) const entry = await fg(['**/*.json'], { dot: true, cwd: url }) const imports = entry.map((_url: string) => `import ${_url.split('.')[0]} from './${_url}'`) + let prefix = '' + debugger const map = entry.map((_url: string) => { - return `[${_url.split('.')[0]}, "xx", "<${_url.split('.')[0]}>"],` + let tagName = 'A'+_url.split('.')[0] + if (isHyphen) { + tagName = hyphenate(tagName) + prefix = '\'' + tagName.split('-')[0] + '\'' + } + return `[${_url.split('.')[0]}, ${_url.split('.')[0]}.name, "<${tagName}>"],` }) const template = `import { componentsReducer, propsReducer } from '../../utils' @@ -29,10 +36,15 @@ export function ${name}Components() { const map = [ ${map.join('\n ')} ] - return componentsReducer(map, ${isHyphen}) + return componentsReducer(map, ${isHyphen}, ${prefix}) } ` fsp.writeFile(path.resolve(root, `${folder}/${name}/index.ts`), template) } run() + + +function hyphenate(s: string): string { + return s.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '') +} diff --git a/src/index.ts b/src/index.ts index e98b8a67..66af79b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode' -import { addEventListener, copyText, createCompletionItem, getActiveTextEditorLanguageId, getSelection, message, openExternalUrl, registerCommand, registerCompletionItemProvider } from '@vscode-use/utils' +import { addEventListener, createCompletionItem, getActiveText, getActiveTextEditorLanguageId, getSelection, message, openExternalUrl, registerCommand, registerCompletionItemProvider, setCopyText } from '@vscode-use/utils' import { CreateWebview } from '@vscode-use/createwebview' import { findPkgUI, parser } from './utils' import UI from './ui' @@ -34,11 +34,12 @@ export function activate(context: vscode.ExtensionContext) { findUI() })) context.subscriptions.push(registerCommand('intellisense.copyDemo', () => { - copyText(global.commonIntellisense.copyDom) + setCopyText(global.commonIntellisense.copyDom) message.info('copy successfully') })) findUI() + context.subscriptions.push(registerCompletionItemProvider(filter, (document, position) => { const { lineText } = getSelection()! const p: any = position @@ -57,6 +58,7 @@ export function activate(context: vscode.ExtensionContext) { const lan = getActiveTextEditorLanguageId() const isVue = lan === 'vue' + const deps = optionsComponents.prefix.length ? getImportDeps(getActiveText()!) : undefined const { character } = position const isPreEmpty = lineText[character - 1] === ' ' const isValue = result.isValue @@ -94,7 +96,27 @@ export function activate(context: vscode.ExtensionContext) { return UiCompletions.icons const propName = result.propName - const { events, completions } = UiCompletions[name] + let target = UiCompletions[name] + if (!target) { + const prefix = optionsComponents.prefix + let flag = false + for (const d in deps) { + const n = deps[d] + for (const p of prefix) { + const t = UiCompletions[p.toUpperCase() + n] + if (t) { + target = t + flag = true + break + } + } + if (flag) + break + } + } + if (!target) + return + const { events, completions } = target if (!completionsCallbacks.has(name)) { const _events = events[0]() eventCallbacks.set(name, _events) @@ -188,10 +210,12 @@ export function activate(context: vscode.ExtensionContext) { return optionsComponents.data } }, ['"', '\'', '-', ' ', '@', '.'])) + const provider = new CreateWebview(context.extensionUri, { viewColumn: vscode.ViewColumn.Beside, scripts: ['main.js'], }) + context.subscriptions.push(registerCommand('intellisense.openDocument', (args) => { // 注册全局的link点击时间 const url = args.link @@ -224,6 +248,7 @@ export function activate(context: vscode.ExtensionContext) { } }) })) + context.subscriptions.push(registerCommand('intellisense.openDocumentExternal', (args) => { // 注册全局的link点击时间 const url = args.link @@ -231,6 +256,7 @@ export function activate(context: vscode.ExtensionContext) { return openExternalUrl(url) })) + const LANS = ['javascriptreact', 'typescript', 'typescriptreact', 'vue', 'svelte', 'solid', 'swan', 'react', 'js', 'ts', 'tsx', 'jsx'] context.subscriptions.push(vscode.languages.registerHoverProvider(LANS, { @@ -243,7 +269,17 @@ export function activate(context: vscode.ExtensionContext) { if (!optionsComponents.data.length || !word) return new vscode.Hover('') - const target = UiCompletions[toCamel(word)[0].toUpperCase() + toCamel(word).slice(1)] + let target = UiCompletions[toCamel(word)[0].toUpperCase() + toCamel(word).slice(1)] + if (!target) { + const prefix = optionsComponents.prefix + for (const p of prefix) { + const t = UiCompletions[p.toUpperCase() + word] + if (t) { + target = t + break + } + } + } if (!target) return @@ -323,3 +359,19 @@ function isSamePrefix(label: string, key: string) { } return labelName === key } + +const IMPORT_REG = /import\s+{([^\}]+)}\s+from\s+['"]([^"']+)['"]/g +function getImportDeps(text: string) { + const deps: Record = {} + for (const match of text.matchAll(IMPORT_REG)) { + if (!match) + continue + const from = match[2] + if (/^[\.\/\@]/.test(from)) + continue + if (!UINames.map((i: string) => i.replace(/[0-9]/g, '')).includes(toCamel(from))) + continue + deps[from] = match[1].replace(/\s/g, '').split(',') + } + return deps +} diff --git a/src/ui/antDesignVue/antDesignVue4/index.ts b/src/ui/antDesignVue/antDesignVue4/index.ts index 707ac5cc..1b7925d4 100644 --- a/src/ui/antDesignVue/antDesignVue4/index.ts +++ b/src/ui/antDesignVue/antDesignVue4/index.ts @@ -1,428 +1,320 @@ -import { getLocale } from '@vscode-use/utils' import { componentsReducer, propsReducer } from '../../utils' -import AAffix from './Affix.json' -import AAlert from './Alert.json' -import AAnchor from './Anchor.json' -import AAutoComplete from './AutoComplete.json' -import AAvatar from './Avatar.json' -import AAvatarGroup from './AvatarGroup.json' -import ABackTop from './BackTop.json' -import ABadge from './Badge.json' -import ABadgeRibbon from './BadgeRibbon.json' -import ABreadcrumb from './Breadcrumb.json' -import ABreadcrumbItem from './BreadcrumbItem.json' -import ABreadcrumbSeparator from './BreadcrumbSeparator.json' -import AButton from './Button.json' -import ACalendar from './Calendar.json' -import ACard from './Card.json' -import ACardMeta from './CardMeta.json' -import ACarousel from './Carousel.json' -import ACascader from './Cascader.json' -import ACheckableTag from './CheckableTag.json' -import ACheckbox from './Checkbox.json' -import ACheckboxGroup from './CheckboxGroup.json' -import ACol from './Col.json' -import ACollapse from './Collapse.json' -import ACollapsePanel from './CollapsePanel.json' -import AComment from './Comment.json' -import AConfigProvider from './ConfigProvider.json' -import ADatePicker from './DatePicker.json' -import ADescriptions from './Descriptions.json' -import ADescriptionsItem from './DescriptionsItem.json' -import ADivider from './Divider.json' -import ADrawer from './Drawer.json' -import ADropdown from './Dropdown.json' -import ADropdownButton from './DropdownButton.json' -import AEmpty from './Empty.json' -import AFloatButton from './FloatButton.json' -import AFloatButtonGroup from './FloatButtonGroup.json' -import AForm from './Form.json' -import AFormItem from './FormItem.json' -import AImage from './Image.json' -import AInput from './Input.json' -import AInputGroup from './InputGroup.json' -import AInputNumber from './InputNumber.json' -import AInputPassword from './InputPassword.json' -import AInputSearch from './InputSearch.json' -import ALayout from './Layout.json' -import ALayoutSider from './LayoutSider.json' -import AList from './List.json' -import AListItem from './ListItem.json' -import AListItemMeta from './ListItemMeta.json' -import AMentions from './Mentions.json' -import AMenu from './Menu.json' -import AModal from './Modal.json' -import APageHeader from './PageHeader.json' -import APagination from './Pagination.json' -import APopconfirm from './Popconfirm.json' -import APopover from './Popover.json' -import AProgress from './Progress.json' -import AQrcode from './Qrcode.json' -import ARadio from './Radio.json' -import ARadioButton from './RadioButton.json' -import ARadioGroup from './RadioGroup.json' -import ARangePicker from './RangePicker.json' -import ARate from './Rate.json' -import AResult from './Result.json' -import ARow from './Row.json' -import ASegmented from './Segmented.json' -import ASelect from './Select.json' -import ASelectOption from './SelectOption.json' -import ASelectOptionGroup from './SelectOptionGroup.json' -import ASkeleton from './Skeleton.json' -import ASlider from './Slider.json' -import ASpace from './Space.json' -import ASpaceCompact from './SpaceCompact.json' -import ASpin from './Spin.json' -import AStatistic from './Statistic.json' -import AStatisticCountdown from './StatisticCountdown.json' -import ASteps from './Steps.json' -import ASwitch from './Switch.json' -import ATable from './Table.json' -import ATableColumn from './TableColumn.json' -import ATabPane from './TabPane.json' -import ATabs from './Tabs.json' -import ATag from './Tag.json' -import ATextarea from './Textarea.json' -import ATimeline from './Timeline.json' -import ATimelineItem from './TimelineItem.json' -import ATimePicker from './TimePicker.json' -import ATooltip from './Tooltip.json' -import ATour from './Tour.json' -import ATransfer from './Transfer.json' -import ATree from './Tree.json' -import ATreeSelect from './TreeSelect.json' -import ATypography from './Typography.json' -import ATypographyLink from './TypographyLink.json' -import ATypographyParagraph from './TypographyParagraph.json' -import ATypographyText from './TypographyText.json' -import ATypographyTitle from './TypographyTitle.json' -import AUpload from './Upload.json' -import AWatermark from './Watermark.json' -import ALayoutContent from './LayoutContent.json' -import ALayoutFooter from './LayoutFooter.json' -import ALayoutHeader from './LayoutHeader.json' +import Affix from './Affix.json' +import Alert from './Alert.json' +import Anchor from './Anchor.json' +import AutoComplete from './AutoComplete.json' +import Avatar from './Avatar.json' +import AvatarGroup from './AvatarGroup.json' +import BackTop from './BackTop.json' +import Badge from './Badge.json' +import BadgeRibbon from './BadgeRibbon.json' +import Breadcrumb from './Breadcrumb.json' +import BreadcrumbItem from './BreadcrumbItem.json' +import BreadcrumbSeparator from './BreadcrumbSeparator.json' +import Button from './Button.json' +import Calendar from './Calendar.json' +import Card from './Card.json' +import CardMeta from './CardMeta.json' +import Carousel from './Carousel.json' +import Cascader from './Cascader.json' +import CheckableTag from './CheckableTag.json' +import Checkbox from './Checkbox.json' +import CheckboxGroup from './CheckboxGroup.json' +import Col from './Col.json' +import Collapse from './Collapse.json' +import CollapsePanel from './CollapsePanel.json' +import Comment from './Comment.json' +import ConfigProvider from './ConfigProvider.json' +import DatePicker from './DatePicker.json' +import Descriptions from './Descriptions.json' +import DescriptionsItem from './DescriptionsItem.json' +import Divider from './Divider.json' +import Drawer from './Drawer.json' +import Dropdown from './Dropdown.json' +import DropdownButton from './DropdownButton.json' +import Empty from './Empty.json' +import FloatButton from './FloatButton.json' +import FloatButtonGroup from './FloatButtonGroup.json' +import Form from './Form.json' +import FormItem from './FormItem.json' +import Image from './Image.json' +import Input from './Input.json' +import InputGroup from './InputGroup.json' +import InputNumber from './InputNumber.json' +import InputPassword from './InputPassword.json' +import InputSearch from './InputSearch.json' +import Layout from './Layout.json' +import LayoutContent from './LayoutContent.json' +import LayoutFooter from './LayoutFooter.json' +import LayoutHeader from './LayoutHeader.json' +import LayoutSider from './LayoutSider.json' +import List from './List.json' +import ListItem from './ListItem.json' +import ListItemMeta from './ListItemMeta.json' +import Mentions from './Mentions.json' +import Menu from './Menu.json' +import Modal from './Modal.json' +import PageHeader from './PageHeader.json' +import Pagination from './Pagination.json' +import Popconfirm from './Popconfirm.json' +import Popover from './Popover.json' +import Progress from './Progress.json' +import Qrcode from './Qrcode.json' +import Radio from './Radio.json' +import RadioButton from './RadioButton.json' +import RadioGroup from './RadioGroup.json' +import RangePicker from './RangePicker.json' +import Rate from './Rate.json' +import Result from './Result.json' +import Row from './Row.json' +import Segmented from './Segmented.json' +import Select from './Select.json' +import SelectOption from './SelectOption.json' +import SelectOptionGroup from './SelectOptionGroup.json' +import Skeleton from './Skeleton.json' +import Slider from './Slider.json' +import Space from './Space.json' +import SpaceCompact from './SpaceCompact.json' +import Spin from './Spin.json' +import Statistic from './Statistic.json' +import StatisticCountdown from './StatisticCountdown.json' +import Steps from './Steps.json' +import Switch from './Switch.json' +import TabPane from './TabPane.json' +import Table from './Table.json' +import TableColumn from './TableColumn.json' +import Tabs from './Tabs.json' +import Tag from './Tag.json' +import Textarea from './Textarea.json' +import TimePicker from './TimePicker.json' +import Timeline from './Timeline.json' +import TimelineItem from './TimelineItem.json' +import Tooltip from './Tooltip.json' +import Tour from './Tour.json' +import Transfer from './Transfer.json' +import Tree from './Tree.json' +import TreeSelect from './TreeSelect.json' +import Typography from './Typography.json' +import TypographyLink from './TypographyLink.json' +import TypographyParagraph from './TypographyParagraph.json' +import TypographyText from './TypographyText.json' +import TypographyTitle from './TypographyTitle.json' +import Upload from './Upload.json' +import Watermark from './Watermark.json' export function antDesignVue4() { const map: any = [ - AAffix, - AAlert, - AAnchor, - AAutoComplete, - AAvatar, - AAvatarGroup, - ABackTop, - ABadge, - ABadgeRibbon, - ABreadcrumb, - ABreadcrumbItem, - ABreadcrumbSeparator, - AButton, - ACalendar, - ACard, - ACardMeta, - ACarousel, - ACascader, - ACheckableTag, - ACheckbox, - ACheckboxGroup, - ACol, - ACollapse, - ACollapsePanel, - AComment, - AConfigProvider, - ADatePicker, - ADescriptions, - ADescriptionsItem, - ADivider, - ADrawer, - ADropdown, - ADropdownButton, - AEmpty, - AFloatButton, - AFloatButtonGroup, - AForm, - AFormItem, - AImage, - AInput, - AInputGroup, - AInputNumber, - AInputPassword, - AInputSearch, - ALayout, - ALayoutSider, - AList, - AListItem, - AListItemMeta, - AMentions, - AMenu, - AModal, - APageHeader, - APagination, - APopconfirm, - APopover, - AProgress, - AQrcode, - ARadio, - ARadioButton, - ARadioGroup, - ARangePicker, - ARate, - AResult, - ARow, - ASegmented, - ASelect, - ASelectOption, - ASelectOptionGroup, - ASkeleton, - ASlider, - ASpace, - ASpaceCompact, - ASpin, - AStatistic, - AStatisticCountdown, - ASteps, - ASwitch, - ATable, - ATableColumn, - ATabPane, - ATabs, - ATag, - ATextarea, - ATimeline, - ATimelineItem, - ATimePicker, - ATooltip, - ATour, - ATransfer, - ATree, - ATreeSelect, - ATypography, - ATypographyLink, - ATypographyParagraph, - ATypographyText, - ATypographyTitle, - AUpload, - AWatermark, - ALayoutContent, - ALayoutFooter, - ALayoutHeader, + Affix, + Alert, + Anchor, + AutoComplete, + Avatar, + AvatarGroup, + BackTop, + Badge, + BadgeRibbon, + Breadcrumb, + BreadcrumbItem, + BreadcrumbSeparator, + Button, + Calendar, + Card, + CardMeta, + Carousel, + Cascader, + CheckableTag, + Checkbox, + CheckboxGroup, + Col, + Collapse, + CollapsePanel, + Comment, + ConfigProvider, + DatePicker, + Descriptions, + DescriptionsItem, + Divider, + Drawer, + Dropdown, + DropdownButton, + Empty, + FloatButton, + FloatButtonGroup, + Form, + FormItem, + Image, + Input, + InputGroup, + InputNumber, + InputPassword, + InputSearch, + Layout, + LayoutContent, + LayoutFooter, + LayoutHeader, + LayoutSider, + List, + ListItem, + ListItemMeta, + Mentions, + Menu, + Modal, + PageHeader, + Pagination, + Popconfirm, + Popover, + Progress, + Qrcode, + Radio, + RadioButton, + RadioGroup, + RangePicker, + Rate, + Result, + Row, + Segmented, + Select, + SelectOption, + SelectOptionGroup, + Skeleton, + Slider, + Space, + SpaceCompact, + Spin, + Statistic, + StatisticCountdown, + Steps, + Switch, + TabPane, + Table, + TableColumn, + Tabs, + Tag, + Textarea, + TimePicker, + Timeline, + TimelineItem, + Tooltip, + Tour, + Transfer, + Tree, + TreeSelect, + Typography, + TypographyLink, + TypographyParagraph, + TypographyText, + TypographyTitle, + Upload, + Watermark, ] - return propsReducer(map) + return propsReducer('ant-design-vue', map) } export function antDesignVue4Components() { - const isZh = getLocale().includes('zh') - - const map = isZh - ? [ - [ARow, '栅格布局'], - [AQrcode, '二维码'], - [ACol, '栅格布局'], - [ALayoutContent, '内容部分,自带默认样式,其下可嵌套任何元素,只能放在 Layout 中'], - [ALayoutHeader, '顶部布局,自带默认样式,其下可嵌套任何元素,只能放在 Layout 中。'], - [ALayoutSider, '侧边栏,自带默认样式及基本功能,其下可嵌套任何元素,只能放在 Layout 中。'], - [ALayout, '布局容器,其下可嵌套 Header Sider Content Footer 或 Layout 本身,可以放在任何父容器中。'], - [ALayoutFooter, '底部布局,自带默认样式,其下可嵌套任何元素,只能放在 Layout 中。'], - [AButton, '按钮'], - [ASpace, '间距 设置组件之间的间距'], - [ASpaceCompact, '紧凑布局组合 使用 Space.Compact 让表单组件之间紧凑连接且合并边框'], - [AAnchor, '锚点'], - [AAutoComplete, '输入字段的自动完成功能'], - [ARadio, '单选框'], - [ARadioGroup, '单选框组'], - [ARadioButton, '按钮样式的单选组合'], - [ACheckbox, '多选框'], - [ACheckboxGroup, '多选框组'], - [AInput, '输入框'], - [AInputPassword, '密码框'], - [AInputSearch, '搜索框 带有搜索按钮的输入框'], - [AInputGroup, '输入框组 Input.Group 中所有的 Input 的大小,可选 large default small'], - [AInputNumber, '计数器'], - [ASelect, '选择器'], - [ASelectOption, '基础多选'], - [ASegmented, '分段控制器 用于展示多个选项并允许用户选择其中单个选项'], - [ATypographyParagraph, '排版段落'], - [ATypographyText, '排版文本'], - [ATypographyTitle, '排版标题'], - [ATypographyLink, '排版超链接'], - [ATypography, '排版'], - [ASelectOptionGroup, '备选项进行分组展示'], - [ACascader, '级联选择器'], - [ACheckableTag, '进行标记和分类的小标签。'], - [ASwitch, '开关'], - [ASlider, '滑块'], - [ATimePicker, '时间选择器'], - [ARangePicker, '时间范围选择器'], - [ADatePicker, '日期选择器/日期时间选择器'], - [AUpload, '上传'], - [ASpin, '加载中 用于页面和区块的加载中状态'], - [ARate, '评分'], - [AAffix, '固钉 将页面元素钉在可视范围'], - [AConfigProvider, '全局化配置 为组件提供统一的全局化配置'], - [AFloatButton, '悬浮按钮 自 4.0.0 版本开始提供该组件'], - [AFloatButtonGroup, '浮动按钮组 自 4.0.0 版本开始提供该组件'], - [ABackTop, '回到顶部'], - [ATextarea, '适应文本高度的文本域'], - [AWatermark, '水印 给页面的某个区域加上水印'], - [ATransfer, '穿梭框'], - [AForm, '表单'], - [AFormItem, '表单项'], - [ATable, '表格'], - [ATableColumn, '表格项'], - [ATag, '标签'], - [AProgress, '进度条'], - [ATree, '树形控件'], - [ATreeSelect, '树型选择控件。'], - [APagination, '分页'], - [ABadge, '标记'], - [ABadgeRibbon, '缎带型的徽标'], - [AAvatar, '头像'], - [AAvatarGroup, '头像组合展现'], - [ASkeleton, '骨架屏'], - [AEmpty, '空状态'], - [ADescriptions, '描述列表'], - [ADescriptionsItem, '描述列表项'], - [AResult, '结果'], - [AStatistic, '统计数值'], - [AStatisticCountdown, '统计数值'], - [AAlert, '警告'], - [AMenu, '导航菜单'], - [ATabs, '标签页'], - [ATabPane, '标签项'], - [ABreadcrumb, '面包屑'], - [ABreadcrumbItem, '面包屑项'], - [ABreadcrumbSeparator, '可以自定义分隔符的面包屑项'], - [APageHeader, '页头'], - [ADropdown, '下拉菜单'], - [ADropdownButton, '带下拉框的按钮'], - [ASteps, '步骤条'], - [ATooltip, '文字提示'], - [APopover, '弹出框'], - [APopconfirm, '气泡确认框'], - [ATour, '漫游式引导 常用于引导用户了解产品功能'], - [ACard, '卡片'], - [ACardMeta, '卡片 可以利用 Card.Meta 支持更灵活的内容'], - [ACarousel, '走马灯'], - [ACollapse, '折叠面板'], - [ACollapsePanel, '折叠面板项'], - [ATimeline, '时间线'], - [ATimelineItem, '时间线项'], - [ADivider, '分割线 区隔内容的分割线'], - [ACalendar, '日历'], - [AImage, '图片'], - [ADrawer, '抽屉'], - [AModal, '对话框'], - [AMentions, '提及 用于在输入中提及某人或某事,常用于发布、聊天或评论功能'], - [AComment, '评论 对网站内容的反馈、评价和讨论'], - [AList, '列表 最基础的列表展示,可承载文字、列表、图片、段落,常用于后台数据展示页面'], - [AListItem, '列表项'], - [AListItemMeta, '列表元素图'], - ] - : [ - [ARow, 'grid layout'], - [AQrcode, 'QR code'], - [ACol, 'Grid layout'], - [ALayoutContent, 'The content part has its own default style. Any elements can be nested under it and can only be placed in Layout'], - [ALayoutHeader, 'The top layout has its own default style. Any element can be nested under it and can only be placed in Layout. '], - [ALayoutSider, 'Sidebar has its own default style and basic functions. Any element can be nested under it and can only be placed in Layout. '], - [ALayout, 'Layout container, under which Header Sider Content Footer or Layout itself can be nested, and can be placed in any parent container. '], - [ALayoutFooter, 'Bottom layout, with its own default style, any element can be nested under it, and can only be placed in Layout. '], - [AButton, 'button'], - [ASpace, 'Spacing sets the spacing between components'], - [ASpaceCompact, 'Compact layout combination uses Space.Compact to compactly connect form components and merge borders'], - [AAnchor, 'anchor'], - [AAutoComplete, 'Autocomplete function of input field.'], - [ARadio, 'radio button'], - [ARadioGroup, 'Radio group'], - [ARadioButton, 'Radio combination of button styles'], - [ACheckbox, 'Multiple checkbox'], - [ACheckboxGroup, 'Multiple checkbox group'], - [AInput, 'input box'], - [AInputPassword, 'password box'], - [AInputSearch, 'Search box input box with search button'], - [AInputGroup, 'The size of all Inputs in the input box group Input.Group, optional large default small'], - [AInputNumber, 'counter'], - [ASelect, 'selector'], - [ASelectOption, 'Basic multiple selection'], - [ASegmented, 'Segmented controller is used to display multiple options and allow the user to select a single option'], - [ATypographyParagraph, 'typography paragraph'], - [ATypographyText, 'typography text'], - [ATypographyTitle, 'typography title'], - [ATypographyLink, 'typography hyperlink'], - [ATypography, 'typography'], - [ASelectOptionGroup, 'Alternative options are displayed in groups'], - [ACascader, 'cascading selector'], - [ACheckableTag, 'Tag for categorizing or markup.'], - [ASwitch, 'switch'], - [ASlider, 'slider'], - [ATimePicker, 'time picker'], - [ARangePicker, 'time range picker'], - [ADatePicker, 'Date picker/date time picker'], - [AUpload, 'upload'], - [ASpin, 'Loading'], - [ARate, 'rating'], - [AAffix, 'Pin the page element to the visible range'], - [AConfigProvider, 'Global configuration provides unified global configuration for components'], - [AFloatButton, 'Floating button is available since version 4.0.0'], - [AFloatButtonGroup, 'Float button group is available since version 4.0.0'], - [ABackTop, 'back to top'], - [ATextarea, 'Text area that adapts to text height'], - [AWatermark, 'Watermark adds watermark to a certain area of the page'], - [ATransfer, 'shuttle box'], - [AForm, 'form'], - [AFormItem, 'form item'], - [ATable, 'table'], - [ATableColumn, 'table item'], - [ATag, 'tag'], - [AProgress, 'progress bar'], - [ATree, 'Tree control'], - [ATreeSelect, 'Tree selection control.'], - [APagination, 'pagination'], - [ABadge, 'mark'], - [ABadgeRibbon, 'ribbon-shaped logo'], - [AAvatar, 'avatar'], - [AAvatarGroup, 'Avatar group display'], - [ASkeleton, 'skeleton screen'], - [AEmpty, 'empty state'], - [ADescriptions, 'description list'], - [ADescriptionsItem, 'Description list item'], - [AResult, 'result'], - [AStatistic, 'statistical value'], - [AStatisticCountdown, 'statistical value'], - [AAlert, 'warning'], - [AMenu, 'Navigation menu'], - [ATabs, 'tabs'], - [ATabPane, 'tab item'], - [ABreadcrumb, 'breadcrumb'], - [ABreadcrumbItem, 'breadcrumb item'], - [ABreadcrumbSeparator, 'Breadcrumb items with customizable separators'], - [APageHeader, 'page header'], - [ADropdown, 'drop-down menu'], - [ADropdownButton, 'Button with dropdown box'], - [ASteps, 'step bar'], - [ATooltip, 'Text tip'], - [APopover, 'pop-up box'], - [APopconfirm, 'Bubble confirmation box'], - [ATour, 'Roaming guide is often used to guide users to understand product functions'], - [ACard, 'card'], - [ACardMeta, 'Cards can use Card.Meta to support more flexible content'], - [ACarousel, 'carousel'], - [ACollapse, 'collapse panel'], - [ACollapsePanel, 'collapse panel item'], - [ATimeline, 'timeline'], - [ATimelineItem, 'Timeline item'], - [ADivider, 'Divider line The dividing line that separates content'], - [ACalendar, 'calendar'], - [AImage, 'image'], - [ADrawer, 'drawer'], - [AModal, 'dialog'], - [AMentions, 'Mentions are used to mention someone or something in the input, often used in publishing, chat or comment functions'], - [AComment, 'Comment Feedback, evaluation and discussion of website content'], - [AList, 'List is the most basic list display, which can carry text, lists, pictures, paragraphs, and is often used in background data display pages'], - [AListItem, 'list item'], - [AListItemMeta, 'List element graph'], - ] - return componentsReducer(map) + const map = [ + [Affix, Affix.name, ''], + [Alert, Alert.name, ''], + [Anchor, Anchor.name, ''], + [AutoComplete, AutoComplete.name, ''], + [Avatar, Avatar.name, ''], + [AvatarGroup, AvatarGroup.name, ''], + [BackTop, BackTop.name, ''], + [Badge, Badge.name, ''], + [BadgeRibbon, BadgeRibbon.name, ''], + [Breadcrumb, Breadcrumb.name, ''], + [BreadcrumbItem, BreadcrumbItem.name, ''], + [BreadcrumbSeparator, BreadcrumbSeparator.name, ''], + [Button, Button.name, ''], + [Calendar, Calendar.name, ''], + [Card, Card.name, ''], + [CardMeta, CardMeta.name, ''], + [Carousel, Carousel.name, ''], + [Cascader, Cascader.name, ''], + [CheckableTag, CheckableTag.name, ''], + [Checkbox, Checkbox.name, ''], + [CheckboxGroup, CheckboxGroup.name, ''], + [Col, Col.name, ''], + [Collapse, Collapse.name, ''], + [CollapsePanel, CollapsePanel.name, ''], + [Comment, Comment.name, ''], + [ConfigProvider, ConfigProvider.name, ''], + [DatePicker, DatePicker.name, ''], + [Descriptions, Descriptions.name, ''], + [DescriptionsItem, DescriptionsItem.name, ''], + [Divider, Divider.name, ''], + [Drawer, Drawer.name, ''], + [Dropdown, Dropdown.name, ''], + [DropdownButton, DropdownButton.name, ''], + [Empty, Empty.name, ''], + [FloatButton, FloatButton.name, ''], + [FloatButtonGroup, FloatButtonGroup.name, ''], + [Form, Form.name, ''], + [FormItem, FormItem.name, ''], + [Image, Image.name, ''], + [Input, Input.name, ''], + [InputGroup, InputGroup.name, ''], + [InputNumber, InputNumber.name, ''], + [InputPassword, InputPassword.name, ''], + [InputSearch, InputSearch.name, ''], + [Layout, Layout.name, ''], + [LayoutContent, LayoutContent.name, ''], + [LayoutFooter, LayoutFooter.name, ''], + [LayoutHeader, LayoutHeader.name, ''], + [LayoutSider, LayoutSider.name, ''], + [List, List.name, ''], + [ListItem, ListItem.name, ''], + [ListItemMeta, ListItemMeta.name, ''], + [Mentions, Mentions.name, ''], + [Menu, Menu.name, ''], + [Modal, Modal.name, ''], + [PageHeader, PageHeader.name, ''], + [Pagination, Pagination.name, ''], + [Popconfirm, Popconfirm.name, ''], + [Popover, Popover.name, ''], + [Progress, Progress.name, ''], + [Qrcode, Qrcode.name, ''], + [Radio, Radio.name, ''], + [RadioButton, RadioButton.name, ''], + [RadioGroup, RadioGroup.name, ''], + [RangePicker, RangePicker.name, ''], + [Rate, Rate.name, ''], + [Result, Result.name, ''], + [Row, Row.name, ''], + [Segmented, Segmented.name, ''], + [Select, Select.name, ''], + [SelectOption, SelectOption.name, ''], + [SelectOptionGroup, SelectOptionGroup.name, ''], + [Skeleton, Skeleton.name, ''], + [Slider, Slider.name, ''], + [Space, Space.name, ''], + [SpaceCompact, SpaceCompact.name, ''], + [Spin, Spin.name, ''], + [Statistic, Statistic.name, ''], + [StatisticCountdown, StatisticCountdown.name, ''], + [Steps, Steps.name, ''], + [Switch, Switch.name, ''], + [TabPane, TabPane.name, ''], + [Table, Table.name, ''], + [TableColumn, TableColumn.name, ''], + [Tabs, Tabs.name, ''], + [Tag, Tag.name, ''], + [Textarea, Textarea.name, ''], + [TimePicker, TimePicker.name, ''], + [Timeline, Timeline.name, ''], + [TimelineItem, TimelineItem.name, ''], + [Tooltip, Tooltip.name, ''], + [Tour, Tour.name, ''], + [Transfer, Transfer.name, ''], + [Tree, Tree.name, ''], + [TreeSelect, TreeSelect.name, ''], + [Typography, Typography.name, ''], + [TypographyLink, TypographyLink.name, ''], + [TypographyParagraph, TypographyParagraph.name, ''], + [TypographyText, TypographyText.name, ''], + [TypographyTitle, TypographyTitle.name, ''], + [Upload, Upload.name, ''], + [Watermark, Watermark.name, ''], + ] + return componentsReducer(map, true, 'a') } diff --git a/src/ui/antd/antd4/index.ts b/src/ui/antd/antd4/index.ts index 68ed3e9d..556b3847 100644 --- a/src/ui/antd/antd4/index.ts +++ b/src/ui/antd/antd4/index.ts @@ -169,7 +169,7 @@ export function antd4() { Spin, ] - return propsReducer(map) + return propsReducer('antd', map) } export function antd4Components() { diff --git a/src/ui/antd/antd5/index.ts b/src/ui/antd/antd5/index.ts index f00ad552..5aac0e07 100644 --- a/src/ui/antd/antd5/index.ts +++ b/src/ui/antd/antd5/index.ts @@ -203,7 +203,7 @@ export function antd5() { Flex, ] - return propsReducer(map) + return propsReducer('antd', map) } export function antd5Components() { diff --git a/src/ui/arcoDesign/arcoDesign2/index.ts b/src/ui/arcoDesign/arcoDesign2/index.ts index 2e18cc51..d5f76f3b 100644 --- a/src/ui/arcoDesign/arcoDesign2/index.ts +++ b/src/ui/arcoDesign/arcoDesign2/index.ts @@ -236,7 +236,7 @@ export function arcoDesign2() { YearPicker, ] - return propsReducer(map) + return propsReducer('@arco-design/web-react', map) } export function arcoDesign2Components() { diff --git a/src/ui/arcoDesignVue/arcoDesignVue2/index.ts b/src/ui/arcoDesignVue/arcoDesignVue2/index.ts index 3668c3f0..4300eb66 100644 --- a/src/ui/arcoDesignVue/arcoDesignVue2/index.ts +++ b/src/ui/arcoDesignVue/arcoDesignVue2/index.ts @@ -240,129 +240,129 @@ export function arcoDesignVue2() { YearPicker, ] - return propsReducer(map) + return propsReducer('@arco-design/web-vue', map) } export function arcoDesignVue2Components() { const map = [ - [Affix, '固钉', ''], - [Alert, '警告提示', ''], - [Anchor, '锚点', ''], - [AnchorLink, '锚点', ''], - [AutoComplete, '自动补全', ''], - [Avatar, '头像', ''], - [AvatarGroup, '头像', ''], - [BackTop, '返回顶部', ''], - [Badge, '徽标', ''], - [Breadcrumb, '面包屑', ''], - [BreadcrumbItem, '面包屑', ''], - [Button, '按钮', ''], - [ButtonGroup, '按钮', ''], - [Calendar, '日历', ''], - [Card, '卡片', ''], - [CardGrid, '卡片', ''], - [CardMeta, '卡片', ''], - [Carousel, '图片轮播', ''], - [Cascader, '级联选择', ''], - [CascaderPanel, '级联选择', ''], - [Checkbox, '复选框', ''], - [CheckboxGroup, '复选框', ''], - [Col, '列', ''], - [Collapse, '折叠面板', ''], - [CollapseItem, '折叠面板', ''], - [Comment, '评论', ''], - [ConfigProvider, '全局配置', ''], - [Countdown, '倒计时', ''], - [DatePicker, '日期选择器', ''], - [Descriptions, '描述', ''], - [DescriptionsItem, '描述', ''], - [Dgroup, '下拉菜单', ''], - [Divider, '分割线', ''], - [Doption, '下拉菜单', ''], - [Drawer, '抽屉', ''], - [Dropdown, '下拉菜单', ''], - [DropdownButton, '下拉菜单', ''], - [Dsubmenu, '下拉菜单', ''], - [Empty, '空列表', ''], - [Form, '表单', '
'], - [FormItem, '表单', ''], - [Grid, '栅格', ''], - [GridItem, '栅格', ''], - [Image, '图片', ''], - [ImagePreview, '图片', ''], - [ImagePreviewAction, '图片', ''], - [ImagePreviewGroup, '图片', ''], - [Input, '输入框', ''], - [InputNumber, '数字输入框', ''], - [InputPassword, '密码输入框', ''], - [InputSearch, '搜索输入', ''], - [InputTag, '标签输入框', ''], - [Layout, '布局', ''], - [LayoutContent, '布局', ''], - [LayoutFooter, '布局', ''], - [LayoutHeader, '布局', ''], - [LayoutSider, '布局', ''], - [Link, '链接', ''], - [List, '列表', ''], - [ListItem, '列表', ''], - [ListItemMeta, '列表', ''], - [Mention, '提及', ''], - [Menu, '菜单', ''], - [MenuItem, '菜单', ''], - [MenuItemGroup, '菜单', ''], - [Modal, '对话框', ''], - [MonthPicker, '日期选择器', ''], - [OverflowList, '折叠列表', ''], - [PageHeader, '页头', ''], - [Pagination, '分页', ''], - [Popconfirm, '气泡确认框', ''], - [Popover, '气泡卡片', ''], - [Progress, '进度条', ''], - [QuarterPicker, '日期选择器', ''], - [Radio, '按钮', ''], - [RadioGroup, '按钮组', ''], - [RangePicker, '日期选择器', ''], - [Rate, '评分', ''], - [ResizeBox, '伸缩框', ''], - [Result, '结果也', ''], - [Row, '行', ''], - [Scrollbar, '滚动条', ''], - [Select, '选择器', ''], - [SelectOptgroup, '选择器', ''], - [SelectOption, '选择器', ''], - [Skeleton, '骨架屏', ''], - [SkeletonLine, '骨架屏', ''], - [SkeletonShape, '骨架屏', ''], - [Slider, '滑动输入条', ''], - [Space, '间距', ''], - [Spin, '加载中', ''], - [Split, '面板分割', ''], - [Statistic, '数值显示', ''], - [Step, '步骤条', ''], - [Steps, '步骤条', ''], - [SubMenu, '菜单', ''], - [Switch, '开关', ''], - [TabPane, '标签页', ''], - [Table, '表格', '
'], - [TableColumn, '表格', ''], - [Tabs, '标签页', ''], - [Tag, '标签', ''], - [Textarea, '文本域', ''], - [TimePicker, '日期选择器', ''], - [Timeline, '时间线', ''], - [TimelineItem, '时间线', ''], - [Tooltip, '文字气泡', ''], - [Transfer, '穿梭框', ''], - [Tree, '树', ''], - [TreeSelect, '树选择', ''], - [Trigger, '触发器', ''], - [Typography, '排版', ''], - [TypographyParagraph, '排版', ''], - [TypographyTitle, '排版', ''], - [Upload, '上传', ''], - [Watermark, '水印', ''], - [WeekPicker, '日期选择器', ''], - [YearPicker, '日期选择器', ''], + [Affix, Affix.name, ''], + [Alert, Alert.name, ''], + [Anchor, Anchor.name, ''], + [AnchorLink, AnchorLink.name, ''], + [AutoComplete, AutoComplete.name, ''], + [Avatar, Avatar.name, ''], + [AvatarGroup, AvatarGroup.name, ''], + [BackTop, BackTop.name, ''], + [Badge, Badge.name, ''], + [Breadcrumb, Breadcrumb.name, ''], + [BreadcrumbItem, BreadcrumbItem.name, ''], + [Button, Button.name, ''], + [ButtonGroup, ButtonGroup.name, ''], + [Calendar, Calendar.name, ''], + [Card, Card.name, ''], + [CardGrid, CardGrid.name, ''], + [CardMeta, CardMeta.name, ''], + [Carousel, Carousel.name, ''], + [Cascader, Cascader.name, ''], + [CascaderPanel, CascaderPanel.name, ''], + [Checkbox, Checkbox.name, ''], + [CheckboxGroup, CheckboxGroup.name, ''], + [Col, Col.name, ''], + [Collapse, Collapse.name, ''], + [CollapseItem, CollapseItem.name, ''], + [Comment, Comment.name, ''], + [ConfigProvider, ConfigProvider.name, ''], + [Countdown, Countdown.name, ''], + [DatePicker, DatePicker.name, ''], + [Descriptions, Descriptions.name, ''], + [DescriptionsItem, DescriptionsItem.name, ''], + [Dgroup, Dgroup.name, ''], + [Divider, Divider.name, ''], + [Doption, Doption.name, ''], + [Drawer, Drawer.name, ''], + [Dropdown, Dropdown.name, ''], + [DropdownButton, DropdownButton.name, ''], + [Dsubmenu, Dsubmenu.name, ''], + [Empty, Empty.name, ''], + [Form, Form.name, ''], + [FormItem, FormItem.name, ''], + [Grid, Grid.name, ''], + [GridItem, GridItem.name, ''], + [Image, Image.name, ''], + [ImagePreview, ImagePreview.name, ''], + [ImagePreviewAction, ImagePreviewAction.name, ''], + [ImagePreviewGroup, ImagePreviewGroup.name, ''], + [Input, Input.name, ''], + [InputNumber, InputNumber.name, ''], + [InputPassword, InputPassword.name, ''], + [InputSearch, InputSearch.name, ''], + [InputTag, InputTag.name, ''], + [Layout, Layout.name, ''], + [LayoutContent, LayoutContent.name, ''], + [LayoutFooter, LayoutFooter.name, ''], + [LayoutHeader, LayoutHeader.name, ''], + [LayoutSider, LayoutSider.name, ''], + [Link, Link.name, ''], + [List, List.name, ''], + [ListItem, ListItem.name, ''], + [ListItemMeta, ListItemMeta.name, ''], + [Mention, Mention.name, ''], + [Menu, Menu.name, ''], + [MenuItem, MenuItem.name, ''], + [MenuItemGroup, MenuItemGroup.name, ''], + [Modal, Modal.name, ''], + [MonthPicker, MonthPicker.name, ''], + [OverflowList, OverflowList.name, ''], + [PageHeader, PageHeader.name, ''], + [Pagination, Pagination.name, ''], + [Popconfirm, Popconfirm.name, ''], + [Popover, Popover.name, ''], + [Progress, Progress.name, ''], + [QuarterPicker, QuarterPicker.name, ''], + [Radio, Radio.name, ''], + [RadioGroup, RadioGroup.name, ''], + [RangePicker, RangePicker.name, ''], + [Rate, Rate.name, ''], + [ResizeBox, ResizeBox.name, ''], + [Result, Result.name, ''], + [Row, Row.name, ''], + [Scrollbar, Scrollbar.name, ''], + [Select, Select.name, ''], + [SelectOptgroup, SelectOptgroup.name, ''], + [SelectOption, SelectOption.name, ''], + [Skeleton, Skeleton.name, ''], + [SkeletonLine, SkeletonLine.name, ''], + [SkeletonShape, SkeletonShape.name, ''], + [Slider, Slider.name, ''], + [Space, Space.name, ''], + [Spin, Spin.name, ''], + [Split, Split.name, ''], + [Statistic, Statistic.name, ''], + [Step, Step.name, ''], + [Steps, Steps.name, ''], + [SubMenu, SubMenu.name, ''], + [Switch, Switch.name, ''], + [TabPane, TabPane.name, ''], + [Table, Table.name, ''], + [TableColumn, TableColumn.name, ''], + [Tabs, Tabs.name, ''], + [Tag, Tag.name, ''], + [Textarea, Textarea.name, ''], + [TimePicker, TimePicker.name, ''], + [Timeline, Timeline.name, ''], + [TimelineItem, TimelineItem.name, ''], + [Tooltip, Tooltip.name, ''], + [Transfer, Transfer.name, ''], + [Tree, Tree.name, ''], + [TreeSelect, TreeSelect.name, ''], + [Trigger, Trigger.name, ''], + [Typography, Typography.name, ''], + [TypographyParagraph, TypographyParagraph.name, ''], + [TypographyTitle, TypographyTitle.name, ''], + [Upload, Upload.name, ''], + [Watermark, Watermark.name, ''], + [WeekPicker, WeekPicker.name, ''], + [YearPicker, YearPicker.name, ''], ] - return componentsReducer(map) + return componentsReducer(map, true, 'a') } diff --git a/src/ui/chakraUi/chakra-ui-react/index.ts b/src/ui/chakraUi/chakra-ui-react/index.ts index 62e6cfe0..f8286895 100644 --- a/src/ui/chakraUi/chakra-ui-react/index.ts +++ b/src/ui/chakraUi/chakra-ui-react/index.ts @@ -28,7 +28,7 @@ export function chakraUiReact2() { IconButton, ] - return propsReducer(map) + return propsReducer('@chakra-ui/react', map) } export function chakraUiReact2Components() { diff --git a/src/ui/chakraUi/chakra-ui-vue/index.ts b/src/ui/chakraUi/chakra-ui-vue/index.ts index 365ec4d4..e880933c 100644 --- a/src/ui/chakraUi/chakra-ui-vue/index.ts +++ b/src/ui/chakraUi/chakra-ui-vue/index.ts @@ -6,7 +6,7 @@ export function chakraUiVue0() { Accordion, ] - return propsReducer(map) + return propsReducer('@chakra-ui/vue', map) } export function chakraUiVue0Components() { diff --git a/src/ui/elementUI/elementUi2/index.ts b/src/ui/elementUI/elementUi2/index.ts index a2a241ba..0a43e6a5 100644 --- a/src/ui/elementUI/elementUi2/index.ts +++ b/src/ui/elementUI/elementUi2/index.ts @@ -445,7 +445,7 @@ export function elementUi2(extensionContext: any) { 'ice-cream-round', ] - return propsReducer(map, { prefix: 'el-icon', type: 'elementUi', icons }, extensionContext) + return propsReducer('element-ui', map, { prefix: 'el-icon', type: 'elementUi', icons }, extensionContext) } export function elementUi2Components() { @@ -1231,5 +1231,5 @@ export function elementUi2Components() { '', ], ] - return componentsReducer(map) + return componentsReducer(map, true, 'el') } diff --git a/src/ui/elementUi/elementUi2/index.ts b/src/ui/elementUi/elementUi2/index.ts index a2a241ba..0a43e6a5 100644 --- a/src/ui/elementUi/elementUi2/index.ts +++ b/src/ui/elementUi/elementUi2/index.ts @@ -445,7 +445,7 @@ export function elementUi2(extensionContext: any) { 'ice-cream-round', ] - return propsReducer(map, { prefix: 'el-icon', type: 'elementUi', icons }, extensionContext) + return propsReducer('element-ui', map, { prefix: 'el-icon', type: 'elementUi', icons }, extensionContext) } export function elementUi2Components() { @@ -1231,5 +1231,5 @@ export function elementUi2Components() { '', ], ] - return componentsReducer(map) + return componentsReducer(map, true, 'el') } diff --git a/src/ui/index.ts b/src/ui/index.ts index 28b5737d..e341555e 100644 --- a/src/ui/index.ts +++ b/src/ui/index.ts @@ -1,14 +1,14 @@ import { elementUi2, elementUi2Components } from './elementUi' import { antd4, antd4Components, antd5, antd5Components } from './antd' -import { elementPlus2, elementPlus2Components } from './elementPlus' +// import { elementPlus2, elementPlus2Components } from './elementPlus' import { vant4, vant4Components } from './vant' import { antDesignVue2, antDesignVue2Components, antDesignVue3, antDesignVue3Components, antDesignVue4, antDesignVue4Components } from './antDesignVue' import { varlet2, varlet2Components } from './varlet' import { naiveUi2, naiveUi2Components } from './naiveUi' import { vuetify3, vuetify3Components } from './vuetify' -import { uview2, uview2Components } from './uview' +// import { uview2, uview2Components } from './uview' import { chakraUiReact2, chakraUiReact2Components } from './chakraUi' -import { skeleton2, skeleton2Components } from './skeleton' +// import { skeleton2, skeleton2Components } from './skeleton' import { primevue3, primevue3Components } from './primevue' import { quasar2, quasar2Components } from './quasar' import { nextui2, nextui2Components } from './nextUi' @@ -22,7 +22,7 @@ export default { elementUi2, antd4, antd5, - elementPlus2, + // elementPlus2, vant4, naiveUi2, antDesignVue4, @@ -30,9 +30,9 @@ export default { antDesignVue2, varlet2, vuetify3, - uview2, + // uview2, chakraUiReact2, - skeleton2, + // skeleton2, primevue3, quasar2, nextui2, @@ -44,7 +44,7 @@ export default { elementUi2Components, antd4Components, antd5Components, - elementPlus2Components, + // elementPlus2Components, vant4Components, antDesignVue4Components, antDesignVue3Components, @@ -52,9 +52,9 @@ export default { naiveUi2Components, varlet2Components, vuetify3Components, - uview2Components, + // uview2Components, chakraUiReact2Components, - skeleton2Components, + // skeleton2Components, primevue3Components, quasar2Components, nextui2Components, diff --git a/src/ui/naiveUi/naiveUi2/index.ts b/src/ui/naiveUi/naiveUi2/index.ts index 8e98863d..469ca0a4 100644 --- a/src/ui/naiveUi/naiveUi2/index.ts +++ b/src/ui/naiveUi/naiveUi2/index.ts @@ -167,7 +167,7 @@ export function naiveUi2() { watermark, ] - return propsReducer(map) + return propsReducer('naive-ui', map) } export function naiveUi2Components() { @@ -746,5 +746,5 @@ Definitely Maybe :rotate="-15" >`], ] - return componentsReducer(map) + return componentsReducer(map, true, 'n') } diff --git a/src/ui/nextUi/nextUi2/index.ts b/src/ui/nextUi/nextUi2/index.ts index 8a3124d0..ff3c2188 100644 --- a/src/ui/nextUi/nextUi2/index.ts +++ b/src/ui/nextUi/nextUi2/index.ts @@ -128,7 +128,7 @@ export function nextui2() { User, ] - return propsReducer(map) + return propsReducer('@nextui-org/react', map) } export function nextui2Components() { diff --git a/src/ui/nuxtUi/nuxtUi2/index.ts b/src/ui/nuxtUi/nuxtUi2/index.ts index 34e0a66f..61722731 100644 --- a/src/ui/nuxtUi/nuxtUi2/index.ts +++ b/src/ui/nuxtUi/nuxtUi2/index.ts @@ -79,7 +79,7 @@ export function nuxtui2() { UProgress, ] - return propsReducer(map) + return propsReducer('@nuxt/ui', map) } export function nuxtui2Components() { diff --git a/src/ui/primevue/primevue3/index.ts b/src/ui/primevue/primevue3/index.ts index eb073529..aa45b943 100644 --- a/src/ui/primevue/primevue3/index.ts +++ b/src/ui/primevue/primevue3/index.ts @@ -166,7 +166,7 @@ export function primevue3() { Terminal, ] - return propsReducer(map) + return propsReducer('primevue', map) } export function primevue3Components() { @@ -577,5 +577,5 @@ export function primevue3Components() { '', ], ] - return componentsReducer(map) + return componentsReducer(map, false) } diff --git a/src/ui/quasar/quasar2/index.ts b/src/ui/quasar/quasar2/index.ts index 0513cab0..08ebd4ea 100644 --- a/src/ui/quasar/quasar2/index.ts +++ b/src/ui/quasar/quasar2/index.ts @@ -160,401 +160,89 @@ export function quasar2() { QVirtualScroll, ] - return propsReducer(map) + return propsReducer('quasar', map) } export function quasar2Components() { const map = [ - [ - 'QAjaxBar', - 'QAjaxBar', - '', - ], - [ - 'QAvatar', - 'QAvatar', - '', - ], - [ - 'QBadge', - 'QBadge', - '', - ], - [ - 'QBanner', - 'QBanner', - '', - ], - [ - 'QBar', - 'QBar', - '', - ], - [ - 'QBreadcrumbs', - 'QBreadcrumbs', - '', - ], - [ - 'QBtn', - 'QBtn', - '', - ], - [ - 'QBtnDropdown', - 'QBtnDropdown', - '', - ], - [ - 'QBtnGroup', - 'QBtnGroup', - '', - ], - [ - 'QBtnToggle', - 'QBtnToggle', - '', - ], - [ - 'QCard', - 'QCard', - '', - ], - [ - 'QCarousel', - 'QCarousel', - '', - ], - [ - 'QCheckbox', - 'QCheckbox', - '', - ], - [ - 'QChip', - 'QChip', - '', - ], - [ - 'QCircularProgress', - 'QCircularProgress', - '', - ], - [ - 'QColor', - 'QColor', - '', - ], - [ - 'QDate', - 'QDate', - '', - ], - [ - 'QDialog', - 'QDialog', - '', - ], - [ - 'QDrawer', - 'QDrawer', - '', - ], - [ - 'QEditor', - 'QEditor', - '', - ], - [ - 'QExpansionItem', - 'QExpansionItem', - '', - ], - [ - 'QFab', - 'QFab', - '', - ], - [ - 'QField', - 'QField', - '', - ], - [ - 'QFile', - 'QFile', - '', - ], - [ - 'QFooter', - 'QFooter', - '', - ], - [ - 'QForm', - 'QForm', - '', - ], - [ - 'QHeader', - 'QHeader', - '', - ], - [ - 'QIcon', - 'QIcon', - '', - ], - [ - 'QImg', - 'QImg', - '', - ], - [ - 'QInfiniteScroll', - 'QInfiniteScroll', - '', - ], - [ - 'QInnerLoading', - 'QInnerLoading', - '', - ], - [ - 'QInput', - 'QInput', - '', - ], - [ - 'QIntersection', - 'QIntersection', - '', - ], - [ - 'QItem', - 'QItem', - '', - ], - [ - 'QKnob', - 'QKnob', - '', - ], - [ - 'QLayout', - 'QLayout', - '', - ], - [ - 'QLinearProgress', - 'QLinearProgress', - '', - ], - [ - 'QMarkupTable', - 'QMarkupTable', - '', - ], - [ - 'QMenu', - 'QMenu', - '', - ], - [ - 'QNoSsr', - 'QNoSsr', - '', - ], - [ - 'QOptionGroup', - 'QOptionGroup', - '', - ], - [ - 'QPage', - 'QPage', - '', - ], - [ - 'QPageScroller', - 'QPageScroller', - '', - ], - [ - 'QPageSticky', - 'QPageSticky', - '', - ], - [ - 'QPagination', - 'QPagination', - '', - ], - [ - 'QParallax', - 'QParallax', - '', - ], - [ - 'QPopupEdit', - 'QPopupEdit', - '', - ], - [ - 'QPopupProxy', - 'QPopupProxy', - '', - ], - [ - 'QPullToRefresh', - 'QPullToRefresh', - '', - ], - [ - 'QRadio', - 'QRadio', - '', - ], - [ - 'QRange', - 'QRange', - '', - ], - [ - 'QRating', - 'QRating', - '', - ], - [ - 'QResizeObserver', - 'QResizeObserver', - '', - ], - [ - 'QResponsive', - 'QResponsive', - '', - ], - [ - 'QScrollArea', - 'QScrollArea', - '', - ], - [ - 'QScrollObserver', - 'QScrollObserver', - '', - ], - [ - 'QSelect', - 'QSelect', - '', - ], - [ - 'QSeparator', - 'QSeparator', - '', - ], - [ - 'QSkeleton', - 'QSkeleton', - '', - ], - [ - 'QSlideItem', - 'QSlideItem', - '', - ], - [ - 'QSlideTransition', - 'QSlideTransition', - '', - ], - [ - 'QSlider', - 'QSlider', - '', - ], - [ - 'QSpace', - 'QSpace', - '', - ], - [ - 'QSpinner', - 'QSpinner', - '', - ], - [ - 'QSplitter', - 'QSplitter', - '', - ], - [ - 'QStepper', - 'QStepper', - '', - ], - [ - 'QTabPanels', - 'QTabPanels', - '', - ], - [ - 'QTable', - 'QTable', - '', - ], - [ - 'QTabs', - 'QTabs', - '', - ], - [ - 'QTime', - 'QTime', - '', - ], - [ - 'QTimeline', - 'QTimeline', - '', - ], - [ - 'QToggle', - 'QToggle', - '', - ], - [ - 'QToolbar', - 'QToolbar', - '', - ], - [ - 'QTooltip', - 'QTooltip', - '', - ], - [ - 'QTree', - 'QTree', - '', - ], - [ - 'QUploader', - 'QUploader', - '', - ], - [ - 'QVideo', - 'QVideo', - '', - ], - [ - 'QVirtualScroll', - 'QVirtualScroll', - '', - ], + [QAjaxBar, QAjaxBar.name, ''], + [QAvatar, QAvatar.name, ''], + [QBadge, QBadge.name, ''], + [QBanner, QBanner.name, ''], + [QBar, QBar.name, ''], + [QBreadcrumbs, QBreadcrumbs.name, ''], + [QBtn, QBtn.name, ''], + [QBtnDropdown, QBtnDropdown.name, ''], + [QBtnGroup, QBtnGroup.name, ''], + [QBtnToggle, QBtnToggle.name, ''], + [QCard, QCard.name, ''], + [QCarousel, QCarousel.name, ''], + [QCheckbox, QCheckbox.name, ''], + [QChip, QChip.name, ''], + [QCircularProgress, QCircularProgress.name, ''], + [QColor, QColor.name, ''], + [QDate, QDate.name, ''], + [QDialog, QDialog.name, ''], + [QDrawer, QDrawer.name, ''], + [QEditor, QEditor.name, ''], + [QExpansionItem, QExpansionItem.name, ''], + [QFab, QFab.name, ''], + [QField, QField.name, ''], + [QFile, QFile.name, ''], + [QFooter, QFooter.name, ''], + [QForm, QForm.name, ''], + [QHeader, QHeader.name, ''], + [QIcon, QIcon.name, ''], + [QImg, QImg.name, ''], + [QInfiniteScroll, QInfiniteScroll.name, ''], + [QInnerLoading, QInnerLoading.name, ''], + [QInput, QInput.name, ''], + [QIntersection, QIntersection.name, ''], + [QItem, QItem.name, ''], + [QKnob, QKnob.name, ''], + [QLayout, QLayout.name, ''], + [QLinearProgress, QLinearProgress.name, ''], + [QMarkupTable, QMarkupTable.name, ''], + [QMenu, QMenu.name, ''], + [QNoSsr, QNoSsr.name, ''], + [QOptionGroup, QOptionGroup.name, ''], + [QPage, QPage.name, ''], + [QPageScroller, QPageScroller.name, ''], + [QPageSticky, QPageSticky.name, ''], + [QPagination, QPagination.name, ''], + [QParallax, QParallax.name, ''], + [QPopupEdit, QPopupEdit.name, ''], + [QPopupProxy, QPopupProxy.name, ''], + [QPullToRefresh, QPullToRefresh.name, ''], + [QRadio, QRadio.name, ''], + [QRange, QRange.name, ''], + [QRating, QRating.name, ''], + [QResizeObserver, QResizeObserver.name, ''], + [QResponsive, QResponsive.name, ''], + [QScrollArea, QScrollArea.name, ''], + [QScrollObserver, QScrollObserver.name, ''], + [QSelect, QSelect.name, ''], + [QSeparator, QSeparator.name, ''], + [QSkeleton, QSkeleton.name, ''], + [QSlideItem, QSlideItem.name, ''], + [QSlideTransition, QSlideTransition.name, ''], + [QSlider, QSlider.name, ''], + [QSpace, QSpace.name, ''], + [QSpinner, QSpinner.name, ''], + [QSplitter, QSplitter.name, ''], + [QStepper, QStepper.name, ''], + [QTabPanels, QTabPanels.name, ''], + [QTable, QTable.name, ''], + [QTabs, QTabs.name, ''], + [QTime, QTime.name, ''], + [QTimeline, QTimeline.name, ''], + [QToggle, QToggle.name, ''], + [QToolbar, QToolbar.name, ''], + [QTooltip, QTooltip.name, ''], + [QTree, QTree.name, ''], + [QUploader, QUploader.name, ''], + [QVideo, QVideo.name, ''], + [QVirtualScroll, QVirtualScroll.name, ''], ] - return componentsReducer(map) + return componentsReducer(map, true, 'q') } diff --git a/src/ui/radix-vue/radix-vue1/index.ts b/src/ui/radix-vue/radix-vue1/index.ts index 0af6f1fb..63725dff 100644 --- a/src/ui/radix-vue/radix-vue1/index.ts +++ b/src/ui/radix-vue/radix-vue1/index.ts @@ -372,7 +372,7 @@ export function radixVue1() { RadioGroupRoot, ] - return propsReducer(map) + return propsReducer('radix-vue', map) } export function radixVue1Components() { diff --git a/src/ui/shadcn-vue/shadcnVue0/index.ts b/src/ui/shadcn-vue/shadcnVue0/index.ts index 55d65ed7..d5402156 100644 --- a/src/ui/shadcn-vue/shadcnVue0/index.ts +++ b/src/ui/shadcn-vue/shadcnVue0/index.ts @@ -372,7 +372,7 @@ export function shadcnVue0() { RadioGroupRoot, ] - return propsReducer(map) + return propsReducer('shadcn-vue', map) } export function shadcnVue0Components() { diff --git a/src/ui/utils.ts b/src/ui/utils.ts index 05eca364..7745eed5 100644 --- a/src/ui/utils.ts +++ b/src/ui/utils.ts @@ -7,7 +7,7 @@ declare const global: { } } -export function propsReducer(map: string[], iconData?: { prefix: string; type: string; icons: any[] }, extensionContext?: any) { +export function propsReducer(uiName: string, map: string[], iconData?: { prefix: string; type: string; icons: any[] }, extensionContext?: any) { const result: any = {} let icons if (iconData) { @@ -16,7 +16,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s const imagePath = vscode.Uri.file(extensionContext.asAbsolutePath(`images/${iconData.type}/${icon}.svg`)) const documentation = new vscode.MarkdownString(`![img](${imagePath})`) const snippet = `${prefix}-${icon}` - return createCompletionItem({ content: icon, type: 19, documentation, snippet }) + return createCompletionItem({ content: icon, type: 19, documentation, snippet, params: uiName }) }) result.icons = icons } @@ -26,15 +26,15 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s const methods = [] const slots: any[] = [] const isZh = getLocale().includes('zh') + const lan = getActiveTextEditorLanguageId() + const isVue = lan === 'vue' const completionsDeferCallback = () => { - const lan = getActiveTextEditorLanguageId() const data = [ 'id', - 'class', - 'className', + isVue ? 'class' : 'className', ].map(item => createCompletionItem({ content: item, snippet: `${item}="$1"`, type: 5 })) - if (lan === 'vue') + if (isVue) data.push(createCompletionItem({ content: 'style', snippet: 'style="$1"', type: 5 })) else data.push(createCompletionItem({ content: 'style', snippet: 'style={$1}', type: 5 })) @@ -53,6 +53,8 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s documentation.supportHtml = true const detail = [] + detail.push(`## ${uiName} [${item.name}]`) + if (value.default !== undefined && value.default !== '') detail.push(`#### 💎 ${isZh ? '默认值' : 'default'}: ***\`${value.default.toString().replace(/`/g, '')}\`***`) @@ -85,7 +87,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s content = snippet = key } else if (value.type && value.type.trim() === 'boolean' && value.default === 'true') { - if (lan === 'vue') { + if (isVue) { content = key snippet = `:${key}="false"` } @@ -96,7 +98,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s } else if (key.startsWith(':')) { if (!v) { - if (lan === 'vue') { + if (isVue) { const _key = key.replace('v-model', 'model') content = `${key.replace(':v-model', 'v-model')}="${getComponentTagName(item.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}"` snippet = `${key.replace(':v-model', 'v-model')}="\${1:${getComponentTagName(item.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}}"$2` @@ -107,7 +109,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s } } else { - if (lan === 'vue') { + if (isVue) { const _key = key.replace('v-model', 'model') content = `${key.replace(':v-model', 'v-model')}="${getComponentTagName(item.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}"` snippet = `${key.replace(':v-model', 'v-model')}="\${1:${getComponentTagName(item.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}}"$2` @@ -124,7 +126,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s } content += ` ${isZh ? (value.description_zh || value.description) : value.description}${value.default ? ` ${isZh ? '默认' : 'default'}:${value.default}` : ''}` - return createCompletionItem({ content, snippet, type, documentation, preselect: true, sortText: 'a' }) + return createCompletionItem({ content, snippet, type, documentation, preselect: true, sortText: 'a', params: uiName }) }, )) }) @@ -141,7 +143,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s const lan = getActiveTextEditorLanguageId() const originEvent = [ { - name: lan === 'vue' + name: isVue ? 'click' : lan === 'svelte' ? 'on:click' @@ -159,6 +161,8 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s const detail = [] const { name, description, params, description_zh } = events + detail.push(`## ${uiName} [${item.name}]`) + if (description) { if (isZh) detail.push(`#### 🔦 说明: ***\`${description_zh || description}\`***`) @@ -170,7 +174,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s detail.push(`#### 🔮 ${isZh ? '回调参数' : 'callback parameters'}: ***\`${params}\`***`) let snippet let content - if (lan === 'vue') { + if (isVue) { const _name = name.split(':').map((item: string) => item[0].toUpperCase() + item.slice(1), ).join('').replace(/-(\w)/g, (_: string, v: string) => v.toUpperCase()) @@ -190,7 +194,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s documentation.isTrusted = true documentation.supportHtml = true documentation.appendMarkdown(detail.join('\n\n')) - return createCompletionItem({ content, snippet, documentation, type: vscode.CompletionItemKind.Event, sortText: 'b', preselect: true }) + return createCompletionItem({ content, snippet, documentation, type: vscode.CompletionItemKind.Event, sortText: 'b', preselect: true, params: uiName }) }, ) } @@ -204,6 +208,9 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s documentation.supportHtml = true const detail: any = [] const { name, description, params, description_zh } = method + + detail.push(`## ${uiName} [${item.name}]`) + if (name) detail.push(`\n#### 💨 ${isZh ? '方法' : 'method'} ${name}:`) @@ -218,7 +225,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s detail.push(`- 🚢 ${isZh ? '参数' : 'params'}: ***\`${params}\`***`) documentation.appendMarkdown(detail.join('\n\n')) - return createCompletionItem({ content: method.name, snippet: `${name.endsWith('()') ? name : `${name}()`}$1`, documentation, type: 1, preselect: true, sortText: 'b' }) + return createCompletionItem({ content: method.name, snippet: `${name.endsWith('()') ? name : `${name}()`}$1`, documentation, type: 1, preselect: true, sortText: 'b', params: uiName }) })) } @@ -237,7 +244,7 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s } documentation.appendMarkdown(detail.join('\n\n')) - slots.push(createCompletionItem({ content: `slot="${name}"`, snippet: `slot="${name}"$1`, documentation, type: 1, preselect: true, sortText: 'b' })) + slots.push(createCompletionItem({ content: `slot="${name}"`, snippet: `slot="${name}"$1`, documentation, type: 1, preselect: true, sortText: 'b', params: uiName })) }) } @@ -246,6 +253,9 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s documentation.isTrusted = true documentation.supportHtml = true const details = [] + + details.push(`# ${uiName} [${item.name}]`) + if (item.props) { if (isZh) details.push('## 参数:') @@ -324,15 +334,10 @@ export function propsReducer(map: string[], iconData?: { prefix: string; type: s }, result) } -export function componentsReducer(map: any[][], isSeperatorByHyphen = true) { - let prefix = '' - if (map) { - const first = map[0][0] - const name = typeof first === 'string' ? first : `${first.name[0].toLowerCase()}${hyphenate(first.name.slice(1))}` - prefix = name.split('-')[0][0] - } +export function componentsReducer(map: any[][], isSeperatorByHyphen = true, prefix = '') { const isZh = getLocale().includes('zh') - + const lan = getActiveTextEditorLanguageId() + const isVue = lan === 'vue' return { prefix, data: map.map(([content, detail, demo]) => { @@ -342,7 +347,6 @@ export function componentsReducer(map: any[][], isSeperatorByHyphen = true) { const requiredProps: string[] = [] let index = 0 if (content.props) { - const lan = getActiveTextEditorLanguageId() Object.keys(content.props).forEach((key) => { const item = content.props[key] if (!item.required) @@ -362,13 +366,13 @@ export function componentsReducer(map: any[][], isSeperatorByHyphen = true) { key = key.replace(':v-model', 'v-model') ++index if (!v) { - if (lan === 'vue') + if (isVue) attr = `${key}="\${${index}:${getComponentTagName(content.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}}"` else attr = `${key.slice(1)}={\${${index}:${getComponentTagName(content.name)}${_key[1].toUpperCase()}${toCamel(_key.slice(2))}}}` } else { - if (lan === 'vue') + if (isVue) attr = `${key}="\${${index}:${getComponentTagName(content.name)}${key[1].toUpperCase()}${toCamel(key.slice(2))}}"` else attr = `${key.slice(1)}={\${${index}:${v}}}` @@ -376,7 +380,7 @@ export function componentsReducer(map: any[][], isSeperatorByHyphen = true) { } } else if (item.type && item.type.includes('boolean') && item.default === 'false') { - if (lan === 'vue') + if (isVue) attr = key else attr = `${key}="true"` @@ -390,7 +394,7 @@ export function componentsReducer(map: any[][], isSeperatorByHyphen = true) { requiredProps.push(attr) }) } - const tag = isSeperatorByHyphen ? hyphenate(content.name.slice(1)) === content.name.slice(1) ? content.name : `${content.name[0].toLowerCase()}${hyphenate(content.name.slice(1))}` : content.name + const tag = isSeperatorByHyphen ? hyphenate(content.name) : content.name if (requiredProps.length) snippet = `<${tag} ${requiredProps.join(' ')}>$${++index}` else @@ -425,7 +429,7 @@ function getComponentTagName(str: string) { } export function hyphenate(s: string): string { - return s.replace(/([A-Z])/g, '-$1').toLowerCase() + return s.replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '') } export function toCamel(s: string) { diff --git a/src/ui/vant/vant4/index.ts b/src/ui/vant/vant4/index.ts index e491b2f4..050caeed 100644 --- a/src/ui/vant/vant4/index.ts +++ b/src/ui/vant/vant4/index.ts @@ -192,7 +192,7 @@ export function vant4() { watermark, ] - return propsReducer(map) + return propsReducer('vant', map) } export function vant4Components() { @@ -431,5 +431,5 @@ export function vant4Components() { [uploader, '文件上传 用于将本地的图片或文件上传至服务器,并在上传过程中展示预览图和上传进度。目前 Uploader 组件不包含将文件上传至服务器的接口逻辑,该步骤需要自行实现。', ''], [watermark, '水印 在页面上添加特定的文字或图案作为水印,可用于防止信息盗用。请升级 vant 到 >= 4.2.0 版本来使用该组件。', ''], ] - return componentsReducer(map) + return componentsReducer(map, true, 'van') } diff --git a/src/ui/varlet/varlet2/index.ts b/src/ui/varlet/varlet2/index.ts index 73db65e3..84fcb02f 100644 --- a/src/ui/varlet/varlet2/index.ts +++ b/src/ui/varlet/varlet2/index.ts @@ -129,7 +129,7 @@ export function varlet2() { radioGroup, ] - return propsReducer(map) + return propsReducer('varlet', map) } export function varlet2Components() { @@ -440,5 +440,5 @@ export function varlet2Components() { `], [uploader, 'File upload provides file reading and image/video preview capabilities. Obtain the file upload server by listening to the after-read event. ', ''], ] - return componentsReducer(map) + return componentsReducer(map, true, 'var') } diff --git a/src/ui/vuetify/vuetify3/index.ts b/src/ui/vuetify/vuetify3/index.ts index 4ac7d58d..799fd023 100644 --- a/src/ui/vuetify/vuetify3/index.ts +++ b/src/ui/vuetify/vuetify3/index.ts @@ -195,7 +195,7 @@ export function vuetify3() { listItemSubtitle, ] - return propsReducer(map) + return propsReducer('vuetify', map) } export function vuetify3Components() { @@ -411,5 +411,5 @@ export function vuetify3Components() { [menu, 'Menu can display a menu at the position of an active menu element. ', ''], [overlay, 'mask layer', ''], ] - return componentsReducer(map) + return componentsReducer(map, true, 'v') }