From aac478eebc609050e57c85f5945250daed14ff00 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 29 May 2023 11:33:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 2 +- .gitignore | 1 + docs/.vitepress/config.ts | 6 +- package.json | 6 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 + packages/core/src/App.ts | 103 +- packages/core/src/index.ts | 2 + packages/core/vite.config.ts | 5 +- packages/data-source/.npmignore | 31 + packages/data-source/package.json | 47 + packages/data-source/src/DataSourceManager.ts | 115 ++ .../src/createDataSourceManager.ts | 55 + packages/data-source/src/data-sources/Base.ts | 75 ++ packages/data-source/src/data-sources/Http.ts | 130 ++ .../data-source/src/data-sources/index.ts | 2 + packages/data-source/src/index.ts | 23 + packages/data-source/src/types.ts | 40 + packages/data-source/src/util.ts | 46 + packages/data-source/tests/DataSource.spec.ts | 32 + .../tests/DataSourceMenager.spec.ts | 81 ++ .../tests/createDataSourceManager.spec.ts | 49 + packages/data-source/tests/utils.spec.ts | 78 ++ packages/data-source/tsconfig.build.json | 16 + packages/data-source/tsconfig.json | 6 + packages/data-source/vite.config.ts | 55 + packages/design/package.json | 2 +- packages/design/src/Autocomplete.vue | 85 ++ packages/design/src/defaultAdapter.ts | 5 + packages/design/src/index.ts | 1 + packages/editor/package.json | 3 +- packages/editor/src/Editor.vue | 2 + .../editor/src/components/CodeDraftEditor.vue | 4 +- packages/editor/src/editorProps.ts | 5 + .../editor/src/fields/DataSourceFields.vue | 178 +++ .../editor/src/fields/DataSourceInput.vue | 342 +++++ packages/editor/src/fields/KeyValue.vue | 93 ++ packages/editor/src/index.ts | 10 + packages/editor/src/initService.ts | 129 +- .../editor/src/layouts/sidebar/Sidebar.vue | 21 +- .../data-source/DataSourceConfigPanel.vue | 84 ++ .../data-source/DataSourceListPanel.vue | 130 ++ packages/editor/src/services/codeBlock.ts | 2 - packages/editor/src/services/dataSource.ts | 90 ++ packages/editor/src/services/dep.ts | 3 + .../editor/src/theme/data-source-fields.scss | 13 + packages/editor/src/theme/data-source.scss | 17 + packages/editor/src/theme/key-value.scss | 13 + packages/editor/src/theme/theme.scss | 3 + packages/editor/src/type.ts | 4 +- .../src/utils/data-source/formConfigs/base.ts | 32 + .../src/utils/data-source/formConfigs/http.ts | 50 + .../editor/src/utils/data-source/index.ts | 31 + packages/editor/src/utils/dep.ts | 10 +- packages/element-plus-adapter/src/index.ts | 6 + packages/form/package.json | 2 +- packages/form/src/fields/Select.vue | 12 +- packages/form/tests/unit/fields/Time.spec.ts | 1 - packages/schema/src/index.ts | 46 + packages/table/package.json | 2 +- packages/ui-react/src/button/formConfig.ts | 1 + packages/ui-react/src/img/formConfig.ts | 1 + packages/ui-react/src/qrcode/formConfig.ts | 1 + packages/ui-react/src/text/Text.tsx | 10 +- packages/ui-react/src/text/formConfig.ts | 1 + packages/ui-vue2/package.json | 2 +- packages/ui-vue2/src/button/formConfig.ts | 1 + packages/ui-vue2/src/img/src/formConfig.ts | 1 + packages/ui-vue2/src/qrcode/src/formConfig.ts | 1 + packages/ui-vue2/src/text/formConfig.ts | 1 + packages/ui/src/button/src/formConfig.ts | 1 + packages/ui/src/img/src/formConfig.ts | 2 + packages/ui/src/qrcode/src/formConfig.ts | 1 + packages/ui/src/text/src/formConfig.ts | 1 + packages/utils/src/index.ts | 137 +- packages/utils/tests/unit/index.spec.ts | 310 +++++ playground/package.json | 4 +- playground/src/configs/dsl.ts | 27 +- playground/vite.config.ts | 2 + pnpm-lock.yaml | 1143 +++++++++-------- runtime/react/dev.vite.config.ts | 2 + runtime/react/package.json | 4 +- runtime/react/page/App.tsx | 22 +- runtime/react/playground/main.tsx | 14 +- runtime/vue2/dev.vite.config.ts | 2 + runtime/vue2/package.json | 4 +- runtime/vue2/page/App.vue | 9 + runtime/vue2/playground/App.vue | 24 +- runtime/vue3/dev.vite.config.ts | 2 + runtime/vue3/package.json | 4 +- runtime/vue3/page/App.vue | 9 + runtime/vue3/playground/App.vue | 176 ++- tsconfig.json | 2 + vitest.config.ts | 3 + 94 files changed, 3601 insertions(+), 765 deletions(-) create mode 100644 packages/data-source/.npmignore create mode 100644 packages/data-source/package.json create mode 100644 packages/data-source/src/DataSourceManager.ts create mode 100644 packages/data-source/src/createDataSourceManager.ts create mode 100644 packages/data-source/src/data-sources/Base.ts create mode 100644 packages/data-source/src/data-sources/Http.ts create mode 100644 packages/data-source/src/data-sources/index.ts create mode 100644 packages/data-source/src/index.ts create mode 100644 packages/data-source/src/types.ts create mode 100644 packages/data-source/src/util.ts create mode 100644 packages/data-source/tests/DataSource.spec.ts create mode 100644 packages/data-source/tests/DataSourceMenager.spec.ts create mode 100644 packages/data-source/tests/createDataSourceManager.spec.ts create mode 100644 packages/data-source/tests/utils.spec.ts create mode 100644 packages/data-source/tsconfig.build.json create mode 100644 packages/data-source/tsconfig.json create mode 100644 packages/data-source/vite.config.ts create mode 100644 packages/design/src/Autocomplete.vue create mode 100644 packages/editor/src/fields/DataSourceFields.vue create mode 100644 packages/editor/src/fields/DataSourceInput.vue create mode 100644 packages/editor/src/fields/KeyValue.vue create mode 100644 packages/editor/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue create mode 100644 packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue create mode 100644 packages/editor/src/services/dataSource.ts create mode 100644 packages/editor/src/theme/data-source-fields.scss create mode 100644 packages/editor/src/theme/data-source.scss create mode 100644 packages/editor/src/theme/key-value.scss create mode 100644 packages/editor/src/utils/data-source/formConfigs/base.ts create mode 100644 packages/editor/src/utils/data-source/formConfigs/http.ts create mode 100644 packages/editor/src/utils/data-source/index.ts diff --git a/.eslintrc.js b/.eslintrc.js index 74a721a4..e2295799 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -53,7 +53,7 @@ module.exports = { ["^(react|vue|vite)", "^@?\\w"], ["^(@tmagic)(/.*|$)"], // Internal packages. - ["^(@|@editor)(/.*|$)"], + ["^(@|@editor|@data-source)(/.*|$)"], // Side effect imports. ["^\\u0000"], // Parent imports. Put `..` last. diff --git a/.gitignore b/.gitignore index 6625ec14..fc1a0b08 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ coverage auto-imports.d.ts components.d.ts +docs/.vitepress/cache/deps diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index dc2f7bbc..c809db02 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -1,5 +1,5 @@ import path from 'path'; -import { defineConfig, DefaultTheme } from 'vitepress' +import { defineConfig } from 'vitepress' export default defineConfig({ title: 'tmagic-editor', @@ -14,6 +14,10 @@ export default defineConfig({ themeConfig: { logo: './favicon.png', + search: { + provider: 'local' + }, + socialLinks: [ { icon: 'github', link: 'https://github.com/Tencent/tmagic-editor' } ], diff --git a/package.json b/package.json index 9c05bc99..44da2b54 100644 --- a/package.json +++ b/package.json @@ -76,9 +76,9 @@ "serialize-javascript": "^6.0.0", "shx": "^0.3.4", "typescript": "^5.0.4", - "vite": "^4.2.1", - "vitepress": "1.0.0-alpha.29", - "vitest": "^0.30.0", + "vite": "^4.3.8", + "vitepress": "1.0.0-beta.1", + "vitest": "^0.31.1", "vue": "^3.2.37" }, "config": { diff --git a/packages/cli/package.json b/packages/cli/package.json index caff884a..cb2d4439 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -26,7 +26,7 @@ "cac": "^6.7.12", "chalk": "^4.1.0", "chokidar": "^3.5.3", - "esbuild": "^0.15.5", + "esbuild": "^0.17.19", "fs-extra": "^10.1.0", "recast": "^0.21.1", "tslib": "^2.4.0" diff --git a/packages/core/package.json b/packages/core/package.json index 2797fd5a..9e2f218c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -36,7 +36,9 @@ "vue" ], "dependencies": { + "@tmagic/data-source": "1.2.15", "@tmagic/schema": "1.2.15", + "@tmagic/utils": "1.2.15", "events": "^3.3.0", "lodash-es": "^4.17.21" }, diff --git a/packages/core/src/App.ts b/packages/core/src/App.ts index bc1ad6aa..18b17165 100644 --- a/packages/core/src/App.ts +++ b/packages/core/src/App.ts @@ -18,8 +18,14 @@ import { EventEmitter } from 'events'; -import { has, isEmpty } from 'lodash-es'; +import { cloneDeep, has, isEmpty, template } from 'lodash-es'; +import { + createDataSourceManager, + DataSourceManager, + DataSourceManagerData, + RequestFunction, +} from '@tmagic/data-source'; import { ActionType, CodeBlockDSL, @@ -29,7 +35,9 @@ import { EventConfig, Id, MApp, + MNode, } from '@tmagic/schema'; +import { compiledNode } from '@tmagic/utils'; import Env from './Env'; import { bindCommonEventListener, isCommonMethod, triggerCommonMethod } from './events'; @@ -45,6 +53,7 @@ interface AppOptionsConfig { designWidth?: number; curPage?: Id; transformStyle?: (style: Record) => Record; + request?: RequestFunction; } interface EventCache { @@ -57,6 +66,7 @@ class App extends EventEmitter { public env: Env = new Env(); public dsl?: MApp; public codeDsl?: CodeBlockDSL; + public dataSourceManager?: DataSourceManager; public page?: Page; @@ -88,11 +98,7 @@ class App extends EventEmitter { } if (options.config) { - let pageId = options.curPage; - if (!pageId && options.config.items.length) { - pageId = options.config.items[0].id; - } - this.setConfig(options.config, pageId); + this.setConfig(options.config, options.curPage, options.request); } bindCommonEventListener(this); @@ -156,8 +162,25 @@ class App extends EventEmitter { * @param config dsl跟节点 * @param curPage 当前页面id */ - public setConfig(config: MApp, curPage?: Id) { + public setConfig(config: MApp, curPage?: Id, request?: RequestFunction) { this.dsl = config; + + if (!curPage && config.items.length) { + curPage = config.items[0].id; + } + + if (this.dataSourceManager) { + this.dataSourceManager.destroy(); + } + + this.dataSourceManager = createDataSourceManager( + config, + (node: MNode, content: DataSourceManagerData) => this.compiledNode(node, content), + { + request, + }, + ); + this.codeDsl = config.codeBlocks; this.setPage(curPage || this.page?.data?.id); } @@ -196,9 +219,7 @@ class App extends EventEmitter { super.emit('page-change', this.page); - if (this.platform !== 'magic') { - this.bindEvents(); - } + this.bindEvents(); } public deletePage() { @@ -258,31 +279,6 @@ class App extends EventEmitter { return super.emit(name, node, ...args); } - /** - * 事件联动处理函数 - * @param eventConfig 事件配置 - * @param fromCpt 触发事件的组件 - * @param args 事件参数 - */ - public async eventHandler(eventConfig: EventConfig | DeprecatedEventConfig, fromCpt: any, args: any[]) { - if (has(eventConfig, 'actions')) { - // EventConfig类型 - const { actions } = eventConfig as EventConfig; - for (const actionItem of actions) { - if (actionItem.actionType === ActionType.COMP) { - // 组件动作 - await this.compActionHandler(actionItem as CompItemConfig, fromCpt, args); - } else if (actionItem.actionType === ActionType.CODE) { - // 执行代码块 - await this.codeActionHandler(actionItem as CodeItemConfig); - } - } - } else { - // 兼容DeprecatedEventConfig类型 组件动作 - await this.compActionHandler(eventConfig as DeprecatedEventConfig, fromCpt, args); - } - } - /** * 执行代码块动作 * @param eventConfig 代码动作的配置 @@ -325,6 +321,18 @@ class App extends EventEmitter { } } + public compiledNode(node: MNode, content: DataSourceManagerData, sourceId?: Id) { + return compiledNode( + (str: string) => + template(str, { + escape: /\{\{([\s\S]+?)\}\}/g, + })(content), + cloneDeep(node), + this.dsl?.dataSourceDeps, + sourceId, + ); + } + public destroy() { this.removeAllListeners(); this.page = undefined; @@ -334,6 +342,31 @@ class App extends EventEmitter { } } + /** + * 事件联动处理函数 + * @param eventConfig 事件配置 + * @param fromCpt 触发事件的组件 + * @param args 事件参数 + */ + private async eventHandler(eventConfig: EventConfig | DeprecatedEventConfig, fromCpt: any, args: any[]) { + if (has(eventConfig, 'actions')) { + // EventConfig类型 + const { actions } = eventConfig as EventConfig; + for (const actionItem of actions) { + if (actionItem.actionType === ActionType.COMP) { + // 组件动作 + await this.compActionHandler(actionItem as CompItemConfig, fromCpt, args); + } else if (actionItem.actionType === ActionType.CODE) { + // 执行代码块 + await this.codeActionHandler(actionItem as CodeItemConfig); + } + } + } else { + // 兼容DeprecatedEventConfig类型 组件动作 + await this.compActionHandler(eventConfig as DeprecatedEventConfig, fromCpt, args); + } + } + private addEventToMap(event: EventCache) { if (this.eventQueueMap[event.eventConfig.to]) { this.eventQueueMap[event.eventConfig.to].push(event); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 6e1f7db5..123df87a 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -23,5 +23,7 @@ import './resetcss.css'; export * from './events'; export { default as Env } from './Env'; +export { default as Page } from './Page'; +export { default as Node } from './Node'; export default App; diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts index 08e3f682..e1bd2d7d 100644 --- a/packages/core/vite.config.ts +++ b/packages/core/vite.config.ts @@ -27,7 +27,10 @@ export default defineConfig({ alias: process.env.NODE_ENV === 'production' ? [] - : [{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../schema/src/index.ts') }], + : [ + { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../schema/src/index.ts') }, + { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../data-source/src/index.ts') }, + ], }, build: { diff --git a/packages/data-source/.npmignore b/packages/data-source/.npmignore new file mode 100644 index 00000000..bdb9b052 --- /dev/null +++ b/packages/data-source/.npmignore @@ -0,0 +1,31 @@ +.babelrc +.eslintrc +.editorconfig +node_modules +.DS_Store +examples +tests +.code.yml +reports +tsconfig.build.json +tsconfig.json +vite.config.ts + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +pnpm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/packages/data-source/package.json b/packages/data-source/package.json new file mode 100644 index 00000000..0ff5347c --- /dev/null +++ b/packages/data-source/package.json @@ -0,0 +1,47 @@ +{ + "version": "1.2.15", + "name": "@tmagic/data-source", + "type": "module", + "sideEffects": [ + "dist/*" + ], + "main": "dist/tmagic-data-source.umd.cjs", + "module": "dist/tmagic-data-source.js", + "types": "types/index.d.ts", + "exports": { + ".": { + "import": "./dist/tmagic-data-source.js", + "require": "./dist/tmagic-data-source.umd.cjs" + }, + "./*": "./*" + }, + "license": "Apache-2.0", + "scripts": { + "build": "npm run build:type && vite build", + "build:type": "npm run clear:type && tsc --declaration --emitDeclarationOnly --project tsconfig.build.json && tsc-alias -p tsconfig.build.json", + "clear:type": "rimraf ./types" + }, + "engines": { + "node": ">=14" + }, + "repository": { + "type": "git", + "url": "https://github.com/Tencent/tmagic-editor.git" + }, + "keywords": [ + "data-source" + ], + "dependencies": { + "@tmagic/utils": "1.2.15", + "@tmagic/schema": "1.2.15", + "events": "^3.3.0" + }, + "devDependencies": { + "@types/events": "^3.0.0", + "@types/lodash-es": "^4.17.4", + "@types/node": "^15.12.4", + "tsc-alias": "^1.8.5", + "typescript": "^4.7.4", + "vite": "^3.1.3" + } +} diff --git a/packages/data-source/src/DataSourceManager.ts b/packages/data-source/src/DataSourceManager.ts new file mode 100644 index 00000000..43cd7fa5 --- /dev/null +++ b/packages/data-source/src/DataSourceManager.ts @@ -0,0 +1,115 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import EventEmitter from 'events'; + +import { DataSourceSchema } from '@tmagic/schema'; + +import { DataSource, HttpDataSource } from './data-sources'; +import type { DataSourceManagerData, DataSourceManagerOptions, HttpDataSourceSchema, RequestFunction } from './types'; + +class DataSourceManager extends EventEmitter { + public static dataSourceClassMap = new Map(); + public static registe(type: string, dataSource: typeof DataSource) { + DataSourceManager.dataSourceClassMap.set(type, dataSource); + } + + public dataSourceMap = new Map(); + + public data: DataSourceManagerData = {}; + + private request?: RequestFunction; + + constructor(options: DataSourceManagerOptions) { + super(); + + if (options.httpDataSourceOptions?.request) { + this.request = options.httpDataSourceOptions.request; + } + + options.dataSourceConfigs.forEach((config) => { + this.addDataSource(config); + }); + } + + public get(id: string) { + return this.dataSourceMap.get(id); + } + + public addDataSource(config?: DataSourceSchema) { + if (!config) return; + + let ds: DataSource; + if (config.type === 'http') { + ds = new HttpDataSource({ + schema: config as HttpDataSourceSchema, + request: this.request, + }); + } else { + // eslint-disable-next-line @typescript-eslint/naming-convention + const DataSourceClass = DataSourceManager.dataSourceClassMap.get(config.type) || DataSource; + + ds = new DataSourceClass({ + schema: config, + }); + } + + this.dataSourceMap.set(config.id, ds); + + this.data[ds.id] = ds.data; + + ds.init().then(() => { + this.data[ds.id] = ds.data; + }); + + ds.on('change', () => { + Object.assign(this.data[ds.id], ds.data); + + this.emit('change', ds.id); + }); + } + + public removeDataSource(id: string) { + this.get(id)?.destroy(); + delete this.data[id]; + this.dataSourceMap.delete(id); + } + + public updateSchema(schemas: DataSourceSchema[]) { + schemas.forEach((schema) => { + const ds = this.dataSourceMap.get(schema.id); + if (!ds) { + return; + } + ds.setFields(schema.fields); + ds.updateDefaultData(); + this.data[ds.id] = ds.data; + }); + } + + public destroy() { + this.removeAllListeners(); + this.data = {}; + this.dataSourceMap.forEach((ds) => { + ds.destroy(); + }); + this.dataSourceMap = new Map(); + } +} + +export default DataSourceManager; diff --git a/packages/data-source/src/createDataSourceManager.ts b/packages/data-source/src/createDataSourceManager.ts new file mode 100644 index 00000000..a22e6e2d --- /dev/null +++ b/packages/data-source/src/createDataSourceManager.ts @@ -0,0 +1,55 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import type { MApp, MNode } from '@tmagic/schema'; +import { getDepNodeIds, getNodes, replaceChildNode } from '@tmagic/utils'; + +import DataSourceManager from './DataSourceManager'; +import type { DataSourceManagerData, HttpDataSourceOptions } from './types'; + +/** + * 创建数据源管理器 + * @param dsl DSL + * @param httpDataSourceOptions http 数据源配置 + * @returns DataSourceManager + */ +export const createDataSourceManager = ( + dsl: MApp, + compiledNode = (node: MNode, _content: DataSourceManagerData) => node, + httpDataSourceOptions?: Partial, +) => { + if (!dsl?.dataSources) return; + + const dataSourceManager = new DataSourceManager({ + dataSourceConfigs: dsl.dataSources, + httpDataSourceOptions, + }); + + if (dsl.dataSources && dsl.dataSourceDeps) { + getNodes(getDepNodeIds(dsl.dataSourceDeps), dsl.items).forEach((node) => { + replaceChildNode(compiledNode(node, dataSourceManager.data), dsl!.items); + }); + } + + dataSourceManager.on('change', (sourceId: string) => { + const dep = dsl.dataSourceDeps?.[sourceId]; + if (!dep) return; + dataSourceManager.emit('update-data', getNodes(Object.keys(dep), dsl.items), sourceId); + }); + + return dataSourceManager; +}; diff --git a/packages/data-source/src/data-sources/Base.ts b/packages/data-source/src/data-sources/Base.ts new file mode 100644 index 00000000..a8cba938 --- /dev/null +++ b/packages/data-source/src/data-sources/Base.ts @@ -0,0 +1,75 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import EventEmitter from 'events'; + +import type { DataSchema } from '@tmagic/schema'; + +import type { DataSourceOptions } from '@data-source/types'; +import { getDefaultValueFromFields } from '@data-source/util'; + +/** + * 静态数据源 + */ +export default class DataSource extends EventEmitter { + public type = 'base'; + + public id: string; + + public isInit = false; + + public data: Record = {}; + + private fields: DataSchema[] = []; + + constructor(options: DataSourceOptions) { + super(); + + this.id = options.schema.id; + this.setFields(options.schema.fields); + + this.updateDefaultData(); + } + + public setFields(fields: DataSchema[]) { + this.fields = fields; + } + + public setData(data: Record) { + // todo: 校验数据,看是否符合 schema + this.data = data; + this.emit('change'); + } + + public getDefaultData() { + return getDefaultValueFromFields(this.fields); + } + + public updateDefaultData() { + this.setData(this.getDefaultData()); + } + + public async init() { + this.isInit = true; + } + + public destroy() { + this.data = {}; + this.fields = []; + this.removeAllListeners(); + } +} diff --git a/packages/data-source/src/data-sources/Http.ts b/packages/data-source/src/data-sources/Http.ts new file mode 100644 index 00000000..64c4f423 --- /dev/null +++ b/packages/data-source/src/data-sources/Http.ts @@ -0,0 +1,130 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { getValueByKeyPath } from '@tmagic/utils'; + +import { HttpDataSourceOptions, HttpDataSourceSchema, HttpOptions, RequestFunction } from '@data-source/types'; + +import DataSource from './Base'; + +/** + * 将json对象转换为urlencoded字符串 + * @param data json对象 + * @returns string + */ +const urlencoded = (data: Record) => + Object.entries(data).reduce((prev, [key, value]) => { + let v = value; + if (typeof value === 'object') { + v = JSON.stringify(value); + } + if (typeof value !== 'undefined') { + return `${prev}${prev ? '&' : ''}${globalThis.encodeURIComponent(key)}=${globalThis.encodeURIComponent(`${v}`)}`; + } + return prev; + }, ''); + +/** + * 浏览器端请求 + * 如果未有自定义的request方法,则使用浏览器的fetch方法 + * @param options 请求参数 + */ +const webRequest = async (options: HttpOptions) => { + const { url, method = 'GET', headers = {}, params = {}, data = {}, ...config } = options; + const query = urlencoded(params); + let body: string = JSON.stringify(data); + if (headers['Content-Type']?.includes('application/x-www-form-urlencoded')) { + body = urlencoded(data); + } + + const response = await globalThis.fetch(query ? `${url}?${query}` : url, { + method, + headers, + body: method === 'GET' ? undefined : body, + ...config, + }); + + return response.json(); +}; + +/** + * Http 数据源 + * @description 通过 http 请求获取数据 + */ +export default class HttpDataSource extends DataSource { + public type = 'http'; + + public isLoading = false; + public error?: Error; + public schema: HttpDataSourceSchema; + public httpOptions: HttpOptions; + + private fetch?: RequestFunction; + + constructor(options: HttpDataSourceOptions) { + const { options: httpOptions, ...dataSourceOptions } = options.schema; + + super({ + schema: dataSourceOptions, + }); + + this.schema = options.schema; + this.httpOptions = httpOptions; + + if (typeof options.request === 'function') { + this.fetch = options.request; + } else if (typeof globalThis.fetch === 'function') { + this.fetch = webRequest; + } + } + + public async init() { + if (this.schema.autoFetch) { + await this.request(this.httpOptions); + } + + super.init(); + } + + public async request(options: HttpOptions) { + const res = await this.fetch?.({ + ...this.httpOptions, + ...options, + }); + + if (this.schema.responseOptions?.dataPath) { + const data = getValueByKeyPath(this.schema.responseOptions.dataPath, res); + this.setData(data); + } else { + this.setData(res); + } + } + + public get(options: Partial & { url: string }) { + return this.request({ + ...options, + method: 'GET', + }); + } + + public post(options: Partial & { url: string }) { + return this.request({ + ...options, + method: 'POST', + }); + } +} diff --git a/packages/data-source/src/data-sources/index.ts b/packages/data-source/src/data-sources/index.ts new file mode 100644 index 00000000..4ccca726 --- /dev/null +++ b/packages/data-source/src/data-sources/index.ts @@ -0,0 +1,2 @@ +export { default as DataSource } from './Base'; +export { default as HttpDataSource } from './Http'; diff --git a/packages/data-source/src/index.ts b/packages/data-source/src/index.ts new file mode 100644 index 00000000..e418d1c6 --- /dev/null +++ b/packages/data-source/src/index.ts @@ -0,0 +1,23 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { default as DataSourceManager } from './DataSourceManager'; +export * from './data-sources'; +export * from './createDataSourceManager'; +export * from './util'; +export * from './types'; diff --git a/packages/data-source/src/types.ts b/packages/data-source/src/types.ts new file mode 100644 index 00000000..036690ae --- /dev/null +++ b/packages/data-source/src/types.ts @@ -0,0 +1,40 @@ +import { DataSourceSchema } from '@tmagic/schema'; + +export interface DataSourceOptions { + schema: DataSourceSchema; +} + +export type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'post' | 'POST' | 'put' | 'PUT'; + +export type RequestFunction = (options: HttpOptions) => Promise; + +export interface HttpOptions { + url: string; + params?: Record; + data?: Record; + headers?: Record; + method?: Method; +} + +export interface HttpDataSourceSchema extends DataSourceSchema { + type: 'http'; + options: HttpOptions; + responseOptions?: { + dataPath?: string; + }; + autoFetch?: boolean; +} + +export interface HttpDataSourceOptions { + schema: HttpDataSourceSchema; + request?: RequestFunction; +} + +export interface DataSourceManagerOptions { + dataSourceConfigs: DataSourceSchema[]; + httpDataSourceOptions?: Partial; +} + +export interface DataSourceManagerData { + [key: string]: Record; +} diff --git a/packages/data-source/src/util.ts b/packages/data-source/src/util.ts new file mode 100644 index 00000000..633794f7 --- /dev/null +++ b/packages/data-source/src/util.ts @@ -0,0 +1,46 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { DataSchema } from '@tmagic/schema'; + +export const getDefaultValueFromFields = (fields: DataSchema[]) => { + const data: Record = {}; + + const defaultValue: Record = { + string: '', + object: {}, + array: [], + boolean: false, + number: 0, + null: null, + any: undefined, + }; + + fields.forEach((field) => { + if (typeof field.defaultValue !== 'undefined') { + data[field.name] = field.defaultValue; + } else if (field.type === 'object') { + data[field.name] = field.fields ? getDefaultValueFromFields(field.fields) : {}; + } else if (field.type) { + data[field.name] = defaultValue[field.type]; + } else { + data[field.name] = undefined; + } + }); + return data; +}; diff --git a/packages/data-source/tests/DataSource.spec.ts b/packages/data-source/tests/DataSource.spec.ts new file mode 100644 index 00000000..c852c414 --- /dev/null +++ b/packages/data-source/tests/DataSource.spec.ts @@ -0,0 +1,32 @@ +import { describe, expect, test } from 'vitest'; + +import { DataSource } from '@data-source/index'; + +describe('DataSource', () => { + test('instance', () => { + const ds = new DataSource({ + schema: { + type: 'base', + id: '1', + fields: [{ name: 'name' }], + }, + }); + + expect(ds).toBeInstanceOf(DataSource); + expect(ds.data).toHaveProperty('name'); + }); + + test('init', () => { + const ds = new DataSource({ + schema: { + type: 'base', + id: '1', + fields: [{ name: 'name' }], + }, + }); + + ds.init(); + + expect(ds.isInit).toBeTruthy(); + }); +}); diff --git a/packages/data-source/tests/DataSourceMenager.spec.ts b/packages/data-source/tests/DataSourceMenager.spec.ts new file mode 100644 index 00000000..cf76ce5b --- /dev/null +++ b/packages/data-source/tests/DataSourceMenager.spec.ts @@ -0,0 +1,81 @@ +import { describe, expect, test } from 'vitest'; + +import { DataSource, DataSourceManager } from '@data-source/index'; + +describe('DataSourceManager', () => { + const dsm = new DataSourceManager({ + dataSourceConfigs: [ + { + type: 'base', + id: '1', + fields: [{ name: 'name' }], + }, + { + type: 'http', + id: '2', + fields: [{ name: 'name' }], + }, + ], + httpDataSourceOptions: { + request: () => Promise.resolve(), + }, + }); + + test('instance', () => { + expect(dsm).toBeInstanceOf(DataSourceManager); + expect(dsm.dataSourceMap.get('1')).toBeInstanceOf(DataSource); + expect(dsm.dataSourceMap.get('2')?.type).toBe('http'); + }); + + test('registe', () => { + class TestDataSource extends DataSource {} + + DataSourceManager.registe('test', TestDataSource); + expect(DataSourceManager.dataSourceClassMap.get('test')).toBe(TestDataSource); + }); + + test('get', () => { + const ds = dsm.get('1'); + expect(ds).toBeInstanceOf(DataSource); + }); + + test('removeDataSource', () => { + dsm.removeDataSource('1'); + const ds = dsm.get('1'); + expect(ds).toBeUndefined(); + }); + + test('updateSchema', () => { + const dsm = new DataSourceManager({ + dataSourceConfigs: [ + { + type: 'base', + id: '1', + fields: [{ name: 'name' }], + }, + ], + httpDataSourceOptions: { + request: () => Promise.resolve(), + }, + }); + + dsm.updateSchema([ + { + type: 'base', + id: '1', + fields: [{ name: 'name1' }], + }, + ]); + const ds = dsm.get('1'); + expect(ds).toBeInstanceOf(DataSource); + }); + + test('destroy', () => { + dsm.destroy(); + expect(dsm.dataSourceMap.size).toBe(0); + }); + + test('addDataSource error', () => { + expect(dsm.addDataSource()).toBeUndefined(); + }); +}); diff --git a/packages/data-source/tests/createDataSourceManager.spec.ts b/packages/data-source/tests/createDataSourceManager.spec.ts new file mode 100644 index 00000000..fa6438d3 --- /dev/null +++ b/packages/data-source/tests/createDataSourceManager.spec.ts @@ -0,0 +1,49 @@ +import { describe, expect, test } from 'vitest'; + +import { MApp, MNode, NodeType } from '@tmagic/schema'; + +import { createDataSourceManager, DataSourceManager } from '@data-source/index'; + +const dsl: MApp = { + type: NodeType.ROOT, + id: 'app_1', + items: [ + { + type: NodeType.PAGE, + id: 'page_1', + items: [ + { + type: 'text', + id: 61705611, + text: '{{ds_bebcb2d5.text}}', + }, + ], + }, + ], + dataSourceDeps: { + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }, + dataSources: [ + { + id: 'ds_bebcb2d5', + type: 'http', + fields: [ + { + name: 'text', + }, + ], + }, + ], +}; + +describe('createDataSourceManager', () => { + test('instance', () => { + const manager = createDataSourceManager(dsl, (node: MNode) => node, {}); + expect(manager).toBeInstanceOf(DataSourceManager); + }); +}); diff --git a/packages/data-source/tests/utils.spec.ts b/packages/data-source/tests/utils.spec.ts new file mode 100644 index 00000000..4cfe83a2 --- /dev/null +++ b/packages/data-source/tests/utils.spec.ts @@ -0,0 +1,78 @@ +import { describe, expect, test } from 'vitest'; + +import { DataSchema } from '@tmagic/schema'; + +import * as util from '@data-source/util'; + +describe('getDefaultValueFromFields', () => { + test('最简单', () => { + const fileds = [ + { + name: 'name', + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data).toHaveProperty('name'); + }); + + test('默认值为string', () => { + const fileds = [ + { + name: 'name', + defaultValue: 'name', + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data.name).toBe('name'); + }); + + test('type 为 object', () => { + const fileds: DataSchema[] = [ + { + type: 'object', + name: 'name', + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data.name).toEqual({}); + }); + + test('type 为 array', () => { + const fileds: DataSchema[] = [ + { + type: 'array', + name: 'name', + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data.name).toEqual([]); + }); + + test('type 为 null', () => { + const fileds: DataSchema[] = [ + { + type: 'null', + name: 'name', + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data.name).toBeNull(); + }); + + test('object 嵌套', () => { + const fileds: DataSchema[] = [ + { + type: 'object', + name: 'name', + fields: [ + { + name: 'key', + defaultValue: 'key', + }, + ], + }, + ]; + const data = util.getDefaultValueFromFields(fileds); + expect(data.name.key).toBe('key'); + }); +}); diff --git a/packages/data-source/tsconfig.build.json b/packages/data-source/tsconfig.build.json new file mode 100644 index 00000000..41dfc935 --- /dev/null +++ b/packages/data-source/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "declarationDir": "types", + "forceConsistentCasingInFileNames": true, + "outDir": "./types", + "paths": { + "@data-source/*": ["src/*"], + }, + }, + "include": [ + "src" + ], +} diff --git a/packages/data-source/tsconfig.json b/packages/data-source/tsconfig.json new file mode 100644 index 00000000..6c40cf1e --- /dev/null +++ b/packages/data-source/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "baseUrl": "../..", + }, +} diff --git a/packages/data-source/vite.config.ts b/packages/data-source/vite.config.ts new file mode 100644 index 00000000..7fd5aa1a --- /dev/null +++ b/packages/data-source/vite.config.ts @@ -0,0 +1,55 @@ +/* + * Tencent is pleased to support the open source community by making TMagicEditor available. + * + * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import path from 'path'; + +import { defineConfig } from 'vite'; + +import pkg from './package.json'; + +export default defineConfig({ + resolve: { + alias: + process.env.NODE_ENV === 'production' + ? [{ find: /^@data-source/, replacement: path.join(__dirname, './src') }] + : [ + { find: /^@data-source/, replacement: path.join(__dirname, './src') }, + { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../schema/src/index.ts') }, + ], + }, + + build: { + cssCodeSplit: false, + sourcemap: true, + minify: false, + target: 'esnext', + + lib: { + entry: 'src/index.ts', + name: 'TMagicDataSource', + fileName: 'tmagic-data-source', + }, + + rollupOptions: { + // 确保外部化处理那些你不想打包进库的依赖 + external(id: string) { + return Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id)); + }, + }, + }, +}); diff --git a/packages/design/package.json b/packages/design/package.json index 40dba57c..eac7427a 100644 --- a/packages/design/package.json +++ b/packages/design/package.json @@ -48,7 +48,7 @@ "@vue/test-utils": "^2.0.0", "rimraf": "^3.0.2", "typescript": "^5.0.4", - "vite": "^4.2.1", + "vite": "^4.3.8", "vite-plugin-vue-setup-extend": "^0.4.0", "vue-tsc": "^1.2.0" } diff --git a/packages/design/src/Autocomplete.vue b/packages/design/src/Autocomplete.vue new file mode 100644 index 00000000..53588673 --- /dev/null +++ b/packages/design/src/Autocomplete.vue @@ -0,0 +1,85 @@ + + + diff --git a/packages/design/src/defaultAdapter.ts b/packages/design/src/defaultAdapter.ts index 1d740771..d7e1843c 100644 --- a/packages/design/src/defaultAdapter.ts +++ b/packages/design/src/defaultAdapter.ts @@ -5,6 +5,11 @@ export default { props: (props: any) => props, }, + autocomplete: { + component: 'el-autocomplete', + props: (props: any) => props, + }, + button: { component: 'el-button', props: (props: any) => props, diff --git a/packages/design/src/index.ts b/packages/design/src/index.ts index 478662e6..1a1e2b86 100644 --- a/packages/design/src/index.ts +++ b/packages/design/src/index.ts @@ -7,6 +7,7 @@ export * from './type'; export * from './config'; /* eslint-disable @typescript-eslint/no-unused-vars */ +export { default as TMagicAutocomplete } from './Autocomplete.vue'; export { default as TMagicBadge } from './Badge.vue'; export { default as TMagicButton } from './Button.vue'; export { default as TMagicCard } from './Card.vue'; diff --git a/packages/editor/package.json b/packages/editor/package.json index 6b997e8a..f639c2bf 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -51,6 +51,7 @@ "@tmagic/form": "1.2.15", "@tmagic/schema": "1.2.15", "@tmagic/stage": "1.2.15", + "@tmagic/table": "1.2.15", "@tmagic/utils": "1.2.15", "buffer": "^6.0.3", "color": "^3.1.3", @@ -80,7 +81,7 @@ "sass": "^1.35.1", "tsc-alias": "^1.8.5", "typescript": "^5.0.4", - "vite": "^4.2.1", + "vite": "^4.3.8", "vite-plugin-vue-setup-extend": "^0.4.0", "vue-tsc": "^1.0.11" } diff --git a/packages/editor/src/Editor.vue b/packages/editor/src/Editor.vue index 92cbff0f..9ac4cfeb 100644 --- a/packages/editor/src/Editor.vue +++ b/packages/editor/src/Editor.vue @@ -73,6 +73,7 @@ import Sidebar from './layouts/sidebar/Sidebar.vue'; import Workspace from './layouts/workspace/Workspace.vue'; import codeBlockService from './services/codeBlock'; import componentListService from './services/componentList'; +import dataSourceService from './services/dataSource'; import depService from './services/dep'; import editorService from './services/editor'; import eventsService from './services/events'; @@ -110,6 +111,7 @@ export default defineComponent({ storageService, codeBlockService, depService, + dataSourceService, }; initServiceEvents(props, emit, services); diff --git a/packages/editor/src/components/CodeDraftEditor.vue b/packages/editor/src/components/CodeDraftEditor.vue index 42e72727..141402d9 100644 --- a/packages/editor/src/components/CodeDraftEditor.vue +++ b/packages/editor/src/components/CodeDraftEditor.vue @@ -13,13 +13,13 @@ {{ isFullScreen ? '退出全屏' : '全屏' }} 确认 - 关闭 + 关闭
{{ isFullScreen ? '退出全屏' : '全屏' }} - 关闭 + 关闭
diff --git a/packages/editor/src/editorProps.ts b/packages/editor/src/editorProps.ts index 1f2762aa..f195b192 100644 --- a/packages/editor/src/editorProps.ts +++ b/packages/editor/src/editorProps.ts @@ -79,6 +79,11 @@ export default { default: () => ({}), }, + dataScourceConfigs: { + type: Object as PropType>, + default: () => ({}), + }, + /** 画布中组件选中框的移动范围 */ moveableOptions: { type: [Object, Function] as PropType< diff --git a/packages/editor/src/fields/DataSourceFields.vue b/packages/editor/src/fields/DataSourceFields.vue new file mode 100644 index 00000000..c90d66bd --- /dev/null +++ b/packages/editor/src/fields/DataSourceFields.vue @@ -0,0 +1,178 @@ + + + diff --git a/packages/editor/src/fields/DataSourceInput.vue b/packages/editor/src/fields/DataSourceInput.vue new file mode 100644 index 00000000..874a2e5c --- /dev/null +++ b/packages/editor/src/fields/DataSourceInput.vue @@ -0,0 +1,342 @@ + + + diff --git a/packages/editor/src/fields/KeyValue.vue b/packages/editor/src/fields/KeyValue.vue new file mode 100644 index 00000000..58f16c9f --- /dev/null +++ b/packages/editor/src/fields/KeyValue.vue @@ -0,0 +1,93 @@ + + + diff --git a/packages/editor/src/index.ts b/packages/editor/src/index.ts index 18bffa53..70997458 100644 --- a/packages/editor/src/index.ts +++ b/packages/editor/src/index.ts @@ -21,7 +21,10 @@ import Code from './fields/Code.vue'; import CodeLink from './fields/CodeLink.vue'; import CodeSelect from './fields/CodeSelect.vue'; import CodeSelectCol from './fields/CodeSelectCol.vue'; +import DataSourceFields from './fields/DataSourceFields.vue'; +import DataSourceInput from './fields/DataSourceInput.vue'; import EventSelect from './fields/EventSelect.vue'; +import KeyValue from './fields/KeyValue.vue'; import uiSelect from './fields/UISelect.vue'; import CodeEditor from './layouts/CodeEditor.vue'; import { setConfig } from './utils/config'; @@ -40,6 +43,7 @@ export { default as propsService } from './services/props'; export { default as historyService } from './services/history'; export { default as storageService } from './services/storage'; export { default as eventsService } from './services/events'; +export { default as dataSourceService } from './services/dataSource'; export { default as uiService } from './services/ui'; export { default as codeBlockService } from './services/codeBlock'; export { default as depService } from './services/dep'; @@ -47,7 +51,10 @@ export { default as ComponentListPanel } from './layouts/sidebar/ComponentListPa export { default as LayerPanel } from './layouts/sidebar/LayerPanel.vue'; export { default as CodeSelect } from './fields/CodeSelect.vue'; export { default as CodeSelectCol } from './fields/CodeSelectCol.vue'; +export { default as DataSourceFields } from './fields/DataSourceFields.vue'; +export { default as DataSourceInput } from './fields/DataSourceInput.vue'; export { default as EventSelect } from './fields/EventSelect.vue'; +export { default as KeyValue } from './fields/KeyValue.vue'; export { default as CodeBlockList } from './layouts/sidebar/code-block/CodeBlockList.vue'; export { default as PropsPanel } from './layouts/PropsPanel.vue'; export { default as ToolButton } from './components/ToolButton.vue'; @@ -74,5 +81,8 @@ export default { app.component('m-fields-code-select', CodeSelect); app.component('m-fields-code-select-col', CodeSelectCol); app.component('m-fields-event-select', EventSelect); + app.component('m-fields-data-source-fields', DataSourceFields); + app.component('m-fields-key-value', KeyValue); + app.component('m-fields-data-source-input', DataSourceInput); }, }; diff --git a/packages/editor/src/initService.ts b/packages/editor/src/initService.ts index c6ecfeab..d0fba7f8 100644 --- a/packages/editor/src/initService.ts +++ b/packages/editor/src/initService.ts @@ -1,10 +1,13 @@ import type { ExtractPropTypes } from 'vue'; import { onUnmounted, toRaw, watch } from 'vue'; +import { cloneDeep } from 'lodash-es'; import type { EventOption } from '@tmagic/core'; -import type { CodeBlockContent, Id, MApp, MNode, MPage } from '@tmagic/schema'; +import type { CodeBlockContent, DataSourceSchema, Id, MApp, MNode, MPage } from '@tmagic/schema'; +import { getNodes } from '@tmagic/utils'; -import { createCodeBlockTarget } from './utils/dep'; +import type { Target } from './services/dep'; +import { createCodeBlockTarget, createDataSourceTarget } from './utils/dep'; import editorProps from './editorProps'; import type { Services } from './type'; @@ -107,8 +110,85 @@ export const initServiceState = ( export const initServiceEvents = ( props: Readonly>>>, emit: (event: 'props-panel-mounted' | 'update:modelValue', ...args: any[]) => void, - { editorService, codeBlockService, depService }: Services, + { editorService, codeBlockService, dataSourceService, depService }: Services, ) => { + const getApp = () => { + const stage = editorService.get('stage'); + return stage?.renderer.runtime?.getApp?.(); + }; + + const updateDataSoucreSchema = () => { + const root = editorService.get('root'); + + if (root?.dataSources) { + getApp()?.dataSourceManager?.updateSchema(root.dataSources); + } + }; + + const upateNodeWhenDataSourceChange = (nodes: MNode[]) => { + const root = editorService.get('root'); + const stage = editorService.get('stage'); + + if (!root || !stage) return; + + const app = getApp(); + + if (!app) return; + + if (app.dsl) { + app.dsl.dataSourceDeps = root.dataSourceDeps; + app.dsl.dataSources = root.dataSources; + } + + updateDataSoucreSchema(); + + nodes.forEach((node) => { + const deps = Object.values(root.dataSourceDeps || {}); + deps.forEach((dep) => { + if (dep[node.id]) { + stage.update({ + config: cloneDeep(node), + parentId: editorService.getParentById(node.id)?.id, + root: cloneDeep(root), + }); + } + }); + }); + }; + + const targetAddHandler = (target: Target) => { + if (target.type !== 'data-source') return; + + const root = editorService.get('root'); + if (!root) return; + + if (!root.dataSourceDeps) { + root.dataSourceDeps = {}; + } + + root.dataSourceDeps[target.id] = target.deps; + }; + + const targetRemoveHandler = (id: string | number) => { + const root = editorService.get('root'); + if (!root?.dataSourceDeps) return; + + delete root.dataSourceDeps[id]; + }; + + const depUpdateHandler = (node: MNode) => { + upateNodeWhenDataSourceChange([node]); + }; + + const collectedHandler = (nodes: MNode[]) => { + upateNodeWhenDataSourceChange(nodes); + }; + + depService.on('add-target', targetAddHandler); + depService.on('remove-target', targetRemoveHandler); + depService.on('dep-update', depUpdateHandler); + depService.on('collected', collectedHandler); + const rootChangeHandler = async (value: MApp, preValue?: MApp | null) => { const nodeId = editorService.get('node')?.id || props.defaultSelected; let node; @@ -131,8 +211,10 @@ export const initServiceEvents = ( } value.codeBlocks = value.codeBlocks || {}; + value.dataSources = value.dataSources || []; codeBlockService.setCodeDsl(value.codeBlocks); + dataSourceService.set('dataSources', value.dataSources); depService.removeTargets('code-block'); @@ -140,10 +222,15 @@ export const initServiceEvents = ( depService.addTarget(createCodeBlockTarget(id, code)); }); + value.dataSources.forEach((ds) => { + depService.addTarget(createDataSourceTarget(ds.id, ds)); + }); + if (value && Array.isArray(value.items)) { depService.collect(value.items, true); } else { depService.clear(); + delete value.dataSourceDeps; } }; @@ -185,7 +272,39 @@ export const initServiceEvents = ( codeBlockService.on('addOrUpdate', codeBlockAddOrUpdateHandler); codeBlockService.on('remove', codeBlockRemoveHandler); + const dataSourceAddHandler = (config: DataSourceSchema) => { + depService.addTarget(createDataSourceTarget(config.id, config)); + getApp()?.dataSourceManager?.addDataSource(config); + }; + + const dataSourceUpdateHandler = (config: DataSourceSchema) => { + if (config.title) { + depService.getTarget(config.id)!.name = config.title; + } + const root = editorService.get('root'); + + const targets = depService.getTargets('data-source'); + + const nodes = getNodes(Object.keys(targets[config.id].deps), root?.items); + + upateNodeWhenDataSourceChange(nodes); + }; + + const dataSourceRemoveHandler = (id: string) => { + depService.removeTarget(id); + getApp()?.dataSourceManager?.removeDataSource(id); + }; + + dataSourceService.on('add', dataSourceAddHandler); + dataSourceService.on('update', dataSourceUpdateHandler); + dataSourceService.on('remove', dataSourceRemoveHandler); + onUnmounted(() => { + depService.off('add-target', targetAddHandler); + depService.off('remove-target', targetRemoveHandler); + depService.off('dep-update', depUpdateHandler); + depService.off('collected', collectedHandler); + editorService.off('history-change', historyChangeHandler); editorService.off('root-change', rootChangeHandler); editorService.off('add', nodeAddHandler); @@ -194,5 +313,9 @@ export const initServiceEvents = ( codeBlockService.off('addOrUpdate', codeBlockAddOrUpdateHandler); codeBlockService.off('remove', codeBlockRemoveHandler); + + dataSourceService.off('add', dataSourceAddHandler); + dataSourceService.off('update', dataSourceUpdateHandler); + dataSourceService.off('remove', dataSourceRemoveHandler); }); }; diff --git a/packages/editor/src/layouts/sidebar/Sidebar.vue b/packages/editor/src/layouts/sidebar/Sidebar.vue index bc1e4326..bf8c60d4 100644 --- a/packages/editor/src/layouts/sidebar/Sidebar.vue +++ b/packages/editor/src/layouts/sidebar/Sidebar.vue @@ -8,7 +8,7 @@ > @@ -85,7 +85,7 @@ diff --git a/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue new file mode 100644 index 00000000..2d3f71b3 --- /dev/null +++ b/packages/editor/src/layouts/sidebar/data-source/DataSourceListPanel.vue @@ -0,0 +1,130 @@ + + + diff --git a/packages/editor/src/services/codeBlock.ts b/packages/editor/src/services/codeBlock.ts index eb2db518..fb2d0464 100644 --- a/packages/editor/src/services/codeBlock.ts +++ b/packages/editor/src/services/codeBlock.ts @@ -23,7 +23,6 @@ import { CodeBlockContent, CodeBlockDSL, Id } from '@tmagic/schema'; import type { CodeState } from '@editor/type'; import { CODE_DRAFT_STORAGE_KEY } from '@editor/type'; -import { info } from '@editor/utils/logger'; import BaseService from './BaseService'; @@ -55,7 +54,6 @@ class CodeBlock extends BaseService { */ public async setCodeDsl(codeDsl: CodeBlockDSL): Promise { this.state.codeDsl = codeDsl; - info('[code-block]:code-dsl-change', this.state.codeDsl); this.emit('code-dsl-change', this.state.codeDsl); } diff --git a/packages/editor/src/services/dataSource.ts b/packages/editor/src/services/dataSource.ts new file mode 100644 index 00000000..0e94ee80 --- /dev/null +++ b/packages/editor/src/services/dataSource.ts @@ -0,0 +1,90 @@ +import { reactive } from 'vue'; +import { cloneDeep } from 'lodash-es'; + +import type { FormConfig } from '@tmagic/form'; +import { DataSourceSchema } from '@tmagic/schema'; +import { guid } from '@tmagic/utils'; + +import { getFormConfig } from '@editor/utils/data-source'; + +import BaseService from './BaseService'; + +interface State { + dataSources: DataSourceSchema[]; + configs: Record; +} + +type StateKey = keyof State; +class DataSource extends BaseService { + private state = reactive({ + dataSources: [], + configs: {}, + }); + + public set(name: K, value: T) { + this.state[name] = value; + } + + public get(name: K): State[K] { + return this.state[name]; + } + + public getFormConfig(type = 'base') { + return getFormConfig(type, this.get('configs')); + } + + public setFormConfig(type: string, config: FormConfig) { + this.get('configs')[type] = config; + } + + public add(config: DataSourceSchema) { + const newConfig = { + ...config, + id: this.createId(), + }; + + this.get('dataSources').push(newConfig); + + this.emit('add', newConfig); + } + + public update(config: DataSourceSchema) { + const dataSources = this.get('dataSources'); + + const index = dataSources.findIndex((ds) => ds.id === config.id); + + dataSources[index] = cloneDeep(config); + + this.emit('update', config); + } + + public remove(id: string) { + const dataSources = this.get('dataSources'); + const index = dataSources.findIndex((ds) => ds.id === id); + dataSources.splice(index, 1); + + this.emit('remove', id); + } + + public getDataSourceById(id: string) { + return this.get('dataSources').find((ds) => ds.id === id); + } + + public resetState() { + this.set('dataSources', []); + } + + public destroy() { + this.removeAllListeners(); + this.resetState(); + this.removeAllPlugins(); + } + + private createId(): string { + return `ds_${guid()}`; + } +} + +export type DataSourceService = DataSource; + +export default new DataSource(); diff --git a/packages/editor/src/services/dep.ts b/packages/editor/src/services/dep.ts index 24e4af71..9869876b 100644 --- a/packages/editor/src/services/dep.ts +++ b/packages/editor/src/services/dep.ts @@ -267,6 +267,8 @@ export class Watcher extends EventEmitter { }); }); }); + + this.emit('collected', nodes, deep); } /** @@ -299,6 +301,7 @@ export class Watcher extends EventEmitter { if (target.isTarget(key, value)) { target.updateDep(node, fullKey); + this.emit('update-dep', node, fullKey); } else if (!keyIsItems && Array.isArray(value)) { value.forEach((item, index) => { collectTarget(item, `${fullKey}.${index}`); diff --git a/packages/editor/src/theme/data-source-fields.scss b/packages/editor/src/theme/data-source-fields.scss new file mode 100644 index 00000000..ed97ac31 --- /dev/null +++ b/packages/editor/src/theme/data-source-fields.scss @@ -0,0 +1,13 @@ +.m-editor-data-source-fields { + width: 100%; + + .tmagic-design-table { + width: 100%; + } + + .m-editor-data-source-fields-footer { + display: flex; + justify-content: flex-end; + margin-top: 15px; + } +} diff --git a/packages/editor/src/theme/data-source.scss b/packages/editor/src/theme/data-source.scss new file mode 100644 index 00000000..61480adf --- /dev/null +++ b/packages/editor/src/theme/data-source.scss @@ -0,0 +1,17 @@ +.data-source-list-panel { + .list-container { + .list-item { + .codeIcon { + width: 22px; + height: 22px; + margin-right: 5px; + } + + .compIcon { + width: 22px; + height: 22px; + margin-right: 5px; + } + } + } +} diff --git a/packages/editor/src/theme/key-value.scss b/packages/editor/src/theme/key-value.scss new file mode 100644 index 00000000..85728a28 --- /dev/null +++ b/packages/editor/src/theme/key-value.scss @@ -0,0 +1,13 @@ +.m-fields-key-value-item { + display: flex; + margin-bottom: 10px; + align-items: center; +} + +.m-fileds-key-value-delimiter { + margin: 0 10px; +} + +.m-fileds-key-value-delete { + margin-left: 10px; +} diff --git a/packages/editor/src/theme/theme.scss b/packages/editor/src/theme/theme.scss index de99bd79..df06ccfc 100644 --- a/packages/editor/src/theme/theme.scss +++ b/packages/editor/src/theme/theme.scss @@ -17,3 +17,6 @@ @import "./layout.scss"; @import "./breadcrumb.scss"; @import "./dep-list.scss"; +@import "./data-source.scss"; +@import "./data-source-fields.scss"; +@import "./key-value.scss"; diff --git a/packages/editor/src/type.ts b/packages/editor/src/type.ts index 43cf2960..25b32c20 100644 --- a/packages/editor/src/type.ts +++ b/packages/editor/src/type.ts @@ -30,6 +30,7 @@ import type { import type { CodeBlockService } from './services/codeBlock'; import type { ComponentListService } from './services/componentList'; +import { DataSourceService } from './services/dataSource'; import type { DepService } from './services/dep'; import type { EditorService } from './services/editor'; import type { EventsService } from './services/events'; @@ -56,6 +57,7 @@ export interface Services { uiService: UiService; codeBlockService: CodeBlockService; depService: DepService; + dataSourceService: DataSourceService; } export interface StageOptions { @@ -264,7 +266,7 @@ export interface SideComponent extends MenuComponent { * layer: 已选组件树 * code-block: 代码块 */ -export type SideItem = 'component-list' | 'layer' | 'code-block' | SideComponent; +export type SideItem = 'component-list' | 'layer' | 'code-block' | 'data-source' | SideComponent; /** 工具栏 */ export interface SideBarData { diff --git a/packages/editor/src/utils/data-source/formConfigs/base.ts b/packages/editor/src/utils/data-source/formConfigs/base.ts new file mode 100644 index 00000000..37ad98c3 --- /dev/null +++ b/packages/editor/src/utils/data-source/formConfigs/base.ts @@ -0,0 +1,32 @@ +import type { FormConfig } from '@tmagic/form'; + +export default [ + { + name: 'id', + type: 'hidden', + }, + { + name: 'type', + text: '类型', + type: 'select', + options: [ + { text: '基础', value: 'base' }, + { text: 'HTTP', value: 'http' }, + ], + defaultValue: 'base', + }, + { + name: 'title', + text: '名称', + rules: [ + { + required: true, + message: '请输入名称', + }, + ], + }, + { + name: 'description', + text: '描述', + }, +] as FormConfig; diff --git a/packages/editor/src/utils/data-source/formConfigs/http.ts b/packages/editor/src/utils/data-source/formConfigs/http.ts new file mode 100644 index 00000000..b28a4ebb --- /dev/null +++ b/packages/editor/src/utils/data-source/formConfigs/http.ts @@ -0,0 +1,50 @@ +import { FormConfig } from '@tmagic/form'; + +export default [ + { + name: 'autoFetch', + text: '自动请求', + type: 'switch', + defaultValue: true, + }, + { + type: 'fieldset', + name: 'options', + legend: 'HTTP 配置', + items: [ + { + name: 'url', + text: 'URL', + }, + { + name: 'method', + text: 'Method', + type: 'select', + options: [ + { text: 'GET', value: 'GET' }, + { text: 'POST', value: 'POST' }, + { text: 'PUT', value: 'PUT' }, + { text: 'DELETE', value: 'DELETE' }, + ], + }, + { + name: 'params', + type: 'key-value', + defaultValue: {}, + text: '参数', + }, + { + name: 'data', + type: 'key-value', + defaultValue: {}, + text: '请求体', + }, + { + name: 'headers', + type: 'key-value', + defaultValue: {}, + text: '请求头', + }, + ], + }, +] as FormConfig; diff --git a/packages/editor/src/utils/data-source/index.ts b/packages/editor/src/utils/data-source/index.ts new file mode 100644 index 00000000..33c6f33a --- /dev/null +++ b/packages/editor/src/utils/data-source/index.ts @@ -0,0 +1,31 @@ +import { FormConfig } from '@tmagic/form'; + +import BaseFormConfig from './formConfigs/base'; +import HttpFormConfig from './formConfigs/http'; + +const fillConfig = (config: FormConfig): FormConfig => [ + ...BaseFormConfig, + ...config, + { + type: 'panel', + title: '数据定义', + items: [ + { + name: 'fields', + type: 'data-source-fields', + defaultValue: [], + }, + ], + }, +]; + +export const getFormConfig = (type: string, configs: Record): FormConfig => { + switch (type) { + case 'base': + return fillConfig([]); + case 'http': + return fillConfig(HttpFormConfig); + default: + return fillConfig(configs[type] || []); + } +}; diff --git a/packages/editor/src/utils/dep.ts b/packages/editor/src/utils/dep.ts index 64311f0c..13c44a06 100644 --- a/packages/editor/src/utils/dep.ts +++ b/packages/editor/src/utils/dep.ts @@ -1,6 +1,6 @@ import { isEmpty } from 'lodash-es'; -import { CodeBlockContent, HookType, Id } from '@tmagic/schema'; +import { CodeBlockContent, DataSourceSchema, HookType, Id } from '@tmagic/schema'; import { Target } from '@editor/services/dep'; import type { HookData } from '@editor/type'; @@ -19,3 +19,11 @@ export const createCodeBlockTarget = (id: Id, codeBlock: CodeBlockContent) => return false; }, }); + +export const createDataSourceTarget = (id: Id, ds: DataSourceSchema) => + new Target({ + type: 'data-source', + id, + name: ds.title || `${id}`, + isTarget: (key: string | number, value: any) => typeof value === 'string' && value.includes(`${id}`), + }); diff --git a/packages/element-plus-adapter/src/index.ts b/packages/element-plus-adapter/src/index.ts index 559af4d5..14ed5ad2 100644 --- a/packages/element-plus-adapter/src/index.ts +++ b/packages/element-plus-adapter/src/index.ts @@ -1,4 +1,5 @@ import { + ElAutocomplete, ElBadge, ElButton, ElCard, @@ -51,6 +52,11 @@ const adapter: any = { message: ElMessage, messageBox: ElMessageBox, components: { + autocomplete: { + component: ElAutocomplete, + props: (props: any) => props, + }, + badge: { component: ElBadge, props: (props: any) => props, diff --git a/packages/form/package.json b/packages/form/package.json index 0f0385d7..5f4a198a 100644 --- a/packages/form/package.json +++ b/packages/form/package.json @@ -56,7 +56,7 @@ "rimraf": "^3.0.2", "sass": "^1.35.1", "typescript": "^5.0.4", - "vite": "^4.2.1", + "vite": "^4.3.8", "vite-plugin-vue-setup-extend": "^0.4.0", "vue-tsc": "^1.2.0" } diff --git a/packages/form/src/fields/Select.vue b/packages/form/src/fields/Select.vue index 6cf88a8a..f5d1064a 100644 --- a/packages/form/src/fields/Select.vue +++ b/packages/form/src/fields/Select.vue @@ -29,6 +29,7 @@ import { inject, onBeforeMount, Ref, ref, watch, watchEffect } from 'vue'; import { TMagicSelect } from '@tmagic/design'; +import { getValueByKeyPath } from '@tmagic/utils'; import { FormState, SelectConfig, SelectGroupOption, SelectOption } from '../schema'; import { getConfig } from '../utils/config'; @@ -157,12 +158,9 @@ const getOptions = async () => { }); } - const optionsData = root.split('.').reduce((accumulator, currentValue: any) => accumulator[currentValue], res); + const optionsData = getValueByKeyPath(root, res); - const resTotal = globalThis.parseInt( - totalKey.split('.').reduce((accumulator, currentValue: any) => accumulator[currentValue], res), - 10, - ); + const resTotal = globalThis.parseInt(getValueByKeyPath(totalKey, res), 10); if (resTotal > 0) { total.value = resTotal; } @@ -283,9 +281,7 @@ const getInitOption = async () => { }); } - let initData = (initRoot || root) - .split('.') - .reduce((accumulator, currentValue: any) => accumulator[currentValue], res); + let initData = getValueByKeyPath(initRoot || root, res); if (initData) { if (!Array.isArray(initData)) { initData = [initData]; diff --git a/packages/form/tests/unit/fields/Time.spec.ts b/packages/form/tests/unit/fields/Time.spec.ts index a4e4acaf..7d37f7f0 100644 --- a/packages/form/tests/unit/fields/Time.spec.ts +++ b/packages/form/tests/unit/fields/Time.spec.ts @@ -57,7 +57,6 @@ describe('Time', () => { await input.setValue('12:00:00'); const value = await (wrapper.vm as any).submitForm(); - console.log(value.time); expect(value.time).toMatch('12:00:00'); }); }); diff --git a/packages/schema/src/index.ts b/packages/schema/src/index.ts index c3d10091..bf3e6a85 100644 --- a/packages/schema/src/index.ts +++ b/packages/schema/src/index.ts @@ -32,6 +32,10 @@ export enum ActionType { CODE = 'code', } +export interface DataSourceDeps { + [dataSourceId: string | number]: Dep; +} + /** 事件类型(已废弃,后续不建议继续使用) */ export interface DeprecatedEventConfig { /** 待触发的事件名称 */ @@ -106,6 +110,10 @@ export interface MApp extends MComponent { items: MPage[]; /** 代码块 */ codeBlocks?: CodeBlockDSL; + + dataSources?: DataSourceSchema[]; + + dataSourceDeps?: DataSourceDeps; } export interface CodeBlockDSL { @@ -140,3 +148,41 @@ export enum HookType { /** 代码块钩子标识 */ CODE = 'code', } + +export interface DataSchema { + type?: 'null' | 'boolean' | 'object' | 'array' | 'number' | 'string' | 'any'; + /** 键名 */ + name: string; + /** 展示名称 */ + title?: string; + /** 实体描述,鼠标hover时展示 */ + description?: string; + /** 默认值 */ + defaultValue?: any; + /** 是否可用 */ + enable?: boolean; + /** type === 'object' || type === 'array' */ + fields?: DataSchema[]; +} + +export interface DataSourceSchema { + /** 数据源类型,根据类型来实例化;例如http则使用new HttpDataSource */ + type: string; + /** 实体ID */ + id: string; + /** 实体名称,用于关联时展示 */ + title?: string; + /** 实体描述,鼠标hover时展示 */ + description?: string; + /** 字段列表 */ + fields: DataSchema[]; + /** 扩展字段 */ + [key: string]: any; +} + +export interface Dep { + [nodeId: Id]: { + name: string; + keys: Id[]; + }; +} diff --git a/packages/table/package.json b/packages/table/package.json index 6e755126..ddd4c6ce 100644 --- a/packages/table/package.json +++ b/packages/table/package.json @@ -53,7 +53,7 @@ "rimraf": "^3.0.2", "sass": "^1.35.1", "typescript": "^5.0.4", - "vite": "^4.2.1", + "vite": "^4.3.8", "vite-plugin-vue-setup-extend": "^0.4.0", "vue-tsc": "^1.2.0" } diff --git a/packages/ui-react/src/button/formConfig.ts b/packages/ui-react/src/button/formConfig.ts index 100d6d72..2e86b78c 100644 --- a/packages/ui-react/src/button/formConfig.ts +++ b/packages/ui-react/src/button/formConfig.ts @@ -20,6 +20,7 @@ export default [ { name: 'text', text: '文本', + type: 'data-source-input', }, { name: 'multiple', diff --git a/packages/ui-react/src/img/formConfig.ts b/packages/ui-react/src/img/formConfig.ts index 5419472f..1616e0b4 100644 --- a/packages/ui-react/src/img/formConfig.ts +++ b/packages/ui-react/src/img/formConfig.ts @@ -24,5 +24,6 @@ export default [ { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui-react/src/qrcode/formConfig.ts b/packages/ui-react/src/qrcode/formConfig.ts index 9b0b61b7..e5c4ef09 100644 --- a/packages/ui-react/src/qrcode/formConfig.ts +++ b/packages/ui-react/src/qrcode/formConfig.ts @@ -20,5 +20,6 @@ export default [ { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui-react/src/text/Text.tsx b/packages/ui-react/src/text/Text.tsx index 96aa5e1b..9e83d0ad 100644 --- a/packages/ui-react/src/text/Text.tsx +++ b/packages/ui-react/src/text/Text.tsx @@ -16,7 +16,7 @@ * limitations under the License. */ -import React, { useState } from 'react'; +import React from 'react'; import type { MComponent } from '@tmagic/schema'; @@ -27,15 +27,13 @@ interface TextProps { } const Text: React.FC = ({ config }) => { - const { app, ref } = useApp({ config }); + const { app } = useApp({ config }); if (!app) return null; - const [displayText] = useState(config.text); - return ( -
- {displayText} +
+ {config.text}
); }; diff --git a/packages/ui-react/src/text/formConfig.ts b/packages/ui-react/src/text/formConfig.ts index 100d6d72..2e86b78c 100644 --- a/packages/ui-react/src/text/formConfig.ts +++ b/packages/ui-react/src/text/formConfig.ts @@ -20,6 +20,7 @@ export default [ { name: 'text', text: '文本', + type: 'data-source-input', }, { name: 'multiple', diff --git a/packages/ui-vue2/package.json b/packages/ui-vue2/package.json index 9f03c9ed..0b80a595 100644 --- a/packages/ui-vue2/package.json +++ b/packages/ui-vue2/package.json @@ -22,7 +22,7 @@ "vue": "^2.7.4" }, "devDependencies": { - "vite": "^4.2.1", + "vite": "^4.3.8", "vue-template-compiler": "^2.7.4" } } diff --git a/packages/ui-vue2/src/button/formConfig.ts b/packages/ui-vue2/src/button/formConfig.ts index 7a8b0eb4..22a9a517 100644 --- a/packages/ui-vue2/src/button/formConfig.ts +++ b/packages/ui-vue2/src/button/formConfig.ts @@ -20,5 +20,6 @@ export default [ { text: '文本', name: 'text', + type: 'data-source-input', }, ]; diff --git a/packages/ui-vue2/src/img/src/formConfig.ts b/packages/ui-vue2/src/img/src/formConfig.ts index 5419472f..1616e0b4 100644 --- a/packages/ui-vue2/src/img/src/formConfig.ts +++ b/packages/ui-vue2/src/img/src/formConfig.ts @@ -24,5 +24,6 @@ export default [ { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui-vue2/src/qrcode/src/formConfig.ts b/packages/ui-vue2/src/qrcode/src/formConfig.ts index 9b0b61b7..e5c4ef09 100644 --- a/packages/ui-vue2/src/qrcode/src/formConfig.ts +++ b/packages/ui-vue2/src/qrcode/src/formConfig.ts @@ -20,5 +20,6 @@ export default [ { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui-vue2/src/text/formConfig.ts b/packages/ui-vue2/src/text/formConfig.ts index 100d6d72..2e86b78c 100644 --- a/packages/ui-vue2/src/text/formConfig.ts +++ b/packages/ui-vue2/src/text/formConfig.ts @@ -20,6 +20,7 @@ export default [ { name: 'text', text: '文本', + type: 'data-source-input', }, { name: 'multiple', diff --git a/packages/ui/src/button/src/formConfig.ts b/packages/ui/src/button/src/formConfig.ts index 7a8b0eb4..22a9a517 100644 --- a/packages/ui/src/button/src/formConfig.ts +++ b/packages/ui/src/button/src/formConfig.ts @@ -20,5 +20,6 @@ export default [ { text: '文本', name: 'text', + type: 'data-source-input', }, ]; diff --git a/packages/ui/src/img/src/formConfig.ts b/packages/ui/src/img/src/formConfig.ts index 5419472f..82926bdb 100644 --- a/packages/ui/src/img/src/formConfig.ts +++ b/packages/ui/src/img/src/formConfig.ts @@ -20,9 +20,11 @@ export default [ { text: '图片', name: 'src', + type: 'data-source-input', }, { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui/src/qrcode/src/formConfig.ts b/packages/ui/src/qrcode/src/formConfig.ts index 9b0b61b7..e5c4ef09 100644 --- a/packages/ui/src/qrcode/src/formConfig.ts +++ b/packages/ui/src/qrcode/src/formConfig.ts @@ -20,5 +20,6 @@ export default [ { text: '链接', name: 'url', + type: 'data-source-input', }, ]; diff --git a/packages/ui/src/text/src/formConfig.ts b/packages/ui/src/text/src/formConfig.ts index 100d6d72..2e86b78c 100644 --- a/packages/ui/src/text/src/formConfig.ts +++ b/packages/ui/src/text/src/formConfig.ts @@ -20,6 +20,7 @@ export default [ { name: 'text', text: '文本', + type: 'data-source-input', }, { name: 'multiple', diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index b86bdafe..c88d8379 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -19,7 +19,7 @@ import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; -import type { MComponent, MNode } from '@tmagic/schema'; +import type { DataSourceDeps, Id, MComponent, MNode } from '@tmagic/schema'; import { NodeType } from '@tmagic/schema'; export * from './dom'; @@ -72,7 +72,7 @@ export const emptyFn = (): any => undefined; * @param {Array} data 要查找的根容器节点 * @return {Array} 组件在data中的子孙路径 */ -export const getNodePath = (id: number | string, data: MNode[] = []): MNode[] => { +export const getNodePath = (id: Id, data: MNode[] = []): MNode[] => { const path: MNode[] = []; const get = function (id: number | string, data: MNode[]): MNode | null { @@ -81,7 +81,7 @@ export const getNodePath = (id: number | string, data: MNode[] = []): MNode[] => } for (let i = 0, l = data.length; i < l; i++) { - const item: any = data[i]; + const item = data[i]; path.push(item); if (`${item.id}` === `${id}`) { @@ -156,3 +156,134 @@ export const guid = (digit = 8): string => const v = c === 'x' ? r : (r & 0x3) | 0x8; return v.toString(16); }); + +export const getValueByKeyPath: any = (keys: string, value: Record) => { + const path = keys.split('.'); + const pathLength = path.length; + + return path.reduce((accumulator, currentValue: any, currentIndex: number) => { + if (Object.prototype.toString.call(accumulator) === '[object Object]' || Array.isArray(accumulator)) { + return accumulator[currentValue]; + } + + if (pathLength - 1 === currentIndex) { + return undefined; + } + + return {}; + }, value); +}; + +export const getNodes = (ids: Id[], data: MNode[] = []): MNode[] => { + const nodes: MNode[] = []; + + const get = function (ids: Id[], data: MNode[]) { + if (!Array.isArray(data)) { + return; + } + + for (let i = 0, l = data.length; i < l; i++) { + const item = data[i]; + const index = ids.findIndex((id: Id) => `${id}` === `${item.id}`); + + if (index > -1) { + ids.slice(index, 1); + nodes.push(item); + } + + if (item.items) { + get(ids, item.items); + } + } + }; + + get(ids, data); + + return nodes; +}; + +export const getDepKeys = (dataSourceDeps: DataSourceDeps = {}, nodeId: Id) => + Array.from( + Object.values(dataSourceDeps).reduce((prev, cur) => { + (cur[nodeId]?.keys || []).forEach((key) => prev.add(key)); + return prev; + }, new Set()), + ); + +export const getDepNodeIds = (dataSourceDeps: DataSourceDeps = {}) => + Array.from( + Object.values(dataSourceDeps).reduce((prev, cur) => { + Object.keys(cur).forEach((id) => { + prev.add(id); + }); + return prev; + }, new Set()), + ); + +/** + * 将新节点更新到data或者parentId对应的节点的子节点中 + * @param newNode 新节点 + * @param data 需要修改的数据 + * @param parentId 父节点 id + */ +export const replaceChildNode = (newNode: MNode, data?: MNode[], parentId?: Id) => { + const path = getNodePath(newNode.id, data); + const node = path.pop(); + let parent = path.pop(); + + if (parentId) { + parent = getNodePath(parentId, data).pop(); + } + + if (!node) throw new Error('未找到目标节点'); + if (!parent) throw new Error('未找到父节点'); + + const index = parent.items?.findIndex((child: MNode) => child.id === node.id); + parent.items.splice(index, 1, newNode); +}; + +export const compiledNode = ( + compile: (template: string) => string, + node: MNode, + dataSourceDeps: DataSourceDeps = {}, + sourceId?: Id, +) => { + let keys: Id[] = []; + if (!sourceId) { + keys = getDepKeys(dataSourceDeps, node.id); + } else { + const dep = dataSourceDeps[sourceId]; + keys = dep?.[node.id].keys || []; + } + + const keyPrefix = '__magic__'; + + keys.forEach((key) => { + const keyPath = `${key}`.split('.'); + const keyPathLength = keyPath.length; + keyPath.reduce((accumulator, currentValue: any, currentIndex) => { + if (keyPathLength - 1 === currentIndex) { + if (typeof accumulator[`${keyPrefix}${currentValue}`] === 'undefined') { + accumulator[`${keyPrefix}${currentValue}`] = accumulator[currentValue]; + } + + try { + accumulator[currentValue] = compile(accumulator[`${keyPrefix}${currentValue}`]); + } catch (e) { + console.error(e); + accumulator[currentValue] = ''; + } + + return accumulator; + } + + if (Object.prototype.toString.call(accumulator) === '[object Object]' || Array.isArray(accumulator)) { + return accumulator[currentValue]; + } + + return {}; + }, node); + }); + + return node; +}; diff --git a/packages/utils/tests/unit/index.spec.ts b/packages/utils/tests/unit/index.spec.ts index 47a88fc7..791a0ce7 100644 --- a/packages/utils/tests/unit/index.spec.ts +++ b/packages/utils/tests/unit/index.spec.ts @@ -257,6 +257,26 @@ describe('isPop', () => { }); }); +describe('isPage', () => { + test('true', () => { + expect( + util.isPage({ + type: 'page', + id: 1, + }), + ).toBeTruthy(); + }); + + test('false', () => { + expect( + util.isPage({ + type: 'pop1', + id: 1, + }), + ).toBeFalsy(); + }); +}); + describe('getHost', () => { test('正常', () => { const host = util.getHost('https://film.qq.com/index.html'); @@ -280,3 +300,293 @@ describe('isSameDomain', () => { expect(flag).toBeTruthy(); }); }); + +describe('guid', () => { + test('获取id', () => { + const id = util.guid(); + const id1 = util.guid(); + expect(typeof id).toBe('string'); + expect(id === id1).toBeFalsy(); + }); +}); + +describe('getValueByKeyPath', () => { + test('key', () => { + const value = util.getValueByKeyPath('a', { + a: 1, + }); + + expect(value).toBe(1); + }); + + test('keys', () => { + const value = util.getValueByKeyPath('a.b', { + a: { + b: 1, + }, + }); + + expect(value).toBe(1); + }); + + test('error', () => { + const value = util.getValueByKeyPath('a.b.c.d', { + a: {}, + }); + + expect(value).toBeUndefined(); + + const value1 = util.getValueByKeyPath('a.b.c', { + a: {}, + }); + + expect(value1).toBeUndefined(); + }); +}); + +describe('getNodes', () => { + test('获取id', () => { + const root = [ + { + id: 1, + type: 'container', + items: [ + { + id: 11, + items: [ + { + id: 111, + }, + ], + }, + ], + }, + { + id: 2, + type: 'container', + items: [ + { + id: 22, + items: [ + { + id: 222, + }, + ], + }, + ], + }, + { + id: 3, + type: 'container', + items: { + id: 33, + items: [ + { + id: 333, + }, + ], + }, + }, + ]; + const nodes = util.getNodes([22, 111, 2], root); + expect(nodes.length).toBe(3); + }); +}); + +describe('getDepKeys', () => { + test('get keys', () => { + const keys = util.getDepKeys( + { + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }, + 61705611, + ); + expect(keys).toEqual(['text']); + }); +}); + +describe('getDepNodeIds', () => { + test('get node ids', () => { + const ids = util.getDepNodeIds({ + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }); + expect(ids).toEqual(['61705611']); + }); +}); + +describe('replaceChildNode', () => { + test('replace', () => { + const root = [ + { + id: 1, + text: '', + type: 'container', + items: [ + { + id: 11, + text: '', + items: [ + { + id: 111, + text: '', + }, + ], + }, + ], + }, + { + id: 2, + type: 'container', + text: '', + items: [ + { + id: 22, + text: '', + items: [ + { + id: 222, + text: '', + }, + ], + }, + ], + }, + ]; + expect(root[1].items[0].items[0].text).toBe(''); + util.replaceChildNode( + { + id: 222, + text: '文本', + }, + root, + ); + expect(root[1].items[0].items[0].text).toBe('文本'); + }); + + test('replace whith parent', () => { + const root = [ + { + id: 1, + text: '', + type: 'container', + items: [ + { + id: 11, + text: '', + items: [ + { + id: 111, + text: '', + }, + ], + }, + ], + }, + { + id: 2, + type: 'container', + text: '', + items: [ + { + id: 22, + text: '', + items: [ + { + id: 222, + text: '', + }, + ], + }, + ], + }, + ]; + expect(root[1].items[0].items[0].text).toBe(''); + util.replaceChildNode( + { + id: 222, + text: '文本', + }, + root, + 22, + ); + expect(root[1].items[0].items[0].text).toBe('文本'); + }); +}); + +describe('compiledNode', () => { + test('compiled', () => { + const node = util.compiledNode( + (_str: string) => '123', + { + id: 61705611, + type: 'text', + text: '456', + }, + { + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }, + ); + + expect(node.text).toBe('123'); + }); + + test('compile with source id', () => { + const node = util.compiledNode( + (_str: string) => '123', + { + id: 61705611, + type: 'text', + text: '456', + }, + { + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }, + 'ds_bebcb2d5', + ); + + expect(node.text).toBe('123'); + }); + + test('compile error', () => { + const node = util.compiledNode( + (_str: string) => { + throw new Error('error'); + }, + { + id: 61705611, + type: 'text', + text: '456', + }, + { + ds_bebcb2d5: { + 61705611: { + name: '文本', + keys: ['text'], + }, + }, + }, + ); + + expect(node.text).toBe(''); + }); +}); diff --git a/playground/package.json b/playground/package.json index 8633569a..3492f499 100644 --- a/playground/package.json +++ b/playground/package.json @@ -31,7 +31,7 @@ "@babel/preset-env": "^7.21.4", "@types/node": "^15.12.4", "@types/serialize-javascript": "^5.0.1", - "@vitejs/plugin-legacy": "^4.0.2", + "@vitejs/plugin-legacy": "^4.0.3", "@vitejs/plugin-vue": "^4.1.0", "@vitejs/plugin-vue-jsx": "^3.0.1", "@vue/compiler-sfc": "^3.2.37", @@ -40,7 +40,7 @@ "typescript": "^5.0.4", "unplugin-auto-import": "^0.12.0", "unplugin-vue-components": "^0.22.11", - "vite": "^4.2.1", + "vite": "^4.3.8", "vue-tsc": "^1.2.0" } } diff --git a/playground/src/configs/dsl.ts b/playground/src/configs/dsl.ts index 1717c963..3e057c38 100644 --- a/playground/src/configs/dsl.ts +++ b/playground/src/configs/dsl.ts @@ -208,7 +208,7 @@ export default { fontWeight: '', }, name: '按钮', - text: '打开弹窗', + text: '{{ds_b64c92b5.text}}', multiple: true, events: [ { @@ -334,4 +334,29 @@ export default { ], }, ], + dataSources: [ + { + id: 'ds_b64c92b5', + type: 'base', + title: 'button', + description: '按钮', + fields: [ + { + type: 'string', + name: 'text', + title: '按钮文案', + description: '', + defaultValue: '打开弹窗', + }, + ], + }, + ], + dataSourceDeps: { + ds_b64c92b5: { + button_430: { + name: '按钮', + keys: ['text'], + }, + }, + }, }; diff --git a/playground/vite.config.ts b/playground/vite.config.ts index 7d7213da..f88e40ce 100644 --- a/playground/vite.config.ts +++ b/playground/vite.config.ts @@ -58,6 +58,8 @@ export default defineConfig({ { find: /^@tmagic\/stage/, replacement: path.join(__dirname, '../packages/stage/src/index.ts') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../packages/utils/src/index.ts') }, { find: /^@tmagic\/design/, replacement: path.join(__dirname, '../packages/design/src/index.ts') }, + { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../packages/data-source/src/index.ts') }, + { find: /^@data-source/, replacement: path.join(__dirname, '../packages/data-source/src') }, { find: /^@tmagic\/element-plus-adapter/, replacement: path.join(__dirname, '../packages/element-plus-adapter/src/index.ts'), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 005a996a..b28ab259 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,10 +27,10 @@ importers: version: 5.57.1(eslint@8.38.0)(typescript@5.0.4) '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vitest/coverage-c8': specifier: ^0.30.0 - version: 0.30.0(vitest@0.30.0) + version: 0.30.0(vitest@0.31.1) c8: specifier: ^7.11.3 version: 7.11.3 @@ -110,14 +110,14 @@ importers: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vitepress: - specifier: 1.0.0-alpha.29 - version: 1.0.0-alpha.29(@algolia/client-search@4.9.1)(@types/node@18.15.11) + specifier: 1.0.0-beta.1 + version: 1.0.0-beta.1(@algolia/client-search@4.9.1)(@types/node@18.15.11) vitest: - specifier: ^0.30.0 - version: 0.30.0(jsdom@19.0.0) + specifier: ^0.31.1 + version: 0.31.1(jsdom@19.0.0) vue: specifier: ^3.2.37 version: 3.2.37 @@ -134,8 +134,8 @@ importers: specifier: ^3.5.3 version: 3.5.3 esbuild: - specifier: ^0.15.5 - version: 0.15.5 + specifier: ^0.17.19 + version: 0.17.19 fs-extra: specifier: ^10.1.0 version: 10.1.0 @@ -152,9 +152,15 @@ importers: packages/core: dependencies: + '@tmagic/data-source': + specifier: 1.2.15 + version: link:../data-source '@tmagic/schema': specifier: 1.2.15 version: link:../schema + '@tmagic/utils': + specifier: 1.2.15 + version: link:../utils events: specifier: ^3.3.0 version: 3.3.0 @@ -179,7 +185,38 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) + + packages/data-source: + dependencies: + '@tmagic/schema': + specifier: 1.2.15 + version: link:../schema + '@tmagic/utils': + specifier: 1.2.15 + version: link:../utils + events: + specifier: ^3.3.0 + version: 3.3.0 + devDependencies: + '@types/events': + specifier: ^3.0.0 + version: 3.0.0 + '@types/lodash-es': + specifier: ^4.17.4 + version: 4.17.4 + '@types/node': + specifier: ^15.12.4 + version: 15.12.4 + tsc-alias: + specifier: ^1.8.5 + version: 1.8.5 + typescript: + specifier: ^4.7.4 + version: 4.9.5 + vite: + specifier: ^3.1.3 + version: 3.2.5(@types/node@15.12.4) packages/design: dependencies: @@ -192,7 +229,7 @@ importers: version: 15.12.4 '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -206,11 +243,11 @@ importers: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vite-plugin-vue-setup-extend: specifier: ^0.4.0 - version: 0.4.0(vite@4.2.1) + version: 0.4.0(vite@4.3.8) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@5.0.4) @@ -238,6 +275,9 @@ importers: '@tmagic/stage': specifier: 1.2.15 version: link:../stage + '@tmagic/table': + specifier: 1.2.15 + version: link:../table '@tmagic/utils': specifier: 1.2.15 version: link:../utils @@ -283,7 +323,7 @@ importers: version: 5.0.1 '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -303,11 +343,11 @@ importers: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vite-plugin-vue-setup-extend: specifier: ^0.4.0 - version: 0.4.0(vite@4.2.1) + version: 0.4.0(vite@4.3.8) vue-tsc: specifier: ^1.0.11 version: 1.2.0(typescript@5.0.4) @@ -332,7 +372,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) packages/form: dependencies: @@ -369,7 +409,7 @@ importers: version: 1.10.7 '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -386,11 +426,11 @@ importers: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vite-plugin-vue-setup-extend: specifier: ^0.4.0 - version: 0.4.0(vite@4.2.1) + version: 0.4.0(vite@4.3.8) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@5.0.4) @@ -408,7 +448,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) packages/stage: dependencies: @@ -460,7 +500,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@15.12.4)(sass@1.35.1) packages/table: dependencies: @@ -491,7 +531,7 @@ importers: version: 15.12.4 '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -508,11 +548,11 @@ importers: specifier: ^5.0.4 version: 5.0.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vite-plugin-vue-setup-extend: specifier: ^0.4.0 - version: 0.4.0(vite@4.2.1) + version: 0.4.0(vite@4.3.8) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@5.0.4) @@ -543,7 +583,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) packages/ui: dependencies: @@ -629,8 +669,8 @@ importers: version: 2.7.4 devDependencies: vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vue-template-compiler: specifier: ^2.7.4 version: 2.7.4 @@ -655,7 +695,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) playground: dependencies: @@ -712,14 +752,14 @@ importers: specifier: ^5.0.1 version: 5.0.1 '@vitejs/plugin-legacy': - specifier: ^4.0.2 - version: 4.0.2(terser@5.14.2)(vite@4.2.1) + specifier: ^4.0.3 + version: 4.0.3(terser@5.14.2)(vite@4.3.8) '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vitejs/plugin-vue-jsx': specifier: ^3.0.1 - version: 3.0.1(vite@4.2.1)(vue@3.2.37) + version: 3.0.1(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -739,8 +779,8 @@ importers: specifier: ^0.22.11 version: 0.22.11(vue@3.2.37) vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@5.0.4) @@ -768,6 +808,9 @@ importers: axios: specifier: ^0.25.0 version: 0.25.0 + lodash-es: + specifier: ^4.17.21 + version: 4.17.21 react: specifier: ^17.0.2 version: 17.0.2 @@ -781,6 +824,9 @@ importers: '@babel/preset-env': specifier: ^7.21.4 version: 7.21.4(@babel/core@7.21.4) + '@types/lodash-es': + specifier: ^4.17.4 + version: 4.17.4 '@types/react': specifier: ^17.0.37 version: 17.0.37 @@ -788,8 +834,8 @@ importers: specifier: ^17.0.11 version: 17.0.11 '@vitejs/plugin-legacy': - specifier: ^4.0.2 - version: 4.0.2(terser@5.14.2)(vite@4.2.1) + specifier: ^4.0.3 + version: 4.0.3(terser@5.14.2)(vite@4.2.1) '@vitejs/plugin-react-refresh': specifier: ^1.3.1 version: 1.3.1 @@ -801,7 +847,7 @@ importers: version: 5.0.4 vite: specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + version: 4.2.1(@types/node@18.15.11)(terser@5.14.2) runtime/vue2: dependencies: @@ -840,11 +886,11 @@ importers: specifier: ^3.0.0 version: 3.0.0 '@vitejs/plugin-legacy': - specifier: ^4.0.2 - version: 4.0.2(terser@5.14.2)(vite@4.2.1) + specifier: ^4.0.3 + version: 4.0.3(terser@5.14.2)(vite@4.3.8) '@vitejs/plugin-vue2': specifier: ^2.2.0 - version: 2.2.0(vite@4.2.1)(vue@2.7.4) + version: 2.2.0(vite@4.3.8)(vue@2.7.4) recast: specifier: ^0.20.4 version: 0.20.4 @@ -858,8 +904,8 @@ importers: specifier: ^1.35.1 version: 1.35.1 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vue-template-compiler: specifier: ^2.7.4 version: 2.7.4 @@ -898,14 +944,14 @@ importers: specifier: ^15.12.4 version: 15.12.4 '@vitejs/plugin-legacy': - specifier: ^4.0.2 - version: 4.0.2(terser@5.14.2)(vite@4.2.1) + specifier: ^4.0.3 + version: 4.0.3(terser@5.14.2)(vite@4.3.8) '@vitejs/plugin-vue': specifier: ^4.1.0 - version: 4.1.0(vite@4.2.1)(vue@3.2.37) + version: 4.1.0(vite@4.3.8)(vue@3.2.37) '@vitejs/plugin-vue-jsx': specifier: ^3.0.1 - version: 3.0.1(vite@4.2.1)(vue@3.2.37) + version: 3.0.1(vite@4.3.8)(vue@3.2.37) '@vue/compiler-sfc': specifier: ^3.2.37 version: 3.2.37 @@ -931,33 +977,33 @@ importers: specifier: ^4.3.4 version: 4.3.4 vite: - specifier: ^4.2.1 - version: 4.2.1(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) + specifier: ^4.3.8 + version: 4.3.8(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) vue-tsc: specifier: ^1.2.0 version: 1.2.0(typescript@4.3.4) packages: - /@algolia/autocomplete-core@1.7.4: - resolution: {integrity: sha512-daoLpQ3ps/VTMRZDEBfU8ixXd+amZcNJ4QSP3IERGyzqnL5Ch8uSRFt/4G8pUvW9c3o6GA4vtVv4I4lmnkdXyg==} + /@algolia/autocomplete-core@1.8.2: + resolution: {integrity: sha512-mTeshsyFhAqw/ebqNsQpMtbnjr+qVOSKXArEj4K0d7sqc8It1XD0gkASwecm9mF/jlOQ4Z9RNg1HbdA8JPdRwQ==} dependencies: - '@algolia/autocomplete-shared': 1.7.4 + '@algolia/autocomplete-shared': 1.8.2 dev: true - /@algolia/autocomplete-preset-algolia@1.7.4(@algolia/client-search@4.9.1)(algoliasearch@4.17.0): - resolution: {integrity: sha512-s37hrvLEIfcmKY8VU9LsAXgm2yfmkdHT3DnA3SgHaY93yjZ2qL57wzb5QweVkYuEBZkT2PIREvRoLXC2sxTbpQ==} + /@algolia/autocomplete-preset-algolia@1.8.2(@algolia/client-search@4.9.1)(algoliasearch@4.17.0): + resolution: {integrity: sha512-J0oTx4me6ZM9kIKPuL3lyU3aB8DEvpVvR6xWmHVROx5rOYJGQcZsdG4ozxwcOyiiu3qxMkIbzntnV1S1VWD8yA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/autocomplete-shared': 1.7.4 + '@algolia/autocomplete-shared': 1.8.2 '@algolia/client-search': 4.9.1 algoliasearch: 4.17.0 dev: true - /@algolia/autocomplete-shared@1.7.4: - resolution: {integrity: sha512-2VGCk7I9tA9Ge73Km99+Qg87w0wzW4tgUruvWAn/gfey1ZXgmxZtyIRBebk35R1O8TbK77wujVtCnpsGpRy1kg==} + /@algolia/autocomplete-shared@1.8.2: + resolution: {integrity: sha512-b6Z/X4MczChMcfhk6kfRmBzPgjoPzuS9KGR4AFsiLulLNRAAqhP+xZTKtMnZGhLuc61I20d5WqlId02AZvcO6g==} dev: true /@algolia/cache-browser-local-storage@4.17.0: @@ -2464,13 +2510,13 @@ packages: '@types/node': 18.15.11 chalk: 4.1.2 cosmiconfig: 8.1.3 - cosmiconfig-typescript-loader: 4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.0.4) + cosmiconfig-typescript-loader: 4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@4.9.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) - typescript: 5.0.4 + ts-node: 10.9.1(@types/node@18.15.11)(typescript@4.9.5) + typescript: 4.9.5 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -2579,14 +2625,14 @@ packages: resolution: {integrity: sha512-/T0Oe7KkfUoCusFj1cJ6N+Tu+jFZXVkaKqDBcDY3P0goJfcfaT+4+oG8aHi4LDgBErNjP6uvC3IEOSMe2ka/yQ==} dev: false - /@docsearch/css@3.3.3: - resolution: {integrity: sha512-6SCwI7P8ao+se1TUsdZ7B4XzL+gqeQZnBc+2EONZlcVa0dVrk0NjETxozFKgMv0eEGH8QzP1fkN+A1rH61l4eg==} + /@docsearch/css@3.3.5: + resolution: {integrity: sha512-NaXVp3I8LdmJ54fn038KHgG7HmbIzZlKS2FkVf6mKcW5bYMJovkx4947joQyZk5yubxOZ+ddHSh79y39Aevufg==} dev: true - /@docsearch/js@3.3.3(@algolia/client-search@4.9.1): - resolution: {integrity: sha512-2xAv2GFuHzzmG0SSZgf8wHX0qZX8n9Y1ZirKUk5Wrdc+vH9CL837x2hZIUdwcPZI9caBA+/CzxsS68O4waYjUQ==} + /@docsearch/js@3.3.5(@algolia/client-search@4.9.1): + resolution: {integrity: sha512-nZi074OCryZnzva2LNcbQkwBJIND6cvuFI4s1FIe6Ygf6n9g6B/IYUULXNx05rpoCZ+KEoEt3taROpsHBliuSw==} dependencies: - '@docsearch/react': 3.3.3(@algolia/client-search@4.9.1) + '@docsearch/react': 3.3.5(@algolia/client-search@4.9.1) preact: 10.13.2 transitivePeerDependencies: - '@algolia/client-search' @@ -2595,8 +2641,8 @@ packages: - react-dom dev: true - /@docsearch/react@3.3.3(@algolia/client-search@4.9.1): - resolution: {integrity: sha512-pLa0cxnl+G0FuIDuYlW+EBK6Rw2jwLw9B1RHIeS4N4s2VhsfJ/wzeCi3CWcs5yVfxLd5ZK50t//TMA5e79YT7Q==} + /@docsearch/react@3.3.5(@algolia/client-search@4.9.1): + resolution: {integrity: sha512-Zuxf4z5PZ9eIQkVCNu76v1H+KAztKItNn3rLzZa7kpBS+++TgNARITnZeUS7C1DKoAhJZFr6T/H+Lvc6h/iiYg==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' @@ -2609,9 +2655,9 @@ packages: react-dom: optional: true dependencies: - '@algolia/autocomplete-core': 1.7.4 - '@algolia/autocomplete-preset-algolia': 1.7.4(@algolia/client-search@4.9.1)(algoliasearch@4.17.0) - '@docsearch/css': 3.3.3 + '@algolia/autocomplete-core': 1.8.2 + '@algolia/autocomplete-preset-algolia': 1.8.2(@algolia/client-search@4.9.1)(algoliasearch@4.17.0) + '@docsearch/css': 3.3.5 algoliasearch: 4.17.0 transitivePeerDependencies: - '@algolia/client-search' @@ -2642,13 +2688,12 @@ packages: dependencies: vue: 3.2.37 - /@esbuild/android-arm64@0.17.15: - resolution: {integrity: sha512-0kOB6Y7Br3KDVgHeg8PRcvfLkq+AccreK///B4Z6fNZGr/tNHX0z2VywCc7PTeWp+bPvjA5WMvNXltHw5QjAIA==} + /@esbuild/android-arm64@0.17.19: + resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} engines: {node: '>=12'} cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm@0.15.18: @@ -2660,85 +2705,76 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.15: - resolution: {integrity: sha512-sRSOVlLawAktpMvDyJIkdLI/c/kdRTOqo8t6ImVxg8yT7LQDUYV5Rp2FKeEosLr6ZCja9UjYAzyRSxGteSJPYg==} + /@esbuild/android-arm@0.17.19: + resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true - /@esbuild/android-x64@0.17.15: - resolution: {integrity: sha512-MzDqnNajQZ63YkaUWVl9uuhcWyEyh69HGpMIrf+acR4otMkfLJ4sUCxqwbCyPGicE9dVlrysI3lMcDBjGiBBcQ==} + /@esbuild/android-x64@0.17.19: + resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} engines: {node: '>=12'} cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true - /@esbuild/darwin-arm64@0.17.15: - resolution: {integrity: sha512-7siLjBc88Z4+6qkMDxPT2juf2e8SJxmsbNVKFY2ifWCDT72v5YJz9arlvBw5oB4W/e61H1+HDB/jnu8nNg0rLA==} + /@esbuild/darwin-arm64@0.17.19: + resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true - /@esbuild/darwin-x64@0.17.15: - resolution: {integrity: sha512-NbImBas2rXwYI52BOKTW342Tm3LTeVlaOQ4QPZ7XuWNKiO226DisFk/RyPk3T0CKZkKMuU69yOvlapJEmax7cg==} + /@esbuild/darwin-x64@0.17.19: + resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true - /@esbuild/freebsd-arm64@0.17.15: - resolution: {integrity: sha512-Xk9xMDjBVG6CfgoqlVczHAdJnCs0/oeFOspFap5NkYAmRCT2qTn1vJWA2f419iMtsHSLm+O8B6SLV/HlY5cYKg==} + /@esbuild/freebsd-arm64@0.17.19: + resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true - /@esbuild/freebsd-x64@0.17.15: - resolution: {integrity: sha512-3TWAnnEOdclvb2pnfsTWtdwthPfOz7qAfcwDLcfZyGJwm1SRZIMOeB5FODVhnM93mFSPsHB9b/PmxNNbSnd0RQ==} + /@esbuild/freebsd-x64@0.17.19: + resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true - /@esbuild/linux-arm64@0.17.15: - resolution: {integrity: sha512-T0MVnYw9KT6b83/SqyznTs/3Jg2ODWrZfNccg11XjDehIved2oQfrX/wVuev9N936BpMRaTR9I1J0tdGgUgpJA==} + /@esbuild/linux-arm64@0.17.19: + resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} engines: {node: '>=12'} cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-arm@0.17.15: - resolution: {integrity: sha512-MLTgiXWEMAMr8nmS9Gigx43zPRmEfeBfGCwxFQEMgJ5MC53QKajaclW6XDPjwJvhbebv+RzK05TQjvH3/aM4Xw==} + /@esbuild/linux-arm@0.17.19: + resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} engines: {node: '>=12'} cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-ia32@0.17.15: - resolution: {integrity: sha512-wp02sHs015T23zsQtU4Cj57WiteiuASHlD7rXjKUyAGYzlOKDAjqK6bk5dMi2QEl/KVOcsjwL36kD+WW7vJt8Q==} + /@esbuild/linux-ia32@0.17.19: + resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-loong64@0.15.18: @@ -2750,121 +2786,100 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.15.5: - resolution: {integrity: sha512-UHkDFCfSGTuXq08oQltXxSZmH1TXyWsL+4QhZDWvvLl6mEJQqk3u7/wq1LjhrrAXYIllaTtRSzUXl4Olkf2J8A==} + /@esbuild/linux-loong64@0.17.19: + resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] requiresBuild: true - dev: false optional: true - /@esbuild/linux-loong64@0.17.15: - resolution: {integrity: sha512-k7FsUJjGGSxwnBmMh8d7IbObWu+sF/qbwc+xKZkBe/lTAF16RqxRCnNHA7QTd3oS2AfGBAnHlXL67shV5bBThQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-mips64el@0.17.15: - resolution: {integrity: sha512-ZLWk6czDdog+Q9kE/Jfbilu24vEe/iW/Sj2d8EVsmiixQ1rM2RKH2n36qfxK4e8tVcaXkvuV3mU5zTZviE+NVQ==} + /@esbuild/linux-mips64el@0.17.19: + resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-ppc64@0.17.15: - resolution: {integrity: sha512-mY6dPkIRAiFHRsGfOYZC8Q9rmr8vOBZBme0/j15zFUKM99d4ILY4WpOC7i/LqoY+RE7KaMaSfvY8CqjJtuO4xg==} + /@esbuild/linux-ppc64@0.17.19: + resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-riscv64@0.17.15: - resolution: {integrity: sha512-EcyUtxffdDtWjjwIH8sKzpDRLcVtqANooMNASO59y+xmqqRYBBM7xVLQhqF7nksIbm2yHABptoioS9RAbVMWVA==} + /@esbuild/linux-riscv64@0.17.19: + resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-s390x@0.17.15: - resolution: {integrity: sha512-BuS6Jx/ezxFuHxgsfvz7T4g4YlVrmCmg7UAwboeyNNg0OzNzKsIZXpr3Sb/ZREDXWgt48RO4UQRDBxJN3B9Rbg==} + /@esbuild/linux-s390x@0.17.19: + resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} engines: {node: '>=12'} cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/linux-x64@0.17.15: - resolution: {integrity: sha512-JsdS0EgEViwuKsw5tiJQo9UdQdUJYuB+Mf6HxtJSPN35vez1hlrNb1KajvKWF5Sa35j17+rW1ECEO9iNrIXbNg==} + /@esbuild/linux-x64@0.17.19: + resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} engines: {node: '>=12'} cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true - /@esbuild/netbsd-x64@0.17.15: - resolution: {integrity: sha512-R6fKjtUysYGym6uXf6qyNephVUQAGtf3n2RCsOST/neIwPqRWcnc3ogcielOd6pT+J0RDR1RGcy0ZY7d3uHVLA==} + /@esbuild/netbsd-x64@0.17.19: + resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true - /@esbuild/openbsd-x64@0.17.15: - resolution: {integrity: sha512-mVD4PGc26b8PI60QaPUltYKeSX0wxuy0AltC+WCTFwvKCq2+OgLP4+fFd+hZXzO2xW1HPKcytZBdjqL6FQFa7w==} + /@esbuild/openbsd-x64@0.17.19: + resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true - /@esbuild/sunos-x64@0.17.15: - resolution: {integrity: sha512-U6tYPovOkw3459t2CBwGcFYfFRjivcJJc1WC8Q3funIwX8x4fP+R6xL/QuTPNGOblbq/EUDxj9GU+dWKX0oWlQ==} + /@esbuild/sunos-x64@0.17.19: + resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true - /@esbuild/win32-arm64@0.17.15: - resolution: {integrity: sha512-W+Z5F++wgKAleDABemiyXVnzXgvRFs+GVKThSI+mGgleLWluv0D7Diz4oQpgdpNzh4i2nNDzQtWbjJiqutRp6Q==} + /@esbuild/win32-arm64@0.17.19: + resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} engines: {node: '>=12'} cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true - /@esbuild/win32-ia32@0.17.15: - resolution: {integrity: sha512-Muz/+uGgheShKGqSVS1KsHtCyEzcdOn/W/Xbh6H91Etm+wiIfwZaBn1W58MeGtfI8WA961YMHFYTthBdQs4t+w==} + /@esbuild/win32-ia32@0.17.19: + resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true - /@esbuild/win32-x64@0.17.15: - resolution: {integrity: sha512-DjDa9ywLUUmjhV2Y9wUTIF+1XsmuFGvZoCmOWkli1XcNAh5t25cc7fgsCx4Zi/Uurep3TTLyDiKATgGEg61pkA==} + /@esbuild/win32-x64@0.17.19: + resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} engines: {node: '>=12'} cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.38.0): @@ -3109,7 +3124,7 @@ packages: '@babel/runtime': 7.21.0 '@types/aria-query': 4.2.2 aria-query: 4.2.2 - chalk: 4.1.0 + chalk: 4.1.2 dom-accessibility-api: 0.5.16 lz-string: 1.5.0 pretty-format: 26.6.2 @@ -3157,11 +3172,11 @@ packages: /@types/chai-subset@1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: - '@types/chai': 4.3.4 + '@types/chai': 4.3.5 dev: true - /@types/chai@4.3.4: - resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==} + /@types/chai@4.3.5: + resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} dev: true /@types/color-convert@2.0.0: @@ -3306,6 +3321,10 @@ packages: /@types/web-bluetooth@0.0.16: resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + /@types/web-bluetooth@0.0.17: + resolution: {integrity: sha512-4p9vcSmxAayx72yn70joFoL44c9MO/0+iVEBIQXe3v2h2SiAsEIo/G5v6ObFWvNKRFjbrVadNf9LqEEZeQPzdA==} + dev: true + /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true @@ -3446,8 +3465,8 @@ packages: eslint-visitor-keys: 3.4.0 dev: true - /@vitejs/plugin-legacy@4.0.2(terser@5.14.2)(vite@4.2.1): - resolution: {integrity: sha512-ivnt9sCkgwJTYTWLjuvY6H/HTuiQC1EgzAPkiAvi0yNAssiqOJjyjhG3hAK5LFUUorE0w9kGxn8K0f/74DlbxQ==} + /@vitejs/plugin-legacy@4.0.3(terser@5.14.2)(vite@4.2.1): + resolution: {integrity: sha512-RqDQOSEmFSNL42vITkNp8HE8Ak1yjGgaav4B6BGcZ8/URK0wikzwSyhNRirHDkp+snflEEk7iPZXTXUYA9exbg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: terser: ^5.4.0 @@ -3461,7 +3480,27 @@ packages: regenerator-runtime: 0.13.11 systemjs: 6.14.1 terser: 5.14.2 - vite: 4.2.1(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) + vite: 4.2.1(@types/node@18.15.11)(terser@5.14.2) + transitivePeerDependencies: + - supports-color + dev: true + + /@vitejs/plugin-legacy@4.0.3(terser@5.14.2)(vite@4.3.8): + resolution: {integrity: sha512-RqDQOSEmFSNL42vITkNp8HE8Ak1yjGgaav4B6BGcZ8/URK0wikzwSyhNRirHDkp+snflEEk7iPZXTXUYA9exbg==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + terser: ^5.4.0 + vite: ^4.0.0 + dependencies: + '@babel/core': 7.21.4 + '@babel/preset-env': 7.21.4(@babel/core@7.21.4) + browserslist: 4.21.5 + core-js: 3.30.0 + magic-string: 0.30.0 + regenerator-runtime: 0.13.11 + systemjs: 6.14.1 + terser: 5.14.2 + vite: 4.3.8(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) transitivePeerDependencies: - supports-color dev: true @@ -3479,7 +3518,7 @@ packages: - supports-color dev: true - /@vitejs/plugin-vue-jsx@3.0.1(vite@4.2.1)(vue@3.2.37): + /@vitejs/plugin-vue-jsx@3.0.1(vite@4.3.8)(vue@3.2.37): resolution: {integrity: sha512-+Jb7ggL48FSPS1uhPnJbJwWa9Sr90vQ+d0InW+AhBM22n+cfuYqJZDckBc+W3QSHe1WDvewMZfa4wZOtk5pRgw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3489,34 +3528,23 @@ packages: '@babel/core': 7.21.4 '@babel/plugin-transform-typescript': 7.21.3(@babel/core@7.21.4) '@vue/babel-plugin-jsx': 1.1.1(@babel/core@7.21.4) - vite: 4.2.1(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) + vite: 4.3.8(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2) vue: 3.2.37 transitivePeerDependencies: - supports-color dev: true - /@vitejs/plugin-vue2@2.2.0(vite@4.2.1)(vue@2.7.4): + /@vitejs/plugin-vue2@2.2.0(vite@4.3.8)(vue@2.7.4): resolution: {integrity: sha512-1km7zEuZ/9QRPvzXSjikbTYGQPG86Mq1baktpC4sXqsXlb02HQKfi+fl8qVS703JM7cgm24Ga9j+RwKmvFn90A==} engines: {node: ^14.18.0 || >= 16.0.0} peerDependencies: vite: ^3.0.0 || ^4.0.0 vue: ^2.7.0-0 dependencies: - vite: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) vue: 2.7.4 dev: true - /@vitejs/plugin-vue@3.2.0(vite@3.2.5)(vue@3.2.47): - resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} - engines: {node: ^14.18.0 || >=16.0.0} - peerDependencies: - vite: ^3.0.0 - vue: ^3.2.25 - dependencies: - vite: 3.2.5(@types/node@18.15.11) - vue: 3.2.47 - dev: true - /@vitejs/plugin-vue@4.1.0(vite@4.2.1)(vue@3.2.37): resolution: {integrity: sha512-++9JOAFdcXI3lyer9UKUV4rfoQ3T1RN8yDqoCLar86s0xQct5yblxAE+yWgRnU5/0FOlVCpTZpYSBV/bGWrSrQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -3524,11 +3552,33 @@ packages: vite: ^4.0.0 vue: ^3.2.25 dependencies: - vite: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vite: 4.2.1(@types/node@18.15.11)(terser@5.14.2) vue: 3.2.37 dev: true - /@vitest/coverage-c8@0.30.0(vitest@0.30.0): + /@vitejs/plugin-vue@4.1.0(vite@4.3.8)(vue@3.2.37): + resolution: {integrity: sha512-++9JOAFdcXI3lyer9UKUV4rfoQ3T1RN8yDqoCLar86s0xQct5yblxAE+yWgRnU5/0FOlVCpTZpYSBV/bGWrSrQ==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.0.0 + vue: ^3.2.25 + dependencies: + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vue: 3.2.37 + dev: true + + /@vitejs/plugin-vue@4.2.3(vite@4.3.8)(vue@3.3.4): + resolution: {integrity: sha512-R6JDUfiZbJA9cMiguQ7jxALsgiprjBeHL5ikpXfJCH62pPHtI+JdJ5xWj6Ev73yXSlYl86+blXn1kZHQ7uElxw==} + engines: {node: ^14.18.0 || >=16.0.0} + peerDependencies: + vite: ^4.0.0 + vue: ^3.2.25 + dependencies: + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vue: 3.3.4 + dev: true + + /@vitest/coverage-c8@0.30.0(vitest@0.31.1): resolution: {integrity: sha512-NC0GgT4hUyPYUJHE9Sx9gU41pbYWBFI+3nUuZ/ZiQU8WQy27xQJSYGkDmB6wFeAyS5IxUXqhCRsBOK9fEvgmtA==} peerDependencies: vitest: '>=0.30.0 <1' @@ -3536,42 +3586,42 @@ packages: c8: 7.13.0 picocolors: 1.0.0 std-env: 3.3.2 - vitest: 0.30.0(jsdom@19.0.0) + vitest: 0.31.1(jsdom@19.0.0) dev: true - /@vitest/expect@0.30.0: - resolution: {integrity: sha512-b/jLWBqi6WQHfezWm8VjgXdIyfejAurtxqdyCdDqoToCim5W/nDxKjFAADitEHPz80oz+IP+c+wmkGKBucSpiw==} + /@vitest/expect@0.31.1: + resolution: {integrity: sha512-BV1LyNvhnX+eNYzJxlHIGPWZpwJFZaCcOIzp2CNG0P+bbetenTupk6EO0LANm4QFt0TTit+yqx7Rxd1qxi/SQA==} dependencies: - '@vitest/spy': 0.30.0 - '@vitest/utils': 0.30.0 + '@vitest/spy': 0.31.1 + '@vitest/utils': 0.31.1 chai: 4.3.7 dev: true - /@vitest/runner@0.30.0: - resolution: {integrity: sha512-Xh4xkdRcymdeRNrSwjhgarCTSgnQu2J59wsFI6i4UhKrL5whzo5+vWyq7iWK1ht3fppPeNAtvkbqUDf+OJSCbQ==} + /@vitest/runner@0.31.1: + resolution: {integrity: sha512-imWuc82ngOtxdCUpXwtEzZIuc1KMr+VlQ3Ondph45VhWoQWit5yvG/fFcldbnCi8DUuFi+NmNx5ehMUw/cGLUw==} dependencies: - '@vitest/utils': 0.30.0 + '@vitest/utils': 0.31.1 concordance: 5.0.4 p-limit: 4.0.0 pathe: 1.1.0 dev: true - /@vitest/snapshot@0.30.0: - resolution: {integrity: sha512-e4eSGCy36Bw3/Tkir9qYJDlFsUz3NALFPNJSxzlY8CFl901TV9iZdKgpqXpyG1sAhLO0tPHThBAMHRi8hRA8cg==} + /@vitest/snapshot@0.31.1: + resolution: {integrity: sha512-L3w5uU9bMe6asrNzJ8WZzN+jUTX4KSgCinEJPXyny0o90fG4FPQMV0OWsq7vrCWfQlAilMjDnOF9nP8lidsJ+g==} dependencies: magic-string: 0.30.0 pathe: 1.1.0 pretty-format: 27.5.1 dev: true - /@vitest/spy@0.30.0: - resolution: {integrity: sha512-olTWyG5gVWdfhCrdgxWQb2K3JYtj1/ZwInFFOb4GZ2HFI91PUWHWHhLRPORxwRwVvoXD1MS1162vPJZuHlKJkg==} + /@vitest/spy@0.31.1: + resolution: {integrity: sha512-1cTpt2m9mdo3hRLDyCG2hDQvRrePTDgEJBFQQNz1ydHHZy03EiA6EpFxY+7ODaY7vMRCie+WlFZBZ0/dQWyssQ==} dependencies: tinyspy: 2.1.0 dev: true - /@vitest/utils@0.30.0: - resolution: {integrity: sha512-qFZgoOKQ+rJV9xG4BBxgOSilnLQ2gkfG4I+z1wBuuQ3AD33zQrnB88kMFfzsot1E1AbF3dNK1e4CU7q3ojahRA==} + /@vitest/utils@0.31.1: + resolution: {integrity: sha512-yFyRD5ilwojsZfo3E0BnH72pSVSuLg2356cN1tCEe/0RtDzxTPYwOomIC+eQbot7m6DRy4tPZw+09mB7NkbMmA==} dependencies: concordance: 5.0.4 loupe: 2.3.6 @@ -3655,6 +3705,15 @@ packages: source-map: 0.6.1 dev: true + /@vue/compiler-core@3.3.4: + resolution: {integrity: sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==} + dependencies: + '@babel/parser': 7.21.4 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + source-map-js: 1.0.2 + dev: true + /@vue/compiler-dom@3.2.37: resolution: {integrity: sha512-yxJLH167fucHKxaqXpYk7x8z7mMEnXOw3G2q62FTkmsvNxu4FQSu5+3UMb+L7fjKa26DEzhrmCxAgFLLIzVfqQ==} dependencies: @@ -3668,11 +3727,18 @@ packages: '@vue/shared': 3.2.47 dev: true + /@vue/compiler-dom@3.3.4: + resolution: {integrity: sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==} + dependencies: + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 + dev: true + /@vue/compiler-sfc@2.7.4: resolution: {integrity: sha512-WCaF33mlKLSvHDKvOD6FzTa5CI2FlMTeJf3MxJsNP0KDgRoI6RdXhHo9dtvCqV4Sywf9Owm17wTLT1Ymu/WsOQ==} dependencies: '@babel/parser': 7.21.4 - postcss: 8.4.21 + postcss: 8.4.23 source-map: 0.6.1 /@vue/compiler-sfc@3.2.37: @@ -3700,10 +3766,25 @@ packages: '@vue/shared': 3.2.47 estree-walker: 2.0.2 magic-string: 0.25.9 - postcss: 8.4.21 + postcss: 8.4.23 source-map: 0.6.1 dev: true + /@vue/compiler-sfc@3.3.4: + resolution: {integrity: sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==} + dependencies: + '@babel/parser': 7.21.4 + '@vue/compiler-core': 3.3.4 + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-ssr': 3.3.4 + '@vue/reactivity-transform': 3.3.4 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + magic-string: 0.30.0 + postcss: 8.4.23 + source-map-js: 1.0.2 + dev: true + /@vue/compiler-ssr@3.2.37: resolution: {integrity: sha512-7mQJD7HdXxQjktmsWp/J67lThEIcxLemz1Vb5I6rYJHR5vI+lON3nPGOH3ubmbvYGt8xEUaAr1j7/tIFWiEOqw==} dependencies: @@ -3717,6 +3798,13 @@ packages: '@vue/shared': 3.2.47 dev: true + /@vue/compiler-ssr@3.3.4: + resolution: {integrity: sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==} + dependencies: + '@vue/compiler-dom': 3.3.4 + '@vue/shared': 3.3.4 + dev: true + /@vue/devtools-api@6.5.0: resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} @@ -3739,6 +3827,16 @@ packages: magic-string: 0.25.9 dev: true + /@vue/reactivity-transform@3.3.4: + resolution: {integrity: sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==} + dependencies: + '@babel/parser': 7.21.4 + '@vue/compiler-core': 3.3.4 + '@vue/shared': 3.3.4 + estree-walker: 2.0.2 + magic-string: 0.30.0 + dev: true + /@vue/reactivity@3.2.37: resolution: {integrity: sha512-/7WRafBOshOc6m3F7plwzPeCu/RCVv9uMpOwa/5PiY1Zz+WLVRWiy0MYKwmg19KBdGtFWsmZ4cD+LOdVPcs52A==} dependencies: @@ -3750,17 +3848,23 @@ packages: '@vue/shared': 3.2.47 dev: true + /@vue/reactivity@3.3.4: + resolution: {integrity: sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==} + dependencies: + '@vue/shared': 3.3.4 + dev: true + /@vue/runtime-core@3.2.37: resolution: {integrity: sha512-JPcd9kFyEdXLl/i0ClS7lwgcs0QpUAWj+SKX2ZC3ANKi1U4DOtiEr6cRqFXsPwY5u1L9fAjkinIdB8Rz3FoYNQ==} dependencies: '@vue/reactivity': 3.2.37 '@vue/shared': 3.2.37 - /@vue/runtime-core@3.2.47: - resolution: {integrity: sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==} + /@vue/runtime-core@3.3.4: + resolution: {integrity: sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==} dependencies: - '@vue/reactivity': 3.2.47 - '@vue/shared': 3.2.47 + '@vue/reactivity': 3.3.4 + '@vue/shared': 3.3.4 dev: true /@vue/runtime-dom@3.2.37: @@ -3770,12 +3874,12 @@ packages: '@vue/shared': 3.2.37 csstype: 2.6.21 - /@vue/runtime-dom@3.2.47: - resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==} + /@vue/runtime-dom@3.3.4: + resolution: {integrity: sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==} dependencies: - '@vue/runtime-core': 3.2.47 - '@vue/shared': 3.2.47 - csstype: 2.6.21 + '@vue/runtime-core': 3.3.4 + '@vue/shared': 3.3.4 + csstype: 3.1.2 dev: true /@vue/server-renderer@3.2.37(vue@3.2.37): @@ -3787,14 +3891,14 @@ packages: '@vue/shared': 3.2.37 vue: 3.2.37 - /@vue/server-renderer@3.2.47(vue@3.2.47): - resolution: {integrity: sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==} + /@vue/server-renderer@3.3.4(vue@3.3.4): + resolution: {integrity: sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==} peerDependencies: - vue: 3.2.47 + vue: 3.3.4 dependencies: - '@vue/compiler-ssr': 3.2.47 - '@vue/shared': 3.2.47 - vue: 3.2.47 + '@vue/compiler-ssr': 3.3.4 + '@vue/shared': 3.3.4 + vue: 3.3.4 dev: true /@vue/shared@3.2.37: @@ -3804,6 +3908,10 @@ packages: resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} dev: true + /@vue/shared@3.3.4: + resolution: {integrity: sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==} + dev: true + /@vue/test-utils@2.0.0(vue@3.2.37): resolution: {integrity: sha512-zL5kygNq7hONrO1CzaUGprEAklAX+pH8J1MPMCU3Rd2xtSYkZ+PmKU3oEDRg8VAGdL5lNJHzDgrud5amFPtirw==} peerDependencies: @@ -3812,6 +3920,18 @@ packages: vue: 3.2.37 dev: true + /@vueuse/core@10.1.2(vue@3.3.4): + resolution: {integrity: sha512-roNn8WuerI56A5uiTyF/TEYX0Y+VKlhZAF94unUfdhbDUI+NfwQMn4FUnUscIRUhv3344qvAghopU4bzLPNFlA==} + dependencies: + '@types/web-bluetooth': 0.0.17 + '@vueuse/metadata': 10.1.2 + '@vueuse/shared': 10.1.2(vue@3.3.4) + vue-demi: 0.14.5(vue@3.3.4) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + dev: true + /@vueuse/core@9.13.0(vue@3.2.37): resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} dependencies: @@ -3823,38 +3943,80 @@ packages: - '@vue/composition-api' - vue - /@vueuse/core@9.13.0(vue@3.2.47): - resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} + /@vueuse/integrations@10.1.2(focus-trap@7.4.3)(vue@3.3.4): + resolution: {integrity: sha512-wUpG3Wv6LiWerOwCzOAM0iGhNQ4vfFUTkhj/xQy7TLXduh2M3D8N08aS0KqlxsejY6R8NLxydDIM+68QfHZZ8Q==} + peerDependencies: + async-validator: '*' + axios: '*' + change-case: '*' + drauu: '*' + focus-trap: '*' + fuse.js: '*' + idb-keyval: '*' + jwt-decode: '*' + nprogress: '*' + qrcode: '*' + sortablejs: '*' + universal-cookie: '*' + peerDependenciesMeta: + async-validator: + optional: true + axios: + optional: true + change-case: + optional: true + drauu: + optional: true + focus-trap: + optional: true + fuse.js: + optional: true + idb-keyval: + optional: true + jwt-decode: + optional: true + nprogress: + optional: true + qrcode: + optional: true + sortablejs: + optional: true + universal-cookie: + optional: true dependencies: - '@types/web-bluetooth': 0.0.16 - '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(vue@3.2.47) - vue-demi: 0.13.11(vue@3.2.47) + '@vueuse/core': 10.1.2(vue@3.3.4) + '@vueuse/shared': 10.1.2(vue@3.3.4) + focus-trap: 7.4.3 + vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true + /@vueuse/metadata@10.1.2: + resolution: {integrity: sha512-3mc5BqN9aU2SqBeBuWE7ne4OtXHoHKggNgxZR2K+zIW4YLsy6xoZ4/9vErQs6tvoKDX6QAqm3lvsrv0mczAwIQ==} + dev: true + /@vueuse/metadata@9.13.0: resolution: {integrity: sha512-gdU7TKNAUVlXXLbaF+ZCfte8BjRJQWPCa2J55+7/h+yDtzw3vOoGQDRXzI6pyKyo6bXFT5/QoPE4hAknExjRLQ==} - /@vueuse/shared@9.13.0(vue@3.2.37): - resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} + /@vueuse/shared@10.1.2(vue@3.3.4): + resolution: {integrity: sha512-1uoUTPBlgyscK9v6ScGeVYDDzlPSFXBlxuK7SfrDGyUTBiznb3mNceqhwvZHjtDRELZEN79V5uWPTF1VDV8svA==} dependencies: - vue-demi: 0.13.11(vue@3.2.37) - transitivePeerDependencies: - - '@vue/composition-api' - - vue - - /@vueuse/shared@9.13.0(vue@3.2.47): - resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} - dependencies: - vue-demi: 0.13.11(vue@3.2.47) + vue-demi: 0.14.5(vue@3.3.4) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true + /@vueuse/shared@9.13.0(vue@3.2.37): + resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} + dependencies: + vue-demi: 0.14.5(vue@3.2.37) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -3993,6 +4155,10 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + /ansi-sequence-parser@1.1.0: + resolution: {integrity: sha512-lEm8mt52to2fT8GhciPCGeCXACSz2UwIN4X2e2LJSnZ5uAbn2/dsYdOmUXq0AtWS5cpAupysIneExOgH0Vd2TQ==} + dev: true + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -4737,7 +4903,7 @@ packages: - '@swc/wasm' dev: true - /cosmiconfig-typescript-loader@4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@5.0.4): + /cosmiconfig-typescript-loader@4.3.0(@types/node@18.15.11)(cosmiconfig@8.1.3)(ts-node@10.9.1)(typescript@4.9.5): resolution: {integrity: sha512-NTxV1MFfZDLPiBMjxbHRwSh5LaLcPMwNdCutmnHJCKoVnlvldPWlllonKwrsRJ5pYZBIBGRWWU2tfvzxgeSW5Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -4748,8 +4914,8 @@ packages: dependencies: '@types/node': 18.15.11 cosmiconfig: 8.1.3 - ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) - typescript: 5.0.4 + ts-node: 10.9.1(@types/node@18.15.11)(typescript@4.9.5) + typescript: 4.9.5 dev: true optional: true @@ -5151,15 +5317,6 @@ packages: dev: true optional: true - /esbuild-android-64@0.15.5: - resolution: {integrity: sha512-dYPPkiGNskvZqmIK29OPxolyY3tp+c47+Fsc2WYSOVjEPWNCHNyqhtFqQadcXMJDQt8eN0NMDukbyQgFcHquXg==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: false - optional: true - /esbuild-android-arm64@0.15.18: resolution: {integrity: sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ==} engines: {node: '>=12'} @@ -5169,15 +5326,6 @@ packages: dev: true optional: true - /esbuild-android-arm64@0.15.5: - resolution: {integrity: sha512-YyEkaQl08ze3cBzI/4Cm1S+rVh8HMOpCdq8B78JLbNFHhzi4NixVN93xDrHZLztlocEYqi45rHHCgA8kZFidFg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: false - optional: true - /esbuild-darwin-64@0.15.18: resolution: {integrity: sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg==} engines: {node: '>=12'} @@ -5187,15 +5335,6 @@ packages: dev: true optional: true - /esbuild-darwin-64@0.15.5: - resolution: {integrity: sha512-Cr0iIqnWKx3ZTvDUAzG0H/u9dWjLE4c2gTtRLz4pqOBGjfjqdcZSfAObFzKTInLLSmD0ZV1I/mshhPoYSBMMCQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - /esbuild-darwin-arm64@0.15.18: resolution: {integrity: sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA==} engines: {node: '>=12'} @@ -5205,15 +5344,6 @@ packages: dev: true optional: true - /esbuild-darwin-arm64@0.15.5: - resolution: {integrity: sha512-WIfQkocGtFrz7vCu44ypY5YmiFXpsxvz2xqwe688jFfSVCnUsCn2qkEVDo7gT8EpsLOz1J/OmqjExePL1dr1Kg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - /esbuild-freebsd-64@0.15.18: resolution: {integrity: sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA==} engines: {node: '>=12'} @@ -5223,15 +5353,6 @@ packages: dev: true optional: true - /esbuild-freebsd-64@0.15.5: - resolution: {integrity: sha512-M5/EfzV2RsMd/wqwR18CELcenZ8+fFxQAAEO7TJKDmP3knhWSbD72ILzrXFMMwshlPAS1ShCZ90jsxkm+8FlaA==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: false - optional: true - /esbuild-freebsd-arm64@0.15.18: resolution: {integrity: sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA==} engines: {node: '>=12'} @@ -5241,15 +5362,6 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64@0.15.5: - resolution: {integrity: sha512-2JQQ5Qs9J0440F/n/aUBNvY6lTo4XP/4lt1TwDfHuo0DY3w5++anw+jTjfouLzbJmFFiwmX7SmUhMnysocx96w==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-32@0.15.18: resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==} engines: {node: '>=12'} @@ -5259,15 +5371,6 @@ packages: dev: true optional: true - /esbuild-linux-32@0.15.5: - resolution: {integrity: sha512-gO9vNnIN0FTUGjvTFucIXtBSr1Woymmx/aHQtuU+2OllGU6YFLs99960UD4Dib1kFovVgs59MTXwpFdVoSMZoQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-64@0.15.18: resolution: {integrity: sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw==} engines: {node: '>=12'} @@ -5277,15 +5380,6 @@ packages: dev: true optional: true - /esbuild-linux-64@0.15.5: - resolution: {integrity: sha512-ne0GFdNLsm4veXbTnYAWjbx3shpNKZJUd6XpNbKNUZaNllDZfYQt0/zRqOg0sc7O8GQ+PjSMv9IpIEULXVTVmg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-arm64@0.15.18: resolution: {integrity: sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug==} engines: {node: '>=12'} @@ -5295,15 +5389,6 @@ packages: dev: true optional: true - /esbuild-linux-arm64@0.15.5: - resolution: {integrity: sha512-7EgFyP2zjO065XTfdCxiXVEk+f83RQ1JsryN1X/VSX2li9rnHAt2swRbpoz5Vlrl6qjHrCmq5b6yxD13z6RheA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-arm@0.15.18: resolution: {integrity: sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA==} engines: {node: '>=12'} @@ -5313,15 +5398,6 @@ packages: dev: true optional: true - /esbuild-linux-arm@0.15.5: - resolution: {integrity: sha512-wvAoHEN+gJ/22gnvhZnS/+2H14HyAxM07m59RSLn3iXrQsdS518jnEWRBnJz3fR6BJa+VUTo0NxYjGaNt7RA7Q==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-mips64le@0.15.18: resolution: {integrity: sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ==} engines: {node: '>=12'} @@ -5331,15 +5407,6 @@ packages: dev: true optional: true - /esbuild-linux-mips64le@0.15.5: - resolution: {integrity: sha512-KdnSkHxWrJ6Y40ABu+ipTZeRhFtc8dowGyFsZY5prsmMSr1ZTG9zQawguN4/tunJ0wy3+kD54GaGwdcpwWAvZQ==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-ppc64le@0.15.18: resolution: {integrity: sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w==} engines: {node: '>=12'} @@ -5349,15 +5416,6 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le@0.15.5: - resolution: {integrity: sha512-QdRHGeZ2ykl5P0KRmfGBZIHmqcwIsUKWmmpZTOq573jRWwmpfRmS7xOhmDHBj9pxv+6qRMH8tLr2fe+ZKQvCYw==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-riscv64@0.15.18: resolution: {integrity: sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg==} engines: {node: '>=12'} @@ -5367,15 +5425,6 @@ packages: dev: true optional: true - /esbuild-linux-riscv64@0.15.5: - resolution: {integrity: sha512-p+WE6RX+jNILsf+exR29DwgV6B73khEQV0qWUbzxaycxawZ8NE0wA6HnnTxbiw5f4Gx9sJDUBemh9v49lKOORA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-linux-s390x@0.15.18: resolution: {integrity: sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ==} engines: {node: '>=12'} @@ -5385,15 +5434,6 @@ packages: dev: true optional: true - /esbuild-linux-s390x@0.15.5: - resolution: {integrity: sha512-J2ngOB4cNzmqLHh6TYMM/ips8aoZIuzxJnDdWutBw5482jGXiOzsPoEF4j2WJ2mGnm7FBCO4StGcwzOgic70JQ==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: false - optional: true - /esbuild-netbsd-64@0.15.18: resolution: {integrity: sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg==} engines: {node: '>=12'} @@ -5403,15 +5443,6 @@ packages: dev: true optional: true - /esbuild-netbsd-64@0.15.5: - resolution: {integrity: sha512-MmKUYGDizYjFia0Rwt8oOgmiFH7zaYlsoQ3tIOfPxOqLssAsEgG0MUdRDm5lliqjiuoog8LyDu9srQk5YwWF3w==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: false - optional: true - /esbuild-openbsd-64@0.15.18: resolution: {integrity: sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ==} engines: {node: '>=12'} @@ -5421,15 +5452,6 @@ packages: dev: true optional: true - /esbuild-openbsd-64@0.15.5: - resolution: {integrity: sha512-2mMFfkLk3oPWfopA9Plj4hyhqHNuGyp5KQyTT9Rc8hFd8wAn5ZrbJg+gNcLMo2yzf8Uiu0RT6G9B15YN9WQyMA==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: false - optional: true - /esbuild-sunos-64@0.15.18: resolution: {integrity: sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw==} engines: {node: '>=12'} @@ -5439,15 +5461,6 @@ packages: dev: true optional: true - /esbuild-sunos-64@0.15.5: - resolution: {integrity: sha512-2sIzhMUfLNoD+rdmV6AacilCHSxZIoGAU2oT7XmJ0lXcZWnCvCtObvO6D4puxX9YRE97GodciRGDLBaiC6x1SA==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: false - optional: true - /esbuild-windows-32@0.15.18: resolution: {integrity: sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ==} engines: {node: '>=12'} @@ -5457,15 +5470,6 @@ packages: dev: true optional: true - /esbuild-windows-32@0.15.5: - resolution: {integrity: sha512-e+duNED9UBop7Vnlap6XKedA/53lIi12xv2ebeNS4gFmu7aKyTrok7DPIZyU5w/ftHD4MUDs5PJUkQPP9xJRzg==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: false - optional: true - /esbuild-windows-64@0.15.18: resolution: {integrity: sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw==} engines: {node: '>=12'} @@ -5475,15 +5479,6 @@ packages: dev: true optional: true - /esbuild-windows-64@0.15.5: - resolution: {integrity: sha512-v+PjvNtSASHOjPDMIai9Yi+aP+Vwox+3WVdg2JB8N9aivJ7lyhp4NVU+J0MV2OkWFPnVO8AE/7xH+72ibUUEnw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - /esbuild-windows-arm64@0.15.18: resolution: {integrity: sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ==} engines: {node: '>=12'} @@ -5493,15 +5488,6 @@ packages: dev: true optional: true - /esbuild-windows-arm64@0.15.5: - resolution: {integrity: sha512-Yz8w/D8CUPYstvVQujByu6mlf48lKmXkq6bkeSZZxTA626efQOJb26aDGLzmFWx6eg/FwrXgt6SZs9V8Pwy/aA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false - optional: true - /esbuild@0.15.18: resolution: {integrity: sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==} engines: {node: '>=12'} @@ -5532,64 +5518,34 @@ packages: esbuild-windows-arm64: 0.15.18 dev: true - /esbuild@0.15.5: - resolution: {integrity: sha512-VSf6S1QVqvxfIsSKb3UKr3VhUCis7wgDbtF4Vd9z84UJr05/Sp2fRKmzC+CSPG/dNAPPJZ0BTBLTT1Fhd6N9Gg==} + /esbuild@0.17.19: + resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/linux-loong64': 0.15.5 - esbuild-android-64: 0.15.5 - esbuild-android-arm64: 0.15.5 - esbuild-darwin-64: 0.15.5 - esbuild-darwin-arm64: 0.15.5 - esbuild-freebsd-64: 0.15.5 - esbuild-freebsd-arm64: 0.15.5 - esbuild-linux-32: 0.15.5 - esbuild-linux-64: 0.15.5 - esbuild-linux-arm: 0.15.5 - esbuild-linux-arm64: 0.15.5 - esbuild-linux-mips64le: 0.15.5 - esbuild-linux-ppc64le: 0.15.5 - esbuild-linux-riscv64: 0.15.5 - esbuild-linux-s390x: 0.15.5 - esbuild-netbsd-64: 0.15.5 - esbuild-openbsd-64: 0.15.5 - esbuild-sunos-64: 0.15.5 - esbuild-windows-32: 0.15.5 - esbuild-windows-64: 0.15.5 - esbuild-windows-arm64: 0.15.5 - dev: false - - /esbuild@0.17.15: - resolution: {integrity: sha512-LBUV2VsUIc/iD9ME75qhT4aJj0r75abCVS0jakhFzOtR7TQsqQA5w0tZ+KTKnwl3kXE0MhskNdHDh/I5aCR1Zw==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.17.15 - '@esbuild/android-arm64': 0.17.15 - '@esbuild/android-x64': 0.17.15 - '@esbuild/darwin-arm64': 0.17.15 - '@esbuild/darwin-x64': 0.17.15 - '@esbuild/freebsd-arm64': 0.17.15 - '@esbuild/freebsd-x64': 0.17.15 - '@esbuild/linux-arm': 0.17.15 - '@esbuild/linux-arm64': 0.17.15 - '@esbuild/linux-ia32': 0.17.15 - '@esbuild/linux-loong64': 0.17.15 - '@esbuild/linux-mips64el': 0.17.15 - '@esbuild/linux-ppc64': 0.17.15 - '@esbuild/linux-riscv64': 0.17.15 - '@esbuild/linux-s390x': 0.17.15 - '@esbuild/linux-x64': 0.17.15 - '@esbuild/netbsd-x64': 0.17.15 - '@esbuild/openbsd-x64': 0.17.15 - '@esbuild/sunos-x64': 0.17.15 - '@esbuild/win32-arm64': 0.17.15 - '@esbuild/win32-ia32': 0.17.15 - '@esbuild/win32-x64': 0.17.15 - dev: true + '@esbuild/android-arm': 0.17.19 + '@esbuild/android-arm64': 0.17.19 + '@esbuild/android-x64': 0.17.19 + '@esbuild/darwin-arm64': 0.17.19 + '@esbuild/darwin-x64': 0.17.19 + '@esbuild/freebsd-arm64': 0.17.19 + '@esbuild/freebsd-x64': 0.17.19 + '@esbuild/linux-arm': 0.17.19 + '@esbuild/linux-arm64': 0.17.19 + '@esbuild/linux-ia32': 0.17.19 + '@esbuild/linux-loong64': 0.17.19 + '@esbuild/linux-mips64el': 0.17.19 + '@esbuild/linux-ppc64': 0.17.19 + '@esbuild/linux-riscv64': 0.17.19 + '@esbuild/linux-s390x': 0.17.19 + '@esbuild/linux-x64': 0.17.19 + '@esbuild/netbsd-x64': 0.17.19 + '@esbuild/openbsd-x64': 0.17.19 + '@esbuild/sunos-x64': 0.17.19 + '@esbuild/win32-arm64': 0.17.19 + '@esbuild/win32-ia32': 0.17.19 + '@esbuild/win32-x64': 0.17.19 /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -6054,6 +6010,12 @@ packages: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true + /focus-trap@7.4.3: + resolution: {integrity: sha512-BgSSbK4GPnS2VbtZ50VtOv1Sti6DIkj3+LkVjiWMNjLeAp1SH1UlLx3ULu/DCu4vq5R4/uvTm+zrvsMsuYmGLg==} + dependencies: + tabbable: 6.1.2 + dev: true + /follow-redirects@1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} engines: {node: '>=4.0'} @@ -7204,6 +7166,10 @@ packages: engines: {node: '>=8'} dev: true + /mark.js@8.11.1: + resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} + dev: true + /md5-hex@3.0.1: resolution: {integrity: sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==} engines: {node: '>=8'} @@ -7316,6 +7282,10 @@ packages: resolution: {integrity: sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==} dev: true + /minisearch@6.1.0: + resolution: {integrity: sha512-PNxA/X8pWk+TiqPbsoIYH0GQ5Di7m6326/lwU/S4mlo4wGQddIcf/V//1f9TB0V4j59b57b+HZxt8h3iMROGvg==} + dev: true + /mitt@3.0.0: resolution: {integrity: sha512-7dX2/10ITVyqh4aOSVI9gdape+t9l2/8QxHrFmUXu4EEUpdlxl6RudZUPZoc+zuY2hk1j7XxVroIVIan/pD/SQ==} dev: false @@ -7733,6 +7703,14 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 + /postcss@8.4.23: + resolution: {integrity: sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.6 + picocolors: 1.0.0 + source-map-js: 1.0.2 + /preact@10.13.2: resolution: {integrity: sha512-q44QFLhOhty2Bd0Y46fnYW0gD/cbVM9dUVtNTDKPcdXSMA7jfY+Jpd6rk3GB0lcQss0z5s/6CmVP0Z/hV+g6pw==} dev: true @@ -8222,6 +8200,14 @@ packages: fsevents: 2.3.2 dev: true + /rollup@3.23.0: + resolution: {integrity: sha512-h31UlwEi7FHihLe1zbk+3Q7z1k/84rb9BSwmBSr/XjOCEaBJ2YyedQDuM0t/kfOS0IxM+vk1/zI9XxYj9V+NJQ==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} @@ -8353,12 +8339,13 @@ packages: rechoir: 0.6.2 dev: true - /shiki@0.11.1: - resolution: {integrity: sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==} + /shiki@0.14.2: + resolution: {integrity: sha512-ltSZlSLOuSY0M0Y75KA+ieRaZ0Trf5Wl3gutE7jzLuIcWxLp5i/uEnLoQWNvgKXQ5OMpGkJnVMRLAuzjc0LJ2A==} dependencies: + ansi-sequence-parser: 1.1.0 jsonc-parser: 3.2.0 vscode-oniguruma: 1.7.0 - vscode-textmate: 6.0.0 + vscode-textmate: 8.0.0 dev: true /shx@0.3.4: @@ -8641,6 +8628,10 @@ packages: resolution: {integrity: sha512-8ftwWd+XnQtZ/aGbatrN4QFNGrKJzmbtixW+ODpci7pyoTajg4sonPP8aFLESAcuVxaC1FyDESt+SpfFCH9rZQ==} dev: true + /tabbable@6.1.2: + resolution: {integrity: sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ==} + dev: true + /tdesign-icons-vue-next@0.1.8(vue@3.2.37): resolution: {integrity: sha512-ssI/KJHlhUMYbf+dk+7Ab3LQbWc5wJBjWF9GaGZWPlMU0Yhui9oa2Dvm97Pbx8Ba6drTEDKwfmtJV2R4V6e84Q==} peerDependencies: @@ -8738,16 +8729,16 @@ packages: resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} dev: false - /tinybench@2.4.0: - resolution: {integrity: sha512-iyziEiyFxX4kyxSp+MtY1oCH/lvjH3PxFN8PGCDeqcZWAJ/i+9y+nL85w99PxVzrIvew/GSkSbDYtiGVa85Afg==} + /tinybench@2.5.0: + resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} dev: true /tinycolor2@1.6.0: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} dev: false - /tinypool@0.4.0: - resolution: {integrity: sha512-2ksntHOKf893wSAH4z/+JbPpi92esw8Gn9N2deXX+B0EO92hexAVI9GIZZPx7P5aYo5KULfeOSt3kMOmSOy6uA==} + /tinypool@0.5.0: + resolution: {integrity: sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==} engines: {node: '>=14.0.0'} dev: true @@ -8826,38 +8817,6 @@ packages: yn: 3.1.1 dev: true - /ts-node@10.9.1(@types/node@18.15.11)(typescript@5.0.4): - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.3 - '@types/node': 18.15.11 - acorn: 8.8.2 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.0.4 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - optional: true - /tsc-alias@1.8.5: resolution: {integrity: sha512-Y3ka0olwSRdbHPyX5kXhYY2aoBKuT53DFdeY+PpQUR4hg5M/b8eIRmC8dL4FBdd0wT366iWc6iDUUGe6QwI7mg==} hasBin: true @@ -9154,8 +9113,8 @@ packages: engines: {node: '>= 0.10'} dev: false - /vite-node@0.30.0(@types/node@18.15.11): - resolution: {integrity: sha512-23X5Ggylx0kU/bMf8MCcEEl55d/gsTtU81mMZjm7Z0FSpgKZexUqmX3mJtgglP9SySQQs9ydYg/GEahi/cKHaA==} + /vite-node@0.31.1(@types/node@18.15.11): + resolution: {integrity: sha512-BajE/IsNQ6JyizPzu9zRgHrBwczkAs0erQf/JRpgTIESpKvNj9/Gd0vxX905klLkb0I0SJVCKbdrl5c6FnqYKA==} engines: {node: '>=v14.18.0'} hasBin: true dependencies: @@ -9164,7 +9123,7 @@ packages: mlly: 1.2.0 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) transitivePeerDependencies: - '@types/node' - less @@ -9175,17 +9134,17 @@ packages: - terser dev: true - /vite-plugin-vue-setup-extend@0.4.0(vite@4.2.1): + /vite-plugin-vue-setup-extend@0.4.0(vite@4.3.8): resolution: {integrity: sha512-WMbjPCui75fboFoUTHhdbXzu4Y/bJMv5N9QT9a7do3wNMNHHqrk+Tn2jrSJU0LS5fGl/EG+FEDBYVUeWIkDqXQ==} peerDependencies: vite: '>=2.0.0' dependencies: '@vue/compiler-sfc': 3.2.37 magic-string: 0.25.9 - vite: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) dev: true - /vite@3.2.5(@types/node@18.15.11): + /vite@3.2.5(@types/node@15.12.4): resolution: {integrity: sha512-4mVEpXpSOgrssFZAOmGIr85wPHKvaDAcXqxVxVRZhljkJOMZi1ibLibzjLHzJvcok8BMguLc7g1W6W/GqZbLdQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -9210,7 +9169,7 @@ packages: terser: optional: true dependencies: - '@types/node': 18.15.11 + '@types/node': 15.12.4 esbuild: 0.15.18 postcss: 8.4.21 resolve: 1.22.2 @@ -9219,7 +9178,7 @@ packages: fsevents: 2.3.2 dev: true - /vite@4.2.1(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2): + /vite@4.2.1(@types/node@15.12.4)(sass@1.35.1): resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -9245,17 +9204,16 @@ packages: optional: true dependencies: '@types/node': 15.12.4 - esbuild: 0.17.15 + esbuild: 0.17.19 postcss: 8.4.21 resolve: 1.22.2 rollup: 3.20.2 sass: 1.35.1 - terser: 5.14.2 optionalDependencies: fsevents: 2.3.2 dev: true - /vite@4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2): + /vite@4.2.1(@types/node@18.15.11)(terser@5.14.2): resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -9281,45 +9239,129 @@ packages: optional: true dependencies: '@types/node': 18.15.11 - esbuild: 0.17.15 + esbuild: 0.17.19 postcss: 8.4.21 resolve: 1.22.2 rollup: 3.20.2 + terser: 5.14.2 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vite@4.3.8(@types/node@15.12.4)(sass@1.35.1)(terser@5.14.2): + resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 15.12.4 + esbuild: 0.17.19 + postcss: 8.4.23 + rollup: 3.23.0 sass: 1.35.1 terser: 5.14.2 optionalDependencies: fsevents: 2.3.2 dev: true - /vitepress@1.0.0-alpha.29(@algolia/client-search@4.9.1)(@types/node@18.15.11): - resolution: {integrity: sha512-oaRaeMLcN9M3Bxz97fFVF6Gzm3Aqtb0CijTt5TOW0XPzNPuKA0YpFnsmS97gdKmA+VztM6itRJ8K7JJuU0VS3g==} + /vite@4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2): + resolution: {integrity: sha512-uYB8PwN7hbMrf4j1xzGDk/lqjsZvCDbt/JC5dyfxc19Pg8kRm14LinK/uq+HSLNswZEoKmweGdtpbnxRtrAXiQ==} + engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true + peerDependencies: + '@types/node': '>= 14' + less: '*' + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + dependencies: + '@types/node': 18.15.11 + esbuild: 0.17.19 + postcss: 8.4.23 + rollup: 3.23.0 + sass: 1.35.1 + terser: 5.14.2 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /vitepress@1.0.0-beta.1(@algolia/client-search@4.9.1)(@types/node@18.15.11): + resolution: {integrity: sha512-V2yyCwQ+v9fh7rbnGDLp8M7vHa9sLElexXf/JHtBOsOwv7ed9wt1QI4WUagYgKR3TeoJT9v2s6f0UaQSne0EvQ==} hasBin: true dependencies: - '@docsearch/css': 3.3.3 - '@docsearch/js': 3.3.3(@algolia/client-search@4.9.1) - '@vitejs/plugin-vue': 3.2.0(vite@3.2.5)(vue@3.2.47) + '@docsearch/css': 3.3.5 + '@docsearch/js': 3.3.5(@algolia/client-search@4.9.1) + '@vitejs/plugin-vue': 4.2.3(vite@4.3.8)(vue@3.3.4) '@vue/devtools-api': 6.5.0 - '@vueuse/core': 9.13.0(vue@3.2.47) + '@vueuse/core': 10.1.2(vue@3.3.4) + '@vueuse/integrations': 10.1.2(focus-trap@7.4.3)(vue@3.3.4) body-scroll-lock: 4.0.0-beta.0 - shiki: 0.11.1 - vite: 3.2.5(@types/node@18.15.11) - vue: 3.2.47 + focus-trap: 7.4.3 + mark.js: 8.11.1 + minisearch: 6.1.0 + shiki: 0.14.2 + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vue: 3.3.4 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' - '@types/react' - '@vue/composition-api' + - async-validator + - axios + - change-case + - drauu + - fuse.js + - idb-keyval + - jwt-decode - less + - nprogress + - qrcode - react - react-dom - sass + - sortablejs - stylus - sugarss - terser + - universal-cookie dev: true - /vitest@0.30.0(jsdom@19.0.0): - resolution: {integrity: sha512-2WW4WeTHtrLFeoiuotWvEW6khozx1NvMGYoGsNz2btdddEbqvEdPJIouIdoiC5i61Rl1ctZvm9cn2R9TcPQlzw==} + /vitest@0.31.1(jsdom@19.0.0): + resolution: {integrity: sha512-/dOoOgzoFk/5pTvg1E65WVaobknWREN15+HF+0ucudo3dDG/vCZoXTQrjIfEaWvQXmqScwkRodrTbM/ScMpRcQ==} engines: {node: '>=v14.18.0'} hasBin: true peerDependencies: @@ -9349,14 +9391,14 @@ packages: webdriverio: optional: true dependencies: - '@types/chai': 4.3.4 + '@types/chai': 4.3.5 '@types/chai-subset': 1.3.3 '@types/node': 18.15.11 - '@vitest/expect': 0.30.0 - '@vitest/runner': 0.30.0 - '@vitest/snapshot': 0.30.0 - '@vitest/spy': 0.30.0 - '@vitest/utils': 0.30.0 + '@vitest/expect': 0.31.1 + '@vitest/runner': 0.31.1 + '@vitest/snapshot': 0.31.1 + '@vitest/spy': 0.31.1 + '@vitest/utils': 0.31.1 acorn: 8.8.2 acorn-walk: 8.2.0 cac: 6.7.14 @@ -9368,13 +9410,12 @@ packages: magic-string: 0.30.0 pathe: 1.1.0 picocolors: 1.0.0 - source-map: 0.6.1 std-env: 3.3.2 strip-literal: 1.0.1 - tinybench: 2.4.0 - tinypool: 0.4.0 - vite: 4.2.1(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) - vite-node: 0.30.0(@types/node@18.15.11) + tinybench: 2.5.0 + tinypool: 0.5.0 + vite: 4.3.8(@types/node@18.15.11)(sass@1.35.1)(terser@5.14.2) + vite-node: 0.31.1(@types/node@18.15.11) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -9389,8 +9430,8 @@ packages: resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} dev: true - /vscode-textmate@6.0.0: - resolution: {integrity: sha512-gu73tuZfJgu+mvCSy4UZwd2JXykjK9zAZsfmDeut5dx/1a7FeTk0XwJsSuqQn+cuMCGVbIBfl+s53X4T19DnzQ==} + /vscode-textmate@8.0.0: + resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} dev: true /vue-demi@0.13.11(vue@3.2.37): @@ -9407,8 +9448,8 @@ packages: dependencies: vue: 3.2.37 - /vue-demi@0.13.11(vue@3.2.47): - resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} + /vue-demi@0.14.5(vue@3.2.37): + resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} engines: {node: '>=12'} hasBin: true requiresBuild: true @@ -9419,7 +9460,21 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.2.47 + vue: 3.2.37 + + /vue-demi@0.14.5(vue@3.3.4): + resolution: {integrity: sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + dependencies: + vue: 3.3.4 dev: true /vue-eslint-parser@9.1.1(eslint@8.38.0): @@ -9500,14 +9555,14 @@ packages: '@vue/server-renderer': 3.2.37(vue@3.2.37) '@vue/shared': 3.2.37 - /vue@3.2.47: - resolution: {integrity: sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==} + /vue@3.3.4: + resolution: {integrity: sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==} dependencies: - '@vue/compiler-dom': 3.2.47 - '@vue/compiler-sfc': 3.2.47 - '@vue/runtime-dom': 3.2.47 - '@vue/server-renderer': 3.2.47(vue@3.2.47) - '@vue/shared': 3.2.47 + '@vue/compiler-dom': 3.3.4 + '@vue/compiler-sfc': 3.3.4 + '@vue/runtime-dom': 3.3.4 + '@vue/server-renderer': 3.3.4(vue@3.3.4) + '@vue/shared': 3.3.4 dev: true /w3c-hr-time@1.0.2: diff --git a/runtime/react/dev.vite.config.ts b/runtime/react/dev.vite.config.ts index 3a327210..2b17a3bd 100644 --- a/runtime/react/dev.vite.config.ts +++ b/runtime/react/dev.vite.config.ts @@ -31,6 +31,8 @@ export default defineConfig({ { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') }, + { find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') }, + { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') }, ], }, diff --git a/runtime/react/package.json b/runtime/react/package.json index e5c8af5e..f77f22b2 100644 --- a/runtime/react/package.json +++ b/runtime/react/package.json @@ -28,6 +28,7 @@ "@tmagic/stage": "1.2.15", "@tmagic/utils": "1.2.15", "axios": "^0.25.0", + "lodash-es": "^4.17.21", "terser": "^5.14.2", "react": "^17.0.2", "react-dom": "^17.0.2" @@ -38,9 +39,10 @@ }, "devDependencies": { "@babel/preset-env": "^7.21.4", + "@types/lodash-es": "^4.17.4", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", - "@vitejs/plugin-legacy": "^4.0.2", + "@vitejs/plugin-legacy": "^4.0.3", "@vitejs/plugin-react-refresh": "^1.3.1", "recast": "^0.20.4", "typescript": "^5.0.4", diff --git a/runtime/react/page/App.tsx b/runtime/react/page/App.tsx index bde5a17c..2295d18a 100644 --- a/runtime/react/page/App.tsx +++ b/runtime/react/page/App.tsx @@ -16,22 +16,32 @@ * limitations under the License. */ -import React, { useContext } from 'react'; +import React, { useContext, useState } from 'react'; +import { cloneDeep } from 'lodash-es'; import Core from '@tmagic/core'; -import type { MPage } from '@tmagic/schema'; +import type { MNode } from '@tmagic/schema'; import { AppContent } from '@tmagic/ui-react'; +import { replaceChildNode } from '@tmagic/utils'; function App() { const app = useContext(AppContent); - if (!app?.page?.data) { - return null; - } + if (!app?.page) return null; + + const [config, setConfig] = useState(app.page.data); + + app.dataSourceManager?.on('update-data', (nodes: MNode[], sourceId: string) => { + nodes.forEach((node) => { + const newNode = app.compiledNode(node, app.dataSourceManager?.data || {}, sourceId); + replaceChildNode(newNode, [config]); + setConfig(cloneDeep(config)); + }); + }); const MagicUiPage = app.resolveComponent('page'); - return ; + return ; } export default App; diff --git a/runtime/react/playground/main.tsx b/runtime/react/playground/main.tsx index 4ca0211c..0fed0888 100644 --- a/runtime/react/playground/main.tsx +++ b/runtime/react/playground/main.tsx @@ -18,11 +18,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; +import { cloneDeep } from 'lodash-es'; import Core from '@tmagic/core'; import type { MApp } from '@tmagic/schema'; import type { RemoveData, SortEventData, UpdateData } from '@tmagic/stage'; import { AppContent } from '@tmagic/ui-react'; +import { replaceChildNode } from '@tmagic/utils'; import components from '../.tmagic/comp-entry'; import plugins from '../.tmagic/plugin-entry'; @@ -75,12 +77,10 @@ const operations = { }, updateRootConfig(root: MApp) { - console.log('update root config', root); app?.setConfig(root); }, updatePageId(id: string) { - console.log('update page id', id); curPageId = id; app?.setPage(curPageId); renderDom(); @@ -91,7 +91,6 @@ const operations = { }, select(id: string) { - console.log('select config', id); const el = document.getElementById(id); if (el) return el; // 未在当前文档下找到目标元素,可能是还未渲染,等待渲染完成后再尝试获取 @@ -103,22 +102,19 @@ const operations = { }, add({ root }: UpdateData) { - console.log('add config', root); updateConfig(root); }, - update({ root }: UpdateData) { - console.log('update config', root); - updateConfig(root); + update({ config, root }: UpdateData) { + replaceChildNode(app.compiledNode(config, app.dataSourceManager?.data || {}), root.items); + updateConfig(cloneDeep(root)); }, sortNode({ root }: SortEventData) { - console.log('sort config', root); root && updateConfig(root); }, remove({ root }: RemoveData) { - console.log('remove config', root); updateConfig(root); }, }; diff --git a/runtime/vue2/dev.vite.config.ts b/runtime/vue2/dev.vite.config.ts index 4d155a3b..1b09f04c 100644 --- a/runtime/vue2/dev.vite.config.ts +++ b/runtime/vue2/dev.vite.config.ts @@ -29,6 +29,8 @@ export default defineConfig({ { find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm.js') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, + { find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') }, + { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') }, { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') }, ], }, diff --git a/runtime/vue2/package.json b/runtime/vue2/package.json index 35efea7a..62088e25 100644 --- a/runtime/vue2/package.json +++ b/runtime/vue2/package.json @@ -39,8 +39,8 @@ "rollup": "^2.25.0", "rollup-plugin-external-globals": "^0.6.1", "sass": "^1.35.1", - "vite": "^4.2.1", - "@vitejs/plugin-legacy": "^4.0.2", + "vite": "^4.3.8", + "@vitejs/plugin-legacy": "^4.0.3", "@vitejs/plugin-vue2": "^2.2.0", "vue-template-compiler": "^2.7.4" } diff --git a/runtime/vue2/page/App.vue b/runtime/vue2/page/App.vue index fc418847..21cb65bf 100644 --- a/runtime/vue2/page/App.vue +++ b/runtime/vue2/page/App.vue @@ -6,6 +6,8 @@ import { defineComponent, inject, reactive } from 'vue'; import Core from '@tmagic/core'; +import { MNode } from '@tmagic/schema'; +import { replaceChildNode } from '@tmagic/utils'; export default defineComponent({ name: 'App', @@ -14,6 +16,13 @@ export default defineComponent({ const app = inject('app'); const pageConfig = reactive(app?.page?.data || {}); + app?.dataSourceManager?.on('update-data', (nodes: MNode[], sourceId: string) => { + nodes.forEach((node) => { + const newNode = app.compiledNode(node, app.dataSourceManager?.data || {}, sourceId); + replaceChildNode(reactive(newNode), [pageConfig as MNode]); + }); + }); + return { pageConfig, }; diff --git a/runtime/vue2/playground/App.vue b/runtime/vue2/playground/App.vue index cb2c593e..22274198 100644 --- a/runtime/vue2/playground/App.vue +++ b/runtime/vue2/playground/App.vue @@ -8,7 +8,7 @@ import { computed, defineComponent, inject, nextTick, reactive, ref, watch } fro import Core from '@tmagic/core'; import type { Id, MApp, MNode } from '@tmagic/schema'; import { Magic, RemoveData, UpdateData } from '@tmagic/stage'; -import { getNodePath } from '@tmagic/utils'; +import { getNodePath, replaceChildNode } from '@tmagic/utils'; declare global { interface Window { @@ -41,19 +41,16 @@ export default defineComponent({ }, updateRootConfig(config: MApp) { - console.log('update config', config); root.value = config; app?.setConfig(config, curPageId.value); }, updatePageId(id: Id) { - console.log('update page id', id); curPageId.value = id; app?.setPage(id); }, select(id: Id) { - console.log('select config', id); selectedId.value = id; if (app?.getPage(id)) { @@ -67,8 +64,6 @@ export default defineComponent({ }, add({ config, parentId }: UpdateData) { - console.log('add config', config); - if (!root.value) throw new Error('error'); if (!selectedId.value) throw new Error('error'); if (!parentId) throw new Error('error'); @@ -91,24 +86,15 @@ export default defineComponent({ }, update({ config, parentId }: UpdateData) { - console.log('update config', config); + if (!root.value || !app) throw new Error('error'); - if (!root.value) throw new Error('error'); + const newNode = app.compiledNode(config, app.dataSourceManager?.data || {}); + replaceChildNode(reactive(newNode), [root.value], parentId); - const node = getNodePath(config.id, [root.value]).pop(); - if (!node) throw new Error('未找到目标节点'); - - if (!parentId) throw new Error('error'); - const parent = getNodePath(parentId, [root.value]).pop(); - if (!parent) throw new Error('未找到父节点'); - - const nodeInstance = app?.page?.getNode(config.id); + const nodeInstance = app.page?.getNode(config.id); if (nodeInstance) { nodeInstance.setData(config); } - - const index = parent.items?.findIndex((child: MNode) => child.id === node.id); - parent.items.splice(index, 1, reactive(config)); }, remove({ id, parentId }: RemoveData) { diff --git a/runtime/vue3/dev.vite.config.ts b/runtime/vue3/dev.vite.config.ts index 4cd590f2..16a1c371 100644 --- a/runtime/vue3/dev.vite.config.ts +++ b/runtime/vue3/dev.vite.config.ts @@ -30,6 +30,8 @@ export default defineConfig({ { find: /^vue$/, replacement: path.join(__dirname, 'node_modules/vue/dist/vue.esm-bundler.js') }, { find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../packages/utils/src/index.ts') }, { find: /^@tmagic\/core/, replacement: path.join(__dirname, '../../packages/core/src/index.ts') }, + { find: /^@tmagic\/data-source/, replacement: path.join(__dirname, '../../packages/data-source/src/index.ts') }, + { find: /^@data-source/, replacement: path.join(__dirname, '../../packages/data-source/src') }, { find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../packages/schema/src/index.ts') }, ], }, diff --git a/runtime/vue3/package.json b/runtime/vue3/package.json index dc1b4e50..e85c6cdf 100644 --- a/runtime/vue3/package.json +++ b/runtime/vue3/package.json @@ -33,7 +33,7 @@ "devDependencies": { "@babel/preset-env": "^7.21.4", "@types/node": "^15.12.4", - "@vitejs/plugin-legacy": "^4.0.2", + "@vitejs/plugin-legacy": "^4.0.3", "@vitejs/plugin-vue": "^4.1.0", "@vitejs/plugin-vue-jsx": "^3.0.1", "@vue/compiler-sfc": "^3.2.37", @@ -44,7 +44,7 @@ "sass": "^1.35.1", "terser": "^5.14.2", "typescript": "^4.3.4", - "vite": "^4.2.1", + "vite": "^4.3.8", "vue-tsc": "^1.2.0" } } diff --git a/runtime/vue3/page/App.vue b/runtime/vue3/page/App.vue index fc418847..21cb65bf 100644 --- a/runtime/vue3/page/App.vue +++ b/runtime/vue3/page/App.vue @@ -6,6 +6,8 @@ import { defineComponent, inject, reactive } from 'vue'; import Core from '@tmagic/core'; +import { MNode } from '@tmagic/schema'; +import { replaceChildNode } from '@tmagic/utils'; export default defineComponent({ name: 'App', @@ -14,6 +16,13 @@ export default defineComponent({ const app = inject('app'); const pageConfig = reactive(app?.page?.data || {}); + app?.dataSourceManager?.on('update-data', (nodes: MNode[], sourceId: string) => { + nodes.forEach((node) => { + const newNode = app.compiledNode(node, app.dataSourceManager?.data || {}, sourceId); + replaceChildNode(reactive(newNode), [pageConfig as MNode]); + }); + }); + return { pageConfig, }; diff --git a/runtime/vue3/playground/App.vue b/runtime/vue3/playground/App.vue index e20c933b..196f7d4a 100644 --- a/runtime/vue3/playground/App.vue +++ b/runtime/vue3/playground/App.vue @@ -2,13 +2,13 @@ - diff --git a/tsconfig.json b/tsconfig.json index 83bff6f0..61836b24 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,8 @@ // 内部模块都指向 src/index.ts, 会有更好的代码跳转体验. "@tmagic/*": ["packages/*/src"], "@editor/*": ["packages/editor/src/*"], + "@form/*": ["packages/form/src/*"], + "@data-source/*": ["packages/data-source/src/*"], }, "types": [ "node", diff --git a/vitest.config.ts b/vitest.config.ts index 493dd512..84248fa2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -21,6 +21,7 @@ export default defineConfig({ './packages/form/tests/unit/utils/**', './packages/stage/tests/**', './packages/utils/tests/**', + './packages/data-source/tests/**', ], environment: 'jsdom', }, @@ -29,11 +30,13 @@ export default defineConfig({ alias: { '@editor': r('./packages/editor/src'), '@form': r('./packages/form/src'), + '@data-source': r('./packages/data-source/src'), '@tmagic/core': r('./packages/core/src'), '@tmagic/utils': r('./packages/utils/src'), '@tmagic/editor': r('./packages/editor/src'), '@tmagic/stage': r('./packages/stage/src'), '@tmagic/schema': r('./packages/schema/src'), + '@tmagic/data-source': r('./packages/data-source/src'), }, }, });