diff --git a/packages/core/build/tsconfig.json b/packages/core/build/tsconfig.json new file mode 100644 index 000000000..a0f4c89ef --- /dev/null +++ b/packages/core/build/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "lib": ["esnext", "DOM.Iterable", "DOM"], + "esModuleInterop": true, + "moduleResolution": "node", + "jsx": "react", + "target": "esnext", + "module": "esnext", + "allowJs": true, + "noUnusedLocals": false, + "preserveConstEnums": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "sourceMap": true, + "inlineSources": true, + "resolveJsonModule": true, + "declaration": true, + "experimentalDecorators": true, + "downlevelIteration": true + }, + "exclude": ["bin", "node_modules", "lib"] +} diff --git a/packages/core/build/tsup.config.ts b/packages/core/build/tsup.config.ts index 5d962ca85..d8d4e0dd2 100644 --- a/packages/core/build/tsup.config.ts +++ b/packages/core/build/tsup.config.ts @@ -7,6 +7,7 @@ const entry = fg.globSync(['src/**', ...globExcludeFiles], { cwd: __dirname, abs export default defineConfig({ entry, + tsconfig: path.join(__dirname, 'tsconfig.json'), outDir: path.join(__dirname, 'lib'), splitting: false, silent: true, @@ -14,7 +15,7 @@ export default defineConfig({ clean: true, bundle: false, loader: { - '.d.ts': 'copy' + '.d.ts': 'copy', }, skipNodeModulesBundle: true, }); diff --git a/packages/core/cli/src/cli.ts b/packages/core/cli/src/cli.ts index d1dd6e64f..06484d920 100755 --- a/packages/core/cli/src/cli.ts +++ b/packages/core/cli/src/cli.ts @@ -9,11 +9,12 @@ import semver from 'semver'; const cli = new Command(); cli.version((await import('../package.json')).version); -await commands(cli); initEnv(); genTsConfigPaths(); +await commands(cli); + if (semver.satisfies(process.version, '<20')) { console.error(chalk.red('[tachybase cli]: Node.js version must be >= 20')); process.exit(1); diff --git a/packages/core/cli/src/util.ts b/packages/core/cli/src/util.ts index 8443365bb..b550028d7 100644 --- a/packages/core/cli/src/util.ts +++ b/packages/core/cli/src/util.ts @@ -222,9 +222,7 @@ export async function genTsConfigPaths() { const cwd = process.cwd(); const cwdLength = cwd.length; - const paths: Record = { - '@@/*': ['.dumi/tmp/*'], - }; + const paths: Record = {}; const packages = fastGlob.sync(['packages/*/*/package.json', 'packages/*/*/*/package.json'], { absolute: true, onlyFiles: true, @@ -324,7 +322,7 @@ export function initEnv() { SOCKET_PATH: 'storage/gateway.sock', NODE_MODULES_PATH: resolve(process.cwd(), 'node_modules'), PM2_HOME: resolve(process.cwd(), './storage/.pm2'), - PLUGIN_PACKAGE_PREFIX: '@nocobase/plugin-,@nocobase/plugin-sample-,@nocobase/preset-', + PLUGIN_PACKAGE_PREFIX: '@nocobase/plugin-,@nocobase/plugin-sample-,@nocobase/preset-,@hera/plugin-', SERVER_TSCONFIG_PATH: './tsconfig.server.json', PLAYWRIGHT_AUTH_FILE: resolve(process.cwd(), 'storage/playwright/.auth/admin.json'), CACHE_DEFAULT_STORE: 'memory', diff --git a/packages/core/client/.dumi/theme/builtins/LangSwitch/index.tsx b/packages/core/client/.dumi/theme/builtins/LangSwitch/index.tsx deleted file mode 100644 index 4111f9eb6..000000000 --- a/packages/core/client/.dumi/theme/builtins/LangSwitch/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from "react"; - -const LangSwitch = () => { - const { hostname } = window.location - if (hostname === 'localhost') return null; - const en = window.location.href.replace(hostname, 'docs.nocobase.com') - const cn = window.location.href.replace(hostname, 'docs-cn.nocobase.com') - return EN | 中文 -} - -export default LangSwitch; diff --git a/packages/core/client/.dumi/theme/builtins/Previewer/index.tsx b/packages/core/client/.dumi/theme/builtins/Previewer/index.tsx deleted file mode 100644 index 9ec63f2cc..000000000 --- a/packages/core/client/.dumi/theme/builtins/Previewer/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React, { FC, useRef, useEffect, Suspense } from 'react'; -import { Root, createRoot } from 'react-dom/client'; -import { IPreviewerProps } from 'dumi'; -import DefaultPreviewer from 'dumi/theme-default/builtins/Previewer'; - -const Previewer: FC = ({ children, ...props }) => { - const ref = useRef(null); - useEffect(() => { - let root: Root - if (ref.current) { - root = createRoot(ref.current) - root.render(loading...}>{children}) - } - return () => { - if (root) { - root.unmount() - } - } - }, []); - return
; -}; - -export default Previewer; diff --git a/packages/core/client/.dumi/theme/slots/PreviewerActions.tsx b/packages/core/client/.dumi/theme/slots/PreviewerActions.tsx deleted file mode 100644 index 15a86df5d..000000000 --- a/packages/core/client/.dumi/theme/slots/PreviewerActions.tsx +++ /dev/null @@ -1,219 +0,0 @@ -import DumiPreviewerActions from 'dumi/theme-default/slots/PreviewerActions'; -import React, { useRef, useEffect, useState } from 'react'; -import { Spin } from 'antd' - -import { IPreviewerProps } from 'dumi'; - -const indexHtml = ` -
- - -` - -const mainTsx = ` -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App' - -ReactDOM.createRoot(document.getElementById('root')!).render( - - - , -) -` - -const packageJson = ` -{ - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc && vite build", - "preview": "vite preview" - }, - "dependencies": { - }, - "devDependencies": { - "flat": "^5.0.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "@types/react": "^18.2.15", - "@types/react-dom": "^18.2.7", - "@vitejs/plugin-react": "^4.0.3", - "less": "^4.2.0", - "typescript": "^5.0.2", - "vite": "^4.4.5" - } -} -` - -const tsConfigJson = ` -{ - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": [ - "ES2020", - "DOM", - "DOM.Iterable" - ], - "module": "ESNext", - "skipLibCheck": true, - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - "composite": true, - "strict": false, - "noUnusedLocals": true, - "noUnusedParameters": true, - "allowSyntheticDefaultImports": true, - "noFallthroughCasesInSwitch": true - }, - "include": [ - "src", - "vite.config.ts" - ] -} -` - -const viteConfigTs = ` -import { defineConfig } from 'vite' -import react from '@vitejs/plugin-react' - -export default defineConfig({ - plugins: [react()], -}) -` - -const sandboxTask = ` -{ - "setupTasks": [ - { - "name": "Install Dependencies", - "command": "pnpm install" - } - ], - "tasks": { - "dev": { - "name": "dev", - "command": "pnpm dev", - "runAtStart": true, - "preview": { - "port": 5173 - } - }, - "build": { - "name": "build", - "command": "pnpm build", - "runAtStart": false - }, - "preview": { - "name": "preview", - "command": "pnpm preview", - "runAtStart": false - } - } -} -` - -function getCSBData(opts: IPreviewerProps, ext: string) { - - const files: Record< - string, - { - content: string; - isBinary: boolean; - } - > = {}; - const deps: Record = {}; - const entryFileName = `index${ext}`; - - Object.entries(opts.asset.dependencies).forEach(([name, { type, value }]) => { - if (type === 'NPM') { - // generate dependencies - deps[name] = value; - } else { - // append other imported local files - files[name === entryFileName ? `src/App${ext}` : name] = { - content: value, - isBinary: false, - }; - } - }); - - // append package.json - let pkg = JSON.parse(packageJson) - try { - for (let key in deps) { - if (!pkg['devDependencies'][key]) { - pkg.dependencies[key] = deps[key] - } - } - } catch (e) { - console.log(e) - } - files['package.json'] = { - content: JSON.stringify( - { - name: opts.title, - ...pkg, - }, - null, - 2, - ), - isBinary: false, - }; - - files['index.html'] = { content: indexHtml, isBinary: false }; - files['src/main.tsx'] = { content: mainTsx, isBinary: false }; - files['package.json'] = { content: JSON.stringify(pkg, null, 2), isBinary: false }; - files['.codesandbox/task.json'] = { content: sandboxTask, isBinary: false }; - files['tsconfig.json'] = { content: tsConfigJson, isBinary: false }; - files['vite.config.ts'] = { content: viteConfigTs, isBinary: false }; - - return { files }; -} - - -export function openCodeSandbox(opts: IPreviewerProps) { - const isTSX = Boolean(opts.asset.dependencies?.['index.tsx']); - const ext = isTSX ? '.tsx' : '.jsx'; - return fetch("https://codesandbox.io/api/v1/sandboxes/define?json=1", { - method: "POST", - headers: { - "Content-Type": "application/json", - Accept: "application/json" - }, - body: JSON.stringify(getCSBData(opts, ext)) - }) - .then(x => x.json()) - .then(data => { - window.open(`https://codesandbox.io/p/sandbox/${data.sandbox_id}?file=/src/App${ext}`); - }); -} - - -const PreviewerActions: typeof DumiPreviewerActions = (props) => { - const div = useRef(null); - const [loading, setLoading] = useState(false); - - useEffect(() => { - if (div.current) { - const element = div.current.querySelector('.dumi-default-previewer-action-btn'); - element?.addEventListener('click', (e) => { - e.stopImmediatePropagation(); - setLoading(true); - openCodeSandbox(props).finally(() => { - setLoading(false); - }); - }) - } - }, [div]) - - return
-}; - -export default PreviewerActions; diff --git a/packages/core/client/.dumi/tsconfig.json b/packages/core/client/.dumi/tsconfig.json deleted file mode 100644 index a32dd4f23..000000000 --- a/packages/core/client/.dumi/tsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": "../tsconfig.json", - "include": ["**/*"] -} diff --git a/packages/core/client/.dumirc.ts b/packages/core/client/.dumirc.ts deleted file mode 100644 index dd0c2198e..000000000 --- a/packages/core/client/.dumirc.ts +++ /dev/null @@ -1,469 +0,0 @@ -import { getUmiConfig } from '@nocobase/devtools/umiConfig'; -import { defineConfig } from 'dumi'; -import { defineThemeConfig } from 'dumi-theme-nocobase'; - -const umiConfig = getUmiConfig(); -process.env.DOC_LANG = process.env.DOC_LANG || 'zh-CN'; -const lang = process.env.DOC_LANG; - -console.log('process.env.DOC_LANG', lang); - -export default defineConfig({ - hash: true, - alias: { - ...umiConfig.alias, - }, - fastRefresh: false, // 热更新会导致 Context 丢失,不开启 - // ssr: {}, - // exportStatic: { - // ignorePreRenderError: true - // }, - cacheDirectoryPath: `node_modules/.docs-client-${lang}-cache`, - outputPath: `./dist/${lang}`, - resolve: { - docDirs: [`./docs/${lang}`] - }, - locales: [ - { id: 'en-US', name: 'English' }, - { id: 'zh-CN', name: '中文' }, - ], - themeConfig: defineThemeConfig({ - title: 'NocoBase', - logo: 'https://www.nocobase.com/images/logo.png', - github: 'https://github.com/nocobase/nocobase', - footer: 'nocobase | Copyright © 2022', - // sidebarGroupModePath: ['/components'], - nav: [ - { - title: 'API', - link: '/core/application/application', - }, - // { - // title: 'UI Schema', - // link: '/ui-schema', - // }, - ], - sidebarEnhance: { - '/core': [ - { - title: 'Application', - type: 'group', - children: [ - { - title: 'Application', - link: '/core/application/application', - }, - { - title: 'Plugin', - link: '/core/application/plugin', - }, - { - title: 'PluginManager', - link: '/core/application/plugin-manager', - }, - { - title: 'RouterManager', - link: '/core/application/router-manager', - }, - { - title: 'PluginSettingsManager', - link: '/core/application/plugin-settings-manager', - }, - ], - }, - { - title: 'UI Schema', - type: 'group', - children: [ - { - title: 'SchemaComponent', - link: '/core/ui-schema/schema-component', - }, - { - title: 'Designable', - link: '/core/ui-schema/designable', - }, - { - title: 'SchemaInitializer', - link: '/core/ui-schema/schema-initializer', - }, - { - title: 'SchemaInitializerManager', - link: '/core/ui-schema/schema-initializer-manager', - }, - { - title: 'SchemaSettings', - link: '/core/ui-schema/schema-settings', - }, - { - title: 'SchemaSettingsManager', - link: '/core/ui-schema/schema-settings-manager', - }, - { - title: 'SchemaToolbar', - link: '/core/ui-schema/schema-toolbar', - }, - ], - }, - { - title: 'Data Source', - type: 'group', - children: [ - { - title: 'DataSourceManager', - link: '/core/data-source/data-source-manager', - }, - { - title: 'DataSourceManagerProvider', - link: '/core/data-source/data-source-manager-provider', - }, - { - title: 'DataSource', - link: '/core/data-source/data-source', - }, - { - title: 'DataSourceProvider', - link: '/core/data-source/data-source-provider', - }, - { - title: 'CollectionManager', - link: '/core/data-source/collection-manager', - }, - { - title: 'CollectionManagerProvider', - link: '/core/data-source/collection-manager-provider', - }, - { - title: 'CollectionTemplateManager', - link: '/core/data-source/collection-template-manager', - }, - { - title: 'CollectionTemplate', - link: '/core/data-source/collection-template', - }, - { - title: 'Collection', - link: '/core/data-source/collection', - }, - { - title: 'CollectionProvider', - link: '/core/data-source/collection-provider', - }, - { - title: 'CollectionMixins', - link: '/core/data-source/collection-mixins', - }, - { - title: 'CollectionField', - link: '/core/data-source/collection-field', - }, - { - title: 'CollectionFieldInterfaceManager', - link: '/core/data-source/collection-field-interface-manager', - }, - { - title: 'CollectionFieldInterface', - link: '/core/data-source/collection-field-interface', - }, - { - title: 'AssociationProvider', - link: '/core/data-source/association-provider', - }, - { - title: 'ExtendCollectionsProvider', - link: '/core/data-source/extend-collections-provider', - }, - ] - }, - { - title: 'DataBlock', - type: 'group', - children: [ - { - title: 'CollectionRecord', - link: '/core/data-block/collection-record', - }, - { - title: 'CollectionRecordProvider', - link: '/core/data-block/collection-record-provider', - }, - { - title: 'DataBlockProvider', - link: '/core/data-block/data-block-provider', - }, - { - title: 'DataBlockResourceProvider', - link: '/core/data-block/data-block-resource-provider', - }, - { - title: 'DataBlockRequestProvider', - link: '/core/data-block/data-block-request-provider', - }, - ] - } - ], - // '/ui-schema': [ - // { - // title: 'Overview', - // link: '/ui-schema', - // }, - // { - // title: 'Globals', - // type: 'group', - // children: [ - // { - // title: 'Menu', - // link: '/ui-schema/globals/menu', - // }, - // { - // title: 'Page', - // link: '/ui-schema/globals/page', - // }, - // { - // title: 'Tabs', - // link: '/ui-schema/globals/tabs', - // }, - // ], - // }, - // { - // title: 'Blocks', - // type: 'group', - // children: [ - // { - // title: 'Overview', - // link: '/ui-schema/blocks', - // }, - // { - // title: 'Data blocks', - // children: [ - // { - // title: 'Overview', - // link: '/ui-schema/blocks/data', - // }, - // { - // title: 'Table', - // link: '/ui-schema/blocks/data/table', - // }, - // { - // title: 'Form', - // link: '/ui-schema/blocks/data/form', - // }, - // { - // title: 'Form(Read pretty)', - // link: '/ui-schema/blocks/data/form-read-pretty', - // }, - // { - // title: 'Details', - // link: '/ui-schema/blocks/data/details', - // }, - // { - // title: 'List', - // link: '/ui-schema/blocks/data/list', - // }, - // { - // title: 'Grid Card', - // link: '/ui-schema/blocks/data/grid-card', - // }, - // { - // title: 'Calendar', - // link: '/ui-schema/blocks/data/calendar', - // }, - // { - // title: 'Kanban', - // link: '/ui-schema/blocks/data/kanban', - // }, - // { - // title: 'Map', - // link: '/ui-schema/blocks/data/map', - // }, - // { - // title: 'Gantt', - // link: '/ui-schema/blocks/data/gantt', - // }, - // { - // title: 'Charts', - // link: '/ui-schema/blocks/data/charts', - // }, - // ], - // }, - // { - // title: 'Filter blocks', - // children: [ - // { - // title: 'Collapse', - // link: '/ui-schema/blocks/filter/collapse', - // }, - // { - // title: 'Form', - // link: '/ui-schema/blocks/filter/form', - // }, - // ], - // }, - // { - // title: 'Other blocks', - // children: [ - // { - // title: 'iframe', - // link: '/ui-schema/blocks/others/iframe', - // }, - // { - // title: 'Markdown', - // link: '/ui-schema/blocks/others/markdown', - // }, - // { - // title: 'Workflow todos', - // link: '/ui-schema/blocks/others/workflow-todo', - // }, - // ], - // }, - // ], - // }, - // { - // title: 'Fields', - // type: 'group', - // children: [ - // { - // title: 'Overview', - // link: '/ui-schema/fields', - // }, - // { - // title: 'FormItem', - // link: '/ui-schema/fields/form-item', - // }, - // { - // title: 'TableColumn', - // link: '/ui-schema/fields/table-column', - // }, - // { - // title: 'Association', - // children: [ - // { - // title: 'Title', - // link: '/ui-schema/fields/association-components/title', - // }, - // { - // title: 'Tag', - // link: '/ui-schema/fields/association-components/tag', - // }, - // { - // title: 'Select', - // link: '/ui-schema/fields/association-components/select', - // }, - // { - // title: 'RecordPicker', - // link: '/ui-schema/fields/association-components/record-picker', - // }, - // { - // title: 'Cascader', - // link: '/ui-schema/fields/association-components/cascader-select', - // }, - // { - // title: 'Sub-form', - // link: '/ui-schema/fields/association-components/sub-form', - // }, - // { - // title: 'Sub-form(Popover)', - // link: '/ui-schema/fields/association-components/sub-form-popover', - // }, - // { - // title: 'Sub-details', - // link: '/ui-schema/fields/association-components/sub-details', - // }, - // { - // title: 'Sub-table', - // link: '/ui-schema/fields/association-components/cascader-select', - // }, - // { - // title: 'File manager', - // link: '/ui-schema/fields/association-components/file-manager', - // }, - // ], - // }, - // ], - // }, - // { - // title: 'Actions', - // type: 'group', - // children: [ - // { - // title: 'Overview', - // link: '/ui-schema/actions', - // }, - // { - // title: 'Add new', - // link: '/ui-schema/actions/add-new', - // }, - // { - // title: 'View', - // link: '/ui-schema/actions/view', - // }, - // { - // title: 'Edit', - // link: '/ui-schema/actions/edit', - // }, - // { - // title: 'Delete', - // link: '/ui-schema/actions/delete', - // }, - // { - // title: 'Submit', - // link: '/ui-schema/actions/submit', - // }, - // { - // title: 'Filter', - // link: '/ui-schema/actions/filter', - // }, - // { - // title: 'Refresh', - // link: '/ui-schema/actions/refresh', - // }, - // { - // title: 'Print', - // link: '/ui-schema/actions/print', - // }, - // { - // title: 'Duplicate', - // link: '/ui-schema/actions/duplicate', - // }, - // { - // title: 'Export', - // link: '/ui-schema/actions/export', - // }, - // { - // title: 'Import', - // link: '/ui-schema/actions/import', - // }, - // { - // title: 'Bulk update', - // link: '/ui-schema/actions/bulk-update', - // }, - // { - // title: 'Bulk edit', - // link: '/ui-schema/actions/bulk-edit', - // }, - // { - // title: 'Add record(任意表)', - // link: '/ui-schema/actions/add-record', - // }, - // { - // title: 'Update record', - // link: '/ui-schema/actions/update-record', - // }, - // { - // title: 'Save record', - // link: '/ui-schema/actions/save-record', - // }, - // { - // title: 'Custom request', - // link: '/ui-schema/actions/custom-request', - // }, - // { - // title: 'Submit to workflow', - // link: '/ui-schema/actions/submit-to-workflow', - // }, - // ], - // }, - // ], - }, - }), -}); diff --git a/packages/core/client/docs/en-US/core/application/application.md b/packages/core/client/docs/en-US/core/application/application.md deleted file mode 100644 index b33fe9bbf..000000000 --- a/packages/core/client/docs/en-US/core/application/application.md +++ /dev/null @@ -1,374 +0,0 @@ -# Application - -## new Application(options) - -创建一个 NocoBase 应用。 - -- 类型 - -```tsx | pure -export interface ApplicationOptions { - apiClient?: APIClientOptions | APIClient; - ws?: WebSocketClientOptions | boolean; - i18n?: i18next; - providers?: (ComponentType | ComponentAndProps)[]; - plugins?: PluginType[]; - components?: Record; - scopes?: Record; - router?: RouterOptions; - schemaSettings?: SchemaSetting[]; - schemaInitializers?: SchemaInitializer[]; - loadRemotePlugins?: boolean; - dataSourceManager?: DataSourceManagerOptions; -} -``` - -- 详细信息 - - apiClient:API 请求实例,具体说明请参见:[https://docs.nocobase.com/api/sdk](https://docs.nocobase.com/api/sdk) - - i18n:国际化,具体请参考:[https://www.i18next.com/overview/api#createinstance](https://www.i18next.com/overview/api#createinstance) - - providers:上下文 - - components:全局组件 - - scopes:全局 scopes - - router:配置路由,具体请参考:[RouterManager](/core/application/router-manager) - - pluginSettings: [PluginSettingsManager](/core/application/plugin-settings-manager) - - schemaSettings:Schema 设置工具,具体参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) - - schemaInitializers:Schema 添加工具,具体参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) - - loadRemotePlugins:用于控制是否加载远程插件,默认为 `false`,即不加载远程插件(方便单测和 DEMO 环境)。 - - dataSourceManager:数据源管理器,具体参考:[DataSourceManager](/core/data-source/data-source-manager) -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import { Application, Plugin } from '@nocobase/client'; - -const ProviderDemo = ({ children }) => { - return
-
hello world
-
{children}
-
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - } -} - -const app = new Application({ - providers: [ProviderDemo], - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -## 实例属性 - -### app.i18n - -```tsx | pure -class Application { - i18n: i18next; -} -``` - -详细介绍,请参考:[i18next](https://www.i18next.com/overview/api#createinstance) - -### app.apiClient - -```tsx | pure -class Application { - apiClient: APIClient; -} -``` - -详细介绍,请参考:[APIClient](https://docs.nocobase.com/api/sdk) - -### app.router - -详细介绍,请参考:[RouterManager](/core/application/router-manager) - -### app.pluginSettingsManager - -详细介绍,请参考:[PluginSettingsManager](/core/application/plugin-settings-manager) - -### app.schemaSettingsManager - -详细介绍,请参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) - -### app.schemaInitializerManager - -详细介绍,请参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) - -### app.dataSourceManager - -详细介绍,请参考:[dataSourceManager](/core/data-source/data-source-manager) - -## 实例方法 - -### app.getRootComponent() - -获取应用的根组件。 - -- 类型 - -```tsx | pure -class Application { - getRootComponent(): React.FC -} -``` - -- 示例 - -```tsx | pure -import { Application } from '@nocobase/client'; - -const app = new Application(); - -const App = app.getRootComponent(); -``` - -### app.mount() - -将应用实例挂载在一个容器元素中。 - -- 类型 - -```tsx | pure -class Application { - mount(containerOrSelector: Element | ShadowRoot | string): ReactDOM.Root -} -``` - -- 示例 - -```tsx | pure -import { Application } from '@nocobase/client'; - -const app = new Application(); - -app.mount('#root'); -``` - -### app.addProvider() - -添加 `Provider` 上下文。 - -- 类型 - -```tsx | pure -class Application { - addProvider(component: ComponentType, props?: T): void; -} -``` - -- 详细信息 - -第一个参数是组件,第二个参数是组件的参数。注意 `Provider` 一定要渲染 `children`。 - -- 示例 - -```tsx | pure -// 场景1:第三方库,或者自己创建的 Context -const MyContext = createContext({}); -app.addProvider(MyContext.provider, { value: { color: 'red' } }); -``` - -```tsx -import { createContext, useContext } from 'react'; -import { Application, Plugin } from '@nocobase/client'; - -const MyContext = createContext(); - -const HomePage = () => { - const { color } = useContext(MyContext) || {}; - return
home page
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.addProvider(MyContext.Provider, { value: { color: 'red' } }); - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -```tsx | pure -// 场景2:自定义的组件,注意 children -const GlobalDemo = ({ name, children }) => { - return
-
hello, { name }
-
{ children }
-
-} -app.addProvider(GlobalDemo, { name: 'nocobase' }); -``` - - -```tsx -import { Application, Plugin } from '@nocobase/client'; - -const GlobalDemo = ({ name, children }) => { - return
-
hello, { name }
-
{ children }
-
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.addProvider(GlobalDemo, { name: 'nocobase' }); - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - - -### app.addProviders() - -添加多个 `Provider` 上下文。 - -- 类型 - -```tsx | pure -class Application { - addProviders(providers: (ComponentType | [ComponentType, any])[]): void; -} -``` - -- 详细信息 - -一次添加多个 `Provider`。 - -- 示例 - -```tsx | pure -app.addProviders([[MyContext.provider, { value: { color: 'red' } }], [GlobalDemo, { name: 'nocobase' }]]) -``` - -### app.addComponents() - -添加全局组件。 - -全局组件可以使用在 [RouterManager](/core/application/router-manager) 和 [UI Schema](/core/ui-schema/schema-component)上。 - -- 类型 - -```tsx | pure -class Application { - addComponents(components: Record): void; -} -``` - -- 示例 - -```tsx | pure -app.addComponents({ Demo, Foo, Bar }) -``` - -### app.addScopes() - -添加全局的 scope。 - -全局组 scope 可以 [UI Schema](/core/ui-schema/schema-component) 上。 - -- 类型 - -```tsx | pure -class Application { - addScopes(scopes: Record): void; -} -``` - -- 示例 - -```tsx | pure -function useSomeThing() {} -const anyVar = ''; - -app.addScopes({ useSomeThing, anyVar }) -``` - -## Hooks - -### useApp() - -获取当前应用的实例。 - -- 类型 - -```tsx | pure -const useApp: () => Application -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const app = useApp(); - return
{ JSON.stringify(app.router.getRouters()) }
-} -``` - -```tsx -import { Application, Plugin, useApp } from '@nocobase/client'; - -const HomePage = () => { - const app = useApp(); - return
{ JSON.stringify(app.router.getRoutes()) }
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` diff --git a/packages/core/client/docs/en-US/core/application/plugin-manager.md b/packages/core/client/docs/en-US/core/application/plugin-manager.md deleted file mode 100644 index 342420f32..000000000 --- a/packages/core/client/docs/en-US/core/application/plugin-manager.md +++ /dev/null @@ -1,122 +0,0 @@ -# PluginManager - -用于管理插件。 - -```tsx | pure -class PluginManager { - add(plugin: typeof Plugin, opts?: PluginOptions): Promise - - get(PluginClass: T): InstanceType; - get(name: string): T; -} -``` - -## 实例方法 - -### pluginManager.add() - -将插件添加到应用中。 - -- 类型 - -```tsx | pure -class PluginManager { - add(plugin: typeof Plugin, opts?: PluginOptions): Promise -} -``` - -- 详细信息 - -第一个参数是插件类,第二个则是实例化时传递的参数。前面已经讲过会在添加插件后,立即调用 `afterAdd` 钩子函数,所以返回的是 `Promise`。 - -对于远程组件而言,会自动传递一个 `name` 参数。 - -- 示例 - -```tsx | pure -class MyPluginA extends Plugin { - async load() { - console.log('options', this.options) - console.log('app', this.app); - console.log('router', this.app.router, this.router); - } -} - -class MyPluginB extends Plugin { - // 需要在 afterAdd 执行添加的方法 - async afterAdd() { - // 通过 `app.pluginManager.add()` 添加插件时,第一个参数是插件类,第二个参数是实例化时传递的参数 - this.app.pluginManager.add(MyPluginA, { name: 'MyPluginA', hello: 'world' }) - } -} - -const app = new Application({ - plugins: [MyPluginB], -}); -``` - -### pluginManager.get() - -获取插件实例。 - -- 类型 - -```tsx | pure -class PluginManager { - get(PluginClass: T): InstanceType; - get(name: string): T; -} -``` - -- 详细信息 - -可以通过 Class 获取插件示例,如果在插件注册的时候有 name,也可以通过字符串的 name 获取。 - -如果是远程插件,会自动传入 name,值为 package 的 name。 - -- 示例 - -```tsx | pure -import MyPluginA from 'xxx'; - -class MyPluginB extends Plugin { - async load() { - // 方式1:通过 Class 获取 - const myPluginA = this.app.pluginManager.get(MyPluginA); - - // 方式2:通过 name 获取(添加的时候要传递 name 参数) - const myPluginA = this.app.pluginManager.get('MyPluginA'); - } -} -``` - -## Hooks - -获取插件实例,等同于 `pluginManager.get()`。 - -### usePlugin() - -```tsx | pure -function usePlugin(plugin: T): InstanceType; -function usePlugin(name: string): T; -``` - -- 详细信息 - -可以通过 Class 获取插件示例,如果在插件注册的时候有 name,也可以通过字符串的 name 获取。 - -- 示例 - -```tsx | pure -import { usePlugin } from '@nocobase/client'; - -const Demo = () => { - // 通过 Class 获取 - const myPlugin = usePlugin(MyPlugin); - - // 通过 name 获取(添加的时候要传递 name 参数) - const myPlugin = usePlugin('MyPlugin'); - - return
-} -``` diff --git a/packages/core/client/docs/en-US/core/application/plugin-settings-manager.md b/packages/core/client/docs/en-US/core/application/plugin-settings-manager.md deleted file mode 100644 index 34e6f8c67..000000000 --- a/packages/core/client/docs/en-US/core/application/plugin-settings-manager.md +++ /dev/null @@ -1,269 +0,0 @@ -# PluginSettingsManager - -![](../static/plugin-settings.jpg) - -用于管理插件配置页面,其底层对应着 [RouterManager](/core/application/router-manager)。 - -```tsx | pure -interface PluginSettingOptionsType { - title: string; - /** - * @default `Outlet` - */ - Component?: ComponentType | string; - icon?: string; - /** - * sort, the smaller the number, the higher the priority - * @default 0 - */ - sort?: number; - aclSnippet?: string; -} - -interface PluginSettingsPageType { - label?: string; - title: string; - key: string; - icon: any; - path: string; - sort?: number; - name?: string; - isAllow?: boolean; - topLevelName?: string; - aclSnippet: string; - children?: PluginSettingsPageType[]; -} - -class PluginSettingsManager { - add(name: string, options: PluginSettingOptionsType): void - get(name: string, filterAuth?: boolean): PluginSettingsPageType; - getList(filterAuth?: boolean): PluginSettingsPageType[] - has(name: string): boolean; - remove(name: string): void; - getRouteName(name: string): string - getRoutePath(name: string): string; - hasAuth(name: string): boolean; -} -``` - -## 实例方法 - -### pluginSettingsManager.add() - -添加插件配置页。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - add(name: string, options: PluginSettingOptionsType): void -} -``` - -- 详细解释 - -第一个参数 `name`,是路由唯一标识,用于后续的删改查,并且 `name` 支持 `.` 用于分割层级,不过需要注意当使用 `.` 分层的时候,父级要使用 [Outlet](https://reactrouter.com/en/main/components/outlet),让子元素能正常渲染。 - -第二个参数中 `Component` 支持组件形式和字符串形式,如果是字符串组件,要先通过 [app.addComponents](/core/application/application#appaddcomponents) 进行注册,具体参考 [RouterManager](/core/application/router-manager)。 - -- 示例 - -单层级配置。 - -```tsx | pure -const HelloSettingPage = () => { - return
hello setting page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.add('hello', { - title: 'Hello', // menu title and page title - icon: 'ApiOutlined', // menu icon - Component: HelloSettingPage - }) - } -} -``` - -多层级配置。 - -```tsx | pure -// 多层级配置页 - -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.add('hello', { - title: 'HelloWorld', - icon: '', - // Component: Outlet, 默认为 react-router-dom 的 Outlet 组件,可自定义 - }) - - this.app.pluginSettingsManager.add('hello.demo1', { - title: 'Demo1 Page', - Component: () =>
Demo1 Page Content
- }) - - this.app.pluginSettingsManager.add('hello.demo2', { - title: 'Demo2 Page', - Component: () =>
Demo2 Page Content
- }) - } -} -``` - -### pluginSettingsManager.get() - -获取配置信息。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - get(name: string, filterAuth?: boolean): PluginSettingsPageType; -} -``` - -- 详细解释 - -第一个是在添加时的 name 参数,第二个参数是是否在获取的时候进行权限过滤。 - -- 示例 - -在组件中获取。 - -```tsx | pure -const Demo = () => { - const app = useApp(); - const helloSettingPage = this.app.pluginSettingsManager.get('hello'); -} -``` - -在插件中获取。 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const helloSettingPage = this.app.pluginSettingsManager.get('hello') - const helloSettingPage = this.app.pluginSettingsManager.get('hello', false); - - const mobileAppConfigPage = this.app.pluginSettingsManager.get('mobile.app') - } -} -``` - -### pluginSettingsManager.getList() - -获取插件配置页列表。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getList(filterAuth?: boolean): PluginSettingsPageType[] -} -``` - -- 详细解释 - -`filterAuth` 默认值为 `true`,即进行权限过滤。 - -- 示例 - -```tsx | pure -const Demo = () => { - const app = useApp(); - const settings = app.pluginSettingsManager.getList(); - const settings = app.pluginSettingsManager.getList(false); -} -``` - -### pluginSettingsManager.has() - -判断是否存在,内部已进行权限过滤。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - has(name: string): boolean; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.has('hello'); - } -} -``` - -### pluginSettingsManager.remove() - -移除配置。 - -```tsx | pure -class PluginSettingsManager { - remove(name: string): void; -} -``` - -### pluginSettingsManager.getRouteName() - -获取对应路由的名称。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getRouteName(name: string): string -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const helloRouteName = this.pluginSettingsManager.getRouteName('hello'); // admin.settings.hello - } -} -``` - -### pluginSettingsManager.getRoutePath() - -获取插件配置对应的页面路径。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getRoutePath(name: string): string; -} -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const navigate = useNavigate(); - const app = useApp(); - const helloSettingPath = app.pluginSettingsManager.getRoutePath('hello'); - - return
navigate(helloSettingPath)}> - go to hello setting page -
-} -``` - -### pluginSettingsManager.hasAuth() - -单独判断是否权限。 - -```tsx | pure -class PluginSettingsManager { - hasAuth(name: string): boolean; -} -``` diff --git a/packages/core/client/docs/en-US/core/application/plugin.md b/packages/core/client/docs/en-US/core/application/plugin.md deleted file mode 100644 index 5bfcfe42c..000000000 --- a/packages/core/client/docs/en-US/core/application/plugin.md +++ /dev/null @@ -1,89 +0,0 @@ -# Plugin - -Plugin 基类。 - -- 类型 - -```tsx | pure -class Plugin { - constructor( - protected options: T, - protected app: Application, - ) { - this.options = options; - this.app = app; - } - - get pluginManager() { - return this.app.pluginManager; - } - - get router() { - return this.app.router; - } - - get pluginSettingsManager() { - return this.app.pluginSettingsManager; - } - - get schemaInitializerManager() { - return this.app.schemaInitializerManager; - } - - get schemaSettingsManager() { - return this.app.schemaSettingsManager; - } - - get dataSourceManager() { - return this.app.dataSourceManager; - } - - async afterAdd() {} - - async beforeLoad() {} - - async load() {} -} -``` - -- 详细信息 - - - 构造函数 - - `options`: 插件的添加有两种方式,一种方式从插件列表中远程加载出来,另一种方式是通过 [PluginManager](/core/application/plugin-manager) 添加 - - 远程加载:`options` 会被自动注入 `{ name: 'npm package.name' }` - - PluginManager `options` 由用户自己传递 - - `app`:此参数是自动注入的,是应用实例 - - 快捷访问:基类提供了对 `app` 部分方法和属性的快捷访问 - - `pluginManager` - - `router` - - `pluginSettingsManager` - - `schemaSettingsManager` - - `schemaInitializerManager` - - 声明周期 - - `afterAdd`:插件被添加后立即执行 - - `beforeLoad`:执行渲染时执行,在 `afterAdd` 之后,`load` 之前 - - `load`:最后执行 -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - - async afterAdd() { - console.log('afterAdd') - } - - async beforeLoad() { - console.log('beforeLoad') - } - - async load() { - console.log('load') - - // 可以访问应用实例 - console.log(this.app) - - // 访问应用实例内容 - console.log(this.app.router, this.router); - } -} -``` diff --git a/packages/core/client/docs/en-US/core/application/router-manager.md b/packages/core/client/docs/en-US/core/application/router-manager.md deleted file mode 100644 index ef707219c..000000000 --- a/packages/core/client/docs/en-US/core/application/router-manager.md +++ /dev/null @@ -1,386 +0,0 @@ -# RouterManager - -用于管理路由。 - -```tsx | pure -import { ComponentType } from 'react'; -import { RouteObject } from 'react-router-dom'; - -interface RouteType extends Omit { - Component?: ComponentType | string; -} - -class RouterManager { - add(name: string, route: RouteType): void; - getRoutes(): Record; - getRoutesTree(): RouteObject[]; - get(name: string): RouteType; - has(name: string): boolean; - remove(name: string): void; - setType(type: 'browser' | 'memory' | 'hash'): void; - setBasename(basename: string): void; -} -``` - -## 实例方法 - -### router.add() - -添加一条路由。 - -- 类型 - -```tsx | pure -class RouterManager { - add(name: string, route: RouteType): void -} -``` - -- 详情 - -第一个参数 `name`,是路由唯一标识,用于后续的删改查,并且 `name` 支持 `.` 用于分割层级,不过需要注意当使用 `.` 分层的时候,父级要使用 [Outlet](https://reactrouter.com/en/main/components/outlet),让子元素能正常渲染。 - -第二个参数 `RouteType` 的 `Component` 支持组件形式和字符串形式,如果是字符串组件,要先通过 [app.addComponents](/core/application/application#appaddcomponents) 进行注册。 - -- 示例 - -单层级路由。 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - this.app.router.add('login', { - path: '/login', - element:
login page
- }) - } -} -``` - -```tsx -import { useNavigate } from 'react-router-dom'; -import { Plugin, Application } from '@nocobase/client'; - -const HomePage = () => { - const navigate = useNavigate(); - return
-
home page
- -
-} - -const LoginPage = () => { - const navigate = useNavigate(); - return
-
login page
- -
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - this.app.router.add('login', { - path: '/login', - Component: LoginPage - }) - } -} - - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -多层级路由。 - -```tsx | pure -import { Plugin } from '@nocobase/client'; -import { Outlet } from 'react-router-dom'; - -const AdminLayout = () =>{ - return
-
This is admin layout
- -
-} - -const AdminSettings = () => { - return
This is admin settings page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('admin', { - path: '/admin', - Component: AdminLayout - }) - this.app.router.add('admin.settings', { - path: '/admin/settings', - Component: AdminSettings , - }) - } -} -``` - - -```tsx -import { useNavigate, Outlet } from 'react-router-dom'; -import { Plugin, Application } from '@nocobase/client'; - -const AdminLayout = () =>{ - return
-
This is admin layout
- -
-} - -const AdminSettings = () => { - return
This is admin settings page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('admin', { - path: '/admin', - Component: AdminLayout - }) - this.app.router.add('admin.settings', { - path: '/admin/settings', - Component: AdminSettings , - }) - } -} - - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/admin/settings'], - } -}); - -export default app.getRootComponent(); -``` - -`Component` 参数为字符串。 - -```tsx | pure -const LoginPage = () => { - return
login page
-} - -class MyPlugin extends Plugin { - async load() { - // 通过 app.addComponents 进行注册 - this.app.addComponents({ LoginPage }) - - this.app.router.add('login', { - path: '/login', - Component: 'LoginPage', // 这里可以使用字符串了 - }) - } -} -``` - -### router.getRoutes() - -获取路由列表。 - -- 类型 - -```tsx | pure -class RouterManager { - getRoutes(): Record -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - console.log(this.app.router.getRoutes()); - } -} -``` - -![](../static/CxjJbp0pcogYn6xviVyc6QT8nUg.png) - -### router.getRoutesTree() - -获取用于 [useRoutes()](https://reactrouter.com/hooks/use-routes) 的数据。 - -- 类型 - -```tsx | pure -class RouterManager { - getRoutesTree(): RouteObject[] -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const routes = this.app.router.getRoutesTree(); - } -} -``` - -### router.get() - -获取单个路由配置。 - -- 类型 - -```tsx | pure -class RouterManager { - get(name: string): RouteType -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const adminRoute = this.app.router.get('admin') - const adminSettings = this.app.router.get('admin.settings') - } -} -``` - -### router.has() - -判断是否添加过路由。 - -- 类型 - -```tsx | pure -class RouterManager { - has(name: string): boolean; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasAdminRoute = this.app.router.has('admin') - const hasAdminSettings = this.app.router.has('admin.settings') - } -} -``` - -### router.remove() - -移除路由配置。 - -- 类型 - -```tsx | pure -class RouterManager { - remove(name: string): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.remove('admin') - this.app.router.remove('admin.settings') - } -} -``` - -### router.setType() - -设置路由类型,默认为 `browser`。 - - -- 类型 - -```tsx | pure -class RouterManager { - setType(type: 'browser' | 'memory' | 'hash'): void; -} -``` - -- 详细解释 - - browser: [BrowserRouter](https://reactrouter.com/en/main/router-components/browser-router) - - memory: [MemoryRouter](https://reactrouter.com/en/main/router-components/hash-router) - - hash: [HashRouter](https://reactrouter.com/en/main/router-components/memory-router) - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.setType('hash') - } -} -``` - -### router.setBasename() - -设置 [basename](https://reactrouter.com/en/main/router-components/browser-router#basename)。 - -- 类型 - -```tsx | pure -class RouterManager { - setBasename(basename: string): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.setBasename('/') - } -} -``` - -## Hooks - -### useRouter() - -获取当前路由的实例,等同于 `app.router`。 - -- 类型 - -```tsx | pure -const useRouter: () => RouterManager -``` - -- 示例 - -```tsx | pure -import { useRouter } from '@nocobase/client'; - -const Demo = () => { - const router = useRouter(); -} -``` diff --git a/packages/core/client/docs/en-US/core/data-block/collection-record-provider.md b/packages/core/client/docs/en-US/core/data-block/collection-record-provider.md deleted file mode 100644 index 0cfad105f..000000000 --- a/packages/core/client/docs/en-US/core/data-block/collection-record-provider.md +++ /dev/null @@ -1,259 +0,0 @@ -# CollectionRecordProvider - -用于提供 [CollectionRecord](./collection-record) 实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface CollectionRecordProviderProps { - isNew?: boolean; - record?: CollectionRecord | DataType; - parentRecord?: CollectionRecord | DataType; - /** - * 当前记录所属的 collection name - */ - collectionName?: string; -} -``` - -- 详解 - -参数的具体说明参见 [CollectionRecord](./collection-record)。 - -需要说明的是 `record` 和 `parentRecord` 即可以是普通的对象,也可以是 [CollectionRecord](./collection-record) 实例,但最终会转为 `CollectionRecord` 实例,并通过 context 传递给子组件。 - -## 示例 - -- record 参数为 CollectionRecord 实例 - -```tsx | pure -import { CollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - - -// 最终向子组件传递的数据为: props.record -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为普通对象 - -```tsx | pure - -// 最终向子组件传递的数据为: const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为 CollectionRecord 实例且带有父记录 - -```tsx | pure -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' }, parentRecord }); - - -// 最终向子组件传递的数据为: props.record -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' }, parentRecord }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为 CollectionRecord 实例,父记录通过 `parentRecord` 参数传递 - -```tsx | pure -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - - - -// 首先设置父记录:record.setParentRecord(parentRecord); -// 最终向子组件传递的数据为:record(带有父记录) -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为普通对象,父记录也是普通对象 - -```tsx | pure - - -// 首先实例化父记录:const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -// 然后实例化记录:const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); -// 最后设置父记录:record.setParentRecord(parentRecord); -// 最终向子组件传递的数据为:record(带有父记录) -``` - - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -## Hooks - -### useCollectionRecord() - -用于获取 `CollectionRecordProvider` 组件传递的数据记录。 - -- 示例 - -```tsx | pure -const record = useCollectionRecord(); - -console.log(record, record.data, record.parentRecord, record.parentRecord.data); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
-
record:
{JSON.stringify(record, null, 2)}
-
record.data:
{JSON.stringify(record.data, null, 2)}
-
record.parentRecord:
{JSON.stringify(record.parentRecord, null, 2)}
-
record.parentRecord.data:
{JSON.stringify(record.parentRecord.data, null, 2)}
-
; -} - -export default () => -``` - -### useCollectionRecordData() - -直接获取 CollectionRecord 的 `data` 属性,等同于 `useCollectionRecord().data`。 - -- 示例 - -```tsx | pure -const data = useCollectionRecordData(); -const record = useCollectionRecord(); -console.log(data === record.data); -``` - -```tsx -import { useCollectionRecord, useCollectionRecordData, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const data = useCollectionRecordData(); - const record = useCollectionRecord(); - return
-
data === record.data: { JSON.stringify(data === record.data) }
-
data:
{JSON.stringify(data, null, 2)}
-
record.data:
{JSON.stringify(record.data, null, 2)}
-
; -} - -export default () => -``` - -### useCollectionParentRecord() - -直接获取 CollectionRecord 的数据 `parentRecord`,等同于 `useCollectionRecord().parentRecord`。 - -- 示例 - -```tsx | pure -const parentRecord = useCollectionParentRecord(); -const record = useCollectionRecord(); -console.log(parentRecord === record.parentRecord); -``` - -```tsx -import { useCollectionRecord, useCollectionParentRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - const parentRecord = useCollectionParentRecord(); - return
-
parentRecord === record.parentRecord: { JSON.stringify(parentRecord === record.parentRecord) }
-
parentRecord:
{JSON.stringify(parentRecord, null, 2)}
-
record.parentRecord:
{JSON.stringify(record.parentRecord, null, 2)}
-
; -} - -export default () => -``` - - -### useCollectionParentRecordData() - -直接获取 CollectionRecord 的数据 `parentRecord.data`,等同于 `useCollectionRecord().parentRecord.data`。 - -- 示例 - -```tsx | pure -const record = useCollectionRecord(); -const parentData = useCollectionParentRecordData(); -const parentRecord = useCollectionParentRecord(); -console.log(parentData === parentRecord.data === record.parentRecord.data); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider, useCollectionParentRecordData, useCollectionParentRecord } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - const parentData = useCollectionParentRecordData(); - const parentRecord = useCollectionParentRecord(); - return
-
parentData:
{JSON.stringify(parentData, null, 2)}
-
parentRecord.data:
{JSON.stringify(parentRecord.data, null, 2)}
-
record.parentRecord.data:
{JSON.stringify(record.parentRecord.data, null, 2)}
-
; -} - -export default () => -``` diff --git a/packages/core/client/docs/en-US/core/data-block/collection-record.md b/packages/core/client/docs/en-US/core/data-block/collection-record.md deleted file mode 100644 index d2bc6ffa4..000000000 --- a/packages/core/client/docs/en-US/core/data-block/collection-record.md +++ /dev/null @@ -1,194 +0,0 @@ -# CollectionRecord - -数据表中的一条记录。 - -## 类型 - -```tsx | pure -interface CollectionRecordOptions { - isNew?: boolean; - data?: DataType; - parentRecord?: CollectionRecord; - /** - * 当前记录所属的 collection name - */ - collectionName?: string; -} - -class CollectionRecord { - public isNew?: boolean; - public data?: DataType; - public parentRecord?: CollectionRecord; - public collectionName?: string; - constructor(options: CollectionRecordOptions) {} - - setData(data: DataType) { - this.data = data; - } - - setParentRecord(parentRecord: CollectionRecord) { - this.parentRecord = parentRecord; - } -} -``` - -## 详解 - -### CollectionRecord 基本概念 - -CollectionRecord 类用于提供数据记录,通常情况下对应着后端数据表中的一条记录。以用户表为例,其一条数据对应的 CollectionRecord 类如下: - -```tsx | pure -const useCollectionRecord = new CollectionRecord({ - data: { - "id": 1, - "roleId": 10, - "appLang": null, - "createdById": null, - "email": "test@nocobase.com", - "nickname": "Admin", - "phone": null, - "systemSettings": {}, - "updatedById": null, - "username": "nocobase", - "createdAt": "2023-12-04T09:42:52.953Z", - "updatedAt": "2023-12-04T09:42:52.953Z", - } -}); -``` - -### CollectionRecord 和 Collection 的关系 - -CollectionRecord 是指的数据,而 Collection 则是表结构。对于上面的用户表,其对应的 Collection 如下: - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - fields: [ - { - type: 'bigInt', - name: 'id', - }, - { - type: 'string', - name: 'username', - }, - { - type: 'integer', - name: 'age', - }, - { - "name": "email", - "type": "string", - }, - // .... - ], -}); -``` - -### 父子关系和关系字段 - -对于[关系字段](https://docs.nocobase.com/development/server/collections/association-fields),例如用户和角色的关系,在用户表中会有一个 `roleId` 字段,其值为角色表中的 `id`,当我们通过 `users.roleId` 字段查询用户的角色时: - -```bash | pure -GET /api/users/1/roles:get/10 -``` - -其中 `1` 为用户的 `id`,`10` 为角色的 `id`,我们可以得到用户的角色数据: - -```tsx | pure -const roleRecord = new CollectionRecord({ - data: { - "id": 10, - "name": "member", - "title": "test role", - "strategy": { - "actions": [ - "view", - "update:own", - "destroy:own", - "create" - ] - }, - "createdAt": "2023-03-30T07:53:10.924Z", - "updatedAt": "2023-12-15T02:51:43.577Z", - } -}) -``` - -其中 `users` id 为 1 的记录我们称之为父记录: - -```tsx | pure -roleRecord.setParentRecord(userRecord); -``` - -### 新记录 - -对于新表单,我们可以通过 `isNew` 属性来标识: - -```tsx | pure -const record = new CollectionRecord({ - isNew: true, -}); -``` - -## 示例 - -### 基本使用 - -```tsx | pure -import { CollectionRecord } from '@nocobase/client'; - -const record = new CollectionRecord({ - data: { - name: 'foo', - } -}); -``` - -### 创建空记录 - -```tsx | pure -import { CollectionRecord } from '@nocobase/client'; - -const record = new CollectionRecord({ - isNew: true, -}); -``` - -### 设置 parentRecord - -方式1: 通过构造函数设置 - -```tsx | pure -const parentRecord = new CollectionRecord({ - data: { - foo: 'foo', - } -}); - -const record = new CollectionRecord({ - data: { - name: 'bar', - }, - parentRecord, -}); -``` - -方式2: 通过 `setParentRecord` 方法设置 - -```tsx | pure -const parentRecord = new CollectionRecord({ - data: { - foo: 'foo', - } -}); - -const record = new CollectionRecord({ - data: { - name: 'bar', - } -}); - -record.setParentRecord(parentRecord); -``` diff --git a/packages/core/client/docs/en-US/core/data-block/data-block-provider.md b/packages/core/client/docs/en-US/core/data-block/data-block-provider.md deleted file mode 100644 index 6aeaec049..000000000 --- a/packages/core/client/docs/en-US/core/data-block/data-block-provider.md +++ /dev/null @@ -1,246 +0,0 @@ -# DataBlockProvider - -## 区块类型 - -区块分为简单区块和包含各种数据的区块。 - -### 简单区块 - -简单区块例如 Markdown 区块。 - -![](./images/markdown-block.png) - -它只有文本内容,没有其他更多复杂数据,且文本内容是存储在 `schema` 中的,没有存储在数据库中。 - -```json {5}| pure -{ - "type": "void", - "x-component": "Markdown.Void", - "x-component-props": { - "content": "markdown content" - }, -} -``` - -### 数据区块 - -数据区块是指区块的数据存储在服务端的数据表中,例如 Table 组件。 - -![](./images/data-block.png) - -Table 中的字段信息及列表数据,都是存储在数据库中的。 - - -## DataBlockProvider 介绍 - -为了方便对数据区块的数据进行管理,我们提供了 `DataBlockProvider` 组件,其内部封装了: - -- `DataBlockProvider`:封装了下面的所有组件,并提供了区块属性 - - [CollectionProvider](/core/data-source/collection-provider) / [AssociationProvider](/core/data-source/association-provider): 根据 `DataBlockProvider` 提供的上下文信息,查询对应数据表数据及关系字段信息并传递 - - [BlockResourceProvider](/core/data-block/data-block-resource-provider): 根据 `DataBlockProvider` 提供的上下文信息,构建区块 [Resource](https://docs.nocobase.com/api/sdk#resource-action) API,用于区块数据的增删改查 - - [BlockRequestProvider](/core/data-block/data-block-request-provider): 根据 `DataBlockProvider` 提供的上下文信息,自动调用 `BlockResourceProvider` 提供的 `resource.get()` 或 `resource.list()` 发起请求,得到区块数据,并传递 - - [CollectionRecordProvider](/core/data-source/record-provider): 对于 `resource.get()` 场景,会自动嵌套 `CollectionRecordProvider` 并将 `resource.get()` 请求结果传递下去,`resource.list()` 场景则需要自行使用 `CollectionRecordProvider` 提供数据记录 - -```tsx | pure -const DataBlockProvider = (props) => { - return - - / - - - {action !== 'list' && - {props.children} - } - - / - - - -} -``` - -上述组件封装到 `DataBlockProvider` 的内部,只需要使用 `DataBlockProvider` 即可自行得到上述数据。 - -### 使用方式 - -其主要使用在区块的 schema [x-decorator](https://docs.nocobase.com/development/client/ui-schema/what-is-ui-schema#x-decorator) 中,例如: - -```js {5}| pure -{ - type: 'void', - name: 'hello-block', - 'x-component': 'CardItem', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - dataSource: 'main', - action: 'list', - tableProps: { - bordered: true, - } - }, - 'x-use-decorator-props': 'useDynamicDataBlockProps', -} -``` - -### 完整示例 - - - -## 属性 - -### 静态属性和动态属性 - -- schema 中的 `x-decorator-props` 称为静态属性,它是一个普通对象,记录区块的配置信息 -- schema 中的 `x-use-decorator-props` 中的属性称为动态属性,它是一个 React hook,可用于获取例如 URL 上的 ID,或者父级的 context 数据 - -当两者都存在时,会进行深度合并,作为 `DataBlockProvider` 的属性。 - -### 属性详解 - -```ts | pure -interface AllDataBlockProps { - collection?: string; - association?: string; - sourceId?: string | number; - record?: Record; - action?: 'list' | 'get'; - filterByTk?: string; - params?: Record; - parentRecord?: Record; - [index: string]: any; -} -``` - -- collection(`x-decorator-props`):区块的 collection 表名,用于获取区块的字段信息和区块数据 -- association(`x-decorator-props`):区块的关系字段名,用于获取区块的关系字段信息和关系字段数据 -- dataSource(`x-decorator-props`): 数据源,具体可参考 [Data Modeling](https://docs.nocobase.com/manual/data-modeling) -- action(`x-decorator-props`):区块的请求类型,`list` 或 `get` -- params(`x-decorator-props` 和 `x-use-decorator-props`):区块的请求参数,同时存在于 -- filterByTk(`x-use-decorator-props`):相当于 `params.filterByTk`,可理解为 `id`,用于获取单条数据 -- sourceId(`x-use-decorator-props`):区块的 sourceId,配合 `association` 使用,用于获取区块的关系字段数据 -- record(`x-use-decorator-props`):当提供 `record` 时,会使用 `record` 作为区块的数据,不发起请求 -- parentRecord(`x-use-decorator-props`):当提供 `parentRecord` 时,会使用 `parentRecord` 作为关系字段的表数据,不发起请求 - -```tsx | pure -const DataBlockProvider = (props) => { - return - - / - - - {action !== 'list' && - {props.children} - } - - - - - -} -``` - -### 属性组合和场景 - -这些属性根据不同的场景,共有 8 中情况: - -- collection - - 创建:`collection` - - 获取单条数据:`collection` + `action: get` + `params` - - 获取列表数据:`collection` + `action: list` + `params` - - 使用 `record` 作为数据:`collection` + `record` - -对于 *获取单条数据* 和 *获取列表数据* `params` 非必须。 - -- association - - 创建:`association` + `sourceId` - - 获取单条数据:`association` + `sourceId` + `action: get` + `params` + `parentRecord` - - 获取列表数据:`association` + `sourceId` + `action: list` + `params` + `parentRecord` - - 使用 `record` 作为数据:`association` + `sourceId` + `record` + `parentRecord` - - -对于 *获取单条数据* 和 *获取列表数据* `params` 和 `parentRecord` 非必须,当没有 `parentRecord` 会根据 `association` 查询到对应的 `collection`,然后再根据 `collection` 查询到对应的 `parentRecord`。 - -### 属性获取和修改 - -#### useDataBlock() - -可用于获取和修改 `DataBlockProvider` 的属性。 - -- 类型 - -```tsx | pure -interface Result { - props: AllDataBlockProps & T; - dn: Designable; -} -const useDataBlock: () => Result -``` - -- 详解 - -`props` 就对应着上面的 `AllDataBlockProps`。 -`dn` 是 `Designable` 对象,可用于修改 `DataBlockProvider` 的 UI schema,详细见 [Designable](/core/ui-schema/designable)。 - -- 示例 - -```tsx | pure -const { props, dn } = useDataBlock<{ tableProps: { bordered?: boolean } }>(); - -// 获取 -const checked = props.tableProps.bordered; - -// 修改 -dn.deepMerge({ - 'x-decorator-props': { - tableProps: { - bordered: !checked, - }, - }, -}); -``` - -#### useDataBlockProps() - -相当于 `useDataBlock().props`。 - -```tsx | pure -const props = useDataBlockProps<{ tableProps: { bordered?: boolean } }>(); - -const checked = props.tableProps.bordered; -``` - -## 示例 - -### collection - -#### Table list - - - -#### Form get & update - - - -#### Form create - - - -#### Form record & update - - - -### association - -association 与 collection 类似,只是需要提供 `sourceId`,我们以 `Table list` 为例。 - -#### Table list & sourceId - - - -#### Table list & parentRecord - -如果不提供 `sourceId`,则需要提供 `parentRecord`,我们以 `Table list` 为例。 - - - diff --git a/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md b/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md deleted file mode 100644 index 48b5801b3..000000000 --- a/packages/core/client/docs/en-US/core/data-block/data-block-request-provider.md +++ /dev/null @@ -1,139 +0,0 @@ -# DataBlockRequestProvider - -其内部获取到 [BlockResourceProvider](/core/data-block/data-block-resource-provider) 提供的 `resource`,根据 [BlockProvider](/core/data-block/data-block-provider) 提供的参数,自动调用 `resource.get()` 或者 `resource.list()` 获取的区块的数据,并通过 context 传递下去。 - -## 请求参数 - -请求参数是获取 `DataBlockProvider` 提供中的 `params` 和 `filterByTk`。 - -```ts | pure -const schema = { - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - 'collection': 'users', - 'action': 'list', - // 静态参数 - params: { - pageSize: 10, - } - }, - // 动态参数 - 'x-use-decorator-props': 'useDynamicDataBlockProps', -} - -const useDynamicDataBlockProps: UseDataBlockProps<'CollectionList'> = () => { - return { - params: { - size: 15, - } - } -} -``` - -会自动调用 `resource.list()` 获取数据,发起 `GET /api/users:list?pageSize=10&size=15` 的请求。 - -## Hooks - -### useDataBlockRequest() - -用于获取请求对象,一般用区块组件中。 - -```tsx | pure -const MyTable = () => { - const { data, loading } = useDataBlockRequest(); - - return ( - - ) -} -``` - -## Record - -### Get 请求 - -对于 `get` 请求,当获取到 `data` 数据后,会通过 `CollectionRecordProvider` 提供 `record` 对象,用于获取当前区块的数据。 - -```ts | pure -const schema = { - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - 'collection': 'users', - 'action': 'get', // get 请求 - }, - // 动态参数 - 'x-use-decorator-props': 'useDynamicFormProps', -} - -const useDynamicDataBlockProps: UseDataBlockProps<'CollectionGet'> = () => { - return { - params: { - filterByTk: 1, - } - } -} -``` - -会自动调用 `resource.get()` 获取数据,发起 `GET /api/users:get/1` 的请求,并通过 `CollectionRecordProvider` 提供上下文。 - -```tsx | pure -const { data } = useDataBlockRequest(); -const record = useCollectionRecord(); // record 上下文数据 - -// 相等 -record.data === data; -``` - -### List 请求 - -对于 `list` 请求则不会提供 `record` 对象,需要自己通过 `` 设置上下文。 - -```tsx | pure -const MyTable = () => { - const { data } = useDataBlockRequest(); - - return ( -
{ - return ( - - - - ) - }, - }, - ]} - pagination={{ - total: data?.meta.total, - pageSize: data?.meta.pageSize, - page: data?.meta.page, - }} - /> - ) -} - -const MyAction = () => { - const record = useCollectionRecord(); - return ( - - ) -} -``` diff --git a/packages/core/client/docs/en-US/core/data-block/data-block-resource-provider.md b/packages/core/client/docs/en-US/core/data-block/data-block-resource-provider.md deleted file mode 100644 index e94246b6c..000000000 --- a/packages/core/client/docs/en-US/core/data-block/data-block-resource-provider.md +++ /dev/null @@ -1,36 +0,0 @@ -# DataBlockResourceProvider - -根据 `DataBlockProvider` 中的 `collection`、`association`、`sourceId` 等属性,构建好 [resource](https://docs.nocobase.com/api/sdk#resource-action) 对象,方便子组件对区块数据的增删改查操作,其内置在 [DataBlockProvider](/core/data-block/data-block-provider) 中 - - -## useDataBlockResource - -用于获取当前数据块的 resource 对象。 - -- 类型 - -```ts | pure -function useDataBlockResource(): IResource -``` - -- 示例 - -```ts | pure -const resource = useDataBlockResource(); - -const onSubmit = async (values) => { - // 创建 - await resource.create({ values }); -} -``` - -```ts | pure -const resource = useDataBlockResource(); - -const onDelete = async () => { - // 删除 - await resource.destroy(); -} -``` - -可运行示例 diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx deleted file mode 100644 index 13964b35b..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import { Table, TableProps } from 'antd'; -import { SchemaComponent, UseDataBlockProps, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -const collection = 'users'; -const associationField = 'roles'; - -const association = `${collection}.${associationField}`; -const action = 'list'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - association, - action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Title', - dataIndex: 'title', - }, - { - title: 'Description', - dataIndex: 'description', - }, - ], - }; -} - -const useBlockDecoratorProps: UseDataBlockProps<'CollectionList'> = () => { - const parentRecord = { - id: 1, - username: 'Tom', - }; - return { - parentRecord, - }; -}; - -const Demo = () => { - return ; -}; - -const mocks = { - [`${collection}/1/${associationField}:${action}`]: { - data: [ - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - ], - }, -}; - -const Root = createApp( - Demo, - { - components: { MyTable }, - scopes: { useTableProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx deleted file mode 100644 index e82fde3db..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import React from 'react'; -import { Select, Table, TableProps } from 'antd'; -import { SchemaComponent, UseDataBlockProps, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; -import useUrlState from '@ahooksjs/use-url-state'; - -const collection = 'users'; -const associationField = 'roles'; - -const association = `${collection}.${associationField}`; -const action = 'list'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - association, - action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Title', - dataIndex: 'title', - }, - { - title: 'Description', - dataIndex: 'description', - }, - ], - }; -} - -const useBlockDecoratorProps: UseDataBlockProps<'CollectionList'> = () => { - const [state] = useUrlState({ userId: '1' }); - return { - sourceId: state.userId, - }; -}; - -const Demo = () => { - const [state, setState] = useUrlState({ userId: '1' }); - return ( - <> - - - - ); -}; - -const mocks = { - [`${collection}/1/${associationField}:${action}`]: { - data: [ - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - ], - }, - [`${collection}/2/${associationField}:${action}`]: { - data: [ - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - { - name: 'tester', - title: 'Tester', - description: 'Tester description', - }, - ], - }, - [`${collection}:get/1`]: { - id: 1, - username: 'Tom', - }, - [`${collection}:get/2`]: { - id: 1, - username: 'Jack', - }, -}; - -const Root = createApp( - Demo, - { - components: { MyTable }, - scopes: { useTableProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-create.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-create.tsx deleted file mode 100644 index cddd88c89..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-create.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { FC } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, notification } from 'antd'; -import { SchemaComponent, useDataBlockResource, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( -
- - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const resource = useDataBlockResource(); - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.create({ - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - onFinish, - }; -} - -const collection = 'users'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: collection, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const Demo = () => { - return ; -}; - -const mocks = { - [`${collection}:create`]: (config) => { - console.log('config.data', config.data); - return [200, { msg: 'ok' }]; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx deleted file mode 100644 index ac5ecc5e5..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx +++ /dev/null @@ -1,158 +0,0 @@ -import React, { FC, useEffect } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, Select, notification } from 'antd'; -import { - SchemaComponent, - UseDataBlockProps, - useDataBlockResource, - useCollectionRecordData, - withDynamicSchemaProps, -} from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; -import useUrlState from '@ahooksjs/use-url-state'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( -
- - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const data = useCollectionRecordData(); - const resource = useDataBlockResource(); - - const [form] = Form.useForm(); - - useEffect(() => { - form.setFieldsValue(data); - }, [data, form]); - - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.update({ - filterByTk: data.id, - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - initialValues: data, - preserve: true, - onFinish, - form, - }; -} -const useBlockDecoratorProps: UseDataBlockProps<'CollectionGet'> = () => { - const [state] = useUrlState({ id: '1' }); - return { - filterByTk: state.id, - }; -}; - -const collection = 'users'; -const action = 'get'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - collection: collection, - action: action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const Demo = () => { - const [state, setState] = useUrlState({ id: '1' }); - - return ( - <> - - - - ); -}; - -const mocks = { - [`${collection}:${action}`]: function (config) { - const { filterByTk } = config.params; - return { - data: - Number(filterByTk) === 1 - ? { - id: 1, - username: 'Bamboo', - age: 18, - } - : { - id: 2, - username: 'Mary', - age: 25, - }, - }; - }, - [`${collection}:update`]: function (config) { - console.log('config.data', config.data); - return { - data: 'ok', - }; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx deleted file mode 100644 index 98cb58170..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React, { FC, useEffect } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, notification } from 'antd'; -import { - CollectionRecordProvider, - SchemaComponent, - UseDataBlockProps, - useDataBlockResource, - useCollectionRecordData, - withDynamicSchemaProps, -} from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( -
- - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const data = useCollectionRecordData(); - const resource = useDataBlockResource(); - - const [form] = Form.useForm(); - - useEffect(() => { - form.setFieldsValue(data); - }, [data, form]); - - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.update({ - filterByTk: data.id, - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - initialValues: data, - preserve: true, - onFinish, - form, - }; -} -const useFormBlockDecoratorProps: UseDataBlockProps<'CollectionRecord'> = () => { - const record = useCollectionRecordData(); - return { - record, - }; -}; - -const collection = 'users'; -const action = 'get'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useFormBlockDecoratorProps', - 'x-decorator-props': { - collection: collection, - action: action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const recordData = { - id: 1, - username: 'Bamboo', - age: 18, -}; - -const Demo = () => { - return ( - <> - - - - - ); -}; - -const mocks = { - [`${collection}:update`]: function (config) { - console.log('config.data', config.data); - return { - data: 'ok', - }; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps, useFormBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-table-list.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-table-list.tsx deleted file mode 100644 index 6da749168..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/collection-table-list.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import { Table, TableProps } from 'antd'; -import { SchemaComponent, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - action: 'list', - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'UserName', - dataIndex: 'username', - }, - { - title: 'NickName', - dataIndex: 'nickname', - }, - { - title: 'Email', - dataIndex: 'email', - }, - ], - }; -} - -const Demo = () => { - return ; -}; - -const Root = createApp(Demo, { - components: { MyTable }, - scopes: { useTableProps }, -}); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/complete-demo.tsx b/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/complete-demo.tsx deleted file mode 100644 index 8135d9310..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/data-block-provider/complete-demo.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import React, { useMemo } from 'react'; -import { - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - useDataBlockRequest, - useCollectionManager, - useCollection, - useCompile, - useDataBlockProps, - useDataBlock, - useSchemaInitializer, - useSchemaInitializerRender, - withDynamicSchemaProps, -} from '@nocobase/client'; - -import { createApp } from '../../../data-source/demos/createApp'; -import { Table, TableProps } from 'antd'; -import { ISchema } from '@nocobase/schema'; -import { observer, useFieldSchema } from '@nocobase/schema'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-component': 'Page', - 'x-initializer': 'MyInitializer', -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { tableProps } = useDataBlockProps(); - const { data, loading } = useDataBlockRequest(); - const compile = useCompile(); - const collection = useCollection(); - const columns = useMemo(() => { - return collection.getFields().map((field) => { - return { - title: compile(field.uiSchema?.title || field.name), - dataIndex: field.name, - }; - }); - }, [collection, compile]); - return { - ...tableProps, - loading, - dataSource: data?.data || [], - columns, - }; -} - -const MyTableSettings = new SchemaSettings({ - name: 'MyTableSettings', - items: [ - { - name: 'bordered', - type: 'switch', - useComponentProps() { - const { props: blockSettingsProps, dn } = useDataBlock(); - - return { - title: 'Bordered', - checked: !!blockSettingsProps.tableProps?.bordered, - onChange: (checked) => { - // 修改 schema - dn.deepMerge({ 'x-decorator-props': { tableProps: { bordered: checked } } }); - }, - }; - }, - }, - ], -}); - -const TableDataBlockInitializer = () => { - const { insert } = useSchemaInitializer(); - const handleClick = ({ item }) => { - insert({ - type: 'void', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: item.value, - action: 'list', - tableProps: { - bordered: true, // 用于设置是否显示边框 - }, - }, - 'x-settings': 'MyTableSettings', - 'x-component': 'CardItem', - 'x-toolbar-props': { - draggable: false, - }, - properties: { - table: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, - }); - }; - const compile = useCompile(); - const collectionManager = useCollectionManager(); - const collectionMenuItems = useMemo( - () => - collectionManager.getCollections().map((collection) => { - return { - label: compile(collection.getOption('title')), - value: collection.getOption('name'), - }; - }), - [collectionManager, compile], - ); - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'table', - Component: TableDataBlockInitializer, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ; -}; - -const App = createApp(Root, { - components: { MyTable, Page }, - scopes: { useTableProps }, - schemaSettings: [MyTableSettings], - schemaInitializers: [myInitializer], -}); - -export default App; diff --git a/packages/core/client/docs/en-US/core/data-block/demos/settings/demo1.tsx b/packages/core/client/docs/en-US/core/data-block/demos/settings/demo1.tsx deleted file mode 100644 index 2bfc15af2..000000000 --- a/packages/core/client/docs/en-US/core/data-block/demos/settings/demo1.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import React from 'react'; -import { - SchemaComponent, - SchemaSettings, - useDataBlockRequest, - useDataBlock, - withDynamicSchemaProps, -} from '@nocobase/client'; - -import { createApp } from '../../../data-source/demos/createApp'; -import { Table, TableProps } from 'antd'; -import { ISchema } from '@nocobase/schema'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - action: 'list', - bordered: true, // 用于设置是否显示边框 - }, - 'x-settings': 'MyTableSettings', - 'x-component': 'CardItem', - 'x-toolbar-props': { - draggable: false, - }, - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - // 获取 - const { props } = useDataBlock(); - const { bordered } = props; - const { data, loading } = useDataBlockRequest(); - return { - bordered, - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Age', - dataIndex: 'age', - }, - { - title: 'Address', - dataIndex: 'address', - }, - ], - }; -} - -const MyTableSettings = new SchemaSettings({ - name: 'MyTableSettings', - items: [ - { - name: 'bordered', - type: 'switch', - useComponentProps() { - // 获取 - const { props: blockSettingsProps, dn } = useDataBlock(); - const { bordered } = blockSettingsProps; - - return { - title: 'Bordered', - checked: bordered, - onChange: (checked) => { - // 修改 - dn.deepMerge({ 'x-decorator-props': { bordered: checked } }); - }, - }; - }, - }, - ], -}); - -const Demo = () => { - return ; -}; - -const Root = createApp(Demo, { - components: { MyTable }, - scopes: { useTableProps }, - schemaSettings: [MyTableSettings], -}); - -export default Root; diff --git a/packages/core/client/docs/en-US/core/data-block/images/data-block.png b/packages/core/client/docs/en-US/core/data-block/images/data-block.png deleted file mode 100644 index 0ac7ee8e8..000000000 Binary files a/packages/core/client/docs/en-US/core/data-block/images/data-block.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-block/images/markdown-block.png b/packages/core/client/docs/en-US/core/data-block/images/markdown-block.png deleted file mode 100644 index 9c9c351be..000000000 Binary files a/packages/core/client/docs/en-US/core/data-block/images/markdown-block.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-source/association-provider.md b/packages/core/client/docs/en-US/core/data-source/association-provider.md deleted file mode 100644 index 97da3d3ab..000000000 --- a/packages/core/client/docs/en-US/core/data-source/association-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -# AssociationProvider - -用于传递关联数据字段以及对应的数据表信息,等同于 `CollectionFieldProvider` + `CollectionProvider`。 - -```tsx | pure -const AssociationProvider = - - {children} - - -``` - -关于关系字段的更多信息,请参考 [关系字段](https://docs.nocobase.com/development/server/collections/association-fields) 以及 [CollectionField](/core/data-source/collection-field)。 diff --git a/packages/core/client/docs/en-US/core/data-source/collection-field-interface-manager.md b/packages/core/client/docs/en-US/core/data-source/collection-field-interface-manager.md deleted file mode 100644 index b589784e5..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-field-interface-manager.md +++ /dev/null @@ -1,171 +0,0 @@ -# CollectionFieldInterfaceManager - -主要是用来管理 [CollectionFieldInterface](./collection-field-interface.md) 和 [CollectionFieldInterfaceGroups](#collectionfieldinterfacegroups),其被 [DataSourceManager](./data-source-manager) 管理。 - - -## CollectionFieldInterfaceGroups - -CollectionFieldInterfaceGroups 是用来对数据表字段进行分组的。 - -![Field Groups](./images/field-groups.png) - -## 实例方法 - -### field interface - -#### addFieldInterfaces() - -添加 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - addFieldInterfaces(fieldInterfaces: CollectionFieldInterface[]): void -} -``` - -- 示例 - -```tsx | pure -class CheckboxFieldInterface extends CollectionFieldInterface { - name = 'checkbox'; - type = 'object'; - group = 'choices'; - title = '{{t("Checkbox")}}'; - // ... -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([CheckboxFieldInterface]); - // or - this.app.dataSourceManager.addFieldInterfaces([CheckboxFieldInterface]); - } -} -``` - -#### getFieldInterface() - -获取 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterface(name: string): T; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterface = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface('checkbox'); // checkboxFieldInterface - } -} -``` - -#### getFieldInterfaces() - -获取所有的 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaces(): CollectionFieldInterface[]; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaces = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaces(); - } -} -``` - -### field interface group - -#### addFieldInterfaceGroups() - -添加 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - addFieldInterfaceGroups(fieldGroups: Record): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaceGroups({ - 'test': { - label: 'Test', - order: 1, - } - }); - - // or - this.app.dataSourceManager.addFieldInterfaceGroups({ - 'test': { - label: 'Test', - order: 1, - } - }); - } -} -``` - -#### getFieldInterfaceGroups() - -获取所有的 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaceGroups(): Record; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaceGroups = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaceGroups(); // { 'test': { label: 'Test', order: 1 } } - } -} -``` - -#### getFieldInterfaceGroup() - -获取 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaceGroup(name: string): { label: string; order?: number }; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaceGroup = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaceGroup('test'); // { label: 'Test', order: 1 } - } -} -``` diff --git a/packages/core/client/docs/en-US/core/data-source/collection-field-interface.md b/packages/core/client/docs/en-US/core/data-source/collection-field-interface.md deleted file mode 100644 index bb2c1aebf..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-field-interface.md +++ /dev/null @@ -1,94 +0,0 @@ -# CollectionFieldInterface - -用于创建数据字段。 - -![](./images/collection-field-interface.png) - -```ts -class CollectionFieldInterface { - app: Application; - collectionManager: CollectionManager; - - name: string; - group: string; - title?: string; - description?: string; - order?: number; - default?: { - type: string; - uiSchema?: ISchema; - [key: string]: any; - }; - sortable?: boolean; - availableTypes?: string[]; - hasDefaultValue?: boolean; - isAssociation?: boolean; - operators?: any[]; - filterable?: { - operators?: any[]; - children?: any[]; - [key: string]: any; - }; - titleUsable?: boolean; - - validateSchema(fieldSchema: ISchema): Record - usePathOptions(field: CollectionFieldOptions): any - schemaInitialize(schema: ISchema, data: any): void - - getOption(key: K): CollectionFieldInterfaceOptions[K] - getOptions(): CollectionFieldInterfaceOptions; - setOptions(options: CollectionFieldInterfaceOptions): void; -} -``` - -其需要结合 [CollectionManager](./collection-field-interface-manager.md) 使用。 - -```ts -class EmailFieldInterface extends CollectionFieldInterface { - name = 'email'; - type = 'object'; - group = 'basic'; - order = 4; - title = '{{t("Email")}}'; - sortable = true; - // ... -} - -class MyPlugin extends Plugin { - load() { - this.app.dataSourceManager.addFieldInterfaces([ EmailFieldInterface ]); - } -} -``` - -## 实例属性 - -### name - -唯一标识符。 - -### group - -分组。 - -### title - -标题。 - -### default - -配置表单默认值字段 schema。 - -![](./images/collection-field-interface-form.png) - - -## 实例方法 - -### collectionFieldInterface.validateSchema(fieldSchema) - - -### collectionFieldInterface.usePathOptions(field: CollectionFieldOptions) - - -### collectionFieldInterface.schemaInitialize(schema: ISchema, data: any) - diff --git a/packages/core/client/docs/en-US/core/data-source/collection-field.md b/packages/core/client/docs/en-US/core/data-source/collection-field.md deleted file mode 100644 index 3f64b94a6..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-field.md +++ /dev/null @@ -1,164 +0,0 @@ -# CollectionField - -NocoBase 将字段的 schema 分为 2 部分,一部分在 schema 中,一部分在 collection 中。例如: - -```tsx | pure -const schema = { - properties: { - username: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - }, - } -} - -const collection = { - fields: [ - { - type: 'string', - name: 'username', - interface: 'input', - uiSchema: { - title: 'UserName', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - } - ], -} -``` - -两者通过 `name: username` 联系起来,`CollectionField` 会自动读取 schema `name` 属性,并根据 `name` 属性查找 collection 中对应的 `uiSchema` 属性,然后拼接到 schema 中,进行渲染。 - -这样做的好处是,对于同一个字段创建的内容,可以在不同的地方共享同一个 schema,当 schema 变化时,只需要修改一处即可。比如通过上面的 `title: "UserName"` 假设变化 `title: "Name"` 则所有使用到此字段的地方都会变化。 - - - -## CollectionFieldOptions - -字段的配置项。 - -```ts -interface CollectionFieldOptions { - name?: any; - collectionName?: string; - sourceKey?: string; - uiSchema?: ISchema; - target?: string; - - [key: string]: any; -} -``` - -### 普通字段和关系字段 - -字段有 2 种情况,一种是普通字段,一种是 [关系字段](https://docs-cn.nocobase.com/development/server/collections/association-fields)。 - -关系字段是指,字段的值是另一个 collection 的数据,例如 `users` 和 `roles` 两个 collection,`users` 中有一个字段 `roles`,其值是 `roles` collection 的数据,那么 `roles` 就是一个关系字段。 - -普通字段的示例如下: - -```json -{ - "key": "ootprgkoawo", - "name": "email", - "type": "string", - "interface": "email", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true, - "uiSchema": { - "type": "string", - "title": "{{t(\"Email\")}}", - "x-component": "Input", - "x-validator": "email", - "required": true - } -} -``` - -关系字段的示例如下: - -```json -{ - "key": "t09bauwm0wb", - "name": "roles", - "type": "belongsToMany", - "interface": "m2m", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "target": "roles", - "foreignKey": "userId", - "otherKey": "roleName", - "onDelete": "CASCADE", - "sourceKey": "id", - "targetKey": "name", - "through": "rolesUsers", - "uiSchema": { - "type": "array", - "title": "{{t(\"Roles\")}}", - "x-component": "AssociationField", - "x-component-props": { - "multiple": true, - "fieldNames": { - "label": "title", - "value": "name" - } - } - } -} -``` - -相对于普通字段,关系字段多了以下属性: - -- xx -- xx - -### 全部字段说明 - -- `name`:字段名称 -- `collectionName`:数据表名称 -- `sourceKey`:当字段为关系字段时,对应的关系字段名称。 - -TODO:补全 - -## Hooks - -### useCollectionField() - -用于获取字段信息。 - -```tsx | pure -const collection = { - fields: [ - { - type: 'string', - name: 'username', - interface: 'input', - uiSchema: { - title: 'UserName', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - } - ], -} - -const { uiSchema } = useCollectionField() -const required = uiSchema?.required -``` - -其通常在 [SchemaSettings](/core/ui-schema/schema-settings) 中使用,用来获取和修改字段的属性。 - - - - - diff --git a/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md b/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md deleted file mode 100644 index b37a6a27f..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-manager-provider.md +++ /dev/null @@ -1,52 +0,0 @@ -# CollectionManagerProvider - -用于提供 [CollectionManager](/core/data-source/collection-manager) 实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface CollectionManagerProviderProps { - instance?: CollectionManager; - dataSource?: string; - children?: ReactNode; -} -``` - -- 参数详解 - - `dataSource` - 数据源名称,如果为空,则会取默认数据源。 - - `instance` - CollectionManager 实例,如果没有,则会取 `dataSource` 对应的 collectionManager。 - -- 示例 - -```tsx | pure -const collectionManager = new CollectionManager(); - -const Demo = () => { - return ( - -
...
-
- ); -}; -``` - -## Hooks - -### useCollectionManager() - -用于获取 `CollectionManagerProvider` 传递的实例。 - -- 示例 - -```tsx | pure -const Demo = () => { - const collectionManager = useCollectionManager(); - const collections = collectionManager.getCollections() - - return
-
{JSON.stringify(collections, null, 2)}
-
; -}; -``` diff --git a/packages/core/client/docs/en-US/core/data-source/collection-manager.md b/packages/core/client/docs/en-US/core/data-source/collection-manager.md deleted file mode 100644 index 5df92575d..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-manager.md +++ /dev/null @@ -1,175 +0,0 @@ -# CollectionManager - -用于管理 [Collection](./collection.md),其被 [DataSource](./data-source.md) 管理。 - -## 实例方法 - -### addCollections(collections) - -添加数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - addCollections(collections: CollectionOptions[]): void -} -``` - -- 示例 - -```tsx | pure -const userCollectionOptions = { - "name": "users", - "title": "Users", - fields: [ - // ... - ], -}; - -collectionManager.addCollections([userCollectionOptions]); -``` - -### setCollections(collections) - -重置数据表,会先移除所有数据表,然后再调用 `addCollections()` 添加数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - setCollections(collections: CollectionOptions[]): void -} -``` - -### reAddCollections(collections) - -由于 [CollectionTemplate](./collection-template.md) 或者 [CollectionMixins](./collection-mixins.md) 的添加会影响 Collection 的实例化,所以提供了重新添加数据表的方法。 - -- 类型 - -```tsx | pure -class CollectionManager { - reAddCollections(collectionInstances: Collection[]): void -} -``` - -- 示例 - -```tsx | pure -const userCollectionInstance = collectionManager.getCollection('users'); -collectionManager.reAddCollections([userCollectionInstance]); -``` - -### getCollections(predicate?) - -获取数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollections(predicate?: (collection: Collection) => boolean) -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollections(); // [ userCollection ] - -collectionManager.getCollections(collection => collection.name === 'posts'); // [ postCollection ] -``` - - -### getCollection(path) - -获取数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollection(path: string): (Mixins & Collection) | undefined -} -``` - -- 详细解释 - - `path` 参数可以是数据表名称,也可以是[关系字段](https://docs.nocobase.com/development/server/collections/association-fields)路径。 - - `path: 'users'`: 获取 `users` 数据表 - - `path: 'users.posts'`: 获取 `users` 数据表的 `posts` 关联字段对应的数据表,即 `postCollection` - -- 示例 - -```tsx | pure -collectionManager.getCollection('users'); // userCollection - -collectionManager.getCollection('users.posts'); // postCollection -collectionManager.getCollection('users.profileId'); // profileCollection -``` - -结合 Mixin 使用: - -```tsx | pure -const collection = collectionManager.getCollection('users'); -const collection = collectionManager.getCollection('users'); -``` - -### getCollectionFields(collectionName) - -获取数据表字段列表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionFields(collectionName: string): CollectionFieldOptions[]; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionFields('users'); // [ { name: 'username', type: 'string', title: 'Username', .. }, { name: 'password', type: 'password', title: 'Password', .. } ] -``` - -### getCollectionName(path) - -获取数据表名称。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionName(path: string: GetCollectionOptions): string | undefined; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionName('users'); // 'users' - -collectionManager.getCollectionName('users.profiles'); // 'profiles' -``` - - -### getCollectionField(path) - -获取数据表字段。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionField(path: string: GetCollectionOptions): CollectionFieldOptions | undefined; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionField('users.username'); // { name: 'username', type: 'string', title: 'Username', .. } - -collectionManager.getCollectionField('users.roles.name'); // 获取 roles 关联字段对应的 roles 表中的 name 字段 -``` diff --git a/packages/core/client/docs/en-US/core/data-source/collection-mixins.md b/packages/core/client/docs/en-US/core/data-source/collection-mixins.md deleted file mode 100644 index 6512fccc3..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-mixins.md +++ /dev/null @@ -1,57 +0,0 @@ - -## Collection Mixins - -Collection Mixins 是为扩展 Collection 类提供的一种机制,可以通过 `dataSourceManager.addCollectionMixins()` 添加 Collection Mixins。 - -### 定义和注册 - -```tsx | pure -import { Collection, Plugin } from '@nocobase/client'; - -class TestMixin extends Collection { - test() { - const { name } = this.options; - return 'test '+ name; - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([TestMixin]); - } -} -``` - -### 使用 - -- 使用方式1:在 `CollectionManager` 实例上调用 `getCollection()` 获取指定 `Collection` 实例。 - -```tsx | pure -const Demo = () => { - const cm = useCollectionManager(); - const userCollection = cm.getCollection('users'); - - userCollection.test(); // 'test users' -} -``` - -- 使用方式2:调用 `useCollection()` 获取当前上下文的数据表信息。 - -```tsx | pure -const Demo = () => { - const collection = useCollection(); - collection.test(); // 'test users' -} -``` - -### 多个 Mixins 的使用 - -如果添加了 Mixins,可通过如下方式获得类型提示: - -```tsx | pure -const Demo = () => { - const collection = useCollection(); -} -``` - - diff --git a/packages/core/client/docs/en-US/core/data-source/collection-provider.md b/packages/core/client/docs/en-US/core/data-source/collection-provider.md deleted file mode 100644 index 141187df8..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-provider.md +++ /dev/null @@ -1,63 +0,0 @@ -# CollectionProvider - -用于提供 [Collection](/core/data-source/collction) 实例。 - -## 组件 - -### CollectionProvider - -- 类型 - -```tsx | pure -interface CollectionProviderProps { - name: string; - dataSource?: string; - children?: ReactNode; -} -``` - -- 详解 - -组件会根据 `name` 去 [CollectionManager](/core/data-source/collection-manager) 中查询数据表信息,如果查询不到,则会不进行渲染。 - -`dataSource` 用于指定数据表所在的[命名空间](/core/data-source/collection-manager#datasource),如果不指定,则默认命名空间。 - -- 示例 - -```tsx | pure -import { CollectionProvider } from '@nocobase/client'; - -const MyComponent = () => { - return ( - -
...
-
- ) -} -``` - - -## Hooks - -### useCollection() - -用于获取 `CollectionProvider` 传递的 `Collection` 实例。 - -```tsx | pure -const collection = useCollection() - -console.log(collection instanceof Collection) // true -console.log(collection); -``` - -结合 Mixin 使用: - -```tsx | pure -const collection = useCollection() -const collection = useCollection() -``` - -## 示例 - - - diff --git a/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md b/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md deleted file mode 100644 index 1ff0bffea..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-template-manager.md +++ /dev/null @@ -1,86 +0,0 @@ -# CollectionTemplateManager - -用于管理 [CollectionTemplate](./collection-template),其被 [DataSourceManager](./data-source-manager) 管理。 - -## 实例方法 - -### addCollectionTemplates() - -用于添加 collection template。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - addCollectionTemplates(templates: CollectionTemplate[]): void; -} -``` - -- 示例 - -```tsx | pure -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - type = 'object'; - title = '{{t("SQL collection")}}'; - configurableProperties = { - // ... - } -} - -class TreeCollectionTemplate extends CollectionTemplate { - name = 'tree'; - type = 'object'; - title = '{{t("Tree collection")}}'; - configurableProperties = { - // ... - } -} - -class MyPlugin extends Plugin { - async load() { - this.dataSourceManager.collectionTemplateManager.addCollectionTemplates([ SqlCollectionTemplate, TreeCollectionTemplate ]); - - // or - this.dataSourceManager.addCollectionTemplates([ SqlCollectionTemplate, TreeCollectionTemplate ]); - } -} -``` - -### getCollectionTemplate() - -用于获取 collection template。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - getCollectionTemplate(name: string): CollectionTemplate; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionTemplate(); // generalCollectionTemplate - -collectionManager.getCollectionTemplate('tree'); // treeCollectionTemplate -``` - -### getCollectionTemplates() - -用于获取所有 collection templates。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - getCollectionTemplates(): CollectionTemplate[]; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionTemplates(); // [ generalCollectionTemplate, treeCollectionTemplate, sqlCollectionTemplate ] -``` diff --git a/packages/core/client/docs/en-US/core/data-source/collection-template.md b/packages/core/client/docs/en-US/core/data-source/collection-template.md deleted file mode 100644 index eb248e519..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection-template.md +++ /dev/null @@ -1,249 +0,0 @@ -# CollectionTemplate - -用于创建数据表的模板。 - -![](./images/collection-template.png) - -```ts -interface AvailableFieldInterfacesInclude { - include?: any[]; -} - -interface AvailableFieldInterfacesExclude { - exclude?: any[]; -} - -interface CollectionTemplateDefaultOptions { - /** - * 自动生成 id - * @default true - * */ - autoGenId?: boolean; - /** 创建人 */ - createdBy?: boolean; - /** 最后更新人 */ - updatedBy?: boolean; - /** 创建日期 */ - createdAt?: boolean; - /** 更新日期 */ - updatedAt?: boolean; - /** 可排序 */ - sortable?: boolean; - /* 树结构 */ - tree?: string; - /* 日志 */ - logging?: boolean; - /** 继承 */ - inherits?: string | string[]; - /* 字段列表 */ - fields?: CollectionOptions['fields']; -} - -class CollectionTemplate { - app: Application; - collectionManager: CollectionManager; - - name: string; - Collection?: typeof Collection; - transform?: (collection: CollectionOptions, app: Application) => CollectionOptions; - title?: string; - color?: string; - /** 排序 */ - order?: number; - /** 默认配置 */ - default?: CollectionTemplateDefaultOptions; - events?: any; - /** UI 可配置的 CollectionOptions 参数(添加或编辑的 Collection 表单的字段) */ - configurableProperties?: Record; - /** 当前模板可用的字段类型 */ - availableFieldInterfaces?: AvailableFieldInterfacesInclude | AvailableFieldInterfacesExclude; - /** 是否分割线 */ - divider?: boolean; - /** 模板描述 */ - description?: string; - /**配置字段中的操作按钮 */ - configureActions?: Record; - //是否禁止删除字段 - forbidDeletion?: boolean; -} -``` - -其需要结合 [CollectionManager](./collection-template-manager.md) 使用。 - -```ts -import { Plugin, Collection, CollectionTemplate } from '@nocobase/client'; - -class SqlCollection extends Collection { - otherMethods() { - // ... - } -} - -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - Collection = SqlCollection; // 自定义的数据表类 - title = '{{t("SQL collection")}}'; - order = 4; - color = 'yellow'; - default = { - fields: [], - }; - configurableProperties = { - // ... - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([ SqlCollectionTemplate ]); - - // or - this.app.dataSourceManager.addCollectionTemplates([ SqlCollectionTemplate ]); - } -} -``` - -## 实例属性 - -### name - -模板的唯一标识符。 - - -### Collection - -模板对应的数据表类。 - -在创建数据表后,Collection 会有 [template 字段](/core/data-source/collection#collectionoptions),用于标识该数据表是由哪个模板创建的。 - -当通过 `collectionManager.addCollections()` 添加数据表对象时,会先读取 `collection.template` 字段,然后通过 `collectionManager.getCollectionTemplate(collection.template)` 获取到 `collectionTemplate`。 - -读取 `collectionTemplate.Collection` 字段,并通过 `new collectionTemplate.Collection(collection)` 创建对应的实例。 - -如果不传递 `Collection`,则会通过 `new Collection(collection)` 创建对应的实例。 - -```ts -class SqlCollection extends Collection { - otherMethods() { - // ... - } -} - -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - Collection = SqlCollection; // 自定义的数据表类 - // ... -} - -const userCollection = { - name: 'users', - template: 'sql', - // ... -} - -// 内部会调用 new SqlCollection(userCollection) -``` - -### title - -模板的标题。 - -### color - -模板的颜色。 - -### order - -模板的排序。 - -### events - -- `beforeSubmit`:提交前触发 - - -### configurableProperties - -表单配置项。 - -![](./images//collection-template-form.png) - -```ts -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql', - // ... - configurableProperties = { - title: { - type: 'string', - title: '{{ t("Collection display name") }}', - required: true, - 'x-decorator': 'FormItem', - 'x-component': 'Input', - }, - name: { - type: 'string', - title: '{{t("Collection name")}}', - required: true, - 'x-disabled': '{{ !createOnly }}', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-validator': 'uid', - description: - "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}", - }, - // ... - }, -} -``` - -### default - -表单默认值。 - - - -## 实例方法 - -### collectionTemplate.transform(collection) - -collection 创建后,会调用该方法,用于对 collection 进行转换。 - -## Utils - -### getConfigurableProperties() - -用于获取内置的配置项字段。 - -- 类型 - -```tsx | pure -export type DefaultConfigurableKeys = - | 'name' - | 'title' - | 'inherits' - | 'category' - | 'autoGenId' - | 'createdBy' - | 'updatedBy' - | 'createdAt' - | 'updatedAt' - | 'sortable' - | 'description' - | 'moreOptions'; - -const getConfigurableProperties: (...keys: DefaultConfigurableKeys[]) => Record -``` - -- 示例 - -```tsx | pure -import { getConfigurableProperties } from '@nocobase/client'; - -const sqlCollectionTemplate = new CollectionTemplate({ - name: 'sql', - // ... - configurableProperties: { - ...getConfigurableProperties('name', 'title', 'description'), - // ... - }, -}); -``` diff --git a/packages/core/client/docs/en-US/core/data-source/collection.md b/packages/core/client/docs/en-US/core/data-source/collection.md deleted file mode 100644 index 5cce1e551..000000000 --- a/packages/core/client/docs/en-US/core/data-source/collection.md +++ /dev/null @@ -1,293 +0,0 @@ -# Collection - -Collection 数据表类,其被 [CollectionManager](/core/data-source/collection-manager) 管理。 - -## 类型 - -```tsx | pure -interface CollectionOptions { - name: string; - title?: string; - fields?: FieldOptions[]; - // .... -} - -class Collection { - app: Application; - collectionManager: CollectionManager; - - constructor(options: CollectionOptions) {} - - name: string; - primaryKey: string; - titleField: string; - - getOptions(): CollectionOptions; - setOptions(options: CollectionOptions): void; - getOption(key: K): CollectionOptions[K]; - - getFields(predicate?: CollectionFieldOptions | ((collection: CollectionFieldOptions) => boolean) | keyof CollectionFieldOptions): any[] - getField(name: SchemaKey): CollectionFieldOptions - hasField(name: SchemaKey): boolean; -} -``` - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - title: 'Users', - fields: [ - { - type: 'string', - name: 'username', - }, - { - type: 'integer', - name: 'age', - }, - ], -}); -``` - -## CollectionOptions - -```tsx | pure -export interface CollectionOptions { - name: string; - title?: string; - dataSource?: string; - /** - * Used for @nocobase/plugin-duplicator - * @see packages/core/database/src/collection-group-manager.tss - * - * @prop {'required' | 'optional' | 'skip'} dumpable - Determine whether the collection is dumped - * @prop {string[] | string} [with] - Collections dumped with this collection - * @prop {any} [delayRestore] - A function to execute after all collections are restored - */ - duplicator?: - | dumpable - | { - dumpable: dumpable; - with?: string[] | string; - delayRestore?: any; - }; - - tableName?: string; - inherits?: string[] | string; - inherit?: string; - key?: string; - viewName?: string; - writableView?: boolean; - - filterTargetKey?: string; - fields?: CollectionFieldOptions[]; - model?: any; - repository?: any; - sortable?: CollectionSortable; - /** - * @default true - */ - autoGenId?: boolean; - /** - * @default 'options' - */ - magicAttribute?: string; - - tree?: string; - - template?: string; - - isThrough?: boolean; - autoCreate?: boolean; - resource?: string; - collectionName?: string; - sourceKey?: string; - uiSchema?: any; - [key: string]: any; -} -``` - -- name: Collection 的标识,必须唯一。 - -- title: Collection 的标题,用于显示。 - -- fields: 字段列表,详细说明请查看 [CollectionField](/core/data-source/collection-field) - -- template: 模板标识,用于标识该 Collection 是由哪个模板创建的,详细说明请查看 [CollectionTemplate](/core/data-source/collection-template) - -- dataSource: 数据源标识,用于标识该 Collection 是由哪个数据源创建的,详细说明请查看 [CollectionDataSource](/core/data-source/collection-manager#datasource) - -- duplicator - -- tableName - -- inherits - -- viewName - -- writableView - -- filterTargetKey - -- model - -- repository - - -## 实例属性 - -### collection.collectionManager - -[CollectionManager](/core/data-source/collection-manager) 的实例。 - -### collection.titleFieldName - -标题字段的 name 属性。 - -### 其他属性 - -其他属性同 [CollectionOptions](/core/data-source/collection#collectionoptions)。 - -## 实例方法 - -### collection.getOptions() - -获取 collection 的所有配置项。 - -- 类型 - -```tsx | pure -class Collection { - getOptions(): CollectionOptions; -} -``` - -- 示例 - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - title: 'Users', - fields: [ - // ... - ], -}); - -console.log(usersCollection.getOptions()); // { name: 'users', title: 'Users', fields: [ ] } -``` - -### collection.setOptions(options) - -设置 collection 的配置项,最终会和默认配置项进行合并。 - -- 类型 - -```tsx | pure -class Collection { - setOptions(options: CollectionOptions): void; -} -``` - -- 示例 - -```tsx | pure -collection.setOptions({ - name: 'users', - title: 'Users', - fields: [ - // ... - ], -}); -``` - -### collection.getOption(key) - -获取 collection 的单个配置项。 - -- 类型 - -```tsx | pure -class Collection { - getOption(key: K): CollectionOptions[K]; -} -``` - -- 示例 - -```tsx | pure -collection.getOption('name'); // 'users' -collection.getOption('title'); // 'Users' -``` - -### collection.getFields(predicate?) - -获取 collection 的字段列表。 - -- 类型 - -```tsx | pure -class Collection { - getFields(predicate?: CollectionFieldOptions | ((collection: CollectionFieldOptions) => boolean) | keyof CollectionFieldOptions): any[] -} -``` - -- 详解 - - predicate - - 类型 - - `CollectionFieldOptions` - - `(collection: CollectionFieldOptions) => boolean` - - `keyof CollectionFieldOptions` - - 说明 - - 如果传递了 `predicate`,则返回符合条件的字段列表 - - 如果没有传递 `predicate`,则返回所有字段列表 - -`predicate` 的使用可看参考 [lodash.filter](https://www.lodashjs.com/docs/lodash.filter)。 - -- 示例 - -```tsx | pure -collection.getFields(); // [{ name: 'username', type: 'string', primaryKey: true }, { name: 'age', type: 'integer' }] - -collection.getFields({ name: 'age' }); // [{ name: 'age', type: 'integer' }] - -collection.getFields('primaryKey'); // [{ name: 'username', type: 'string', primaryKey: true }] - -collection.getFields(field => field.type === 'string'); // [{ name: 'name', type: 'string' }] -``` - -### collection.getField(name) - -获取 collection 的单个字段。 - -- 类型 - -```tsx | pure -class Collection { - getField(name: SchemaKey): CollectionFieldOptions -} -``` - -- 示例 - -```tsx | pure -collection.getField('username'); // { name: 'username', type: 'string', primaryKey: true } -``` - -### collection.hasField(name) - -判断 collection 是否存在某个字段。 - -- 类型 - -```tsx | pure -class Collection { - hasField(name: SchemaKey): boolean; -} -``` - -- 示例 - -```tsx | pure -collection.hasField('username'); // true -collection.hasField('name'); // false -``` diff --git a/packages/core/client/docs/en-US/core/data-source/data-source-manager-provider.md b/packages/core/client/docs/en-US/core/data-source/data-source-manager-provider.md deleted file mode 100644 index 4b39e452c..000000000 --- a/packages/core/client/docs/en-US/core/data-source/data-source-manager-provider.md +++ /dev/null @@ -1,25 +0,0 @@ -# DataSourceManagerProvider - -用于提供 `DataSourceManager` 实例。 - - -## Hooks - -### useDataSourceManager() - -获取 `DataSourceManager` 实例。 - -- 类型 - -```tsx | pure -function useDataSourceManager(): DataSourceManager; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.removeDataSources(['my-data-source']); -} -``` diff --git a/packages/core/client/docs/en-US/core/data-source/data-source-manager.md b/packages/core/client/docs/en-US/core/data-source/data-source-manager.md deleted file mode 100644 index 198021e29..000000000 --- a/packages/core/client/docs/en-US/core/data-source/data-source-manager.md +++ /dev/null @@ -1,334 +0,0 @@ -# DataSourceManager - -Nocobase 数据源前端体系包含如下内容: - -- [DataSourceManager](./data-source-manager.md) - - [DataSource](./data-source) - - [CollectionManager](./collection-manager) - - [Collection](./collection) - - [Field](./collection-field) - - [CollectionTemplateManager](./collection-template-manager) - - [CollectionTemplate](./collection-template) - - [CollectionFieldInterfaceManager](./collection-field-interface-manager) - - [CollectionFieldInterface](./collection-field-interface) - - [CollectionMixins](./collection-mixins) - - -## 实例属性 - -- collectionTemplateManager - -用于管理 `CollectionTemplate` 实例。 - -```tsx | pure -import { Plugin, CollectionTemplate } from '@nocobase/client'; - -class MyCollectionTemplate extends CollectionTemplate { - name = 'my-collection-template'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([MyCollectionTemplate]) - } -} -``` - -详细请参考:[CollectionTemplateManager](./collection-template-manager) - -- collectionFieldInterfaceManager - -用于管理 `CollectionFieldInterface` 实例。 - -```tsx | pure -import { Plugin, CollectionFieldInterface } from '@nocobase/client'; - -class MyCollectionFieldInterface extends CollectionFieldInterface { - name = 'my-collection-field-interface'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([MyCollectionFieldInterface]) - } -} -``` - -详细请参考:[CollectionTemplateManager](./collection-template-manager) - -## 实例方法 - -### addCollectionTemplates() - -是 `CollectionTemplateManager` 的快捷方法,用于添加 `CollectionTemplate`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addCollectionTemplates(templates: CollectionTemplate[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, CollectionTemplate } from '@nocobase/client'; - -class MyCollectionTemplate extends CollectionTemplate { - name = 'my-collection-template'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([MyCollectionTemplate]) - } -} -``` - -更多详细请参考:[CollectionTemplateManager](./collection-template-manager) - -### addFieldInterfaces() - -是 `CollectionFieldInterfaceManager` 的快捷方法,用于添加 `CollectionFieldInterface`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addFieldInterfaces(fieldInterfaces: CollectionFieldInterface[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, CollectionFieldInterface } from '@nocobase/client'; - -class MyCollectionFieldInterface extends CollectionFieldInterface { - name = 'my-collection-field-interface'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([MyCollectionFieldInterface]) - } -} -``` - -更多详细请参考:[CollectionFieldInterfaceManager](./collection-field-interface-manager) - -### addCollectionMixins() - -用于添加 `Collection` 的 Mixins。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addCollectionMixins(mixins: (typeof Collection)[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, Collection } from '@nocobase/client'; - -class MyCollectionMixin extends Collection { - otherMethod() { - console.log('otherMethod'); - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([MyCollectionMixin]) - } -} - -const MyComponent = () => { - const collection = useCollection(); - collection.otherMethod(); -} -``` - -更多详细请参考:[CollectionMixins](./collection-mixins) - -### addDataSource() - -用于添加 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addDataSource(DataSource: DataSource, options: DataSourceOptions): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, DataSource, DataSourceOptions } from '@nocobase/client'; - -class MyDataSource extends DataSource { - async getDataSource() { - return { - status: 'loaded', - collections: [{ name: 'users' }] - } - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(MyDataSource, { - key: 'my-data-source', - displayName: 'My Data Source', - }) - } -} -``` - -更多详细请参考:[DataSource](./data-source) - -### removeDataSources() - -移除 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - removeDataSources(keys: string[]): void; -} -``` - -- 示例 - -```tsx | pure - -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.removeDataSources(['my-data-source']); -} -``` - -### getDataSources() - -获取全部 `DataSource` 实例列表。 - -- 类型 - -```tsx | pure -class DataSourceManager { - getDataSources(): DataSource[]; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const dataSources = dataSourceManager.getDataSources(); - - return ( -
- {dataSources.map(dataSource => ( -
{dataSource.displayName}
- ))} -
- ) -} -``` - -### getDataSource() - -获取 `DataSource` 实例。 - -- 类型 - -```tsx | pure -class DataSourceManager { - getDataSource(key: string): DataSource; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const dataSource = dataSourceManager.getDataSource('my-data-source'); - - return ( -
- {dataSource.displayName} -
- ) -} -``` - -### getAllCollections() - -获取所有 DataSource 的所有 Collection 实例。 - -- 类型 - -```tsx | pure - -class DataSourceManager { - getAllCollections(options?: { - filterCollection?: (collection: Collection) => boolean; - filterDataSource?: (dataSource: DataSource) => boolean; - }): (DataSourceOptions & { collections: Collection[] })[]; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const collections = dataSourceManager.getAllCollections(); - - return ( -
- {collections.map(({ key, displayName, collections }) => ( -
-

{displayName}

-
    - {collections.map(collection => ( -
  • {collection.name}
  • - ))} -
-
- ))} -
- ) -} -``` - -### reload() - -重载所有 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - reload(): Promise; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.reload(); -} -``` - diff --git a/packages/core/client/docs/en-US/core/data-source/data-source-provider.md b/packages/core/client/docs/en-US/core/data-source/data-source-provider.md deleted file mode 100644 index 909a4d894..000000000 --- a/packages/core/client/docs/en-US/core/data-source/data-source-provider.md +++ /dev/null @@ -1,66 +0,0 @@ -# DataSourceProvider - -用于提供 `DataSource` 的实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface DataSourceProviderProps { - dataSource?: string; - children?: ReactNode; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - return ( - - - - ); -} -``` - -## Hooks - -### useDataSource() - -获取 `DataSource` 实例。 - -- 类型 - -```tsx | pure -function useDataSource(): DataSource; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - return
{dataSource.displayName}
-} -``` - -### useDataSourceKey() - -获取 `DataSource` 的 key。 - -- 类型 - -```tsx | pure -function useDataSourceKey(): string; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceKey = useDataSourceKey(); - return
{dataSourceKey}
-} -``` diff --git a/packages/core/client/docs/en-US/core/data-source/data-source.md b/packages/core/client/docs/en-US/core/data-source/data-source.md deleted file mode 100644 index 558a37089..000000000 --- a/packages/core/client/docs/en-US/core/data-source/data-source.md +++ /dev/null @@ -1,176 +0,0 @@ -# DataSource - -主要是用于获取数据源和数据源的数据表结构列表,并在获取后交给 [CollectionManager](./collection-manager.md) 进行管理,其被 [DataSourceManager](./data-source-manager.md) 管理。 - -## 数据源定义 - -数据源的定义需要继承 `DataSource` 类,并实现 `getDataSource` 方法,当调用 `reload` 方法时,会调用 `getDataSource` 方法获取数据表结构。 - -```tsx | pure -import { DataSource } from '@nocobase/client'; - -class MyDataSource extends DataSource { - async getDataSource() { - return this.app.request({ - url: 'xxx', - method: 'GET', - }); - } -} -``` - -### 数据源注册 - -数据源需要在插件中注册,通过 `DataSourceManager` 的 `addDataSource` 方法进行注册。 - -初始化添加的时候 `collections` 可以为空,当调用 `reload` 方法时,会调用 `getDataSource` 方法获取数据表结构。 - -```tsx | pure -import { Plugin, DataSource, DataSourceOptions } from '@nocobase/client'; - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(MyDataSource, { - key: 'my-data-source', - displayName: 'My Data Source', - status: 'loaded', - collections: [ - { - name: 'users', - fields: [ - { - name: 'name', - type: 'string', - }, - ], - }, - ], - }); - } -} -``` - -- `key`:数据源的唯一标识 -- `displayName`:数据源的显示名称 -- `status`:数据源的状态,`loaded` 表示已加载,`loading` 表示正在加载,`loading-failed` 表示加载失败 -- `collections`:数据表结构 -- `errorMessage`:错误信息 - -## 实例方法 - -### getDataSource() - -用于获取数据源信息,其会被 `reload` 方法内部调用,外部不需要调用。 - -### addReloadCallback() - -用于添加数据源加载完成后的回调函数。 - -- 类型 - -```tsx | pure -type LoadCallback = (collections: CollectionOptions[]) => void; - -class DataSource { - addReloadCallback(callback: LoadCallback): void; -} -``` - -### removeReloadCallback() - -用于移除数据源加载完成后的回调函数。 - -- 类型 - -```tsx | pure -type LoadCallback = (collections: CollectionOptions[]) => void; -class DataSource { - removeReloadCallback(callback: LoadCallback): void; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - useEffect(() => { - const callback = (collections) => { - console.log(collections); - }; - dataSource.addReloadCallback(callback); - return () => { - dataSource.removeReloadCallback(callback); - }; - }, []); -}; -``` - -### reload() - -用于重新加载数据源,会调用 `getDataSource` 方法获取数据表结构,并内部调用 `addReloadCallback` 添加的回调函数。 - -- 类型 - -```tsx | pure -class DataSource { - reload(): Promise; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - const handleClick = async () => { - await dataSource.reload(); - }; -}; -``` - -### getOptions() - -获取数据源的配置信息。 - -- 类型 - -```tsx | pure -interface DataSourceOptions { - key: string; - displayName: string; - collections?: CollectionOptions[]; - errorMessage?: string; - status?: 'loaded' | 'loading-failed' | 'loading'; -} - -class DataSource { - getOptions(): DataSourceOptions; -} -``` - -### getOption() - -获取数据源的配置信息。 - -- 类型 - -```tsx | pure -class DataSource { - getOption(key: string): any; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - const handleClick = async () => { - console.log(dataSource.getOption('key')); - }; -}; -``` diff --git a/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo1.tsx b/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo1.tsx deleted file mode 100644 index 0ec4ddb40..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo1.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import { ISchema, observer, useForm } from '@nocobase/schema'; -import { - Action, - Application, - CollectionProvider, - Form, - SchemaComponent, - FormItem, - InheritanceCollectionMixin, - Input, - SchemaComponentOptions, -} from '@nocobase/client'; -import React from 'react'; - -const collection = { - name: 'tests', - fields: [ - { - type: 'string', - name: 'title1', - interface: 'input', - uiSchema: { - title: 'Title1', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - }, - { - type: 'string', - name: 'title2', - interface: 'input', - uiSchema: { - title: 'Title2', - type: 'string', - 'x-component': 'Input', - description: 'description', - default: 'ttt', - }, - }, - { - type: 'string', - name: 'title3', - }, - ], -}; - -const Root = observer(() => { - const schema: ISchema = { - type: 'object', - properties: { - form1: { - type: 'void', - 'x-component': 'Form', - properties: { - // 字段 title1 直接使用全局提供的 uiSchema - title1: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - default: '111', - }, - // 等同于 - // title1: { - // type: 'string', - // title: 'Title', - // required: true, - // 'x-component': 'Input', - // 'x-decorator': 'FormItem', - // }, - title2: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - title: 'Title4', // 覆盖全局已定义的 Title2 - required: true, // 扩展的配置参数 - description: 'description4', - }, - // 等同于 - // title2: { - // type: 'string', - // title: 'Title22', - // required: true, - // 'x-component': 'Input', - // 'x-decorator': 'FormItem', - // }, - // 字段 title3 没有提供 uiSchema,自行处理 - title3: { - 'x-component': 'Input', - 'x-decorator': 'FormItem', - title: 'Title3', - required: true, - }, - action1: { - // type: 'void', - 'x-component': 'Action', - title: 'Submit', - 'x-component-props': { - type: 'primary', - useAction: '{{ useSubmit }}', - }, - }, - }, - }, - }, - }; - - const useSubmit = () => { - const form = useForm(); - return { - async run() { - form.submit(() => { - console.log(form.values); - }); - }, - }; - }; - - return ( - - - - - - ); -}); - -const app = new Application({ - providers: [Root], - components: { Action, Form, Input, FormItem }, - dataSourceManager: { - collections: [collection], - collectionMixins: [InheritanceCollectionMixin], - }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo2.tsx b/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo2.tsx deleted file mode 100644 index 6ead1b09a..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/collection-field/demo2.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { ISchema, observer } from '@nocobase/schema'; -import { - Application, - CollectionProvider, - Form, - FormItem, - InheritanceCollectionMixin, - Input, - SchemaComponent, - SchemaSettings, -} from '@nocobase/client'; -import React from 'react'; - -const collection = { - name: 'tests', - fields: [ - { - type: 'string', - name: 'title1', - interface: 'input', - uiSchema: { - title: 'Title1', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - }, - ], -}; - -const Root = observer(() => { - const schema: ISchema = { - type: 'object', - properties: { - form1: { - type: 'void', - 'x-component': 'Form', - properties: { - title1: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - 'x-settings': 'FormItemSettings', - }, - }, - }, - }, - }; - - return ( - - - - ); -}); - -const formSettings = new SchemaSettings({ - name: 'FormItemSettings', - items: [ - { - name: 'required', - type: 'switch', - useComponentProps() { - // const collectionField = useCollectionField(); // 报错 - return { - checked: true, - // checked: !!collectionField?.uiSchema?.required, - title: 'Required', - onChange(v) { - // ? - }, - }; - }, - }, - ], -}); - -const app = new Application({ - providers: [Root], - components: { Form, Input, FormItem }, - dataSourceManager: { - collections: [collection], - collectionMixins: [InheritanceCollectionMixin], - }, - schemaSettings: [formSettings], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/data-source/demos/collection/demo1.tsx b/packages/core/client/docs/en-US/core/data-source/demos/collection/demo1.tsx deleted file mode 100644 index a01748165..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/collection/demo1.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { CollectionProvider, useCollection } from '@nocobase/client'; -import { createApp } from '../createApp'; - -const Demo = () => { - const collection = useCollection(); - return
{JSON.stringify(collection.getField('username'), null, 2)}
; -}; - -const Root = () => { - return ( - - - - ); -}; - -export default createApp(Root); diff --git a/packages/core/client/docs/en-US/core/data-source/demos/collections.json b/packages/core/client/docs/en-US/core/data-source/demos/collections.json deleted file mode 100644 index 4d3aa45f8..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/collections.json +++ /dev/null @@ -1,198 +0,0 @@ -[ - { - "key": "h7b9i8khc3q", - "name": "users", - "inherit": false, - "hidden": false, - "description": null, - "category": [], - "namespace": "users.users", - "duplicator": { - "dumpable": "optional", - "with": "rolesUsers" - }, - "sortable": "sort", - "model": "UserModel", - "createdBy": true, - "updatedBy": true, - "logging": true, - "from": "db2cm", - "title": "{{t(\"Users\")}}", - "rawTitle": "{{t(\"Users\")}}", - "fields": [ - { - "uiSchema": { - "type": "number", - "title": "{{t(\"ID\")}}", - "x-component": "InputNumber", - "x-read-pretty": true, - "rawTitle": "{{t(\"ID\")}}" - }, - "key": "ffp1f2sula0", - "name": "id", - "type": "bigInt", - "interface": "id", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "autoIncrement": true, - "primaryKey": true, - "allowNull": false - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Nickname\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Nickname\")}}" - }, - "key": "vrv7yjue90g", - "name": "nickname", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Username\")}}", - "x-component": "Input", - "x-validator": { - "username": true - }, - "required": true, - "rawTitle": "{{t(\"Username\")}}" - }, - "key": "2ccs6evyrub", - "name": "username", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Email\")}}", - "x-component": "Input", - "x-validator": "email", - "required": true, - "rawTitle": "{{t(\"Email\")}}" - }, - "key": "rrskwjl5wt1", - "name": "email", - "type": "string", - "interface": "email", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true - }, - { - "key": "t09bauwm0wb", - "name": "roles", - "type": "belongsToMany", - "interface": "m2m", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "target": "roles", - "foreignKey": "userId", - "otherKey": "roleName", - "onDelete": "CASCADE", - "sourceKey": "id", - "targetKey": "name", - "through": "rolesUsers", - "uiSchema": { - "type": "array", - "title": "{{t(\"Roles\")}}", - "x-component": "AssociationField", - "x-component-props": { - "multiple": true, - "fieldNames": { - "label": "title", - "value": "name" - } - } - } - } - ] - }, - { - "key": "pqnenvqrzxr", - "name": "roles", - "inherit": false, - "hidden": false, - "description": null, - "category": [], - "namespace": "acl.acl", - "duplicator": { - "dumpable": "required", - "with": "uiSchemas" - }, - "autoGenId": false, - "model": "RoleModel", - "filterTargetKey": "name", - "sortable": true, - "from": "db2cm", - "title": "{{t(\"Roles\")}}", - "rawTitle": "{{t(\"Roles\")}}", - "fields": [ - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Role UID\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Role UID\")}}" - }, - "key": "jbz9m80bxmp", - "name": "name", - "type": "uid", - "interface": "input", - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null, - "prefix": "r_", - "primaryKey": true - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Role name\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Role name\")}}" - }, - "key": "faywtz4sf3u", - "name": "title", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null, - "unique": true, - "translation": true - }, - { - "key": "1enkovm9sye", - "name": "description", - "type": "string", - "interface": null, - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null - } - ] - } -] diff --git a/packages/core/client/docs/en-US/core/data-source/demos/createApp.tsx b/packages/core/client/docs/en-US/core/data-source/demos/createApp.tsx deleted file mode 100644 index 127f2e7c8..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/createApp.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { - Application, - ApplicationOptions, - CardItem, - Plugin, - CollectionPlugin, - DataBlockProvider, - DEFAULT_DATA_SOURCE_KEY, - DEFAULT_DATA_SOURCE_TITLE, - LocalDataSource, -} from '@nocobase/client'; -import MockAdapter from 'axios-mock-adapter'; -import { ComponentType } from 'react'; -import collections from './collections.json'; - -const defaultMocks = { - 'users:list': { - data: [ - { - id: '1', - username: 'jack', - nickname: 'Jack Ma', - email: 'test@gmail.com', - }, - { - id: '2', - username: 'jim', - nickname: 'Jim Green', - }, - { - id: '3', - username: 'tom', - nickname: 'Tom Cat', - email: 'tom@gmail.com', - }, - ], - }, - 'roles:list': { - data: [ - { - name: 'root', - title: 'Root', - description: 'Root', - }, - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - ], - }, -}; - -export function createApp( - Demo: ComponentType, - options: ApplicationOptions = {}, - mocks: Record = defaultMocks, -) { - class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(LocalDataSource, { - key: DEFAULT_DATA_SOURCE_KEY, - displayName: DEFAULT_DATA_SOURCE_TITLE, - collections: collections as any, - }); - } - } - const app = new Application({ - apiClient: { - baseURL: 'http://localhost:8000', - }, - providers: [Demo], - ...options, - components: { - ...options.components, - DataBlockProvider, - CardItem, - }, - plugins: [CollectionPlugin, MyPlugin, ...(options.plugins || [])], - designable: true, - }); - - const mock = new MockAdapter(app.apiClient.axios); - - Object.entries(mocks).forEach(([url, data]) => { - mock.onGet(url).reply(async (config) => { - const res = typeof data === 'function' ? data(config) : data; - return [200, res]; - }); - mock.onPost(url).reply(async (config) => { - const res = typeof data === 'function' ? data(config) : data; - return [200, res]; - }); - }); - - const Root = app.getRootComponent(); - return Root; -} diff --git a/packages/core/client/docs/en-US/core/data-source/demos/data-source-manager/mixins.tsx b/packages/core/client/docs/en-US/core/data-source/demos/data-source-manager/mixins.tsx deleted file mode 100644 index f2f26151f..000000000 --- a/packages/core/client/docs/en-US/core/data-source/demos/data-source-manager/mixins.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { CollectionProvider, Collection, useCollection, Plugin } from '@nocobase/client'; -import { createApp } from '../createApp'; - -class TestMixin extends Collection { - test() { - const { name } = this.options; - return 'test ' + name; - } -} - -class Test2Mixin extends Collection { - test2() { - const { name } = this.options; - return 'test2 ' + name; - } -} - -const Demo = () => { - const collection = useCollection(); - return ( -
-
test: {collection.test()}
-
test2: {collection.test2()}
-
fields.length: {collection.getFields().length}
-
- ); -}; - -const Root = () => { - return ( - - - - ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([TestMixin, Test2Mixin]); - } -} - -export default createApp(Root, { - plugins: [MyPlugin], -}); diff --git a/packages/core/client/docs/en-US/core/data-source/extend-collections-provider.md b/packages/core/client/docs/en-US/core/data-source/extend-collections-provider.md deleted file mode 100644 index 8b033ff0f..000000000 --- a/packages/core/client/docs/en-US/core/data-source/extend-collections-provider.md +++ /dev/null @@ -1,79 +0,0 @@ -# ExtendCollectionsProvider - -用于扩展 [Collection](./collection.md) 。 - -## 组件 - -- 类型 - -```tsx | pure -interface ExtendCollectionsProviderProps { - collections: CollectionOptions[]; - children?: ReactNode; -} -``` - -- 示例 - -```tsx | pure -import { ExtendCollectionsProvider, CollectionOptions } from '@nocobase/client'; - -const userCollection: CollectionOptions = { - name: 'users', - title: '{{t("Users")}}', - fields: [ - { - type: 'string', - name: 'name', - title: '{{t("Name")}}', - }, - { - type: 'string', - name: 'email', - title: '{{t("Email")}}', - }, - ], -} - -const MyPlugin = () => { - return ( - - - - - - ); -} - -const ChildComponent = () => { - const collection = useCollection(); - - return ( -
-

{collection.name}

-
- ); -} -``` - -## Hooks - -### useExtendCollections() - -获取扩展的数据表。 - -```tsx | pure -import { useExtendCollections } from '@nocobase/client'; - -const MyComponent = () => { - const collections = useExtendCollections(); - - return ( -
- {collections.map((collection) => ( -
{collection.title}
- ))} -
- ); -} -``` diff --git a/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface-form.png b/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface-form.png deleted file mode 100644 index 9a6029e8a..000000000 Binary files a/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface-form.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface.png b/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface.png deleted file mode 100644 index 6d04d0e2b..000000000 Binary files a/packages/core/client/docs/en-US/core/data-source/images/collection-field-interface.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-source/images/collection-template-form.png b/packages/core/client/docs/en-US/core/data-source/images/collection-template-form.png deleted file mode 100644 index 6223be103..000000000 Binary files a/packages/core/client/docs/en-US/core/data-source/images/collection-template-form.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-source/images/collection-template.png b/packages/core/client/docs/en-US/core/data-source/images/collection-template.png deleted file mode 100644 index 45a9de527..000000000 Binary files a/packages/core/client/docs/en-US/core/data-source/images/collection-template.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/data-source/images/field-groups.png b/packages/core/client/docs/en-US/core/data-source/images/field-groups.png deleted file mode 100644 index 3f9381a70..000000000 Binary files a/packages/core/client/docs/en-US/core/data-source/images/field-groups.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png b/packages/core/client/docs/en-US/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png deleted file mode 100644 index 0fa567bf5..000000000 Binary files a/packages/core/client/docs/en-US/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png b/packages/core/client/docs/en-US/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png deleted file mode 100644 index d27e675f7..000000000 Binary files a/packages/core/client/docs/en-US/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png b/packages/core/client/docs/en-US/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png deleted file mode 100644 index 9d65a782c..000000000 Binary files a/packages/core/client/docs/en-US/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/static/designer.png b/packages/core/client/docs/en-US/core/static/designer.png deleted file mode 100644 index 466fa4cfd..000000000 Binary files a/packages/core/client/docs/en-US/core/static/designer.png and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/static/plugin-settings.jpg b/packages/core/client/docs/en-US/core/static/plugin-settings.jpg deleted file mode 100644 index 34a8da116..000000000 Binary files a/packages/core/client/docs/en-US/core/static/plugin-settings.jpg and /dev/null differ diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-basic.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-basic.tsx deleted file mode 100644 index 7c67b3b24..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-basic.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-common.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-common.tsx deleted file mode 100644 index 79962078e..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-common.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ApplicationOptions, Grid, Plugin, SchemaComponent } from '@nocobase/client'; -import React from 'react'; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid }); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const appOptions: ApplicationOptions = { - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}; - -export { appOptions }; diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-component.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-component.tsx deleted file mode 100644 index 06796b827..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-component.tsx +++ /dev/null @@ -1,133 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { Avatar } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - insertPosition: 'beforeEnd', - Component: (props: any) => ( - - C - - ), - componentProps: { - size: 'large', - }, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-divider.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-divider.tsx deleted file mode 100644 index 39a23be52..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-divider.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'd', - type: 'divider', - }, - { - name: 'b', - title: 'B Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'B1', - }, - { - name: 'a2', - type: 'item', - title: 'B2', - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-group.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-group.tsx deleted file mode 100644 index d691ff925..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-group.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { Application, SchemaInitializer, SchemaInitializerItemGroup } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; -import React from 'react'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'b', - title: 'B Group Title', - type: 'itemGroup', - divider: true, // 渲染分割线 - useChildren() { - // 动态子元素 - return [ - { - name: 'b1', - type: 'item', - title: 'B1', - }, - { - name: 'b2', - type: 'item', - title: 'B2', - }, - ]; - }, - }, - { - name: 'c', - Component: () => { - return ( - - {[ - { - name: 'c1', - type: 'item', - title: 'C1', - }, - ]} - - ); - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-item.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-item.tsx deleted file mode 100644 index 05e6f983a..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-item.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * defaultShowCode: true - */ -import { - Grid, - SchemaInitializer, - useSchemaInitializer, - SchemaInitializerItem, - CardItem, - Application, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; -import { useFieldSchema } from '@nocobase/schema'; - -const Demo = () => { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - Component: Demo, - }, - { - name: 'demo2', - type: 'item', - useComponentProps() { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - - return { - title: 'type 方式定义', - onClick: handleClick, - }; - }, - }, - { - name: 'demo3', - title: 'with items', - type: 'item', - onClick(args) { - console.log(args); - }, - items: [ - { - label: 'aaa', - value: 'aaa', - }, - { - label: 'bbb', - value: 'bbb', - }, - ], - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], - components: { CardItem, Hello }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-menu.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-menu.tsx deleted file mode 100644 index f795b0271..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-menu.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A subMenu', - type: 'subMenu', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'b', - title: 'B subMenu', - type: 'subMenu', - children: [ - { - name: 'a1', - type: 'item', - title: 'B1', - }, - { - name: 'a2', - type: 'item', - title: 'B2', - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-select.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-select.tsx deleted file mode 100644 index 620dc40c5..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-select.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Grid, SchemaInitializer, Application, SchemaInitializerSelect, useDesignable } from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; -import { useFieldSchema } from '@nocobase/schema'; - -const OpenModeSelect = () => { - const fieldSchema = useFieldSchema(); - const openModeValue = fieldSchema?.['x-component-props']?.['openMode'] || 'drawer'; - - const { patch } = useDesignable(); - const handleChange = (value) => { - // 修改当前节点的 Schema 的属性 - patch({ - 'x-component-props': { - openMode: value, - }, - }); - }; - - return ( - - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'openMode', - Component: OpenModeSelect, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-switch.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-switch.tsx deleted file mode 100644 index c8eb33888..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-components-switch.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * defaultShowCode: true - */ -import { - Grid, - SchemaInitializer, - Application, - SchemaInitializerSwitch, - useCurrentSchema, - useSchemaInitializer, - Action, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; - -const actionKey = 'x-action'; - -const schema = { - type: 'void', - [actionKey]: 'create', - title: "{{t('Add new')}}", - 'x-component': 'Action', - 'x-component-props': { - type: 'primary', - }, -}; - -const AddNewButton = () => { - // 判断是否已插入 - const { exists, remove } = useCurrentSchema(schema[actionKey], actionKey); - - const { insert } = useSchemaInitializer(); - return ( - { - // 如果已插入,则移除 - if (exists) { - return remove(); - } - // 新插入子节点 - insert(schema); - }} - /> - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Configure actions', - wrap: Grid.wrap, - items: [ - { - name: 'Add New', - Component: AddNewButton, - }, - { - name: 'Add New2', - type: 'switch', - useComponentProps() { - const { exists, remove } = useCurrentSchema(schema[actionKey], actionKey); - - const { insert } = useSchemaInitializer(); - return { - checked: exists, - title: 'Add new - type 方式', - onClick() { - // 如果已插入,则移除 - if (exists) { - return remove(); - } - // 新插入子节点 - insert(schema); - }, - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], - components: { Action }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-hooks-item.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-hooks-item.tsx deleted file mode 100644 index ddf54ed2d..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-hooks-item.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { ReactNode } from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem, useSchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; -import { TableOutlined } from '@ant-design/icons'; - -const Demo = () => { - const { name, foo, icon } = useSchemaInitializerItem<{ name: string; foo: string; icon: ReactNode }>(); - - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - foo: 'bar', - icon: , - Component: Demo, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-items.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-items.tsx deleted file mode 100644 index 78657d332..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-items.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import React, { FC } from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerChild, - SchemaInitializerItem, - SchemaInitializerItemsProps, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { ButtonProps, ListProps, List, Card } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const CustomListGridMenu: FC>> = (props) => { - const { items, options, ...others } = props; - return ( - ( - - - - )} - > - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - ItemsComponent: CustomListGridMenu, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-children.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-children.tsx deleted file mode 100644 index 1e7fe3e23..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-children.tsx +++ /dev/null @@ -1,61 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - type: 'itemGroup', - title: '静态 children', - children: [ - { - name: 'a1', - type: 'item', - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - title: 'A 2', - }, - ], - }, - { - name: 'a', - type: 'itemGroup', - title: '动态 children', - useChildren() { - return [ - { - name: 'a1', - type: 'item', - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - title: 'A 2', - }, - ]; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-define.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-define.tsx deleted file mode 100644 index 534ec581b..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-define.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - }, - { - name: 'b', - type: 'item', // 通过 `type` 定义,底层对应着 `SchemaInitializerItem` 组件 - title: 'type Demo', - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-props.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-props.tsx deleted file mode 100644 index 37d46fa4e..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-props.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const CommonDemo = (props) => { - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - Component: CommonDemo, - componentProps: { - title: 'componentProps', - }, - }, - { - name: 'b', - Component: CommonDemo, - useComponentProps() { - return { - title: 'useComponentProps', - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-visible.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-visible.tsx deleted file mode 100644 index ead52953d..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-options-item-visible.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - type: 'item', - title: 'Demo A', - }, - { - name: 'b', - type: 'item', - title: 'Demo B', - useVisible() { - return false; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-popover.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-popover.tsx deleted file mode 100644 index 87fec2666..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-popover.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - useDesignable, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { Button } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -const MyInitializerComponent = () => { - const { insertBeforeEnd } = useDesignable(); - return ( - - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - popover: false, - Component: MyInitializerComponent, -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-render.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-render.tsx deleted file mode 100644 index eea87b77d..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-initializer-render.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer(() => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return ( -
-
{render()}
-
可以进行参数的二次覆盖:{render({ style: { color: 'red' } })}
-
- ); -}); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-common.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-common.tsx deleted file mode 100644 index 01b99b9aa..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-common.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ApplicationOptions, CardItem, Grid, Plugin, SchemaComponent } from '@nocobase/client'; -import React from 'react'; - -const Hello = () => { - return

Hello, world!

; -}; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const appOptions: ApplicationOptions = { - router: { - type: 'memory', - }, - designable: true, - components: { Grid, CardItem, Hello }, - plugins: [PluginHello], -}; - -export { appOptions }; diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-action-modal.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-action-modal.tsx deleted file mode 100644 index 25b94e5c3..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-action-modal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { - Application, - FormItem, - Input, - SchemaSettings, - SchemaSettingsActionModalItem, - useDesignable, -} from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { ISchema, useField } from '@nocobase/schema'; - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const filed = useField(); - const { patch } = useDesignable(); - - return ( - { - patch({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ FormItem, Input }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-divider.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-divider.tsx deleted file mode 100644 index f2b3d98b6..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-divider.tsx +++ /dev/null @@ -1,68 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'group A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'divider', - type: 'divider', - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: 'group B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-group.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-group.tsx deleted file mode 100644 index e47b99a13..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-group.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'group A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: 'group B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-item.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-item.tsx deleted file mode 100644 index 3aae57b2f..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-item.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC, useState } from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Button, Input, Space } from 'antd'; - -const MarkdownEdit = () => { - const field = useField(); - return ( - { - field.editable = true; - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'markdown', - Component: MarkdownEdit, - }, - ], -}); - -const Hello: FC<{ content?: string }> = observer((props) => { - const field = useField(); - const { content } = props; - const [inputVal, setInputVal] = useState(content); - const { patch } = useDesignable(); - return field.editable ? ( - - setInputVal(e.target.value)} /> - - - - - - ) : ( -

{content}

- ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-modal.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-modal.tsx deleted file mode 100644 index 6dac4f24d..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-modal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/** - * defaultShowCode: true - */ -import { ISchema } from '@nocobase/schema'; -import { - Application, - FormItem, - Input, - SchemaSettings, - SchemaSettingsModalItem, - useSchemaSettings, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-settings-common'; - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const { dn } = useSchemaSettings(); - - return ( - { - dn.deepMerge({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ FormItem, Input }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-remove.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-remove.tsx deleted file mode 100644 index c1b101cc3..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-remove.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - breakRemoveOn(s) { - return s['x-component'] === 'Grid'; // 其顶级是 Grid,这一层级不能删 - }, - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-select.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-select.tsx deleted file mode 100644 index e9f80c243..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-select.tsx +++ /dev/null @@ -1,82 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC } from 'react'; -import { Application, SchemaSettings, SchemaSettingsSelectItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Table } from 'antd'; - -const PageSize = () => { - const { patch } = useDesignable(); - const filed = useField(); - return ( - { - patch({ - 'x-component-props': { - pageSize: v, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'pageSize', - Component: PageSize, - }, - ], -}); - -const data = []; -for (let i = 0; i < 46; i++) { - data.push({ - key: i, - name: `Edward King ${i}`, - age: 32, - address: `London, Park Lane no. ${i}`, - }); -} -const Hello: FC<{ pageSize: number }> = observer((props) => { - return ( -
- ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-sub-menu.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-sub-menu.tsx deleted file mode 100644 index 4e9be9478..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-sub-menu.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'subMenu', - componentProps: { - title: 'Sub Menu A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'b', - type: 'subMenu', - componentProps: { - title: 'Sub Menu B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-switch.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-switch.tsx deleted file mode 100644 index ef8a22619..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-components-switch.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC } from 'react'; -import { Application, SchemaSettings, SchemaSettingsSwitchItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Form, Input } from 'antd'; - -const FormItemRequired = () => { - const { patch } = useDesignable(); - const filed = useField(); - return ( - { - patch({ - 'x-component-props': { - required: v, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'required', - Component: FormItemRequired, - }, - { - name: 'required2', - type: 'switch', - useComponentProps() { - const { patch } = useDesignable(); - const filed = useField(); - return { - title: 'Required - type 方式', - checked: !!filed.componentProps?.required, - onChange(v) { - patch({ - 'x-component-props': { - required: v, - }, - }); - }, - }; - }, - }, - ], -}); - -const Hello: FC<{ required: boolean }> = observer((props) => { - return ( -
- - - - - ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-children.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-children.tsx deleted file mode 100644 index 102c312b2..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-children.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: '静态 children', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A 2', - }, - }, - ], - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: '动态 children', - }, - useChildren() { - return [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A 1', - }, - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A 2', - }, - }, - ]; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-define.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-define.tsx deleted file mode 100644 index f370a23ee..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-define.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return ; -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - }, - { - name: 'b', - type: 'item', // 通过 `type` 定义,底层对应着 `SchemaInitializerItem` 组件 - componentProps: { - title: 'type Demo', - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-props.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-props.tsx deleted file mode 100644 index 7b3737611..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-props.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const CommonDemo = (props) => { - return ; -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: CommonDemo, - componentProps: { - title: 'componentProps', - }, - }, - { - name: 'b', - Component: CommonDemo, - useComponentProps() { - return { - title: 'useComponentProps', - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-visible.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-visible.tsx deleted file mode 100644 index 6cfc7f725..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-options-item-visible.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'item', - componentProps: { - title: 'Demo A', - }, - }, - { - name: 'b', - type: 'item', - componentProps: { - title: 'Demo B', - }, - useVisible() { - return false; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-render.tsx b/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-render.tsx deleted file mode 100644 index 5993b128b..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/demos/schema-settings-render.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import { ISchema, useField, useFieldSchema } from '@nocobase/schema'; -import { - Application, - CardItem, - FormItem, - Grid, - Input, - Plugin, - SchemaComponent, - SchemaSettings, - SchemaSettingsModalItem, - createDesignable, - useAPIClient, - useSchemaComponentContext, - useSchemaSettings, - useSchemaSettingsRender, -} from '@nocobase/client'; -import React, { useMemo } from 'react'; - -class PluginHello extends Plugin { - async load() { - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const { dn } = useSchemaSettings(); - - return ( - { - dn.shallowMerge({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const Hello = (props) => { - return ( -

- Hello, world! - {props.children} -

- ); -}; - -const Demo = () => { - const fieldSchema = useFieldSchema(); - const field = useField(); - const api = useAPIClient(); - const { refresh } = useSchemaComponentContext(); - const dn = useMemo( - () => - createDesignable({ - current: fieldSchema.parent, - model: field.parent, - api, - refresh, - }), - [], - ); - const { render, exists } = useSchemaSettingsRender(fieldSchema['x-settings'], { - fieldSchema: dn.current, - field: dn.model, - dn, - }); - return ( -
-
{render()}
-
可以进行参数的二次覆盖:{render({ style: { color: 'red' } })}
-
- ); -}; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -const app = new Application({ - schemaSettings: [mySettings], - router: { - type: 'memory', - }, - designable: true, - components: { FormItem, Input, Grid, CardItem, Hello }, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/en-US/core/ui-schema/designable.md b/packages/core/client/docs/en-US/core/ui-schema/designable.md deleted file mode 100644 index 75b151b26..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/designable.md +++ /dev/null @@ -1,791 +0,0 @@ -# Designable - -## Designable - -对 Schema 节点进行增、删、改操作,并且提供了事件触发机制,用于将数据同步到服务端。 - -```tsx | pure -interface Options { - current: Schema; - api?: APIClient; - onSuccess?: any; - refresh?: () => void; - t?: any; -} - -interface InsertAdjacentOptions { - wrap?: (s: ISchema) => ISchema; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | BreakFn; - onSuccess?: any; -} - -class Designable { - constructor(options: Options ) { } - loadAPIClientEvents(): void; - on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', listener: any): void - emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]): Promise - refresh(): void - recursiveRemoveIfNoChildren(schema?: Schema, options?: RecursiveRemoveOptions): Schema; - remove(schema?: Schema, options?: RemoveOptions): Promise - removeWithoutEmit(schema?: Schema, options?: RemoveOptions): Schema - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void | Promise - insertBeforeBeginOrAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeBegin(schema: ISchema, options?: InsertAdjacentOptions): void - insertAfterBegin(schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeEnd(schema: ISchema, options?: InsertAdjacentOptions): Promise - insertAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void -} -``` - -### 构造函数 - -- 参数讲解 - - - `current`:需要操作的 Schema 节点 - - `api`:用于发起后端请求的 [APIClient](https://docs.nocobase.com/api/sdk) 实例 - - `onSuccess`:后端接口请求成功后的回调 - - `refresh`:用于更新节点后,刷新页面 - - `t`:`useTranslation()` 的返回值 -- 示例 - -```tsx | pure -const schema = new Schema({ - type: 'void', - name: 'hello', - 'x-component': 'div', -}) - -const dn = new Designable({ current: schema }); -``` - -### Schema 操作方法 - -```tsx | pure -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - } - } -}); - -const b = schema.b; - -const dn = createDesignable({ - current: b, -}) - -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -#### remove - -移除当前节点 - -```tsx | pure -dn.remove(); -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.remove(); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { -- b: { -- type: 'void', -- properties: { -- c: { -- type: 'void', -- } -- } -- } - } -} -``` - -#### insertBeforeBegin - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertBeforeBegin({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertBeforeBegin({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { -+ d: { -+ type: 'void', -+ }, - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - } - } -} -``` - -#### insertAfterBegin - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertAfterBegin({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertAfterBegin({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { -+ d: { -+ type: 'void', -+ }, - c: { - type: 'void', - } - } - } - } -} -``` - -#### insertBeforeEnd - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertBeforeEnd({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertBeforeEnd({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, -+ d: { -+ type: 'void', -+ }, - } - } - } -} -``` - -#### insertAfterEnd - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertAfterEnd({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertAfterEnd({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - }, -+ d: { -+ type: 'void', -+ }, - } -} -``` - -#### insertAdjacent - -根据第一个参数决定插入的位置,是前面四个方法的封装。 - -```tsx | pure -class Designable { - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void | Promise -} -``` - -### 事件监听和 API 请求 - -- `on` :添加事件监听的基础方法 -- `loadAPIClientEvents`:调用 `on` 方法添加对 `insertAdjacent`、`patch`、`batchPatch`、`remove` 的事件的监听,主要功能是将变更的 Schema 更新到服务端 -- `emit`:是根据事件名称,调用之前注册过的方法,具体是由前面讲过的 *插入操作和删除操作* 触发 - -而 `loadAPIClientEvents()` 并非在初始化时调用,需要手动调用,换而言之,如果不调用 `dn.loadAPIClientEvents()`,则不会将更新发送到服务端,主要是简化在单测或者 DEMO 环境对服务端的 Mock。 - -## 工具函数 - -### createDesignable() - -对 `new Designable()` 的简单封装。 - -```tsx | pure -function createDesignable(options: CreateDesignableProps) { - return new Designable(options); -} -``` - -```tsx | pure -const dn = createDesignable({ current: schema }); -``` - -## Hooks - -### useFieldSchema() - -用户获取当前节点 Schema JSON 对象,更多信息请参考 [formily useFieldSchema()](https://react.formilyjs.org/api/hooks/use-field-schema)。 - -- 类型 - -```tsx | pure -import { Schema } from '@formily/json-schema'; -const useFieldSchema: () => Schema; -``` - -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import React from 'react'; -import { useFieldSchema } from '@formily/react'; -import { Application, Plugin, SchemaComponent } from '@nocobase/client'; -const Demo = ({ children }) => { - const fieldSchema = useFieldSchema(); - return
-
{ JSON.stringify(fieldSchema, null, 2)}
-
{children}
-
-} -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Demo', // 这里是 Demo 组件 - 'properties': { - 'world': { - 'type': 'void', - 'x-component': 'Demo', // 这里也是 Demo 组件 - }, - } -} - -const Root = () => { - return -} - -const app = new Application({ - providers: [Root] -}) - -export default app.getRootComponent(); -``` - -### useField() - -获取当前节点 Schema 实例,更多信息请参考 [formily useField()](https://react.formilyjs.org/api/hooks/use-field) - -- 类型 - -```tsx | pure -import { GeneralField } from '@formily/core'; -const useField: () => T; -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const field = useField(); - console.log('field', field); - return
-} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Demo', // 这里是 Demo 组件 - 'properties': { - 'world': { - 'type': 'void', - 'x-component': 'Demo', // 这里也是 Demo 组件 - }, - } -} - -const Root = () => { - return -} -``` - -### useDesignable() - -对当前 Schema 节点的修改操作。 - -- 类型 - -```tsx | pure -interface InsertAdjacentOptions { - wrap?: (s: ISchema) => ISchema; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | BreakFn; - onSuccess?: any; -} - -type Position = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd'; - -function useDesignable(): { - dn: Designable; - designable: boolean; - reset: () => void; - refresh: () => void; - setDesignable: (value: boolean) => void; - findComponent(component: any): any; - patch: (key: ISchema | string, value?: any) => void - on(name: "error" | "insertAdjacent" | "remove" | "patch" | "batchPatch", listener: any): void - remove(schema?: any, options?: RemoveOptions): void - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeBegin(schema: ISchema): void; - insertAfterBegin(schema: ISchema): void; - insertBeforeEnd(schema: ISchema): void; - insertAfterEnd(schema: ISchema): void; -} -``` - -- 详细解释 - - - designable、reset、refresh、setDesignable:这些值继承自 [SchemaComponentContext](https://www.baidu.com) - - dn:是 `Designable` 的实例 - - findComponent:用于查找 Schema 中字符串对应真正的组件,如果组件未注册则返回 `null` - - remove:内部调用的是 `dn.remove` 方法 - - on:内部调用的是 `dn.on` 方法 - - insertAdjacent:插入新的 Schema 节点,内部调用的是 `dn.insertAdjacent` 方法 - - position:插入位置 - - schema:新的 Schema 节点 - - Options - - wrap:对 Schema 的二次处理的回调函数 - - removeParentsIfNoChildren:当没有子元素时,删除父元素 - - breakRemoveOn:停止删除的判断回调 - - onSuccess:插入成功的回调 - - insertBeforeBegin:内部调用的是 `dn.insertBeforeBegin` 方法 - - insertAfterBegin:内部调用的是 `dn.insertAfterBegin` 方法 - - insertBeforeEnd:内部调用的是 `dn.insertBeforeEnd` 方法 - - insertAfterEnd:内部调用的是 `dn.insertAfterEnd` 方法 -- 示例 - -插入节点。 - -```tsx -import React from 'react'; -import { - SchemaComponentProvider, - SchemaComponent, - useDesignable, -} from '@nocobase/client'; -import { observer, Schema, useFieldSchema } from '@formily/react'; -import { Button, Space } from 'antd'; -import { uid } from '@formily/shared'; - -const Hello = observer( - (props) => { - const { insertAdjacent } = useDesignable(); - const fieldSchema = useFieldSchema(); - return ( -
-

{fieldSchema.name}

- - - - - - -
{props.children}
-
- ); - }, - { displayName: 'Hello' }, -); - -const Page = observer( - (props) => { - return
{props.children}
; - }, - { displayName: 'Page' }, -); - -export default () => { - return ( - - - - ); -}; -``` - -部分更新。 - -```tsx -import React from 'react'; -import { - SchemaComponentProvider, - SchemaComponent, - useDesignable, -} from '@nocobase/client'; -import { observer, Schema, useField, useFieldSchema } from '@formily/react'; -import { FormItem } from '@formily/antd-v5'; -import { Button } from 'antd'; -import { uid } from '@formily/shared'; - -const Hello = observer( - (props) => { - const fieldSchema = useFieldSchema(); - const field = useField(); - const { dn } = useDesignable(); - return ( -
-

{field.title}

- { JSON.stringify(props) } -
- { JSON.stringify(field.componentProps) } -
- { JSON.stringify(field.decoratorProps) } -
- { JSON.stringify(fieldSchema.toJSON()) } -
- - -
- ); - }, - { displayName: 'Hello' }, -); - -const Page = observer( - (props) => { - return
{props.children}
; - }, - { displayName: 'Page' }, -); - -export default () => { - return ( - - - - ); -}; -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-component.md b/packages/core/client/docs/en-US/core/ui-schema/schema-component.md deleted file mode 100644 index 9a6aa8310..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-component.md +++ /dev/null @@ -1,212 +0,0 @@ -# SchemaComponent - -## Context - -### SchemaComponentContext - -```tsx | pure -interface SchemaComponentContext { - scope?: any; - components?: SchemaReactComponents; - refresh?: () => void; - reset?: () => void; - designable?: boolean; - setDesignable?: (value: boolean) => void; -} -``` - -Schema 渲染的上下文。 - -- `scope`:Schema 中变量的映射 -- `components`: Schema 中组件的映射 -- `refresh`:触发 React 重新渲染的工具函数 -- `reset`:重置整个 Schema 节点 -- `designable`:是否显示设计器,默认 `false` -- `setDesignable`:用于切换 `designable` 的值 - -## Hooks - -### useSchemaOptionsContext() - -用于获取注册的 `scope` 和 `components`。 - -```tsx | pure -const { scope, components } = useSchemaOptionsContext(); -``` - -## 组件 - -### SchemaComponentProvider - -其是对 `SchemaComponentContext.Provider` 和 [FormProvider ](https://react.formilyjs.org/api/components/form-provider)的封装,并内置在 `Application` 中,并且会将 `app.components` 和 `app.scopes` 传递过去,所以一般情况下 *不需要关注* 此组件。 - -- props - -```tsx | pure -interface SchemaComponentProviderProps { - designable?: boolean; - form?: Form; - scope?: any; - components?: SchemaReactComponents; -} -``` - -- 详细解释 - - `designable`:`SchemaComponentContext` 中 `designable` 的默认值 - - `form`:NocoBase 的 Schema 能力是基于 formily 的 `FormProvider` 提供的,form 是其参数,默认为 `createForm()` - - `scope`:Schema 中所用到的变量,会通过 `SchemaComponentContext` 进行传递 - - `components`:Schema 中所用到的组件,会通过 `SchemaComponentContext` 进行传递 - -### SchemaComponent - -用于渲染 Schema,此组件必须和 `SchemaComponentProvider` 一起使用,因为 `SchemaComponentProvider` 提供了 [FormProvider](https://react.formilyjs.org/api/components/form-provider) 作为渲染 Schema 的根节点。 - -- Props - -```tsx | pure -type SchemaComponentProps = (ISchemaFieldProps | IRecursionFieldProps) & { - memoized?: boolean; - components?: SchemaReactComponents; - scope?: any; -} -``` - -- 详细解释 - - - `memoized`:当为 `true` 时,会对每层的 Schema 使用 `useMemo()` 进行处理 - - `components`:同 `SchemaComponentProvider` 的 `components` - - `scope`: 同 `SchemaComponentProvider` 的 `components` - -## 综合示例 - -结合 `SchemaComponentProvider`、 `useSchemaComponentContext()` 和 `SchemaComponent`。 - -```tsx -/** - * defaultShowCode: true - */ -import { SchemaComponentProvider, useSchemaComponentContext, SchemaComponent, } from '@nocobase/client'; -const Hello = () => { - const { designable, setDesignable } = useSchemaComponentContext(); - return
-
hello world
- -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', -} - -const Demo = () => { - return -} - -const Root = () => { - return - - -} - -export default Root; -``` - -使用 `new Application()` 的方式,其内置了 `SchemaComponentProvider` ,我们可以如下操作: - -```tsx -/** - * defaultShowCode: true - */ -import { Application, Plugin, useSchemaComponentContext, SchemaComponent } from '@nocobase/client'; -const Hello = () => { - const { designable, setDesignable } = useSchemaComponentContext(); - return
-
hello world
- -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', -} - -const HomePage = () => { - return -} - -class MyPlugin extends Plugin { - async load() { - this.app.addComponents({ Hello }); - this.app.router.add('home', { - path: '/', - Component: HomePage, - }) - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], -}) - -export default app.getRootComponent(); -``` - -### SchemaComponentOptions - -在应用中,会有很多层级的嵌套,每一层都可能提供自己的组件和 scope,此组件就是为了层层传递 Schema 所需的 `components` 和 `scope` 的。 - -- props - -```tsx | pure -interface SchemaComponentOptionsProps { - scope?: any; - components?: SchemaReactComponents; -} -``` - -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import { SchemaComponentProvider, useSchemaComponentContext, SchemaComponent, SchemaComponentOptions } from '@nocobase/client'; -const World = () => { - return
world
-} - -const Hello = ({ children }) => { - return
-
hello
- { children } -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', - properties: { - world: { - type: 'void', - 'x-component': 'World', - }, - }, -} - -const Root = () => { - return - - -} - -export default Root; -``` diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-initializer-manager.md b/packages/core/client/docs/en-US/core/ui-schema/schema-initializer-manager.md deleted file mode 100644 index 483f9d2b6..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-initializer-manager.md +++ /dev/null @@ -1,186 +0,0 @@ -# SchemaInitializerManager - -## 实例方法 - -### schemaInitializerManager.add() - -添加 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - add(...schemaInitializerList: SchemaInitializer[]): void -} -``` - -- 示例 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add block', - items: [ - { - name: 'demo', - type: 'item', - title: 'Demo' - } - ], -}); - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - } -} -``` - -### schemaInitializerManager.get() - -获取一个 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - get(name: string): SchemaInitializer | undefined -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - } -} -``` - -### schemaInitializerManager.getAll() - -获取所有的 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - getAll(): Record> -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const list = this.app.schemaInitializerManager.getAll(); - } -} -``` - -### app.schemaInitializerManager.has() - -判断是否有存在某个 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - has(name: string): boolean -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasMyInitializer = this.app.schemaInitializerManager.has('MyInitializer'); - } -} -``` - -### schemaInitializerManager.remove() - -移除 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - remove(name: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.remove('MyInitializer'); - } -} -``` - -### schemaInitializerManager.addItem() - -添加 SchemaInitializer 实例的 Item 项,其和直接 schemaInitializer.add() 方法的区别是,可以确保在实例存在时才会添加。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - addItem(schemaInitializerName: string, itemName: string, data: Omit): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再添加子项,需要确保已注册 - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - if (myInitializer) { - myInitializer.add('b', { type: 'item', title: 'B' }) - } - - // 方式2:通过 addItem,内部确保在 MyInitializer 注册时才会添加 - this.app.schemaInitializerManager.addItem('MyInitializer', 'b', { - type: 'item', - title: 'B' - }) - } -} -``` - -### schemaInitializerManager.removeItem() - -移除 实例的 Item 项,其和直接 schemaInitializer.remove() 方法的区别是,可以确保在实例存在时才会移除。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - removeItem(schemaInitializerName: string, itemName: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再删除子项,需要确保已注册 - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - if (myInitializer) { - myInitializer.remove('a') - } - - // 方式2:通过 addItem,内部确保在 MyInitializer 注册时才会移除 - this.app.schemaInitializerManager.remove('MyInitializer', 'a') - } -} -``` diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-initializer.md b/packages/core/client/docs/en-US/core/ui-schema/schema-initializer.md deleted file mode 100644 index 2637b0a80..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-initializer.md +++ /dev/null @@ -1,704 +0,0 @@ -# SchemaInitializer - -## new SchemaInitializer(options) - -```tsx | pure -interface SchemaInitializerOptions { - Component?: ComponentType; - componentProps?: P1; - style?: React.CSSProperties; - title?: string; - icon?: ReactNode; - - items?: SchemaInitializerItemType[]; - ItemsComponent?: ComponentType; - itemsComponentProps?: P2; - itemsComponentStyle?: React.CSSProperties; - - insertPosition?: 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd'; - designable?: boolean; - wrap?: (s: ISchema) => ISchema; - onSuccess?: (data: any) => void; - insert?: InsertType; - useInsert?: () => InsertType; - - popover?: boolean; - popoverProps?: PopoverProps; -} - -class SchemaInitializer { - constructor(options: SchemaInitializerOptions & { name: string }): SchemaInitializer; - add(name: string, item: Omit): void - get(nestedName: string): SchemaInitializerItemType | undefined - remove(nestedName: string): void -} -``` - -### 详细解释 - -![](../static/KTUWb69kioUg8bxYTAMc2ReDnRg.png) - -- name:唯一标识,必填 -- Component 相关 - - - Component:触发组件,默认是 `Button` 组件 - - componentProps: 组件属性,默认是 `ButtonProps` - - title: 按钮的文本 - - icon:按钮的 icon 属性 - - style:组件的样式 -- Items 相关 - - - items:列表项配置 - - ItemsComponent:默认是渲染成一个列表的形式,可通过此参数自定义 items - - itemsComponentProps:`ItemsComponent` 的属性 - - itemsComponentStyle:`ItemsComponent` 的样式 -- popover 组件相关 - - - popover:是否使用 popover,默认为 `true` - - popoverProps:popover 的属性 -- Schema 操作相关 - - - insertPosition:插入位置,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - designable:是否显示设计模式,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - wrap:对 Schema 的二次处理,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - onSuccess:Schema 更新到服务端后的回调,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - insert:自定义 Schema 插入逻辑,默认为 [useDesignable()](/core/ui-schema/designable#usedesignable) 的 `insertAdjacent` - - useInsert:当自定义插入 Schema 的逻辑需要用到 Hooks 时,可以使用此参数 - -### 示例 - -#### 基础用法 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - ], -}); -``` - - - - -#### 定制化 `Component` - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - Component: (props) => ( - - C - - ), - componentProps: { - size: 'large', - }, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - } - ], -}); -``` - - - -#### 不使用 Popover - -关于 `useDesignable()` 的说明请参考 [useDesignable](/core/ui-schema/designable#usedesignable)。 - -```tsx | pure -const schema = { - type: 'void', - title: Math.random(), - 'x-component': 'Hello', -}; -const MyInitializerComponent = () => { - const { insertBeforeEnd } = useDesignable(); - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add block', - popover: false, - Component: MyInitializerComponent, -}); -``` - - - - -#### 定制化 Items - -```tsx | pure -const CustomListGridMenu: FC>> = (props) => { - const { items, options, ...others } = props; - return ( - ( - - - - )} - > - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - ItemsComponent: CustomListGridMenu, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - } - ], -}); -``` - - - -## options.items 配置详解 - -### 类型 - -```tsx | pure -interface SchemaInitializerComponentCommonProps { - title?: string; - schema?: ISchema; - style?: React.CSSProperties; - className?: string; -} - -interface SchemaInitializerItemBaseType extends SchemaInitializerComponentCommonProps { - name: string; - sort?: number; - type?: string; - Component?: string | ComponentType; - componentProps?: Omit; - useComponentProps?: () => Omit; - useVisible?: () => boolean; - children?: SchemaInitializerItemType[]; - useChildren?: () => SchemaInitializerItemType[]; - [index: string]: any; -} -``` - -### 两种定义方式:`Component` 和 `type` - - -- 通过 `Component` 定义 - -```tsx | pure - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - } - ], -}); -``` - -- 通过 `type` 定义 - -NocoBase 内置了一些常用的 `type`,例如 `type: 'item'`,相当于 `Component: SchemaInitializerItem`。 - -更多内置类型,请参考:[内置组件和类型](/core/ui-schema/schema-initializer#%E5%86%85%E7%BD%AE%E7%BB%84%E4%BB%B6%E5%92%8C%E7%B1%BB%E5%9E%8B) - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - items: [ - { - name: 'a', - type: 'item', - title: 'Demo' - } - ], -}); -``` - - - -### `children` 和动态方式 `useChildren` - -对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。 - - - -### 动态显示隐藏 `useVisible` - - - -### 组件属性 `componentProps` 和动态属性 `useComponentProps` - -对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。 - -当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。 - - - -### 公共属性和组件属性 - -```tsx | pure -{ - name: 'demo', - title: 'Demo', - foo: 'bar', - Component: Demo, - componentProps: { - zzz: 'xxx', - }, -} -``` - -从上面的示例中我么看到,从配置项中获取组件组件所需的数据有两个方式: - -- 组件属性:通过 `componentProps` 来定义,例如 `zzz: 'xxx'` -- 公共属性:将属性直接定义在配置项上,例如 `foo: 'bar'`、`name`、`title` - -在获取上 - -- `componentProps` 定义的数据会被传递给组件的 `props` -- 直接定义在配置项上的数据会则需要通过 [useSchemaInitializerItem()](/core/ui-schema/schema-initializer#useschemainitializeritem) 获取 - -```tsx | pure -const Demo = (props) => { - console.log(props); // { zzz: 'xxx' } - const { foo } = useSchemaInitializerItem(); // { foo: 'bar' } -} -``` - -## 实例方法 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - } - ], - }, - ], -}); -``` - -```tsx -import { SchemaInitializer, Application, useSchemaInitializerRender } from '@nocobase/client'; -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - type: 'item', - } - ], - }, - ], -}); - -const Root = () => { - const { render } = useSchemaInitializerRender('MyInitializer'); - return render(); -} -const app = new Application({ - schemaInitializers: [myInitializer], - providers: [Root], - designable: true, -}); - -export default app.getRootComponent(); -``` - -### schemaInitializer.add() - -用于新增 Item,另一种添加方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanageradditem); - -- 类型 - -```tsx | pure -class SchemaInitializer { - add(name: string, item: Omit): void -} -``` - -- 参数说明 - -第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。 - -- 示例 - -```tsx | pure -myInitializer.add('b', { - type: 'item', - title: 'item b', -}) - -myInitializer.add('a.a2', { - type: 'item', - title: 'item a2', -}) -``` - -```tsx -import { SchemaInitializer, Application, useSchemaInitializerRender } from '@nocobase/client'; -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - type: 'item', - } - ], - }, - ], -}); - -myInitializer.add('b', { - type: 'item', - title: 'item b', -}) - -myInitializer.add('a.a2', { - type: 'item', - title: 'item a2', -}) - -const Root = () => { - const { render } = useSchemaInitializerRender('MyInitializer'); - return render(); -} -const app = new Application({ - schemaInitializers: [myInitializer], - providers: [Root], - designable: true, -}); - - -export default app.getRootComponent(); -``` - - -### schemaInitializer.get() - -- 类型 - -```tsx | pure -class SchemaInitializer { - get(nestedName: string): SchemaInitializerItemType | undefined -} -``` - -- 示例 - -```tsx | pure -const itemA = myInitializer.get('a') - -const itemA1 = myInitializer.add('a.a1') -``` - -### schemaInitializer.remove() - -另一种移除方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanagerremoveitem); - -- 类型 - -```tsx | pure -class SchemaInitializer { - remove(nestedName: string): void -} -``` - -- 示例 - -```tsx | pure -myInitializer.remove('a.a1') - -myInitializer.remove('a') -``` - -## Hooks - -### useSchemaInitializer() - -用于获取 `SchemaInitializer` 上下文内容。 - -- 类型 - -```tsx | pure -export type InsertType = (s: ISchema) => void; - -const useSchemaInitializer: () => { - insert: InsertType; - options: SchemaInitializerOptions; - visible?: boolean; - setVisible?: (v: boolean) => void; -} -``` - -- 参数详解 - - `insert`:参数是 Schema 对象,用于插入 Schema - - `options`:获取 `new SchemaInitializer(options)` 时 options 配置 - - `visible`:popover 是否显示 - - `setVisible`:设置 popover 显示状态 - -- 示例 - -```tsx | pure -const schema = { - type: 'void', - 'x-component': 'Hello', -} -const Demo = () => { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert(schema); - }; - return ; -} -``` - -### useSchemaInitializerRender() - -用于渲染 `SchemaInitializer`。 - -- 类型 - -```tsx | pure -function useSchemaInitializerRender(name: string, options?: SchemaInitializerOptions): { - exists: boolean; - render: (props?: SchemaInitializerOptions) => React.FunctionComponentElement; -} -``` - -- 参数详解 - -返回的 `render` 方法可以接收一个参数,用于覆盖 `new SchemaInitializer(options)` 的 `options` 配置。 - -- 示例 - -```tsx | pure -const Demo = () => { - const filedSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer'], fieldSchema['x-initializer-props']); - return
-
{ render() }
-
可以进行参数的二次覆盖:{ render({ style: { color: 'red' } }) }
-
-} -``` - - - -### useSchemaInitializerItem() - -用于获取配置项内容的,配置项是指的 `SchemaInitializer` 中的 `items` 中的一项。 - -- 类型 - -```tsx | pure -const useSchemaInitializerItem: () => T -``` - -- 示例 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'Item A', - foo: 'bar', - Component: Demo, - }, - ], -}); - -/** - * 通过 useSchemaInitializerItem() 获取到的是 - * { - * name: 'a', - * title: 'Item A', - * foo: 'bar', - * Component: Demo, - * } - */ -const Demo = () => { - const { title, foo } = useSchemaInitializerItem(); - return
{ title } - { foo }
-} -``` - - - -## 内置组件和类型 - -| type | Component | 效果 | -| ----------- | ------------------------------ | ----------------------------------------- | -| item | SchemaInitializerItem | 文本| -| itemGroup | SchemaInitializerItemGroup | 分组,同 antd `Menu` 组件的 `type: 'group'` | -| subMenu | SchemaInitializerSubMenu | 子菜单,同 antd `Menu` 组件的子菜单 | -| divider | SchemaInitializerDivider | 分割线,同 antd `Menu` 组件的 `type: 'divider'` | -| switch | SchemaInitializerSwitch | 开关 | -| actionModal | SchemaInitializerActionModal | 弹窗| - -以下每个示例都提供了 2 种[定义方式](/core/ui-schema/schema-initializer#两种定义方式component-和-type),一种是通过 `Component` 定义,另一种是通过 `type` 定义。 - -### `type: 'item'` & `SchemaInitializerItem` - -文本项。 - -```tsx | pure -interface SchemaInitializerItemProps { - style?: React.CSSProperties; - className?: string; - name?: string; - icon?: React.ReactNode; - title?: React.ReactNode; - items?: SchemaInitializerItemType[]; - onClick?: (args?: any) => any; -} -``` - -核心参数是 `title`、`icon`、`onClick`、`items`,其中 `onClick` 用于插入 Schema,`items` 用于渲染子列表项。 - - - -### `type: 'itemGroup'` & SchemaInitializerItemGroup - -分组。 - -```tsx | pure -interface SchemaInitializerItemGroupProps { - name: string; - title: string; - children?: SchemaInitializerOptions['items']; - divider?: boolean; -} -``` - -核心参数是 `title`、`children`,其中 `children` 用于渲染子列表项,`divider` 用于渲染分割线。 - - - -### `type: 'switch'` & SchemaInitializerSwitch - -Switch 切换按钮。 - -```tsx | pure -interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemProps { - checked?: boolean; - disabled?: boolean; -} -``` - -核心参数是 `checked`、`onClick`,其中 `onClick` 用于插入或者移除 Schema。 - - - -### `type: 'subMenu'` & SchemaInitializerSubMenu - -子菜单。 - - - -### `type: 'divider'` & SchemaInitializerDivider - -分割线。 - - - -## 渲染组件 - -### SchemaInitializerChildren - -用于自定义渲染多个列表项。 - -```tsx | pure - -const Demo = ({ children }) => { - // children: [{ name: 'a1', Component: ItemA1 }, { name: 'a2', type: 'item', title: 'ItemA2' }] - return { children } -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'test', - Component: Demo, - children: [ - { - name: 'a1', - Component: ItemA1, - }, - { - name: 'a2', - type: 'item', - title: 'ItemA2', - } - ] - } - ], -}); -``` - -### SchemaInitializerChild - -用于自定义渲染单个列表项。 - -```tsx | pure -const Demo = (props) => { - return -} -``` diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md b/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md deleted file mode 100644 index e4f43a33d..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-settings-manager.md +++ /dev/null @@ -1,188 +0,0 @@ -# SchemaSettingsManager - -## 实例方法 - -### schemaSettingsManager.add() - -添加 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - add(...schemaSettingList: SchemaSetting[]): void -} -``` - -- 示例 - -```tsx | pure -const mySchemaSettings = new SchemaSetting({ - name: 'MySchemaSettings', - title: 'Add block', - items: [ - { - name: 'demo', - type: 'item', - componentProps:{ - title: 'Demo' - } - } - ], -}); - -class MyPlugin extends Plugin { - async load() { - this.app.schemaSettingsManager.add(mySchemaSettings); - } -} -``` - -### schemaSettingsManager.get() - -获取一个 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - get(name: string): SchemaSetting | undefined -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.getAll() - -获取所有的 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - getAll(): Record> -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const list = this.app.schemaSettingsManager.getAll(); - } -} -``` - -### app.schemaSettingsManager.has() - -判断是否有存在某个 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - has(name: string): boolean -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasMySchemaSettings = this.app.schemaSettingsManager.has('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.remove() - -移除 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - remove(name: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.schemaSettingsManager.remove('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.addItem() - -添加 SchemaSettings 实例的 Item 项,其和直接 schemaInitializer.add() 方法的区别是,可以确保在实例存在时才会添加。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - addItem(schemaInitializerName: string, itemName: string, data: Omit): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再添加子项,需要确保已注册 - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - if (mySchemaSettings) { - mySchemaSettings.add('b', { type: 'item', componentProps:{ title: 'B' } }) - } - - // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会添加 - this.app.schemaSettingsManager.addItem('MySchemaSettings', 'b', { - type: 'item', - componentProps:{ title: 'B' } - }) - } -} -``` - -### schemaSettingsManager.removeItem() - -移除 实例的 Item 项,其和直接 schemaInitializer.remove() 方法的区别是,可以确保在实例存在时才会移除。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - removeItem(schemaInitializerName: string, itemName: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再删除子项,需要确保已注册 - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - if (mySchemaSettings) { - mySchemaSettings.remove('a') - } - - // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会移除 - this.app.schemaSettingsManager.remove('MySchemaSettings', 'a') - } -} -``` diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md b/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md deleted file mode 100644 index b374cbdfa..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-settings.md +++ /dev/null @@ -1,467 +0,0 @@ -# SchemaSettings - -## new SchemaSettings(options) - -创建一个 SchemaSettings 实例。 - -```tsx | pure -interface SchemaSettingsOptions { - name: string; - Component?: ComponentType; - componentProps?: T; - style?: React.CSSProperties; - - items: SchemaSettingsItemType[]; -} - -class SchemaSettings{ - constructor(options: SchemaSettingsOptions): SchemaSettings; - add(name: string, item: Omit): void - get(nestedName: string): SchemaSettingsItemType | undefined - remove(nestedName: string): void -} -``` - -### 详细解释 - -![](../static/VfPGbhWo9os0qTxcITkcHNfin4g.png) - -- name:唯一标识,必填 -- Component 相关 - - - Component:触发组件,默认是 `` 组件 - - componentProps: 组件属性 - - style:组件的样式 -- items:列表项配置 - -### 示例 - -#### 基础用法 - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - items: [ - { - name: 'demo1', // 唯一标识 - type: 'item', // 内置类型 - componentProps: { - title: 'DEMO1', - onClick() { - alert('DEMO1'); - }, - }, - }, - { - name: 'demo2', - Component: () => alert('DEMO2')} />, // 直接使用 Component 组件 - }, - ], -}); -``` - -#### 定制化 `Component` - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - Component: Button, // 自定义组件 - componentProps: { - type: 'primary', - children: '自定义按钮', - }, - // Component: (props) => , // 等同于上面效果 - items: [ - { - name: 'demo1', - type: 'item', - componentProps: { - title: 'DEMO', - }, - }, - ], -}); -``` - -## options.items 配置详解 - -```tsx | pure -interface SchemaSettingsItemCommon { - name: string; - sort?: number; - type?: string; - Component: string | ComponentType; - useVisible?: () => boolean; - children?: SchemaSettingsItemType[]; - useChildren?: () => SchemaSettingsItemType[]; - checkChildrenLength?: boolean; - componentProps?: Omit; - useComponentProps?: () => Omit; -} -``` - -### 两种定义方式:`Component` 和 `type` - - -- 通过 `Component` 定义 - -```tsx | pure - -const Demo = () => { - // 最终渲染 `SchemaSettingsItem` - return -} - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - } - ], -}); -``` - -- 通过 `type` 定义 - -NocoBase 内置了一些常用的 `type`,例如 `type: 'item'`,相当于 `Component: SchemaSettingsItem`。 - -更多内置类型,请参考:[内置组件和类型](/core/ui-schema/schema-settings#%E5%86%85%E7%BD%AE%E7%BB%84%E4%BB%B6%E5%92%8C%E7%B1%BB%E5%9E%8B) - -```tsx | pure -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'item', - componentProps: { - title: 'Demo', - }, - } - ], -}); -``` - - - -### `children` 和动态方式 `useChildren` - -对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。 - - - -### 动态显示隐藏 `useVisible` - - - -### 组件属性 `componentProps` 和动态属性 `useComponentProps` - -对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。 - -当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。 - - - -## 实例方法 - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'item a' - }, - children: [ - { - name: 'a1', - title: 'item a1', - } - ], - }, - ], -}); -``` - -### schemaSettings.add() - -用于新增 Item。 - -- 类型 - -```tsx | pure -class SchemaSettings { - add(name: string, item: Omit): void -} -``` - -- 参数说明 - -第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。 - -- 示例 - -```tsx | pure -mySchemaSetting.add('b', { - type: 'item', - title: 'item b', -}) - -mySchemaSetting.add('a.a2', { - type: 'item', - title: 'item a2', -}) -``` - -### schemaSettings.get() - -- 类型 - -```tsx | pure -class SchemaSettings { - get(nestedName: string): SchemaSettingsItemType| undefined -} -``` - -- 示例 - -```tsx | pure -const itemA = mySchemaSetting.get('a') - -const itemA1 = mySchemaSetting.add('a.a1') -``` - -### schemaSettings.remove() - -- 类型 - -```tsx | pure -class SchemaSettings { - remove(nestedName: string): void -} -``` - -- 示例 - -```tsx | pure -mySchemaSetting.remove('a.a1') - -mySchemaSetting.remove('a') -``` - -## Hooks - -### useSchemaSettingsRender() - -用于渲染 SchemaSettings。 - -- 类型 - -```tsx | pure -function useSchemaSettingsRender(name: string, options?: SchemaSettingsOptions): { - exists: boolean; - render: (options?: SchemaSettingsRenderOptions) => React.ReactElement; -} -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const filedSchema = useFieldSchema(); - const { render, exists } = useSchemaSettingsRender(fieldSchema['x-settings'], fieldSchema['x-settings-props']) - return
-
{ render() }
-
可以进行参数的二次覆盖:{ render({ style: { color: 'red' } }) }
-
-} -``` - - - -### useSchemaSettings() - -获取 schemaSetting 上下文数据。 - -上下文数据包含了 `schemaSetting` 实例化时的 `options` 以及调用 `useSchemaSettingsRender()` 时传入的 `options`。 - -- 类型 - -```tsx | pure -interface UseSchemaSettingsResult extends SchemaSettingsOptions { - dn?: Designable; - field?: GeneralField; - fieldSchema?: Schema; -} - -function useSchemaSettings(): UseSchemaSettingsResult; -``` - -- 示例 - -```tsx | pure -const { dn } = useSchemaSettings(); -``` - -### useSchemaSettingsItem() - -用于获取一个 item 的数据。 - -- 类型 - -```tsx | pure -export type SchemaSettingsItemType = { - name: string; - type?: string; - sort?: number; - Component?: string | ComponentType; - componentProps?: T; - useComponentProps?: () => T; - useVisible?: () => boolean; - children?: SchemaSettingsItemType[]; - [index]: any; -}; - -function useSchemaSettingsItem(): SchemaSettingsItemType; -``` - -- 示例 - -```tsx | pure -const { name } = useSchemaSettingsItem(); -``` - -## 内置组件和类型 - -| type | Component | 效果 | -| ----------- | ------------------------------ | ----------------------------------------- | -| item | SchemaSettingsItem | 文本 | -| itemGroup | SchemaSettingsItemGroup | 分组,同 Menu 组件的 `type: 'itemGroup'` | -| subMenu | SchemaSettingsSubMenu | 子菜单,同 Menu 组件的子菜单 | -| divider | SchemaSettingsDivider | 分割线,同 Menu 组件的 `type: 'divider'` | -| remove | SchemaSettingsRemove | 删除,用于删除一个区块 | -| select | SchemaSettingsSelectItem | 下拉选择 | -| cascader | SchemaSettingsCascaderItem | 级联选择 | -| switch | SchemaSettingsSwitchItem | 开关 | -| popup | SchemaSettingsPopupItem | 弹出层 | -| actionModal | SchemaSettingsActionModalItem | 操作弹窗 | -| modal | SchemaSettingsModalItem | 弹窗 | - -### SchemaSettingsItem - -文本,对应的 `type` 为 `item`。 - -```tsx | pure -interface SchemaSettingsItemProps extends Omit { - title: string; -} -``` - -核心参数为 `title` 和 `onClick`,可以在 `onClick` 中修改 schema。 - - - -### SchemaSettingsItemGroup - -分组,对应的 `type` 为 `itemGroup`。 - -核心参数是 `title`。 - - - -### SchemaSettingsSubMenu - -子菜单,对应的 `type` 为 `subMenu`。 - -核心参数是 `title`。 - - - -### SchemaSettingsDivider - -分割线,对应的 `type` 为 `divider`。 - - - -### SchemaSettingsRemove - -删除,对应的 `type` 为 `remove`。 - -```tsx | pure -interface SchemaSettingsRemoveProps { - confirm?: ModalFuncProps; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | ((s: ISchema) => boolean); -} -``` - -- `confirm`:删除前的确认弹窗 -- `removeParentsIfNoChildren`:如果删除后没有子节点了,是否删除父节点 -- `breakRemoveOn`:如果删除的节点满足条件,是否中断删除 - - - -### SchemaSettingsSelectItem - -选择器,对应的 `type` 为 `select`。 - - - -### SchemaSettingsCascaderItem - -级联选择,对应的 `type` 为 `cascader`。 - -### SchemaSettingsSwitchItem - -开关,对应的 `type` 为 `switch`。 - - - -### SchemaSettingsModalItem - -弹窗,对应的 `type` 为 `modal`。 - -```tsx | pure -export interface SchemaSettingsModalItemProps { - title: string; - onSubmit: (values: any) => void; - initialValues?: any; - schema?: ISchema | (() => ISchema); - modalTip?: string; - components?: any; - hidden?: boolean; - scope?: any; - effects?: any; - width?: string | number; - children?: ReactNode; - asyncGetInitialValues?: () => Promise; - eventKey?: string; - hide?: boolean; -} -``` - -我们可以通过 `schema` 参数来定义弹窗的表单,然后在 `onSubmit` 中获取表单的值,然后修改当前 schema 节点。 - - - -### SchemaSettingsActionModalItem - -操作弹窗,对应的 `type` 为 `actionModal`。 - -其和 `modal` 的区别是,`SchemaSettingsModalItem` 弹窗会丢失上下文,而 `SchemaSettingsActionModalItem` 会保留上下文,简单场景下可以使用 `SchemaSettingsModalItem`,复杂场景下可以使用 `SchemaSettingsActionModalItem`。 - -```tsx | pure -export interface SchemaSettingsActionModalItemProps extends SchemaSettingsModalItemProps, Omit { - uid?: string; - initialSchema?: ISchema; - schema?: ISchema; - beforeOpen?: () => void; - maskClosable?: boolean; -} -``` - - diff --git a/packages/core/client/docs/en-US/core/ui-schema/schema-toolbar.md b/packages/core/client/docs/en-US/core/ui-schema/schema-toolbar.md deleted file mode 100644 index dfd809bba..000000000 --- a/packages/core/client/docs/en-US/core/ui-schema/schema-toolbar.md +++ /dev/null @@ -1,427 +0,0 @@ -# SchemaToolbar - -![SchemaToolbar](../static/designer.png) - -## 组件 - -### SchemaToolbar 组件 - -此为默认的 Toolbar 组件,其内部会自动根据 Schema 的 `x-settings`、`x-initializer` 渲染 `SchemaSettings`、`SchemaInitializer` 和 `Drag` 组件。 - -Toolbar 具体的渲染规则为:当有 `x-toolbar` 会渲染对应的组件;当无 `x-toolbar` 但是有 `x-settings`、`x-initializer` 会渲染默认的 `SchemaToolbar` 组件。 - -- 类型 - -```tsx | pure -interface SchemaToolbarProps { - title?: string; - draggable?: boolean; - initializer?: string | false; - settings?: string | false; - /** - * @default true - */ - showBorder?: boolean; - showBackground?: boolean; -} -``` - -- 详细解释 - - `title`:左上角的标题 - - `draggable`:是否可以拖拽,默认为 `true` - - `initializer`:`SchemaInitializer` 的默认值,当 schema 里没有 `x-initializer` 时,会使用此值;当为 `false` 时,不会渲染 `SchemaInitializer` - - `settings`:`SchemaSettings` 的默认值,当 schema 里没有 `x-settings` 时,会使用此值;当为 `false` 时,不会渲染 `SchemaSettings` - - `showBorder`:边框是否变为橘色 - - `showBackground`:背景是否变为橘色 - -- 示例 - -未指定 `x-toolbar` 时会渲染默认的 `SchemaToolbar` 这个组件。 - -```tsx -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - useSchemaInitializer, - useSchemaInitializerItem, -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 仅指定了 `x-settings` 但是没有 `x-toolbar`,会使用默认的 `SchemaToolbar` 组件 - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` - -自定义 Toolbar 组件。 - - -```tsx -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - SchemaToolbar, - useSchemaInitializer, - useSchemaInitializerItem, -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const MyToolbar = () => { - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello, MyToolbar }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` - -## Hooks - -### useSchemaToolbarRender() - -用于渲染 `SchemaToolbar`。 - -- 类型 - -```tsx | pure -const useSchemaToolbarRender: (fieldSchema: ISchema) => { - render(props?: SchemaToolbarProps): React.JSX.Element; - exists: boolean; -} -``` - -- 详细解释 - -前面示例中 `'x-decorator': 'CardItem'` 中组件 `CardItem` 里面就调用了 `useSchemaToolbarRender()` 进行渲染。内置的组件还有:`BlockItem`、`CardItem`、`Action`、`FormItem`。 - -`render()` 支持二次覆盖组件属性。 - -- 示例 - -```tsx | pure -const MyDecorator = () => { - const filedSchema = useFieldSchema(); - const { render } = useSchemaToolbarRender(filedSchema); // 从 Schema 中读取 Toolbar 组件 - - return { render() } -} -``` - - -```tsx -import { Card } from 'antd'; -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - SchemaToolbar, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaToolbarRender -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const MyToolbar = (props) => { - return -} - -// 自定义包装器 -const MyDecorator = ({children}) => { - const filedSchema = useFieldSchema(); - // 使用 `useSchemaToolbarRender()` 获取并渲染内容 - const { render } = useSchemaToolbarRender(filedSchema); - return { render({ draggable: false }) }{children} -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'MyDecorator', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'MyDecorator', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello, MyToolbar, MyDecorator }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` diff --git a/packages/core/client/docs/en-US/core/utils.md b/packages/core/client/docs/en-US/core/utils.md deleted file mode 100644 index 9fb88088e..000000000 --- a/packages/core/client/docs/en-US/core/utils.md +++ /dev/null @@ -1,13 +0,0 @@ -# Utils - -## Function - -### tval - -用于输出多语言的字符串。 - -- 类型 - - - -- 示例 diff --git a/packages/core/client/docs/en-US/index.md b/packages/core/client/docs/en-US/index.md deleted file mode 100644 index fe2d08520..000000000 --- a/packages/core/client/docs/en-US/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Index - - diff --git a/packages/core/client/docs/en-US/ui-schema/actions/add-new.md b/packages/core/client/docs/en-US/ui-schema/actions/add-new.md deleted file mode 100644 index 308dab604..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/add-new.md +++ /dev/null @@ -1,82 +0,0 @@ -# Add new - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-action": "create", - "x-acl-action": "create", - "title": "{{t('Add new')}}", - "x-designer": "Action.Designer", - "x-component": "Action", - "x-decorator": "ACLActionProvider", - "x-component-props": { - "openMode": "drawer", - "type": "primary", - "component": "CreateRecordAction", - "icon": "PlusOutlined" - }, - "x-align": "right", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Add record\") }}", - "x-component": "Action.Container", - "x-component-props": { - "className": "nb-action-popup" - }, - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializersForCreateFormBlock", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Add new\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "CreateFormBlockInitializers", - "x-uid": "psh2rj6pkab", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "3i7grk0aytf", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "75s24n1nlkh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "wg1f4xyx7vp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "2hwye7mt2th", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/add-record.md b/packages/core/client/docs/en-US/ui-schema/actions/add-record.md deleted file mode 100644 index 7dbce5eda..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/add-record.md +++ /dev/null @@ -1 +0,0 @@ -# Add record(任意表) \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/bulk-edit.md b/packages/core/client/docs/en-US/ui-schema/actions/bulk-edit.md deleted file mode 100644 index b602f30ff..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/bulk-edit.md +++ /dev/null @@ -1 +0,0 @@ -# 批量编辑 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/bulk-update.md b/packages/core/client/docs/en-US/ui-schema/actions/bulk-update.md deleted file mode 100644 index 9ac6d1890..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/bulk-update.md +++ /dev/null @@ -1 +0,0 @@ -# 批量更新 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/custom-request.md b/packages/core/client/docs/en-US/ui-schema/actions/custom-request.md deleted file mode 100644 index b69407f62..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/custom-request.md +++ /dev/null @@ -1,88 +0,0 @@ -# 自定义请求 - - -x-component 不统一,x-action 也不统一,有三种风格的 schema - - -## UI Schema - -### 表单的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "CustomRequestAction", - "x-action": "customize:form:request", - "x-designer": "CustomRequestAction.Designer", - "x-decorator": "CustomRequestAction.Decorator", - "x-action-settings": { - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "type": "void", - "x-uid": "d1rfalvivfo", - "x-async": false, - "x-index": 2 -} -``` - -### 表格列操作的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "Action.Link", - "x-action": "customize:table:request", - "x-designer": "Action.Designer", - "x-action-settings": { - "requestSettings": {}, - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "x-component-props": { - "useProps": "{{ useCustomizeRequestActionProps }}" - }, - "x-designer-props": { - "linkageAction": true - }, - "type": "void", - "x-uid": "edn0y4fq7xb", - "x-async": false, - "x-index": 1 -} -``` - -### 详情的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "CustomRequestAction", - "x-action": "customize:form:request", - "x-designer": "CustomRequestAction.Designer", - "x-decorator": "CustomRequestAction.Decorator", - "x-action-settings": { - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "type": "void", - "x-uid": "glc5zkr0ke3", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/delete.md b/packages/core/client/docs/en-US/ui-schema/actions/delete.md deleted file mode 100644 index d4f3659f0..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/delete.md +++ /dev/null @@ -1 +0,0 @@ -# 删除 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/duplicate.md b/packages/core/client/docs/en-US/ui-schema/actions/duplicate.md deleted file mode 100644 index 5fc15c69d..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/duplicate.md +++ /dev/null @@ -1 +0,0 @@ -# 复制 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/edit.md b/packages/core/client/docs/en-US/ui-schema/actions/edit.md deleted file mode 100644 index 3092287aa..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/edit.md +++ /dev/null @@ -1 +0,0 @@ -# 编辑 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/export.md b/packages/core/client/docs/en-US/ui-schema/actions/export.md deleted file mode 100644 index 9e6bd4bd6..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/export.md +++ /dev/null @@ -1 +0,0 @@ -# 导出 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/filter.md b/packages/core/client/docs/en-US/ui-schema/actions/filter.md deleted file mode 100644 index 653fc6d26..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/filter.md +++ /dev/null @@ -1 +0,0 @@ -# 筛选 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/import.md b/packages/core/client/docs/en-US/ui-schema/actions/import.md deleted file mode 100644 index a371bffd3..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/import.md +++ /dev/null @@ -1 +0,0 @@ -# 导入 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/index.md b/packages/core/client/docs/en-US/ui-schema/actions/index.md deleted file mode 100644 index e177708c4..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/index.md +++ /dev/null @@ -1,51 +0,0 @@ -# 概览 - -## UI Schema 协议 - -- `x-action` -- `x-align` -- `x-acl-action` -- `x-acl-action-props` -- `x-action-settings` - -## 常规操作 - -```json -{ - "type": "void", - "title": "{{ t(\"Submit\") }}", - "x-component": "Action", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, -} -``` - -## 弹窗操作 - -```json -{ - "type": "void", - "title": "{{t('Open drawer')}}", - "x-component": "Action", - "x-component-props": { - "openMode": "drawer", - "type": "primary", - "icon": "PlusOutlined" - }, - "x-align": "right", - "properties": { - "drawer": { - "type": "void", - "x-component": "Action.Container", - "x-component-props": {}, - "properties": { - }, - } - } -} -``` - -更多示例查看 [Action](/apis/action) \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/print.md b/packages/core/client/docs/en-US/ui-schema/actions/print.md deleted file mode 100644 index 2823a7a18..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/print.md +++ /dev/null @@ -1 +0,0 @@ -# 打印 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/refresh.md b/packages/core/client/docs/en-US/ui-schema/actions/refresh.md deleted file mode 100644 index 654d97cca..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/refresh.md +++ /dev/null @@ -1 +0,0 @@ -# 刷新 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/save-record.md b/packages/core/client/docs/en-US/ui-schema/actions/save-record.md deleted file mode 100644 index 83d1a5a37..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/save-record.md +++ /dev/null @@ -1 +0,0 @@ -# 保存数据 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/submit-to-workflow.md b/packages/core/client/docs/en-US/ui-schema/actions/submit-to-workflow.md deleted file mode 100644 index 97bfe3b19..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/submit-to-workflow.md +++ /dev/null @@ -1 +0,0 @@ -# 提交至工作流 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/submit.md b/packages/core/client/docs/en-US/ui-schema/actions/submit.md deleted file mode 100644 index 0634eb49d..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/submit.md +++ /dev/null @@ -1,28 +0,0 @@ -# 提交 - -## UI Schema - -### 新建数据的提交 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Submit\") }}", - "x-action": "submit", - "x-component": "Action", - "x-designer": "Action.Designer", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, - "x-action-settings": { - "triggerWorkflows": [] - }, - "type": "void", - "x-uid": "aaxbm1i5xxd", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/update-record.md b/packages/core/client/docs/en-US/ui-schema/actions/update-record.md deleted file mode 100644 index aa3ff7ffb..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/update-record.md +++ /dev/null @@ -1 +0,0 @@ -# 更新数据 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/actions/view.md b/packages/core/client/docs/en-US/ui-schema/actions/view.md deleted file mode 100644 index f5fd55d6b..000000000 --- a/packages/core/client/docs/en-US/ui-schema/actions/view.md +++ /dev/null @@ -1 +0,0 @@ -# 查看 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/calendar.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/calendar.md deleted file mode 100644 index 13e6c108e..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/calendar.md +++ /dev/null @@ -1,282 +0,0 @@ -# Calendar - -## x-initializer - -- CalendarActionInitializers -- TabPaneInitializers -- RecordBlockInitializers - -## x-designer - -- CalendarV2.Designer - -## x-settings - -- CalendarSettings - -## UI Schema - -### 日历区块 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "CalendarV2.Designer", - "x-component": "CardItem", - "x-decorator": "CalendarBlockProvider", - "x-acl-action": "users:list", - "x-decorator-props": { - "action": "list", - "params": { - "paginate": false - }, - "resource": "users", - "collection": "users", - "fieldNames": { - "id": "id", - "end": ["f_nxqfedh5fd5"], - "start": ["f_nxqfedh5fd5"], - "title": "nickname" - } - }, - "_isJSONSchemaObject": true, - "properties": { - "puytl7p5x8o": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2", - "x-component-props": { - "useProps": "{{ useCalendarBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "toolBar": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2.ActionBar", - "x-initializer": "CalendarActionInitializers", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "_isJSONSchemaObject": true, - "x-uid": "494h1j6bxyg", - "x-async": false, - "x-index": 1 - }, - "event": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2.Event", - "_isJSONSchemaObject": true, - "properties": { - "drawer": { - "type": "void", - "title": "{{ t(\"View record\") }}", - "version": "2.0", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "_isJSONSchemaObject": true, - "properties": { - "tabs": { - "type": "void", - "version": "2.0", - "x-component": "Tabs", - "x-initializer": "TabPaneInitializers", - "x-component-props": {}, - "_isJSONSchemaObject": true, - "x-initializer-props": { - "gridInitializer": "RecordBlockInitializers" - }, - "properties": { - "tab1": { - "type": "void", - "title": "{{t(\"Details\")}}", - "version": "2.0", - "x-designer": "Tabs.Designer", - "x-component": "Tabs.TabPane", - "x-component-props": {}, - "_isJSONSchemaObject": true, - "properties": { - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "_isJSONSchemaObject": true, - "x-initializer-props": { - "actionInitializers": "CalendarFormActionInitializers" - }, - "x-uid": "yty9wg20qq0", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "hcsgenoc3hb", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "c5cpptwxw7s", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "c5iarcnpefc", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "080x8qlpn6s", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "pcche4s596p", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "gk2jk3gpo9f", - "x-async": false, - "x-index": 1 -} -``` - -### 关系的日历区块 - -```json -{ - "x-uid": "8q0hsbdr9fc", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:list", - "x-decorator": "CalendarBlockProvider", - "x-decorator-props": { - "collection": "b", - "resource": "a.o2m", - "action": "list", - "fieldNames": { - "id": "id", - "start": "createdAt", - "title": "f_ex4581dfc0t" - }, - "params": { - "paginate": false - }, - "association": "a.o2m" - }, - "x-designer": "CalendarV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系的日历区块" - }, - "properties": { - "v3za6qejuz7": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2", - "x-component-props": { - "useProps": "{{ useCalendarBlockProps }}" - }, - "properties": { - "toolBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2.ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-initializer": "CalendarActionInitializers", - "x-uid": "u9ntffsdsrh", - "x-async": false, - "x-index": 1 - }, - "event": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2.Event", - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "x-initializer-props": { - "gridInitializer": "RecordBlockInitializers" - }, - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer-props": { - "actionInitializers": "CalendarFormActionInitializers" - }, - "x-initializer": "RecordBlockInitializers", - "x-uid": "2swhiw4lee5", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "z6odjfbwnht", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mxr7ikhfc9y", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mfgucnj7ev8", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "05l5a2h42pn", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "v2jazzvqa85", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/charts.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/charts.md deleted file mode 100644 index 77dbdbdbb..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/charts.md +++ /dev/null @@ -1,143 +0,0 @@ -# Charts - -## UI Schema - -### 图表区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CardItem", - "x-component-props": { - "name": "charts" - }, - "x-designer": "ChartV2BlockDesigner", - "properties": { - "u8841bjm65y": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-decorator": "ChartV2Block", - "x-initializer": "ChartInitializers", - "x-uid": "j4hzcpzcc3g", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ldc2aokaop2", - "x-async": false, - "x-index": 1 -} -``` - -### 内嵌区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CardItem", - "x-component-props": { - "name": "charts" - }, - "x-designer": "ChartV2BlockDesigner", - "properties": { - "g3jq3vkx9fv": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-decorator": "ChartV2Block", - "x-initializer": "ChartInitializers", - "properties": { - "ue7lfigjgm1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Row", - "properties": { - "43ztg8gu03v": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Col", - "properties": { - "n47fsb4i2lm": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "ChartRendererProvider", - "x-decorator-props": { - "query": { - "measures": [ - { - "field": ["id"] - } - ], - "dimensions": [], - "filter": { - "$and": [] - }, - "orders": [], - "cache": {} - }, - "config": { - "chartType": "Built-in.line", - "general": { - "xField": "id", - "yField": "id", - "smooth": false, - "isStack": false - } - }, - "collection": "a", - "mode": "builder" - }, - "x-acl-action": "a:list", - "x-designer": "ChartRenderer.Designer", - "x-component": "CardItem", - "x-component-props": { - "size": "small" - }, - "x-initializer": "ChartInitializers", - "properties": { - "y25sgh5pukl": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "ChartRenderer", - "x-component-props": {}, - "x-uid": "ma0s07k753t", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "k6naqcx59ow", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "o8ktlccovml", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mvn9ai9rhx8", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mcbyby93j6n", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "sn0lczwtkgm", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/details.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/details.md deleted file mode 100644 index 31f765bac..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/details.md +++ /dev/null @@ -1,169 +0,0 @@ -# Details - -## UI Schema - -### 详情区块(带分页) - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "DetailsDesigner", - "x-component": "CardItem", - "x-decorator": "DetailsBlockProvider", - "x-acl-action": "users:view", - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 1 - }, - "rowKey": "id", - "resource": "users", - "collection": "users", - "readPretty": true - }, - "_isJSONSchemaObject": true, - "properties": { - "mjad1dcywip": { - "type": "void", - "version": "2.0", - "x-component": "Details", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useDetailsBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "8avswx6qgyp": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "DetailsActionInitializers", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "_isJSONSchemaObject": true, - "x-uid": "01w17yleng8", - "x-async": false, - "x-index": 1 - }, - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "_isJSONSchemaObject": true, - "x-uid": "bgu0ix4lfmc", - "x-async": false, - "x-index": 2 - }, - "pagination": { - "type": "void", - "version": "2.0", - "x-component": "Pagination", - "x-component-props": { - "useProps": "{{ useDetailsPaginationProps }}" - }, - "_isJSONSchemaObject": true, - "x-uid": "6riuxghrz30", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "3apkfu8ngrp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "yeodhismy2w", - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系区块 - -```json -{ - "x-uid": "2gm2iw937q5", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "DetailsBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 1 - }, - "rowKey": "id" - }, - "x-designer": "DetailsDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "关系区块" - }, - "properties": { - "paj8b2noc1g": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Details", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useDetailsBlockProps }}" - }, - "properties": { - "3jisjip7503": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "DetailsActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "cbkfxafywtx", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "d1ls1w6gpzm", - "x-async": false, - "x-index": 2 - }, - "pagination": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Pagination", - "x-component-props": { - "useProps": "{{ useDetailsPaginationProps }}" - }, - "x-uid": "u0rzv8370za", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "1hfu8jbzzqw", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/form-read-pretty.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/form-read-pretty.md deleted file mode 100644 index 676df3034..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/form-read-pretty.md +++ /dev/null @@ -1,286 +0,0 @@ -# Form (Read pretty) - -## UI Schema - -### 单数据详情 - -```json -{ - "x-uid": "dt4q817fw81", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a", - "collection": "a", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "Form read pretty" - }, - "properties": { - "30qrxij609o": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "fznn1ygt50o", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "t3o4t8fi7l7", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "6dp2qqoc4s0", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系数据详情 - -```json -{ - "x-uid": "jf470wrzdaf", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2oBelongsTo:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2oBelongsTo", - "collection": "b", - "association": "a.o2oBelongsTo", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "对一关系详情" - }, - "properties": { - "uauk2wbj3iq": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "r3pcykksp8l", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "vs000etludp", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "rt228uhudcf", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 表格详情 - -```json -{ - "x-uid": "lxcjjkkor1m", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "表格详情" - }, - "properties": { - "7pe17tcgtye": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "wek8nc795ja", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "5y5u8qm6yvz", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "5bpcm982n51", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 查看关系数据 - -```json -{ - "x-uid": "5ymsrq1fv37", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "查看关系数据" - }, - "properties": { - "vehcfr0fsh2": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "zpuz629u2dg", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "b8u8e2k5inf", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "2rz0u3j14px", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/form.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/form.md deleted file mode 100644 index 442457ba0..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/form.md +++ /dev/null @@ -1,418 +0,0 @@ -# Form - -## UI Schema - -### 添加表单 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a", - "collection": "a" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": {}, - "properties": { - "23pj9m7ot5a": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "0ctuwnatyzd", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "properties": { - "j7ta88et3mv": { - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Submit\") }}", - "x-action": "submit", - "x-component": "Action", - "x-designer": "Action.Designer", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, - "x-action-settings": { - "triggerWorkflows": [] - }, - "type": "void", - "x-uid": "ua858zswy37", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "o0riryr0ob0", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "1ng4hies4yu", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ebiyvziafda", - "x-async": false, - "x-index": 1 -} -``` - -### 编辑表单 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": false - }, - "x-acl-action": "a:update", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": "get", - "resource": "a", - "collection": "a" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": {}, - "properties": { - "w533dipin7p": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "otncpmalhjr", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "UpdateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "qjjmm1qkapx", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "n12zo6qd72g", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "zafyvmng9m5", - "x-async": false, - "x-index": 1 -} -``` - -### 关系新增表单 - -```json -{ - "x-uid": "il5q341k4vg", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a.o2m:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": null, - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系新增表单" - }, - "properties": { - "3357yvwe4je": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "88xhnoml321", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "dhs8o8vpl1h", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "h6fhh9ox9ay", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系新增(关系表格里的 Add new) - -useSourceIdFromParentRecord 和 useParamsFromRecord 参数缺失 - -```json -{ - "x-uid": "6tknohm4ubr", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a.o2m:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系新增表单-Table" - }, - "properties": { - "o96izt6ez7m": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "properties": { - "pk9l1i26yq6": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Row", - "properties": { - "32wz2lr9cry": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Col", - "properties": { - "id": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "string", - "x-designer": "FormItem.Designer", - "x-component": "CollectionField", - "x-decorator": "FormItem", - "x-collection-field": "b.id", - "x-component-props": {}, - "x-read-pretty": true, - "x-uid": "jb09nj4kbfm", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "rtx3b0uom75", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5gvd7ks6m0z", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "fcw1y2xk6km", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "msgopb1meoq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "g0mg6fhho4x", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系编辑 - -```json -{ - "x-uid": "kzg1tz339ro", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": false - }, - "x-acl-action": "a.o2m:update", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": "get", - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系编辑表单" - }, - "properties": { - "3jqysycq8m0": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "sy3sjswogh4", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "UpdateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "xarcyjpypsy", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "lepez9684rm", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/gantt.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/gantt.md deleted file mode 100644 index 4b7ad1269..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/gantt.md +++ /dev/null @@ -1,185 +0,0 @@ -# Gantt - -## UI Schema - -### 甘特图区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "users:list", - "x-decorator": "GanttBlockProvider", - "x-decorator-props": { - "collection": "users", - "resource": "users", - "action": "list", - "fieldNames": { - "id": "id", - "start": "createdAt", - "range": "day", - "title": "nickname", - "end": "f_46b1u4dp820" - }, - "params": { - "paginate": false - } - }, - "x-designer": "Gantt.Designer", - "x-component": "CardItem", - "properties": { - "rx21gtpcj3w": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Gantt", - "x-component-props": { - "useProps": "{{ useGanttBlockProps }}" - }, - "properties": { - "toolBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-initializer": "GanttActionInitializers", - "x-uid": "m0uru68ugw9", - "x-async": false, - "x-index": 1 - }, - "table": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-decorator": "div", - "x-decorator-props": { - "style": { - "float": "left", - "maxWidth": "35%" - } - }, - "x-initializer": "TableColumnInitializers", - "x-component": "TableV2", - "x-component-props": { - "rowKey": "id", - "rowSelection": { - "type": "checkbox" - }, - "useProps": "{{ useTableBlockProps }}", - "pagination": false - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Actions\") }}", - "x-action-column": "actions", - "x-decorator": "TableV2.Column.ActionBar", - "x-component": "TableV2.Column", - "x-designer": "TableV2.ActionColumnDesigner", - "x-initializer": "TableActionColumnInitializers", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "DndContext", - "x-component": "Space", - "x-component-props": { - "split": "|" - }, - "x-uid": "z2vnizu7bds", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "8gbabo6kdr6", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5c8g2x6rvro", - "x-async": false, - "x-index": 2 - }, - "detail": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Gantt.Event", - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "jr5h3asz6gp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "8uwfpgyok9x", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "bjm4sfwxmrx", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "7cmwpc0rrwj", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nffb7qbs96o", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "hoi2j5lhlho", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "e0rdive4xpa", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/grid-card.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/grid-card.md deleted file mode 100644 index 6620d607b..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/grid-card.md +++ /dev/null @@ -1,219 +0,0 @@ -# GridCard - -## UI Schema - -### 栅格卡片 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "GridCard.Designer", - "x-component": "BlockItem", - "x-decorator": "GridCard.Decorator", - "x-acl-action": "users:view", - "x-component-props": { - "useProps": "{{ useGridCardBlockItemProps }}" - }, - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 12 - }, - "rowKey": "id", - "resource": "users", - "collection": "users", - "readPretty": true, - "runWhenParamsChanged": true - }, - "_isJSONSchemaObject": true, - "properties": { - "actionBar": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "GridCardActionInitializers", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "_isJSONSchemaObject": true, - "x-uid": "prx9wnlzqb1", - "x-async": false, - "x-index": 1 - }, - "list": { - "type": "array", - "version": "2.0", - "x-component": "GridCard", - "x-component-props": { - "useProps": "{{ useGridCardBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "item": { - "type": "object", - "version": "2.0", - "x-component": "GridCard.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useGridCardItemProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "_isJSONSchemaObject": true, - "x-initializer-props": { - "useProps": "{{ useGridCardItemInitializerProps }}" - }, - "x-uid": "pq895sv6136", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "type": "void", - "version": "2.0", - "x-align": "left", - "x-component": "ActionBar", - "x-initializer": "GridCardItemActionInitializers", - "x-component-props": { - "layout": "one-column", - "useProps": "{{ useGridCardActionBarProps }}" - }, - "_isJSONSchemaObject": true, - "x-uid": "w2c3qcp4nme", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "1ct8yn1jnzn", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "pvnkvtc6tte", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "phodsqwsifq", - "x-async": false, - "x-index": 1 -} -``` - -### 关系数据的栅格卡片 - -```json -{ - "x-uid": "yr79zvl98lc", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "GridCard.Decorator", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 12 - }, - "runWhenParamsChanged": true, - "columnCount": { - "xs": 1, - "md": 12, - "lg": 12, - "xxl": 12 - } - }, - "x-component": "BlockItem", - "x-component-props": { - "useProps": "{{ useGridCardBlockItemProps }}" - }, - "x-designer": "GridCard.Designer", - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "GridCardActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "u36l44beq6a", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "GridCard", - "x-component-props": { - "useProps": "{{ useGridCardBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "GridCard.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useGridCardItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useGridCardItemInitializerProps }}" - }, - "x-uid": "aqxlonv3bpk", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "GridCardItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useGridCardActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "zxhqo81kdf5", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "ed56owlyz1p", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nfpuvrkwkk7", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/index.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/index.md deleted file mode 100644 index d47422275..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/index.md +++ /dev/null @@ -1,255 +0,0 @@ -# 数据区块概述 - -数据可能是某个表(collection)的数据,也可能是某个关系(association)的数据 - -- collection,如 a 表 -- association,如 a.b 关系,关系表为 b - -collection 示例 - -```js -{ - "collection": "a" -} -``` - -association 示例 - -```js -{ - "collection": "b", - "association": "a.b" -} -``` - -数据的操作 - -```bash -: -.: -``` - -实际的请求参数 - -``` - /api/: - /api/:/ - /api///: - /api///:/ -``` - -- collection、association、action 是配置里存好的 -- sourceId、filterByTk 由上下文提供 - -## CollectionRecordProvider - -Record - -```ts -class CollectionRecord { - protected current = {}; - protected parent?: Record; - public isNew = false; - constructor(options = {}) { - const { current, parent, isNew } = options; - this.current = current || {}; - this.parent = parent; - this.isNew = isNew; - } -} -``` - -a:list(**list 外层不套空 RecordPicker**) - -```jsx | pure -{list.map((item) => { - const record = new CollectionRecord({ current: item }); - return -})} -``` - -a:get(view、edit) - -```jsx | pure -const record = new CollectionRecord({ current: item }); - -``` - -a:create - -```jsx | pure -const record = new CollectionRecord({ current, isNew: true }); - -``` - -a.b:list - -```jsx | pure - - {list.map((item) => { - const recordB = new CollectionRecord({ - current: item, - }); - return - })} - -``` - -a.b:get - -```jsx | pure -const recordA = new CollectionRecord({ - current: itemA, -}); -const recordB = new CollectionRecord({ - current: itemB, - parent: recordA, -}); -// 或者 -recordB.setParent(recordA); - - - - -``` - -a.b:create - -```jsx | pure -const recordA = new CollectionRecord({ - current: itemA, -}); -const recordB = new CollectionRecord({ - isNew: true, - parent: recordA, -}); - - - -``` - -## 区块 - -以下重要组件说明 - -- `DataBlockProvider` 数据区块的总称 -- `BlockProvider` 区块的各种参数设置 -- `CollectionProvider` collection 信息 -- `AssociationProvider` association 信息 -- `UseRequestProvider` useRequest 的 result - -没有当前记录的区块,如表格 - -```tsx | pure - - - - - - -
- - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - {props.children} - - - -``` - -有当前记录的区块,如表单 - -```tsx | pure - -
- -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - {props.children} - - - - -``` - -有当前父级记录的区块,如对多关系的表格区块,区块本身不套 RecordPicker - -```tsx | pure - - - - - - - -
- - - - - - - - -
- - - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - {props.children} - - - - -``` - -有父级记录也有当前记录的区块,如关系的表单 - -```tsx | pure - - - - - - - - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - - {props.children} - - - - - -``` diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/kanban.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/kanban.md deleted file mode 100644 index b84b1b62a..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/kanban.md +++ /dev/null @@ -1,160 +0,0 @@ -# Kanban - -## UI Schema - -### 看板区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "t_ehwqkw0ljw2:list", - "x-decorator": "KanbanBlockProvider", - "x-decorator-props": { - "collection": "t_ehwqkw0ljw2", - "resource": "t_ehwqkw0ljw2", - "action": "list", - "groupField": "f_5h4umwf59lc", - "params": { - "sort": ["f_5h4umwf59lc_sort"], - "paginate": false - } - }, - "x-designer": "Kanban.Designer", - "x-component": "CardItem", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "KanbanActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "4vh5t2iohwp", - "x-async": false, - "x-index": 1 - }, - "iwnc45ou960": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "Kanban", - "x-component-props": { - "useProps": "{{ useKanbanBlockProps }}" - }, - "properties": { - "card": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-read-pretty": true, - "x-label-disabled": true, - "x-decorator": "BlockItem", - "x-component": "Kanban.Card", - "x-component-props": { - "openMode": "drawer" - }, - "x-designer": "Kanban.Card.Designer", - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-component-props": { - "dndContext": false - }, - "x-uid": "3v010y09684", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "dk9a5cb9d95", - "x-async": false, - "x-index": 1 - }, - "cardViewer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"View\") }}", - "x-designer": "Action.Designer", - "x-component": "Kanban.CardViewer", - "x-action": "view", - "x-component-props": { - "openMode": "drawer" - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"View record\") }}", - "x-component": "Action.Container", - "x-component-props": { - "className": "nb-action-popup" - }, - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "1lhiyyydpye", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "gisuj0zldz1", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ohly2w4gnwp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "29hjrxcfczh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "0k56h1q80xo", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "uny2d4n5ry4", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "3gga5lop4t6", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/list.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/list.md deleted file mode 100644 index 4e690cb7d..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/list.md +++ /dev/null @@ -1,213 +0,0 @@ -# List - -## UI Schema - -### 列表区块 - -```json -{ - "x-uid": "h9mzrnxokk3", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a:view", - "x-decorator": "List.Decorator", - "x-decorator-props": { - "resource": "a", - "collection": "a", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 10 - }, - "runWhenParamsChanged": true, - "rowKey": "id" - }, - "x-component": "CardItem", - "x-designer": "List.Designer", - "x-component-props": { - "title": "List 区块" - }, - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ListActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "chjgpgd45qz", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "List", - "x-component-props": { - "props": "{{ useListBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "List.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useListItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useListItemInitializerProps }}" - }, - "x-uid": "u45nwmwlone", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "ListItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useListActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "9erso7nhotq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "qkuzlun8frh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "1mfaa48qy5j", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系的列表区块 - -```json -{ - "x-uid": "6tzpnkz60rx", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "List.Decorator", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 10 - }, - "runWhenParamsChanged": true - }, - "x-component": "CardItem", - "x-designer": "List.Designer", - "x-component-props": { - "title": "对多关系的列表区块" - }, - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ListActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "i05xr7nfs26", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "List", - "x-component-props": { - "props": "{{ useListBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "List.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useListItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useListItemInitializerProps }}" - }, - "x-uid": "krerg70a28e", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "ListItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useListActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "9745q36ltfv", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "yxc0lnax9gk", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "6mlzb7p6dvn", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/map.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/map.md deleted file mode 100644 index 0413da64b..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/map.md +++ /dev/null @@ -1,115 +0,0 @@ -# Map - -## UI Schema - -### 地图区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "t_ddo5bd0swdg:list", - "x-decorator": "MapBlockProvider", - "x-decorator-props": { - "collection": "t_ddo5bd0swdg", - "resource": "t_ddo5bd0swdg", - "action": "list", - "fieldNames": { - "field": ["f_tmhy5bbusr8"] - }, - "params": { - "paginate": false - } - }, - "x-designer": "MapBlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "MapActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 16 - } - }, - "x-uid": "ap0xzy32bms", - "x-async": false, - "x-index": 1 - }, - "1672zefmplu": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "MapBlock", - "x-component-props": { - "useProps": "{{ useMapBlockProps }}" - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "vce3u8hfdrf", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "waw7z3qw7nn", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "szyybarlapl", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "83m07ksqbal", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5cquhqq2161", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "p42awfpfnbf", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/data/table.md b/packages/core/client/docs/en-US/ui-schema/blocks/data/table.md deleted file mode 100644 index 4c99e2554..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/data/table.md +++ /dev/null @@ -1,193 +0,0 @@ -# Table - -## UI Schema - -### 表格区块 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-decorator": "TableBlockProvider", - "x-acl-action": "users:list", - "x-filter-targets": [], - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 20 - }, - "rowKey": "id", - "dragSort": false, - "resource": "users", - "showIndex": true, - "collection": "users", - "disableTemplate": false - }, - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "TableActionInitializers", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "_isJSONSchemaObject": true, - "x-uid": "55tgsn1puqk", - "x-async": false, - "x-index": 1 - }, - "g22il5nkv67": { - "type": "array", - "version": "2.0", - "x-component": "TableV2", - "x-initializer": "TableColumnInitializers", - "x-component-props": { - "rowKey": "id", - "useProps": "{{ useTableBlockProps }}", - "rowSelection": { - "type": "checkbox" - } - }, - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "title": "{{ t(\"Actions\") }}", - "version": "2.0", - "x-designer": "TableV2.ActionColumnDesigner", - "x-component": "TableV2.Column", - "x-decorator": "TableV2.Column.ActionBar", - "x-initializer": "TableActionColumnInitializers", - "x-action-column": "actions", - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "version": "2.0", - "x-component": "Space", - "x-decorator": "DndContext", - "x-component-props": { - "split": "|" - }, - "_isJSONSchemaObject": true, - "x-uid": "qkcugf5l0h6", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "kbgbskxsj3j", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "6r8e3mhnuxg", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "b87bbc5x0cp", - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "TableBlockProvider", - "x-acl-action": "a.o2m:list", - "x-decorator-props": { - "collection": "b", - "resource": "a.o2m", - "action": "list", - "params": { - "pageSize": 20 - }, - "showIndex": true, - "dragSort": false, - "disableTemplate": false, - "association": "a.o2m" - }, - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "TableActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "0gwze38mzps", - "x-async": false, - "x-index": 1 - }, - "0wuk1cpy5zp": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-initializer": "TableColumnInitializers", - "x-component": "TableV2", - "x-component-props": { - "rowKey": "id", - "rowSelection": { - "type": "checkbox" - }, - "useProps": "{{ useTableBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Actions\") }}", - "x-action-column": "actions", - "x-decorator": "TableV2.Column.ActionBar", - "x-component": "TableV2.Column", - "x-designer": "TableV2.ActionColumnDesigner", - "x-initializer": "TableActionColumnInitializers", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "DndContext", - "x-component": "Space", - "x-component-props": { - "split": "|" - }, - "x-uid": "gq0nkc7rf0q", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "zx97354nzfq", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nss8uocacdq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "0j5kcrius5z", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/filter/collapse.md b/packages/core/client/docs/en-US/ui-schema/blocks/filter/collapse.md deleted file mode 100644 index 0bb30600a..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/filter/collapse.md +++ /dev/null @@ -1,41 +0,0 @@ -# Collapse - -## UI Schema - -### 折叠面板 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "AssociationFilter.Provider", - "x-decorator-props": { - "collection": "users", - "blockType": "filter", - "associationFilterStyle": { - "width": "100%" - }, - "name": "filter-collapse" - }, - "x-designer": "AssociationFilter.BlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "x8q0r7wp73e": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-action": "associateFilter", - "x-initializer": "AssociationFilter.FilterBlockInitializer", - "x-component": "AssociationFilter", - "x-uid": "j11suxuizte", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "0g6pyonrj83", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/filter/form.md b/packages/core/client/docs/en-US/ui-schema/blocks/filter/form.md deleted file mode 100644 index f0145c51b..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/filter/form.md +++ /dev/null @@ -1,63 +0,0 @@ -# Form - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "FilterFormBlockProvider", - "x-decorator-props": { - "resource": "users", - "collection": "users" - }, - "x-designer": "FormV2.FilterDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "x-filter-operators": {}, - "properties": { - "dwltvxybiir": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FilterFormItemInitializers", - "x-uid": "aggw48stzwc", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "FilterFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "float": "right" - } - }, - "x-uid": "7aogdo89a7s", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "wreuz6dr1pc", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "7d1o5bruekl", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/index.md b/packages/core/client/docs/en-US/ui-schema/blocks/index.md deleted file mode 100644 index 07dd0c5c7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/index.md +++ /dev/null @@ -1 +0,0 @@ -# Overview diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/others/iframe.md b/packages/core/client/docs/en-US/ui-schema/blocks/others/iframe.md deleted file mode 100644 index 58a2bf038..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/others/iframe.md +++ /dev/null @@ -1,22 +0,0 @@ - -# iframe - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "Iframe.Designer", - "x-component": "Iframe", - "x-decorator": "BlockItem", - "x-component-props": {}, - "x-decorator-props": { - "name": "iframe" - }, - "_isJSONSchemaObject": true, - "x-uid": "fmmlqe8rrei", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/others/markdown.md b/packages/core/client/docs/en-US/ui-schema/blocks/others/markdown.md deleted file mode 100644 index 478fafd2c..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/others/markdown.md +++ /dev/null @@ -1,24 +0,0 @@ -# Markdown - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "Markdown.Void.Designer", - "x-editable": false, - "x-component": "Markdown.Void", - "x-decorator": "CardItem", - "x-component-props": { - "content": "This is a demo text, **supports Markdown syntax**." - }, - "x-decorator-props": { - "name": "markdown" - }, - "_isJSONSchemaObject": true, - "x-uid": "w75e9d5vs1e", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/blocks/others/workflow-todo.md b/packages/core/client/docs/en-US/ui-schema/blocks/others/workflow-todo.md deleted file mode 100644 index 9f477e5d7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/blocks/others/workflow-todo.md +++ /dev/null @@ -1,33 +0,0 @@ -# Workflow todos - -## x-designer - -- TableBlockDesigner(不适合直接用表格区块的) - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-decorator": "WorkflowTodo.Decorator", - "x-decorator-props": {}, - "_isJSONSchemaObject": true, - "properties": { - "todos": { - "type": "void", - "version": "2.0", - "x-component": "WorkflowTodo", - "_isJSONSchemaObject": true, - "x-uid": "xq1qcdpq7rq", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "3z3ey8r6ik9", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/cascader-select.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/cascader-select.md deleted file mode 100644 index 94547e50c..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/cascader-select.md +++ /dev/null @@ -1 +0,0 @@ -# 级联选择器 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/file-manager.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/file-manager.md deleted file mode 100644 index 5b02970f7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/file-manager.md +++ /dev/null @@ -1 +0,0 @@ -# 文件管理器 diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/index.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/index.md deleted file mode 100644 index e9f57784b..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# 关系字段组件 - -### 标题 Read pretty - -### 标签 Read pretty - -### 子详情 Read pretty - -### 子表单 Editable - -### 子表单(弹窗) Editable - -### 下拉选择器 Editable - -### 数据选择器 Editable - -### 级联选择器 Editable - -### 文件管理器 Editable - -### 子表格 Editable Read pretty diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/record-picker.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/record-picker.md deleted file mode 100644 index ae439f012..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/record-picker.md +++ /dev/null @@ -1 +0,0 @@ -# 数据选择器 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/select.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/select.md deleted file mode 100644 index 9df4627f7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/select.md +++ /dev/null @@ -1 +0,0 @@ -# 下拉选择器 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-details.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-details.md deleted file mode 100644 index a509906e4..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-details.md +++ /dev/null @@ -1 +0,0 @@ -# 子详情 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form-popover.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form-popover.md deleted file mode 100644 index acc10f4a7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form-popover.md +++ /dev/null @@ -1 +0,0 @@ -# 子表单 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form.md deleted file mode 100644 index acc10f4a7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-form.md +++ /dev/null @@ -1 +0,0 @@ -# 子表单 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-table.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-table.md deleted file mode 100644 index 9556a6c5c..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/sub-table.md +++ /dev/null @@ -1 +0,0 @@ -# 子表格 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/tag.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/tag.md deleted file mode 100644 index f927916b3..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/tag.md +++ /dev/null @@ -1 +0,0 @@ -# 标签 diff --git a/packages/core/client/docs/en-US/ui-schema/fields/association-components/title.md b/packages/core/client/docs/en-US/ui-schema/fields/association-components/title.md deleted file mode 100644 index e8a280714..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/association-components/title.md +++ /dev/null @@ -1 +0,0 @@ -# 标题 \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/form-item.md b/packages/core/client/docs/en-US/ui-schema/fields/form-item.md deleted file mode 100644 index 74112ffb2..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/form-item.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormItem - 表单项 - -## UI Schema - -### 表单字段 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "string", - "x-designer": "FormItem.Designer", - "x-component": "CollectionField", - "x-decorator": "FormItem", - "x-collection-field": "a.id", - "x-component-props": {}, - "x-read-pretty": true, - "x-uid": "u2nk80cguoa", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/en-US/ui-schema/fields/index.md b/packages/core/client/docs/en-US/ui-schema/fields/index.md deleted file mode 100644 index e734184db..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Overview - -## UI Schema 协议 - -- `x-collection-field` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/fields/table-column.md b/packages/core/client/docs/en-US/ui-schema/fields/table-column.md deleted file mode 100644 index 61598b8f6..000000000 --- a/packages/core/client/docs/en-US/ui-schema/fields/table-column.md +++ /dev/null @@ -1,40 +0,0 @@ -# 表格列 - -## UI Schema - -### 表格列 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "TableV2.Column.Decorator", - "x-designer": "TableV2.Column.Designer", - "x-component": "TableV2.Column", - "properties": { - "f_beilggsbj0r": { - "_isJSONSchemaObject": true, - "version": "2.0", - "x-collection-field": "a.f_beilggsbj0r", - "x-component": "CollectionField", - "x-component-props": { - "ellipsis": true - }, - "x-read-pretty": true, - "x-decorator": null, - "x-decorator-props": { - "labelStyle": { - "display": "none" - } - }, - "x-uid": "h5u4xi7uvji", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "z8p8ezctwsh", - "x-async": false, - "x-index": 2 -} -``` diff --git a/packages/core/client/docs/en-US/ui-schema/globals/menu.md b/packages/core/client/docs/en-US/ui-schema/globals/menu.md deleted file mode 100644 index 69a4e6a80..000000000 --- a/packages/core/client/docs/en-US/ui-schema/globals/menu.md +++ /dev/null @@ -1,127 +0,0 @@ -# Menu - - -菜单模块以后会重构,Item 直接用 items 对接,不用 schema 嵌套,Menu 也会开放到更多场景里使用。 - - -## `x-initializer` - -- MenuItemInitializers - -## `x-designer` - -- Menu.Designer - -## `x-settings` - -- MenuSettings - -## UI Schema - -### 菜单 - -```json -{ - "type": "void", - "x-component": "Menu", - "x-designer": "Menu.Designer", - "x-initializer": "MenuItemInitializers", - "x-component-props": { - "mode": "mix", - "theme": "dark", - "onSelect": "{{ onSelect }}", - "sideMenuRefScopeKey": "sideMenuRef" - }, - "name": "lap9zil5z4u", - "x-uid": "x77wpukk3qz", - "x-async": false -} -``` - -### 菜单分组 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Group", - "x-component": "Menu.SubMenu", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "icon": "alipaycircleoutlined", - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "zjxw5sph3do", - "x-async": false, - "x-index": 1 -} -``` - -### 菜单页面 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Page1", - "x-component": "Menu.Item", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "icon": "alipaycircleoutlined", - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "y0jp661nb8i", - "x-async": false, - "x-index": 2 -} -``` - -### 链接 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Link", - "x-component": "Menu.URL", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "href": "#", - "icon": "alipaycircleoutlined" - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "ynembhzwcj1", - "x-async": false, - "x-index": 3 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/globals/page.md b/packages/core/client/docs/en-US/ui-schema/globals/page.md deleted file mode 100644 index 2f93084f7..000000000 --- a/packages/core/client/docs/en-US/ui-schema/globals/page.md +++ /dev/null @@ -1,94 +0,0 @@ -# Page - - -现在页面依赖菜单,以后会独立出来,也可以创建无菜单的页面。另外,页面的标签页的设计还有问题。 - - -## `x-initializer` - -- PageTabsInitializers(暂无) -- BlockInitializers - -## `x-designer` - -- PageDesigner(暂无) -- PageTabsDesigner(暂无) - -## `x-settings` - -- PageSettings - -## UI Schema - -### 页面区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Page", - "title": "AA333", - "x-component-props": { - "enablePageTabs": true, - "hidePageTitle": true, - "disablePageHeader": true - }, - "properties": { - "nzxygx0iady": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "x-uid": "z8hxh8fxksb", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "9stdz1ld2p5", - "x-async": true, - "x-index": 1 -} -``` - -### 页面标签页 - -```json -{ - "x-uid": "cqq0ythy0yj", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Page", - "x-component-props": { - "enablePageTabs": true - }, - "properties": { - "o8gqaximg8c": { - "x-uid": "lzz2tqi8sxp", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "title": "Tab1", - "x-async": false, - "x-index": 1 - }, - "zjl1itzi6t8": { - "x-uid": "x10ru2grypq", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Tab2", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "x-async": false, - "x-index": 2 - } - }, - "x-async": true, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/en-US/ui-schema/globals/tabs.md b/packages/core/client/docs/en-US/ui-schema/globals/tabs.md deleted file mode 100644 index c3ccea468..000000000 --- a/packages/core/client/docs/en-US/ui-schema/globals/tabs.md +++ /dev/null @@ -1,5 +0,0 @@ -# Tabs - - -标签页以后会重构,相关场景有页面的标签页和弹窗里的标签页 - diff --git a/packages/core/client/docs/en-US/ui-schema/index.md b/packages/core/client/docs/en-US/ui-schema/index.md deleted file mode 100644 index d908d9ed2..000000000 --- a/packages/core/client/docs/en-US/ui-schema/index.md +++ /dev/null @@ -1,25 +0,0 @@ -# 概述 - -## `x-initializer` - -不是所有节点都能使用 `x-initializer`,内置的 Schema 组件里,只有 Grid、ActionBar、Tabs、Table 组件有 `x-initializer` 参数 - -- Grid(通用) -- ActionBar(通用) -- Tabs(通用) -- Table -- Menu - -## `x-designer` - -`x-designer` 通常需要和 `BlockItem`、`FormItem`、`CardItem` 这类组件结合使用 - -完整的 Designer 组件有 - -- DragHandler -- Initializer -- Settings - -```tsx | pure - -``` diff --git a/packages/core/client/docs/zh-CN/core/application/application.md b/packages/core/client/docs/zh-CN/core/application/application.md deleted file mode 100644 index b33fe9bbf..000000000 --- a/packages/core/client/docs/zh-CN/core/application/application.md +++ /dev/null @@ -1,374 +0,0 @@ -# Application - -## new Application(options) - -创建一个 NocoBase 应用。 - -- 类型 - -```tsx | pure -export interface ApplicationOptions { - apiClient?: APIClientOptions | APIClient; - ws?: WebSocketClientOptions | boolean; - i18n?: i18next; - providers?: (ComponentType | ComponentAndProps)[]; - plugins?: PluginType[]; - components?: Record; - scopes?: Record; - router?: RouterOptions; - schemaSettings?: SchemaSetting[]; - schemaInitializers?: SchemaInitializer[]; - loadRemotePlugins?: boolean; - dataSourceManager?: DataSourceManagerOptions; -} -``` - -- 详细信息 - - apiClient:API 请求实例,具体说明请参见:[https://docs.nocobase.com/api/sdk](https://docs.nocobase.com/api/sdk) - - i18n:国际化,具体请参考:[https://www.i18next.com/overview/api#createinstance](https://www.i18next.com/overview/api#createinstance) - - providers:上下文 - - components:全局组件 - - scopes:全局 scopes - - router:配置路由,具体请参考:[RouterManager](/core/application/router-manager) - - pluginSettings: [PluginSettingsManager](/core/application/plugin-settings-manager) - - schemaSettings:Schema 设置工具,具体参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) - - schemaInitializers:Schema 添加工具,具体参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) - - loadRemotePlugins:用于控制是否加载远程插件,默认为 `false`,即不加载远程插件(方便单测和 DEMO 环境)。 - - dataSourceManager:数据源管理器,具体参考:[DataSourceManager](/core/data-source/data-source-manager) -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import { Application, Plugin } from '@nocobase/client'; - -const ProviderDemo = ({ children }) => { - return
-
hello world
-
{children}
-
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - } -} - -const app = new Application({ - providers: [ProviderDemo], - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -## 实例属性 - -### app.i18n - -```tsx | pure -class Application { - i18n: i18next; -} -``` - -详细介绍,请参考:[i18next](https://www.i18next.com/overview/api#createinstance) - -### app.apiClient - -```tsx | pure -class Application { - apiClient: APIClient; -} -``` - -详细介绍,请参考:[APIClient](https://docs.nocobase.com/api/sdk) - -### app.router - -详细介绍,请参考:[RouterManager](/core/application/router-manager) - -### app.pluginSettingsManager - -详细介绍,请参考:[PluginSettingsManager](/core/application/plugin-settings-manager) - -### app.schemaSettingsManager - -详细介绍,请参考:[SchemaSettingsManager](/core/ui-schema/schema-initializer-manager) - -### app.schemaInitializerManager - -详细介绍,请参考:[SchemaInitializerManager](/core/ui-schema/schema-initializer-manager) - -### app.dataSourceManager - -详细介绍,请参考:[dataSourceManager](/core/data-source/data-source-manager) - -## 实例方法 - -### app.getRootComponent() - -获取应用的根组件。 - -- 类型 - -```tsx | pure -class Application { - getRootComponent(): React.FC -} -``` - -- 示例 - -```tsx | pure -import { Application } from '@nocobase/client'; - -const app = new Application(); - -const App = app.getRootComponent(); -``` - -### app.mount() - -将应用实例挂载在一个容器元素中。 - -- 类型 - -```tsx | pure -class Application { - mount(containerOrSelector: Element | ShadowRoot | string): ReactDOM.Root -} -``` - -- 示例 - -```tsx | pure -import { Application } from '@nocobase/client'; - -const app = new Application(); - -app.mount('#root'); -``` - -### app.addProvider() - -添加 `Provider` 上下文。 - -- 类型 - -```tsx | pure -class Application { - addProvider(component: ComponentType, props?: T): void; -} -``` - -- 详细信息 - -第一个参数是组件,第二个参数是组件的参数。注意 `Provider` 一定要渲染 `children`。 - -- 示例 - -```tsx | pure -// 场景1:第三方库,或者自己创建的 Context -const MyContext = createContext({}); -app.addProvider(MyContext.provider, { value: { color: 'red' } }); -``` - -```tsx -import { createContext, useContext } from 'react'; -import { Application, Plugin } from '@nocobase/client'; - -const MyContext = createContext(); - -const HomePage = () => { - const { color } = useContext(MyContext) || {}; - return
home page
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.addProvider(MyContext.Provider, { value: { color: 'red' } }); - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -```tsx | pure -// 场景2:自定义的组件,注意 children -const GlobalDemo = ({ name, children }) => { - return
-
hello, { name }
-
{ children }
-
-} -app.addProvider(GlobalDemo, { name: 'nocobase' }); -``` - - -```tsx -import { Application, Plugin } from '@nocobase/client'; - -const GlobalDemo = ({ name, children }) => { - return
-
hello, { name }
-
{ children }
-
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.addProvider(GlobalDemo, { name: 'nocobase' }); - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - - -### app.addProviders() - -添加多个 `Provider` 上下文。 - -- 类型 - -```tsx | pure -class Application { - addProviders(providers: (ComponentType | [ComponentType, any])[]): void; -} -``` - -- 详细信息 - -一次添加多个 `Provider`。 - -- 示例 - -```tsx | pure -app.addProviders([[MyContext.provider, { value: { color: 'red' } }], [GlobalDemo, { name: 'nocobase' }]]) -``` - -### app.addComponents() - -添加全局组件。 - -全局组件可以使用在 [RouterManager](/core/application/router-manager) 和 [UI Schema](/core/ui-schema/schema-component)上。 - -- 类型 - -```tsx | pure -class Application { - addComponents(components: Record): void; -} -``` - -- 示例 - -```tsx | pure -app.addComponents({ Demo, Foo, Bar }) -``` - -### app.addScopes() - -添加全局的 scope。 - -全局组 scope 可以 [UI Schema](/core/ui-schema/schema-component) 上。 - -- 类型 - -```tsx | pure -class Application { - addScopes(scopes: Record): void; -} -``` - -- 示例 - -```tsx | pure -function useSomeThing() {} -const anyVar = ''; - -app.addScopes({ useSomeThing, anyVar }) -``` - -## Hooks - -### useApp() - -获取当前应用的实例。 - -- 类型 - -```tsx | pure -const useApp: () => Application -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const app = useApp(); - return
{ JSON.stringify(app.router.getRouters()) }
-} -``` - -```tsx -import { Application, Plugin, useApp } from '@nocobase/client'; - -const HomePage = () => { - const app = useApp(); - return
{ JSON.stringify(app.router.getRoutes()) }
-} - -class MyPlugin extends Plugin { - async load(){ - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - } -} - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` diff --git a/packages/core/client/docs/zh-CN/core/application/plugin-manager.md b/packages/core/client/docs/zh-CN/core/application/plugin-manager.md deleted file mode 100644 index 342420f32..000000000 --- a/packages/core/client/docs/zh-CN/core/application/plugin-manager.md +++ /dev/null @@ -1,122 +0,0 @@ -# PluginManager - -用于管理插件。 - -```tsx | pure -class PluginManager { - add(plugin: typeof Plugin, opts?: PluginOptions): Promise - - get(PluginClass: T): InstanceType; - get(name: string): T; -} -``` - -## 实例方法 - -### pluginManager.add() - -将插件添加到应用中。 - -- 类型 - -```tsx | pure -class PluginManager { - add(plugin: typeof Plugin, opts?: PluginOptions): Promise -} -``` - -- 详细信息 - -第一个参数是插件类,第二个则是实例化时传递的参数。前面已经讲过会在添加插件后,立即调用 `afterAdd` 钩子函数,所以返回的是 `Promise`。 - -对于远程组件而言,会自动传递一个 `name` 参数。 - -- 示例 - -```tsx | pure -class MyPluginA extends Plugin { - async load() { - console.log('options', this.options) - console.log('app', this.app); - console.log('router', this.app.router, this.router); - } -} - -class MyPluginB extends Plugin { - // 需要在 afterAdd 执行添加的方法 - async afterAdd() { - // 通过 `app.pluginManager.add()` 添加插件时,第一个参数是插件类,第二个参数是实例化时传递的参数 - this.app.pluginManager.add(MyPluginA, { name: 'MyPluginA', hello: 'world' }) - } -} - -const app = new Application({ - plugins: [MyPluginB], -}); -``` - -### pluginManager.get() - -获取插件实例。 - -- 类型 - -```tsx | pure -class PluginManager { - get(PluginClass: T): InstanceType; - get(name: string): T; -} -``` - -- 详细信息 - -可以通过 Class 获取插件示例,如果在插件注册的时候有 name,也可以通过字符串的 name 获取。 - -如果是远程插件,会自动传入 name,值为 package 的 name。 - -- 示例 - -```tsx | pure -import MyPluginA from 'xxx'; - -class MyPluginB extends Plugin { - async load() { - // 方式1:通过 Class 获取 - const myPluginA = this.app.pluginManager.get(MyPluginA); - - // 方式2:通过 name 获取(添加的时候要传递 name 参数) - const myPluginA = this.app.pluginManager.get('MyPluginA'); - } -} -``` - -## Hooks - -获取插件实例,等同于 `pluginManager.get()`。 - -### usePlugin() - -```tsx | pure -function usePlugin(plugin: T): InstanceType; -function usePlugin(name: string): T; -``` - -- 详细信息 - -可以通过 Class 获取插件示例,如果在插件注册的时候有 name,也可以通过字符串的 name 获取。 - -- 示例 - -```tsx | pure -import { usePlugin } from '@nocobase/client'; - -const Demo = () => { - // 通过 Class 获取 - const myPlugin = usePlugin(MyPlugin); - - // 通过 name 获取(添加的时候要传递 name 参数) - const myPlugin = usePlugin('MyPlugin'); - - return
-} -``` diff --git a/packages/core/client/docs/zh-CN/core/application/plugin-settings-manager.md b/packages/core/client/docs/zh-CN/core/application/plugin-settings-manager.md deleted file mode 100644 index 34e6f8c67..000000000 --- a/packages/core/client/docs/zh-CN/core/application/plugin-settings-manager.md +++ /dev/null @@ -1,269 +0,0 @@ -# PluginSettingsManager - -![](../static/plugin-settings.jpg) - -用于管理插件配置页面,其底层对应着 [RouterManager](/core/application/router-manager)。 - -```tsx | pure -interface PluginSettingOptionsType { - title: string; - /** - * @default `Outlet` - */ - Component?: ComponentType | string; - icon?: string; - /** - * sort, the smaller the number, the higher the priority - * @default 0 - */ - sort?: number; - aclSnippet?: string; -} - -interface PluginSettingsPageType { - label?: string; - title: string; - key: string; - icon: any; - path: string; - sort?: number; - name?: string; - isAllow?: boolean; - topLevelName?: string; - aclSnippet: string; - children?: PluginSettingsPageType[]; -} - -class PluginSettingsManager { - add(name: string, options: PluginSettingOptionsType): void - get(name: string, filterAuth?: boolean): PluginSettingsPageType; - getList(filterAuth?: boolean): PluginSettingsPageType[] - has(name: string): boolean; - remove(name: string): void; - getRouteName(name: string): string - getRoutePath(name: string): string; - hasAuth(name: string): boolean; -} -``` - -## 实例方法 - -### pluginSettingsManager.add() - -添加插件配置页。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - add(name: string, options: PluginSettingOptionsType): void -} -``` - -- 详细解释 - -第一个参数 `name`,是路由唯一标识,用于后续的删改查,并且 `name` 支持 `.` 用于分割层级,不过需要注意当使用 `.` 分层的时候,父级要使用 [Outlet](https://reactrouter.com/en/main/components/outlet),让子元素能正常渲染。 - -第二个参数中 `Component` 支持组件形式和字符串形式,如果是字符串组件,要先通过 [app.addComponents](/core/application/application#appaddcomponents) 进行注册,具体参考 [RouterManager](/core/application/router-manager)。 - -- 示例 - -单层级配置。 - -```tsx | pure -const HelloSettingPage = () => { - return
hello setting page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.add('hello', { - title: 'Hello', // menu title and page title - icon: 'ApiOutlined', // menu icon - Component: HelloSettingPage - }) - } -} -``` - -多层级配置。 - -```tsx | pure -// 多层级配置页 - -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.add('hello', { - title: 'HelloWorld', - icon: '', - // Component: Outlet, 默认为 react-router-dom 的 Outlet 组件,可自定义 - }) - - this.app.pluginSettingsManager.add('hello.demo1', { - title: 'Demo1 Page', - Component: () =>
Demo1 Page Content
- }) - - this.app.pluginSettingsManager.add('hello.demo2', { - title: 'Demo2 Page', - Component: () =>
Demo2 Page Content
- }) - } -} -``` - -### pluginSettingsManager.get() - -获取配置信息。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - get(name: string, filterAuth?: boolean): PluginSettingsPageType; -} -``` - -- 详细解释 - -第一个是在添加时的 name 参数,第二个参数是是否在获取的时候进行权限过滤。 - -- 示例 - -在组件中获取。 - -```tsx | pure -const Demo = () => { - const app = useApp(); - const helloSettingPage = this.app.pluginSettingsManager.get('hello'); -} -``` - -在插件中获取。 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const helloSettingPage = this.app.pluginSettingsManager.get('hello') - const helloSettingPage = this.app.pluginSettingsManager.get('hello', false); - - const mobileAppConfigPage = this.app.pluginSettingsManager.get('mobile.app') - } -} -``` - -### pluginSettingsManager.getList() - -获取插件配置页列表。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getList(filterAuth?: boolean): PluginSettingsPageType[] -} -``` - -- 详细解释 - -`filterAuth` 默认值为 `true`,即进行权限过滤。 - -- 示例 - -```tsx | pure -const Demo = () => { - const app = useApp(); - const settings = app.pluginSettingsManager.getList(); - const settings = app.pluginSettingsManager.getList(false); -} -``` - -### pluginSettingsManager.has() - -判断是否存在,内部已进行权限过滤。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - has(name: string): boolean; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.pluginSettingsManager.has('hello'); - } -} -``` - -### pluginSettingsManager.remove() - -移除配置。 - -```tsx | pure -class PluginSettingsManager { - remove(name: string): void; -} -``` - -### pluginSettingsManager.getRouteName() - -获取对应路由的名称。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getRouteName(name: string): string -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const helloRouteName = this.pluginSettingsManager.getRouteName('hello'); // admin.settings.hello - } -} -``` - -### pluginSettingsManager.getRoutePath() - -获取插件配置对应的页面路径。 - -- 类型 - -```tsx | pure -class PluginSettingsManager { - getRoutePath(name: string): string; -} -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const navigate = useNavigate(); - const app = useApp(); - const helloSettingPath = app.pluginSettingsManager.getRoutePath('hello'); - - return
navigate(helloSettingPath)}> - go to hello setting page -
-} -``` - -### pluginSettingsManager.hasAuth() - -单独判断是否权限。 - -```tsx | pure -class PluginSettingsManager { - hasAuth(name: string): boolean; -} -``` diff --git a/packages/core/client/docs/zh-CN/core/application/plugin.md b/packages/core/client/docs/zh-CN/core/application/plugin.md deleted file mode 100644 index 5bfcfe42c..000000000 --- a/packages/core/client/docs/zh-CN/core/application/plugin.md +++ /dev/null @@ -1,89 +0,0 @@ -# Plugin - -Plugin 基类。 - -- 类型 - -```tsx | pure -class Plugin { - constructor( - protected options: T, - protected app: Application, - ) { - this.options = options; - this.app = app; - } - - get pluginManager() { - return this.app.pluginManager; - } - - get router() { - return this.app.router; - } - - get pluginSettingsManager() { - return this.app.pluginSettingsManager; - } - - get schemaInitializerManager() { - return this.app.schemaInitializerManager; - } - - get schemaSettingsManager() { - return this.app.schemaSettingsManager; - } - - get dataSourceManager() { - return this.app.dataSourceManager; - } - - async afterAdd() {} - - async beforeLoad() {} - - async load() {} -} -``` - -- 详细信息 - - - 构造函数 - - `options`: 插件的添加有两种方式,一种方式从插件列表中远程加载出来,另一种方式是通过 [PluginManager](/core/application/plugin-manager) 添加 - - 远程加载:`options` 会被自动注入 `{ name: 'npm package.name' }` - - PluginManager `options` 由用户自己传递 - - `app`:此参数是自动注入的,是应用实例 - - 快捷访问:基类提供了对 `app` 部分方法和属性的快捷访问 - - `pluginManager` - - `router` - - `pluginSettingsManager` - - `schemaSettingsManager` - - `schemaInitializerManager` - - 声明周期 - - `afterAdd`:插件被添加后立即执行 - - `beforeLoad`:执行渲染时执行,在 `afterAdd` 之后,`load` 之前 - - `load`:最后执行 -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - - async afterAdd() { - console.log('afterAdd') - } - - async beforeLoad() { - console.log('beforeLoad') - } - - async load() { - console.log('load') - - // 可以访问应用实例 - console.log(this.app) - - // 访问应用实例内容 - console.log(this.app.router, this.router); - } -} -``` diff --git a/packages/core/client/docs/zh-CN/core/application/router-manager.md b/packages/core/client/docs/zh-CN/core/application/router-manager.md deleted file mode 100644 index ef707219c..000000000 --- a/packages/core/client/docs/zh-CN/core/application/router-manager.md +++ /dev/null @@ -1,386 +0,0 @@ -# RouterManager - -用于管理路由。 - -```tsx | pure -import { ComponentType } from 'react'; -import { RouteObject } from 'react-router-dom'; - -interface RouteType extends Omit { - Component?: ComponentType | string; -} - -class RouterManager { - add(name: string, route: RouteType): void; - getRoutes(): Record; - getRoutesTree(): RouteObject[]; - get(name: string): RouteType; - has(name: string): boolean; - remove(name: string): void; - setType(type: 'browser' | 'memory' | 'hash'): void; - setBasename(basename: string): void; -} -``` - -## 实例方法 - -### router.add() - -添加一条路由。 - -- 类型 - -```tsx | pure -class RouterManager { - add(name: string, route: RouteType): void -} -``` - -- 详情 - -第一个参数 `name`,是路由唯一标识,用于后续的删改查,并且 `name` 支持 `.` 用于分割层级,不过需要注意当使用 `.` 分层的时候,父级要使用 [Outlet](https://reactrouter.com/en/main/components/outlet),让子元素能正常渲染。 - -第二个参数 `RouteType` 的 `Component` 支持组件形式和字符串形式,如果是字符串组件,要先通过 [app.addComponents](/core/application/application#appaddcomponents) 进行注册。 - -- 示例 - -单层级路由。 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.add('home', { - path: '/', - Component: () =>
home page
- }) - this.app.router.add('login', { - path: '/login', - element:
login page
- }) - } -} -``` - -```tsx -import { useNavigate } from 'react-router-dom'; -import { Plugin, Application } from '@nocobase/client'; - -const HomePage = () => { - const navigate = useNavigate(); - return
-
home page
- -
-} - -const LoginPage = () => { - const navigate = useNavigate(); - return
-
login page
- -
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('home', { - path: '/', - Component: HomePage - }) - this.app.router.add('login', { - path: '/login', - Component: LoginPage - }) - } -} - - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/'], - } -}); - -export default app.getRootComponent(); -``` - -多层级路由。 - -```tsx | pure -import { Plugin } from '@nocobase/client'; -import { Outlet } from 'react-router-dom'; - -const AdminLayout = () =>{ - return
-
This is admin layout
- -
-} - -const AdminSettings = () => { - return
This is admin settings page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('admin', { - path: '/admin', - Component: AdminLayout - }) - this.app.router.add('admin.settings', { - path: '/admin/settings', - Component: AdminSettings , - }) - } -} -``` - - -```tsx -import { useNavigate, Outlet } from 'react-router-dom'; -import { Plugin, Application } from '@nocobase/client'; - -const AdminLayout = () =>{ - return
-
This is admin layout
- -
-} - -const AdminSettings = () => { - return
This is admin settings page
-} - -class MyPlugin extends Plugin { - async load() { - this.app.router.add('admin', { - path: '/admin', - Component: AdminLayout - }) - this.app.router.add('admin.settings', { - path: '/admin/settings', - Component: AdminSettings , - }) - } -} - - -const app = new Application({ - plugins: [MyPlugin], - router: { - type: 'memory', - initialEntries: ['/admin/settings'], - } -}); - -export default app.getRootComponent(); -``` - -`Component` 参数为字符串。 - -```tsx | pure -const LoginPage = () => { - return
login page
-} - -class MyPlugin extends Plugin { - async load() { - // 通过 app.addComponents 进行注册 - this.app.addComponents({ LoginPage }) - - this.app.router.add('login', { - path: '/login', - Component: 'LoginPage', // 这里可以使用字符串了 - }) - } -} -``` - -### router.getRoutes() - -获取路由列表。 - -- 类型 - -```tsx | pure -class RouterManager { - getRoutes(): Record -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - console.log(this.app.router.getRoutes()); - } -} -``` - -![](../static/CxjJbp0pcogYn6xviVyc6QT8nUg.png) - -### router.getRoutesTree() - -获取用于 [useRoutes()](https://reactrouter.com/hooks/use-routes) 的数据。 - -- 类型 - -```tsx | pure -class RouterManager { - getRoutesTree(): RouteObject[] -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const routes = this.app.router.getRoutesTree(); - } -} -``` - -### router.get() - -获取单个路由配置。 - -- 类型 - -```tsx | pure -class RouterManager { - get(name: string): RouteType -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const adminRoute = this.app.router.get('admin') - const adminSettings = this.app.router.get('admin.settings') - } -} -``` - -### router.has() - -判断是否添加过路由。 - -- 类型 - -```tsx | pure -class RouterManager { - has(name: string): boolean; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasAdminRoute = this.app.router.has('admin') - const hasAdminSettings = this.app.router.has('admin.settings') - } -} -``` - -### router.remove() - -移除路由配置。 - -- 类型 - -```tsx | pure -class RouterManager { - remove(name: string): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.remove('admin') - this.app.router.remove('admin.settings') - } -} -``` - -### router.setType() - -设置路由类型,默认为 `browser`。 - - -- 类型 - -```tsx | pure -class RouterManager { - setType(type: 'browser' | 'memory' | 'hash'): void; -} -``` - -- 详细解释 - - browser: [BrowserRouter](https://reactrouter.com/en/main/router-components/browser-router) - - memory: [MemoryRouter](https://reactrouter.com/en/main/router-components/hash-router) - - hash: [HashRouter](https://reactrouter.com/en/main/router-components/memory-router) - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.setType('hash') - } -} -``` - -### router.setBasename() - -设置 [basename](https://reactrouter.com/en/main/router-components/browser-router#basename)。 - -- 类型 - -```tsx | pure -class RouterManager { - setBasename(basename: string): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.router.setBasename('/') - } -} -``` - -## Hooks - -### useRouter() - -获取当前路由的实例,等同于 `app.router`。 - -- 类型 - -```tsx | pure -const useRouter: () => RouterManager -``` - -- 示例 - -```tsx | pure -import { useRouter } from '@nocobase/client'; - -const Demo = () => { - const router = useRouter(); -} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-block/collection-record-provider.md b/packages/core/client/docs/zh-CN/core/data-block/collection-record-provider.md deleted file mode 100644 index 0cfad105f..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/collection-record-provider.md +++ /dev/null @@ -1,259 +0,0 @@ -# CollectionRecordProvider - -用于提供 [CollectionRecord](./collection-record) 实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface CollectionRecordProviderProps { - isNew?: boolean; - record?: CollectionRecord | DataType; - parentRecord?: CollectionRecord | DataType; - /** - * 当前记录所属的 collection name - */ - collectionName?: string; -} -``` - -- 详解 - -参数的具体说明参见 [CollectionRecord](./collection-record)。 - -需要说明的是 `record` 和 `parentRecord` 即可以是普通的对象,也可以是 [CollectionRecord](./collection-record) 实例,但最终会转为 `CollectionRecord` 实例,并通过 context 传递给子组件。 - -## 示例 - -- record 参数为 CollectionRecord 实例 - -```tsx | pure -import { CollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - - -// 最终向子组件传递的数据为: props.record -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为普通对象 - -```tsx | pure - -// 最终向子组件传递的数据为: const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为 CollectionRecord 实例且带有父记录 - -```tsx | pure -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' }, parentRecord }); - - -// 最终向子组件传递的数据为: props.record -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' }, parentRecord }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为 CollectionRecord 实例,父记录通过 `parentRecord` 参数传递 - -```tsx | pure -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - - - -// 首先设置父记录:record.setParentRecord(parentRecord); -// 最终向子组件传递的数据为:record(带有父记录) -``` - -```tsx -import { CollectionRecord, useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -- record 参数为普通对象,父记录也是普通对象 - -```tsx | pure - - -// 首先实例化父记录:const parentRecord = new CollectionRecord({ data: { id: 1, role: 'admin' } }); -// 然后实例化记录:const record = new CollectionRecord({ data: { id: 1, name: 'foo' } }); -// 最后设置父记录:record.setParentRecord(parentRecord); -// 最终向子组件传递的数据为:record(带有父记录) -``` - - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
{JSON.stringify(record, null, 2)}
; -} - -export default () => -``` - -## Hooks - -### useCollectionRecord() - -用于获取 `CollectionRecordProvider` 组件传递的数据记录。 - -- 示例 - -```tsx | pure -const record = useCollectionRecord(); - -console.log(record, record.data, record.parentRecord, record.parentRecord.data); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - return
-
record:
{JSON.stringify(record, null, 2)}
-
record.data:
{JSON.stringify(record.data, null, 2)}
-
record.parentRecord:
{JSON.stringify(record.parentRecord, null, 2)}
-
record.parentRecord.data:
{JSON.stringify(record.parentRecord.data, null, 2)}
-
; -} - -export default () => -``` - -### useCollectionRecordData() - -直接获取 CollectionRecord 的 `data` 属性,等同于 `useCollectionRecord().data`。 - -- 示例 - -```tsx | pure -const data = useCollectionRecordData(); -const record = useCollectionRecord(); -console.log(data === record.data); -``` - -```tsx -import { useCollectionRecord, useCollectionRecordData, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const data = useCollectionRecordData(); - const record = useCollectionRecord(); - return
-
data === record.data: { JSON.stringify(data === record.data) }
-
data:
{JSON.stringify(data, null, 2)}
-
record.data:
{JSON.stringify(record.data, null, 2)}
-
; -} - -export default () => -``` - -### useCollectionParentRecord() - -直接获取 CollectionRecord 的数据 `parentRecord`,等同于 `useCollectionRecord().parentRecord`。 - -- 示例 - -```tsx | pure -const parentRecord = useCollectionParentRecord(); -const record = useCollectionRecord(); -console.log(parentRecord === record.parentRecord); -``` - -```tsx -import { useCollectionRecord, useCollectionParentRecord, CollectionRecordProvider } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - const parentRecord = useCollectionParentRecord(); - return
-
parentRecord === record.parentRecord: { JSON.stringify(parentRecord === record.parentRecord) }
-
parentRecord:
{JSON.stringify(parentRecord, null, 2)}
-
record.parentRecord:
{JSON.stringify(record.parentRecord, null, 2)}
-
; -} - -export default () => -``` - - -### useCollectionParentRecordData() - -直接获取 CollectionRecord 的数据 `parentRecord.data`,等同于 `useCollectionRecord().parentRecord.data`。 - -- 示例 - -```tsx | pure -const record = useCollectionRecord(); -const parentData = useCollectionParentRecordData(); -const parentRecord = useCollectionParentRecord(); -console.log(parentData === parentRecord.data === record.parentRecord.data); -``` - -```tsx -import { useCollectionRecord, CollectionRecordProvider, useCollectionParentRecordData, useCollectionParentRecord } from '@nocobase/client'; - -const Demo = () => { - const record = useCollectionRecord(); - const parentData = useCollectionParentRecordData(); - const parentRecord = useCollectionParentRecord(); - return
-
parentData:
{JSON.stringify(parentData, null, 2)}
-
parentRecord.data:
{JSON.stringify(parentRecord.data, null, 2)}
-
record.parentRecord.data:
{JSON.stringify(record.parentRecord.data, null, 2)}
-
; -} - -export default () => -``` diff --git a/packages/core/client/docs/zh-CN/core/data-block/collection-record.md b/packages/core/client/docs/zh-CN/core/data-block/collection-record.md deleted file mode 100644 index d2bc6ffa4..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/collection-record.md +++ /dev/null @@ -1,194 +0,0 @@ -# CollectionRecord - -数据表中的一条记录。 - -## 类型 - -```tsx | pure -interface CollectionRecordOptions { - isNew?: boolean; - data?: DataType; - parentRecord?: CollectionRecord; - /** - * 当前记录所属的 collection name - */ - collectionName?: string; -} - -class CollectionRecord { - public isNew?: boolean; - public data?: DataType; - public parentRecord?: CollectionRecord; - public collectionName?: string; - constructor(options: CollectionRecordOptions) {} - - setData(data: DataType) { - this.data = data; - } - - setParentRecord(parentRecord: CollectionRecord) { - this.parentRecord = parentRecord; - } -} -``` - -## 详解 - -### CollectionRecord 基本概念 - -CollectionRecord 类用于提供数据记录,通常情况下对应着后端数据表中的一条记录。以用户表为例,其一条数据对应的 CollectionRecord 类如下: - -```tsx | pure -const useCollectionRecord = new CollectionRecord({ - data: { - "id": 1, - "roleId": 10, - "appLang": null, - "createdById": null, - "email": "test@nocobase.com", - "nickname": "Admin", - "phone": null, - "systemSettings": {}, - "updatedById": null, - "username": "nocobase", - "createdAt": "2023-12-04T09:42:52.953Z", - "updatedAt": "2023-12-04T09:42:52.953Z", - } -}); -``` - -### CollectionRecord 和 Collection 的关系 - -CollectionRecord 是指的数据,而 Collection 则是表结构。对于上面的用户表,其对应的 Collection 如下: - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - fields: [ - { - type: 'bigInt', - name: 'id', - }, - { - type: 'string', - name: 'username', - }, - { - type: 'integer', - name: 'age', - }, - { - "name": "email", - "type": "string", - }, - // .... - ], -}); -``` - -### 父子关系和关系字段 - -对于[关系字段](https://docs.nocobase.com/development/server/collections/association-fields),例如用户和角色的关系,在用户表中会有一个 `roleId` 字段,其值为角色表中的 `id`,当我们通过 `users.roleId` 字段查询用户的角色时: - -```bash | pure -GET /api/users/1/roles:get/10 -``` - -其中 `1` 为用户的 `id`,`10` 为角色的 `id`,我们可以得到用户的角色数据: - -```tsx | pure -const roleRecord = new CollectionRecord({ - data: { - "id": 10, - "name": "member", - "title": "test role", - "strategy": { - "actions": [ - "view", - "update:own", - "destroy:own", - "create" - ] - }, - "createdAt": "2023-03-30T07:53:10.924Z", - "updatedAt": "2023-12-15T02:51:43.577Z", - } -}) -``` - -其中 `users` id 为 1 的记录我们称之为父记录: - -```tsx | pure -roleRecord.setParentRecord(userRecord); -``` - -### 新记录 - -对于新表单,我们可以通过 `isNew` 属性来标识: - -```tsx | pure -const record = new CollectionRecord({ - isNew: true, -}); -``` - -## 示例 - -### 基本使用 - -```tsx | pure -import { CollectionRecord } from '@nocobase/client'; - -const record = new CollectionRecord({ - data: { - name: 'foo', - } -}); -``` - -### 创建空记录 - -```tsx | pure -import { CollectionRecord } from '@nocobase/client'; - -const record = new CollectionRecord({ - isNew: true, -}); -``` - -### 设置 parentRecord - -方式1: 通过构造函数设置 - -```tsx | pure -const parentRecord = new CollectionRecord({ - data: { - foo: 'foo', - } -}); - -const record = new CollectionRecord({ - data: { - name: 'bar', - }, - parentRecord, -}); -``` - -方式2: 通过 `setParentRecord` 方法设置 - -```tsx | pure -const parentRecord = new CollectionRecord({ - data: { - foo: 'foo', - } -}); - -const record = new CollectionRecord({ - data: { - name: 'bar', - } -}); - -record.setParentRecord(parentRecord); -``` diff --git a/packages/core/client/docs/zh-CN/core/data-block/data-block-provider.md b/packages/core/client/docs/zh-CN/core/data-block/data-block-provider.md deleted file mode 100644 index 6aeaec049..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/data-block-provider.md +++ /dev/null @@ -1,246 +0,0 @@ -# DataBlockProvider - -## 区块类型 - -区块分为简单区块和包含各种数据的区块。 - -### 简单区块 - -简单区块例如 Markdown 区块。 - -![](./images/markdown-block.png) - -它只有文本内容,没有其他更多复杂数据,且文本内容是存储在 `schema` 中的,没有存储在数据库中。 - -```json {5}| pure -{ - "type": "void", - "x-component": "Markdown.Void", - "x-component-props": { - "content": "markdown content" - }, -} -``` - -### 数据区块 - -数据区块是指区块的数据存储在服务端的数据表中,例如 Table 组件。 - -![](./images/data-block.png) - -Table 中的字段信息及列表数据,都是存储在数据库中的。 - - -## DataBlockProvider 介绍 - -为了方便对数据区块的数据进行管理,我们提供了 `DataBlockProvider` 组件,其内部封装了: - -- `DataBlockProvider`:封装了下面的所有组件,并提供了区块属性 - - [CollectionProvider](/core/data-source/collection-provider) / [AssociationProvider](/core/data-source/association-provider): 根据 `DataBlockProvider` 提供的上下文信息,查询对应数据表数据及关系字段信息并传递 - - [BlockResourceProvider](/core/data-block/data-block-resource-provider): 根据 `DataBlockProvider` 提供的上下文信息,构建区块 [Resource](https://docs.nocobase.com/api/sdk#resource-action) API,用于区块数据的增删改查 - - [BlockRequestProvider](/core/data-block/data-block-request-provider): 根据 `DataBlockProvider` 提供的上下文信息,自动调用 `BlockResourceProvider` 提供的 `resource.get()` 或 `resource.list()` 发起请求,得到区块数据,并传递 - - [CollectionRecordProvider](/core/data-source/record-provider): 对于 `resource.get()` 场景,会自动嵌套 `CollectionRecordProvider` 并将 `resource.get()` 请求结果传递下去,`resource.list()` 场景则需要自行使用 `CollectionRecordProvider` 提供数据记录 - -```tsx | pure -const DataBlockProvider = (props) => { - return - - / - - - {action !== 'list' && - {props.children} - } - - / - - - -} -``` - -上述组件封装到 `DataBlockProvider` 的内部,只需要使用 `DataBlockProvider` 即可自行得到上述数据。 - -### 使用方式 - -其主要使用在区块的 schema [x-decorator](https://docs.nocobase.com/development/client/ui-schema/what-is-ui-schema#x-decorator) 中,例如: - -```js {5}| pure -{ - type: 'void', - name: 'hello-block', - 'x-component': 'CardItem', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - dataSource: 'main', - action: 'list', - tableProps: { - bordered: true, - } - }, - 'x-use-decorator-props': 'useDynamicDataBlockProps', -} -``` - -### 完整示例 - - - -## 属性 - -### 静态属性和动态属性 - -- schema 中的 `x-decorator-props` 称为静态属性,它是一个普通对象,记录区块的配置信息 -- schema 中的 `x-use-decorator-props` 中的属性称为动态属性,它是一个 React hook,可用于获取例如 URL 上的 ID,或者父级的 context 数据 - -当两者都存在时,会进行深度合并,作为 `DataBlockProvider` 的属性。 - -### 属性详解 - -```ts | pure -interface AllDataBlockProps { - collection?: string; - association?: string; - sourceId?: string | number; - record?: Record; - action?: 'list' | 'get'; - filterByTk?: string; - params?: Record; - parentRecord?: Record; - [index: string]: any; -} -``` - -- collection(`x-decorator-props`):区块的 collection 表名,用于获取区块的字段信息和区块数据 -- association(`x-decorator-props`):区块的关系字段名,用于获取区块的关系字段信息和关系字段数据 -- dataSource(`x-decorator-props`): 数据源,具体可参考 [Data Modeling](https://docs.nocobase.com/manual/data-modeling) -- action(`x-decorator-props`):区块的请求类型,`list` 或 `get` -- params(`x-decorator-props` 和 `x-use-decorator-props`):区块的请求参数,同时存在于 -- filterByTk(`x-use-decorator-props`):相当于 `params.filterByTk`,可理解为 `id`,用于获取单条数据 -- sourceId(`x-use-decorator-props`):区块的 sourceId,配合 `association` 使用,用于获取区块的关系字段数据 -- record(`x-use-decorator-props`):当提供 `record` 时,会使用 `record` 作为区块的数据,不发起请求 -- parentRecord(`x-use-decorator-props`):当提供 `parentRecord` 时,会使用 `parentRecord` 作为关系字段的表数据,不发起请求 - -```tsx | pure -const DataBlockProvider = (props) => { - return - - / - - - {action !== 'list' && - {props.children} - } - - - - - -} -``` - -### 属性组合和场景 - -这些属性根据不同的场景,共有 8 中情况: - -- collection - - 创建:`collection` - - 获取单条数据:`collection` + `action: get` + `params` - - 获取列表数据:`collection` + `action: list` + `params` - - 使用 `record` 作为数据:`collection` + `record` - -对于 *获取单条数据* 和 *获取列表数据* `params` 非必须。 - -- association - - 创建:`association` + `sourceId` - - 获取单条数据:`association` + `sourceId` + `action: get` + `params` + `parentRecord` - - 获取列表数据:`association` + `sourceId` + `action: list` + `params` + `parentRecord` - - 使用 `record` 作为数据:`association` + `sourceId` + `record` + `parentRecord` - - -对于 *获取单条数据* 和 *获取列表数据* `params` 和 `parentRecord` 非必须,当没有 `parentRecord` 会根据 `association` 查询到对应的 `collection`,然后再根据 `collection` 查询到对应的 `parentRecord`。 - -### 属性获取和修改 - -#### useDataBlock() - -可用于获取和修改 `DataBlockProvider` 的属性。 - -- 类型 - -```tsx | pure -interface Result { - props: AllDataBlockProps & T; - dn: Designable; -} -const useDataBlock: () => Result -``` - -- 详解 - -`props` 就对应着上面的 `AllDataBlockProps`。 -`dn` 是 `Designable` 对象,可用于修改 `DataBlockProvider` 的 UI schema,详细见 [Designable](/core/ui-schema/designable)。 - -- 示例 - -```tsx | pure -const { props, dn } = useDataBlock<{ tableProps: { bordered?: boolean } }>(); - -// 获取 -const checked = props.tableProps.bordered; - -// 修改 -dn.deepMerge({ - 'x-decorator-props': { - tableProps: { - bordered: !checked, - }, - }, -}); -``` - -#### useDataBlockProps() - -相当于 `useDataBlock().props`。 - -```tsx | pure -const props = useDataBlockProps<{ tableProps: { bordered?: boolean } }>(); - -const checked = props.tableProps.bordered; -``` - -## 示例 - -### collection - -#### Table list - - - -#### Form get & update - - - -#### Form create - - - -#### Form record & update - - - -### association - -association 与 collection 类似,只是需要提供 `sourceId`,我们以 `Table list` 为例。 - -#### Table list & sourceId - - - -#### Table list & parentRecord - -如果不提供 `sourceId`,则需要提供 `parentRecord`,我们以 `Table list` 为例。 - - - diff --git a/packages/core/client/docs/zh-CN/core/data-block/data-block-request-provider.md b/packages/core/client/docs/zh-CN/core/data-block/data-block-request-provider.md deleted file mode 100644 index 48b5801b3..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/data-block-request-provider.md +++ /dev/null @@ -1,139 +0,0 @@ -# DataBlockRequestProvider - -其内部获取到 [BlockResourceProvider](/core/data-block/data-block-resource-provider) 提供的 `resource`,根据 [BlockProvider](/core/data-block/data-block-provider) 提供的参数,自动调用 `resource.get()` 或者 `resource.list()` 获取的区块的数据,并通过 context 传递下去。 - -## 请求参数 - -请求参数是获取 `DataBlockProvider` 提供中的 `params` 和 `filterByTk`。 - -```ts | pure -const schema = { - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - 'collection': 'users', - 'action': 'list', - // 静态参数 - params: { - pageSize: 10, - } - }, - // 动态参数 - 'x-use-decorator-props': 'useDynamicDataBlockProps', -} - -const useDynamicDataBlockProps: UseDataBlockProps<'CollectionList'> = () => { - return { - params: { - size: 15, - } - } -} -``` - -会自动调用 `resource.list()` 获取数据,发起 `GET /api/users:list?pageSize=10&size=15` 的请求。 - -## Hooks - -### useDataBlockRequest() - -用于获取请求对象,一般用区块组件中。 - -```tsx | pure -const MyTable = () => { - const { data, loading } = useDataBlockRequest(); - - return ( -
- ) -} -``` - -## Record - -### Get 请求 - -对于 `get` 请求,当获取到 `data` 数据后,会通过 `CollectionRecordProvider` 提供 `record` 对象,用于获取当前区块的数据。 - -```ts | pure -const schema = { - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - 'collection': 'users', - 'action': 'get', // get 请求 - }, - // 动态参数 - 'x-use-decorator-props': 'useDynamicFormProps', -} - -const useDynamicDataBlockProps: UseDataBlockProps<'CollectionGet'> = () => { - return { - params: { - filterByTk: 1, - } - } -} -``` - -会自动调用 `resource.get()` 获取数据,发起 `GET /api/users:get/1` 的请求,并通过 `CollectionRecordProvider` 提供上下文。 - -```tsx | pure -const { data } = useDataBlockRequest(); -const record = useCollectionRecord(); // record 上下文数据 - -// 相等 -record.data === data; -``` - -### List 请求 - -对于 `list` 请求则不会提供 `record` 对象,需要自己通过 `` 设置上下文。 - -```tsx | pure -const MyTable = () => { - const { data } = useDataBlockRequest(); - - return ( -
{ - return ( - - - - ) - }, - }, - ]} - pagination={{ - total: data?.meta.total, - pageSize: data?.meta.pageSize, - page: data?.meta.page, - }} - /> - ) -} - -const MyAction = () => { - const record = useCollectionRecord(); - return ( - - ) -} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-block/data-block-resource-provider.md b/packages/core/client/docs/zh-CN/core/data-block/data-block-resource-provider.md deleted file mode 100644 index e94246b6c..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/data-block-resource-provider.md +++ /dev/null @@ -1,36 +0,0 @@ -# DataBlockResourceProvider - -根据 `DataBlockProvider` 中的 `collection`、`association`、`sourceId` 等属性,构建好 [resource](https://docs.nocobase.com/api/sdk#resource-action) 对象,方便子组件对区块数据的增删改查操作,其内置在 [DataBlockProvider](/core/data-block/data-block-provider) 中 - - -## useDataBlockResource - -用于获取当前数据块的 resource 对象。 - -- 类型 - -```ts | pure -function useDataBlockResource(): IResource -``` - -- 示例 - -```ts | pure -const resource = useDataBlockResource(); - -const onSubmit = async (values) => { - // 创建 - await resource.create({ values }); -} -``` - -```ts | pure -const resource = useDataBlockResource(); - -const onDelete = async () => { - // 删除 - await resource.destroy(); -} -``` - -可运行示例 diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx deleted file mode 100644 index 13964b35b..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-parent-record.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React from 'react'; -import { Table, TableProps } from 'antd'; -import { SchemaComponent, UseDataBlockProps, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -const collection = 'users'; -const associationField = 'roles'; - -const association = `${collection}.${associationField}`; -const action = 'list'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - association, - action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Title', - dataIndex: 'title', - }, - { - title: 'Description', - dataIndex: 'description', - }, - ], - }; -} - -const useBlockDecoratorProps: UseDataBlockProps<'CollectionList'> = () => { - const parentRecord = { - id: 1, - username: 'Tom', - }; - return { - parentRecord, - }; -}; - -const Demo = () => { - return ; -}; - -const mocks = { - [`${collection}/1/${associationField}:${action}`]: { - data: [ - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - ], - }, -}; - -const Root = createApp( - Demo, - { - components: { MyTable }, - scopes: { useTableProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx deleted file mode 100644 index e82fde3db..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/association-table-list-and-source-id.tsx +++ /dev/null @@ -1,132 +0,0 @@ -import React from 'react'; -import { Select, Table, TableProps } from 'antd'; -import { SchemaComponent, UseDataBlockProps, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; -import useUrlState from '@ahooksjs/use-url-state'; - -const collection = 'users'; -const associationField = 'roles'; - -const association = `${collection}.${associationField}`; -const action = 'list'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - association, - action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Title', - dataIndex: 'title', - }, - { - title: 'Description', - dataIndex: 'description', - }, - ], - }; -} - -const useBlockDecoratorProps: UseDataBlockProps<'CollectionList'> = () => { - const [state] = useUrlState({ userId: '1' }); - return { - sourceId: state.userId, - }; -}; - -const Demo = () => { - const [state, setState] = useUrlState({ userId: '1' }); - return ( - <> - - - - ); -}; - -const mocks = { - [`${collection}/1/${associationField}:${action}`]: { - data: [ - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - ], - }, - [`${collection}/2/${associationField}:${action}`]: { - data: [ - { - name: 'developer', - title: 'Developer', - description: 'Developer description', - }, - { - name: 'tester', - title: 'Tester', - description: 'Tester description', - }, - ], - }, - [`${collection}:get/1`]: { - id: 1, - username: 'Tom', - }, - [`${collection}:get/2`]: { - id: 1, - username: 'Jack', - }, -}; - -const Root = createApp( - Demo, - { - components: { MyTable }, - scopes: { useTableProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-create.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-create.tsx deleted file mode 100644 index cddd88c89..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-create.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { FC } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, notification } from 'antd'; -import { SchemaComponent, useDataBlockResource, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( - - - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const resource = useDataBlockResource(); - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.create({ - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - onFinish, - }; -} - -const collection = 'users'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: collection, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const Demo = () => { - return ; -}; - -const mocks = { - [`${collection}:create`]: (config) => { - console.log('config.data', config.data); - return [200, { msg: 'ok' }]; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx deleted file mode 100644 index ac5ecc5e5..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-get-and-update.tsx +++ /dev/null @@ -1,158 +0,0 @@ -import React, { FC, useEffect } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, Select, notification } from 'antd'; -import { - SchemaComponent, - UseDataBlockProps, - useDataBlockResource, - useCollectionRecordData, - withDynamicSchemaProps, -} from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; -import useUrlState from '@ahooksjs/use-url-state'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( -
- - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const data = useCollectionRecordData(); - const resource = useDataBlockResource(); - - const [form] = Form.useForm(); - - useEffect(() => { - form.setFieldsValue(data); - }, [data, form]); - - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.update({ - filterByTk: data.id, - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - initialValues: data, - preserve: true, - onFinish, - form, - }; -} -const useBlockDecoratorProps: UseDataBlockProps<'CollectionGet'> = () => { - const [state] = useUrlState({ id: '1' }); - return { - filterByTk: state.id, - }; -}; - -const collection = 'users'; -const action = 'get'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useBlockDecoratorProps', - 'x-decorator-props': { - collection: collection, - action: action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const Demo = () => { - const [state, setState] = useUrlState({ id: '1' }); - - return ( - <> - - - - ); -}; - -const mocks = { - [`${collection}:${action}`]: function (config) { - const { filterByTk } = config.params; - return { - data: - Number(filterByTk) === 1 - ? { - id: 1, - username: 'Bamboo', - age: 18, - } - : { - id: 2, - username: 'Mary', - age: 25, - }, - }; - }, - [`${collection}:update`]: function (config) { - console.log('config.data', config.data); - return { - data: 'ok', - }; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps, useBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx deleted file mode 100644 index 98cb58170..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-form-record-and-update.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import React, { FC, useEffect } from 'react'; -import { Button, Form, FormProps, Input, InputNumber, notification } from 'antd'; -import { - CollectionRecordProvider, - SchemaComponent, - UseDataBlockProps, - useDataBlockResource, - useCollectionRecordData, - withDynamicSchemaProps, -} from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -interface DemoFormFieldType { - id: number; - username: string; - age: number; -} -type DemoFormProps = FormProps; -const DemoForm: FC = withDynamicSchemaProps((props) => { - return ( -
- - label="Username" - name="username" - rules={[{ required: true, message: 'Please input your username!' }]} - > - - - - label="Age" - name="age" - rules={[{ required: true, message: 'Please input your age!' }]} - > - - - - - - - ); -}); - -function useDemoFormProps(): DemoFormProps { - const data = useCollectionRecordData(); - const resource = useDataBlockResource(); - - const [form] = Form.useForm(); - - useEffect(() => { - form.setFieldsValue(data); - }, [data, form]); - - const onFinish = async (values: DemoFormFieldType) => { - console.log('values', values); - await resource.update({ - filterByTk: data.id, - values, - }); - notification.success({ - message: 'Save successfully!', - }); - }; - - return { - initialValues: data, - preserve: true, - onFinish, - form, - }; -} -const useFormBlockDecoratorProps: UseDataBlockProps<'CollectionRecord'> = () => { - const record = useCollectionRecordData(); - return { - record, - }; -}; - -const collection = 'users'; -const action = 'get'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-use-decorator-props': 'useFormBlockDecoratorProps', - 'x-decorator-props': { - collection: collection, - action: action, - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'object', - 'x-component': 'DemoForm', - 'x-use-component-props': 'useDemoFormProps', - }, - }, -}; - -const recordData = { - id: 1, - username: 'Bamboo', - age: 18, -}; - -const Demo = () => { - return ( - <> - - - - - ); -}; - -const mocks = { - [`${collection}:update`]: function (config) { - console.log('config.data', config.data); - return { - data: 'ok', - }; - }, -}; -const Root = createApp( - Demo, - { - components: { DemoForm }, - scopes: { useDemoFormProps, useFormBlockDecoratorProps }, - }, - mocks, -); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-table-list.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-table-list.tsx deleted file mode 100644 index 6da749168..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/collection-table-list.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import { Table, TableProps } from 'antd'; -import { SchemaComponent, useDataBlockRequest, withDynamicSchemaProps } from '@nocobase/client'; -import { ISchema } from '@nocobase/schema'; - -import { createApp } from '../../../data-source/demos/createApp'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - action: 'list', - }, - 'x-component': 'CardItem', - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { data, loading } = useDataBlockRequest(); - return { - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'UserName', - dataIndex: 'username', - }, - { - title: 'NickName', - dataIndex: 'nickname', - }, - { - title: 'Email', - dataIndex: 'email', - }, - ], - }; -} - -const Demo = () => { - return ; -}; - -const Root = createApp(Demo, { - components: { MyTable }, - scopes: { useTableProps }, -}); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/complete-demo.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/complete-demo.tsx deleted file mode 100644 index 8135d9310..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/data-block-provider/complete-demo.tsx +++ /dev/null @@ -1,162 +0,0 @@ -import React, { useMemo } from 'react'; -import { - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - useDataBlockRequest, - useCollectionManager, - useCollection, - useCompile, - useDataBlockProps, - useDataBlock, - useSchemaInitializer, - useSchemaInitializerRender, - withDynamicSchemaProps, -} from '@nocobase/client'; - -import { createApp } from '../../../data-source/demos/createApp'; -import { Table, TableProps } from 'antd'; -import { ISchema } from '@nocobase/schema'; -import { observer, useFieldSchema } from '@nocobase/schema'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-component': 'Page', - 'x-initializer': 'MyInitializer', -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - const { tableProps } = useDataBlockProps(); - const { data, loading } = useDataBlockRequest(); - const compile = useCompile(); - const collection = useCollection(); - const columns = useMemo(() => { - return collection.getFields().map((field) => { - return { - title: compile(field.uiSchema?.title || field.name), - dataIndex: field.name, - }; - }); - }, [collection, compile]); - return { - ...tableProps, - loading, - dataSource: data?.data || [], - columns, - }; -} - -const MyTableSettings = new SchemaSettings({ - name: 'MyTableSettings', - items: [ - { - name: 'bordered', - type: 'switch', - useComponentProps() { - const { props: blockSettingsProps, dn } = useDataBlock(); - - return { - title: 'Bordered', - checked: !!blockSettingsProps.tableProps?.bordered, - onChange: (checked) => { - // 修改 schema - dn.deepMerge({ 'x-decorator-props': { tableProps: { bordered: checked } } }); - }, - }; - }, - }, - ], -}); - -const TableDataBlockInitializer = () => { - const { insert } = useSchemaInitializer(); - const handleClick = ({ item }) => { - insert({ - type: 'void', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: item.value, - action: 'list', - tableProps: { - bordered: true, // 用于设置是否显示边框 - }, - }, - 'x-settings': 'MyTableSettings', - 'x-component': 'CardItem', - 'x-toolbar-props': { - draggable: false, - }, - properties: { - table: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, - }); - }; - const compile = useCompile(); - const collectionManager = useCollectionManager(); - const collectionMenuItems = useMemo( - () => - collectionManager.getCollections().map((collection) => { - return { - label: compile(collection.getOption('title')), - value: collection.getOption('name'), - }; - }), - [collectionManager, compile], - ); - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'table', - Component: TableDataBlockInitializer, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ; -}; - -const App = createApp(Root, { - components: { MyTable, Page }, - scopes: { useTableProps }, - schemaSettings: [MyTableSettings], - schemaInitializers: [myInitializer], -}); - -export default App; diff --git a/packages/core/client/docs/zh-CN/core/data-block/demos/settings/demo1.tsx b/packages/core/client/docs/zh-CN/core/data-block/demos/settings/demo1.tsx deleted file mode 100644 index 2bfc15af2..000000000 --- a/packages/core/client/docs/zh-CN/core/data-block/demos/settings/demo1.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import React from 'react'; -import { - SchemaComponent, - SchemaSettings, - useDataBlockRequest, - useDataBlock, - withDynamicSchemaProps, -} from '@nocobase/client'; - -import { createApp } from '../../../data-source/demos/createApp'; -import { Table, TableProps } from 'antd'; -import { ISchema } from '@nocobase/schema'; - -const schema: ISchema = { - type: 'void', - name: 'root', - 'x-decorator': 'DataBlockProvider', - 'x-decorator-props': { - collection: 'users', - action: 'list', - bordered: true, // 用于设置是否显示边框 - }, - 'x-settings': 'MyTableSettings', - 'x-component': 'CardItem', - 'x-toolbar-props': { - draggable: false, - }, - properties: { - demo: { - type: 'array', - 'x-component': 'MyTable', - 'x-use-component-props': 'useTableProps', // 动态 table 属性 - }, - }, -}; - -const MyTable = withDynamicSchemaProps(Table); - -function useTableProps(): TableProps { - // 获取 - const { props } = useDataBlock(); - const { bordered } = props; - const { data, loading } = useDataBlockRequest(); - return { - bordered, - loading, - dataSource: data?.data || [], - columns: [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Age', - dataIndex: 'age', - }, - { - title: 'Address', - dataIndex: 'address', - }, - ], - }; -} - -const MyTableSettings = new SchemaSettings({ - name: 'MyTableSettings', - items: [ - { - name: 'bordered', - type: 'switch', - useComponentProps() { - // 获取 - const { props: blockSettingsProps, dn } = useDataBlock(); - const { bordered } = blockSettingsProps; - - return { - title: 'Bordered', - checked: bordered, - onChange: (checked) => { - // 修改 - dn.deepMerge({ 'x-decorator-props': { bordered: checked } }); - }, - }; - }, - }, - ], -}); - -const Demo = () => { - return ; -}; - -const Root = createApp(Demo, { - components: { MyTable }, - scopes: { useTableProps }, - schemaSettings: [MyTableSettings], -}); - -export default Root; diff --git a/packages/core/client/docs/zh-CN/core/data-block/images/data-block.png b/packages/core/client/docs/zh-CN/core/data-block/images/data-block.png deleted file mode 100644 index 0ac7ee8e8..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-block/images/data-block.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-block/images/markdown-block.png b/packages/core/client/docs/zh-CN/core/data-block/images/markdown-block.png deleted file mode 100644 index 9c9c351be..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-block/images/markdown-block.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-source/association-provider.md b/packages/core/client/docs/zh-CN/core/data-source/association-provider.md deleted file mode 100644 index 97da3d3ab..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/association-provider.md +++ /dev/null @@ -1,13 +0,0 @@ -# AssociationProvider - -用于传递关联数据字段以及对应的数据表信息,等同于 `CollectionFieldProvider` + `CollectionProvider`。 - -```tsx | pure -const AssociationProvider = - - {children} - - -``` - -关于关系字段的更多信息,请参考 [关系字段](https://docs.nocobase.com/development/server/collections/association-fields) 以及 [CollectionField](/core/data-source/collection-field)。 diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface-manager.md b/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface-manager.md deleted file mode 100644 index b589784e5..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface-manager.md +++ /dev/null @@ -1,171 +0,0 @@ -# CollectionFieldInterfaceManager - -主要是用来管理 [CollectionFieldInterface](./collection-field-interface.md) 和 [CollectionFieldInterfaceGroups](#collectionfieldinterfacegroups),其被 [DataSourceManager](./data-source-manager) 管理。 - - -## CollectionFieldInterfaceGroups - -CollectionFieldInterfaceGroups 是用来对数据表字段进行分组的。 - -![Field Groups](./images/field-groups.png) - -## 实例方法 - -### field interface - -#### addFieldInterfaces() - -添加 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - addFieldInterfaces(fieldInterfaces: CollectionFieldInterface[]): void -} -``` - -- 示例 - -```tsx | pure -class CheckboxFieldInterface extends CollectionFieldInterface { - name = 'checkbox'; - type = 'object'; - group = 'choices'; - title = '{{t("Checkbox")}}'; - // ... -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([CheckboxFieldInterface]); - // or - this.app.dataSourceManager.addFieldInterfaces([CheckboxFieldInterface]); - } -} -``` - -#### getFieldInterface() - -获取 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterface(name: string): T; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterface = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface('checkbox'); // checkboxFieldInterface - } -} -``` - -#### getFieldInterfaces() - -获取所有的 field interface。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaces(): CollectionFieldInterface[]; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaces = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaces(); - } -} -``` - -### field interface group - -#### addFieldInterfaceGroups() - -添加 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - addFieldInterfaceGroups(fieldGroups: Record): void; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaceGroups({ - 'test': { - label: 'Test', - order: 1, - } - }); - - // or - this.app.dataSourceManager.addFieldInterfaceGroups({ - 'test': { - label: 'Test', - order: 1, - } - }); - } -} -``` - -#### getFieldInterfaceGroups() - -获取所有的 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaceGroups(): Record; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaceGroups = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaceGroups(); // { 'test': { label: 'Test', order: 1 } } - } -} -``` - -#### getFieldInterfaceGroup() - -获取 field interface group。 - -- 类型 - -```tsx | pure -class CollectionFieldInterfaceManager { - getFieldInterfaceGroup(name: string): { label: string; order?: number }; -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const fieldInterfaceGroup = this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterfaceGroup('test'); // { label: 'Test', order: 1 } - } -} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface.md b/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface.md deleted file mode 100644 index bb2c1aebf..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-field-interface.md +++ /dev/null @@ -1,94 +0,0 @@ -# CollectionFieldInterface - -用于创建数据字段。 - -![](./images/collection-field-interface.png) - -```ts -class CollectionFieldInterface { - app: Application; - collectionManager: CollectionManager; - - name: string; - group: string; - title?: string; - description?: string; - order?: number; - default?: { - type: string; - uiSchema?: ISchema; - [key: string]: any; - }; - sortable?: boolean; - availableTypes?: string[]; - hasDefaultValue?: boolean; - isAssociation?: boolean; - operators?: any[]; - filterable?: { - operators?: any[]; - children?: any[]; - [key: string]: any; - }; - titleUsable?: boolean; - - validateSchema(fieldSchema: ISchema): Record - usePathOptions(field: CollectionFieldOptions): any - schemaInitialize(schema: ISchema, data: any): void - - getOption(key: K): CollectionFieldInterfaceOptions[K] - getOptions(): CollectionFieldInterfaceOptions; - setOptions(options: CollectionFieldInterfaceOptions): void; -} -``` - -其需要结合 [CollectionManager](./collection-field-interface-manager.md) 使用。 - -```ts -class EmailFieldInterface extends CollectionFieldInterface { - name = 'email'; - type = 'object'; - group = 'basic'; - order = 4; - title = '{{t("Email")}}'; - sortable = true; - // ... -} - -class MyPlugin extends Plugin { - load() { - this.app.dataSourceManager.addFieldInterfaces([ EmailFieldInterface ]); - } -} -``` - -## 实例属性 - -### name - -唯一标识符。 - -### group - -分组。 - -### title - -标题。 - -### default - -配置表单默认值字段 schema。 - -![](./images/collection-field-interface-form.png) - - -## 实例方法 - -### collectionFieldInterface.validateSchema(fieldSchema) - - -### collectionFieldInterface.usePathOptions(field: CollectionFieldOptions) - - -### collectionFieldInterface.schemaInitialize(schema: ISchema, data: any) - diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-field.md b/packages/core/client/docs/zh-CN/core/data-source/collection-field.md deleted file mode 100644 index 3f64b94a6..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-field.md +++ /dev/null @@ -1,164 +0,0 @@ -# CollectionField - -NocoBase 将字段的 schema 分为 2 部分,一部分在 schema 中,一部分在 collection 中。例如: - -```tsx | pure -const schema = { - properties: { - username: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - }, - } -} - -const collection = { - fields: [ - { - type: 'string', - name: 'username', - interface: 'input', - uiSchema: { - title: 'UserName', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - } - ], -} -``` - -两者通过 `name: username` 联系起来,`CollectionField` 会自动读取 schema `name` 属性,并根据 `name` 属性查找 collection 中对应的 `uiSchema` 属性,然后拼接到 schema 中,进行渲染。 - -这样做的好处是,对于同一个字段创建的内容,可以在不同的地方共享同一个 schema,当 schema 变化时,只需要修改一处即可。比如通过上面的 `title: "UserName"` 假设变化 `title: "Name"` 则所有使用到此字段的地方都会变化。 - - - -## CollectionFieldOptions - -字段的配置项。 - -```ts -interface CollectionFieldOptions { - name?: any; - collectionName?: string; - sourceKey?: string; - uiSchema?: ISchema; - target?: string; - - [key: string]: any; -} -``` - -### 普通字段和关系字段 - -字段有 2 种情况,一种是普通字段,一种是 [关系字段](https://docs-cn.nocobase.com/development/server/collections/association-fields)。 - -关系字段是指,字段的值是另一个 collection 的数据,例如 `users` 和 `roles` 两个 collection,`users` 中有一个字段 `roles`,其值是 `roles` collection 的数据,那么 `roles` 就是一个关系字段。 - -普通字段的示例如下: - -```json -{ - "key": "ootprgkoawo", - "name": "email", - "type": "string", - "interface": "email", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true, - "uiSchema": { - "type": "string", - "title": "{{t(\"Email\")}}", - "x-component": "Input", - "x-validator": "email", - "required": true - } -} -``` - -关系字段的示例如下: - -```json -{ - "key": "t09bauwm0wb", - "name": "roles", - "type": "belongsToMany", - "interface": "m2m", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "target": "roles", - "foreignKey": "userId", - "otherKey": "roleName", - "onDelete": "CASCADE", - "sourceKey": "id", - "targetKey": "name", - "through": "rolesUsers", - "uiSchema": { - "type": "array", - "title": "{{t(\"Roles\")}}", - "x-component": "AssociationField", - "x-component-props": { - "multiple": true, - "fieldNames": { - "label": "title", - "value": "name" - } - } - } -} -``` - -相对于普通字段,关系字段多了以下属性: - -- xx -- xx - -### 全部字段说明 - -- `name`:字段名称 -- `collectionName`:数据表名称 -- `sourceKey`:当字段为关系字段时,对应的关系字段名称。 - -TODO:补全 - -## Hooks - -### useCollectionField() - -用于获取字段信息。 - -```tsx | pure -const collection = { - fields: [ - { - type: 'string', - name: 'username', - interface: 'input', - uiSchema: { - title: 'UserName', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - } - ], -} - -const { uiSchema } = useCollectionField() -const required = uiSchema?.required -``` - -其通常在 [SchemaSettings](/core/ui-schema/schema-settings) 中使用,用来获取和修改字段的属性。 - - - - - diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-manager-provider.md b/packages/core/client/docs/zh-CN/core/data-source/collection-manager-provider.md deleted file mode 100644 index b37a6a27f..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-manager-provider.md +++ /dev/null @@ -1,52 +0,0 @@ -# CollectionManagerProvider - -用于提供 [CollectionManager](/core/data-source/collection-manager) 实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface CollectionManagerProviderProps { - instance?: CollectionManager; - dataSource?: string; - children?: ReactNode; -} -``` - -- 参数详解 - - `dataSource` - 数据源名称,如果为空,则会取默认数据源。 - - `instance` - CollectionManager 实例,如果没有,则会取 `dataSource` 对应的 collectionManager。 - -- 示例 - -```tsx | pure -const collectionManager = new CollectionManager(); - -const Demo = () => { - return ( - -
...
-
- ); -}; -``` - -## Hooks - -### useCollectionManager() - -用于获取 `CollectionManagerProvider` 传递的实例。 - -- 示例 - -```tsx | pure -const Demo = () => { - const collectionManager = useCollectionManager(); - const collections = collectionManager.getCollections() - - return
-
{JSON.stringify(collections, null, 2)}
-
; -}; -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-manager.md b/packages/core/client/docs/zh-CN/core/data-source/collection-manager.md deleted file mode 100644 index 5df92575d..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-manager.md +++ /dev/null @@ -1,175 +0,0 @@ -# CollectionManager - -用于管理 [Collection](./collection.md),其被 [DataSource](./data-source.md) 管理。 - -## 实例方法 - -### addCollections(collections) - -添加数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - addCollections(collections: CollectionOptions[]): void -} -``` - -- 示例 - -```tsx | pure -const userCollectionOptions = { - "name": "users", - "title": "Users", - fields: [ - // ... - ], -}; - -collectionManager.addCollections([userCollectionOptions]); -``` - -### setCollections(collections) - -重置数据表,会先移除所有数据表,然后再调用 `addCollections()` 添加数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - setCollections(collections: CollectionOptions[]): void -} -``` - -### reAddCollections(collections) - -由于 [CollectionTemplate](./collection-template.md) 或者 [CollectionMixins](./collection-mixins.md) 的添加会影响 Collection 的实例化,所以提供了重新添加数据表的方法。 - -- 类型 - -```tsx | pure -class CollectionManager { - reAddCollections(collectionInstances: Collection[]): void -} -``` - -- 示例 - -```tsx | pure -const userCollectionInstance = collectionManager.getCollection('users'); -collectionManager.reAddCollections([userCollectionInstance]); -``` - -### getCollections(predicate?) - -获取数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollections(predicate?: (collection: Collection) => boolean) -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollections(); // [ userCollection ] - -collectionManager.getCollections(collection => collection.name === 'posts'); // [ postCollection ] -``` - - -### getCollection(path) - -获取数据表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollection(path: string): (Mixins & Collection) | undefined -} -``` - -- 详细解释 - - `path` 参数可以是数据表名称,也可以是[关系字段](https://docs.nocobase.com/development/server/collections/association-fields)路径。 - - `path: 'users'`: 获取 `users` 数据表 - - `path: 'users.posts'`: 获取 `users` 数据表的 `posts` 关联字段对应的数据表,即 `postCollection` - -- 示例 - -```tsx | pure -collectionManager.getCollection('users'); // userCollection - -collectionManager.getCollection('users.posts'); // postCollection -collectionManager.getCollection('users.profileId'); // profileCollection -``` - -结合 Mixin 使用: - -```tsx | pure -const collection = collectionManager.getCollection('users'); -const collection = collectionManager.getCollection('users'); -``` - -### getCollectionFields(collectionName) - -获取数据表字段列表。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionFields(collectionName: string): CollectionFieldOptions[]; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionFields('users'); // [ { name: 'username', type: 'string', title: 'Username', .. }, { name: 'password', type: 'password', title: 'Password', .. } ] -``` - -### getCollectionName(path) - -获取数据表名称。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionName(path: string: GetCollectionOptions): string | undefined; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionName('users'); // 'users' - -collectionManager.getCollectionName('users.profiles'); // 'profiles' -``` - - -### getCollectionField(path) - -获取数据表字段。 - -- 类型 - -```tsx | pure -class CollectionManager { - getCollectionField(path: string: GetCollectionOptions): CollectionFieldOptions | undefined; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionField('users.username'); // { name: 'username', type: 'string', title: 'Username', .. } - -collectionManager.getCollectionField('users.roles.name'); // 获取 roles 关联字段对应的 roles 表中的 name 字段 -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-mixins.md b/packages/core/client/docs/zh-CN/core/data-source/collection-mixins.md deleted file mode 100644 index 6512fccc3..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-mixins.md +++ /dev/null @@ -1,57 +0,0 @@ - -## Collection Mixins - -Collection Mixins 是为扩展 Collection 类提供的一种机制,可以通过 `dataSourceManager.addCollectionMixins()` 添加 Collection Mixins。 - -### 定义和注册 - -```tsx | pure -import { Collection, Plugin } from '@nocobase/client'; - -class TestMixin extends Collection { - test() { - const { name } = this.options; - return 'test '+ name; - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([TestMixin]); - } -} -``` - -### 使用 - -- 使用方式1:在 `CollectionManager` 实例上调用 `getCollection()` 获取指定 `Collection` 实例。 - -```tsx | pure -const Demo = () => { - const cm = useCollectionManager(); - const userCollection = cm.getCollection('users'); - - userCollection.test(); // 'test users' -} -``` - -- 使用方式2:调用 `useCollection()` 获取当前上下文的数据表信息。 - -```tsx | pure -const Demo = () => { - const collection = useCollection(); - collection.test(); // 'test users' -} -``` - -### 多个 Mixins 的使用 - -如果添加了 Mixins,可通过如下方式获得类型提示: - -```tsx | pure -const Demo = () => { - const collection = useCollection(); -} -``` - - diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-provider.md b/packages/core/client/docs/zh-CN/core/data-source/collection-provider.md deleted file mode 100644 index 141187df8..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-provider.md +++ /dev/null @@ -1,63 +0,0 @@ -# CollectionProvider - -用于提供 [Collection](/core/data-source/collction) 实例。 - -## 组件 - -### CollectionProvider - -- 类型 - -```tsx | pure -interface CollectionProviderProps { - name: string; - dataSource?: string; - children?: ReactNode; -} -``` - -- 详解 - -组件会根据 `name` 去 [CollectionManager](/core/data-source/collection-manager) 中查询数据表信息,如果查询不到,则会不进行渲染。 - -`dataSource` 用于指定数据表所在的[命名空间](/core/data-source/collection-manager#datasource),如果不指定,则默认命名空间。 - -- 示例 - -```tsx | pure -import { CollectionProvider } from '@nocobase/client'; - -const MyComponent = () => { - return ( - -
...
-
- ) -} -``` - - -## Hooks - -### useCollection() - -用于获取 `CollectionProvider` 传递的 `Collection` 实例。 - -```tsx | pure -const collection = useCollection() - -console.log(collection instanceof Collection) // true -console.log(collection); -``` - -结合 Mixin 使用: - -```tsx | pure -const collection = useCollection() -const collection = useCollection() -``` - -## 示例 - - - diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-template-manager.md b/packages/core/client/docs/zh-CN/core/data-source/collection-template-manager.md deleted file mode 100644 index 1ff0bffea..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-template-manager.md +++ /dev/null @@ -1,86 +0,0 @@ -# CollectionTemplateManager - -用于管理 [CollectionTemplate](./collection-template),其被 [DataSourceManager](./data-source-manager) 管理。 - -## 实例方法 - -### addCollectionTemplates() - -用于添加 collection template。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - addCollectionTemplates(templates: CollectionTemplate[]): void; -} -``` - -- 示例 - -```tsx | pure -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - type = 'object'; - title = '{{t("SQL collection")}}'; - configurableProperties = { - // ... - } -} - -class TreeCollectionTemplate extends CollectionTemplate { - name = 'tree'; - type = 'object'; - title = '{{t("Tree collection")}}'; - configurableProperties = { - // ... - } -} - -class MyPlugin extends Plugin { - async load() { - this.dataSourceManager.collectionTemplateManager.addCollectionTemplates([ SqlCollectionTemplate, TreeCollectionTemplate ]); - - // or - this.dataSourceManager.addCollectionTemplates([ SqlCollectionTemplate, TreeCollectionTemplate ]); - } -} -``` - -### getCollectionTemplate() - -用于获取 collection template。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - getCollectionTemplate(name: string): CollectionTemplate; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionTemplate(); // generalCollectionTemplate - -collectionManager.getCollectionTemplate('tree'); // treeCollectionTemplate -``` - -### getCollectionTemplates() - -用于获取所有 collection templates。 - -- 类型 - -```tsx | pure -class CollectionTemplateManager { - getCollectionTemplates(): CollectionTemplate[]; -} -``` - -- 示例 - -```tsx | pure -collectionManager.getCollectionTemplates(); // [ generalCollectionTemplate, treeCollectionTemplate, sqlCollectionTemplate ] -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection-template.md b/packages/core/client/docs/zh-CN/core/data-source/collection-template.md deleted file mode 100644 index eb248e519..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection-template.md +++ /dev/null @@ -1,249 +0,0 @@ -# CollectionTemplate - -用于创建数据表的模板。 - -![](./images/collection-template.png) - -```ts -interface AvailableFieldInterfacesInclude { - include?: any[]; -} - -interface AvailableFieldInterfacesExclude { - exclude?: any[]; -} - -interface CollectionTemplateDefaultOptions { - /** - * 自动生成 id - * @default true - * */ - autoGenId?: boolean; - /** 创建人 */ - createdBy?: boolean; - /** 最后更新人 */ - updatedBy?: boolean; - /** 创建日期 */ - createdAt?: boolean; - /** 更新日期 */ - updatedAt?: boolean; - /** 可排序 */ - sortable?: boolean; - /* 树结构 */ - tree?: string; - /* 日志 */ - logging?: boolean; - /** 继承 */ - inherits?: string | string[]; - /* 字段列表 */ - fields?: CollectionOptions['fields']; -} - -class CollectionTemplate { - app: Application; - collectionManager: CollectionManager; - - name: string; - Collection?: typeof Collection; - transform?: (collection: CollectionOptions, app: Application) => CollectionOptions; - title?: string; - color?: string; - /** 排序 */ - order?: number; - /** 默认配置 */ - default?: CollectionTemplateDefaultOptions; - events?: any; - /** UI 可配置的 CollectionOptions 参数(添加或编辑的 Collection 表单的字段) */ - configurableProperties?: Record; - /** 当前模板可用的字段类型 */ - availableFieldInterfaces?: AvailableFieldInterfacesInclude | AvailableFieldInterfacesExclude; - /** 是否分割线 */ - divider?: boolean; - /** 模板描述 */ - description?: string; - /**配置字段中的操作按钮 */ - configureActions?: Record; - //是否禁止删除字段 - forbidDeletion?: boolean; -} -``` - -其需要结合 [CollectionManager](./collection-template-manager.md) 使用。 - -```ts -import { Plugin, Collection, CollectionTemplate } from '@nocobase/client'; - -class SqlCollection extends Collection { - otherMethods() { - // ... - } -} - -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - Collection = SqlCollection; // 自定义的数据表类 - title = '{{t("SQL collection")}}'; - order = 4; - color = 'yellow'; - default = { - fields: [], - }; - configurableProperties = { - // ... - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([ SqlCollectionTemplate ]); - - // or - this.app.dataSourceManager.addCollectionTemplates([ SqlCollectionTemplate ]); - } -} -``` - -## 实例属性 - -### name - -模板的唯一标识符。 - - -### Collection - -模板对应的数据表类。 - -在创建数据表后,Collection 会有 [template 字段](/core/data-source/collection#collectionoptions),用于标识该数据表是由哪个模板创建的。 - -当通过 `collectionManager.addCollections()` 添加数据表对象时,会先读取 `collection.template` 字段,然后通过 `collectionManager.getCollectionTemplate(collection.template)` 获取到 `collectionTemplate`。 - -读取 `collectionTemplate.Collection` 字段,并通过 `new collectionTemplate.Collection(collection)` 创建对应的实例。 - -如果不传递 `Collection`,则会通过 `new Collection(collection)` 创建对应的实例。 - -```ts -class SqlCollection extends Collection { - otherMethods() { - // ... - } -} - -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql'; - Collection = SqlCollection; // 自定义的数据表类 - // ... -} - -const userCollection = { - name: 'users', - template: 'sql', - // ... -} - -// 内部会调用 new SqlCollection(userCollection) -``` - -### title - -模板的标题。 - -### color - -模板的颜色。 - -### order - -模板的排序。 - -### events - -- `beforeSubmit`:提交前触发 - - -### configurableProperties - -表单配置项。 - -![](./images//collection-template-form.png) - -```ts -class SqlCollectionTemplate extends CollectionTemplate { - name = 'sql', - // ... - configurableProperties = { - title: { - type: 'string', - title: '{{ t("Collection display name") }}', - required: true, - 'x-decorator': 'FormItem', - 'x-component': 'Input', - }, - name: { - type: 'string', - title: '{{t("Collection name")}}', - required: true, - 'x-disabled': '{{ !createOnly }}', - 'x-decorator': 'FormItem', - 'x-component': 'Input', - 'x-validator': 'uid', - description: - "{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}", - }, - // ... - }, -} -``` - -### default - -表单默认值。 - - - -## 实例方法 - -### collectionTemplate.transform(collection) - -collection 创建后,会调用该方法,用于对 collection 进行转换。 - -## Utils - -### getConfigurableProperties() - -用于获取内置的配置项字段。 - -- 类型 - -```tsx | pure -export type DefaultConfigurableKeys = - | 'name' - | 'title' - | 'inherits' - | 'category' - | 'autoGenId' - | 'createdBy' - | 'updatedBy' - | 'createdAt' - | 'updatedAt' - | 'sortable' - | 'description' - | 'moreOptions'; - -const getConfigurableProperties: (...keys: DefaultConfigurableKeys[]) => Record -``` - -- 示例 - -```tsx | pure -import { getConfigurableProperties } from '@nocobase/client'; - -const sqlCollectionTemplate = new CollectionTemplate({ - name: 'sql', - // ... - configurableProperties: { - ...getConfigurableProperties('name', 'title', 'description'), - // ... - }, -}); -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/collection.md b/packages/core/client/docs/zh-CN/core/data-source/collection.md deleted file mode 100644 index 5cce1e551..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/collection.md +++ /dev/null @@ -1,293 +0,0 @@ -# Collection - -Collection 数据表类,其被 [CollectionManager](/core/data-source/collection-manager) 管理。 - -## 类型 - -```tsx | pure -interface CollectionOptions { - name: string; - title?: string; - fields?: FieldOptions[]; - // .... -} - -class Collection { - app: Application; - collectionManager: CollectionManager; - - constructor(options: CollectionOptions) {} - - name: string; - primaryKey: string; - titleField: string; - - getOptions(): CollectionOptions; - setOptions(options: CollectionOptions): void; - getOption(key: K): CollectionOptions[K]; - - getFields(predicate?: CollectionFieldOptions | ((collection: CollectionFieldOptions) => boolean) | keyof CollectionFieldOptions): any[] - getField(name: SchemaKey): CollectionFieldOptions - hasField(name: SchemaKey): boolean; -} -``` - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - title: 'Users', - fields: [ - { - type: 'string', - name: 'username', - }, - { - type: 'integer', - name: 'age', - }, - ], -}); -``` - -## CollectionOptions - -```tsx | pure -export interface CollectionOptions { - name: string; - title?: string; - dataSource?: string; - /** - * Used for @nocobase/plugin-duplicator - * @see packages/core/database/src/collection-group-manager.tss - * - * @prop {'required' | 'optional' | 'skip'} dumpable - Determine whether the collection is dumped - * @prop {string[] | string} [with] - Collections dumped with this collection - * @prop {any} [delayRestore] - A function to execute after all collections are restored - */ - duplicator?: - | dumpable - | { - dumpable: dumpable; - with?: string[] | string; - delayRestore?: any; - }; - - tableName?: string; - inherits?: string[] | string; - inherit?: string; - key?: string; - viewName?: string; - writableView?: boolean; - - filterTargetKey?: string; - fields?: CollectionFieldOptions[]; - model?: any; - repository?: any; - sortable?: CollectionSortable; - /** - * @default true - */ - autoGenId?: boolean; - /** - * @default 'options' - */ - magicAttribute?: string; - - tree?: string; - - template?: string; - - isThrough?: boolean; - autoCreate?: boolean; - resource?: string; - collectionName?: string; - sourceKey?: string; - uiSchema?: any; - [key: string]: any; -} -``` - -- name: Collection 的标识,必须唯一。 - -- title: Collection 的标题,用于显示。 - -- fields: 字段列表,详细说明请查看 [CollectionField](/core/data-source/collection-field) - -- template: 模板标识,用于标识该 Collection 是由哪个模板创建的,详细说明请查看 [CollectionTemplate](/core/data-source/collection-template) - -- dataSource: 数据源标识,用于标识该 Collection 是由哪个数据源创建的,详细说明请查看 [CollectionDataSource](/core/data-source/collection-manager#datasource) - -- duplicator - -- tableName - -- inherits - -- viewName - -- writableView - -- filterTargetKey - -- model - -- repository - - -## 实例属性 - -### collection.collectionManager - -[CollectionManager](/core/data-source/collection-manager) 的实例。 - -### collection.titleFieldName - -标题字段的 name 属性。 - -### 其他属性 - -其他属性同 [CollectionOptions](/core/data-source/collection#collectionoptions)。 - -## 实例方法 - -### collection.getOptions() - -获取 collection 的所有配置项。 - -- 类型 - -```tsx | pure -class Collection { - getOptions(): CollectionOptions; -} -``` - -- 示例 - -```tsx | pure -const usersCollection = new Collection({ - name: 'users', - title: 'Users', - fields: [ - // ... - ], -}); - -console.log(usersCollection.getOptions()); // { name: 'users', title: 'Users', fields: [ ] } -``` - -### collection.setOptions(options) - -设置 collection 的配置项,最终会和默认配置项进行合并。 - -- 类型 - -```tsx | pure -class Collection { - setOptions(options: CollectionOptions): void; -} -``` - -- 示例 - -```tsx | pure -collection.setOptions({ - name: 'users', - title: 'Users', - fields: [ - // ... - ], -}); -``` - -### collection.getOption(key) - -获取 collection 的单个配置项。 - -- 类型 - -```tsx | pure -class Collection { - getOption(key: K): CollectionOptions[K]; -} -``` - -- 示例 - -```tsx | pure -collection.getOption('name'); // 'users' -collection.getOption('title'); // 'Users' -``` - -### collection.getFields(predicate?) - -获取 collection 的字段列表。 - -- 类型 - -```tsx | pure -class Collection { - getFields(predicate?: CollectionFieldOptions | ((collection: CollectionFieldOptions) => boolean) | keyof CollectionFieldOptions): any[] -} -``` - -- 详解 - - predicate - - 类型 - - `CollectionFieldOptions` - - `(collection: CollectionFieldOptions) => boolean` - - `keyof CollectionFieldOptions` - - 说明 - - 如果传递了 `predicate`,则返回符合条件的字段列表 - - 如果没有传递 `predicate`,则返回所有字段列表 - -`predicate` 的使用可看参考 [lodash.filter](https://www.lodashjs.com/docs/lodash.filter)。 - -- 示例 - -```tsx | pure -collection.getFields(); // [{ name: 'username', type: 'string', primaryKey: true }, { name: 'age', type: 'integer' }] - -collection.getFields({ name: 'age' }); // [{ name: 'age', type: 'integer' }] - -collection.getFields('primaryKey'); // [{ name: 'username', type: 'string', primaryKey: true }] - -collection.getFields(field => field.type === 'string'); // [{ name: 'name', type: 'string' }] -``` - -### collection.getField(name) - -获取 collection 的单个字段。 - -- 类型 - -```tsx | pure -class Collection { - getField(name: SchemaKey): CollectionFieldOptions -} -``` - -- 示例 - -```tsx | pure -collection.getField('username'); // { name: 'username', type: 'string', primaryKey: true } -``` - -### collection.hasField(name) - -判断 collection 是否存在某个字段。 - -- 类型 - -```tsx | pure -class Collection { - hasField(name: SchemaKey): boolean; -} -``` - -- 示例 - -```tsx | pure -collection.hasField('username'); // true -collection.hasField('name'); // false -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/data-source-manager-provider.md b/packages/core/client/docs/zh-CN/core/data-source/data-source-manager-provider.md deleted file mode 100644 index 4b39e452c..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/data-source-manager-provider.md +++ /dev/null @@ -1,25 +0,0 @@ -# DataSourceManagerProvider - -用于提供 `DataSourceManager` 实例。 - - -## Hooks - -### useDataSourceManager() - -获取 `DataSourceManager` 实例。 - -- 类型 - -```tsx | pure -function useDataSourceManager(): DataSourceManager; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.removeDataSources(['my-data-source']); -} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/data-source-manager.md b/packages/core/client/docs/zh-CN/core/data-source/data-source-manager.md deleted file mode 100644 index 7ef124b94..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/data-source-manager.md +++ /dev/null @@ -1,334 +0,0 @@ -# DataSourceManager - -Nocobase 数据源前端体系包含如下内容: - -- [DataSourceManager](./data-source-manager.md) - - [DataSource](./data-source) - - [CollectionManager](./collection-manager) - - [Collection](./collection) - - [Field](./collection-field) - - [CollectionTemplateManager](./collection-template-manager) - - [CollectionTemplate](./collection-template) - - [CollectionFieldInterfaceManager](./collection-field-interface-manager) - - [CollectionFieldInterface](./collection-field-interface) - - [CollectionMixins](./collection-mixins) - - -## 实例属性 - -- collectionTemplateManager - -用于管理 `CollectionTemplate` 实例。 - -```tsx | pure -import { Plugin, CollectionTemplate } from '@nocobase/client'; - -class MyCollectionTemplate extends CollectionTemplate { - name = 'my-collection-template'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([MyCollectionTemplate]) - } -} -``` - -详细请参考:[CollectionTemplateManager](./collection-template-manager) - -- collectionFieldInterfaceManager - -用于管理 `CollectionFieldInterface` 实例。 - -```tsx | pure -import { Plugin, CollectionFieldInterface } from '@nocobase/client'; - -class MyCollectionFieldInterface extends CollectionFieldInterface { - name = 'my-collection-field-interface'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([MyCollectionFieldInterface]) - } -} -``` - -详细请参考:[CollectionTemplateManager](./collection-template-manager) - -## 实例方法 - -### addCollectionTemplates() - -是 `CollectionTemplateManager` 的快捷方法,用于添加 `CollectionTemplate`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addCollectionTemplates(templates: CollectionTemplate[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, CollectionTemplate } from '@nocobase/client'; - -class MyCollectionTemplate extends CollectionTemplate { - name = 'my-collection-template'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionTemplateManager.addCollectionTemplates([MyCollectionTemplate]) - } -} -``` - -更多详细请参考:[CollectionTemplateManager](./collection-template-manager) - -### addFieldInterfaces() - -是 `CollectionFieldInterfaceManager` 的快捷方法,用于添加 `CollectionFieldInterface`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addFieldInterfaces(fieldInterfaces: CollectionFieldInterface[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, CollectionFieldInterface } from '@nocobase/client'; - -class MyCollectionFieldInterface extends CollectionFieldInterface { - name = 'my-collection-field-interface'; -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.collectionFieldInterfaceManager.addFieldInterfaces([MyCollectionFieldInterface]) - } -} -``` - -更多详细请参考:[CollectionFieldInterfaceManager](./collection-field-interface-manager) - -### addCollectionMixins() - -用于添加 `Collection` 的 Mixins。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addCollectionMixins(mixins: (typeof Collection)[]): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, Collection } from '@nocobase/client'; - -class MyCollectionMixin extends Collection { - otherMethod() { - console.log('otherMethod'); - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([MyCollectionMixin]) - } -} - -const MyComponent = () => { - const collection = useCollection(); - collection.otherMethod(); -} -``` - -更多详细请参考:[CollectionMixins](./collection-mixins) - -### addDataSource() - -用于添加 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - addDataSource(DataSource: DataSource, options: DataSourceOptions): void; -} -``` - -- 示例 - -```tsx | pure -import { Plugin, DataSource, DataSourceOptions } from '@nocobase/client'; - -class MyDataSource extends DataSource { - async getDataSource() { - return { - status: 'loaded', - collections: [{ name: 'users' }] - } - } -} - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(MyDataSource, { - key: 'my-data-source', - displayName: 'My Data Source', - }) - } -} -``` - -更多详细请参考:[DataSource](./data-source) - -### removeDataSources() - -移除 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - removeDataSources(keys: string[]): void; -} -``` - -- 示例 - -```tsx | pure - -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.removeDataSources(['my-data-source']); -} -``` - -### getDataSources() - -获取全部 `DataSource` 实例列表。 - -- 类型 - -```tsx | pure -class DataSourceManager { - getDataSources(): DataSource[]; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const dataSources = dataSourceManager.getDataSources(); - - return ( -
- {dataSources.map(dataSource => ( -
{dataSource.displayName}
- ))} -
- ) -} -``` - -### getDataSource() - -获取 `DataSource` 实例。 - -- 类型 - -```tsx | pure -class DataSourceManager { - getDataSource(key: string): DataSource; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const dataSource = dataSourceManager.getDataSource('my-data-source'); - - return ( -
- {dataSource.displayName} -
- ) -} -``` - -### getAllCollections() - -获取所有 DataSource 的所有 Collection 实例。 - -- 类型 - -```tsx | pure - -class DataSourceManager { - getAllCollections(options: { - filterCollection?: (collection: Collection) => boolean; - filterDataSource?: (dataSource: DataSource) => boolean; - }): (DataSourceOptions & { collections: Collection[] })[]; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - const collections = dataSourceManager.getAllCollections(); - - return ( -
- {collections.map(({ key, displayName, collections }) => ( -
-

{displayName}

-
    - {collections.map(collection => ( -
  • {collection.name}
  • - ))} -
-
- ))} -
- ) -} -``` - -### reload() - -重载所有 `DataSource`。 - -- 类型 - -```tsx | pure -class DataSourceManager { - reload(): Promise; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceManager = useDataSourceManager(); - dataSourceManager.reload(); -} -``` - diff --git a/packages/core/client/docs/zh-CN/core/data-source/data-source-provider.md b/packages/core/client/docs/zh-CN/core/data-source/data-source-provider.md deleted file mode 100644 index 909a4d894..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/data-source-provider.md +++ /dev/null @@ -1,66 +0,0 @@ -# DataSourceProvider - -用于提供 `DataSource` 的实例。 - -## 组件 - -- 类型 - -```tsx | pure -interface DataSourceProviderProps { - dataSource?: string; - children?: ReactNode; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - return ( - - - - ); -} -``` - -## Hooks - -### useDataSource() - -获取 `DataSource` 实例。 - -- 类型 - -```tsx | pure -function useDataSource(): DataSource; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - return
{dataSource.displayName}
-} -``` - -### useDataSourceKey() - -获取 `DataSource` 的 key。 - -- 类型 - -```tsx | pure -function useDataSourceKey(): string; -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSourceKey = useDataSourceKey(); - return
{dataSourceKey}
-} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/data-source.md b/packages/core/client/docs/zh-CN/core/data-source/data-source.md deleted file mode 100644 index 558a37089..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/data-source.md +++ /dev/null @@ -1,176 +0,0 @@ -# DataSource - -主要是用于获取数据源和数据源的数据表结构列表,并在获取后交给 [CollectionManager](./collection-manager.md) 进行管理,其被 [DataSourceManager](./data-source-manager.md) 管理。 - -## 数据源定义 - -数据源的定义需要继承 `DataSource` 类,并实现 `getDataSource` 方法,当调用 `reload` 方法时,会调用 `getDataSource` 方法获取数据表结构。 - -```tsx | pure -import { DataSource } from '@nocobase/client'; - -class MyDataSource extends DataSource { - async getDataSource() { - return this.app.request({ - url: 'xxx', - method: 'GET', - }); - } -} -``` - -### 数据源注册 - -数据源需要在插件中注册,通过 `DataSourceManager` 的 `addDataSource` 方法进行注册。 - -初始化添加的时候 `collections` 可以为空,当调用 `reload` 方法时,会调用 `getDataSource` 方法获取数据表结构。 - -```tsx | pure -import { Plugin, DataSource, DataSourceOptions } from '@nocobase/client'; - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(MyDataSource, { - key: 'my-data-source', - displayName: 'My Data Source', - status: 'loaded', - collections: [ - { - name: 'users', - fields: [ - { - name: 'name', - type: 'string', - }, - ], - }, - ], - }); - } -} -``` - -- `key`:数据源的唯一标识 -- `displayName`:数据源的显示名称 -- `status`:数据源的状态,`loaded` 表示已加载,`loading` 表示正在加载,`loading-failed` 表示加载失败 -- `collections`:数据表结构 -- `errorMessage`:错误信息 - -## 实例方法 - -### getDataSource() - -用于获取数据源信息,其会被 `reload` 方法内部调用,外部不需要调用。 - -### addReloadCallback() - -用于添加数据源加载完成后的回调函数。 - -- 类型 - -```tsx | pure -type LoadCallback = (collections: CollectionOptions[]) => void; - -class DataSource { - addReloadCallback(callback: LoadCallback): void; -} -``` - -### removeReloadCallback() - -用于移除数据源加载完成后的回调函数。 - -- 类型 - -```tsx | pure -type LoadCallback = (collections: CollectionOptions[]) => void; -class DataSource { - removeReloadCallback(callback: LoadCallback): void; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - useEffect(() => { - const callback = (collections) => { - console.log(collections); - }; - dataSource.addReloadCallback(callback); - return () => { - dataSource.removeReloadCallback(callback); - }; - }, []); -}; -``` - -### reload() - -用于重新加载数据源,会调用 `getDataSource` 方法获取数据表结构,并内部调用 `addReloadCallback` 添加的回调函数。 - -- 类型 - -```tsx | pure -class DataSource { - reload(): Promise; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - const handleClick = async () => { - await dataSource.reload(); - }; -}; -``` - -### getOptions() - -获取数据源的配置信息。 - -- 类型 - -```tsx | pure -interface DataSourceOptions { - key: string; - displayName: string; - collections?: CollectionOptions[]; - errorMessage?: string; - status?: 'loaded' | 'loading-failed' | 'loading'; -} - -class DataSource { - getOptions(): DataSourceOptions; -} -``` - -### getOption() - -获取数据源的配置信息。 - -- 类型 - -```tsx | pure -class DataSource { - getOption(key: string): any; -} -``` - -- 示例 - -```tsx | pure -const MyComponent = () => { - const dataSource = useDataSource(); - - const handleClick = async () => { - console.log(dataSource.getOption('key')); - }; -}; -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo1.tsx b/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo1.tsx deleted file mode 100644 index 0ec4ddb40..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo1.tsx +++ /dev/null @@ -1,136 +0,0 @@ -import { ISchema, observer, useForm } from '@nocobase/schema'; -import { - Action, - Application, - CollectionProvider, - Form, - SchemaComponent, - FormItem, - InheritanceCollectionMixin, - Input, - SchemaComponentOptions, -} from '@nocobase/client'; -import React from 'react'; - -const collection = { - name: 'tests', - fields: [ - { - type: 'string', - name: 'title1', - interface: 'input', - uiSchema: { - title: 'Title1', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - }, - { - type: 'string', - name: 'title2', - interface: 'input', - uiSchema: { - title: 'Title2', - type: 'string', - 'x-component': 'Input', - description: 'description', - default: 'ttt', - }, - }, - { - type: 'string', - name: 'title3', - }, - ], -}; - -const Root = observer(() => { - const schema: ISchema = { - type: 'object', - properties: { - form1: { - type: 'void', - 'x-component': 'Form', - properties: { - // 字段 title1 直接使用全局提供的 uiSchema - title1: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - default: '111', - }, - // 等同于 - // title1: { - // type: 'string', - // title: 'Title', - // required: true, - // 'x-component': 'Input', - // 'x-decorator': 'FormItem', - // }, - title2: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - title: 'Title4', // 覆盖全局已定义的 Title2 - required: true, // 扩展的配置参数 - description: 'description4', - }, - // 等同于 - // title2: { - // type: 'string', - // title: 'Title22', - // required: true, - // 'x-component': 'Input', - // 'x-decorator': 'FormItem', - // }, - // 字段 title3 没有提供 uiSchema,自行处理 - title3: { - 'x-component': 'Input', - 'x-decorator': 'FormItem', - title: 'Title3', - required: true, - }, - action1: { - // type: 'void', - 'x-component': 'Action', - title: 'Submit', - 'x-component-props': { - type: 'primary', - useAction: '{{ useSubmit }}', - }, - }, - }, - }, - }, - }; - - const useSubmit = () => { - const form = useForm(); - return { - async run() { - form.submit(() => { - console.log(form.values); - }); - }, - }; - }; - - return ( - - - - - - ); -}); - -const app = new Application({ - providers: [Root], - components: { Action, Form, Input, FormItem }, - dataSourceManager: { - collections: [collection], - collectionMixins: [InheritanceCollectionMixin], - }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo2.tsx b/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo2.tsx deleted file mode 100644 index 6ead1b09a..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/collection-field/demo2.tsx +++ /dev/null @@ -1,89 +0,0 @@ -import { ISchema, observer } from '@nocobase/schema'; -import { - Application, - CollectionProvider, - Form, - FormItem, - InheritanceCollectionMixin, - Input, - SchemaComponent, - SchemaSettings, -} from '@nocobase/client'; -import React from 'react'; - -const collection = { - name: 'tests', - fields: [ - { - type: 'string', - name: 'title1', - interface: 'input', - uiSchema: { - title: 'Title1', - type: 'string', - 'x-component': 'Input', - required: true, - description: 'description1', - } as ISchema, - }, - ], -}; - -const Root = observer(() => { - const schema: ISchema = { - type: 'object', - properties: { - form1: { - type: 'void', - 'x-component': 'Form', - properties: { - title1: { - 'x-component': 'CollectionField', - 'x-decorator': 'FormItem', - 'x-settings': 'FormItemSettings', - }, - }, - }, - }, - }; - - return ( - - - - ); -}); - -const formSettings = new SchemaSettings({ - name: 'FormItemSettings', - items: [ - { - name: 'required', - type: 'switch', - useComponentProps() { - // const collectionField = useCollectionField(); // 报错 - return { - checked: true, - // checked: !!collectionField?.uiSchema?.required, - title: 'Required', - onChange(v) { - // ? - }, - }; - }, - }, - ], -}); - -const app = new Application({ - providers: [Root], - components: { Form, Input, FormItem }, - dataSourceManager: { - collections: [collection], - collectionMixins: [InheritanceCollectionMixin], - }, - schemaSettings: [formSettings], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/collection/demo1.tsx b/packages/core/client/docs/zh-CN/core/data-source/demos/collection/demo1.tsx deleted file mode 100644 index a01748165..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/collection/demo1.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import { CollectionProvider, useCollection } from '@nocobase/client'; -import { createApp } from '../createApp'; - -const Demo = () => { - const collection = useCollection(); - return
{JSON.stringify(collection.getField('username'), null, 2)}
; -}; - -const Root = () => { - return ( - - - - ); -}; - -export default createApp(Root); diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/collections.json b/packages/core/client/docs/zh-CN/core/data-source/demos/collections.json deleted file mode 100644 index 4d3aa45f8..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/collections.json +++ /dev/null @@ -1,198 +0,0 @@ -[ - { - "key": "h7b9i8khc3q", - "name": "users", - "inherit": false, - "hidden": false, - "description": null, - "category": [], - "namespace": "users.users", - "duplicator": { - "dumpable": "optional", - "with": "rolesUsers" - }, - "sortable": "sort", - "model": "UserModel", - "createdBy": true, - "updatedBy": true, - "logging": true, - "from": "db2cm", - "title": "{{t(\"Users\")}}", - "rawTitle": "{{t(\"Users\")}}", - "fields": [ - { - "uiSchema": { - "type": "number", - "title": "{{t(\"ID\")}}", - "x-component": "InputNumber", - "x-read-pretty": true, - "rawTitle": "{{t(\"ID\")}}" - }, - "key": "ffp1f2sula0", - "name": "id", - "type": "bigInt", - "interface": "id", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "autoIncrement": true, - "primaryKey": true, - "allowNull": false - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Nickname\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Nickname\")}}" - }, - "key": "vrv7yjue90g", - "name": "nickname", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Username\")}}", - "x-component": "Input", - "x-validator": { - "username": true - }, - "required": true, - "rawTitle": "{{t(\"Username\")}}" - }, - "key": "2ccs6evyrub", - "name": "username", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Email\")}}", - "x-component": "Input", - "x-validator": "email", - "required": true, - "rawTitle": "{{t(\"Email\")}}" - }, - "key": "rrskwjl5wt1", - "name": "email", - "type": "string", - "interface": "email", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "unique": true - }, - { - "key": "t09bauwm0wb", - "name": "roles", - "type": "belongsToMany", - "interface": "m2m", - "description": null, - "collectionName": "users", - "parentKey": null, - "reverseKey": null, - "target": "roles", - "foreignKey": "userId", - "otherKey": "roleName", - "onDelete": "CASCADE", - "sourceKey": "id", - "targetKey": "name", - "through": "rolesUsers", - "uiSchema": { - "type": "array", - "title": "{{t(\"Roles\")}}", - "x-component": "AssociationField", - "x-component-props": { - "multiple": true, - "fieldNames": { - "label": "title", - "value": "name" - } - } - } - } - ] - }, - { - "key": "pqnenvqrzxr", - "name": "roles", - "inherit": false, - "hidden": false, - "description": null, - "category": [], - "namespace": "acl.acl", - "duplicator": { - "dumpable": "required", - "with": "uiSchemas" - }, - "autoGenId": false, - "model": "RoleModel", - "filterTargetKey": "name", - "sortable": true, - "from": "db2cm", - "title": "{{t(\"Roles\")}}", - "rawTitle": "{{t(\"Roles\")}}", - "fields": [ - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Role UID\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Role UID\")}}" - }, - "key": "jbz9m80bxmp", - "name": "name", - "type": "uid", - "interface": "input", - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null, - "prefix": "r_", - "primaryKey": true - }, - { - "uiSchema": { - "type": "string", - "title": "{{t(\"Role name\")}}", - "x-component": "Input", - "rawTitle": "{{t(\"Role name\")}}" - }, - "key": "faywtz4sf3u", - "name": "title", - "type": "string", - "interface": "input", - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null, - "unique": true, - "translation": true - }, - { - "key": "1enkovm9sye", - "name": "description", - "type": "string", - "interface": null, - "description": null, - "collectionName": "roles", - "parentKey": null, - "reverseKey": null - } - ] - } -] diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/createApp.tsx b/packages/core/client/docs/zh-CN/core/data-source/demos/createApp.tsx deleted file mode 100644 index 127f2e7c8..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/createApp.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { - Application, - ApplicationOptions, - CardItem, - Plugin, - CollectionPlugin, - DataBlockProvider, - DEFAULT_DATA_SOURCE_KEY, - DEFAULT_DATA_SOURCE_TITLE, - LocalDataSource, -} from '@nocobase/client'; -import MockAdapter from 'axios-mock-adapter'; -import { ComponentType } from 'react'; -import collections from './collections.json'; - -const defaultMocks = { - 'users:list': { - data: [ - { - id: '1', - username: 'jack', - nickname: 'Jack Ma', - email: 'test@gmail.com', - }, - { - id: '2', - username: 'jim', - nickname: 'Jim Green', - }, - { - id: '3', - username: 'tom', - nickname: 'Tom Cat', - email: 'tom@gmail.com', - }, - ], - }, - 'roles:list': { - data: [ - { - name: 'root', - title: 'Root', - description: 'Root', - }, - { - name: 'admin', - title: 'Admin', - description: 'Admin description', - }, - ], - }, -}; - -export function createApp( - Demo: ComponentType, - options: ApplicationOptions = {}, - mocks: Record = defaultMocks, -) { - class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addDataSource(LocalDataSource, { - key: DEFAULT_DATA_SOURCE_KEY, - displayName: DEFAULT_DATA_SOURCE_TITLE, - collections: collections as any, - }); - } - } - const app = new Application({ - apiClient: { - baseURL: 'http://localhost:8000', - }, - providers: [Demo], - ...options, - components: { - ...options.components, - DataBlockProvider, - CardItem, - }, - plugins: [CollectionPlugin, MyPlugin, ...(options.plugins || [])], - designable: true, - }); - - const mock = new MockAdapter(app.apiClient.axios); - - Object.entries(mocks).forEach(([url, data]) => { - mock.onGet(url).reply(async (config) => { - const res = typeof data === 'function' ? data(config) : data; - return [200, res]; - }); - mock.onPost(url).reply(async (config) => { - const res = typeof data === 'function' ? data(config) : data; - return [200, res]; - }); - }); - - const Root = app.getRootComponent(); - return Root; -} diff --git a/packages/core/client/docs/zh-CN/core/data-source/demos/data-source-manager/mixins.tsx b/packages/core/client/docs/zh-CN/core/data-source/demos/data-source-manager/mixins.tsx deleted file mode 100644 index f2f26151f..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/demos/data-source-manager/mixins.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { CollectionProvider, Collection, useCollection, Plugin } from '@nocobase/client'; -import { createApp } from '../createApp'; - -class TestMixin extends Collection { - test() { - const { name } = this.options; - return 'test ' + name; - } -} - -class Test2Mixin extends Collection { - test2() { - const { name } = this.options; - return 'test2 ' + name; - } -} - -const Demo = () => { - const collection = useCollection(); - return ( -
-
test: {collection.test()}
-
test2: {collection.test2()}
-
fields.length: {collection.getFields().length}
-
- ); -}; - -const Root = () => { - return ( - - - - ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.dataSourceManager.addCollectionMixins([TestMixin, Test2Mixin]); - } -} - -export default createApp(Root, { - plugins: [MyPlugin], -}); diff --git a/packages/core/client/docs/zh-CN/core/data-source/extend-collections-provider.md b/packages/core/client/docs/zh-CN/core/data-source/extend-collections-provider.md deleted file mode 100644 index 8b033ff0f..000000000 --- a/packages/core/client/docs/zh-CN/core/data-source/extend-collections-provider.md +++ /dev/null @@ -1,79 +0,0 @@ -# ExtendCollectionsProvider - -用于扩展 [Collection](./collection.md) 。 - -## 组件 - -- 类型 - -```tsx | pure -interface ExtendCollectionsProviderProps { - collections: CollectionOptions[]; - children?: ReactNode; -} -``` - -- 示例 - -```tsx | pure -import { ExtendCollectionsProvider, CollectionOptions } from '@nocobase/client'; - -const userCollection: CollectionOptions = { - name: 'users', - title: '{{t("Users")}}', - fields: [ - { - type: 'string', - name: 'name', - title: '{{t("Name")}}', - }, - { - type: 'string', - name: 'email', - title: '{{t("Email")}}', - }, - ], -} - -const MyPlugin = () => { - return ( - - - - - - ); -} - -const ChildComponent = () => { - const collection = useCollection(); - - return ( -
-

{collection.name}

-
- ); -} -``` - -## Hooks - -### useExtendCollections() - -获取扩展的数据表。 - -```tsx | pure -import { useExtendCollections } from '@nocobase/client'; - -const MyComponent = () => { - const collections = useExtendCollections(); - - return ( -
- {collections.map((collection) => ( -
{collection.title}
- ))} -
- ); -} -``` diff --git a/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface-form.png b/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface-form.png deleted file mode 100644 index 9a6029e8a..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface-form.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface.png b/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface.png deleted file mode 100644 index 6d04d0e2b..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-source/images/collection-field-interface.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-source/images/collection-template-form.png b/packages/core/client/docs/zh-CN/core/data-source/images/collection-template-form.png deleted file mode 100644 index 6223be103..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-source/images/collection-template-form.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-source/images/collection-template.png b/packages/core/client/docs/zh-CN/core/data-source/images/collection-template.png deleted file mode 100644 index 45a9de527..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-source/images/collection-template.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/data-source/images/field-groups.png b/packages/core/client/docs/zh-CN/core/data-source/images/field-groups.png deleted file mode 100644 index 3f9381a70..000000000 Binary files a/packages/core/client/docs/zh-CN/core/data-source/images/field-groups.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png b/packages/core/client/docs/zh-CN/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png deleted file mode 100644 index 0fa567bf5..000000000 Binary files a/packages/core/client/docs/zh-CN/core/static/CxjJbp0pcogYn6xviVyc6QT8nUg.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png b/packages/core/client/docs/zh-CN/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png deleted file mode 100644 index d27e675f7..000000000 Binary files a/packages/core/client/docs/zh-CN/core/static/KTUWb69kioUg8bxYTAMc2ReDnRg.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png b/packages/core/client/docs/zh-CN/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png deleted file mode 100644 index 9d65a782c..000000000 Binary files a/packages/core/client/docs/zh-CN/core/static/VfPGbhWo9os0qTxcITkcHNfin4g.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/static/designer.png b/packages/core/client/docs/zh-CN/core/static/designer.png deleted file mode 100644 index 466fa4cfd..000000000 Binary files a/packages/core/client/docs/zh-CN/core/static/designer.png and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/static/plugin-settings.jpg b/packages/core/client/docs/zh-CN/core/static/plugin-settings.jpg deleted file mode 100644 index 34a8da116..000000000 Binary files a/packages/core/client/docs/zh-CN/core/static/plugin-settings.jpg and /dev/null differ diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-basic.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-basic.tsx deleted file mode 100644 index 7c67b3b24..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-basic.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-common.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-common.tsx deleted file mode 100644 index 79962078e..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-common.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { ApplicationOptions, Grid, Plugin, SchemaComponent } from '@nocobase/client'; -import React from 'react'; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid }); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const appOptions: ApplicationOptions = { - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}; - -export { appOptions }; diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-component.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-component.tsx deleted file mode 100644 index 06796b827..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-component.tsx +++ /dev/null @@ -1,133 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { Avatar } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - insertPosition: 'beforeEnd', - Component: (props: any) => ( - - C - - ), - componentProps: { - size: 'large', - }, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-divider.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-divider.tsx deleted file mode 100644 index 39a23be52..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-divider.tsx +++ /dev/null @@ -1,57 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'd', - type: 'divider', - }, - { - name: 'b', - title: 'B Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'B1', - }, - { - name: 'a2', - type: 'item', - title: 'B2', - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-group.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-group.tsx deleted file mode 100644 index d691ff925..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-group.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { Application, SchemaInitializer, SchemaInitializerItemGroup } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; -import React from 'react'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A Group Title', - type: 'itemGroup', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'b', - title: 'B Group Title', - type: 'itemGroup', - divider: true, // 渲染分割线 - useChildren() { - // 动态子元素 - return [ - { - name: 'b1', - type: 'item', - title: 'B1', - }, - { - name: 'b2', - type: 'item', - title: 'B2', - }, - ]; - }, - }, - { - name: 'c', - Component: () => { - return ( - - {[ - { - name: 'c1', - type: 'item', - title: 'C1', - }, - ]} - - ); - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-item.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-item.tsx deleted file mode 100644 index 05e6f983a..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-item.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * defaultShowCode: true - */ -import { - Grid, - SchemaInitializer, - useSchemaInitializer, - SchemaInitializerItem, - CardItem, - Application, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; -import { useFieldSchema } from '@nocobase/schema'; - -const Demo = () => { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - Component: Demo, - }, - { - name: 'demo2', - type: 'item', - useComponentProps() { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - - return { - title: 'type 方式定义', - onClick: handleClick, - }; - }, - }, - { - name: 'demo3', - title: 'with items', - type: 'item', - onClick(args) { - console.log(args); - }, - items: [ - { - label: 'aaa', - value: 'aaa', - }, - { - label: 'bbb', - value: 'bbb', - }, - ], - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], - components: { CardItem, Hello }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-menu.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-menu.tsx deleted file mode 100644 index f795b0271..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-menu.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'A subMenu', - type: 'subMenu', - children: [ - { - name: 'a1', - type: 'item', - title: 'A1', - }, - { - name: 'a2', - type: 'item', - title: 'A2', - }, - ], - }, - { - name: 'b', - title: 'B subMenu', - type: 'subMenu', - children: [ - { - name: 'a1', - type: 'item', - title: 'B1', - }, - { - name: 'a2', - type: 'item', - title: 'B2', - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-select.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-select.tsx deleted file mode 100644 index 620dc40c5..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-select.tsx +++ /dev/null @@ -1,53 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Grid, SchemaInitializer, Application, SchemaInitializerSelect, useDesignable } from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; -import { useFieldSchema } from '@nocobase/schema'; - -const OpenModeSelect = () => { - const fieldSchema = useFieldSchema(); - const openModeValue = fieldSchema?.['x-component-props']?.['openMode'] || 'drawer'; - - const { patch } = useDesignable(); - const handleChange = (value) => { - // 修改当前节点的 Schema 的属性 - patch({ - 'x-component-props': { - openMode: value, - }, - }); - }; - - return ( - - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'openMode', - Component: OpenModeSelect, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-switch.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-switch.tsx deleted file mode 100644 index c8eb33888..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-components-switch.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/** - * defaultShowCode: true - */ -import { - Grid, - SchemaInitializer, - Application, - SchemaInitializerSwitch, - useCurrentSchema, - useSchemaInitializer, - Action, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-initializer-common'; - -const actionKey = 'x-action'; - -const schema = { - type: 'void', - [actionKey]: 'create', - title: "{{t('Add new')}}", - 'x-component': 'Action', - 'x-component-props': { - type: 'primary', - }, -}; - -const AddNewButton = () => { - // 判断是否已插入 - const { exists, remove } = useCurrentSchema(schema[actionKey], actionKey); - - const { insert } = useSchemaInitializer(); - return ( - { - // 如果已插入,则移除 - if (exists) { - return remove(); - } - // 新插入子节点 - insert(schema); - }} - /> - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Configure actions', - wrap: Grid.wrap, - items: [ - { - name: 'Add New', - Component: AddNewButton, - }, - { - name: 'Add New2', - type: 'switch', - useComponentProps() { - const { exists, remove } = useCurrentSchema(schema[actionKey], actionKey); - - const { insert } = useSchemaInitializer(); - return { - checked: exists, - title: 'Add new - type 方式', - onClick() { - // 如果已插入,则移除 - if (exists) { - return remove(); - } - // 新插入子节点 - insert(schema); - }, - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], - components: { Action }, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-hooks-item.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-hooks-item.tsx deleted file mode 100644 index ddf54ed2d..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-hooks-item.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { ReactNode } from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem, useSchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; -import { TableOutlined } from '@ant-design/icons'; - -const Demo = () => { - const { name, foo, icon } = useSchemaInitializerItem<{ name: string; foo: string; icon: ReactNode }>(); - - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - foo: 'bar', - icon: , - Component: Demo, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-items.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-items.tsx deleted file mode 100644 index 78657d332..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-items.tsx +++ /dev/null @@ -1,146 +0,0 @@ -import React, { FC } from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerChild, - SchemaInitializerItem, - SchemaInitializerItemsProps, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { ButtonProps, ListProps, List, Card } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const CustomListGridMenu: FC>> = (props) => { - const { items, options, ...others } = props; - return ( - ( - - - - )} - > - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - ItemsComponent: CustomListGridMenu, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-children.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-children.tsx deleted file mode 100644 index 1e7fe3e23..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-children.tsx +++ /dev/null @@ -1,61 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - type: 'itemGroup', - title: '静态 children', - children: [ - { - name: 'a1', - type: 'item', - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - title: 'A 2', - }, - ], - }, - { - name: 'a', - type: 'itemGroup', - title: '动态 children', - useChildren() { - return [ - { - name: 'a1', - type: 'item', - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - title: 'A 2', - }, - ]; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-define.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-define.tsx deleted file mode 100644 index 534ec581b..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-define.tsx +++ /dev/null @@ -1,34 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - }, - { - name: 'b', - type: 'item', // 通过 `type` 定义,底层对应着 `SchemaInitializerItem` 组件 - title: 'type Demo', - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-props.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-props.tsx deleted file mode 100644 index 37d46fa4e..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-props.tsx +++ /dev/null @@ -1,40 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaInitializer, SchemaInitializerItem } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const CommonDemo = (props) => { - return ; -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - Component: CommonDemo, - componentProps: { - title: 'componentProps', - }, - }, - { - name: 'b', - Component: CommonDemo, - useComponentProps() { - return { - title: 'useComponentProps', - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-visible.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-visible.tsx deleted file mode 100644 index ead52953d..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-options-item-visible.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaInitializer } from '@nocobase/client'; -import { appOptions } from './schema-initializer-common'; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - type: 'item', - title: 'Demo A', - }, - { - name: 'b', - type: 'item', - title: 'Demo B', - useVisible() { - return false; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaInitializers: [myInitializer], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-popover.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-popover.tsx deleted file mode 100644 index 87fec2666..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-popover.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - useDesignable, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; -import { Button } from 'antd'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -const MyInitializerComponent = () => { - const { insertBeforeEnd } = useDesignable(); - return ( - - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - popover: false, - Component: MyInitializerComponent, -}); - -const AddBlockButton = observer( - () => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return render(); - }, - { displayName: 'AddBlockButton' }, -); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-render.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-render.tsx deleted file mode 100644 index eea87b77d..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-initializer-render.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import React from 'react'; -import { - Application, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaInitializerRender, -} from '@nocobase/client'; -import { observer, useField, useFieldSchema } from '@nocobase/schema'; -import { Field } from '@nocobase/schema'; - -const Hello = observer(() => { - const field = useField(); - return ( -
- {field.title} -
- ); -}); - -function Demo() { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - title: itemConfig.title, - 'x-component': 'Hello', - }); - }; - return ; -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - { - name: 'b', - title: 'Item B', - Component: Demo, - }, - ], -}); - -const AddBlockButton = observer(() => { - const fieldSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer']); - return ( -
-
{render()}
-
可以进行参数的二次覆盖:{render({ style: { color: 'red' } })}
-
- ); -}); - -const Page = observer( - (props) => { - return ( -
- {props.children} - -
- ); - }, - { displayName: 'Page' }, -); - -const Root = () => { - return ( -
- -
- ); -}; - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - this.app.router.add('root', { - path: '/', - Component: Root, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], - designable: true, -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-common.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-common.tsx deleted file mode 100644 index 01b99b9aa..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-common.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ApplicationOptions, CardItem, Grid, Plugin, SchemaComponent } from '@nocobase/client'; -import React from 'react'; - -const Hello = () => { - return

Hello, world!

; -}; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const appOptions: ApplicationOptions = { - router: { - type: 'memory', - }, - designable: true, - components: { Grid, CardItem, Hello }, - plugins: [PluginHello], -}; - -export { appOptions }; diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-action-modal.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-action-modal.tsx deleted file mode 100644 index 25b94e5c3..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-action-modal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { - Application, - FormItem, - Input, - SchemaSettings, - SchemaSettingsActionModalItem, - useDesignable, -} from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { ISchema, useField } from '@nocobase/schema'; - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const filed = useField(); - const { patch } = useDesignable(); - - return ( - { - patch({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ FormItem, Input }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-divider.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-divider.tsx deleted file mode 100644 index f2b3d98b6..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-divider.tsx +++ /dev/null @@ -1,68 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'group A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'divider', - type: 'divider', - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: 'group B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-group.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-group.tsx deleted file mode 100644 index e47b99a13..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-group.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'group A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: 'group B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-item.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-item.tsx deleted file mode 100644 index 3aae57b2f..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-item.tsx +++ /dev/null @@ -1,76 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC, useState } from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Button, Input, Space } from 'antd'; - -const MarkdownEdit = () => { - const field = useField(); - return ( - { - field.editable = true; - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'markdown', - Component: MarkdownEdit, - }, - ], -}); - -const Hello: FC<{ content?: string }> = observer((props) => { - const field = useField(); - const { content } = props; - const [inputVal, setInputVal] = useState(content); - const { patch } = useDesignable(); - return field.editable ? ( - - setInputVal(e.target.value)} /> - - - - - - ) : ( -

{content}

- ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-modal.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-modal.tsx deleted file mode 100644 index 6dac4f24d..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-modal.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/** - * defaultShowCode: true - */ -import { ISchema } from '@nocobase/schema'; -import { - Application, - FormItem, - Input, - SchemaSettings, - SchemaSettingsModalItem, - useSchemaSettings, -} from '@nocobase/client'; -import React from 'react'; -import { appOptions } from './schema-settings-common'; - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const { dn } = useSchemaSettings(); - - return ( - { - dn.deepMerge({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ FormItem, Input }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-remove.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-remove.tsx deleted file mode 100644 index c1b101cc3..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-remove.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - breakRemoveOn(s) { - return s['x-component'] === 'Grid'; // 其顶级是 Grid,这一层级不能删 - }, - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-select.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-select.tsx deleted file mode 100644 index e9f80c243..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-select.tsx +++ /dev/null @@ -1,82 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC } from 'react'; -import { Application, SchemaSettings, SchemaSettingsSelectItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Table } from 'antd'; - -const PageSize = () => { - const { patch } = useDesignable(); - const filed = useField(); - return ( - { - patch({ - 'x-component-props': { - pageSize: v, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'pageSize', - Component: PageSize, - }, - ], -}); - -const data = []; -for (let i = 0; i < 46; i++) { - data.push({ - key: i, - name: `Edward King ${i}`, - age: 32, - address: `London, Park Lane no. ${i}`, - }); -} -const Hello: FC<{ pageSize: number }> = observer((props) => { - return ( -
- ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-sub-menu.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-sub-menu.tsx deleted file mode 100644 index 4e9be9478..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-sub-menu.tsx +++ /dev/null @@ -1,64 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'subMenu', - componentProps: { - title: 'Sub Menu A', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A1', - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A2', - }, - }, - ], - }, - { - name: 'b', - type: 'subMenu', - componentProps: { - title: 'Sub Menu B', - }, - children: [ - { - name: 'b1', - type: 'item', - componentProps: { - title: 'B1', - }, - }, - { - name: 'b2', - type: 'item', - componentProps: { - title: 'B2', - }, - }, - ], - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-switch.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-switch.tsx deleted file mode 100644 index ef8a22619..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-components-switch.tsx +++ /dev/null @@ -1,74 +0,0 @@ -/** - * defaultShowCode: true - */ -import React, { FC } from 'react'; -import { Application, SchemaSettings, SchemaSettingsSwitchItem, useDesignable } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; -import { observer, useField } from '@nocobase/schema'; -import { Form, Input } from 'antd'; - -const FormItemRequired = () => { - const { patch } = useDesignable(); - const filed = useField(); - return ( - { - patch({ - 'x-component-props': { - required: v, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'required', - Component: FormItemRequired, - }, - { - name: 'required2', - type: 'switch', - useComponentProps() { - const { patch } = useDesignable(); - const filed = useField(); - return { - title: 'Required - type 方式', - checked: !!filed.componentProps?.required, - onChange(v) { - patch({ - 'x-component-props': { - required: v, - }, - }); - }, - }; - }, - }, - ], -}); - -const Hello: FC<{ required: boolean }> = observer((props) => { - return ( -
- - - - - ); -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -app.addComponents({ Hello }); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-children.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-children.tsx deleted file mode 100644 index 102c312b2..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-children.tsx +++ /dev/null @@ -1,72 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: '静态 children', - }, - children: [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A 1', - onClick: () => { - alert('a-1'); - }, - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A 2', - }, - }, - ], - }, - { - name: 'b', - type: 'itemGroup', - componentProps: { - title: '动态 children', - }, - useChildren() { - return [ - { - name: 'a1', - type: 'item', - componentProps: { - title: 'A 1', - }, - onClick: () => { - alert('a-1'); - }, - }, - { - name: 'a2', - type: 'item', - componentProps: { - title: 'A 2', - }, - }, - ]; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-define.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-define.tsx deleted file mode 100644 index f370a23ee..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-define.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return ; -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - }, - { - name: 'b', - type: 'item', // 通过 `type` 定义,底层对应着 `SchemaInitializerItem` 组件 - componentProps: { - title: 'type Demo', - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-props.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-props.tsx deleted file mode 100644 index 7b3737611..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-props.tsx +++ /dev/null @@ -1,39 +0,0 @@ -/** - * defaultShowCode: true - */ -import React from 'react'; -import { Application, SchemaSettings, SchemaSettingsItem } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const CommonDemo = (props) => { - return ; -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: CommonDemo, - componentProps: { - title: 'componentProps', - }, - }, - { - name: 'b', - Component: CommonDemo, - useComponentProps() { - return { - title: 'useComponentProps', - }; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-visible.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-visible.tsx deleted file mode 100644 index 6cfc7f725..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-options-item-visible.tsx +++ /dev/null @@ -1,35 +0,0 @@ -/** - * defaultShowCode: true - */ -import { Application, SchemaSettings } from '@nocobase/client'; -import { appOptions } from './schema-settings-common'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'item', - componentProps: { - title: 'Demo A', - }, - }, - { - name: 'b', - type: 'item', - componentProps: { - title: 'Demo B', - }, - useVisible() { - return false; - }, - }, - ], -}); - -const app = new Application({ - ...appOptions, - schemaSettings: [mySettings], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-render.tsx b/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-render.tsx deleted file mode 100644 index 5993b128b..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/demos/schema-settings-render.tsx +++ /dev/null @@ -1,150 +0,0 @@ -import { ISchema, useField, useFieldSchema } from '@nocobase/schema'; -import { - Application, - CardItem, - FormItem, - Grid, - Input, - Plugin, - SchemaComponent, - SchemaSettings, - SchemaSettingsModalItem, - createDesignable, - useAPIClient, - useSchemaComponentContext, - useSchemaSettings, - useSchemaSettingsRender, -} from '@nocobase/client'; -import React, { useMemo } from 'react'; - -class PluginHello extends Plugin { - async load() { - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -export const SchemaSettingsBlockTitleItem = function BlockTitleItem() { - const { dn } = useSchemaSettings(); - - return ( - { - dn.shallowMerge({ - 'x-decorator-props': { - title, - }, - }); - }} - /> - ); -}; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'blockTitle', - Component: SchemaSettingsBlockTitleItem, - }, - ], -}); - -const Hello = (props) => { - return ( -

- Hello, world! - {props.children} -

- ); -}; - -const Demo = () => { - const fieldSchema = useFieldSchema(); - const field = useField(); - const api = useAPIClient(); - const { refresh } = useSchemaComponentContext(); - const dn = useMemo( - () => - createDesignable({ - current: fieldSchema.parent, - model: field.parent, - api, - refresh, - }), - [], - ); - const { render, exists } = useSchemaSettingsRender(fieldSchema['x-settings'], { - fieldSchema: dn.current, - field: dn.model, - dn, - }); - return ( -
-
{render()}
-
可以进行参数的二次覆盖:{render({ style: { color: 'red' } })}
-
- ); -}; - -const HelloPage = () => { - return ( -
- -
- ); -}; - -const app = new Application({ - schemaSettings: [mySettings], - router: { - type: 'memory', - }, - designable: true, - components: { FormItem, Input, Grid, CardItem, Hello }, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/designable.md b/packages/core/client/docs/zh-CN/core/ui-schema/designable.md deleted file mode 100644 index 75b151b26..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/designable.md +++ /dev/null @@ -1,791 +0,0 @@ -# Designable - -## Designable - -对 Schema 节点进行增、删、改操作,并且提供了事件触发机制,用于将数据同步到服务端。 - -```tsx | pure -interface Options { - current: Schema; - api?: APIClient; - onSuccess?: any; - refresh?: () => void; - t?: any; -} - -interface InsertAdjacentOptions { - wrap?: (s: ISchema) => ISchema; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | BreakFn; - onSuccess?: any; -} - -class Designable { - constructor(options: Options ) { } - loadAPIClientEvents(): void; - on(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', listener: any): void - emit(name: 'insertAdjacent' | 'remove' | 'error' | 'patch' | 'batchPatch', ...args: any[]): Promise - refresh(): void - recursiveRemoveIfNoChildren(schema?: Schema, options?: RecursiveRemoveOptions): Schema; - remove(schema?: Schema, options?: RemoveOptions): Promise - removeWithoutEmit(schema?: Schema, options?: RemoveOptions): Schema - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void | Promise - insertBeforeBeginOrAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeBegin(schema: ISchema, options?: InsertAdjacentOptions): void - insertAfterBegin(schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeEnd(schema: ISchema, options?: InsertAdjacentOptions): Promise - insertAfterEnd(schema: ISchema, options?: InsertAdjacentOptions): void -} -``` - -### 构造函数 - -- 参数讲解 - - - `current`:需要操作的 Schema 节点 - - `api`:用于发起后端请求的 [APIClient](https://docs.nocobase.com/api/sdk) 实例 - - `onSuccess`:后端接口请求成功后的回调 - - `refresh`:用于更新节点后,刷新页面 - - `t`:`useTranslation()` 的返回值 -- 示例 - -```tsx | pure -const schema = new Schema({ - type: 'void', - name: 'hello', - 'x-component': 'div', -}) - -const dn = new Designable({ current: schema }); -``` - -### Schema 操作方法 - -```tsx | pure -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - } - } -}); - -const b = schema.b; - -const dn = createDesignable({ - current: b, -}) - -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -#### remove - -移除当前节点 - -```tsx | pure -dn.remove(); -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.remove(); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { -- b: { -- type: 'void', -- properties: { -- c: { -- type: 'void', -- } -- } -- } - } -} -``` - -#### insertBeforeBegin - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertBeforeBegin({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertBeforeBegin({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { -+ d: { -+ type: 'void', -+ }, - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - } - } -} -``` - -#### insertAfterBegin - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertAfterBegin({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertAfterBegin({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { -+ d: { -+ type: 'void', -+ }, - c: { - type: 'void', - } - } - } - } -} -``` - -#### insertBeforeEnd - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertBeforeEnd({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertBeforeEnd({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, -+ d: { -+ type: 'void', -+ }, - } - } - } -} -``` - -#### insertAfterEnd - -在当前节点的前面插入,并会触发 `insertAdjacent` 事件。 - -```tsx | pure -dn.insertAfterEnd({ - type: 'void', - name: 'd', -}); -console.log(schema.toJSON()); -``` - - -```tsx -import React from 'react'; -import { Schema } from '@formily/json-schema'; -import { createDesignable } from '@nocobase/client'; - -const schema = new Schema({ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - }, - }, - }, - }, -}); - -const b = schema.properties['b']; - -const dn = createDesignable({ - current: b, -}); - -dn.insertAfterEnd({ - type: 'void', - name: 'd', -}); - -export default () =>
{JSON.stringify(schema.toJSON(), null, 2)}
; -``` - -```diff -{ - type: 'void', - name: 'a', - properties: { - b: { - type: 'void', - properties: { - c: { - type: 'void', - } - } - }, -+ d: { -+ type: 'void', -+ }, - } -} -``` - -#### insertAdjacent - -根据第一个参数决定插入的位置,是前面四个方法的封装。 - -```tsx | pure -class Designable { - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void | Promise -} -``` - -### 事件监听和 API 请求 - -- `on` :添加事件监听的基础方法 -- `loadAPIClientEvents`:调用 `on` 方法添加对 `insertAdjacent`、`patch`、`batchPatch`、`remove` 的事件的监听,主要功能是将变更的 Schema 更新到服务端 -- `emit`:是根据事件名称,调用之前注册过的方法,具体是由前面讲过的 *插入操作和删除操作* 触发 - -而 `loadAPIClientEvents()` 并非在初始化时调用,需要手动调用,换而言之,如果不调用 `dn.loadAPIClientEvents()`,则不会将更新发送到服务端,主要是简化在单测或者 DEMO 环境对服务端的 Mock。 - -## 工具函数 - -### createDesignable() - -对 `new Designable()` 的简单封装。 - -```tsx | pure -function createDesignable(options: CreateDesignableProps) { - return new Designable(options); -} -``` - -```tsx | pure -const dn = createDesignable({ current: schema }); -``` - -## Hooks - -### useFieldSchema() - -用户获取当前节点 Schema JSON 对象,更多信息请参考 [formily useFieldSchema()](https://react.formilyjs.org/api/hooks/use-field-schema)。 - -- 类型 - -```tsx | pure -import { Schema } from '@formily/json-schema'; -const useFieldSchema: () => Schema; -``` - -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import React from 'react'; -import { useFieldSchema } from '@formily/react'; -import { Application, Plugin, SchemaComponent } from '@nocobase/client'; -const Demo = ({ children }) => { - const fieldSchema = useFieldSchema(); - return
-
{ JSON.stringify(fieldSchema, null, 2)}
-
{children}
-
-} -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Demo', // 这里是 Demo 组件 - 'properties': { - 'world': { - 'type': 'void', - 'x-component': 'Demo', // 这里也是 Demo 组件 - }, - } -} - -const Root = () => { - return -} - -const app = new Application({ - providers: [Root] -}) - -export default app.getRootComponent(); -``` - -### useField() - -获取当前节点 Schema 实例,更多信息请参考 [formily useField()](https://react.formilyjs.org/api/hooks/use-field) - -- 类型 - -```tsx | pure -import { GeneralField } from '@formily/core'; -const useField: () => T; -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const field = useField(); - console.log('field', field); - return
-} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Demo', // 这里是 Demo 组件 - 'properties': { - 'world': { - 'type': 'void', - 'x-component': 'Demo', // 这里也是 Demo 组件 - }, - } -} - -const Root = () => { - return -} -``` - -### useDesignable() - -对当前 Schema 节点的修改操作。 - -- 类型 - -```tsx | pure -interface InsertAdjacentOptions { - wrap?: (s: ISchema) => ISchema; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | BreakFn; - onSuccess?: any; -} - -type Position = 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd'; - -function useDesignable(): { - dn: Designable; - designable: boolean; - reset: () => void; - refresh: () => void; - setDesignable: (value: boolean) => void; - findComponent(component: any): any; - patch: (key: ISchema | string, value?: any) => void - on(name: "error" | "insertAdjacent" | "remove" | "patch" | "batchPatch", listener: any): void - remove(schema?: any, options?: RemoveOptions): void - insertAdjacent(position: Position, schema: ISchema, options?: InsertAdjacentOptions): void - insertBeforeBegin(schema: ISchema): void; - insertAfterBegin(schema: ISchema): void; - insertBeforeEnd(schema: ISchema): void; - insertAfterEnd(schema: ISchema): void; -} -``` - -- 详细解释 - - - designable、reset、refresh、setDesignable:这些值继承自 [SchemaComponentContext](https://www.baidu.com) - - dn:是 `Designable` 的实例 - - findComponent:用于查找 Schema 中字符串对应真正的组件,如果组件未注册则返回 `null` - - remove:内部调用的是 `dn.remove` 方法 - - on:内部调用的是 `dn.on` 方法 - - insertAdjacent:插入新的 Schema 节点,内部调用的是 `dn.insertAdjacent` 方法 - - position:插入位置 - - schema:新的 Schema 节点 - - Options - - wrap:对 Schema 的二次处理的回调函数 - - removeParentsIfNoChildren:当没有子元素时,删除父元素 - - breakRemoveOn:停止删除的判断回调 - - onSuccess:插入成功的回调 - - insertBeforeBegin:内部调用的是 `dn.insertBeforeBegin` 方法 - - insertAfterBegin:内部调用的是 `dn.insertAfterBegin` 方法 - - insertBeforeEnd:内部调用的是 `dn.insertBeforeEnd` 方法 - - insertAfterEnd:内部调用的是 `dn.insertAfterEnd` 方法 -- 示例 - -插入节点。 - -```tsx -import React from 'react'; -import { - SchemaComponentProvider, - SchemaComponent, - useDesignable, -} from '@nocobase/client'; -import { observer, Schema, useFieldSchema } from '@formily/react'; -import { Button, Space } from 'antd'; -import { uid } from '@formily/shared'; - -const Hello = observer( - (props) => { - const { insertAdjacent } = useDesignable(); - const fieldSchema = useFieldSchema(); - return ( -
-

{fieldSchema.name}

- - - - - - -
{props.children}
-
- ); - }, - { displayName: 'Hello' }, -); - -const Page = observer( - (props) => { - return
{props.children}
; - }, - { displayName: 'Page' }, -); - -export default () => { - return ( - - - - ); -}; -``` - -部分更新。 - -```tsx -import React from 'react'; -import { - SchemaComponentProvider, - SchemaComponent, - useDesignable, -} from '@nocobase/client'; -import { observer, Schema, useField, useFieldSchema } from '@formily/react'; -import { FormItem } from '@formily/antd-v5'; -import { Button } from 'antd'; -import { uid } from '@formily/shared'; - -const Hello = observer( - (props) => { - const fieldSchema = useFieldSchema(); - const field = useField(); - const { dn } = useDesignable(); - return ( -
-

{field.title}

- { JSON.stringify(props) } -
- { JSON.stringify(field.componentProps) } -
- { JSON.stringify(field.decoratorProps) } -
- { JSON.stringify(fieldSchema.toJSON()) } -
- - -
- ); - }, - { displayName: 'Hello' }, -); - -const Page = observer( - (props) => { - return
{props.children}
; - }, - { displayName: 'Page' }, -); - -export default () => { - return ( - - - - ); -}; -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-component.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-component.md deleted file mode 100644 index 9a6aa8310..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-component.md +++ /dev/null @@ -1,212 +0,0 @@ -# SchemaComponent - -## Context - -### SchemaComponentContext - -```tsx | pure -interface SchemaComponentContext { - scope?: any; - components?: SchemaReactComponents; - refresh?: () => void; - reset?: () => void; - designable?: boolean; - setDesignable?: (value: boolean) => void; -} -``` - -Schema 渲染的上下文。 - -- `scope`:Schema 中变量的映射 -- `components`: Schema 中组件的映射 -- `refresh`:触发 React 重新渲染的工具函数 -- `reset`:重置整个 Schema 节点 -- `designable`:是否显示设计器,默认 `false` -- `setDesignable`:用于切换 `designable` 的值 - -## Hooks - -### useSchemaOptionsContext() - -用于获取注册的 `scope` 和 `components`。 - -```tsx | pure -const { scope, components } = useSchemaOptionsContext(); -``` - -## 组件 - -### SchemaComponentProvider - -其是对 `SchemaComponentContext.Provider` 和 [FormProvider ](https://react.formilyjs.org/api/components/form-provider)的封装,并内置在 `Application` 中,并且会将 `app.components` 和 `app.scopes` 传递过去,所以一般情况下 *不需要关注* 此组件。 - -- props - -```tsx | pure -interface SchemaComponentProviderProps { - designable?: boolean; - form?: Form; - scope?: any; - components?: SchemaReactComponents; -} -``` - -- 详细解释 - - `designable`:`SchemaComponentContext` 中 `designable` 的默认值 - - `form`:NocoBase 的 Schema 能力是基于 formily 的 `FormProvider` 提供的,form 是其参数,默认为 `createForm()` - - `scope`:Schema 中所用到的变量,会通过 `SchemaComponentContext` 进行传递 - - `components`:Schema 中所用到的组件,会通过 `SchemaComponentContext` 进行传递 - -### SchemaComponent - -用于渲染 Schema,此组件必须和 `SchemaComponentProvider` 一起使用,因为 `SchemaComponentProvider` 提供了 [FormProvider](https://react.formilyjs.org/api/components/form-provider) 作为渲染 Schema 的根节点。 - -- Props - -```tsx | pure -type SchemaComponentProps = (ISchemaFieldProps | IRecursionFieldProps) & { - memoized?: boolean; - components?: SchemaReactComponents; - scope?: any; -} -``` - -- 详细解释 - - - `memoized`:当为 `true` 时,会对每层的 Schema 使用 `useMemo()` 进行处理 - - `components`:同 `SchemaComponentProvider` 的 `components` - - `scope`: 同 `SchemaComponentProvider` 的 `components` - -## 综合示例 - -结合 `SchemaComponentProvider`、 `useSchemaComponentContext()` 和 `SchemaComponent`。 - -```tsx -/** - * defaultShowCode: true - */ -import { SchemaComponentProvider, useSchemaComponentContext, SchemaComponent, } from '@nocobase/client'; -const Hello = () => { - const { designable, setDesignable } = useSchemaComponentContext(); - return
-
hello world
- -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', -} - -const Demo = () => { - return -} - -const Root = () => { - return - - -} - -export default Root; -``` - -使用 `new Application()` 的方式,其内置了 `SchemaComponentProvider` ,我们可以如下操作: - -```tsx -/** - * defaultShowCode: true - */ -import { Application, Plugin, useSchemaComponentContext, SchemaComponent } from '@nocobase/client'; -const Hello = () => { - const { designable, setDesignable } = useSchemaComponentContext(); - return
-
hello world
- -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', -} - -const HomePage = () => { - return -} - -class MyPlugin extends Plugin { - async load() { - this.app.addComponents({ Hello }); - this.app.router.add('home', { - path: '/', - Component: HomePage, - }) - } -} - -const app = new Application({ - router: { - type: 'memory', - initialEntries: ['/'], - }, - plugins: [MyPlugin], -}) - -export default app.getRootComponent(); -``` - -### SchemaComponentOptions - -在应用中,会有很多层级的嵌套,每一层都可能提供自己的组件和 scope,此组件就是为了层层传递 Schema 所需的 `components` 和 `scope` 的。 - -- props - -```tsx | pure -interface SchemaComponentOptionsProps { - scope?: any; - components?: SchemaReactComponents; -} -``` - -- 示例 - -```tsx -/** - * defaultShowCode: true - */ -import { SchemaComponentProvider, useSchemaComponentContext, SchemaComponent, SchemaComponentOptions } from '@nocobase/client'; -const World = () => { - return
world
-} - -const Hello = ({ children }) => { - return
-
hello
- { children } -
; -} - -const schema = { - type: 'void', - name: 'hello', - 'x-component': 'Hello', - properties: { - world: { - type: 'void', - 'x-component': 'World', - }, - }, -} - -const Root = () => { - return - - -} - -export default Root; -``` diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer-manager.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer-manager.md deleted file mode 100644 index 483f9d2b6..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer-manager.md +++ /dev/null @@ -1,186 +0,0 @@ -# SchemaInitializerManager - -## 实例方法 - -### schemaInitializerManager.add() - -添加 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - add(...schemaInitializerList: SchemaInitializer[]): void -} -``` - -- 示例 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add block', - items: [ - { - name: 'demo', - type: 'item', - title: 'Demo' - } - ], -}); - -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.add(myInitializer); - } -} -``` - -### schemaInitializerManager.get() - -获取一个 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - get(name: string): SchemaInitializer | undefined -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - } -} -``` - -### schemaInitializerManager.getAll() - -获取所有的 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - getAll(): Record> -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const list = this.app.schemaInitializerManager.getAll(); - } -} -``` - -### app.schemaInitializerManager.has() - -判断是否有存在某个 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - has(name: string): boolean -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasMyInitializer = this.app.schemaInitializerManager.has('MyInitializer'); - } -} -``` - -### schemaInitializerManager.remove() - -移除 SchemaInitializer 实例。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - remove(name: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.schemaInitializerManager.remove('MyInitializer'); - } -} -``` - -### schemaInitializerManager.addItem() - -添加 SchemaInitializer 实例的 Item 项,其和直接 schemaInitializer.add() 方法的区别是,可以确保在实例存在时才会添加。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - addItem(schemaInitializerName: string, itemName: string, data: Omit): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再添加子项,需要确保已注册 - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - if (myInitializer) { - myInitializer.add('b', { type: 'item', title: 'B' }) - } - - // 方式2:通过 addItem,内部确保在 MyInitializer 注册时才会添加 - this.app.schemaInitializerManager.addItem('MyInitializer', 'b', { - type: 'item', - title: 'B' - }) - } -} -``` - -### schemaInitializerManager.removeItem() - -移除 实例的 Item 项,其和直接 schemaInitializer.remove() 方法的区别是,可以确保在实例存在时才会移除。 - -- 类型 - -```tsx | pure -class SchemaInitializerManager { - removeItem(schemaInitializerName: string, itemName: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再删除子项,需要确保已注册 - const myInitializer = this.app.schemaInitializerManager.get('MyInitializer'); - if (myInitializer) { - myInitializer.remove('a') - } - - // 方式2:通过 addItem,内部确保在 MyInitializer 注册时才会移除 - this.app.schemaInitializerManager.remove('MyInitializer', 'a') - } -} -``` diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer.md deleted file mode 100644 index 2637b0a80..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-initializer.md +++ /dev/null @@ -1,704 +0,0 @@ -# SchemaInitializer - -## new SchemaInitializer(options) - -```tsx | pure -interface SchemaInitializerOptions { - Component?: ComponentType; - componentProps?: P1; - style?: React.CSSProperties; - title?: string; - icon?: ReactNode; - - items?: SchemaInitializerItemType[]; - ItemsComponent?: ComponentType; - itemsComponentProps?: P2; - itemsComponentStyle?: React.CSSProperties; - - insertPosition?: 'beforeBegin' | 'afterBegin' | 'beforeEnd' | 'afterEnd'; - designable?: boolean; - wrap?: (s: ISchema) => ISchema; - onSuccess?: (data: any) => void; - insert?: InsertType; - useInsert?: () => InsertType; - - popover?: boolean; - popoverProps?: PopoverProps; -} - -class SchemaInitializer { - constructor(options: SchemaInitializerOptions & { name: string }): SchemaInitializer; - add(name: string, item: Omit): void - get(nestedName: string): SchemaInitializerItemType | undefined - remove(nestedName: string): void -} -``` - -### 详细解释 - -![](../static/KTUWb69kioUg8bxYTAMc2ReDnRg.png) - -- name:唯一标识,必填 -- Component 相关 - - - Component:触发组件,默认是 `Button` 组件 - - componentProps: 组件属性,默认是 `ButtonProps` - - title: 按钮的文本 - - icon:按钮的 icon 属性 - - style:组件的样式 -- Items 相关 - - - items:列表项配置 - - ItemsComponent:默认是渲染成一个列表的形式,可通过此参数自定义 items - - itemsComponentProps:`ItemsComponent` 的属性 - - itemsComponentStyle:`ItemsComponent` 的样式 -- popover 组件相关 - - - popover:是否使用 popover,默认为 `true` - - popoverProps:popover 的属性 -- Schema 操作相关 - - - insertPosition:插入位置,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - designable:是否显示设计模式,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - wrap:对 Schema 的二次处理,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - onSuccess:Schema 更新到服务端后的回调,参考:[useDesignable()](/core/ui-schema/designable#usedesignable) - - insert:自定义 Schema 插入逻辑,默认为 [useDesignable()](/core/ui-schema/designable#usedesignable) 的 `insertAdjacent` - - useInsert:当自定义插入 Schema 的逻辑需要用到 Hooks 时,可以使用此参数 - -### 示例 - -#### 基础用法 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add Block', - // 插入位置 - insertPosition: 'beforeEnd', - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - }, - ], -}); -``` - - - - -#### 定制化 `Component` - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - Component: (props) => ( - - C - - ), - componentProps: { - size: 'large', - }, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - } - ], -}); -``` - - - -#### 不使用 Popover - -关于 `useDesignable()` 的说明请参考 [useDesignable](/core/ui-schema/designable#usedesignable)。 - -```tsx | pure -const schema = { - type: 'void', - title: Math.random(), - 'x-component': 'Hello', -}; -const MyInitializerComponent = () => { - const { insertBeforeEnd } = useDesignable(); - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Add block', - popover: false, - Component: MyInitializerComponent, -}); -``` - - - - -#### 定制化 Items - -```tsx | pure -const CustomListGridMenu: FC>> = (props) => { - const { items, options, ...others } = props; - return ( - ( - - - - )} - > - ); -}; - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - ItemsComponent: CustomListGridMenu, - items: [ - { - name: 'a', - title: 'Item A', - Component: Demo, - } - ], -}); -``` - - - -## options.items 配置详解 - -### 类型 - -```tsx | pure -interface SchemaInitializerComponentCommonProps { - title?: string; - schema?: ISchema; - style?: React.CSSProperties; - className?: string; -} - -interface SchemaInitializerItemBaseType extends SchemaInitializerComponentCommonProps { - name: string; - sort?: number; - type?: string; - Component?: string | ComponentType; - componentProps?: Omit; - useComponentProps?: () => Omit; - useVisible?: () => boolean; - children?: SchemaInitializerItemType[]; - useChildren?: () => SchemaInitializerItemType[]; - [index: string]: any; -} -``` - -### 两种定义方式:`Component` 和 `type` - - -- 通过 `Component` 定义 - -```tsx | pure - -const Demo = () => { - // 最终渲染 `SchemaInitializerItem` - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - } - ], -}); -``` - -- 通过 `type` 定义 - -NocoBase 内置了一些常用的 `type`,例如 `type: 'item'`,相当于 `Component: SchemaInitializerItem`。 - -更多内置类型,请参考:[内置组件和类型](/core/ui-schema/schema-initializer#%E5%86%85%E7%BD%AE%E7%BB%84%E4%BB%B6%E5%92%8C%E7%B1%BB%E5%9E%8B) - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - items: [ - { - name: 'a', - type: 'item', - title: 'Demo' - } - ], -}); -``` - - - -### `children` 和动态方式 `useChildren` - -对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。 - - - -### 动态显示隐藏 `useVisible` - - - -### 组件属性 `componentProps` 和动态属性 `useComponentProps` - -对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。 - -当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。 - - - -### 公共属性和组件属性 - -```tsx | pure -{ - name: 'demo', - title: 'Demo', - foo: 'bar', - Component: Demo, - componentProps: { - zzz: 'xxx', - }, -} -``` - -从上面的示例中我么看到,从配置项中获取组件组件所需的数据有两个方式: - -- 组件属性:通过 `componentProps` 来定义,例如 `zzz: 'xxx'` -- 公共属性:将属性直接定义在配置项上,例如 `foo: 'bar'`、`name`、`title` - -在获取上 - -- `componentProps` 定义的数据会被传递给组件的 `props` -- 直接定义在配置项上的数据会则需要通过 [useSchemaInitializerItem()](/core/ui-schema/schema-initializer#useschemainitializeritem) 获取 - -```tsx | pure -const Demo = (props) => { - console.log(props); // { zzz: 'xxx' } - const { foo } = useSchemaInitializerItem(); // { foo: 'bar' } -} -``` - -## 实例方法 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - } - ], - }, - ], -}); -``` - -```tsx -import { SchemaInitializer, Application, useSchemaInitializerRender } from '@nocobase/client'; -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - type: 'item', - } - ], - }, - ], -}); - -const Root = () => { - const { render } = useSchemaInitializerRender('MyInitializer'); - return render(); -} -const app = new Application({ - schemaInitializers: [myInitializer], - providers: [Root], - designable: true, -}); - -export default app.getRootComponent(); -``` - -### schemaInitializer.add() - -用于新增 Item,另一种添加方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanageradditem); - -- 类型 - -```tsx | pure -class SchemaInitializer { - add(name: string, item: Omit): void -} -``` - -- 参数说明 - -第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。 - -- 示例 - -```tsx | pure -myInitializer.add('b', { - type: 'item', - title: 'item b', -}) - -myInitializer.add('a.a2', { - type: 'item', - title: 'item a2', -}) -``` - -```tsx -import { SchemaInitializer, Application, useSchemaInitializerRender } from '@nocobase/client'; -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'item a', - type: 'itemGroup', - children: [ - { - name: 'a1', - title: 'item a1', - type: 'item', - } - ], - }, - ], -}); - -myInitializer.add('b', { - type: 'item', - title: 'item b', -}) - -myInitializer.add('a.a2', { - type: 'item', - title: 'item a2', -}) - -const Root = () => { - const { render } = useSchemaInitializerRender('MyInitializer'); - return render(); -} -const app = new Application({ - schemaInitializers: [myInitializer], - providers: [Root], - designable: true, -}); - - -export default app.getRootComponent(); -``` - - -### schemaInitializer.get() - -- 类型 - -```tsx | pure -class SchemaInitializer { - get(nestedName: string): SchemaInitializerItemType | undefined -} -``` - -- 示例 - -```tsx | pure -const itemA = myInitializer.get('a') - -const itemA1 = myInitializer.add('a.a1') -``` - -### schemaInitializer.remove() - -另一种移除方式参考 [schemaInitializerManager.addItem()](/core/ui-schema/schema-initializer-manager#schemainitializermanagerremoveitem); - -- 类型 - -```tsx | pure -class SchemaInitializer { - remove(nestedName: string): void -} -``` - -- 示例 - -```tsx | pure -myInitializer.remove('a.a1') - -myInitializer.remove('a') -``` - -## Hooks - -### useSchemaInitializer() - -用于获取 `SchemaInitializer` 上下文内容。 - -- 类型 - -```tsx | pure -export type InsertType = (s: ISchema) => void; - -const useSchemaInitializer: () => { - insert: InsertType; - options: SchemaInitializerOptions; - visible?: boolean; - setVisible?: (v: boolean) => void; -} -``` - -- 参数详解 - - `insert`:参数是 Schema 对象,用于插入 Schema - - `options`:获取 `new SchemaInitializer(options)` 时 options 配置 - - `visible`:popover 是否显示 - - `setVisible`:设置 popover 显示状态 - -- 示例 - -```tsx | pure -const schema = { - type: 'void', - 'x-component': 'Hello', -} -const Demo = () => { - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert(schema); - }; - return ; -} -``` - -### useSchemaInitializerRender() - -用于渲染 `SchemaInitializer`。 - -- 类型 - -```tsx | pure -function useSchemaInitializerRender(name: string, options?: SchemaInitializerOptions): { - exists: boolean; - render: (props?: SchemaInitializerOptions) => React.FunctionComponentElement; -} -``` - -- 参数详解 - -返回的 `render` 方法可以接收一个参数,用于覆盖 `new SchemaInitializer(options)` 的 `options` 配置。 - -- 示例 - -```tsx | pure -const Demo = () => { - const filedSchema = useFieldSchema(); - const { render } = useSchemaInitializerRender(fieldSchema['x-initializer'], fieldSchema['x-initializer-props']); - return
-
{ render() }
-
可以进行参数的二次覆盖:{ render({ style: { color: 'red' } }) }
-
-} -``` - - - -### useSchemaInitializerItem() - -用于获取配置项内容的,配置项是指的 `SchemaInitializer` 中的 `items` 中的一项。 - -- 类型 - -```tsx | pure -const useSchemaInitializerItem: () => T -``` - -- 示例 - -```tsx | pure -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'a', - title: 'Item A', - foo: 'bar', - Component: Demo, - }, - ], -}); - -/** - * 通过 useSchemaInitializerItem() 获取到的是 - * { - * name: 'a', - * title: 'Item A', - * foo: 'bar', - * Component: Demo, - * } - */ -const Demo = () => { - const { title, foo } = useSchemaInitializerItem(); - return
{ title } - { foo }
-} -``` - - - -## 内置组件和类型 - -| type | Component | 效果 | -| ----------- | ------------------------------ | ----------------------------------------- | -| item | SchemaInitializerItem | 文本| -| itemGroup | SchemaInitializerItemGroup | 分组,同 antd `Menu` 组件的 `type: 'group'` | -| subMenu | SchemaInitializerSubMenu | 子菜单,同 antd `Menu` 组件的子菜单 | -| divider | SchemaInitializerDivider | 分割线,同 antd `Menu` 组件的 `type: 'divider'` | -| switch | SchemaInitializerSwitch | 开关 | -| actionModal | SchemaInitializerActionModal | 弹窗| - -以下每个示例都提供了 2 种[定义方式](/core/ui-schema/schema-initializer#两种定义方式component-和-type),一种是通过 `Component` 定义,另一种是通过 `type` 定义。 - -### `type: 'item'` & `SchemaInitializerItem` - -文本项。 - -```tsx | pure -interface SchemaInitializerItemProps { - style?: React.CSSProperties; - className?: string; - name?: string; - icon?: React.ReactNode; - title?: React.ReactNode; - items?: SchemaInitializerItemType[]; - onClick?: (args?: any) => any; -} -``` - -核心参数是 `title`、`icon`、`onClick`、`items`,其中 `onClick` 用于插入 Schema,`items` 用于渲染子列表项。 - - - -### `type: 'itemGroup'` & SchemaInitializerItemGroup - -分组。 - -```tsx | pure -interface SchemaInitializerItemGroupProps { - name: string; - title: string; - children?: SchemaInitializerOptions['items']; - divider?: boolean; -} -``` - -核心参数是 `title`、`children`,其中 `children` 用于渲染子列表项,`divider` 用于渲染分割线。 - - - -### `type: 'switch'` & SchemaInitializerSwitch - -Switch 切换按钮。 - -```tsx | pure -interface SchemaInitializerSwitchItemProps extends SchemaInitializerItemProps { - checked?: boolean; - disabled?: boolean; -} -``` - -核心参数是 `checked`、`onClick`,其中 `onClick` 用于插入或者移除 Schema。 - - - -### `type: 'subMenu'` & SchemaInitializerSubMenu - -子菜单。 - - - -### `type: 'divider'` & SchemaInitializerDivider - -分割线。 - - - -## 渲染组件 - -### SchemaInitializerChildren - -用于自定义渲染多个列表项。 - -```tsx | pure - -const Demo = ({ children }) => { - // children: [{ name: 'a1', Component: ItemA1 }, { name: 'a2', type: 'item', title: 'ItemA2' }] - return { children } -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - items: [ - { - name: 'test', - Component: Demo, - children: [ - { - name: 'a1', - Component: ItemA1, - }, - { - name: 'a2', - type: 'item', - title: 'ItemA2', - } - ] - } - ], -}); -``` - -### SchemaInitializerChild - -用于自定义渲染单个列表项。 - -```tsx | pure -const Demo = (props) => { - return -} -``` diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings-manager.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings-manager.md deleted file mode 100644 index e4f43a33d..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings-manager.md +++ /dev/null @@ -1,188 +0,0 @@ -# SchemaSettingsManager - -## 实例方法 - -### schemaSettingsManager.add() - -添加 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - add(...schemaSettingList: SchemaSetting[]): void -} -``` - -- 示例 - -```tsx | pure -const mySchemaSettings = new SchemaSetting({ - name: 'MySchemaSettings', - title: 'Add block', - items: [ - { - name: 'demo', - type: 'item', - componentProps:{ - title: 'Demo' - } - } - ], -}); - -class MyPlugin extends Plugin { - async load() { - this.app.schemaSettingsManager.add(mySchemaSettings); - } -} -``` - -### schemaSettingsManager.get() - -获取一个 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - get(name: string): SchemaSetting | undefined -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.getAll() - -获取所有的 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - getAll(): Record> -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const list = this.app.schemaSettingsManager.getAll(); - } -} -``` - -### app.schemaSettingsManager.has() - -判断是否有存在某个 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - has(name: string): boolean -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - const hasMySchemaSettings = this.app.schemaSettingsManager.has('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.remove() - -移除 SchemaSettings 实例。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - remove(name: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - this.app.schemaSettingsManager.remove('MySchemaSettings'); - } -} -``` - -### schemaSettingsManager.addItem() - -添加 SchemaSettings 实例的 Item 项,其和直接 schemaInitializer.add() 方法的区别是,可以确保在实例存在时才会添加。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - addItem(schemaInitializerName: string, itemName: string, data: Omit): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再添加子项,需要确保已注册 - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - if (mySchemaSettings) { - mySchemaSettings.add('b', { type: 'item', componentProps:{ title: 'B' } }) - } - - // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会添加 - this.app.schemaSettingsManager.addItem('MySchemaSettings', 'b', { - type: 'item', - componentProps:{ title: 'B' } - }) - } -} -``` - -### schemaSettingsManager.removeItem() - -移除 实例的 Item 项,其和直接 schemaInitializer.remove() 方法的区别是,可以确保在实例存在时才会移除。 - -- 类型 - -```tsx | pure -class SchemaSettingsManager { - removeItem(schemaInitializerName: string, itemName: string): void -} -``` - -- 示例 - -```tsx | pure -class MyPlugin extends Plugin { - async load() { - // 方式1:先获取,再删除子项,需要确保已注册 - const mySchemaSettings = this.app.schemaSettingsManager.get('MySchemaSettings'); - if (mySchemaSettings) { - mySchemaSettings.remove('a') - } - - // 方式2:通过 addItem,内部确保在 mySchemaSettings 注册时才会移除 - this.app.schemaSettingsManager.remove('MySchemaSettings', 'a') - } -} -``` diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings.md deleted file mode 100644 index b374cbdfa..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-settings.md +++ /dev/null @@ -1,467 +0,0 @@ -# SchemaSettings - -## new SchemaSettings(options) - -创建一个 SchemaSettings 实例。 - -```tsx | pure -interface SchemaSettingsOptions { - name: string; - Component?: ComponentType; - componentProps?: T; - style?: React.CSSProperties; - - items: SchemaSettingsItemType[]; -} - -class SchemaSettings{ - constructor(options: SchemaSettingsOptions): SchemaSettings; - add(name: string, item: Omit): void - get(nestedName: string): SchemaSettingsItemType | undefined - remove(nestedName: string): void -} -``` - -### 详细解释 - -![](../static/VfPGbhWo9os0qTxcITkcHNfin4g.png) - -- name:唯一标识,必填 -- Component 相关 - - - Component:触发组件,默认是 `` 组件 - - componentProps: 组件属性 - - style:组件的样式 -- items:列表项配置 - -### 示例 - -#### 基础用法 - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - items: [ - { - name: 'demo1', // 唯一标识 - type: 'item', // 内置类型 - componentProps: { - title: 'DEMO1', - onClick() { - alert('DEMO1'); - }, - }, - }, - { - name: 'demo2', - Component: () => alert('DEMO2')} />, // 直接使用 Component 组件 - }, - ], -}); -``` - -#### 定制化 `Component` - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - Component: Button, // 自定义组件 - componentProps: { - type: 'primary', - children: '自定义按钮', - }, - // Component: (props) => , // 等同于上面效果 - items: [ - { - name: 'demo1', - type: 'item', - componentProps: { - title: 'DEMO', - }, - }, - ], -}); -``` - -## options.items 配置详解 - -```tsx | pure -interface SchemaSettingsItemCommon { - name: string; - sort?: number; - type?: string; - Component: string | ComponentType; - useVisible?: () => boolean; - children?: SchemaSettingsItemType[]; - useChildren?: () => SchemaSettingsItemType[]; - checkChildrenLength?: boolean; - componentProps?: Omit; - useComponentProps?: () => Omit; -} -``` - -### 两种定义方式:`Component` 和 `type` - - -- 通过 `Component` 定义 - -```tsx | pure - -const Demo = () => { - // 最终渲染 `SchemaSettingsItem` - return -} - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - Component: Demo, // 通过 Component 定义 - } - ], -}); -``` - -- 通过 `type` 定义 - -NocoBase 内置了一些常用的 `type`,例如 `type: 'item'`,相当于 `Component: SchemaSettingsItem`。 - -更多内置类型,请参考:[内置组件和类型](/core/ui-schema/schema-settings#%E5%86%85%E7%BD%AE%E7%BB%84%E4%BB%B6%E5%92%8C%E7%B1%BB%E5%9E%8B) - -```tsx | pure -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'a', - type: 'item', - componentProps: { - title: 'Demo', - }, - } - ], -}); -``` - - - -### `children` 和动态方式 `useChildren` - -对于某些组件而言是有子列表项的,例如 `type: 'itemGroup'`,那么我们使用 children 属性,同时考虑到某些场景下 children 是动态的,需要从 Hooks 里面获取,那么就可以通过 `useChildren` 来定义。 - - - -### 动态显示隐藏 `useVisible` - - - -### 组件属性 `componentProps` 和动态属性 `useComponentProps` - -对于一些通用组件,我们可以通过 `componentProps` 来定义组件属性,同时考虑到某些场景下组件属性是动态的,需要从 Hooks 里面获取,那么就可以通过 `useComponentProps` 来定义。 - -当然也可以不使用这两个属性,直接封装成一个组件,然后通过 `Component` 来定义。 - - - -## 实例方法 - -```tsx | pure -const mySchemaSettings = new SchemaSettings({ - name: 'MySchemaSettings', - items: [ - { - name: 'a', - type: 'itemGroup', - componentProps: { - title: 'item a' - }, - children: [ - { - name: 'a1', - title: 'item a1', - } - ], - }, - ], -}); -``` - -### schemaSettings.add() - -用于新增 Item。 - -- 类型 - -```tsx | pure -class SchemaSettings { - add(name: string, item: Omit): void -} -``` - -- 参数说明 - -第一个参数是 name,作为唯一标识,用于增删改查,并且 `name` 支持 `.` 用于分割层级。 - -- 示例 - -```tsx | pure -mySchemaSetting.add('b', { - type: 'item', - title: 'item b', -}) - -mySchemaSetting.add('a.a2', { - type: 'item', - title: 'item a2', -}) -``` - -### schemaSettings.get() - -- 类型 - -```tsx | pure -class SchemaSettings { - get(nestedName: string): SchemaSettingsItemType| undefined -} -``` - -- 示例 - -```tsx | pure -const itemA = mySchemaSetting.get('a') - -const itemA1 = mySchemaSetting.add('a.a1') -``` - -### schemaSettings.remove() - -- 类型 - -```tsx | pure -class SchemaSettings { - remove(nestedName: string): void -} -``` - -- 示例 - -```tsx | pure -mySchemaSetting.remove('a.a1') - -mySchemaSetting.remove('a') -``` - -## Hooks - -### useSchemaSettingsRender() - -用于渲染 SchemaSettings。 - -- 类型 - -```tsx | pure -function useSchemaSettingsRender(name: string, options?: SchemaSettingsOptions): { - exists: boolean; - render: (options?: SchemaSettingsRenderOptions) => React.ReactElement; -} -``` - -- 示例 - -```tsx | pure -const Demo = () => { - const filedSchema = useFieldSchema(); - const { render, exists } = useSchemaSettingsRender(fieldSchema['x-settings'], fieldSchema['x-settings-props']) - return
-
{ render() }
-
可以进行参数的二次覆盖:{ render({ style: { color: 'red' } }) }
-
-} -``` - - - -### useSchemaSettings() - -获取 schemaSetting 上下文数据。 - -上下文数据包含了 `schemaSetting` 实例化时的 `options` 以及调用 `useSchemaSettingsRender()` 时传入的 `options`。 - -- 类型 - -```tsx | pure -interface UseSchemaSettingsResult extends SchemaSettingsOptions { - dn?: Designable; - field?: GeneralField; - fieldSchema?: Schema; -} - -function useSchemaSettings(): UseSchemaSettingsResult; -``` - -- 示例 - -```tsx | pure -const { dn } = useSchemaSettings(); -``` - -### useSchemaSettingsItem() - -用于获取一个 item 的数据。 - -- 类型 - -```tsx | pure -export type SchemaSettingsItemType = { - name: string; - type?: string; - sort?: number; - Component?: string | ComponentType; - componentProps?: T; - useComponentProps?: () => T; - useVisible?: () => boolean; - children?: SchemaSettingsItemType[]; - [index]: any; -}; - -function useSchemaSettingsItem(): SchemaSettingsItemType; -``` - -- 示例 - -```tsx | pure -const { name } = useSchemaSettingsItem(); -``` - -## 内置组件和类型 - -| type | Component | 效果 | -| ----------- | ------------------------------ | ----------------------------------------- | -| item | SchemaSettingsItem | 文本 | -| itemGroup | SchemaSettingsItemGroup | 分组,同 Menu 组件的 `type: 'itemGroup'` | -| subMenu | SchemaSettingsSubMenu | 子菜单,同 Menu 组件的子菜单 | -| divider | SchemaSettingsDivider | 分割线,同 Menu 组件的 `type: 'divider'` | -| remove | SchemaSettingsRemove | 删除,用于删除一个区块 | -| select | SchemaSettingsSelectItem | 下拉选择 | -| cascader | SchemaSettingsCascaderItem | 级联选择 | -| switch | SchemaSettingsSwitchItem | 开关 | -| popup | SchemaSettingsPopupItem | 弹出层 | -| actionModal | SchemaSettingsActionModalItem | 操作弹窗 | -| modal | SchemaSettingsModalItem | 弹窗 | - -### SchemaSettingsItem - -文本,对应的 `type` 为 `item`。 - -```tsx | pure -interface SchemaSettingsItemProps extends Omit { - title: string; -} -``` - -核心参数为 `title` 和 `onClick`,可以在 `onClick` 中修改 schema。 - - - -### SchemaSettingsItemGroup - -分组,对应的 `type` 为 `itemGroup`。 - -核心参数是 `title`。 - - - -### SchemaSettingsSubMenu - -子菜单,对应的 `type` 为 `subMenu`。 - -核心参数是 `title`。 - - - -### SchemaSettingsDivider - -分割线,对应的 `type` 为 `divider`。 - - - -### SchemaSettingsRemove - -删除,对应的 `type` 为 `remove`。 - -```tsx | pure -interface SchemaSettingsRemoveProps { - confirm?: ModalFuncProps; - removeParentsIfNoChildren?: boolean; - breakRemoveOn?: ISchema | ((s: ISchema) => boolean); -} -``` - -- `confirm`:删除前的确认弹窗 -- `removeParentsIfNoChildren`:如果删除后没有子节点了,是否删除父节点 -- `breakRemoveOn`:如果删除的节点满足条件,是否中断删除 - - - -### SchemaSettingsSelectItem - -选择器,对应的 `type` 为 `select`。 - - - -### SchemaSettingsCascaderItem - -级联选择,对应的 `type` 为 `cascader`。 - -### SchemaSettingsSwitchItem - -开关,对应的 `type` 为 `switch`。 - - - -### SchemaSettingsModalItem - -弹窗,对应的 `type` 为 `modal`。 - -```tsx | pure -export interface SchemaSettingsModalItemProps { - title: string; - onSubmit: (values: any) => void; - initialValues?: any; - schema?: ISchema | (() => ISchema); - modalTip?: string; - components?: any; - hidden?: boolean; - scope?: any; - effects?: any; - width?: string | number; - children?: ReactNode; - asyncGetInitialValues?: () => Promise; - eventKey?: string; - hide?: boolean; -} -``` - -我们可以通过 `schema` 参数来定义弹窗的表单,然后在 `onSubmit` 中获取表单的值,然后修改当前 schema 节点。 - - - -### SchemaSettingsActionModalItem - -操作弹窗,对应的 `type` 为 `actionModal`。 - -其和 `modal` 的区别是,`SchemaSettingsModalItem` 弹窗会丢失上下文,而 `SchemaSettingsActionModalItem` 会保留上下文,简单场景下可以使用 `SchemaSettingsModalItem`,复杂场景下可以使用 `SchemaSettingsActionModalItem`。 - -```tsx | pure -export interface SchemaSettingsActionModalItemProps extends SchemaSettingsModalItemProps, Omit { - uid?: string; - initialSchema?: ISchema; - schema?: ISchema; - beforeOpen?: () => void; - maskClosable?: boolean; -} -``` - - diff --git a/packages/core/client/docs/zh-CN/core/ui-schema/schema-toolbar.md b/packages/core/client/docs/zh-CN/core/ui-schema/schema-toolbar.md deleted file mode 100644 index dfd809bba..000000000 --- a/packages/core/client/docs/zh-CN/core/ui-schema/schema-toolbar.md +++ /dev/null @@ -1,427 +0,0 @@ -# SchemaToolbar - -![SchemaToolbar](../static/designer.png) - -## 组件 - -### SchemaToolbar 组件 - -此为默认的 Toolbar 组件,其内部会自动根据 Schema 的 `x-settings`、`x-initializer` 渲染 `SchemaSettings`、`SchemaInitializer` 和 `Drag` 组件。 - -Toolbar 具体的渲染规则为:当有 `x-toolbar` 会渲染对应的组件;当无 `x-toolbar` 但是有 `x-settings`、`x-initializer` 会渲染默认的 `SchemaToolbar` 组件。 - -- 类型 - -```tsx | pure -interface SchemaToolbarProps { - title?: string; - draggable?: boolean; - initializer?: string | false; - settings?: string | false; - /** - * @default true - */ - showBorder?: boolean; - showBackground?: boolean; -} -``` - -- 详细解释 - - `title`:左上角的标题 - - `draggable`:是否可以拖拽,默认为 `true` - - `initializer`:`SchemaInitializer` 的默认值,当 schema 里没有 `x-initializer` 时,会使用此值;当为 `false` 时,不会渲染 `SchemaInitializer` - - `settings`:`SchemaSettings` 的默认值,当 schema 里没有 `x-settings` 时,会使用此值;当为 `false` 时,不会渲染 `SchemaSettings` - - `showBorder`:边框是否变为橘色 - - `showBackground`:背景是否变为橘色 - -- 示例 - -未指定 `x-toolbar` 时会渲染默认的 `SchemaToolbar` 这个组件。 - -```tsx -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - useSchemaInitializer, - useSchemaInitializerItem, -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 仅指定了 `x-settings` 但是没有 `x-toolbar`,会使用默认的 `SchemaToolbar` 组件 - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` - -自定义 Toolbar 组件。 - - -```tsx -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - SchemaToolbar, - useSchemaInitializer, - useSchemaInitializerItem, -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const MyToolbar = () => { - return -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'CardItem', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello, MyToolbar }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` - -## Hooks - -### useSchemaToolbarRender() - -用于渲染 `SchemaToolbar`。 - -- 类型 - -```tsx | pure -const useSchemaToolbarRender: (fieldSchema: ISchema) => { - render(props?: SchemaToolbarProps): React.JSX.Element; - exists: boolean; -} -``` - -- 详细解释 - -前面示例中 `'x-decorator': 'CardItem'` 中组件 `CardItem` 里面就调用了 `useSchemaToolbarRender()` 进行渲染。内置的组件还有:`BlockItem`、`CardItem`、`Action`、`FormItem`。 - -`render()` 支持二次覆盖组件属性。 - -- 示例 - -```tsx | pure -const MyDecorator = () => { - const filedSchema = useFieldSchema(); - const { render } = useSchemaToolbarRender(filedSchema); // 从 Schema 中读取 Toolbar 组件 - - return { render() } -} -``` - - -```tsx -import { Card } from 'antd'; -import { useFieldSchema } from '@formily/react'; -import { - Application, - CardItem, - Grid, - Plugin, - SchemaComponent, - SchemaInitializer, - SchemaInitializerItem, - SchemaSettings, - SchemaToolbar, - useSchemaInitializer, - useSchemaInitializerItem, - useSchemaToolbarRender -} from '@nocobase/client'; -import React from 'react'; - -const mySettings = new SchemaSettings({ - name: 'mySettings', - items: [ - { - name: 'remove', - type: 'remove', - componentProps: { - removeParentsIfNoChildren: true, - }, - }, - ], -}); - -const MyToolbar = (props) => { - return -} - -// 自定义包装器 -const MyDecorator = ({children}) => { - const filedSchema = useFieldSchema(); - // 使用 `useSchemaToolbarRender()` 获取并渲染内容 - const { render } = useSchemaToolbarRender(filedSchema); - return { render({ draggable: false }) }{children} -} - -const myInitializer = new SchemaInitializer({ - name: 'MyInitializer', - title: 'Button Text', - wrap: Grid.wrap, - items: [ - { - name: 'demo1', - title: 'Demo1', - Component: () => { - const itemConfig = useSchemaInitializerItem(); - // 调用插入功能 - const { insert } = useSchemaInitializer(); - const handleClick = () => { - insert({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'MyDecorator', - 'x-component': 'Hello', - }); - }; - return ; - }, - }, - ], -}); - -const Hello = () => { - const schema = useFieldSchema(); - return

Hello, world! {schema.name}

; -}; - -const hello1 = Grid.wrap({ - type: 'void', - // 使用自定义的 Toolbar 组件 - 'x-toolbar': 'MyToolbar', - 'x-settings': 'mySettings', - 'x-decorator': 'MyDecorator', - 'x-component': 'Hello', -}); - -const HelloPage = () => { - return ( -
- -
- ); -}; - -class PluginHello extends Plugin { - async load() { - this.app.addComponents({ Grid, CardItem, Hello, MyToolbar, MyDecorator }); - this.app.schemaSettingsManager.add(mySettings); - this.app.schemaInitializerManager.add(myInitializer); - this.router.add('hello', { - path: '/', - Component: HelloPage, - }); - } -} - -const app = new Application({ - router: { - type: 'memory', - }, - designable: true, - plugins: [PluginHello], -}); - -export default app.getRootComponent(); -``` diff --git a/packages/core/client/docs/zh-CN/core/utils.md b/packages/core/client/docs/zh-CN/core/utils.md deleted file mode 100644 index 9fb88088e..000000000 --- a/packages/core/client/docs/zh-CN/core/utils.md +++ /dev/null @@ -1,13 +0,0 @@ -# Utils - -## Function - -### tval - -用于输出多语言的字符串。 - -- 类型 - - - -- 示例 diff --git a/packages/core/client/docs/zh-CN/index.md b/packages/core/client/docs/zh-CN/index.md deleted file mode 100644 index fe2d08520..000000000 --- a/packages/core/client/docs/zh-CN/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Index - - diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/add-new.md b/packages/core/client/docs/zh-CN/ui-schema/actions/add-new.md deleted file mode 100644 index 308dab604..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/add-new.md +++ /dev/null @@ -1,82 +0,0 @@ -# Add new - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-action": "create", - "x-acl-action": "create", - "title": "{{t('Add new')}}", - "x-designer": "Action.Designer", - "x-component": "Action", - "x-decorator": "ACLActionProvider", - "x-component-props": { - "openMode": "drawer", - "type": "primary", - "component": "CreateRecordAction", - "icon": "PlusOutlined" - }, - "x-align": "right", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Add record\") }}", - "x-component": "Action.Container", - "x-component-props": { - "className": "nb-action-popup" - }, - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializersForCreateFormBlock", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Add new\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "CreateFormBlockInitializers", - "x-uid": "psh2rj6pkab", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "3i7grk0aytf", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "75s24n1nlkh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "wg1f4xyx7vp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "2hwye7mt2th", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/add-record.md b/packages/core/client/docs/zh-CN/ui-schema/actions/add-record.md deleted file mode 100644 index 7dbce5eda..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/add-record.md +++ /dev/null @@ -1 +0,0 @@ -# Add record(任意表) \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-edit.md b/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-edit.md deleted file mode 100644 index b602f30ff..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-edit.md +++ /dev/null @@ -1 +0,0 @@ -# 批量编辑 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-update.md b/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-update.md deleted file mode 100644 index 9ac6d1890..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/bulk-update.md +++ /dev/null @@ -1 +0,0 @@ -# 批量更新 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/custom-request.md b/packages/core/client/docs/zh-CN/ui-schema/actions/custom-request.md deleted file mode 100644 index b69407f62..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/custom-request.md +++ /dev/null @@ -1,88 +0,0 @@ -# 自定义请求 - - -x-component 不统一,x-action 也不统一,有三种风格的 schema - - -## UI Schema - -### 表单的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "CustomRequestAction", - "x-action": "customize:form:request", - "x-designer": "CustomRequestAction.Designer", - "x-decorator": "CustomRequestAction.Decorator", - "x-action-settings": { - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "type": "void", - "x-uid": "d1rfalvivfo", - "x-async": false, - "x-index": 2 -} -``` - -### 表格列操作的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "Action.Link", - "x-action": "customize:table:request", - "x-designer": "Action.Designer", - "x-action-settings": { - "requestSettings": {}, - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "x-component-props": { - "useProps": "{{ useCustomizeRequestActionProps }}" - }, - "x-designer-props": { - "linkageAction": true - }, - "type": "void", - "x-uid": "edn0y4fq7xb", - "x-async": false, - "x-index": 1 -} -``` - -### 详情的自定义请求 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Custom request\") }}", - "x-component": "CustomRequestAction", - "x-action": "customize:form:request", - "x-designer": "CustomRequestAction.Designer", - "x-decorator": "CustomRequestAction.Decorator", - "x-action-settings": { - "onSuccess": { - "manualClose": false, - "redirecting": false, - "successMessage": "{{t(\"Request success\")}}" - } - }, - "type": "void", - "x-uid": "glc5zkr0ke3", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/delete.md b/packages/core/client/docs/zh-CN/ui-schema/actions/delete.md deleted file mode 100644 index d4f3659f0..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/delete.md +++ /dev/null @@ -1 +0,0 @@ -# 删除 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/duplicate.md b/packages/core/client/docs/zh-CN/ui-schema/actions/duplicate.md deleted file mode 100644 index 5fc15c69d..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/duplicate.md +++ /dev/null @@ -1 +0,0 @@ -# 复制 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/edit.md b/packages/core/client/docs/zh-CN/ui-schema/actions/edit.md deleted file mode 100644 index 3092287aa..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/edit.md +++ /dev/null @@ -1 +0,0 @@ -# 编辑 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/export.md b/packages/core/client/docs/zh-CN/ui-schema/actions/export.md deleted file mode 100644 index 9e6bd4bd6..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/export.md +++ /dev/null @@ -1 +0,0 @@ -# 导出 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/filter.md b/packages/core/client/docs/zh-CN/ui-schema/actions/filter.md deleted file mode 100644 index 653fc6d26..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/filter.md +++ /dev/null @@ -1 +0,0 @@ -# 筛选 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/import.md b/packages/core/client/docs/zh-CN/ui-schema/actions/import.md deleted file mode 100644 index a371bffd3..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/import.md +++ /dev/null @@ -1 +0,0 @@ -# 导入 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/index.md b/packages/core/client/docs/zh-CN/ui-schema/actions/index.md deleted file mode 100644 index e177708c4..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/index.md +++ /dev/null @@ -1,51 +0,0 @@ -# 概览 - -## UI Schema 协议 - -- `x-action` -- `x-align` -- `x-acl-action` -- `x-acl-action-props` -- `x-action-settings` - -## 常规操作 - -```json -{ - "type": "void", - "title": "{{ t(\"Submit\") }}", - "x-component": "Action", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, -} -``` - -## 弹窗操作 - -```json -{ - "type": "void", - "title": "{{t('Open drawer')}}", - "x-component": "Action", - "x-component-props": { - "openMode": "drawer", - "type": "primary", - "icon": "PlusOutlined" - }, - "x-align": "right", - "properties": { - "drawer": { - "type": "void", - "x-component": "Action.Container", - "x-component-props": {}, - "properties": { - }, - } - } -} -``` - -更多示例查看 [Action](/apis/action) \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/print.md b/packages/core/client/docs/zh-CN/ui-schema/actions/print.md deleted file mode 100644 index 2823a7a18..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/print.md +++ /dev/null @@ -1 +0,0 @@ -# 打印 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/refresh.md b/packages/core/client/docs/zh-CN/ui-schema/actions/refresh.md deleted file mode 100644 index 654d97cca..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/refresh.md +++ /dev/null @@ -1 +0,0 @@ -# 刷新 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/save-record.md b/packages/core/client/docs/zh-CN/ui-schema/actions/save-record.md deleted file mode 100644 index 83d1a5a37..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/save-record.md +++ /dev/null @@ -1 +0,0 @@ -# 保存数据 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/submit-to-workflow.md b/packages/core/client/docs/zh-CN/ui-schema/actions/submit-to-workflow.md deleted file mode 100644 index 97bfe3b19..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/submit-to-workflow.md +++ /dev/null @@ -1 +0,0 @@ -# 提交至工作流 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/submit.md b/packages/core/client/docs/zh-CN/ui-schema/actions/submit.md deleted file mode 100644 index 0634eb49d..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/submit.md +++ /dev/null @@ -1,28 +0,0 @@ -# 提交 - -## UI Schema - -### 新建数据的提交 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Submit\") }}", - "x-action": "submit", - "x-component": "Action", - "x-designer": "Action.Designer", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, - "x-action-settings": { - "triggerWorkflows": [] - }, - "type": "void", - "x-uid": "aaxbm1i5xxd", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/update-record.md b/packages/core/client/docs/zh-CN/ui-schema/actions/update-record.md deleted file mode 100644 index aa3ff7ffb..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/update-record.md +++ /dev/null @@ -1 +0,0 @@ -# 更新数据 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/actions/view.md b/packages/core/client/docs/zh-CN/ui-schema/actions/view.md deleted file mode 100644 index f5fd55d6b..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/actions/view.md +++ /dev/null @@ -1 +0,0 @@ -# 查看 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/calendar.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/calendar.md deleted file mode 100644 index 13e6c108e..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/calendar.md +++ /dev/null @@ -1,282 +0,0 @@ -# Calendar - -## x-initializer - -- CalendarActionInitializers -- TabPaneInitializers -- RecordBlockInitializers - -## x-designer - -- CalendarV2.Designer - -## x-settings - -- CalendarSettings - -## UI Schema - -### 日历区块 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "CalendarV2.Designer", - "x-component": "CardItem", - "x-decorator": "CalendarBlockProvider", - "x-acl-action": "users:list", - "x-decorator-props": { - "action": "list", - "params": { - "paginate": false - }, - "resource": "users", - "collection": "users", - "fieldNames": { - "id": "id", - "end": ["f_nxqfedh5fd5"], - "start": ["f_nxqfedh5fd5"], - "title": "nickname" - } - }, - "_isJSONSchemaObject": true, - "properties": { - "puytl7p5x8o": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2", - "x-component-props": { - "useProps": "{{ useCalendarBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "toolBar": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2.ActionBar", - "x-initializer": "CalendarActionInitializers", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "_isJSONSchemaObject": true, - "x-uid": "494h1j6bxyg", - "x-async": false, - "x-index": 1 - }, - "event": { - "type": "void", - "version": "2.0", - "x-component": "CalendarV2.Event", - "_isJSONSchemaObject": true, - "properties": { - "drawer": { - "type": "void", - "title": "{{ t(\"View record\") }}", - "version": "2.0", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "_isJSONSchemaObject": true, - "properties": { - "tabs": { - "type": "void", - "version": "2.0", - "x-component": "Tabs", - "x-initializer": "TabPaneInitializers", - "x-component-props": {}, - "_isJSONSchemaObject": true, - "x-initializer-props": { - "gridInitializer": "RecordBlockInitializers" - }, - "properties": { - "tab1": { - "type": "void", - "title": "{{t(\"Details\")}}", - "version": "2.0", - "x-designer": "Tabs.Designer", - "x-component": "Tabs.TabPane", - "x-component-props": {}, - "_isJSONSchemaObject": true, - "properties": { - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "_isJSONSchemaObject": true, - "x-initializer-props": { - "actionInitializers": "CalendarFormActionInitializers" - }, - "x-uid": "yty9wg20qq0", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "hcsgenoc3hb", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "c5cpptwxw7s", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "c5iarcnpefc", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "080x8qlpn6s", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "pcche4s596p", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "gk2jk3gpo9f", - "x-async": false, - "x-index": 1 -} -``` - -### 关系的日历区块 - -```json -{ - "x-uid": "8q0hsbdr9fc", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:list", - "x-decorator": "CalendarBlockProvider", - "x-decorator-props": { - "collection": "b", - "resource": "a.o2m", - "action": "list", - "fieldNames": { - "id": "id", - "start": "createdAt", - "title": "f_ex4581dfc0t" - }, - "params": { - "paginate": false - }, - "association": "a.o2m" - }, - "x-designer": "CalendarV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系的日历区块" - }, - "properties": { - "v3za6qejuz7": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2", - "x-component-props": { - "useProps": "{{ useCalendarBlockProps }}" - }, - "properties": { - "toolBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2.ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-initializer": "CalendarActionInitializers", - "x-uid": "u9ntffsdsrh", - "x-async": false, - "x-index": 1 - }, - "event": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CalendarV2.Event", - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "x-initializer-props": { - "gridInitializer": "RecordBlockInitializers" - }, - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer-props": { - "actionInitializers": "CalendarFormActionInitializers" - }, - "x-initializer": "RecordBlockInitializers", - "x-uid": "2swhiw4lee5", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "z6odjfbwnht", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mxr7ikhfc9y", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mfgucnj7ev8", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "05l5a2h42pn", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "v2jazzvqa85", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/charts.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/charts.md deleted file mode 100644 index 77dbdbdbb..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/charts.md +++ /dev/null @@ -1,143 +0,0 @@ -# Charts - -## UI Schema - -### 图表区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CardItem", - "x-component-props": { - "name": "charts" - }, - "x-designer": "ChartV2BlockDesigner", - "properties": { - "u8841bjm65y": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-decorator": "ChartV2Block", - "x-initializer": "ChartInitializers", - "x-uid": "j4hzcpzcc3g", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ldc2aokaop2", - "x-async": false, - "x-index": 1 -} -``` - -### 内嵌区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "CardItem", - "x-component-props": { - "name": "charts" - }, - "x-designer": "ChartV2BlockDesigner", - "properties": { - "g3jq3vkx9fv": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-decorator": "ChartV2Block", - "x-initializer": "ChartInitializers", - "properties": { - "ue7lfigjgm1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Row", - "properties": { - "43ztg8gu03v": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Col", - "properties": { - "n47fsb4i2lm": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "ChartRendererProvider", - "x-decorator-props": { - "query": { - "measures": [ - { - "field": ["id"] - } - ], - "dimensions": [], - "filter": { - "$and": [] - }, - "orders": [], - "cache": {} - }, - "config": { - "chartType": "Built-in.line", - "general": { - "xField": "id", - "yField": "id", - "smooth": false, - "isStack": false - } - }, - "collection": "a", - "mode": "builder" - }, - "x-acl-action": "a:list", - "x-designer": "ChartRenderer.Designer", - "x-component": "CardItem", - "x-component-props": { - "size": "small" - }, - "x-initializer": "ChartInitializers", - "properties": { - "y25sgh5pukl": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "ChartRenderer", - "x-component-props": {}, - "x-uid": "ma0s07k753t", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "k6naqcx59ow", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "o8ktlccovml", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mvn9ai9rhx8", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "mcbyby93j6n", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "sn0lczwtkgm", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/details.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/details.md deleted file mode 100644 index 31f765bac..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/details.md +++ /dev/null @@ -1,169 +0,0 @@ -# Details - -## UI Schema - -### 详情区块(带分页) - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "DetailsDesigner", - "x-component": "CardItem", - "x-decorator": "DetailsBlockProvider", - "x-acl-action": "users:view", - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 1 - }, - "rowKey": "id", - "resource": "users", - "collection": "users", - "readPretty": true - }, - "_isJSONSchemaObject": true, - "properties": { - "mjad1dcywip": { - "type": "void", - "version": "2.0", - "x-component": "Details", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useDetailsBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "8avswx6qgyp": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "DetailsActionInitializers", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "_isJSONSchemaObject": true, - "x-uid": "01w17yleng8", - "x-async": false, - "x-index": 1 - }, - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "_isJSONSchemaObject": true, - "x-uid": "bgu0ix4lfmc", - "x-async": false, - "x-index": 2 - }, - "pagination": { - "type": "void", - "version": "2.0", - "x-component": "Pagination", - "x-component-props": { - "useProps": "{{ useDetailsPaginationProps }}" - }, - "_isJSONSchemaObject": true, - "x-uid": "6riuxghrz30", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "3apkfu8ngrp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "yeodhismy2w", - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系区块 - -```json -{ - "x-uid": "2gm2iw937q5", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "DetailsBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 1 - }, - "rowKey": "id" - }, - "x-designer": "DetailsDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "关系区块" - }, - "properties": { - "paj8b2noc1g": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Details", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useDetailsBlockProps }}" - }, - "properties": { - "3jisjip7503": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "DetailsActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "cbkfxafywtx", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "d1ls1w6gpzm", - "x-async": false, - "x-index": 2 - }, - "pagination": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Pagination", - "x-component-props": { - "useProps": "{{ useDetailsPaginationProps }}" - }, - "x-uid": "u0rzv8370za", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "1hfu8jbzzqw", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form-read-pretty.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form-read-pretty.md deleted file mode 100644 index 676df3034..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form-read-pretty.md +++ /dev/null @@ -1,286 +0,0 @@ -# Form (Read pretty) - -## UI Schema - -### 单数据详情 - -```json -{ - "x-uid": "dt4q817fw81", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a", - "collection": "a", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "Form read pretty" - }, - "properties": { - "30qrxij609o": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "fznn1ygt50o", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "t3o4t8fi7l7", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "6dp2qqoc4s0", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系数据详情 - -```json -{ - "x-uid": "jf470wrzdaf", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2oBelongsTo:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2oBelongsTo", - "collection": "b", - "association": "a.o2oBelongsTo", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "对一关系详情" - }, - "properties": { - "uauk2wbj3iq": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "r3pcykksp8l", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "vs000etludp", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "rt228uhudcf", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 表格详情 - -```json -{ - "x-uid": "lxcjjkkor1m", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "表格详情" - }, - "properties": { - "7pe17tcgtye": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "wek8nc795ja", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "5y5u8qm6yvz", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "5bpcm982n51", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 查看关系数据 - -```json -{ - "x-uid": "5ymsrq1fv37", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:get", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "get", - "useParams": "{{ useParamsFromRecord }}", - "useSourceId": "{{ useSourceIdFromParentRecord }}" - }, - "x-designer": "FormV2.ReadPrettyDesigner", - "x-component": "CardItem", - "x-component-props": { - "title": "查看关系数据" - }, - "properties": { - "vehcfr0fsh2": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ReadPrettyFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-uid": "zpuz629u2dg", - "x-async": false, - "x-index": 1 - }, - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-uid": "b8u8e2k5inf", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "2rz0u3j14px", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form.md deleted file mode 100644 index 442457ba0..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/form.md +++ /dev/null @@ -1,418 +0,0 @@ -# Form - -## UI Schema - -### 添加表单 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a", - "collection": "a" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": {}, - "properties": { - "23pj9m7ot5a": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "0ctuwnatyzd", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "properties": { - "j7ta88et3mv": { - "_isJSONSchemaObject": true, - "version": "2.0", - "title": "{{ t(\"Submit\") }}", - "x-action": "submit", - "x-component": "Action", - "x-designer": "Action.Designer", - "x-component-props": { - "type": "primary", - "htmlType": "submit", - "useProps": "{{ useCreateActionProps }}" - }, - "x-action-settings": { - "triggerWorkflows": [] - }, - "type": "void", - "x-uid": "ua858zswy37", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "o0riryr0ob0", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "1ng4hies4yu", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ebiyvziafda", - "x-async": false, - "x-index": 1 -} -``` - -### 编辑表单 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": false - }, - "x-acl-action": "a:update", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": "get", - "resource": "a", - "collection": "a" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": {}, - "properties": { - "w533dipin7p": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "otncpmalhjr", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "UpdateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "qjjmm1qkapx", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "n12zo6qd72g", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "zafyvmng9m5", - "x-async": false, - "x-index": 1 -} -``` - -### 关系新增表单 - -```json -{ - "x-uid": "il5q341k4vg", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a.o2m:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": null, - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系新增表单" - }, - "properties": { - "3357yvwe4je": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "88xhnoml321", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "dhs8o8vpl1h", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "h6fhh9ox9ay", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系新增(关系表格里的 Add new) - -useSourceIdFromParentRecord 和 useParamsFromRecord 参数缺失 - -```json -{ - "x-uid": "6tknohm4ubr", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": true - }, - "x-acl-action": "a.o2m:create", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系新增表单-Table" - }, - "properties": { - "o96izt6ez7m": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "properties": { - "pk9l1i26yq6": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Row", - "properties": { - "32wz2lr9cry": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid.Col", - "properties": { - "id": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "string", - "x-designer": "FormItem.Designer", - "x-component": "CollectionField", - "x-decorator": "FormItem", - "x-collection-field": "b.id", - "x-component-props": {}, - "x-read-pretty": true, - "x-uid": "jb09nj4kbfm", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "rtx3b0uom75", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5gvd7ks6m0z", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "fcw1y2xk6km", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "CreateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "msgopb1meoq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "g0mg6fhho4x", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 关系编辑 - -```json -{ - "x-uid": "kzg1tz339ro", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action-props": { - "skipScopeCheck": false - }, - "x-acl-action": "a.o2m:update", - "x-decorator": "FormBlockProvider", - "x-decorator-props": { - "useSourceId": "{{ useSourceIdFromParentRecord }}", - "useParams": "{{ useParamsFromRecord }}", - "action": "get", - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m" - }, - "x-designer": "FormV2.Designer", - "x-component": "CardItem", - "x-component-props": { - "title": "关系编辑表单" - }, - "properties": { - "3jqysycq8m0": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FormItemInitializers", - "x-uid": "sy3sjswogh4", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "UpdateFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "marginTop": 24 - } - }, - "x-uid": "xarcyjpypsy", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "lepez9684rm", - "x-async": false, - "x-index": 1 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/gantt.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/gantt.md deleted file mode 100644 index 4b7ad1269..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/gantt.md +++ /dev/null @@ -1,185 +0,0 @@ -# Gantt - -## UI Schema - -### 甘特图区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "users:list", - "x-decorator": "GanttBlockProvider", - "x-decorator-props": { - "collection": "users", - "resource": "users", - "action": "list", - "fieldNames": { - "id": "id", - "start": "createdAt", - "range": "day", - "title": "nickname", - "end": "f_46b1u4dp820" - }, - "params": { - "paginate": false - } - }, - "x-designer": "Gantt.Designer", - "x-component": "CardItem", - "properties": { - "rx21gtpcj3w": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Gantt", - "x-component-props": { - "useProps": "{{ useGanttBlockProps }}" - }, - "properties": { - "toolBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 24 - } - }, - "x-initializer": "GanttActionInitializers", - "x-uid": "m0uru68ugw9", - "x-async": false, - "x-index": 1 - }, - "table": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-decorator": "div", - "x-decorator-props": { - "style": { - "float": "left", - "maxWidth": "35%" - } - }, - "x-initializer": "TableColumnInitializers", - "x-component": "TableV2", - "x-component-props": { - "rowKey": "id", - "rowSelection": { - "type": "checkbox" - }, - "useProps": "{{ useTableBlockProps }}", - "pagination": false - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Actions\") }}", - "x-action-column": "actions", - "x-decorator": "TableV2.Column.ActionBar", - "x-component": "TableV2.Column", - "x-designer": "TableV2.ActionColumnDesigner", - "x-initializer": "TableActionColumnInitializers", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "DndContext", - "x-component": "Space", - "x-component-props": { - "split": "|" - }, - "x-uid": "z2vnizu7bds", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "8gbabo6kdr6", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5c8g2x6rvro", - "x-async": false, - "x-index": 2 - }, - "detail": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Gantt.Event", - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "jr5h3asz6gp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "8uwfpgyok9x", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "bjm4sfwxmrx", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "7cmwpc0rrwj", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nffb7qbs96o", - "x-async": false, - "x-index": 3 - } - }, - "x-uid": "hoi2j5lhlho", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "e0rdive4xpa", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/grid-card.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/grid-card.md deleted file mode 100644 index 6620d607b..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/grid-card.md +++ /dev/null @@ -1,219 +0,0 @@ -# GridCard - -## UI Schema - -### 栅格卡片 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "GridCard.Designer", - "x-component": "BlockItem", - "x-decorator": "GridCard.Decorator", - "x-acl-action": "users:view", - "x-component-props": { - "useProps": "{{ useGridCardBlockItemProps }}" - }, - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 12 - }, - "rowKey": "id", - "resource": "users", - "collection": "users", - "readPretty": true, - "runWhenParamsChanged": true - }, - "_isJSONSchemaObject": true, - "properties": { - "actionBar": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "GridCardActionInitializers", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "_isJSONSchemaObject": true, - "x-uid": "prx9wnlzqb1", - "x-async": false, - "x-index": 1 - }, - "list": { - "type": "array", - "version": "2.0", - "x-component": "GridCard", - "x-component-props": { - "useProps": "{{ useGridCardBlockProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "item": { - "type": "object", - "version": "2.0", - "x-component": "GridCard.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useGridCardItemProps }}" - }, - "_isJSONSchemaObject": true, - "properties": { - "grid": { - "type": "void", - "version": "2.0", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "_isJSONSchemaObject": true, - "x-initializer-props": { - "useProps": "{{ useGridCardItemInitializerProps }}" - }, - "x-uid": "pq895sv6136", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "type": "void", - "version": "2.0", - "x-align": "left", - "x-component": "ActionBar", - "x-initializer": "GridCardItemActionInitializers", - "x-component-props": { - "layout": "one-column", - "useProps": "{{ useGridCardActionBarProps }}" - }, - "_isJSONSchemaObject": true, - "x-uid": "w2c3qcp4nme", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "1ct8yn1jnzn", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "pvnkvtc6tte", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "phodsqwsifq", - "x-async": false, - "x-index": 1 -} -``` - -### 关系数据的栅格卡片 - -```json -{ - "x-uid": "yr79zvl98lc", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "GridCard.Decorator", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 12 - }, - "runWhenParamsChanged": true, - "columnCount": { - "xs": 1, - "md": 12, - "lg": 12, - "xxl": 12 - } - }, - "x-component": "BlockItem", - "x-component-props": { - "useProps": "{{ useGridCardBlockItemProps }}" - }, - "x-designer": "GridCard.Designer", - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "GridCardActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "u36l44beq6a", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "GridCard", - "x-component-props": { - "useProps": "{{ useGridCardBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "GridCard.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useGridCardItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useGridCardItemInitializerProps }}" - }, - "x-uid": "aqxlonv3bpk", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "GridCardItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useGridCardActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "zxhqo81kdf5", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "ed56owlyz1p", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nfpuvrkwkk7", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/index.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/index.md deleted file mode 100644 index d47422275..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/index.md +++ /dev/null @@ -1,255 +0,0 @@ -# 数据区块概述 - -数据可能是某个表(collection)的数据,也可能是某个关系(association)的数据 - -- collection,如 a 表 -- association,如 a.b 关系,关系表为 b - -collection 示例 - -```js -{ - "collection": "a" -} -``` - -association 示例 - -```js -{ - "collection": "b", - "association": "a.b" -} -``` - -数据的操作 - -```bash -: -.: -``` - -实际的请求参数 - -``` - /api/: - /api/:/ - /api///: - /api///:/ -``` - -- collection、association、action 是配置里存好的 -- sourceId、filterByTk 由上下文提供 - -## CollectionRecordProvider - -Record - -```ts -class CollectionRecord { - protected current = {}; - protected parent?: Record; - public isNew = false; - constructor(options = {}) { - const { current, parent, isNew } = options; - this.current = current || {}; - this.parent = parent; - this.isNew = isNew; - } -} -``` - -a:list(**list 外层不套空 RecordPicker**) - -```jsx | pure -{list.map((item) => { - const record = new CollectionRecord({ current: item }); - return -})} -``` - -a:get(view、edit) - -```jsx | pure -const record = new CollectionRecord({ current: item }); - -``` - -a:create - -```jsx | pure -const record = new CollectionRecord({ current, isNew: true }); - -``` - -a.b:list - -```jsx | pure - - {list.map((item) => { - const recordB = new CollectionRecord({ - current: item, - }); - return - })} - -``` - -a.b:get - -```jsx | pure -const recordA = new CollectionRecord({ - current: itemA, -}); -const recordB = new CollectionRecord({ - current: itemB, - parent: recordA, -}); -// 或者 -recordB.setParent(recordA); - - - - -``` - -a.b:create - -```jsx | pure -const recordA = new CollectionRecord({ - current: itemA, -}); -const recordB = new CollectionRecord({ - isNew: true, - parent: recordA, -}); - - - -``` - -## 区块 - -以下重要组件说明 - -- `DataBlockProvider` 数据区块的总称 -- `BlockProvider` 区块的各种参数设置 -- `CollectionProvider` collection 信息 -- `AssociationProvider` association 信息 -- `UseRequestProvider` useRequest 的 result - -没有当前记录的区块,如表格 - -```tsx | pure - - - - - - -
- - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - {props.children} - - - -``` - -有当前记录的区块,如表单 - -```tsx | pure - -
- -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - {props.children} - - - - -``` - -有当前父级记录的区块,如对多关系的表格区块,区块本身不套 RecordPicker - -```tsx | pure - - - - - - - -
- - - - - - - - -
- - - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - {props.children} - - - - -``` - -有父级记录也有当前记录的区块,如关系的表单 - -```tsx | pure - - - - - - - - -``` - -DataBlockProvider 内容 - -```tsx | pure - - - - - - {props.children} - - - - - -``` diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/kanban.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/kanban.md deleted file mode 100644 index b84b1b62a..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/kanban.md +++ /dev/null @@ -1,160 +0,0 @@ -# Kanban - -## UI Schema - -### 看板区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "t_ehwqkw0ljw2:list", - "x-decorator": "KanbanBlockProvider", - "x-decorator-props": { - "collection": "t_ehwqkw0ljw2", - "resource": "t_ehwqkw0ljw2", - "action": "list", - "groupField": "f_5h4umwf59lc", - "params": { - "sort": ["f_5h4umwf59lc_sort"], - "paginate": false - } - }, - "x-designer": "Kanban.Designer", - "x-component": "CardItem", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "KanbanActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "4vh5t2iohwp", - "x-async": false, - "x-index": 1 - }, - "iwnc45ou960": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "Kanban", - "x-component-props": { - "useProps": "{{ useKanbanBlockProps }}" - }, - "properties": { - "card": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-read-pretty": true, - "x-label-disabled": true, - "x-decorator": "BlockItem", - "x-component": "Kanban.Card", - "x-component-props": { - "openMode": "drawer" - }, - "x-designer": "Kanban.Card.Designer", - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-component-props": { - "dndContext": false - }, - "x-uid": "3v010y09684", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "dk9a5cb9d95", - "x-async": false, - "x-index": 1 - }, - "cardViewer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"View\") }}", - "x-designer": "Action.Designer", - "x-component": "Kanban.CardViewer", - "x-action": "view", - "x-component-props": { - "openMode": "drawer" - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"View record\") }}", - "x-component": "Action.Container", - "x-component-props": { - "className": "nb-action-popup" - }, - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "1lhiyyydpye", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "gisuj0zldz1", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "ohly2w4gnwp", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "29hjrxcfczh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "0k56h1q80xo", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "uny2d4n5ry4", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "3gga5lop4t6", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/list.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/list.md deleted file mode 100644 index 4e690cb7d..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/list.md +++ /dev/null @@ -1,213 +0,0 @@ -# List - -## UI Schema - -### 列表区块 - -```json -{ - "x-uid": "h9mzrnxokk3", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a:view", - "x-decorator": "List.Decorator", - "x-decorator-props": { - "resource": "a", - "collection": "a", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 10 - }, - "runWhenParamsChanged": true, - "rowKey": "id" - }, - "x-component": "CardItem", - "x-designer": "List.Designer", - "x-component-props": { - "title": "List 区块" - }, - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ListActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "chjgpgd45qz", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "List", - "x-component-props": { - "props": "{{ useListBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "List.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useListItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useListItemInitializerProps }}" - }, - "x-uid": "u45nwmwlone", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "ListItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useListActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "9erso7nhotq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "qkuzlun8frh", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "1mfaa48qy5j", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系的列表区块 - -```json -{ - "x-uid": "6tzpnkz60rx", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "a.o2m:view", - "x-decorator": "List.Decorator", - "x-decorator-props": { - "resource": "a.o2m", - "collection": "b", - "association": "a.o2m", - "readPretty": true, - "action": "list", - "params": { - "pageSize": 10 - }, - "runWhenParamsChanged": true - }, - "x-component": "CardItem", - "x-designer": "List.Designer", - "x-component-props": { - "title": "对多关系的列表区块" - }, - "properties": { - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "ListActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "i05xr7nfs26", - "x-async": false, - "x-index": 1 - }, - "list": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-component": "List", - "x-component-props": { - "props": "{{ useListBlockProps }}" - }, - "properties": { - "item": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "object", - "x-component": "List.Item", - "x-read-pretty": true, - "x-component-props": { - "useProps": "{{ useListItemProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "ReadPrettyFormItemInitializers", - "x-initializer-props": { - "useProps": "{{ useListItemInitializerProps }}" - }, - "x-uid": "krerg70a28e", - "x-async": false, - "x-index": 1 - }, - "actionBar": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-align": "left", - "x-initializer": "ListItemActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "useProps": "{{ useListActionBarProps }}", - "layout": "one-column" - }, - "x-uid": "9745q36ltfv", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "yxc0lnax9gk", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "6mlzb7p6dvn", - "x-async": false, - "x-index": 2 - } - }, - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/map.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/map.md deleted file mode 100644 index 0413da64b..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/map.md +++ /dev/null @@ -1,115 +0,0 @@ -# Map - -## UI Schema - -### 地图区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-acl-action": "t_ddo5bd0swdg:list", - "x-decorator": "MapBlockProvider", - "x-decorator-props": { - "collection": "t_ddo5bd0swdg", - "resource": "t_ddo5bd0swdg", - "action": "list", - "fieldNames": { - "field": ["f_tmhy5bbusr8"] - }, - "params": { - "paginate": false - } - }, - "x-designer": "MapBlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "MapActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": 16 - } - }, - "x-uid": "ap0xzy32bms", - "x-async": false, - "x-index": 1 - }, - "1672zefmplu": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "MapBlock", - "x-component-props": { - "useProps": "{{ useMapBlockProps }}" - }, - "properties": { - "drawer": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Action.Drawer", - "x-component-props": { - "className": "nb-action-popup" - }, - "title": "{{ t(\"View record\") }}", - "properties": { - "tabs": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Tabs", - "x-component-props": {}, - "x-initializer": "TabPaneInitializers", - "properties": { - "tab1": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{t(\"Details\")}}", - "x-component": "Tabs.TabPane", - "x-designer": "Tabs.Designer", - "x-component-props": {}, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "RecordBlockInitializers", - "x-uid": "vce3u8hfdrf", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "waw7z3qw7nn", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "szyybarlapl", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "83m07ksqbal", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "5cquhqq2161", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "p42awfpfnbf", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/table.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/data/table.md deleted file mode 100644 index 4c99e2554..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/data/table.md +++ /dev/null @@ -1,193 +0,0 @@ -# Table - -## UI Schema - -### 表格区块 - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-decorator": "TableBlockProvider", - "x-acl-action": "users:list", - "x-filter-targets": [], - "x-decorator-props": { - "action": "list", - "params": { - "pageSize": 20 - }, - "rowKey": "id", - "dragSort": false, - "resource": "users", - "showIndex": true, - "collection": "users", - "disableTemplate": false - }, - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "version": "2.0", - "x-component": "ActionBar", - "x-initializer": "TableActionInitializers", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "_isJSONSchemaObject": true, - "x-uid": "55tgsn1puqk", - "x-async": false, - "x-index": 1 - }, - "g22il5nkv67": { - "type": "array", - "version": "2.0", - "x-component": "TableV2", - "x-initializer": "TableColumnInitializers", - "x-component-props": { - "rowKey": "id", - "useProps": "{{ useTableBlockProps }}", - "rowSelection": { - "type": "checkbox" - } - }, - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "title": "{{ t(\"Actions\") }}", - "version": "2.0", - "x-designer": "TableV2.ActionColumnDesigner", - "x-component": "TableV2.Column", - "x-decorator": "TableV2.Column.ActionBar", - "x-initializer": "TableActionColumnInitializers", - "x-action-column": "actions", - "_isJSONSchemaObject": true, - "properties": { - "actions": { - "type": "void", - "version": "2.0", - "x-component": "Space", - "x-decorator": "DndContext", - "x-component-props": { - "split": "|" - }, - "_isJSONSchemaObject": true, - "x-uid": "qkcugf5l0h6", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "kbgbskxsj3j", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "6r8e3mhnuxg", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "b87bbc5x0cp", - "x-async": false, - "x-index": 1 -} -``` - -### 对多关系区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "TableBlockProvider", - "x-acl-action": "a.o2m:list", - "x-decorator-props": { - "collection": "b", - "resource": "a.o2m", - "action": "list", - "params": { - "pageSize": 20 - }, - "showIndex": true, - "dragSort": false, - "disableTemplate": false, - "association": "a.o2m" - }, - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "TableActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "style": { - "marginBottom": "var(--nb-spacing)" - } - }, - "x-uid": "0gwze38mzps", - "x-async": false, - "x-index": 1 - }, - "0wuk1cpy5zp": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "array", - "x-initializer": "TableColumnInitializers", - "x-component": "TableV2", - "x-component-props": { - "rowKey": "id", - "rowSelection": { - "type": "checkbox" - }, - "useProps": "{{ useTableBlockProps }}" - }, - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "{{ t(\"Actions\") }}", - "x-action-column": "actions", - "x-decorator": "TableV2.Column.ActionBar", - "x-component": "TableV2.Column", - "x-designer": "TableV2.ActionColumnDesigner", - "x-initializer": "TableActionColumnInitializers", - "properties": { - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "DndContext", - "x-component": "Space", - "x-component-props": { - "split": "|" - }, - "x-uid": "gq0nkc7rf0q", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "zx97354nzfq", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "nss8uocacdq", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "0j5kcrius5z", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/collapse.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/collapse.md deleted file mode 100644 index 0bb30600a..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/collapse.md +++ /dev/null @@ -1,41 +0,0 @@ -# Collapse - -## UI Schema - -### 折叠面板 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "AssociationFilter.Provider", - "x-decorator-props": { - "collection": "users", - "blockType": "filter", - "associationFilterStyle": { - "width": "100%" - }, - "name": "filter-collapse" - }, - "x-designer": "AssociationFilter.BlockDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "properties": { - "x8q0r7wp73e": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-action": "associateFilter", - "x-initializer": "AssociationFilter.FilterBlockInitializer", - "x-component": "AssociationFilter", - "x-uid": "j11suxuizte", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "0g6pyonrj83", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/form.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/form.md deleted file mode 100644 index f0145c51b..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/filter/form.md +++ /dev/null @@ -1,63 +0,0 @@ -# Form - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "FilterFormBlockProvider", - "x-decorator-props": { - "resource": "users", - "collection": "users" - }, - "x-designer": "FormV2.FilterDesigner", - "x-component": "CardItem", - "x-filter-targets": [], - "x-filter-operators": {}, - "properties": { - "dwltvxybiir": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "FormV2", - "x-component-props": { - "useProps": "{{ useFormBlockProps }}" - }, - "properties": { - "grid": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "FilterFormItemInitializers", - "x-uid": "aggw48stzwc", - "x-async": false, - "x-index": 1 - }, - "actions": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-initializer": "FilterFormActionInitializers", - "x-component": "ActionBar", - "x-component-props": { - "layout": "one-column", - "style": { - "float": "right" - } - }, - "x-uid": "7aogdo89a7s", - "x-async": false, - "x-index": 2 - } - }, - "x-uid": "wreuz6dr1pc", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "7d1o5bruekl", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/index.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/index.md deleted file mode 100644 index 07dd0c5c7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/index.md +++ /dev/null @@ -1 +0,0 @@ -# Overview diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/iframe.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/others/iframe.md deleted file mode 100644 index 58a2bf038..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/iframe.md +++ /dev/null @@ -1,22 +0,0 @@ - -# iframe - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "Iframe.Designer", - "x-component": "Iframe", - "x-decorator": "BlockItem", - "x-component-props": {}, - "x-decorator-props": { - "name": "iframe" - }, - "_isJSONSchemaObject": true, - "x-uid": "fmmlqe8rrei", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/markdown.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/others/markdown.md deleted file mode 100644 index 478fafd2c..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/markdown.md +++ /dev/null @@ -1,24 +0,0 @@ -# Markdown - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "Markdown.Void.Designer", - "x-editable": false, - "x-component": "Markdown.Void", - "x-decorator": "CardItem", - "x-component-props": { - "content": "This is a demo text, **supports Markdown syntax**." - }, - "x-decorator-props": { - "name": "markdown" - }, - "_isJSONSchemaObject": true, - "x-uid": "w75e9d5vs1e", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/workflow-todo.md b/packages/core/client/docs/zh-CN/ui-schema/blocks/others/workflow-todo.md deleted file mode 100644 index 9f477e5d7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/blocks/others/workflow-todo.md +++ /dev/null @@ -1,33 +0,0 @@ -# Workflow todos - -## x-designer - -- TableBlockDesigner(不适合直接用表格区块的) - -## UI Schema - -```json -{ - "type": "void", - "version": "2.0", - "x-designer": "TableBlockDesigner", - "x-component": "CardItem", - "x-decorator": "WorkflowTodo.Decorator", - "x-decorator-props": {}, - "_isJSONSchemaObject": true, - "properties": { - "todos": { - "type": "void", - "version": "2.0", - "x-component": "WorkflowTodo", - "_isJSONSchemaObject": true, - "x-uid": "xq1qcdpq7rq", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "3z3ey8r6ik9", - "x-async": false, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/cascader-select.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/cascader-select.md deleted file mode 100644 index 94547e50c..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/cascader-select.md +++ /dev/null @@ -1 +0,0 @@ -# 级联选择器 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/file-manager.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/file-manager.md deleted file mode 100644 index 5b02970f7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/file-manager.md +++ /dev/null @@ -1 +0,0 @@ -# 文件管理器 diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/index.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/index.md deleted file mode 100644 index e9f57784b..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# 关系字段组件 - -### 标题 Read pretty - -### 标签 Read pretty - -### 子详情 Read pretty - -### 子表单 Editable - -### 子表单(弹窗) Editable - -### 下拉选择器 Editable - -### 数据选择器 Editable - -### 级联选择器 Editable - -### 文件管理器 Editable - -### 子表格 Editable Read pretty diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/record-picker.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/record-picker.md deleted file mode 100644 index ae439f012..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/record-picker.md +++ /dev/null @@ -1 +0,0 @@ -# 数据选择器 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/select.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/select.md deleted file mode 100644 index 9df4627f7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/select.md +++ /dev/null @@ -1 +0,0 @@ -# 下拉选择器 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-details.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-details.md deleted file mode 100644 index a509906e4..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-details.md +++ /dev/null @@ -1 +0,0 @@ -# 子详情 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form-popover.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form-popover.md deleted file mode 100644 index acc10f4a7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form-popover.md +++ /dev/null @@ -1 +0,0 @@ -# 子表单 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form.md deleted file mode 100644 index acc10f4a7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-form.md +++ /dev/null @@ -1 +0,0 @@ -# 子表单 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-table.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-table.md deleted file mode 100644 index 9556a6c5c..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/sub-table.md +++ /dev/null @@ -1 +0,0 @@ -# 子表格 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/tag.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/tag.md deleted file mode 100644 index f927916b3..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/tag.md +++ /dev/null @@ -1 +0,0 @@ -# 标签 diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/title.md b/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/title.md deleted file mode 100644 index e8a280714..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/association-components/title.md +++ /dev/null @@ -1 +0,0 @@ -# 标题 \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/form-item.md b/packages/core/client/docs/zh-CN/ui-schema/fields/form-item.md deleted file mode 100644 index 74112ffb2..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/form-item.md +++ /dev/null @@ -1,22 +0,0 @@ -# FormItem - 表单项 - -## UI Schema - -### 表单字段 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "string", - "x-designer": "FormItem.Designer", - "x-component": "CollectionField", - "x-decorator": "FormItem", - "x-collection-field": "a.id", - "x-component-props": {}, - "x-read-pretty": true, - "x-uid": "u2nk80cguoa", - "x-async": false, - "x-index": 1 -} -``` diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/index.md b/packages/core/client/docs/zh-CN/ui-schema/fields/index.md deleted file mode 100644 index e734184db..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/index.md +++ /dev/null @@ -1,5 +0,0 @@ -# Overview - -## UI Schema 协议 - -- `x-collection-field` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/fields/table-column.md b/packages/core/client/docs/zh-CN/ui-schema/fields/table-column.md deleted file mode 100644 index 61598b8f6..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/fields/table-column.md +++ /dev/null @@ -1,40 +0,0 @@ -# 表格列 - -## UI Schema - -### 表格列 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-decorator": "TableV2.Column.Decorator", - "x-designer": "TableV2.Column.Designer", - "x-component": "TableV2.Column", - "properties": { - "f_beilggsbj0r": { - "_isJSONSchemaObject": true, - "version": "2.0", - "x-collection-field": "a.f_beilggsbj0r", - "x-component": "CollectionField", - "x-component-props": { - "ellipsis": true - }, - "x-read-pretty": true, - "x-decorator": null, - "x-decorator-props": { - "labelStyle": { - "display": "none" - } - }, - "x-uid": "h5u4xi7uvji", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "z8p8ezctwsh", - "x-async": false, - "x-index": 2 -} -``` diff --git a/packages/core/client/docs/zh-CN/ui-schema/globals/menu.md b/packages/core/client/docs/zh-CN/ui-schema/globals/menu.md deleted file mode 100644 index 69a4e6a80..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/globals/menu.md +++ /dev/null @@ -1,127 +0,0 @@ -# Menu - - -菜单模块以后会重构,Item 直接用 items 对接,不用 schema 嵌套,Menu 也会开放到更多场景里使用。 - - -## `x-initializer` - -- MenuItemInitializers - -## `x-designer` - -- Menu.Designer - -## `x-settings` - -- MenuSettings - -## UI Schema - -### 菜单 - -```json -{ - "type": "void", - "x-component": "Menu", - "x-designer": "Menu.Designer", - "x-initializer": "MenuItemInitializers", - "x-component-props": { - "mode": "mix", - "theme": "dark", - "onSelect": "{{ onSelect }}", - "sideMenuRefScopeKey": "sideMenuRef" - }, - "name": "lap9zil5z4u", - "x-uid": "x77wpukk3qz", - "x-async": false -} -``` - -### 菜单分组 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Group", - "x-component": "Menu.SubMenu", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "icon": "alipaycircleoutlined", - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "zjxw5sph3do", - "x-async": false, - "x-index": 1 -} -``` - -### 菜单页面 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Page1", - "x-component": "Menu.Item", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "icon": "alipaycircleoutlined", - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "y0jp661nb8i", - "x-async": false, - "x-index": 2 -} -``` - -### 链接 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Link", - "x-component": "Menu.URL", - "x-decorator": "ACLMenuItemProvider", - "x-component-props": { - "href": "#", - "icon": "alipaycircleoutlined" - }, - "x-server-hooks": [ - { - "type": "onSelfCreate", - "method": "bindMenuToRole" - }, - { - "type": "onSelfSave", - "method": "extractTextToLocale" - } - ], - "x-uid": "ynembhzwcj1", - "x-async": false, - "x-index": 3 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/globals/page.md b/packages/core/client/docs/zh-CN/ui-schema/globals/page.md deleted file mode 100644 index 2f93084f7..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/globals/page.md +++ /dev/null @@ -1,94 +0,0 @@ -# Page - - -现在页面依赖菜单,以后会独立出来,也可以创建无菜单的页面。另外,页面的标签页的设计还有问题。 - - -## `x-initializer` - -- PageTabsInitializers(暂无) -- BlockInitializers - -## `x-designer` - -- PageDesigner(暂无) -- PageTabsDesigner(暂无) - -## `x-settings` - -- PageSettings - -## UI Schema - -### 页面区块 - -```json -{ - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Page", - "title": "AA333", - "x-component-props": { - "enablePageTabs": true, - "hidePageTitle": true, - "disablePageHeader": true - }, - "properties": { - "nzxygx0iady": { - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "x-uid": "z8hxh8fxksb", - "x-async": false, - "x-index": 1 - } - }, - "x-uid": "9stdz1ld2p5", - "x-async": true, - "x-index": 1 -} -``` - -### 页面标签页 - -```json -{ - "x-uid": "cqq0ythy0yj", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Page", - "x-component-props": { - "enablePageTabs": true - }, - "properties": { - "o8gqaximg8c": { - "x-uid": "lzz2tqi8sxp", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "title": "Tab1", - "x-async": false, - "x-index": 1 - }, - "zjl1itzi6t8": { - "x-uid": "x10ru2grypq", - "_isJSONSchemaObject": true, - "version": "2.0", - "type": "void", - "title": "Tab2", - "x-component": "Grid", - "x-initializer": "BlockInitializers", - "x-async": false, - "x-index": 2 - } - }, - "x-async": true, - "x-index": 1 -} -``` \ No newline at end of file diff --git a/packages/core/client/docs/zh-CN/ui-schema/globals/tabs.md b/packages/core/client/docs/zh-CN/ui-schema/globals/tabs.md deleted file mode 100644 index c3ccea468..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/globals/tabs.md +++ /dev/null @@ -1,5 +0,0 @@ -# Tabs - - -标签页以后会重构,相关场景有页面的标签页和弹窗里的标签页 - diff --git a/packages/core/client/docs/zh-CN/ui-schema/index.md b/packages/core/client/docs/zh-CN/ui-schema/index.md deleted file mode 100644 index d908d9ed2..000000000 --- a/packages/core/client/docs/zh-CN/ui-schema/index.md +++ /dev/null @@ -1,25 +0,0 @@ -# 概述 - -## `x-initializer` - -不是所有节点都能使用 `x-initializer`,内置的 Schema 组件里,只有 Grid、ActionBar、Tabs、Table 组件有 `x-initializer` 参数 - -- Grid(通用) -- ActionBar(通用) -- Tabs(通用) -- Table -- Menu - -## `x-designer` - -`x-designer` 通常需要和 `BlockItem`、`FormItem`、`CardItem` 这类组件结合使用 - -完整的 Designer 组件有 - -- DragHandler -- Initializer -- Settings - -```tsx | pure - -``` diff --git a/packages/core/client/package.json b/packages/core/client/package.json index 2accc9085..11968944d 100644 --- a/packages/core/client/package.json +++ b/packages/core/client/package.json @@ -67,9 +67,7 @@ "@types/markdown-it": "12.2.3", "@types/markdown-it-highlightjs": "3.3.1", "@types/react-big-calendar": "^1.6.4", - "axios-mock-adapter": "^1.20.0", - "dumi": "^2.2.0", - "dumi-theme-nocobase": "^0.2.19" + "axios-mock-adapter": "^1.20.0" }, "peerDependencies": { "@nocobase/database": "workspace:*", diff --git a/packages/core/client/src/formula/Expression.tsx b/packages/core/client/src/formula/Expression.tsx deleted file mode 100644 index 34b4e0bff..000000000 --- a/packages/core/client/src/formula/Expression.tsx +++ /dev/null @@ -1,239 +0,0 @@ -import { css } from '@emotion/css'; -import { Field, onFormSubmitValidateStart } from '@nocobase/schema'; -import { useField, useFormEffects } from '@nocobase/schema'; -import { Dropdown, MenuProps } from 'antd'; -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { useTranslation } from 'react-i18next'; - -function pasteHtml(html, selectPastedContent = false) { - let sel, range; - if (window.getSelection) { - // IE9 and non-IE - sel = window.getSelection(); - if (sel.getRangeAt && sel.rangeCount) { - range = sel.getRangeAt(0); - range.deleteContents(); - - // Range.createContextualFragment() would be useful here but is - // only relatively recently standardized and is not supported in - // some browsers (IE9, for one) - const el = document.createElement('div'); - el.innerHTML = html; - let frag = document.createDocumentFragment(), - node, - lastNode; - while ((node = el.firstChild)) { - lastNode = frag.appendChild(node); - } - const firstNode = frag.firstChild; - range.insertNode(frag); - - // Preserve the selection - if (lastNode) { - range = range.cloneRange(); - range.setStartAfter(lastNode); - if (selectPastedContent) { - range.setStartBefore(firstNode); - } else { - range.collapse(true); - } - sel.removeAllRanges(); - sel.addRange(range); - } - } - } -} - -const getValue = (el) => { - const values: any[] = []; - for (const node of el.childNodes) { - if (node.nodeName === 'SPAN') { - values.push(`{{${node['dataset']['key']}}}`); - } else { - values.push(node.textContent?.trim?.()); - } - } - const text = values.join(' ')?.replace(/\s+/g, ' ').trim(); - return ` ${text} `; -}; - -const renderExp = (exp: string, scope = {}) => { - return exp.replace(/{{([^}]+)}}/g, (_, i) => { - return scope[i.trim()] || ''; - }); -}; - -export const Expression = (props) => { - const { evaluate, value, supports, useCurrentFields } = props; - const field = useField(); - const { t } = useTranslation(); - const fields = useCurrentFields(); - const inputRef = useRef(); - const [changed, setChanged] = useState(false); - - const onChange = useCallback( - (value) => { - setChanged(true); - props.onChange(value); - }, - [props.onChange], - ); - - const { numColumns, scope } = useMemo(() => { - const numColumns = new Map(); - const scope = {}; - fields - .filter((field) => supports.includes(field.interface)) - .forEach((field) => { - numColumns.set(field.name, field.uiSchema.title); - scope[field.name] = 1; - }); - - return { numColumns, scope }; - }, [fields, supports]); - - const keys = Array.from(numColumns.keys()); - const [html, setHtml] = useState(() => { - const scope = {}; - for (const key of keys) { - const val = numColumns.get(key); - scope[ - key - ] = ` ${val} `; - } - return renderExp(value || '', scope); - }); - - useEffect(() => { - if (changed) { - return; - } - const scope = {}; - for (const key of keys) { - const val = numColumns.get(key); - scope[ - key - ] = ` ${val} `; - } - const val = renderExp(value || '', scope); - setHtml(val); - }, [value]); - - const menuItems = useMemo(() => { - if (keys.length > 0) { - return keys.map((key) => ({ - key, - disabled: true, - label: ( - - ), - })); - } else { - return [ - { - key: 0, - disabled: true, - label: t('No available fields'), - }, - ]; - } - }, [keys, numColumns, onChange]); - - const menu = useMemo(() => { - return { - items: menuItems, - }; - }, [menuItems]); - - useFormEffects(() => { - onFormSubmitValidateStart(() => { - try { - evaluate(field.value, scope); - field.feedbacks = []; - } catch (e) { - console.error(field.value, scope, (e as Error).message); - field.setFeedback({ - type: 'error', - code: 'FormulaError', - messages: [t('Formula error.')], - }); - } - }); - }); - - return ( - -
{ - const text = getValue(e.currentTarget); - if (e.key === 'Backspace') { - if (text && keys.map((k) => `{{${k}}}`).includes(text)) { - inputRef.current.innerHTML = ' '; - } - } - }} - onKeyUp={(e) => { - const text = getValue(e.currentTarget); - if (e.key === 'Backspace') { - // pasteHtml(' '); - } - onChange(text); - }} - // onClick={(e) => { - // const text = getValue(e.currentTarget); - // onChange(text); - // console.log('onChange', text); - // }} - onBlur={(e) => { - const text = getValue(e.currentTarget); - onChange(text); - }} - onInput={(e) => { - const text = getValue(e.currentTarget); - onChange(text); - }} - className={'ant-input'} - style={{ display: 'block' }} - ref={inputRef as any} - contentEditable - dangerouslySetInnerHTML={{ __html: html }} - /> - - ); -}; - -export default Expression; diff --git a/packages/core/client/src/formula/Result.tsx b/packages/core/client/src/formula/Result.tsx deleted file mode 100644 index 6d174ba35..000000000 --- a/packages/core/client/src/formula/Result.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { onFormValuesChange } from '@nocobase/schema'; -import { useField, useFieldSchema, useForm, useFormEffects } from '@nocobase/schema'; -import { toFixedByStep } from '@nocobase/utils/client'; -import cloneDeep from 'lodash/cloneDeep'; -import * as math from 'mathjs'; -import { isNumber } from 'mathjs'; -import React, { useState } from 'react'; -import { useCollection_deprecated } from '../collection-manager'; - -const ReadPretty = (props) => { - if (props?.options?.dataType !== 'string') { - return
{toFixedByStep(props.value, props.step)}
; - } - return
{props.value}
; -}; - -const Input = (props) => { - const { evaluate, options } = props; - const { dataType, expression } = options; - const form = useForm(); - const val = () => { - const scope = cloneDeep(form.values); - try { - let result = evaluate(expression, scope); - result = isNumber(result) && Number.isFinite(result) ? math.round(result, 9) : result; - return result; - } catch (error) { - return null; - } - }; - const [value, setVal] = useState(() => { - return val(); - }); - useFormEffects(() => { - onFormValuesChange(() => { - setVal(val()); - }); - }); - if (dataType !== 'string') { - return
{toFixedByStep(value, props.step)}
; - } - return
{value}
; -}; - -export const Result = (props: any) => { - const field = useField(); - const { getField } = useCollection_deprecated(); - const fieldSchema = useFieldSchema(); - const options = getField(fieldSchema.name as string); - return field.readPretty ? : ; -}; - -export default Result; diff --git a/packages/core/client/src/formula/demos/demo2.tsx b/packages/core/client/src/formula/demos/demo2.tsx deleted file mode 100644 index da5bd9eed..000000000 --- a/packages/core/client/src/formula/demos/demo2.tsx +++ /dev/null @@ -1,51 +0,0 @@ -/** - * title: Formula - */ -import { connect } from '@nocobase/schema'; -import { Formula, SchemaComponent, SchemaComponentProvider } from '@nocobase/client'; -import React from 'react'; - -const Expression = connect(Formula.Expression); - -const schema = { - type: 'object', - properties: { - input: { - type: 'string', - default: '{{f1 }} + {{ f2}}', - 'x-component': 'Expression', - 'x-component-props': { - evaluate: (exp, scope) => { - return 1; - }, - supports: ['number'], - useCurrentFields: () => { - return [ - { - name: 'f1', - interface: 'number', - uiSchema: { - title: 'F1', - }, - }, - { - name: 'f2', - interface: 'number', - uiSchema: { - title: 'F2', - }, - }, - ]; - }, - }, - }, - }, -}; - -export default () => { - return ( - - - - ); -}; diff --git a/packages/core/client/src/formula/index.md b/packages/core/client/src/formula/index.md deleted file mode 100644 index db9bd0a45..000000000 --- a/packages/core/client/src/formula/index.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -group: - title: Client - order: 1 ---- - -# Formula - - diff --git a/packages/core/client/src/formula/index.tsx b/packages/core/client/src/formula/index.tsx deleted file mode 100644 index 9a59d66df..000000000 --- a/packages/core/client/src/formula/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import Expression from './Expression'; -import Result from './Result'; - -export const Formula = () => null; - -Formula.Result = Result; -Formula.Expression = Expression; - -export default Formula; diff --git a/packages/core/client/src/index.ts b/packages/core/client/src/index.ts index b30595767..031229d6b 100644 --- a/packages/core/client/src/index.ts +++ b/packages/core/client/src/index.ts @@ -29,7 +29,6 @@ export * from './data-source'; export * from './document-title'; export * from './filter-provider'; export * from './flag-provider'; -export * from './formula'; export * from './global-theme'; export * from './hooks'; export * from './i18n'; diff --git a/packages/core/client/tsconfig.json b/packages/core/client/tsconfig.json deleted file mode 100644 index 42c17ae84..000000000 --- a/packages/core/client/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "compilerOptions": { - "target": "ESNext", - "module": "ESNext" - } -} diff --git a/packages/core/test/vitest.mjs b/packages/core/test/vitest.mjs index 359d507ff..475969ebf 100644 --- a/packages/core/test/vitest.mjs +++ b/packages/core/test/vitest.mjs @@ -65,7 +65,7 @@ export const defineConfig = (config = {}) => { '**/e2e/**', '**/__e2e__/**', '**/{vitest,commitlint}.config.*', - 'packages/**/{dumi-theme-nocobase,sdk,client}/**/__tests__/**/*.{test,spec}.{ts,tsx}', + 'packages/**/{sdk,client}/**/__tests__/**/*.{test,spec}.{ts,tsx}', ], testTimeout: 300000, hookTimeout: 300000, @@ -94,7 +94,7 @@ export const defineConfig = (config = {}) => { environment: 'jsdom', css: false, alias: tsConfigPathsToAlias(), - include: ['packages/**/{dumi-theme-nocobase,sdk,client}/**/__tests__/**/*.{test,spec}.{ts,tsx}'], + include: ['packages/**/{sdk,client}/**/__tests__/**/*.{test,spec}.{ts,tsx}'], exclude: [ '**/node_modules/**', '**/dist/**', diff --git a/packages/core/utils/tsconfig.json b/packages/core/utils/tsconfig.json new file mode 100644 index 000000000..a7d36e8e4 --- /dev/null +++ b/packages/core/utils/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "lib": ["esnext", "DOM.Iterable", "DOM"], + "esModuleInterop": true, + "moduleResolution": "node", + "jsx": "react", + "target": "esnext", + "module": "esnext", + "allowJs": true, + "noUnusedLocals": false, + "preserveConstEnums": true, + "skipLibCheck": true, + "skipDefaultLibCheck": true, + "sourceMap": true, + "inlineSources": true, + "resolveJsonModule": true, + "declaration": true, + "experimentalDecorators": true, + "downlevelIteration": true + }, + "exclude": [ + "node_modules", + "lib", + "client.d.ts", + "server.d.ts", + "client.js", + "server.js", + "plugin-symlink.d.ts", + "plugin-symlink.js" + ] +} diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/.npmignore b/packages/plugins/@nocobase/plugin-excel-formula-field/.npmignore deleted file mode 100644 index c593fe9df..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/LICENSE b/packages/plugins/@nocobase/plugin-excel-formula-field/LICENSE deleted file mode 100644 index 0ad25db4b..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/README.md b/packages/plugins/@nocobase/plugin-excel-formula-field/README.md deleted file mode 100644 index 8b0979dd3..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# excel-formula-field - -English | [中文](./README.zh-CN.md) - -## 安装激活 - -内置插件无需手动安装激活。 - -## 使用方法 diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/README.zh-CN.md b/packages/plugins/@nocobase/plugin-excel-formula-field/README.zh-CN.md deleted file mode 100644 index 4171af5ea..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/README.zh-CN.md +++ /dev/null @@ -1,9 +0,0 @@ -# excel-formula-field - -[English](./README.md) | 中文 - -## 安装激活 - -内置插件无需手动安装激活。 - -## 使用方法 diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/client.d.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/client.d.ts deleted file mode 100644 index 6c459cbac..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/client.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dist/client'; -export { default } from './dist/client'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/client.js b/packages/plugins/@nocobase/plugin-excel-formula-field/client.js deleted file mode 100644 index b6e3be70e..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/client.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/client/index.js'); diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/package.json b/packages/plugins/@nocobase/plugin-excel-formula-field/package.json deleted file mode 100644 index 8df56776b..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@nocobase/plugin-excel-formula-field", - "version": "0.21.6", - "description": "", - "keywords": [ - "Fields" - ], - "license": "AGPL-3.0", - "main": "./dist/server/index.js", - "devDependencies": { - "@formulajs/formulajs": "^4.2.0", - "@nocobase/schema": "workspace:*", - "react": "^18.2.0", - "react-i18next": "^11.15.1" - }, - "peerDependencies": { - "@nocobase/client": "workspace:*", - "@nocobase/database": "workspace:*", - "@nocobase/server": "workspace:*", - "@nocobase/test": "workspace:*" - }, - "gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1" -} diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/server.d.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/server.d.ts deleted file mode 100644 index c41081ddc..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/server.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dist/server'; -export { default } from './dist/server'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/server.js b/packages/plugins/@nocobase/plugin-excel-formula-field/server.js deleted file mode 100644 index 972842039..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/server.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/server/index.js'); diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormula/index.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormula/index.ts deleted file mode 100644 index 4c13a7b9e..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormula/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { connect, observer } from '@nocobase/schema'; -import { Formula } from '@nocobase/client'; -import React from 'react'; -import { evaluate } from '../../utils/evaluate'; - -export const ExcelFormula: any = () => null; - -ExcelFormula.Result = observer( - (props) => - React.createElement(Formula.Result, { - ...props, - evaluate, - }), - { displayName: 'ExcelFormula.Result' }, -); - -ExcelFormula.Expression = connect((props) => { - return React.createElement(Formula.Expression, { - ...props, - evaluate, - }); -}); - -ExcelFormula.Expression.displayName = 'ExcelFormula.Expression'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormulaFieldProvider.tsx b/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormulaFieldProvider.tsx deleted file mode 100644 index 2be60535c..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/ExcelFormulaFieldProvider.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { SchemaComponentOptions } from '@nocobase/client'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { ExcelFormula } from './ExcelFormula'; - -export const ExcelFormulaFieldProvider = React.memo((props) => { - const { t } = useTranslation(); - - return ( - - {t('Syntax see', { ns: 'math-formula-field' })}{' '} - - formula.js - -
- ), - }} - components={{ - ExcelFormula, - }} - > - {props.children} - - ); -}); - -ExcelFormulaFieldProvider.displayName = 'ExcelFormulaFieldProvider'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/excel-formula.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/excel-formula.ts deleted file mode 100644 index 84a4f0edc..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/excel-formula.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { CollectionFieldInterface, interfacesProperties } from '@nocobase/client'; -const { defaultProps, operators } = interfacesProperties; - -export class ExcelFormulaFieldInterface extends CollectionFieldInterface { - name = 'excelFormula'; - type = 'object'; - group = 'advanced'; - order = 2; - title = '{{t("Excel formula")}}'; - description = '{{t("Compute a value based on the other fields using excel formula functions")}}'; - sortable = true; - default = { - type: 'excelFormula', - // name, - uiSchema: { - type: 'string', - // title, - 'x-disabled': true, - 'x-component': 'ExcelFormula.Result', - 'x-component-props': { - stringMode: true, - step: '1', - }, - }, - }; - properties = { - ...defaultProps, - dataType: { - type: 'string', - title: '{{t("Data type")}}', - 'x-component': 'Select', - 'x-decorator': 'FormItem', - default: 'number', - 'x-disabled': '{{ !createOnly }}', - 'x-reactions': [ - { - target: 'uiSchema.x-component-props.step', - fulfill: { - state: { - display: '{{$self.value !== "string" ? "visible" : "none"}}', - }, - }, - }, - ], - enum: [ - { value: 'string', label: '{{t("String")}}' }, - { value: 'number', label: '{{t("Number")}}' }, - ], - }, - 'uiSchema.x-component-props.step': { - type: 'string', - title: '{{t("Precision")}}', - 'x-component': 'Select', - 'x-decorator': 'FormItem', - required: true, - default: '0', - enum: [ - { value: '0', label: '1' }, - { value: '0.1', label: '1.0' }, - { value: '0.01', label: '1.00' }, - { value: '0.001', label: '1.000' }, - { value: '0.0001', label: '1.0000' }, - { value: '0.00001', label: '1.00000' }, - ], - }, - expression: { - type: 'string', - title: '{{t("Expression")}}', - required: true, - description: '{{excelExpressionDescription}}', - 'x-component': 'ExcelFormula.Expression', - 'x-decorator': 'FormItem', - 'x-component-props': { - supports: ['number', 'percent', 'integer', 'string'], - useCurrentFields: '{{ useCurrentFields }}', - }, - }, - }; - filterable = { - operators: operators.string, - }; -} diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/index.tsx b/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/index.tsx deleted file mode 100644 index adc576f98..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/client/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Plugin } from '@nocobase/client'; -import { ExcelFormulaFieldProvider } from './ExcelFormulaFieldProvider'; -import { ExcelFormulaFieldInterface } from './excel-formula'; - -export class ExcelFormulaFieldPlugin extends Plugin { - async load() { - this.app.use(ExcelFormulaFieldProvider); - this.app.dataSourceManager.addFieldInterfaces([ExcelFormulaFieldInterface]); - } -} - -export default ExcelFormulaFieldPlugin; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/index.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/index.ts deleted file mode 100644 index 7e74612df..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './server'; -export { default } from './server'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/excel-formula-field.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/excel-formula-field.ts deleted file mode 100644 index 839c5e3ce..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/excel-formula-field.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { BaseFieldOptions, DataTypes, Field } from '@nocobase/database'; -import { evaluate } from '../utils/evaluate'; - -export class ExcelFormulaField extends Field { - get dataType() { - const { dataType } = this.options; - return dataType === 'string' ? DataTypes.STRING : DataTypes.DOUBLE; - } - - calculate(expression, scope) { - try { - return evaluate(expression, scope); - } catch {} - return null; - } - - initFieldData = async ({ transaction }) => { - const { expression, name } = this.options; - - const records = await this.collection.repository.find({ - order: [this.collection.model.primaryKeyAttribute], - transaction, - }); - - for (const record of records) { - const scope = record.toJSON(); - const result = this.calculate(expression, scope); - if (result) { - await record.update( - { - [name]: result, - }, - { - transaction, - silent: true, - hooks: false, - }, - ); - } - } - }; - - calculateField = async (instance) => { - const { expression, name } = this.options; - const scope = instance.toJSON(); - const result = this.calculate(expression, scope); - if (result) { - instance.set(name, result); - } - }; - - updateFieldData = async (instance, { transaction }) => { - if (this.collection.name === instance.collectionName && instance.name === this.options.name) { - this.options = Object.assign(this.options, instance.options); - const { name, expression } = this.options; - - const records = await this.collection.repository.find({ - order: [this.collection.model.primaryKeyAttribute], - transaction, - }); - - for (const record of records) { - const scope = record.toJSON(); - const result = this.calculate(expression, scope); - await record.update( - { - [name]: result, - }, - { - transaction, - silent: true, - hooks: false, - }, - ); - } - } - }; - - bind() { - super.bind(); - this.on('afterSync', this.initFieldData); - // TODO: should not depends on fields table (which is defined by other plugin) - this.database.on('fields.afterUpdate', this.updateFieldData); - this.on('beforeSave', this.calculateField); - } - - unbind() { - super.unbind(); - this.off('beforeSave', this.calculateField); - // TODO: should not depends on fields table - this.database.off('fields.afterUpdate', this.updateFieldData); - this.off('afterSync', this.initFieldData); - } - - toSequelize() { - const opts = super.toSequelize(); - delete opts.dataType; - return opts; - } -} - -export interface ExcelFormulaFieldOptions extends BaseFieldOptions { - type: 'excelFormula'; - dataType?: 'number' | 'string'; - expression: string; -} diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/index.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/index.ts deleted file mode 100644 index b68aea57f..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './plugin'; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/plugin.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/plugin.ts deleted file mode 100644 index 75ed8247c..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/server/plugin.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { InstallOptions, Plugin } from '@nocobase/server'; -import { ExcelFormulaField } from './excel-formula-field'; - -export class ExcelFormulaFieldPlugin extends Plugin { - afterAdd() {} - - beforeLoad() { - this.db.registerFieldTypes({ - excelFormula: ExcelFormulaField, - }); - } - - async load() {} - - async install(options?: InstallOptions) {} - - async afterEnable() {} - - async afterDisable() {} - - async remove() {} -} - -export default ExcelFormulaFieldPlugin; diff --git a/packages/plugins/@nocobase/plugin-excel-formula-field/src/utils/evaluate.ts b/packages/plugins/@nocobase/plugin-excel-formula-field/src/utils/evaluate.ts deleted file mode 100644 index cac69d182..000000000 --- a/packages/plugins/@nocobase/plugin-excel-formula-field/src/utils/evaluate.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as formulajs from '@formulajs/formulajs'; - -export function evaluate(exp: string, scope = {}) { - const expression = exp.replace(/{{([^}]+)}}/g, (match, i) => { - return scope[i.trim()] || ''; - }); - const fn = new Function(...Object.keys(formulajs), ...Object.keys(scope), `return ${expression}`); - return fn(...Object.values(formulajs), ...Object.values(scope)); -} diff --git a/packages/plugins/@nocobase/plugin-formula-field/src/client/index.tsx b/packages/plugins/@nocobase/plugin-formula-field/src/client/index.tsx index 8571b40fe..229eac1b8 100644 --- a/packages/plugins/@nocobase/plugin-formula-field/src/client/index.tsx +++ b/packages/plugins/@nocobase/plugin-formula-field/src/client/index.tsx @@ -1,10 +1,16 @@ import { Plugin } from '@nocobase/client'; -import { FormulaFieldProvider } from './FormulaFieldProvider'; import { FormulaFieldInterface } from './interfaces/formula'; +import { Formula } from './components'; +import { renderExpressionDescription } from './scopes'; export class FormulaFieldPlugin extends Plugin { async load() { - this.app.use(FormulaFieldProvider); + this.app.addComponents({ + Formula, + }); + this.app.addScopes({ + renderExpressionDescription, + }); this.app.dataSourceManager.addFieldInterfaces([FormulaFieldInterface]); } } diff --git a/packages/plugins/@nocobase/plugin-formula-field/src/client/FormulaFieldProvider.tsx b/packages/plugins/@nocobase/plugin-formula-field/src/client/scopes.tsx similarity index 55% rename from packages/plugins/@nocobase/plugin-formula-field/src/client/FormulaFieldProvider.tsx rename to packages/plugins/@nocobase/plugin-formula-field/src/client/scopes.tsx index 43b010372..06dacd7b3 100644 --- a/packages/plugins/@nocobase/plugin-formula-field/src/client/FormulaFieldProvider.tsx +++ b/packages/plugins/@nocobase/plugin-formula-field/src/client/scopes.tsx @@ -1,11 +1,10 @@ -import { css, i18n, SchemaComponentOptions } from '@nocobase/client'; +import { css, i18n } from '@nocobase/client'; import { Evaluator, evaluators } from '@nocobase/evaluators/client'; import { Registry } from '@nocobase/utils/client'; import React from 'react'; -import { Formula } from './components'; import { NAMESPACE } from './locale'; -function renderExpressionDescription(key: string) { +export function renderExpressionDescription(key: string) { const engine = (evaluators as Registry).get(key); return engine?.link ? ( @@ -28,20 +27,3 @@ function renderExpressionDescription(key: string) { ) : null; } - -export const FormulaFieldProvider = React.memo((props) => { - return ( - - {props.children} - - ); -}); -FormulaFieldProvider.displayName = 'FormulaFieldProvider'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/.npmignore b/packages/plugins/@nocobase/plugin-math-formula-field/.npmignore deleted file mode 100644 index c593fe9df..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/node_modules -/src \ No newline at end of file diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/LICENSE b/packages/plugins/@nocobase/plugin-math-formula-field/LICENSE deleted file mode 100644 index 0ad25db4b..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/LICENSE +++ /dev/null @@ -1,661 +0,0 @@ - GNU AFFERO GENERAL PUBLIC LICENSE - Version 3, 19 November 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - Developers that use our General Public Licenses protect your rights -with two steps: (1) assert copyright on the software, and (2) offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - - A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - - The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - - An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU Affero General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Remote Network Interaction; Use with the GNU General Public License. - - Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a "Source" link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -. diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/README.md b/packages/plugins/@nocobase/plugin-math-formula-field/README.md deleted file mode 100644 index 09eeec113..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# math-formula-field - -English | [中文](./README.zh-CN.md) - -## 安装激活 - -内置插件无需手动安装激活。 - -## 使用方法 diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/README.zh-CN.md b/packages/plugins/@nocobase/plugin-math-formula-field/README.zh-CN.md deleted file mode 100644 index d408567ed..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/README.zh-CN.md +++ /dev/null @@ -1,9 +0,0 @@ -# math-formula-field - -[English](./README.md) | 中文 - -## 安装激活 - -内置插件无需手动安装激活。 - -## 使用方法 diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/client.d.ts b/packages/plugins/@nocobase/plugin-math-formula-field/client.d.ts deleted file mode 100644 index 6c459cbac..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/client.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dist/client'; -export { default } from './dist/client'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/client.js b/packages/plugins/@nocobase/plugin-math-formula-field/client.js deleted file mode 100644 index b6e3be70e..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/client.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/client/index.js'); diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/package.json b/packages/plugins/@nocobase/plugin-math-formula-field/package.json deleted file mode 100644 index 954a935ba..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@nocobase/plugin-math-formula-field", - "displayName": "math formula field", - "version": "0.21.6", - "description": "A powerful mathematical formula field plugin designed to provide flexible mathematical and formula calculation capabilities for databases or data management systems. It seamlessly integrates with various database systems such as MySQL, PostgreSQL, and offers an intuitive user interface for defining and executing mathematical formula fields.", - "keywords": [ - "Fields" - ], - "license": "AGPL-3.0", - "main": "./dist/server/index.js", - "devDependencies": { - "@nocobase/schema": "workspace:*", - "mathjs": "^10.6.0", - "react": "~18.2.0", - "react-i18next": "^11.15.1" - }, - "peerDependencies": { - "@nocobase/client": "workspace:*", - "@nocobase/database": "workspace:*", - "@nocobase/server": "workspace:*", - "@nocobase/test": "workspace:*" - }, - "description.zh-CN": "一个功能强大的数学公式字段插件,旨在为数据库或数据管理系统提供灵活的数学计算和公式计算功能。它可以与各种数据库系统(如MySQL、PostgreSQL)无缝集成,并提供直观的用户界面来定义和执行数学公式字段。", - "displayName.zh-CN": "数学公式字段", - "gitHead": "d0b4efe4be55f8c79a98a331d99d9f8cf99021a1" -} diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/server.d.ts b/packages/plugins/@nocobase/plugin-math-formula-field/server.d.ts deleted file mode 100644 index c41081ddc..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/server.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './dist/server'; -export { default } from './dist/server'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/server.js b/packages/plugins/@nocobase/plugin-math-formula-field/server.js deleted file mode 100644 index 972842039..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/server.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./dist/server/index.js'); diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormula/index.tsx b/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormula/index.tsx deleted file mode 100644 index 8877d8581..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormula/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { connect, observer } from '@nocobase/schema'; -import { Formula } from '@nocobase/client'; -import React from 'react'; -import { evaluate } from '../../utils/evaluate'; - -export const MathFormula: any = () => null; - -MathFormula.Result = observer( - (props) => - React.createElement(Formula.Result, { - ...props, - evaluate, - }), - { displayName: 'MathFormula.Result' }, -); - -MathFormula.Expression = connect((props) => { - return React.createElement(Formula.Expression, { - ...props, - evaluate, - }); -}); diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormulaFieldProvider.tsx b/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormulaFieldProvider.tsx deleted file mode 100644 index b1c319970..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/MathFormulaFieldProvider.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { SchemaComponentOptions } from '@nocobase/client'; -import React from 'react'; -import { useTranslation } from 'react-i18next'; -import { MathFormula } from './MathFormula'; - -export const MathFormulaFieldProvider = React.memo((props) => { - const { t } = useTranslation(); - return ( - - {t('Syntax see', { ns: 'math-formula-field' })}{' '} - - math.js - - - ), - }} - components={{ MathFormula }} - > - {props.children} - - ); -}); -MathFormulaFieldProvider.displayName = 'MathFormulaFieldProvider'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/index.tsx b/packages/plugins/@nocobase/plugin-math-formula-field/src/client/index.tsx deleted file mode 100644 index 80a9437c4..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/index.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { Plugin } from '@nocobase/client'; -import { MathFormulaFieldProvider } from './MathFormulaFieldProvider'; -import { MathFormulaFieldInterface } from './math-formula'; - -export class MathFormulaFieldPlugin extends Plugin { - async load() { - this.app.use(MathFormulaFieldProvider); - this.app.dataSourceManager.addFieldInterfaces([MathFormulaFieldInterface]); - } -} - -export default MathFormulaFieldPlugin; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/math-formula.tsx b/packages/plugins/@nocobase/plugin-math-formula-field/src/client/math-formula.tsx deleted file mode 100644 index ec1926ffc..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/client/math-formula.tsx +++ /dev/null @@ -1,82 +0,0 @@ -import { CollectionFieldInterface, interfacesProperties } from '@nocobase/client'; -const { defaultProps, operators } = interfacesProperties; - -export class MathFormulaFieldInterface extends CollectionFieldInterface { - name = 'mathFormula'; - type = 'object'; - group = 'advanced'; - order = 1; - title = '{{t("Math formula")}}'; - description = '{{t("Compute a value based on the other fields using mathjs")}}'; - sortable = true; - default = { - type: 'mathFormula', - // name, - uiSchema: { - type: 'number', - // title, - 'x-disabled': true, - 'x-component': 'MathFormula.Result', - 'x-component-props': { - stringMode: true, - step: '1', - }, - }, - }; - properties = { - ...defaultProps, - dataType: { - type: 'string', - title: '{{t("Data type")}}', - 'x-component': 'Select', - 'x-decorator': 'FormItem', - default: 'number', - 'x-disabled': '{{ !createOnly }}', - 'x-reactions': [ - { - target: 'uiSchema.x-component-props.step', - fulfill: { - state: { - display: '{{$self.value !== "string" ? "visible" : "none"}}', - }, - }, - }, - ], - enum: [ - { value: 'string', label: '{{t("String")}}' }, - { value: 'number', label: '{{t("Number")}}' }, - ], - }, - 'uiSchema.x-component-props.step': { - type: 'string', - title: '{{t("Precision")}}', - 'x-component': 'Select', - 'x-decorator': 'FormItem', - required: true, - default: '0', - enum: [ - { value: '0', label: '1' }, - { value: '0.1', label: '1.0' }, - { value: '0.01', label: '1.00' }, - { value: '0.001', label: '1.000' }, - { value: '0.0001', label: '1.0000' }, - { value: '0.00001', label: '1.00000' }, - ], - }, - expression: { - type: 'string', - title: '{{t("Expression")}}', - required: true, - description: '{{mathExpressionDescription}}', - 'x-component': 'MathFormula.Expression', - 'x-decorator': 'FormItem', - 'x-component-props': { - supports: ['number', 'percent', 'integer'], - useCurrentFields: '{{ useCurrentFields }}', - }, - }, - }; - filterable = { - operators: operators.number, - }; -} diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/index.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/index.ts deleted file mode 100644 index 7e74612df..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './server'; -export { default } from './server'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/__tests__/formula-field.test.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/server/__tests__/formula-field.test.ts deleted file mode 100644 index cff7ca966..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/__tests__/formula-field.test.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { Database, mockDatabase } from '@nocobase/database'; -import { MathFormulaField } from '../math-formula-field'; - -describe('formula field', () => { - let db: Database; - - beforeEach(async () => { - db = mockDatabase(); - await db.clean({ drop: true }); - db.registerFieldTypes({ - mathFormula: MathFormulaField, - }); - }); - - afterEach(async () => { - await db.close(); - }); - - it('auto set formula field with create or update data', async () => { - const expression = 'price*count'; - const Test = db.collection({ - name: 'tests', - fields: [ - { type: 'float', name: 'price' }, - { type: 'float', name: 'count' }, - { name: 'sum', type: 'mathFormula', expression }, - ], - }); - - await db.sync(); - - const test = await Test.model.create({ - price: '1.2', - count: '2', - }); - - const sumField = Test.getField('sum'); - expect(test.get('sum')).toEqual(2.4); - - test.set('count', '6'); - await test.save(); - expect(test.get('sum')).toEqual(7.2); - }); - - it('auto set formula field with create or update data', async () => { - const expression = '{{price}}*{{count}}'; - const Test = db.collection({ - name: 'tests', - fields: [ - { type: 'float', name: 'price' }, - { type: 'float', name: 'count' }, - { name: 'sum', type: 'mathFormula', expression }, - ], - }); - - await db.sync(); - - const test = await Test.model.create({ - price: '1.2', - count: '2', - }); - - const sumField = Test.getField('sum'); - expect(test.get('sum')).toEqual(2.4); - - test.set('count', '6'); - await test.save(); - expect(test.get('sum')).toEqual(7.2); - }); - - it('1.22+2=3.22', async () => { - const expression = '{{a}}+{{b}}'; - const Test = db.collection({ - name: 'tests', - fields: [ - { type: 'float', name: 'a' }, - { type: 'float', name: 'b' }, - { name: 'sum', type: 'mathFormula', expression }, - ], - }); - - await db.sync(); - - const test = await Test.model.create({ - a: '2', - b: '1.22', - }); - - expect(test.get('sum')).toEqual(3.22); - }); -}); diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/index.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/server/index.ts deleted file mode 100644 index b68aea57f..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './plugin'; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/math-formula-field.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/server/math-formula-field.ts deleted file mode 100644 index 9258e179c..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/math-formula-field.ts +++ /dev/null @@ -1,106 +0,0 @@ -import { BaseFieldOptions, DataTypes, Field } from '@nocobase/database'; -import * as math from 'mathjs'; -import { evaluate } from '../utils/evaluate'; - -export class MathFormulaField extends Field { - get dataType() { - const { dataType } = this.options; - return dataType === 'string' ? DataTypes.STRING : DataTypes.DOUBLE; - } - - calculate(expression, scope) { - let result: any = null; - try { - result = evaluate(expression, scope); - result = math.round(result, 9); - } catch {} - return result; - } - - initFieldData = async ({ transaction }) => { - const { expression, name } = this.options; - - const records = await this.collection.repository.find({ - order: [this.collection.model.primaryKeyAttribute], - transaction, - }); - - for (const record of records) { - const scope = record.toJSON(); - const result = this.calculate(expression, scope); - if (result) { - await record.update( - { - [name]: result, - }, - { - transaction, - silent: true, - hooks: false, - }, - ); - } - } - }; - - calculateField = async (instance) => { - const { expression, name } = this.options; - const scope = instance.toJSON(); - let result; - try { - result = evaluate(expression, scope); - result = math.round(result, 9); - } catch {} - if (result === 0 || result) { - instance.set(name, result); - } - }; - - updateFieldData = async (instance, { transaction }) => { - if (this.collection.name === instance.collectionName && instance.name === this.options.name) { - this.options = Object.assign(this.options, instance.options); - const { name, expression } = this.options; - - const records = await this.collection.repository.find({ - order: [this.collection.model.primaryKeyAttribute], - transaction, - }); - - for (const record of records) { - const scope = record.toJSON(); - const result = this.calculate(expression, scope); - await record.update( - { - [name]: result, - }, - { - transaction, - silent: true, - hooks: false, - }, - ); - } - } - }; - - bind() { - super.bind(); - this.on('afterSync', this.initFieldData); - // TODO: should not depends on fields table (which is defined by other plugin) - this.database.on('fields.afterUpdate', this.updateFieldData); - this.on('beforeSave', this.calculateField); - } - - unbind() { - super.unbind(); - this.off('beforeSave', this.calculateField); - // TODO: should not depends on fields table - this.database.off('fields.afterUpdate', this.updateFieldData); - this.off('afterSync', this.initFieldData); - } -} - -export interface MathFormulaFieldOptions extends BaseFieldOptions { - type: 'mathFormula'; - expression: string; -} diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/migrations/20230110103214-alert-field.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/server/migrations/20230110103214-alert-field.ts deleted file mode 100644 index 418067c70..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/migrations/20230110103214-alert-field.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Migration } from '@nocobase/server'; - -export default class extends Migration { - async up() { - const result = await this.app.version.satisfies('<=0.8.3-alpha.1'); - if (!result) { - return; - } - const Field = this.context.db.getRepository('fields'); - const fields = await Field.find(); - await this.context.db.sequelize.transaction(async (transaction) => { - for (const field of fields) { - if (field.get('type') === 'formula') { - field.set('type', 'mathFormula'); - field.set('interface', 'mathFormula'); - await field.save({ transaction }); - const schema = await field.getUiSchema({ transaction }); - schema.set('x-component', 'MathFormula.Result'); - await schema.save({ transaction }); - } - } - }); - } -} diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/plugin.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/server/plugin.ts deleted file mode 100644 index 47ce0fbe7..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/server/plugin.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { InstallOptions, Plugin } from '@nocobase/server'; -import { resolve } from 'path'; -import { MathFormulaField } from './math-formula-field'; - -export class MathFormulaFieldPlugin extends Plugin { - afterAdd() {} - - beforeLoad() { - this.db.registerFieldTypes({ - formula: MathFormulaField, - mathFormula: MathFormulaField, - }); - - this.db.addMigrations({ - namespace: this.name, - directory: resolve(__dirname, './migrations'), - context: { - plugin: this, - }, - }); - } - - async load() {} - - async install(options?: InstallOptions) {} - - async afterEnable() {} - - async afterDisable() {} - - async remove() {} -} - -export default MathFormulaFieldPlugin; diff --git a/packages/plugins/@nocobase/plugin-math-formula-field/src/utils/evaluate.ts b/packages/plugins/@nocobase/plugin-math-formula-field/src/utils/evaluate.ts deleted file mode 100644 index 71c0eee14..000000000 --- a/packages/plugins/@nocobase/plugin-math-formula-field/src/utils/evaluate.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as math from 'mathjs'; - -export function evaluate(exp: string, scope = {}) { - const expression = exp.replace(/{{([^}]+)}}/g, (_, i) => { - return scope[i.trim()] || ''; - }); - return math.evaluate(expression, scope); -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42a97353e..61e8c3b6f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -590,12 +590,6 @@ importers: axios-mock-adapter: specifier: ^1.20.0 version: 1.22.0(axios@1.6.7) - dumi: - specifier: ^2.2.0 - version: 2.2.16(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(stylelint@14.16.1)(typescript@4.9.5)(webpack@5.91.0) - dumi-theme-nocobase: - specifier: ^0.2.19 - version: 0.2.21(@babel/core@7.22.10)(@types/react@18.2.75)(dumi@2.2.16)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) packages/core/create-nocobase-app: dependencies: @@ -4762,12 +4756,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@ant-design/colors@6.0.0: - resolution: {integrity: sha512-qAZRvPzfdWHtfameEGP2Qvuf838NhergR35o+EuVyB5XvSA98xod5r4utvi4TJ3ywmevm290g9nsCG5MryrdWQ==} - dependencies: - '@ctrl/tinycolor': 3.6.1 - dev: true - /@ant-design/colors@7.0.2: resolution: {integrity: sha512-7KJkhTiPiLHSu+LmMJnehfJ6242OCxSlR3xHVBecYxnMW8MS/878NXct1GqYARyL59fyeFdKRxXTfvR9SnDgJg==} dependencies: @@ -4821,10 +4809,6 @@ packages: react-dom: 18.2.0(react@18.2.0) stylis: 4.3.1 - /@ant-design/icons-svg@4.3.1: - resolution: {integrity: sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==} - dev: true - /@ant-design/icons-svg@4.4.2: resolution: {integrity: sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==} @@ -9131,74 +9115,6 @@ packages: resolution: {integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==} dev: true - /@formatjs/ecma402-abstract@1.18.0: - resolution: {integrity: sha512-PEVLoa3zBevWSCZzPIM/lvPCi8P5l4G+NXQMc/CjEiaCWgyHieUoo0nM7Bs0n/NbuQ6JpXEolivQ9pKSBHaDlA==} - dependencies: - '@formatjs/intl-localematcher': 0.5.2 - tslib: 2.6.2 - dev: true - - /@formatjs/fast-memoize@2.2.0: - resolution: {integrity: sha512-hnk/nY8FyrL5YxwP9e4r9dqeM6cAbo8PeU9UjyXojZMNvVad2Z06FAVHyR3Ecw6fza+0GH7vdJgiKIVXTMbSBA==} - dependencies: - tslib: 2.6.2 - dev: true - - /@formatjs/icu-messageformat-parser@2.7.3: - resolution: {integrity: sha512-X/jy10V9S/vW+qlplqhMUxR8wErQ0mmIYSq4mrjpjDl9mbuGcCILcI1SUYkL5nlM4PJqpc0KOS0bFkkJNPxYRw==} - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/icu-skeleton-parser': 1.7.0 - tslib: 2.6.2 - dev: true - - /@formatjs/icu-skeleton-parser@1.7.0: - resolution: {integrity: sha512-Cfdo/fgbZzpN/jlN/ptQVe0lRHora+8ezrEeg2RfrNjyp+YStwBy7cqDY8k5/z2LzXg6O0AdzAV91XS0zIWv+A==} - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - tslib: 2.6.2 - dev: true - - /@formatjs/intl-displaynames@6.6.4: - resolution: {integrity: sha512-ET8KQ+L9Q0K8x1SnJQa4DNssUcbATlMopWqYvGGR8yAvw5qwAQc1fv+DshCoZNIE9pbcue0IGC4kWNAkWqlFag==} - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/intl-localematcher': 0.5.2 - tslib: 2.6.2 - dev: true - - /@formatjs/intl-listformat@7.5.3: - resolution: {integrity: sha512-l7EOr0Yh1m8KagytukB90yw81uyzrM7amKFrgxXqphz4KeSIL0KPa68lPsdtZ+JmQB73GaDQRwLOwUKFZ1VZPQ==} - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/intl-localematcher': 0.5.2 - tslib: 2.6.2 - dev: true - - /@formatjs/intl-localematcher@0.5.2: - resolution: {integrity: sha512-txaaE2fiBMagLrR4jYhxzFO6wEdEG4TPMqrzBAcbr4HFUYzH/YC+lg6OIzKCHm8WgDdyQevxbAAV1OgcXctuGw==} - dependencies: - tslib: 2.6.2 - dev: true - - /@formatjs/intl@2.9.9(typescript@4.9.5): - resolution: {integrity: sha512-JI3CNgL2Zdg5lv9ncT2sYKqbAj2RGrCbdzaCckIxMPxn4QuHuOVvYUGmBAXVusBmfG/0sxLmMrnwnBioz+QKdA==} - peerDependencies: - typescript: '5' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/fast-memoize': 2.2.0 - '@formatjs/icu-messageformat-parser': 2.7.3 - '@formatjs/intl-displaynames': 6.6.4 - '@formatjs/intl-listformat': 7.5.3 - intl-messageformat: 10.5.8 - tslib: 2.6.2 - typescript: 4.9.5 - dev: true - /@formily/antd-v5@1.1.9(@types/react-dom@18.2.24)(@types/react@18.2.75)(antd@5.16.1)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(typescript@4.9.5): resolution: {integrity: sha512-Gw0wx6zERLJS8GvmTizV6UPNyxNrg2svbV1Dr38jwsw+dkEef7ZANNERfEpsl2TvCEDl4W3QVFNPws5woLGl8g==} engines: {npm: '>=3.0.0'} @@ -9636,15 +9552,6 @@ packages: react: 18.2.0 react-is: 16.13.1 - /@makotot/ghostui@2.0.0(react@18.2.0): - resolution: {integrity: sha512-LD6OeMv+yGjpYZNjh34yDTCIE1NegqOtJq5gm4wX6op3QL7K5psTVzMjkWzseBoYj0XOD4g+UJVIZTprfoOPGg==} - engines: {node: '>=10'} - peerDependencies: - react: '>=16' - dependencies: - react: 18.2.0 - dev: true - /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: @@ -10452,6 +10359,7 @@ packages: rc-util: 5.38.1(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: false /@rc-component/trigger@2.1.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-24BQg0M34hUDSFofZ8qpTdMXwbykXIl7svFi3OaZwYiz3HDpmv0pOJs0p3zV6hl7q4QuJypmsDQNs2ADqRu7Bw==} @@ -10656,114 +10564,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /@reactflow/background@11.3.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-06FPlSUOOMALEEs+2PqPAbpqmL7WDjrkbG2UsDr2d6mbcDDhHiV4tu9FYoz44SQvXo7ma9VRotlsaR4OiRcYsg==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - classcat: 5.0.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - - /@reactflow/controls@11.2.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-4QHT92/ACVlZkvV+Hq44bAPV8WbMhkJl+/J0EbXcqQ1+an7cWJsF84eeelJw7R5J76RoaSSpKdsWsL2v7HAVlw==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - classcat: 5.0.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - - /@reactflow/core@11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-GIh3usY1W3eVobx//OO9+Cwm+5evQBBdPGxDaeXwm25UqPMWRI240nXQA5F/5gL5Mwpf0DUC7DR2EmrKNQy+Rw==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@types/d3': 7.4.3 - '@types/d3-drag': 3.0.7 - '@types/d3-selection': 3.0.10 - '@types/d3-zoom': 3.0.8 - classcat: 5.0.4 - d3-drag: 3.0.0 - d3-selection: 3.0.0 - d3-zoom: 3.0.0 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - - /@reactflow/minimap@11.7.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-kJEtyeQkTZYViLGebVWHVUJROMAGcvejvT+iX4DqKnFb5yK8E8LWlXQpRx2FrL9gDy80mJJaciy7IxnnQKE1bg==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@types/d3-selection': 3.0.10 - '@types/d3-zoom': 3.0.8 - classcat: 5.0.4 - d3-selection: 3.0.0 - d3-zoom: 3.0.0 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - - /@reactflow/node-resizer@2.2.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-1Xb6q97uP7hRBLpog9sRCNfnsHdDgFRGEiU+lQqGgPEAeYwl4nRjWa/sXwH6ajniKxBhGEvrdzOgEFn6CRMcpQ==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - classcat: 5.0.4 - d3-drag: 3.0.0 - d3-selection: 3.0.0 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - - /@reactflow/node-toolbar@1.3.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-JXDEuZ0wKjZ8z7qK2bIst0eZPzNyVEsiHL0e93EyuqT4fA9icoyE0fLq2ryNOOp7MXgId1h7LusnH6ta45F0yQ==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - classcat: 5.0.4 - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - zustand: 4.4.7(@types/react@18.2.75)(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - /@redis/bloom@1.2.0(@redis/client@1.5.14): resolution: {integrity: sha512-HG2DFjYKbpNmVXsa0keLHp/3leGJz1mjh09f2RLGGLQZzSHpkmZWuwJbAvo3QcRY8p80m5+ZdXZdYOSBLlp7Cg==} peerDependencies: @@ -11124,13 +10924,6 @@ packages: string-argv: 0.3.2 dev: false - /@selderee/plugin-htmlparser2@0.11.0: - resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} - dependencies: - domhandler: 5.0.3 - selderee: 0.11.0 - dev: true - /@sinclair/typebox@0.27.8: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} @@ -11139,10 +10932,6 @@ packages: engines: {node: '>=6'} dev: false - /@sketch-hq/sketch-file-format-ts@6.5.0: - resolution: {integrity: sha512-shaGl4ttFDpHjYBoMaZpciOtsi/lKvJ3VfcBYk6+PjjbFs6H5GxPAyhbiSqy3Vmx30aos284pd88QzD3rE6iag==} - dev: true - /@smithy/abort-controller@2.0.15: resolution: {integrity: sha512-JkS36PIS3/UCbq/MaozzV7jECeL+BTt4R75bwY8i+4RASys4xOyUS1HsRyUNSqUXFP4QyCz5aNnh3ltuaxv+pw==} engines: {node: '>=14.0.0'} @@ -11595,10 +11384,6 @@ packages: tslib: 2.6.2 dev: true - /@stackblitz/sdk@1.9.0: - resolution: {integrity: sha512-3m6C7f8pnR5KXys/Hqx2x6ylnpqOak6HtnZI6T5keEO0yT+E4Spkw37VEbdwuC+2oxmjdgq6YZEgiKX7hM1GmQ==} - dev: true - /@stylelint/postcss-css-in-js@0.38.0(postcss-syntax@0.36.2)(postcss@8.4.38): resolution: {integrity: sha512-XOz5CAe49kS95p5yRd+DAIWDojTjfmyAQ4bbDlXMdbZTQ5t0ThjSLvWI6JI2uiS7MFurVBkZ6zUqcimzcLTBoQ==} deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. @@ -11736,122 +11521,6 @@ packages: deepmerge: 4.3.1 svgo: 2.8.0 - /@swc/core-darwin-arm64@1.3.72: - resolution: {integrity: sha512-oNSI5hVfZ+1xpj+dH1g4kQqA0VsGtqd8S9S+cDqkHZiOOVOevw9KN6dzVtmLOcPtlULVypVc0TVvsB55KdVZhQ==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-darwin-x64@1.3.72: - resolution: {integrity: sha512-y5O/WQ1g0/VfTgeNahWIOutbdD5U2Gi703jaefdcoJo3FUx8WU108QQdbVGwGMgaqapo3iQB6Qs9paixYQAYsA==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm-gnueabihf@1.3.72: - resolution: {integrity: sha512-05JdWcso0OomHF+7bk5MBDgI8MZ9skcQ/4nhSv5gboSgSiuBmKM15Bg3lZ5iAUwGByNj7pGkSmmd3YwTrXEB+g==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-gnu@1.3.72: - resolution: {integrity: sha512-8qRELJaeYshhJgqvyOeXCKqBOpai+JYdWuouMbvvDUL85j3OcZhzR+bipexEbbJKcOCdRnoYB7Qg6mjqZ0t7VA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-arm64-musl@1.3.72: - resolution: {integrity: sha512-tOqAGZw+Pe7YrBHFrwFVyRiKqjgjzwYbJmY+UDxLrzWrZSVtC3eO2TPrp7kWmhirg40Og81BbdfRAl8ds48w0Q==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - libc: [musl] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-gnu@1.3.72: - resolution: {integrity: sha512-U2W2xWR3s9nplGVWz376GiBlcLTgxyYKlpZPBNZk0w3OvTcjKC62gW1Pe7PUkk4NgJUnaQDBa/mb4V4Zl+GZPA==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - libc: [glibc] - requiresBuild: true - dev: true - optional: true - - /@swc/core-linux-x64-musl@1.3.72: - resolution: {integrity: sha512-3+2dUiZBsifKgvnFEHWdysXjInK8K+BfPBw2tTZJmq1+fZLt0rvuErYDVMLfIJnVWLCcJMnDtTXrvkFV1y/6iA==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - libc: [musl] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-arm64-msvc@1.3.72: - resolution: {integrity: sha512-ndI8xZ2AId806D25xgqw2SFJ9gc/jhg21+5hA8XPq9ZL+oDiaYDztaP3ijVmZ1G5xXKD9DpgB7xmylv/f6o6GA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-ia32-msvc@1.3.72: - resolution: {integrity: sha512-F3TK8JHP3SRFjLRlzcRVZPnvvGm2CQ5/cwbIkaEq0Dla3kyctU8SiRqvtYwWCW4JuY10cUygIg93Ec/C9Lkk4g==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core-win32-x64-msvc@1.3.72: - resolution: {integrity: sha512-FXMnIUtLl0yEmGkw+xbUg/uUPExvUxUlLSHbX7CnbSuOIHqMHzvEd9skIueLAst4bvmJ8kT1hDyAIWQcTIAJYQ==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@swc/core@1.3.72: - resolution: {integrity: sha512-+AKjwLH3/STfPrd7CHzB9+NG1FVT0UKJMUChuWq9sQ8b9xlV8vUeRgZXgh/EHYvNQgl/OUTQKtL6xU2yOLuEuA==} - engines: {node: '>=10'} - requiresBuild: true - peerDependencies: - '@swc/helpers': ^0.5.0 - peerDependenciesMeta: - '@swc/helpers': - optional: true - optionalDependencies: - '@swc/core-darwin-arm64': 1.3.72 - '@swc/core-darwin-x64': 1.3.72 - '@swc/core-linux-arm-gnueabihf': 1.3.72 - '@swc/core-linux-arm64-gnu': 1.3.72 - '@swc/core-linux-arm64-musl': 1.3.72 - '@swc/core-linux-x64-gnu': 1.3.72 - '@swc/core-linux-x64-musl': 1.3.72 - '@swc/core-win32-arm64-msvc': 1.3.72 - '@swc/core-win32-ia32-msvc': 1.3.72 - '@swc/core-win32-x64-msvc': 1.3.72 - dev: true - /@swc/helpers@0.4.14: resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} dependencies: @@ -12077,189 +11746,10 @@ packages: '@types/node': 20.12.7 dev: true - /@types/d3-array@3.2.1: - resolution: {integrity: sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==} - dev: true - - /@types/d3-axis@3.0.6: - resolution: {integrity: sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw==} - dependencies: - '@types/d3-selection': 3.0.10 - dev: true - - /@types/d3-brush@3.0.6: - resolution: {integrity: sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A==} - dependencies: - '@types/d3-selection': 3.0.10 - dev: true - - /@types/d3-chord@3.0.6: - resolution: {integrity: sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg==} - dev: true - - /@types/d3-color@3.1.3: - resolution: {integrity: sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==} - dev: true - - /@types/d3-contour@3.0.6: - resolution: {integrity: sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg==} - dependencies: - '@types/d3-array': 3.2.1 - '@types/geojson': 7946.0.13 - dev: true - - /@types/d3-delaunay@6.0.4: - resolution: {integrity: sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw==} - dev: true - - /@types/d3-dispatch@3.0.6: - resolution: {integrity: sha512-4fvZhzMeeuBJYZXRXrRIQnvUYfyXwYmLsdiN7XXmVNQKKw1cM8a5WdID0g1hVFZDqT9ZqZEY5pD44p24VS7iZQ==} - dev: true - - /@types/d3-drag@3.0.7: - resolution: {integrity: sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ==} - dependencies: - '@types/d3-selection': 3.0.10 - dev: true - - /@types/d3-dsv@3.0.7: - resolution: {integrity: sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g==} - dev: true - - /@types/d3-ease@3.0.2: - resolution: {integrity: sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==} - dev: true - - /@types/d3-fetch@3.0.7: - resolution: {integrity: sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA==} - dependencies: - '@types/d3-dsv': 3.0.7 - dev: true - - /@types/d3-force@3.0.9: - resolution: {integrity: sha512-IKtvyFdb4Q0LWna6ymywQsEYjK/94SGhPrMfEr1TIc5OBeziTi+1jcCvttts8e0UWZIxpasjnQk9MNk/3iS+kA==} - dev: true - - /@types/d3-format@3.0.4: - resolution: {integrity: sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g==} - dev: true - - /@types/d3-geo@3.1.0: - resolution: {integrity: sha512-856sckF0oP/diXtS4jNsiQw/UuK5fQG8l/a9VVLeSouf1/PPbBE1i1W852zVwKwYCBkFJJB7nCFTbk6UMEXBOQ==} - dependencies: - '@types/geojson': 7946.0.13 - dev: true - - /@types/d3-hierarchy@3.1.6: - resolution: {integrity: sha512-qlmD/8aMk5xGorUvTUWHCiumvgaUXYldYjNVOWtYoTYY/L+WwIEAmJxUmTgr9LoGNG0PPAOmqMDJVDPc7DOpPw==} - dev: true - - /@types/d3-interpolate@3.0.4: - resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==} - dependencies: - '@types/d3-color': 3.1.3 - dev: true - - /@types/d3-path@3.0.2: - resolution: {integrity: sha512-WAIEVlOCdd/NKRYTsqCpOMHQHemKBEINf8YXMYOtXH0GA7SY0dqMB78P3Uhgfy+4X+/Mlw2wDtlETkN6kQUCMA==} - dev: true - - /@types/d3-polygon@3.0.2: - resolution: {integrity: sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA==} - dev: true - - /@types/d3-quadtree@3.0.6: - resolution: {integrity: sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg==} - dev: true - - /@types/d3-random@3.0.3: - resolution: {integrity: sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==} - dev: true - - /@types/d3-scale-chromatic@3.0.3: - resolution: {integrity: sha512-laXM4+1o5ImZv3RpFAsTRn3TEkzqkytiOY0Dz0sq5cnd1dtNlk6sHLon4OvqaiJb28T0S/TdsBI3Sjsy+keJrw==} - dev: true - - /@types/d3-scale@4.0.8: - resolution: {integrity: sha512-gkK1VVTr5iNiYJ7vWDI+yUFFlszhNMtVeneJ6lUTKPjprsvLLI9/tgEGiXJOnlINJA8FyA88gfnQsHbybVZrYQ==} - dependencies: - '@types/d3-time': 3.0.3 - dev: true - - /@types/d3-selection@3.0.10: - resolution: {integrity: sha512-cuHoUgS/V3hLdjJOLTT691+G2QoqAjCVLmr4kJXR4ha56w1Zdu8UUQ5TxLRqudgNjwXeQxKMq4j+lyf9sWuslg==} - dev: true - - /@types/d3-shape@3.1.6: - resolution: {integrity: sha512-5KKk5aKGu2I+O6SONMYSNflgiP0WfZIQvVUMan50wHsLG1G94JlxEVnCpQARfTtzytuY0p/9PXXZb3I7giofIA==} - dependencies: - '@types/d3-path': 3.0.2 - dev: true - - /@types/d3-time-format@4.0.3: - resolution: {integrity: sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==} - dev: true - - /@types/d3-time@3.0.3: - resolution: {integrity: sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==} - dev: true - /@types/d3-timer@2.0.3: resolution: {integrity: sha512-jhAJzaanK5LqyLQ50jJNIrB8fjL9gwWZTgYjevPvkDLMU+kTAZkYsobI59nYoeSrH1PucuyJEi247Pb90t6XUg==} dev: false - /@types/d3-timer@3.0.2: - resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} - dev: true - - /@types/d3-transition@3.0.8: - resolution: {integrity: sha512-ew63aJfQ/ms7QQ4X7pk5NxQ9fZH/z+i24ZfJ6tJSfqxJMrYLiK01EAs2/Rtw/JreGUsS3pLPNV644qXFGnoZNQ==} - dependencies: - '@types/d3-selection': 3.0.10 - dev: true - - /@types/d3-zoom@3.0.8: - resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==} - dependencies: - '@types/d3-interpolate': 3.0.4 - '@types/d3-selection': 3.0.10 - dev: true - - /@types/d3@7.4.3: - resolution: {integrity: sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==} - dependencies: - '@types/d3-array': 3.2.1 - '@types/d3-axis': 3.0.6 - '@types/d3-brush': 3.0.6 - '@types/d3-chord': 3.0.6 - '@types/d3-color': 3.1.3 - '@types/d3-contour': 3.0.6 - '@types/d3-delaunay': 6.0.4 - '@types/d3-dispatch': 3.0.6 - '@types/d3-drag': 3.0.7 - '@types/d3-dsv': 3.0.7 - '@types/d3-ease': 3.0.2 - '@types/d3-fetch': 3.0.7 - '@types/d3-force': 3.0.9 - '@types/d3-format': 3.0.4 - '@types/d3-geo': 3.1.0 - '@types/d3-hierarchy': 3.1.6 - '@types/d3-interpolate': 3.0.4 - '@types/d3-path': 3.0.2 - '@types/d3-polygon': 3.0.2 - '@types/d3-quadtree': 3.0.6 - '@types/d3-random': 3.0.3 - '@types/d3-scale': 4.0.8 - '@types/d3-scale-chromatic': 3.0.3 - '@types/d3-selection': 3.0.10 - '@types/d3-shape': 3.1.6 - '@types/d3-time': 3.0.3 - '@types/d3-time-format': 4.0.3 - '@types/d3-timer': 3.0.2 - '@types/d3-transition': 3.0.8 - '@types/d3-zoom': 3.0.8 - dev: true - /@types/date-arithmetic@4.1.4: resolution: {integrity: sha512-p9eZ2X9B80iKiTW4ukVj8B4K6q9/+xFtQ5MGYA5HWToY9nL4EkhV9+6ftT2VHpVMEZb5Tv00Iel516bVdO+yRw==} dev: true @@ -12291,12 +11781,6 @@ packages: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 - /@types/estree-jsx@1.0.3: - resolution: {integrity: sha512-pvQ+TKeRHeiUGRhvYwRrQ/ISnohKkSJR14fT2yqyZ4e9K5vqc7hrtY2Y1Dw0ZwAzQ6DQsxsaCUuSIIi8v0Cq6w==} - dependencies: - '@types/estree': 1.0.5 - dev: true - /@types/estree@1.0.5: resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} @@ -12320,13 +11804,6 @@ packages: '@types/qs': 6.9.10 '@types/serve-static': 1.15.5 - /@types/fs-extra@11.0.1: - resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} - dependencies: - '@types/jsonfile': 6.1.4 - '@types/node': 20.12.7 - dev: true - /@types/fs-extra@11.0.4: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: @@ -12336,6 +11813,7 @@ packages: /@types/geojson@7946.0.13: resolution: {integrity: sha512-bmrNrgKMOhM3WsafmbGmC+6dsF2Z308vLFsQ3a/bT8X8Sv5clVYpPars/UPq+sAaJP+5OoLAYgwbkS5QEJdLUQ==} + dev: false /@types/glob-stream@8.0.2: resolution: {integrity: sha512-kyuRfGE+yiSJWzSO3t74rXxdZNdYfLcllO0IUha4eX1fl40pm9L02Q/TEc3mykTLjoWz4STBNwYnUWdFu3I0DA==} @@ -12373,12 +11851,6 @@ packages: /@types/hapi__joi@17.1.9: resolution: {integrity: sha512-oOMFT8vmCTFncsF1engrs04jatz8/Anwx3De9uxnOK4chgSEgWBvFtpSoJo8u3784JNO+ql5tzRR6phHoRnscQ==} - /@types/hast@2.3.8: - resolution: {integrity: sha512-aMIqAlFd2wTIDZuvLbhUT+TGvMxrNC8ECUIVtH6xxy0sQLs3iu6NO8Kp/VT5je7i5ufnebXzdV1dNDMnvaH6IQ==} - dependencies: - '@types/unist': 2.0.10 - dev: true - /@types/hoist-non-react-statics@3.3.5: resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==} dependencies: @@ -12431,6 +11903,7 @@ packages: resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} dependencies: '@types/node': 20.12.7 + dev: false /@types/jsonwebtoken@8.5.9: resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==} @@ -12444,6 +11917,7 @@ packages: resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==} dependencies: '@types/node': 20.12.7 + dev: false /@types/koa-bodyparser@4.3.12: resolution: {integrity: sha512-hKMmRMVP889gPIdLZmmtou/BijaU1tHPyMNmcK7FAHAdATnRcGQQy78EqTTxLH1D4FTsrxIzklAQCso9oGoebQ==} @@ -12515,6 +11989,7 @@ packages: resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} dependencies: '@types/unist': 2.0.10 + dev: false /@types/mdurl@1.0.5: resolution: {integrity: sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==} @@ -12570,10 +12045,6 @@ packages: /@types/parse-json@4.0.2: resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} - /@types/parse5@6.0.3: - resolution: {integrity: sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g==} - dev: true - /@types/passport@1.0.16: resolution: {integrity: sha512-FD0qD5hbPWQzaM0wHUnJ/T0BBCJBxCeemtnCwc/ThhTg3x9jfrAcRUmj5Dopza+MfFS9acTe3wk7rcVnRIp/0A==} dependencies: @@ -12591,10 +12062,6 @@ packages: /@types/prop-types@15.7.12: resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} - /@types/q@1.5.8: - resolution: {integrity: sha512-hroOstUScF6zhIi+5+x0dzqrHA1EJi+Irri6b1fxolMTqqHIV/Cg77EtnQcZqZCu8hR3mX2BzIxN4/GzI68Kfw==} - dev: true - /@types/qs@6.9.10: resolution: {integrity: sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==} @@ -12604,12 +12071,6 @@ packages: parchment: 1.1.4 dev: false - /@types/ramda@0.29.3: - resolution: {integrity: sha512-Yh/RHkjN0ru6LVhSQtTkCRo6HXkfL9trot/2elzM/yXLJmbLm2v6kJc8yftTnwv1zvUob6TEtqI2cYjdqG3U0Q==} - dependencies: - types-ramda: 0.29.6 - dev: true - /@types/range-parser@1.2.7: resolution: {integrity: sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==} @@ -12654,12 +12115,7 @@ packages: resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} dependencies: '@types/node': 20.12.7 - - /@types/sax@1.2.7: - resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} - dependencies: - '@types/node': 20.12.7 - dev: true + dev: false /@types/semver@7.5.6: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} @@ -12762,6 +12218,7 @@ packages: /@types/unist@2.0.10: resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} + dev: false /@types/validator@13.11.7: resolution: {integrity: sha512-q0JomTsJ2I5Mv7dhHhQLGjMvX0JJm5dyZ1DXQySIUzU1UlwzB8bt+R6+LODUbz0UDIOvEzGc28tk27gBJw2N8Q==} @@ -12828,34 +12285,6 @@ packages: dependencies: '@types/yargs-parser': 21.0.3 - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0)(typescript@4.9.5): - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.55.0 - graphemer: 1.4.0 - ignore: 5.3.1 - natural-compare-lite: 1.4.0 - semver: 7.6.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0)(typescript@5.4.4): resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -12941,26 +12370,6 @@ packages: - supports-color dev: false - /@typescript-eslint/parser@5.62.0(eslint@8.55.0)(typescript@4.9.5): - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.55.0 - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/parser@5.62.0(eslint@8.55.0)(typescript@5.4.4): resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -13037,26 +12446,6 @@ packages: '@typescript-eslint/visitor-keys': 6.14.0 dev: false - /@typescript-eslint/type-utils@5.62.0(eslint@8.55.0)(typescript@4.9.5): - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - debug: 4.3.4(supports-color@5.5.0) - eslint: 8.55.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/type-utils@5.62.0(eslint@8.55.0)(typescript@5.4.4): resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -13126,27 +12515,6 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: false - /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4(supports-color@5.5.0) - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.6.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.4): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -13210,26 +12578,6 @@ packages: - supports-color dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@4.9.5): - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.55.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - eslint: 8.55.0 - eslint-scope: 5.1.1 - semver: 7.6.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /@typescript-eslint/utils@5.62.0(eslint@8.55.0)(typescript@5.4.4): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -13335,18 +12683,6 @@ packages: transitivePeerDependencies: - supports-color - /@umijs/bundler-utils@4.0.89: - resolution: {integrity: sha512-/nKdEj0ku9MX5RYYLzDObuvDBb1sd89XD2Opldk7kgLbLw1iePksrWtP8gR5X2UGjqtEZYvcfrYFt0jV0LCcQg==} - dependencies: - '@umijs/utils': 4.0.89 - esbuild: 0.17.19 - regenerate: 1.4.2 - regenerate-unicode-properties: 10.1.1 - spdy: 4.0.2 - transitivePeerDependencies: - - supports-color - dev: true - /@umijs/bundler-utils@4.1.8: resolution: {integrity: sha512-SsbMgN8HzRvS2MqgqbpSnQpAdSYjl12wDznxlO8hiQJJ3sZm7pD4xLIHVIe1H452KsT3ilIDgyBaQ0U+sI8r0g==} dependencies: @@ -13384,7 +12720,7 @@ packages: - terser dev: false - /@umijs/bundler-vite@4.1.8(@types/node@20.12.7)(postcss@8.4.38)(sass@1.69.5): + /@umijs/bundler-vite@4.1.8(@types/node@20.12.7)(postcss@8.4.38): resolution: {integrity: sha512-uZEIlyh5aTtkbdbr2Gbv3C9NC4VMYOG3bsLNKjBzNbnUC4IMkpfcqpP/OZPzDySpvKCpHXkcOAo3x1U3G5zTng==} hasBin: true dependencies: @@ -13397,7 +12733,7 @@ packages: postcss-preset-env: 7.5.0(postcss@8.4.38) rollup-plugin-visualizer: 5.9.0 systemjs: 6.14.3 - vite: 4.5.2(@types/node@20.12.7)(less@4.1.3)(sass@1.69.5) + vite: 4.5.2(@types/node@20.12.7)(less@4.1.3) transitivePeerDependencies: - '@types/node' - lightningcss @@ -13410,43 +12746,6 @@ packages: - terser dev: true - /@umijs/bundler-webpack@4.1.8(typescript@4.9.5)(webpack@5.91.0): - resolution: {integrity: sha512-6yNmwTkgTd/A0vr5D3mMcTTXgDMxiwXQiTTBea6xrJgXfYYX0B7JftJQunITd75nvdToiDUwaIKFqUK1zxBDMw==} - hasBin: true - dependencies: - '@svgr/core': 6.5.1 - '@svgr/plugin-jsx': 6.5.1(@svgr/core@6.5.1) - '@svgr/plugin-svgo': 6.5.1(@svgr/core@6.5.1) - '@types/hapi__joi': 17.1.9 - '@umijs/babel-preset-umi': 4.1.8 - '@umijs/bundler-utils': 4.1.8 - '@umijs/case-sensitive-paths-webpack-plugin': 1.0.1 - '@umijs/mfsu': 4.1.8 - '@umijs/react-refresh-webpack-plugin': 0.5.11(react-refresh@0.14.0)(webpack@5.91.0) - '@umijs/utils': 4.1.8 - cors: 2.8.5 - css-loader: 6.7.1(webpack@5.91.0) - es5-imcompatible-versions: 0.1.89 - fork-ts-checker-webpack-plugin: 8.0.0(typescript@4.9.5)(webpack@5.91.0) - jest-worker: 29.4.3 - lightningcss: 1.22.1 - node-libs-browser: 2.2.1 - postcss: 8.4.38 - postcss-preset-env: 7.5.0(postcss@8.4.38) - react-error-overlay: 6.0.9 - react-refresh: 0.14.0 - transitivePeerDependencies: - - '@types/webpack' - - sockjs-client - - supports-color - - type-fest - - typescript - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - /@umijs/bundler-webpack@4.1.8(typescript@5.4.4)(webpack@5.91.0): resolution: {integrity: sha512-6yNmwTkgTd/A0vr5D3mMcTTXgDMxiwXQiTTBea6xrJgXfYYX0B7JftJQunITd75nvdToiDUwaIKFqUK1zxBDMw==} hasBin: true @@ -13524,15 +12823,6 @@ packages: /@umijs/case-sensitive-paths-webpack-plugin@1.0.1: resolution: {integrity: sha512-kDKJ8yTarxwxGJDInG33hOpaQRZ//XpNuuznQ/1Mscypw6kappzFmrBr2dOYave++K7JHouoANF354UpbEQw0Q==} - /@umijs/core@4.0.89: - resolution: {integrity: sha512-S6K2Y8h6DyRoPP0EVrYgDs3iO7B2hHcd9QN+n6v0JHzhkHMVvsPnGlPx66yAptACBlBirR/ICIm0Pr1CrDADbg==} - dependencies: - '@umijs/bundler-utils': 4.0.89 - '@umijs/utils': 4.0.89 - transitivePeerDependencies: - - supports-color - dev: true - /@umijs/core@4.1.8: resolution: {integrity: sha512-c9jiLju4juc+3t60E38eZVh55eA/X240/JH0xxW/vOT4euFBfrq8U7J/66NRaKumdZ03wq2nX12mg4LtB9W8kQ==} dependencies: @@ -13651,34 +12941,6 @@ packages: '@babel/runtime': 7.23.6 query-string: 6.14.1 - /@umijs/lint@4.1.8(eslint@8.55.0)(stylelint@14.16.1)(typescript@4.9.5): - resolution: {integrity: sha512-IyTznUmlVTs4ReERK0leXSnK/PPiNrYNiTe6wIyQ5ltsdcQprRd2So97hzUYo/gHaD3VkOUX8kVlDou/N7Raiw==} - dependencies: - '@babel/core': 7.23.6 - '@babel/eslint-parser': 7.23.3(@babel/core@7.23.6)(eslint@8.55.0) - '@stylelint/postcss-css-in-js': 0.38.0(postcss-syntax@0.36.2)(postcss@8.4.38) - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0)(typescript@4.9.5) - '@typescript-eslint/parser': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - '@umijs/babel-preset-umi': 4.1.8 - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.55.0)(typescript@4.9.5) - eslint-plugin-react: 7.33.2(eslint@8.55.0) - eslint-plugin-react-hooks: 4.6.0(eslint@8.55.0) - postcss: 8.4.38 - postcss-syntax: 0.36.2(postcss@8.4.38) - stylelint-config-standard: 25.0.0(stylelint@14.16.1) - transitivePeerDependencies: - - eslint - - jest - - postcss-html - - postcss-jsx - - postcss-less - - postcss-markdown - - postcss-scss - - stylelint - - supports-color - - typescript - dev: true - /@umijs/lint@4.1.8(eslint@8.55.0)(stylelint@14.16.1)(typescript@5.4.4): resolution: {integrity: sha512-IyTznUmlVTs4ReERK0leXSnK/PPiNrYNiTe6wIyQ5ltsdcQprRd2So97hzUYo/gHaD3VkOUX8kVlDou/N7Raiw==} dependencies: @@ -13809,64 +13071,6 @@ packages: - webpack-plugin-serve dev: false - /@umijs/preset-umi@4.1.8(@types/node@20.12.7)(@types/react@18.2.75)(sass@1.69.5)(typescript@4.9.5)(webpack@5.91.0): - resolution: {integrity: sha512-YZxHggqsZgl0cYiAifYAv2fVWMOzAyKQx1u00IXDJF5JfS0mcq2lnX2ZTBXXdoG7jYSlqRsqAo+AnR+BWHKu3A==} - dependencies: - '@iconify/utils': 2.1.1 - '@svgr/core': 6.5.1 - '@umijs/ast': 4.1.8 - '@umijs/babel-preset-umi': 4.1.8 - '@umijs/bundler-esbuild': 4.1.8 - '@umijs/bundler-utils': 4.1.8 - '@umijs/bundler-vite': 4.1.8(@types/node@20.12.7)(postcss@8.4.38)(sass@1.69.5) - '@umijs/bundler-webpack': 4.1.8(typescript@4.9.5)(webpack@5.91.0) - '@umijs/core': 4.1.8 - '@umijs/did-you-know': 1.0.3 - '@umijs/es-module-parser': 0.0.7 - '@umijs/history': 5.3.1 - '@umijs/mfsu': 4.1.8 - '@umijs/plugin-run': 4.1.8 - '@umijs/renderer-react': 4.1.8(react-dom@18.1.0)(react@18.1.0) - '@umijs/server': 4.1.8 - '@umijs/ui': 3.0.1 - '@umijs/utils': 4.1.8 - '@umijs/zod2ts': 4.1.8 - babel-plugin-dynamic-import-node: 2.3.3 - click-to-react-component: 1.1.0(@types/react@18.2.75)(react-dom@18.1.0)(react@18.1.0) - core-js: 3.34.0 - current-script-polyfill: 1.0.0 - enhanced-resolve: 5.9.3 - fast-glob: 3.2.12 - html-webpack-plugin: 5.5.0(webpack@5.91.0) - less-plugin-resolve: 1.0.2 - path-to-regexp: 1.7.0 - postcss: 8.4.38 - postcss-prefix-selector: 1.16.0(postcss@8.4.38) - react: 18.1.0 - react-dom: 18.1.0(react@18.1.0) - react-router: 6.3.0(react@18.1.0) - react-router-dom: 6.3.0(react-dom@18.1.0)(react@18.1.0) - regenerator-runtime: 0.13.11 - transitivePeerDependencies: - - '@types/node' - - '@types/react' - - '@types/webpack' - - lightningcss - - rollup - - sass - - sockjs-client - - stylus - - sugarss - - supports-color - - terser - - type-fest - - typescript - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - /@umijs/preset-umi@4.1.8(@types/node@20.12.7)(@types/react@18.2.75)(typescript@5.4.5)(webpack@5.91.0): resolution: {integrity: sha512-YZxHggqsZgl0cYiAifYAv2fVWMOzAyKQx1u00IXDJF5JfS0mcq2lnX2ZTBXXdoG7jYSlqRsqAo+AnR+BWHKu3A==} dependencies: @@ -13876,7 +13080,7 @@ packages: '@umijs/babel-preset-umi': 4.1.8 '@umijs/bundler-esbuild': 4.1.8 '@umijs/bundler-utils': 4.1.8 - '@umijs/bundler-vite': 4.1.8(@types/node@20.12.7)(postcss@8.4.38)(sass@1.69.5) + '@umijs/bundler-vite': 4.1.8(@types/node@20.12.7)(postcss@8.4.38) '@umijs/bundler-webpack': 4.1.8(typescript@5.4.5)(webpack@5.91.0) '@umijs/core': 4.1.8 '@umijs/did-you-know': 1.0.3 @@ -14036,13 +13240,6 @@ packages: '@umijs/deps': 3.5.20 dev: false - /@umijs/utils@4.0.89: - resolution: {integrity: sha512-Gq2yyuhp4m17DfU9VE59MkJGQrnbSsFp9/pfOFhbArV6AWzSo+EUY6UwLPmuQdJbJzVacZlN6N8t6cb794sVNw==} - dependencies: - chokidar: 3.5.3 - pino: 7.11.0 - dev: true - /@umijs/utils@4.1.8: resolution: {integrity: sha512-438dwza66i13H8EYhJuvJcvWGR9Ij5eUSqTaF0XEq+vL8YUCx3cOeYdE/oIrunxDIbNFLmLaG0FtTcEEvK4oeA==} dependencies: @@ -14083,7 +13280,7 @@ packages: '@babel/plugin-transform-react-jsx-self': 7.24.1(@babel/core@7.24.4) '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.4) react-refresh: 0.14.0 - vite: 4.5.2(@types/node@20.12.7)(less@4.1.3)(sass@1.69.5) + vite: 4.5.2(@types/node@20.12.7)(less@4.1.3) transitivePeerDependencies: - supports-color @@ -14336,13 +13533,6 @@ packages: engines: {node: '>=0.8'} dev: true - /agent-base@4.3.0: - resolution: {integrity: sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==} - engines: {node: '>= 4.0.0'} - dependencies: - es6-promisify: 5.0.0 - dev: true - /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -14520,16 +13710,6 @@ packages: resolution: {integrity: sha512-OwIuC4yZaRogHKiuU5WlMR5Xk/jAcpPtawWL05Gj8Lvm2F6mwoJt4O/bHI+DHwG79vWd+8OFYM4/BzYqyRd3qw==} dev: false - /animated-scroll-to@2.3.0: - resolution: {integrity: sha512-PT/5MSKCWQaK2kuOl2HT2KJMuJEvUS4/TgMhWy82c2EmF74/CIkvPBPKOvd8nMYP6Higo7xCn49/iSW9BccMoQ==} - dev: true - - /ansi-align@2.0.0: - resolution: {integrity: sha512-TdlOggdA/zURfMYa7ABC66j+oqfMew58KpJMbUlH3bcZP1b+cBHIHDDn5uH9INsxrHBPjsqM0tDB4jPTF/vgJA==} - dependencies: - string-width: 2.1.1 - dev: true - /ansi-align@3.0.1: resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} dependencies: @@ -14721,35 +13901,6 @@ packages: - react-dom dev: true - /antd-token-previewer@2.0.5(@babel/core@7.22.10)(@types/react@18.2.75)(antd@5.16.1)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-AIxkqI6nd1VJSNsd77tp1UhBQ0K0YdRcWan6E2aG9RTvapZf8hhwcDL/YVJaPaS/4V3iFeOtD2z12BMseemshg==} - peerDependencies: - antd: ^5.5.0 - react: '>=16.0.0' - react-dom: '>=16.0.0' - dependencies: - '@ant-design/colors': 6.0.0 - '@ant-design/cssinjs': 1.19.0(react-dom@18.2.0)(react@18.2.0) - '@ant-design/icons': 5.3.6(react-dom@18.2.0)(react@18.2.0) - '@arvinxu/layout-kit': 1.4.0(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) - '@babel/runtime': 7.24.1 - '@ctrl/tinycolor': 3.6.1 - antd: 5.16.1(react-dom@18.2.0)(react@18.2.0) - classnames: 2.5.1 - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-colorful: 5.6.1(react-dom@18.2.0)(react@18.2.0) - react-dom: 18.2.0(react@18.2.0) - reactflow: 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - use-debouncy: 4.3.1(react@18.2.0) - vanilla-jsoneditor: 0.16.1 - transitivePeerDependencies: - - '@babel/core' - - '@types/react' - - immer - - react-is - dev: true - /antd@5.16.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-XAlLRrgYV+nj9FHnkXEPS6HNcKcluEa8v44e7Cixjlp8aOXRhUI6IfZaKpc2MPGjQ+06rp62/dsxOUNJW9kfLA==} peerDependencies: @@ -14840,10 +13991,6 @@ packages: /append-field@1.0.0: resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} - /aproba@1.2.0: - resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==} - dev: true - /aproba@2.0.0: resolution: {integrity: sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==} @@ -14924,10 +14071,6 @@ packages: /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - /arg@5.0.2: - resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} - dev: true - /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -15100,17 +14243,6 @@ packages: es-abstract: 1.22.3 es-shim-unscopables: 1.0.2 - /array.prototype.reduce@1.0.6: - resolution: {integrity: sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - es-array-method-boxes-properly: 1.0.0 - is-string: 1.0.7 - dev: true - /array.prototype.tosorted@1.1.3: resolution: {integrity: sha512-/DdH4TiTmOKzyQbp/eadcCVexiCb36xJg7HshYOYJnNZFDj33GEv0P7GxsynpShhq4OLYJzbGcBDkLsDt7MnNg==} dependencies: @@ -15205,11 +14337,6 @@ packages: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} - /astring@1.8.6: - resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==} - hasBin: true - dev: true - /async-done@1.3.2: resolution: {integrity: sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==} engines: {node: '>= 0.10'} @@ -15263,6 +14390,7 @@ packages: resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} engines: {node: '>= 4.5.0'} hasBin: true + dev: false /atomic-sleep@1.0.0: resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} @@ -15330,16 +14458,6 @@ packages: is-buffer: 2.0.5 dev: true - /axios@0.18.1: - resolution: {integrity: sha512-0BfJq4NSfQXd+SkFdrvFbG7addhYSBA2mQwISr46pD6E5iqkWg02RAs8vyTT/j0RTnoYmeXauBuSv1qKwR179g==} - deprecated: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410 - dependencies: - follow-redirects: 1.5.10 - is-buffer: 2.0.5 - transitivePeerDependencies: - - supports-color - dev: true - /axios@0.21.4(debug@4.3.4): resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} dependencies: @@ -15514,10 +14632,6 @@ packages: now-and-later: 2.0.1 dev: false - /bail@2.0.2: - resolution: {integrity: sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==} - dev: true - /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -15599,11 +14713,6 @@ packages: chainsaw: 0.1.0 dev: true - /binaryextensions@2.3.0: - resolution: {integrity: sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==} - engines: {node: '>=0.8'} - dev: true - /bindings@1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} requiresBuild: true @@ -15651,9 +14760,6 @@ packages: resolution: {integrity: sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==} dev: true - /bluebird@3.7.2: - resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} - /bn.js@4.12.0: resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} @@ -15682,19 +14788,6 @@ packages: resolution: {integrity: sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==} dev: true - /boxen@1.3.0: - resolution: {integrity: sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==} - engines: {node: '>=4'} - dependencies: - ansi-align: 2.0.0 - camelcase: 4.1.0 - chalk: 2.4.2 - cli-boxes: 1.0.0 - string-width: 2.1.1 - term-size: 1.2.0 - widest-line: 2.0.1 - dev: true - /boxen@3.2.0: resolution: {integrity: sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A==} engines: {node: '>=6'} @@ -15932,10 +15025,6 @@ packages: /builtin-status-codes@3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} - /builtins@1.0.3: - resolution: {integrity: sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==} - dev: true - /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: @@ -15986,24 +15075,6 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} - /cacache@10.0.4: - resolution: {integrity: sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==} - dependencies: - bluebird: 3.7.2 - chownr: 1.1.4 - glob: 7.2.3 - graceful-fs: 4.2.11 - lru-cache: 4.1.5 - mississippi: 2.0.0 - mkdirp: 0.5.6 - move-concurrently: 1.0.1 - promise-inflight: 1.0.1(bluebird@3.7.2) - rimraf: 2.7.1 - ssri: 5.3.0 - unique-filename: 1.1.1 - y18n: 4.0.3 - dev: true - /cacache@15.3.0: resolution: {integrity: sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==} engines: {node: '>= 10'} @@ -16022,7 +15093,7 @@ packages: minipass-pipeline: 1.2.4 mkdirp: 1.0.4 p-map: 4.0.0 - promise-inflight: 1.0.1(bluebird@3.7.2) + promise-inflight: 1.0.1 rimraf: 3.0.2 ssri: 8.0.1 tar: 6.2.0 @@ -16032,24 +15103,6 @@ packages: dev: false optional: true - /cacache@9.3.0: - resolution: {integrity: sha512-Vbi8J1XfC8v+FbQ6QkOtKXsHpPnB0i9uMeYFJoj40EbdOsEqWB3DPpNjfsnYBkqOPYA8UvrqH6FZPpBP0zdN7g==} - dependencies: - bluebird: 3.7.2 - chownr: 1.1.4 - glob: 7.2.3 - graceful-fs: 4.2.11 - lru-cache: 4.1.5 - mississippi: 1.3.1 - mkdirp: 0.5.6 - move-concurrently: 1.0.1 - promise-inflight: 1.0.1(bluebird@3.7.2) - rimraf: 2.7.1 - ssri: 4.1.6 - unique-filename: 1.1.1 - y18n: 3.2.2 - dev: true - /cache-base@1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -16152,11 +15205,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /camelcase@4.1.0: - resolution: {integrity: sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==} - engines: {node: '>=4'} - dev: true - /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} @@ -16196,19 +15244,10 @@ packages: dev: true optional: true - /capture-stack-trace@1.0.2: - resolution: {integrity: sha512-X/WM2UQs6VMHUtjUDnZTRI+i1crWteJySFzr9UpGoQa4WQffXVTTXuekjl7TjZRlcF2XfjgITT0HxZ9RnxeT0w==} - engines: {node: '>=0.10.0'} - dev: true - /caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} dev: true - /ccount@2.0.1: - resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} - dev: true - /center-align@0.1.3: resolution: {integrity: sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==} engines: {node: '>=0.10.0'} @@ -16292,34 +15331,18 @@ packages: engines: {node: '>=10'} dev: false - /character-entities-html4@2.1.0: - resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} - dev: true - /character-entities-legacy@1.1.4: resolution: {integrity: sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA==} dev: false - /character-entities-legacy@3.0.0: - resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} - dev: true - /character-entities@1.2.4: resolution: {integrity: sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw==} dev: false - /character-entities@2.0.2: - resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} - dev: true - /character-reference-invalid@1.1.4: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: false - /character-reference-invalid@2.0.1: - resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} - dev: true - /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true @@ -16401,10 +15424,6 @@ packages: optionalDependencies: fsevents: 2.3.3 - /chownr@1.1.4: - resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - dev: true - /chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} @@ -16413,10 +15432,6 @@ packages: resolution: {integrity: sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==} engines: {node: '>=6.0'} - /ci-info@1.6.0: - resolution: {integrity: sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==} - dev: true - /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: false @@ -16445,14 +15460,6 @@ packages: static-extend: 0.1.2 dev: false - /classcat@5.0.4: - resolution: {integrity: sha512-sbpkOw6z413p+HDGcBENe498WM9woqWHiJxCq7nvmxe9WmrUmqfAcxpIwAiMtM5Q3AhYkzXcNQHqsWq0mND51g==} - dev: true - - /classnames@2.3.2: - resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} - dev: true - /classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} @@ -16467,11 +15474,6 @@ packages: engines: {node: '>=6'} dev: false - /cli-boxes@1.0.0: - resolution: {integrity: sha512-3Fo5wu8Ytle8q9iCzS4D2MWVL2X7JVWRiS1BnXbTFDhS9c/REkM9vd1AmabsoZoY5/dGi5TT9iKL8Kb6DeBRQg==} - engines: {node: '>=0.10.0'} - dev: true - /cli-boxes@2.2.1: resolution: {integrity: sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==} engines: {node: '>=6'} @@ -16506,11 +15508,6 @@ packages: restore-cursor: 4.0.0 dev: true - /cli-spinners@1.3.1: - resolution: {integrity: sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==} - engines: {node: '>=4'} - dev: true - /cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} @@ -16664,15 +15661,6 @@ packages: engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} dev: false - /coa@2.0.2: - resolution: {integrity: sha512-q5/jG+YQnSy4nRTV4F7lPepBJZ8qBNJJDBuJdoejDyLXgmL7IEo+Le2JDZudFTFt7mrCqIRaSjws4ygRCTCAXA==} - engines: {node: '>= 4.0'} - dependencies: - '@types/q': 1.5.8 - chalk: 2.4.2 - q: 1.5.1 - dev: true - /code-point-at@1.1.0: resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} engines: {node: '>=0.10.0'} @@ -16683,47 +15671,6 @@ packages: engines: {node: '>=0.8'} dev: true - /codesandbox-import-util-types@2.2.3: - resolution: {integrity: sha512-Qj00p60oNExthP2oR3vvXmUGjukij+rxJGuiaKM6tyUmSyimdZsqHI/TUvFFClAffk9s7hxGnQgWQ8KCce27qQ==} - dev: true - - /codesandbox-import-utils@2.2.3: - resolution: {integrity: sha512-ymtmcgZKU27U+nM2qUb21aO8Ut/u2S9s6KorOgG81weP+NA0UZkaHKlaRqbLJ9h4i/4FLvwmEXYAnTjNmp6ogg==} - dependencies: - codesandbox-import-util-types: 2.2.3 - istextorbinary: 2.6.0 - lz-string: 1.5.0 - dev: true - - /codesandbox@2.2.3: - resolution: {integrity: sha512-IAkWFk6UUglOhSemI7UFgNNL/jgg+1YjVEIllFULLgsaHhFnY51pCqAifMNuAd5d9Zp4Nk/xMgrEaGNV0L4Xlg==} - hasBin: true - dependencies: - axios: 0.18.1 - chalk: 2.4.2 - codesandbox-import-util-types: 2.2.3 - codesandbox-import-utils: 2.2.3 - commander: 2.20.3 - datauri: 3.0.0 - filesize: 3.6.1 - fs-extra: 3.0.1 - git-branch: 1.0.0 - git-repo-name: 0.6.0 - git-username: 0.5.1 - humps: 2.0.1 - inquirer: 6.5.2 - lodash: 4.17.21 - lz-string: 1.5.0 - ms: 2.1.3 - open: 6.4.0 - ora: 1.4.0 - pacote: 2.7.38 - shortid: 2.2.16 - update-notifier: 2.5.0 - transitivePeerDependencies: - - supports-color - dev: true - /collection-map@1.0.0: resolution: {integrity: sha512-5D2XXSpkOnleOI21TG7p3T0bGAsZ/XknZpKBmGYyluO8pw4zA3K8ZlrBIbC4FXg3m6z/RNFiUFfT2sQK01+UHA==} engines: {node: '>=0.10.0'} @@ -16773,6 +15720,7 @@ packages: dependencies: color-convert: 1.9.3 color-string: 1.9.1 + dev: false /colord@2.9.3: resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} @@ -16799,10 +15747,6 @@ packages: dependencies: delayed-stream: 1.0.0 - /comma-separated-tokens@2.0.3: - resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} - dev: true - /commander@11.0.0: resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} engines: {node: '>=16'} @@ -16944,18 +15888,6 @@ packages: proto-list: 1.2.4 dev: false - /configstore@3.1.5: - resolution: {integrity: sha512-nlOhI4+fdzoK5xmJ+NY+1gZK56bwEaWZr8fYuXohZ9Vkc1o3a4T/R3M+yE/w7x/ZVJ1zF8c+oaOvF0dztdUgmA==} - engines: {node: '>=4'} - dependencies: - dot-prop: 4.2.1 - graceful-fs: 4.2.11 - make-dir: 1.3.0 - unique-string: 1.0.0 - write-file-atomic: 2.4.3 - xdg-basedir: 3.0.0 - dev: true - /configstore@4.0.0: resolution: {integrity: sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==} engines: {node: '>=6'} @@ -17054,17 +15986,6 @@ packages: dependencies: is-what: 3.14.1 - /copy-concurrently@1.0.5: - resolution: {integrity: sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==} - dependencies: - aproba: 1.2.0 - fs-write-stream-atomic: 1.0.10 - iferr: 0.1.5 - mkdirp: 0.5.6 - rimraf: 2.7.1 - run-queue: 1.0.3 - dev: true - /copy-descriptor@0.1.1: resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} engines: {node: '>=0.10.0'} @@ -17188,13 +16109,6 @@ packages: bn.js: 4.12.0 elliptic: 6.5.5 - /create-error-class@3.0.2: - resolution: {integrity: sha512-gYTKKexFO3kh200H1Nit76sRwRtOY32vQd3jpAQKpLtZqyNsSQNfI4N7o3eP2wUjV35pTWKRYqFUDBvUha/Pkw==} - engines: {node: '>=0.10.0'} - dependencies: - capture-stack-trace: 1.0.2 - dev: true - /create-hash@1.2.0: resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} dependencies: @@ -17316,6 +16230,7 @@ packages: /crypto-random-string@1.0.0: resolution: {integrity: sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==} engines: {node: '>=4'} + dev: false /crypto-random-string@2.0.0: resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} @@ -17381,19 +16296,6 @@ packages: dependencies: postcss: 8.4.38 - /css-select-base-adapter@0.1.1: - resolution: {integrity: sha512-jQVeeRG70QI08vSTwf1jHxp74JoZsr2XSgETae8/xC8ovSnL2WF87GTLO86Sbwdt2lK4Umg4HnnwMO4YF3Ce7w==} - dev: true - - /css-select@2.1.0: - resolution: {integrity: sha512-Dqk7LQKpwLoH3VovzZnkzegqNSuAziQyNZUcrdDM401iY+R5NkGBXGmtO05/yaXQziALuPogeG0b7UAgjnTJTQ==} - dependencies: - boolbase: 1.0.0 - css-what: 3.4.2 - domutils: 1.7.0 - nth-check: 1.0.2 - dev: true - /css-select@4.3.0: resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} dependencies: @@ -17411,14 +16313,6 @@ packages: postcss-value-parser: 4.2.0 dev: true - /css-tree@1.0.0-alpha.37: - resolution: {integrity: sha512-DMxWJg0rnz7UgxKT0Q1HU/L9BeJI0M6ksor0OgqOnF+aRCDWg/N2641HmVyU9KVIu0OVVWOb2IpC9A+BJRnejg==} - engines: {node: '>=8.0.0'} - dependencies: - mdn-data: 2.0.4 - source-map: 0.6.1 - dev: true - /css-tree@1.1.3: resolution: {integrity: sha512-tRpdppF7TRazZrjJ6v3stzv93qxRcSsFmW6cX0Zm2NVKpxE1WV1HblnghVv9TreireHkqI/VDEsfolRF1p6y7Q==} engines: {node: '>=8.0.0'} @@ -17426,11 +16320,6 @@ packages: mdn-data: 2.0.14 source-map: 0.6.1 - /css-what@3.4.2: - resolution: {integrity: sha512-ACUm3L0/jiZTqfzRM3Hi9Q8eZqd6IK37mMWPLz9PJxkLWllYeRf+EHUSHYEtFop2Eqytaq1FizFVh7XfBnXCDQ==} - engines: {node: '>= 6'} - dev: true - /css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} @@ -17439,14 +16328,6 @@ packages: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} dev: false - /css@3.0.0: - resolution: {integrity: sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==} - dependencies: - inherits: 2.0.4 - source-map: 0.6.1 - source-map-resolve: 0.6.0 - dev: true - /cssdb@6.6.3: resolution: {integrity: sha512-7GDvDSmE+20+WcSMhP17Q1EVWUrLlbxxpMDqG731n8P99JhnQZHR9YvtjPvEHfjFUjvQJvdpKCjlKOX+xe4UVA==} @@ -17509,17 +16390,6 @@ packages: /current-script-polyfill@1.0.0: resolution: {integrity: sha512-qv8s+G47V6Hq+g2kRE5th+ASzzrL7b6l+tap1DHKK25ZQJv3yIFhH96XaQ7NGL+zRW3t/RDbweJf/dJDe5Z5KA==} - /cwd@0.9.1: - resolution: {integrity: sha512-4+0D+ojEasdLndYX4Cqff057I/Jp6ysXpwKkdLQLnZxV8f6IYZmZtTP5uqD91a/kWqejoc0sSqK4u8wpTKCh8A==} - engines: {node: '>=0.8'} - dependencies: - find-pkg: 0.1.2 - dev: true - - /cyclist@1.0.2: - resolution: {integrity: sha512-0sVXIohTfLqVIW3kb/0n6IiWF3Ifj5nm2XaSrLq2DI6fKIGa2fYAZdk917rUneaeLVpYfFcyXE2ft0fe3remsA==} - dev: true - /cytoscape-cose-bilkent@4.1.0(cytoscape@3.28.0): resolution: {integrity: sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==} peerDependencies: @@ -17607,6 +16477,7 @@ packages: dependencies: d3-dispatch: 3.0.1 d3-selection: 3.0.0 + dev: false /d3-dsv@3.0.1: resolution: {integrity: sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==} @@ -17624,6 +16495,7 @@ packages: /d3-ease@3.0.1: resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==} engines: {node: '>=12'} + dev: false /d3-fetch@3.0.1: resolution: {integrity: sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==} @@ -17707,6 +16579,7 @@ packages: /d3-selection@3.0.0: resolution: {integrity: sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==} engines: {node: '>=12'} + dev: false /d3-shape@3.2.0: resolution: {integrity: sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==} @@ -17748,6 +16621,7 @@ packages: d3-interpolate: 3.0.1 d3-selection: 3.0.0 d3-timer: 3.0.1 + dev: false /d3-voronoi@1.1.4: resolution: {integrity: sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==} @@ -17762,6 +16636,7 @@ packages: d3-interpolate: 3.0.1 d3-selection: 3.0.0 d3-transition: 3.0.1(d3-selection@3.0.0) + dev: false /d3@7.8.5: resolution: {integrity: sha512-JgoahDG51ncUfJu6wX/1vWQEqOflgXyl4MaHqlcSruTez7yhaRKR9i8VjjcQGeS2en/jnFivXuaIMnseMMt0XA==} @@ -17877,14 +16752,6 @@ packages: es-errors: 1.3.0 is-data-view: 1.0.1 - /datauri@3.0.0: - resolution: {integrity: sha512-NeDFuUPV1YCpCn8MUIcDk1QnuyenUHs7f4Q5P0n9FFA0neKFrfEH9esR+YMW95BplbYfdmjbs0Pl/ZGAaM2QHQ==} - engines: {node: '>= 8'} - dependencies: - image-size: 0.8.3 - mimer: 1.1.0 - dev: true - /date-arithmetic@4.1.0: resolution: {integrity: sha512-QWxYLR5P/6GStZcdem+V1xoto6DMadYWpMXU82ES3/RfR3Wdwr3D0+be7mgOJ+Ov0G9D5Dmb9T17sNLQYj9XOg==} dev: true @@ -17924,17 +16791,6 @@ packages: dependencies: ms: 2.0.0 - /debug@3.1.0: - resolution: {integrity: sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.0.0 - dev: true - /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -17971,12 +16827,6 @@ packages: /decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} - /decode-named-character-reference@1.0.2: - resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} - dependencies: - character-entities: 2.0.2 - dev: true - /decode-uri-component@0.2.2: resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} engines: {node: '>=0.10'} @@ -18097,18 +16947,11 @@ packages: /deep-extend@0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} + dev: false /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - /deep-rename-keys@0.2.1: - resolution: {integrity: sha512-RHd9ABw4Fvk+gYDWqwOftG849x0bYOySl/RgX0tLI9i27ZIeSO91mLZJEp7oPHOMFqHvpgu21YptmDt0FYD/0A==} - engines: {node: '>=0.10.0'} - dependencies: - kind-of: 3.2.2 - rename-keys: 1.2.0 - dev: true - /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -18323,11 +17166,6 @@ packages: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} - /diff@5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} - engines: {node: '>=0.3.1'} - dev: true - /diffie-hellman@5.0.3: resolution: {integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==} dependencies: @@ -18388,13 +17226,6 @@ packages: csstype: 3.1.3 dev: true - /dom-serializer@0.2.2: - resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==} - dependencies: - domelementtype: 2.3.0 - entities: 2.2.0 - dev: true - /dom-serializer@1.4.1: resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} dependencies: @@ -18408,15 +17239,12 @@ packages: domelementtype: 2.3.0 domhandler: 5.0.3 entities: 4.5.0 + dev: false /domain-browser@1.2.0: resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==} engines: {node: '>=0.4', npm: '>=1.2'} - /domelementtype@1.3.1: - resolution: {integrity: sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==} - dev: true - /domelementtype@2.3.0: resolution: {integrity: sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==} @@ -18438,18 +17266,12 @@ packages: engines: {node: '>= 4'} dependencies: domelementtype: 2.3.0 + dev: false /dompurify@2.4.3: resolution: {integrity: sha512-q6QaLcakcRjebxjg8/+NP+h0rPfatOgOzc46Fst9VAA3jF2ApfKBNKMzdP4DYTqtUMXSCd5pRS/8Po/OmoCHZQ==} dev: false - /domutils@1.7.0: - resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==} - dependencies: - dom-serializer: 0.2.2 - domelementtype: 1.3.1 - dev: true - /domutils@2.8.0: resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} dependencies: @@ -18463,6 +17285,7 @@ packages: dom-serializer: 2.0.0 domelementtype: 2.3.0 domhandler: 5.0.3 + dev: false /dot-case@3.0.4: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} @@ -18475,6 +17298,7 @@ packages: engines: {node: '>=4'} dependencies: is-obj: 1.0.1 + dev: false /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} @@ -18504,146 +17328,6 @@ packages: /dottie@2.0.6: resolution: {integrity: sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==} - /dumi-afx-deps@1.0.0-alpha.20: - resolution: {integrity: sha512-PRSJlHuJkyHDET7Hukykx/hLULkgUBX5q2CutMG5EDI3eJLzJlX634wNll10m3at1uomcDAVudL7Dgh5UOJ7IQ==} - dev: true - - /dumi-assets-types@2.0.0-alpha.0: - resolution: {integrity: sha512-a/Y5lf0G6gwsEQ9hop/n03CcjmHsGBk384Cz/AEX6mRYrfSpUx/lQvP9HLoXkCzScl9PL1sSmLPnMkgaXDCZLA==} - dev: true - - /dumi-theme-nocobase@0.2.21(@babel/core@7.22.10)(@types/react@18.2.75)(dumi@2.2.16)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-SEAE25VQOaYbY+maD5XEdDUqCQojqbfZYKkl0qVKCWHjTeQZHqptqxD/yi8KtypBJ7B+tdNKljppt0fSm/vJHw==} - peerDependencies: - dumi: ^2.2.0 - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@ant-design/icons': 5.3.6(react-dom@18.2.0)(react@18.2.0) - '@babel/runtime': 7.24.0 - '@ctrl/tinycolor': 3.6.1 - '@emotion/react': 11.11.1(@types/react@18.2.75)(react@18.2.0) - antd: 5.16.1(react-dom@18.2.0)(react@18.2.0) - antd-token-previewer: 2.0.5(@babel/core@7.22.10)(@types/react@18.2.75)(antd@5.16.1)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) - classnames: 2.5.1 - dayjs: 1.11.10 - dumi: 2.2.16(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(stylelint@14.16.1)(typescript@4.9.5)(webpack@5.91.0) - rc-drawer: 6.5.2(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - transitivePeerDependencies: - - '@babel/core' - - '@types/react' - - date-fns - - immer - - luxon - - moment - - react-is - dev: true - - /dumi@2.2.16(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(stylelint@14.16.1)(typescript@4.9.5)(webpack@5.91.0): - resolution: {integrity: sha512-r2x/CY0fR8/YZOwEnG4JsLEpn8jOg94Qyd1u+7pRD9SCx7dF9It+GwkGbdNEsyenGsO/ZU9wD+Kz7KO+HU7/EA==} - hasBin: true - peerDependencies: - react: '>=16.8' - react-dom: '>=16.8' - dependencies: - '@ant-design/icons-svg': 4.3.1 - '@makotot/ghostui': 2.0.0(react@18.2.0) - '@stackblitz/sdk': 1.9.0 - '@swc/core': 1.3.72 - '@types/hast': 2.3.8 - '@types/mdast': 3.0.15 - '@umijs/bundler-utils': 4.0.89 - '@umijs/core': 4.0.89 - '@umijs/utils': 4.1.8 - animated-scroll-to: 2.3.0 - classnames: 2.3.2 - codesandbox: 2.2.3 - copy-to-clipboard: 3.3.3 - deepmerge: 4.3.1 - dumi-afx-deps: 1.0.0-alpha.20 - dumi-assets-types: 2.0.0-alpha.0 - enhanced-resolve: 5.15.0 - estree-util-to-js: 1.2.0 - estree-util-visit: 1.2.1 - file-system-cache: 2.4.4 - github-slugger: 1.5.0 - hast-util-is-element: 2.1.3 - hast-util-raw: 8.0.0 - hast-util-to-estree: 2.3.3 - hast-util-to-string: 2.0.0 - heti: 0.9.4 - hosted-git-info: 6.1.1 - html-to-text: 9.0.5 - html2sketch: 1.0.2 - js-yaml: 4.1.0 - lodash.throttle: 4.1.1 - mdast-util-find-and-replace: 2.2.2 - mdast-util-to-string: 3.2.0 - nprogress: 0.2.0 - pluralize: 8.0.0 - prism-react-renderer: 1.3.5(react@18.2.0) - prism-themes: 1.9.0 - prismjs: 1.29.0 - raw-loader: 4.0.2(webpack@5.91.0) - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-tabs: 12.15.0(react-dom@18.2.0)(react@18.2.0) - rc-tree: 5.8.2(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-copy-to-clipboard: 5.1.0(react@18.2.0) - react-dom: 18.2.0(react@18.2.0) - react-error-boundary: 4.0.11(react@18.2.0) - react-intl: 6.5.5(react@18.2.0)(typescript@4.9.5) - rehype-autolink-headings: 6.1.1 - rehype-remove-comments: 5.0.0 - rehype-stringify: 9.0.4 - remark-directive: 2.0.1 - remark-frontmatter: 4.0.1 - remark-gfm: 3.0.1 - remark-parse: 10.0.2 - remark-rehype: 10.1.0 - sass: 1.69.5 - sitemap: 7.1.1 - umi: 4.1.8(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5)(stylelint@14.16.1)(typescript@4.9.5)(webpack@5.91.0) - unified: 10.1.2 - unist-util-visit: 4.1.2 - unist-util-visit-parents: 5.1.3 - url: 0.11.3 - v8-compile-cache: 2.3.0 - vfile: 5.3.7 - transitivePeerDependencies: - - '@babel/core' - - '@swc/helpers' - - '@types/node' - - '@types/react' - - '@types/webpack' - - '@volar/vue-language-plugin-pug' - - '@volar/vue-typescript' - - eslint - - jest - - lightningcss - - postcss-html - - postcss-jsx - - postcss-less - - postcss-markdown - - postcss-scss - - prettier - - rollup - - sockjs-client - - stylelint - - stylus - - sugarss - - supports-color - - terser - - type-fest - - typescript - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - /duplexer2@0.1.4: resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} dependencies: @@ -18651,6 +17335,7 @@ packages: /duplexer3@0.1.5: resolution: {integrity: sha512-1A8za6ws41LQgv9HrE/66jyC5yuSjQ3L/KOpFtoBilsAK2iA2wuS5rTt1OCzIvtS2V7nVmedsUU+DGRcjBmOYA==} + dev: false /duplexify@3.7.1: resolution: {integrity: sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==} @@ -18659,6 +17344,7 @@ packages: inherits: 2.0.4 readable-stream: 2.3.8 stream-shift: 1.0.1 + dev: false /duplexify@4.1.3: resolution: {integrity: sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==} @@ -18697,14 +17383,6 @@ packages: dependencies: safe-buffer: 5.2.1 - /editions@2.3.1: - resolution: {integrity: sha512-ptGvkwTvGdGfC0hfhKg0MT+TRLRKGtUiWGBInxOm5pz7ssADezahjCUaYuZ8Dr+C05FW0AECIIPt4WBxVINEhA==} - engines: {node: '>=0.8'} - dependencies: - errlop: 2.2.0 - semver: 6.3.1 - dev: true - /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -18774,8 +17452,11 @@ packages: /encoding@0.1.13: resolution: {integrity: sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==} + requiresBuild: true dependencies: iconv-lite: 0.6.3 + dev: false + optional: true /end-of-stream@1.4.4: resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==} @@ -18796,14 +17477,6 @@ packages: tapable: 1.1.3 dev: false - /enhanced-resolve@5.15.0: - resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} - engines: {node: '>=10.13.0'} - dependencies: - graceful-fs: 4.2.11 - tapable: 2.2.1 - dev: true - /enhanced-resolve@5.16.0: resolution: {integrity: sha512-O+QWCviPNSSLAD9Ucn8Awv+poAkqn3T1XY5/N7kR7rQO9yfSGWkYZDwpJ+iKF7B8rxaQKWngSqACpgzeapSyoA==} engines: {node: '>=10.13.0'} @@ -18840,21 +17513,12 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} - /err-code@1.1.2: - resolution: {integrity: sha512-CJAN+O0/yA1CKfRn9SXOGctSpEM7DCon/r/5r2eXFMY2zCCJBasFhcM5I+1kh3Ap11FsQCX+vGHceNPvpWKhoA==} - dev: true - /err-code@2.0.3: resolution: {integrity: sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==} requiresBuild: true dev: false optional: true - /errlop@2.2.0: - resolution: {integrity: sha512-e64Qj9+4aZzjzzFpZC7p5kmm/ccCrbLhAJplhsDXQFs87XTsXwOpH4s1Io2s90Tau/8r2j9f4l/thhDevRjzxw==} - engines: {node: '>=0.8'} - dev: true - /errno@0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true @@ -18967,10 +17631,6 @@ packages: unbox-primitive: 1.0.2 which-typed-array: 1.1.15 - /es-array-method-boxes-properly@1.0.0: - resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} - dev: true - /es-define-property@1.0.0: resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} engines: {node: '>= 0.4'} @@ -19072,16 +17732,6 @@ packages: es6-symbol: 3.1.3 dev: false - /es6-promise@4.2.8: - resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} - dev: true - - /es6-promisify@5.0.0: - resolution: {integrity: sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==} - dependencies: - es6-promise: 4.2.8 - dev: true - /es6-symbol@3.1.3: resolution: {integrity: sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==} dependencies: @@ -19281,11 +17931,6 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /escape-string-regexp@5.0.0: - resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} - engines: {node: '>=12'} - dev: true - /escodegen@2.1.0: resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} engines: {node: '>=6.0'} @@ -19406,27 +18051,6 @@ packages: requireindex: 1.2.0 dev: true - /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.55.0)(typescript@4.9.5): - resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 || ^6.0.0 - eslint: ^7.0.0 || ^8.0.0 - jest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - jest: - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.55.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.55.0)(typescript@4.9.5) - eslint: 8.55.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.55.0)(typescript@5.4.4): resolution: {integrity: sha512-sRLlSCpICzWuje66Gl9zvdF6mwD5X86I4u55hJyFBsxYOsBCmT5+kSUjf+fkFWVMMgpzNEupjW8WzUqi83hJAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -19684,31 +18308,6 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} - /estree-util-attach-comments@2.1.1: - resolution: {integrity: sha512-+5Ba/xGGS6mnwFbXIuQiDPTbuTxuMCooq3arVv7gPZtYpjp+VXH/NkHAP35OOefPhNG/UGqU3vt/LTABwcHX0w==} - dependencies: - '@types/estree': 1.0.5 - dev: true - - /estree-util-is-identifier-name@2.1.0: - resolution: {integrity: sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==} - dev: true - - /estree-util-to-js@1.2.0: - resolution: {integrity: sha512-IzU74r1PK5IMMGZXUVZbmiu4A1uhiPgW5hm1GjcOfr4ZzHaMPpLNJjR7HjXiIOzi25nZDrgFTobHTkV5Q6ITjA==} - dependencies: - '@types/estree-jsx': 1.0.3 - astring: 1.8.6 - source-map: 0.7.4 - dev: true - - /estree-util-visit@1.2.1: - resolution: {integrity: sha512-xbgqcrkIVbIG+lI/gzbvd9SGTJL4zqJKBFttUl5pP27KhAjtMKbX/mQXJ7qgyXpMgVy/zvpm0xoQQaGL8OloOw==} - dependencies: - '@types/estree-jsx': 1.0.3 - '@types/unist': 2.0.10 - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true @@ -19736,6 +18335,7 @@ packages: /eventemitter3@2.0.3: resolution: {integrity: sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==} + dev: false /eventemitter3@5.0.1: resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} @@ -19782,6 +18382,7 @@ packages: p-finally: 1.0.0 signal-exit: 3.0.7 strip-eof: 1.0.0 + dev: false /execa@1.0.0: resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==} @@ -19876,13 +18477,6 @@ packages: - supports-color dev: false - /expand-tilde@1.2.2: - resolution: {integrity: sha512-rtmc+cjLZqnu9dSYosX9EWmSJhTwpACgJQTfj4hgg2JjOD/6SIQalZrt4a3aQeh++oNxkazcaxrhPUj6+g5G/Q==} - engines: {node: '>=0.10.0'} - dependencies: - os-homedir: 1.0.2 - dev: true - /expand-tilde@2.0.2: resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} engines: {node: '>=0.10.0'} @@ -20052,12 +18646,6 @@ packages: dependencies: reusify: 1.0.4 - /fault@2.0.1: - resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} - dependencies: - format: 0.2.2 - dev: true - /fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} dependencies: @@ -20102,11 +18690,6 @@ packages: dependencies: flat-cache: 3.2.0 - /file-name@0.1.0: - resolution: {integrity: sha512-Q8SskhjF4eUk/xoQkmubwLkoHwOTv6Jj/WGtOVLKkZ0vvM+LipkSXugkn1F/+mjWXU32AXLZB3qaz0arUzgtRw==} - engines: {node: '>=0.10.0'} - dev: true - /file-saver@2.0.5: resolution: {integrity: sha512-P9bmyZ3h/PRG+Nzga+rbdI4OEpNDzAVyy74uVO9ATgzLK6VtAsYybF/+TOCvrc0MO793d6+42lLyZTw7/ArVzA==} @@ -20116,15 +18699,6 @@ packages: moment: 2.29.4 dev: false - /file-system-cache@2.4.4: - resolution: {integrity: sha512-vCYhn8pb5nlC3Gs2FFCOkmf4NEg2Ym3ulJwkmS9o6p9oRShGj6CwTMFvpgZihBlsh373NaM0XgAgDHXQIlS4LQ==} - dependencies: - '@types/fs-extra': 11.0.1 - '@types/ramda': 0.29.3 - fs-extra: 11.1.1 - ramda: 0.29.0 - dev: true - /file-type@3.9.0: resolution: {integrity: sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==} engines: {node: '>=0.10.0'} @@ -20143,11 +18717,6 @@ packages: dev: false optional: true - /filesize@3.6.1: - resolution: {integrity: sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==} - engines: {node: '>= 0.4.0'} - dev: true - /fill-range@4.0.0: resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==} engines: {node: '>=0.10.0'} @@ -20168,25 +18737,10 @@ packages: resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} engines: {node: '>=0.10.0'} - /find-file-up@0.1.3: - resolution: {integrity: sha512-mBxmNbVyjg1LQIIpgO8hN+ybWBgDQK8qjht+EbrTCGmmPV/sc7RF1i9stPTD6bpvXZywBdrwRYxhSdJv867L6A==} - engines: {node: '>=0.10.0'} - dependencies: - fs-exists-sync: 0.1.0 - resolve-dir: 0.1.1 - dev: true - /find-package-json@1.2.0: resolution: {integrity: sha512-+SOGcLGYDJHtyqHd87ysBhmaeQ95oWspDKnMXBrnQ9Eq4OkLNqejgoaD8xVWu6GPa0B6roa6KinCMEMcVeqONw==} dev: false - /find-pkg@0.1.2: - resolution: {integrity: sha512-0rnQWcFwZr7eO0513HahrWafsc3CTFioEB7DRiEYCUM/70QXSY8f3mCST17HXLcPvEhzH/Ty/Bxd72ZZsr/yvw==} - engines: {node: '>=0.10.0'} - dependencies: - find-file-up: 0.1.3 - dev: true - /find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} @@ -20303,6 +18857,7 @@ packages: dependencies: inherits: 2.0.4 readable-stream: 2.3.8 + dev: false /fmin@0.0.2: resolution: {integrity: sha512-sSi6DzInhl9d8yqssDfGZejChO8d2bAGIpysPsvYsxFe898z89XhCZg6CPNV3nhUhFefeC/AXZK2bAJxlBjN6A==} @@ -20328,15 +18883,6 @@ packages: dependencies: debug: 4.3.4(supports-color@5.5.0) - /follow-redirects@1.5.10: - resolution: {integrity: sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==} - engines: {node: '>=4.0'} - dependencies: - debug: 3.1.0 - transitivePeerDependencies: - - supports-color - dev: true - /fontkit@2.0.2: resolution: {integrity: sha512-jc4k5Yr8iov8QfS6u8w2CnHWVmbOGtdBtOXMze5Y+QD966Rx6PEVWXSEGwXlsDlKtu1G12cJjcsybnqhSk/+LA==} dependencies: @@ -20380,29 +18926,6 @@ packages: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} dev: true - /fork-ts-checker-webpack-plugin@8.0.0(typescript@4.9.5)(webpack@5.91.0): - resolution: {integrity: sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg==} - engines: {node: '>=12.13.0', yarn: '>=1.0.0'} - peerDependencies: - typescript: '>3.6.0' - webpack: ^5.11.0 - dependencies: - '@babel/code-frame': 7.24.2 - chalk: 4.1.2 - chokidar: 3.6.0 - cosmiconfig: 7.1.0 - deepmerge: 4.3.1 - fs-extra: 10.1.0 - memfs: 3.5.3 - minimatch: 3.1.2 - node-abort-controller: 3.1.1 - schema-utils: 3.3.0 - semver: 7.6.0 - tapable: 2.2.1 - typescript: 4.9.5 - webpack: 5.91.0 - dev: true - /fork-ts-checker-webpack-plugin@8.0.0(typescript@5.4.4)(webpack@5.91.0): resolution: {integrity: sha512-mX3qW3idpueT2klaQXBzrIM/pHw+T0B/V9KHEvNrqijTq9NFnMZU6oreVxDYcf33P8a5cW+67PjodNHthGnNVg==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} @@ -20474,11 +18997,6 @@ packages: combined-stream: 1.0.8 mime-types: 2.1.35 - /format@0.2.2: - resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} - engines: {node: '>=0.4.x'} - dev: true - /formdata-polyfill@4.0.10: resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} engines: {node: '>=12.20.0'} @@ -20521,21 +19039,9 @@ packages: engines: {node: '>= 0.6'} dev: false - /from2@2.3.0: - resolution: {integrity: sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==} - dependencies: - inherits: 2.0.4 - readable-stream: 2.3.8 - dev: true - /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - /fs-exists-sync@0.1.0: - resolution: {integrity: sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==} - engines: {node: '>=0.10.0'} - dev: true - /fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} @@ -20544,15 +19050,6 @@ packages: jsonfile: 6.1.0 universalify: 2.0.1 - /fs-extra@11.1.1: - resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} - engines: {node: '>=14.14'} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - dev: true - /fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -20561,14 +19058,6 @@ packages: jsonfile: 6.1.0 universalify: 2.0.1 - /fs-extra@3.0.1: - resolution: {integrity: sha512-V3Z3WZWVUYd8hoCL5xfXJCaHWYzmtwW5XWYSlLgERi8PWd8bx1kUHUk8L1BT57e49oKnDDD180mjfrHc1yA9rg==} - dependencies: - graceful-fs: 4.2.11 - jsonfile: 3.0.1 - universalify: 0.1.2 - dev: true - /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} @@ -20603,15 +19092,6 @@ packages: /fs-monkey@1.0.5: resolution: {integrity: sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==} - /fs-write-stream-atomic@1.0.10: - resolution: {integrity: sha512-gehEzmPn2nAwr39eay+x3X34Ra+M2QlVUTLhkXPjWdeO8RF9kszk116avgBJM3ZyNHgHXBNx+VmPaFC36k0PzA==} - dependencies: - graceful-fs: 4.2.11 - iferr: 0.1.5 - imurmurhash: 0.1.4 - readable-stream: 2.3.8 - dev: true - /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -20706,10 +19186,6 @@ packages: resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==} engines: {node: '>= 4'} - /genfun@4.0.1: - resolution: {integrity: sha512-48yv1eDS5Qrz6cbSDBBik0u7jCgC/eA9eZrl9MIN1LfKzFTuGt6EHgr31YM8yT9cjb5BplXb4Iz3VtOYmgt8Jg==} - dev: true - /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} @@ -20777,6 +19253,7 @@ packages: /get-stream@3.0.0: resolution: {integrity: sha512-GlhdIUuVakc8SJ6kK0zAFbiGzRFzNnY4jUuEbV9UROo4Y+0Ny4fjvcZFVTeDA4odpFyOQzaw6hXukJSq/f28sQ==} engines: {node: '>=4'} + dev: false /get-stream@4.1.0: resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} @@ -20834,6 +19311,7 @@ packages: /get-value@2.0.6: resolution: {integrity: sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==} engines: {node: '>=0.10.0'} + dev: false /getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} @@ -20841,20 +19319,6 @@ packages: assert-plus: 1.0.0 dev: true - /git-branch@1.0.0: - resolution: {integrity: sha512-ZTzuqw5Df8fyLXQWrX6hK+4FpNCdKzMcERlxENEGO5aKcLmG7MAszhrMhluUKNKmOS/JAGijDMQDXDCDw1mE/A==} - engines: {node: '>=0.8'} - dev: true - - /git-config-path@1.0.1: - resolution: {integrity: sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 2.0.1 - fs-exists-sync: 0.1.0 - homedir-polyfill: 1.0.3 - dev: true - /git-hooks-list@3.1.0: resolution: {integrity: sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==} @@ -20881,31 +19345,10 @@ packages: through2: 4.0.2 dev: true - /git-repo-name@0.6.0: - resolution: {integrity: sha512-DF4XxB6H+Te79JA08/QF/IjIv+j+0gF990WlgAX3SXXU2irfqvBc/xxlAIh6eJWYaKz45MrrGVBFS0Qc4bBz5g==} - engines: {node: '>=0.8'} - dependencies: - cwd: 0.9.1 - file-name: 0.1.0 - lazy-cache: 1.0.4 - remote-origin-url: 0.5.3 - dev: true - /git-sha1@0.1.2: resolution: {integrity: sha512-2e/nZezdVlyCopOCYHeW0onkbZg7xP1Ad6pndPy1rCygeRykefUS6r7oA5cJRGEFvseiaz5a/qUHFVX1dd6Isg==} dev: false - /git-username@0.5.1: - resolution: {integrity: sha512-xjUjrj3i4kup2A3a/ZVZB1Nt0PUX7SU7KeVqIbXPdslT7NbNfyO04JMxBv4gar77JePdS+A6f05jG1Viy6+U1w==} - engines: {node: '>=0.8'} - dependencies: - remote-origin-url: 0.4.0 - dev: true - - /github-slugger@1.5.0: - resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} - dev: true - /gl-matrix@3.4.3: resolution: {integrity: sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==} @@ -21011,14 +19454,6 @@ packages: dependencies: ini: 1.3.8 - /global-modules@0.2.3: - resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} - engines: {node: '>=0.10.0'} - dependencies: - global-prefix: 0.1.5 - is-windows: 0.2.0 - dev: true - /global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} engines: {node: '>=0.10.0'} @@ -21034,16 +19469,6 @@ packages: dependencies: global-prefix: 3.0.0 - /global-prefix@0.1.5: - resolution: {integrity: sha512-gOPiyxcD9dJGCEArAhF4Hd0BAqvAe/JzERP7tYumE4yIkmIedPUVXcJFWbV3/p/ovIIvKjkrTk+f1UVkq7vvbw==} - engines: {node: '>=0.10.0'} - dependencies: - homedir-polyfill: 1.0.3 - ini: 1.3.8 - is-windows: 0.2.0 - which: 1.3.1 - dev: true - /global-prefix@1.0.2: resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} engines: {node: '>=0.10.0'} @@ -21119,25 +19544,6 @@ packages: dependencies: get-intrinsic: 1.2.2 - /got@6.7.1: - resolution: {integrity: sha512-Y/K3EDuiQN9rTZhBvPRWMLXIKdeD1Rj0nzunfoi0Yyn5WBEbzxXKU9Ub2X41oZBagVWOBU3MuDonFMgPWQFnwg==} - engines: {node: '>=4'} - dependencies: - '@types/keyv': 3.1.4 - '@types/responselike': 1.0.3 - create-error-class: 3.0.2 - duplexer3: 0.1.5 - get-stream: 3.0.0 - is-redirect: 1.0.0 - is-retry-allowed: 1.2.0 - is-stream: 1.1.0 - lowercase-keys: 1.0.1 - safe-buffer: 5.2.1 - timed-out: 4.0.1 - unzip-response: 2.0.1 - url-parse-lax: 1.0.0 - dev: true - /got@9.6.0: resolution: {integrity: sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==} engines: {node: '>=8.6'} @@ -21336,6 +19742,7 @@ packages: get-value: 2.0.6 has-values: 0.1.4 isobject: 2.1.0 + dev: false /has-value@1.0.0: resolution: {integrity: sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==} @@ -21349,6 +19756,7 @@ packages: /has-values@0.1.4: resolution: {integrity: sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==} engines: {node: '>=0.10.0'} + dev: false /has-values@1.0.0: resolution: {integrity: sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==} @@ -21401,149 +19809,6 @@ packages: dependencies: function-bind: 1.1.2 - /hast-util-from-parse5@7.1.2: - resolution: {integrity: sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==} - dependencies: - '@types/hast': 2.3.8 - '@types/unist': 2.0.10 - hastscript: 7.2.0 - property-information: 6.4.0 - vfile: 5.3.7 - vfile-location: 4.1.0 - web-namespaces: 2.0.1 - dev: true - - /hast-util-has-property@2.0.1: - resolution: {integrity: sha512-X2+RwZIMTMKpXUzlotatPzWj8bspCymtXH3cfG3iQKV+wPF53Vgaqxi/eLqGck0wKq1kS9nvoB1wchbCPEL8sg==} - dev: true - - /hast-util-heading-rank@2.1.1: - resolution: {integrity: sha512-iAuRp+ESgJoRFJbSyaqsfvJDY6zzmFoEnL1gtz1+U8gKtGGj1p0CVlysuUAUjq95qlZESHINLThwJzNGmgGZxA==} - dependencies: - '@types/hast': 2.3.8 - dev: true - - /hast-util-is-conditional-comment@2.0.0: - resolution: {integrity: sha512-U66gW8ZWQdxP4ZjTEZ3xZT72y6rIKJqV4At5QmC1ItBbQyZyVkuTp8QkQwhxsbkHdzpifiZdQWrDipc9ByqhRg==} - dependencies: - '@types/hast': 2.3.8 - dev: true - - /hast-util-is-element@2.1.3: - resolution: {integrity: sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==} - dependencies: - '@types/hast': 2.3.8 - '@types/unist': 2.0.10 - dev: true - - /hast-util-parse-selector@3.1.1: - resolution: {integrity: sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==} - dependencies: - '@types/hast': 2.3.8 - dev: true - - /hast-util-raw@7.2.3: - resolution: {integrity: sha512-RujVQfVsOrxzPOPSzZFiwofMArbQke6DJjnFfceiEbFh7S05CbPt0cYN+A5YeD3pso0JQk6O1aHBnx9+Pm2uqg==} - dependencies: - '@types/hast': 2.3.8 - '@types/parse5': 6.0.3 - hast-util-from-parse5: 7.1.2 - hast-util-to-parse5: 7.1.0 - html-void-elements: 2.0.1 - parse5: 6.0.1 - unist-util-position: 4.0.4 - unist-util-visit: 4.1.2 - vfile: 5.3.7 - web-namespaces: 2.0.1 - zwitch: 2.0.4 - dev: true - - /hast-util-raw@8.0.0: - resolution: {integrity: sha512-bKbaUxMNLjZMMowgcrc4l3aQSPiMLiceZD+mp+AKF8Si0mtyR2DYVdxzS2XBxXYDeW/VvfZy40lNxHRiY6MMTg==} - dependencies: - '@types/hast': 2.3.8 - extend: 3.0.2 - hast-util-from-parse5: 7.1.2 - hast-util-to-parse5: 7.1.0 - html-void-elements: 2.0.1 - mdast-util-to-hast: 12.3.0 - parse5: 7.1.2 - unist-util-position: 4.0.4 - unist-util-visit: 4.1.2 - vfile: 5.3.7 - web-namespaces: 2.0.1 - zwitch: 2.0.4 - dev: true - - /hast-util-to-estree@2.3.3: - resolution: {integrity: sha512-ihhPIUPxN0v0w6M5+IiAZZrn0LH2uZomeWwhn7uP7avZC6TE7lIiEh2yBMPr5+zi1aUCXq6VoYRgs2Bw9xmycQ==} - dependencies: - '@types/estree': 1.0.5 - '@types/estree-jsx': 1.0.3 - '@types/hast': 2.3.8 - '@types/unist': 2.0.10 - comma-separated-tokens: 2.0.3 - estree-util-attach-comments: 2.1.1 - estree-util-is-identifier-name: 2.1.0 - hast-util-whitespace: 2.0.1 - mdast-util-mdx-expression: 1.3.2 - mdast-util-mdxjs-esm: 1.3.1 - property-information: 6.4.0 - space-separated-tokens: 2.0.2 - style-to-object: 0.4.4 - unist-util-position: 4.0.4 - zwitch: 2.0.4 - transitivePeerDependencies: - - supports-color - dev: true - - /hast-util-to-html@8.0.4: - resolution: {integrity: sha512-4tpQTUOr9BMjtYyNlt0P50mH7xj0Ks2xpo8M943Vykljf99HW6EzulIoJP1N3eKOSScEHzyzi9dm7/cn0RfGwA==} - dependencies: - '@types/hast': 2.3.8 - '@types/unist': 2.0.10 - ccount: 2.0.1 - comma-separated-tokens: 2.0.3 - hast-util-raw: 7.2.3 - hast-util-whitespace: 2.0.1 - html-void-elements: 2.0.1 - property-information: 6.4.0 - space-separated-tokens: 2.0.2 - stringify-entities: 4.0.3 - zwitch: 2.0.4 - dev: true - - /hast-util-to-parse5@7.1.0: - resolution: {integrity: sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==} - dependencies: - '@types/hast': 2.3.8 - comma-separated-tokens: 2.0.3 - property-information: 6.4.0 - space-separated-tokens: 2.0.2 - web-namespaces: 2.0.1 - zwitch: 2.0.4 - dev: true - - /hast-util-to-string@2.0.0: - resolution: {integrity: sha512-02AQ3vLhuH3FisaMM+i/9sm4OXGSq1UhOOCpTLLQtHdL3tZt7qil69r8M8iDkZYyC0HCFylcYoP+8IO7ddta1A==} - dependencies: - '@types/hast': 2.3.8 - dev: true - - /hast-util-whitespace@2.0.1: - resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} - dev: true - - /hastscript@7.2.0: - resolution: {integrity: sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==} - dependencies: - '@types/hast': 2.3.8 - comma-separated-tokens: 2.0.3 - hast-util-parse-selector: 3.1.1 - property-information: 6.4.0 - space-separated-tokens: 2.0.2 - dev: true - /he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true @@ -21552,16 +19817,6 @@ packages: resolution: {integrity: sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==} dev: false - /heti-findandreplacedomtext@0.5.0: - resolution: {integrity: sha512-GFZjqU8LAdu1uR72GqrReI+lzNLMlcWtvdz1TKNJiofyo1mfTecFYSZEoEbcLcRMl+KwEldnNQoS4BwO8wtg0A==} - dev: true - - /heti@0.9.4: - resolution: {integrity: sha512-DI1A/R6VabM8wulXrGVbeHZNZ8jJUm+Pwn+PEYZcNBxAO+4mXWPEX+Xu9R/YrHETGcevNrLO34m/99ZCnFnlhw==} - dependencies: - heti-findandreplacedomtext: 0.5.0 - dev: true - /hexoid@1.0.0: resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==} engines: {node: '>=8'} @@ -21591,6 +19846,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: parse-passwd: 1.0.0 + dev: false /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -21601,13 +19857,6 @@ packages: dependencies: lru-cache: 6.0.0 - /hosted-git-info@6.1.1: - resolution: {integrity: sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - lru-cache: 7.18.3 - dev: true - /hotkeys-js@3.9.4: resolution: {integrity: sha512-2zuLt85Ta+gIyvs4N88pCYskNrxf1TFv3LR9t5mdAZIX8BcgQQ48F2opUptvHa6m8zsy5v/a0i9mWzTrlNWU0Q==} dev: false @@ -21668,17 +19917,6 @@ packages: resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==} engines: {node: '>=8'} - /html-to-text@9.0.5: - resolution: {integrity: sha512-qY60FjREgVZL03vJU6IfMV4GDjGBIoOyvuFdpBDIX9yTlDw0TjxVBQp+P8NvpdIXNJvfWBTNul7fsAQJq2FNpg==} - engines: {node: '>=14'} - dependencies: - '@selderee/plugin-htmlparser2': 0.11.0 - deepmerge: 4.3.1 - dom-serializer: 2.0.0 - htmlparser2: 8.0.2 - selderee: 0.11.0 - dev: true - /html-tokenize@2.0.1: resolution: {integrity: sha512-QY6S+hZ0f5m1WT8WffYN+Hg+xm/w5I8XeUcAq/ZYP5wVC8xbKi4Whhru3FtrAebD5EhBW8rmFzkDI6eCAuFe2w==} hasBin: true @@ -21689,10 +19927,6 @@ packages: readable-stream: 1.0.34 through2: 0.4.2 - /html-void-elements@2.0.1: - resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} - dev: true - /html-webpack-plugin@5.5.0(webpack@5.91.0): resolution: {integrity: sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw==} engines: {node: '>=10.13.0'} @@ -21706,20 +19940,6 @@ packages: tapable: 2.2.1 webpack: 5.91.0 - /html2sketch@1.0.2: - resolution: {integrity: sha512-/P9NcVH9yBhrOkcnaFkAbWJifDO8Ii+CTIxy9gE6trSQvo2OH++TKQIP5MICEoWvgXpVhZ6botj7P63Krl1/gg==} - engines: {node: '>=14.0.0'} - dependencies: - '@sketch-hq/sketch-file-format-ts': 6.5.0 - color: 3.2.1 - css: 3.0.0 - svg-pathdata: 5.0.5 - svgo-browser: 1.3.8 - svgson: 4.1.0 - transformation-matrix: 2.15.0 - uuid: 8.3.2 - dev: true - /htmlparser2@6.1.0: resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} dependencies: @@ -21735,6 +19955,7 @@ packages: domhandler: 5.0.3 domutils: 3.1.0 entities: 4.5.0 + dev: false /http-assert@1.5.0: resolution: {integrity: sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==} @@ -21744,10 +19965,6 @@ packages: http-errors: 1.8.1 dev: false - /http-cache-semantics@3.8.1: - resolution: {integrity: sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w==} - dev: true - /http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} dev: false @@ -21785,16 +20002,6 @@ packages: toidentifier: 1.0.1 dev: false - /http-proxy-agent@2.1.0: - resolution: {integrity: sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==} - engines: {node: '>= 4.5.0'} - dependencies: - agent-base: 4.3.0 - debug: 3.1.0 - transitivePeerDependencies: - - supports-color - dev: true - /http-proxy-agent@4.0.1: resolution: {integrity: sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==} engines: {node: '>= 6'} @@ -21827,16 +20034,6 @@ packages: /https-browserify@1.0.0: resolution: {integrity: sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==} - /https-proxy-agent@2.2.4: - resolution: {integrity: sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==} - engines: {node: '>= 4.5.0'} - dependencies: - agent-base: 4.3.0 - debug: 3.2.7 - transitivePeerDependencies: - - supports-color - dev: true - /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -21890,10 +20087,6 @@ packages: dependencies: ms: 2.1.3 - /humps@2.0.1: - resolution: {integrity: sha512-E0eIbrFWUhwfXJmsbdjRQFQPrl5pTEoKlz163j1mTqqUnU9PgR4AgB8AIITzuB3vLBdxZXyZ9TDIrwB2OASz4g==} - dev: true - /husky@9.0.11: resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} engines: {node: '>=18'} @@ -21947,10 +20140,6 @@ packages: /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - /iferr@0.1.5: - resolution: {integrity: sha512-DUNFN5j7Tln0D+TxzloUjKB+CtVu6myn0JEFak6dG18mNt9YkQ6lzGCdafwofISZ1lLF3xRHJ98VKy9ynkcFaA==} - dev: true - /ignore@5.3.0: resolution: {integrity: sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==} engines: {node: '>= 4'} @@ -21966,21 +20155,10 @@ packages: requiresBuild: true optional: true - /image-size@0.8.3: - resolution: {integrity: sha512-SMtq1AJ+aqHB45c3FsB4ERK0UCiA2d3H1uq8s+8T0Pf8A3W4teyBQyaFaktH6xvZqh+npwlKU7i4fJo0r7TYTg==} - engines: {node: '>=6.9.0'} - hasBin: true - dependencies: - queue: 6.0.1 - dev: true - /immediate@3.0.6: resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} dev: true - /immutable@4.3.4: - resolution: {integrity: sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==} - /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} @@ -22000,6 +20178,7 @@ packages: /import-lazy@2.1.0: resolution: {integrity: sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==} engines: {node: '>=4'} + dev: false /import-lazy@4.0.0: resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} @@ -22057,10 +20236,6 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: false - /inline-style-parser@0.1.1: - resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} - dev: true - /inquirer@6.5.2: resolution: {integrity: sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==} engines: {node: '>=6.0.0'} @@ -22129,15 +20304,6 @@ packages: /intersection-observer@0.12.2: resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} - /intl-messageformat@10.5.8: - resolution: {integrity: sha512-NRf0jpBWV0vd671G5b06wNofAN8tp7WWDogMZyaU8GUAsmbouyvgwmFJI7zLjfAMpm3zK+vSwRP3jzaoIcMbaA==} - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/fast-memoize': 2.2.0 - '@formatjs/icu-messageformat-parser': 2.7.3 - tslib: 2.6.2 - dev: true - /invariant@2.2.4: resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} dependencies: @@ -22174,10 +20340,6 @@ packages: resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==} dev: false - /is-alphabetical@2.0.1: - resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} - dev: true - /is-alphanumerical@1.0.4: resolution: {integrity: sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A==} dependencies: @@ -22185,13 +20347,6 @@ packages: is-decimal: 1.0.4 dev: false - /is-alphanumerical@2.0.1: - resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} - dependencies: - is-alphabetical: 2.0.1 - is-decimal: 2.0.1 - dev: true - /is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} @@ -22274,13 +20429,6 @@ packages: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - /is-ci@1.2.1: - resolution: {integrity: sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==} - hasBin: true - dependencies: - ci-info: 1.6.0 - dev: true - /is-ci@2.0.0: resolution: {integrity: sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==} hasBin: true @@ -22320,10 +20468,6 @@ packages: resolution: {integrity: sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw==} dev: false - /is-decimal@2.0.1: - resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} - dev: true - /is-descriptor@0.1.7: resolution: {integrity: sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==} engines: {node: '>= 0.4'} @@ -22440,10 +20584,6 @@ packages: resolution: {integrity: sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw==} dev: false - /is-hexadecimal@2.0.1: - resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} - dev: true - /is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} @@ -22457,6 +20597,7 @@ packages: dependencies: global-dirs: 0.1.1 is-path-inside: 1.0.1 + dev: false /is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} @@ -22496,11 +20637,6 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} - /is-npm@1.0.0: - resolution: {integrity: sha512-9r39FIr3d+KD9SbX0sfMsHzb5PP3uimOiwr3YupUaUFG4W0l1U57Rx3utpttV7qz5U3jmrO5auUa04LU9pyHsg==} - engines: {node: '>=0.10.0'} - dev: true - /is-npm@3.0.0: resolution: {integrity: sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==} engines: {node: '>=8'} @@ -22531,6 +20667,7 @@ packages: /is-obj@1.0.1: resolution: {integrity: sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==} engines: {node: '>=0.10.0'} + dev: false /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} @@ -22542,6 +20679,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: path-is-inside: 1.0.2 + dev: false /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} @@ -22565,6 +20703,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: isobject: 3.0.1 + dev: false /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} @@ -22576,11 +20715,6 @@ packages: /is-property@1.0.2: resolution: {integrity: sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==} - /is-redirect@1.0.0: - resolution: {integrity: sha512-cr/SlUEe5zOGmzvj9bUyC4LVvkNVAXu4GytXLNMr1pny+a65MpQ9IJzFHD5vi7FyJgb4qt27+eS3TuQnqB+RQw==} - engines: {node: '>=0.10.0'} - dev: true - /is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: @@ -22601,11 +20735,6 @@ packages: is-unc-path: 1.0.0 dev: false - /is-retry-allowed@1.2.0: - resolution: {integrity: sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==} - engines: {node: '>=0.10.0'} - dev: true - /is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} @@ -22738,20 +20867,10 @@ packages: /is-what@3.14.1: resolution: {integrity: sha512-sNxgpk9793nzSs7bA6JQJGeIuRBQhAaNGG77kzYQgMkrID+lS6SlK07K5LaptscDlSaIgH+GPFzf+d75FVxozA==} - /is-windows@0.2.0: - resolution: {integrity: sha512-n67eJYmXbniZB7RF4I/FTjK1s6RPOCTxhYrVYLRaCt3lF0mpWZPKr3T2LSZAqyjQsxR2qMmGYXXzK0YWwcPM1Q==} - engines: {node: '>=0.10.0'} - dev: true - /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - /is-wsl@1.1.0: - resolution: {integrity: sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==} - engines: {node: '>=4'} - dev: true - /is-wsl@2.2.0: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} @@ -22784,10 +20903,12 @@ packages: engines: {node: '>=0.10.0'} dependencies: isarray: 1.0.0 + dev: false /isobject@3.0.1: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} + dev: false /isomorphic-unfetch@4.0.2: resolution: {integrity: sha512-1Yd+CF/7al18/N2BDbsLBcp6RO3tucSW+jcLq24dqdX5MNbCNTw1z4BsGsp4zNmjr/Izm2cs/cEqZPp4kvWSCA==} @@ -22815,15 +20936,6 @@ packages: transitivePeerDependencies: - supports-color - /istextorbinary@2.6.0: - resolution: {integrity: sha512-+XRlFseT8B3L9KyjxxLjfXSLMuErKDsd8DBNrsaxoViABMEZlOSCstwmw0qpoFX3+U6yWU1yhLudAe6/lETGGA==} - engines: {node: '>=0.12'} - dependencies: - binaryextensions: 2.3.0 - editions: 2.3.1 - textextensions: 2.6.0 - dev: true - /iterator.prototype@1.1.2: resolution: {integrity: sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==} dependencies: @@ -23040,10 +21152,6 @@ packages: /json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - /json-parse-better-errors@1.0.2: - resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} - dev: true - /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} @@ -23094,12 +21202,6 @@ packages: /jsonc-parser@3.2.0: resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - /jsonfile@3.0.1: - resolution: {integrity: sha512-oBko6ZHlubVB5mRFkur5vgYR1UyqX+S6Y/oCfLhqNdcc2fYFlDpIoNc7AfKS1KOGcnNAkvsr0grLck9ANM815w==} - optionalDependencies: - graceful-fs: 4.2.11 - dev: true - /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -23331,13 +21433,6 @@ packages: es6-weak-map: 2.0.3 dev: false - /latest-version@3.1.0: - resolution: {integrity: sha512-Be1YRHWWlZaSsrz2U+VInk+tO0EwLIyV+23RhWLINJYwg/UIikxjlj3MhH37/6/EDCAusjajvMkMMUXRaMWl/w==} - engines: {node: '>=4'} - dependencies: - package-json: 4.0.1 - dev: true - /latest-version@5.1.0: resolution: {integrity: sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==} engines: {node: '>=8'} @@ -23375,10 +21470,6 @@ packages: invert-kv: 1.0.0 dev: false - /leac@0.6.0: - resolution: {integrity: sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==} - dev: true - /lead@1.0.0: resolution: {integrity: sha512-IpSVCk9AYvLHo5ctcIXxOBpMWUe+4TKN3VPWAKUbJikkmsGp0VrSM8IttVc32D6J4WUsiPE6aEFRNmIoF/gdow==} engines: {node: '>= 0.10'} @@ -23768,10 +21859,6 @@ packages: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true - /lodash.throttle@4.1.1: - resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==} - dev: true - /lodash.truncate@4.4.2: resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} @@ -23791,13 +21878,6 @@ packages: engines: {node: '>=0.8.6'} dev: false - /log-symbols@2.2.0: - resolution: {integrity: sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==} - engines: {node: '>=4'} - dependencies: - chalk: 2.4.2 - dev: true - /log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -23836,10 +21916,6 @@ packages: resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} dev: false - /longest-streak@3.1.0: - resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} - dev: true - /longest@1.0.1: resolution: {integrity: sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==} engines: {node: '>=0.10.0'} @@ -23863,6 +21939,7 @@ packages: /lowercase-keys@1.0.1: resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} engines: {node: '>=0.10.0'} + dev: false /lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} @@ -23958,24 +22035,6 @@ packages: resolution: {integrity: sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==} dev: true - /make-fetch-happen@2.6.0: - resolution: {integrity: sha512-FFq0lNI0ax+n9IWzWpH8A4JdgYiAp2DDYIZ3rsaav8JDe8I+72CzK6PQW/oom15YDZpV5bYW/9INd6nIJ2ZfZw==} - dependencies: - agentkeepalive: 3.5.2 - cacache: 10.0.4 - http-cache-semantics: 3.8.1 - http-proxy-agent: 2.1.0 - https-proxy-agent: 2.2.4 - lru-cache: 4.1.5 - mississippi: 1.3.1 - node-fetch-npm: 2.0.4 - promise-retry: 1.1.1 - socks-proxy-agent: 3.0.1 - ssri: 5.3.0 - transitivePeerDependencies: - - supports-color - dev: true - /make-fetch-happen@9.1.0: resolution: {integrity: sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==} engines: {node: '>= 10'} @@ -24073,10 +22132,6 @@ packages: uc.micro: 1.0.6 dev: false - /markdown-table@3.0.3: - resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} - dev: true - /matchdep@2.0.0: resolution: {integrity: sha512-LFgVbaHIHMqCRuCZyfCtUOq9/Lnzhi7Z0KFUE2fhD54+JN2jLh3hC02RLkqauJ3U4soU6H1J3tfj/Byk7GoEjA==} engines: {node: '>= 0.10.0'} @@ -24114,37 +22169,6 @@ packages: inherits: 2.0.4 safe-buffer: 5.2.1 - /mdast-util-definitions@5.1.2: - resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} - dependencies: - '@types/mdast': 3.0.15 - '@types/unist': 2.0.10 - unist-util-visit: 4.1.2 - dev: true - - /mdast-util-directive@2.2.4: - resolution: {integrity: sha512-sK3ojFP+jpj1n7Zo5ZKvoxP1MvLyzVG63+gm40Z/qI00avzdPCYxt7RBMgofwAva9gBjbDBWVRB/i+UD+fUCzQ==} - dependencies: - '@types/mdast': 3.0.15 - '@types/unist': 2.0.10 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - parse-entities: 4.0.1 - stringify-entities: 4.0.3 - unist-util-visit-parents: 5.1.3 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-find-and-replace@2.2.2: - resolution: {integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==} - dependencies: - '@types/mdast': 3.0.15 - escape-string-regexp: 5.0.0 - unist-util-is: 5.2.1 - unist-util-visit-parents: 5.1.3 - dev: true - /mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} dependencies: @@ -24157,163 +22181,13 @@ packages: - supports-color dev: false - /mdast-util-from-markdown@1.3.1: - resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} - dependencies: - '@types/mdast': 3.0.15 - '@types/unist': 2.0.10 - decode-named-character-reference: 1.0.2 - mdast-util-to-string: 3.2.0 - micromark: 3.2.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-decode-string: 1.1.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - unist-util-stringify-position: 3.0.3 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-frontmatter@1.0.1: - resolution: {integrity: sha512-JjA2OjxRqAa8wEG8hloD0uTU0kdn8kbtOWpPP94NBkfAlbxn4S8gCGf/9DwFtEeGPXrDcNXdiDjVaRdUFqYokw==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-to-markdown: 1.5.0 - micromark-extension-frontmatter: 1.1.1 - dev: true - - /mdast-util-gfm-autolink-literal@1.0.3: - resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} - dependencies: - '@types/mdast': 3.0.15 - ccount: 2.0.1 - mdast-util-find-and-replace: 2.2.2 - micromark-util-character: 1.2.0 - dev: true - - /mdast-util-gfm-footnote@1.0.2: - resolution: {integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-to-markdown: 1.5.0 - micromark-util-normalize-identifier: 1.1.0 - dev: true - - /mdast-util-gfm-strikethrough@1.0.3: - resolution: {integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-to-markdown: 1.5.0 - dev: true - - /mdast-util-gfm-table@1.0.7: - resolution: {integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==} - dependencies: - '@types/mdast': 3.0.15 - markdown-table: 3.0.3 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-gfm-task-list-item@1.0.2: - resolution: {integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-to-markdown: 1.5.0 - dev: true - - /mdast-util-gfm@2.0.2: - resolution: {integrity: sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==} - dependencies: - mdast-util-from-markdown: 1.3.1 - mdast-util-gfm-autolink-literal: 1.0.3 - mdast-util-gfm-footnote: 1.0.2 - mdast-util-gfm-strikethrough: 1.0.3 - mdast-util-gfm-table: 1.0.7 - mdast-util-gfm-task-list-item: 1.0.2 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdx-expression@1.3.2: - resolution: {integrity: sha512-xIPmR5ReJDu/DHH1OoIT1HkuybIfRGYRywC+gJtI7qHjCJp/M9jrmBEJW22O8lskDWm562BX2W8TiAwRTb0rKA==} - dependencies: - '@types/estree-jsx': 1.0.3 - '@types/hast': 2.3.8 - '@types/mdast': 3.0.15 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-mdxjs-esm@1.3.1: - resolution: {integrity: sha512-SXqglS0HrEvSdUEfoXFtcg7DRl7S2cwOXc7jkuusG472Mmjag34DUDeOJUZtl+BVnyeO1frIgVpHlNRWc2gk/w==} - dependencies: - '@types/estree-jsx': 1.0.3 - '@types/hast': 2.3.8 - '@types/mdast': 3.0.15 - mdast-util-from-markdown: 1.3.1 - mdast-util-to-markdown: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /mdast-util-phrasing@3.0.1: - resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} - dependencies: - '@types/mdast': 3.0.15 - unist-util-is: 5.2.1 - dev: true - - /mdast-util-to-hast@12.3.0: - resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} - dependencies: - '@types/hast': 2.3.8 - '@types/mdast': 3.0.15 - mdast-util-definitions: 5.1.2 - micromark-util-sanitize-uri: 1.2.0 - trim-lines: 3.0.1 - unist-util-generated: 2.0.1 - unist-util-position: 4.0.4 - unist-util-visit: 4.1.2 - dev: true - - /mdast-util-to-markdown@1.5.0: - resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} - dependencies: - '@types/mdast': 3.0.15 - '@types/unist': 2.0.10 - longest-streak: 3.1.0 - mdast-util-phrasing: 3.0.1 - mdast-util-to-string: 3.2.0 - micromark-util-decode-string: 1.1.0 - unist-util-visit: 4.1.2 - zwitch: 2.0.4 - dev: true - /mdast-util-to-string@2.0.0: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} dev: false - /mdast-util-to-string@3.2.0: - resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} - dependencies: - '@types/mdast': 3.0.15 - dev: true - /mdn-data@2.0.14: resolution: {integrity: sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==} - /mdn-data@2.0.4: - resolution: {integrity: sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA==} - dev: true - /mdurl@1.0.1: resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} dev: false @@ -24453,250 +22327,6 @@ packages: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} - /micromark-core-commonmark@1.1.0: - resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-factory-destination: 1.1.0 - micromark-factory-label: 1.1.0 - micromark-factory-space: 1.1.0 - micromark-factory-title: 1.1.0 - micromark-factory-whitespace: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-chunked: 1.1.0 - micromark-util-classify-character: 1.1.0 - micromark-util-html-tag-name: 1.2.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-resolve-all: 1.1.0 - micromark-util-subtokenize: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-directive@2.2.1: - resolution: {integrity: sha512-ZFKZkNaEqAP86IghX1X7sE8NNnx6kFNq9mSBRvEHjArutTCJZ3LYg6VH151lXVb1JHpmIcW/7rX25oMoIHuSug==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-factory-whitespace: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - parse-entities: 4.0.1 - uvu: 0.5.6 - dev: true - - /micromark-extension-frontmatter@1.1.1: - resolution: {integrity: sha512-m2UH9a7n3W8VAH9JO9y01APpPKmNNNs71P0RbknEmYSaZU5Ghogv38BYO94AI5Xw6OYfxZRdHZZ2nYjs/Z+SZQ==} - dependencies: - fault: 2.0.1 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-extension-gfm-autolink-literal@1.0.5: - resolution: {integrity: sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-sanitize-uri: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-extension-gfm-footnote@1.1.2: - resolution: {integrity: sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==} - dependencies: - micromark-core-commonmark: 1.1.0 - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-sanitize-uri: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-gfm-strikethrough@1.0.7: - resolution: {integrity: sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==} - dependencies: - micromark-util-chunked: 1.1.0 - micromark-util-classify-character: 1.1.0 - micromark-util-resolve-all: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-gfm-table@1.0.7: - resolution: {integrity: sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-gfm-tagfilter@1.0.2: - resolution: {integrity: sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==} - dependencies: - micromark-util-types: 1.1.0 - dev: true - - /micromark-extension-gfm-task-list-item@1.0.5: - resolution: {integrity: sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-extension-gfm@2.0.3: - resolution: {integrity: sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==} - dependencies: - micromark-extension-gfm-autolink-literal: 1.0.5 - micromark-extension-gfm-footnote: 1.1.2 - micromark-extension-gfm-strikethrough: 1.0.7 - micromark-extension-gfm-table: 1.0.7 - micromark-extension-gfm-tagfilter: 1.0.2 - micromark-extension-gfm-task-list-item: 1.0.5 - micromark-util-combine-extensions: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-destination@1.1.0: - resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-label@1.1.0: - resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-factory-space@1.1.0: - resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-title@1.1.0: - resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-factory-whitespace@1.1.0: - resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} - dependencies: - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-character@1.2.0: - resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} - dependencies: - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-chunked@1.1.0: - resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-classify-character@1.1.0: - resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-combine-extensions@1.1.0: - resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} - dependencies: - micromark-util-chunked: 1.1.0 - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-decode-numeric-character-reference@1.1.0: - resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-decode-string@1.1.0: - resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} - dependencies: - decode-named-character-reference: 1.0.2 - micromark-util-character: 1.2.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-encode@1.1.0: - resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} - dev: true - - /micromark-util-html-tag-name@1.2.0: - resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} - dev: true - - /micromark-util-normalize-identifier@1.1.0: - resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} - dependencies: - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-resolve-all@1.1.0: - resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} - dependencies: - micromark-util-types: 1.1.0 - dev: true - - /micromark-util-sanitize-uri@1.2.0: - resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} - dependencies: - micromark-util-character: 1.2.0 - micromark-util-encode: 1.1.0 - micromark-util-symbol: 1.1.0 - dev: true - - /micromark-util-subtokenize@1.1.0: - resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} - dependencies: - micromark-util-chunked: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - dev: true - - /micromark-util-symbol@1.1.0: - resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} - dev: true - - /micromark-util-types@1.1.0: - resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} - dev: true - /micromark@2.11.4: resolution: {integrity: sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA==} dependencies: @@ -24706,30 +22336,6 @@ packages: - supports-color dev: false - /micromark@3.2.0: - resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} - dependencies: - '@types/debug': 4.1.12 - debug: 4.3.4(supports-color@5.5.0) - decode-named-character-reference: 1.0.2 - micromark-core-commonmark: 1.1.0 - micromark-factory-space: 1.1.0 - micromark-util-character: 1.2.0 - micromark-util-chunked: 1.1.0 - micromark-util-combine-extensions: 1.1.0 - micromark-util-decode-numeric-character-reference: 1.1.0 - micromark-util-encode: 1.1.0 - micromark-util-normalize-identifier: 1.1.0 - micromark-util-resolve-all: 1.1.0 - micromark-util-sanitize-uri: 1.2.0 - micromark-util-subtokenize: 1.1.0 - micromark-util-symbol: 1.1.0 - micromark-util-types: 1.1.0 - uvu: 0.5.6 - transitivePeerDependencies: - - supports-color - dev: true - /micromatch@3.1.10: resolution: {integrity: sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==} engines: {node: '>=0.10.0'} @@ -24805,12 +22411,6 @@ packages: engines: {node: '>=4.0.0'} hasBin: true - /mimer@1.1.0: - resolution: {integrity: sha512-y9dVfy2uiycQvDNiAYW6zp49ZhFlXDMr5wfdOiMbdzGM/0N5LNR6HTUn3un+WUQcM0koaw8FMTG1bt5EnHJdvQ==} - engines: {node: '>= 6.0'} - hasBin: true - dev: true - /mimic-fn@1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} engines: {node: '>=4'} @@ -24961,37 +22561,6 @@ packages: minipass: 3.3.6 yallist: 4.0.0 - /mississippi@1.3.1: - resolution: {integrity: sha512-/6rB8YXFbAtsUVRphIRQqB0+9c7VaPHCjVtvto+JqwVxgz8Zz+I+f68/JgQ+Pb4VlZb2svA9OtdXnHHsZz7ltg==} - dependencies: - concat-stream: 1.6.2 - duplexify: 3.7.1 - end-of-stream: 1.4.4 - flush-write-stream: 1.1.1 - from2: 2.3.0 - parallel-transform: 1.2.0 - pump: 1.0.3 - pumpify: 1.5.1 - stream-each: 1.2.3 - through2: 2.0.5 - dev: true - - /mississippi@2.0.0: - resolution: {integrity: sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==} - engines: {node: '>=4.0.0'} - dependencies: - concat-stream: 1.6.2 - duplexify: 3.7.1 - end-of-stream: 1.4.4 - flush-write-stream: 1.1.1 - from2: 2.3.0 - parallel-transform: 1.2.0 - pump: 2.0.1 - pumpify: 1.5.1 - stream-each: 1.2.3 - through2: 2.0.5 - dev: true - /mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} dev: false @@ -25065,17 +22634,6 @@ packages: /moo@0.5.2: resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} - /move-concurrently@1.0.1: - resolution: {integrity: sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==} - dependencies: - aproba: 1.2.0 - copy-concurrently: 1.0.5 - fs-write-stream-atomic: 1.0.10 - mkdirp: 0.5.6 - rimraf: 2.7.1 - run-queue: 1.0.3 - dev: true - /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -25206,10 +22764,6 @@ packages: resolution: {integrity: sha512-JyK96AKVGAwVeMj3MoMhaSXaUNqgMbCRSQB3trUV8tYZfWEzqUBKdK1qJpfuNXgKeHOx1jv/IEYTM659ly7zUA==} dev: true - /nanoid@2.1.11: - resolution: {integrity: sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==} - dev: true - /nanoid@3.3.4: resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -25326,16 +22880,6 @@ packages: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} - /node-fetch-npm@2.0.4: - resolution: {integrity: sha512-iOuIQDWDyjhv9qSDrj9aq/klt6F9z1p2otB3AV7v3zBDcL/x+OfGsvGQZZCcMZbUf4Ujw1xGNQkjvGnVT22cKg==} - engines: {node: '>=4'} - deprecated: This module is not used anymore, npm uses minipass-fetch for its fetch implementation now - dependencies: - encoding: 0.1.13 - json-parse-better-errors: 1.0.2 - safe-buffer: 5.2.1 - dev: true - /node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -25504,27 +23048,12 @@ packages: once: 1.4.0 dev: false - /npm-package-arg@5.1.2: - resolution: {integrity: sha512-wJBsrf0qpypPT7A0LART18hCdyhpCMxeTtcb0X4IZO2jsP6Om7EHN1d9KSKiqD+KVH030RVNpWS9thk+pb7wzA==} - dependencies: - hosted-git-info: 2.8.9 - osenv: 0.1.5 - semver: 5.7.2 - validate-npm-package-name: 3.0.0 - dev: true - - /npm-pick-manifest@1.0.4: - resolution: {integrity: sha512-MKxNdeyOZysPRTTbHtW0M5Fw38Jo/3ARsoGw5qjCfS+XGjvNB/Gb4qtAZUFmKPM2mVum+eX559eHvKywU856BQ==} - dependencies: - npm-package-arg: 5.1.2 - semver: 5.7.2 - dev: true - /npm-run-path@2.0.2: resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} engines: {node: '>=4'} dependencies: path-key: 2.0.1 + dev: false /npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} @@ -25558,10 +23087,6 @@ packages: dev: false optional: true - /nprogress@0.2.0: - resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} - dev: true - /nssocket@0.6.0: resolution: {integrity: sha512-a9GSOIql5IqgWJR3F/JXG4KpJTA3Z53Cj0MeMvGpglytB1nxE4PdFNC0jINe27CS7cGivoynwc054EzCcT3M3w==} engines: {node: '>= 0.10.x'} @@ -25570,12 +23095,6 @@ packages: lazy: 1.0.11 dev: false - /nth-check@1.0.2: - resolution: {integrity: sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg==} - dependencies: - boolbase: 1.0.0 - dev: true - /nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} dependencies: @@ -25686,17 +23205,6 @@ packages: es-abstract: 1.23.3 es-object-atoms: 1.0.0 - /object.getownpropertydescriptors@2.1.7: - resolution: {integrity: sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==} - engines: {node: '>= 0.8'} - dependencies: - array.prototype.reduce: 1.0.6 - call-bind: 1.0.5 - define-properties: 1.2.1 - es-abstract: 1.22.3 - safe-array-concat: 1.0.1 - dev: true - /object.getprototypeof@1.0.6: resolution: {integrity: sha512-gUiHHFVGLDayJsXfudx6KQEA6iMhPnsmAqL0vdBXhtKzTupcgNTGDJfW1a8xw81jjyWN07IRsVsCKyTn9wiJvQ==} engines: {node: '>= 0.4'} @@ -25771,14 +23279,6 @@ packages: engines: {node: ^10.13.0 || >=12.0.0} dev: true - /omit-deep@0.3.0: - resolution: {integrity: sha512-Lbl/Ma59sss2b15DpnWnGmECBRL8cRl/PjPbPMVW+Y8zIQzRrwMaI65Oy6HvxyhYeILVKBJb2LWeG81bj5zbMg==} - engines: {node: '>=0.10.0'} - dependencies: - is-plain-object: 2.0.4 - unset-value: 0.1.2 - dev: true - /omit.js@2.0.2: resolution: {integrity: sha512-hJmu9D+bNB40YpL9jYebQl4lsTW6yEHRTroJzNLqQJYHm7c+NQnJGfZmIWh8S3q3KoaxV1aLhV6B3+0N0/kyJg==} @@ -25830,13 +23330,6 @@ packages: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} dev: false - /open@6.4.0: - resolution: {integrity: sha512-IFenVPgF70fSm1keSd2iDBIDIBZkroLeuffXq+wKTzTJlBpesFWojV9lb8mzOfaAzM1sr7HQHuO0vtV0zYekGg==} - engines: {node: '>=8'} - dependencies: - is-wsl: 1.1.0 - dev: true - /open@8.4.2: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} @@ -25874,16 +23367,6 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 - /ora@1.4.0: - resolution: {integrity: sha512-iMK1DOQxzzh2MBlVsU42G80mnrvUhqsMh74phHtDlrcTZPK0pH6o7l7DRshK+0YsxDyEuaOkziVdvM3T0QTzpw==} - engines: {node: '>=4'} - dependencies: - chalk: 2.4.2 - cli-cursor: 2.1.0 - cli-spinners: 1.3.1 - log-symbols: 2.2.0 - dev: true - /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -25908,11 +23391,6 @@ packages: /os-browserify@0.3.0: resolution: {integrity: sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==} - /os-homedir@1.0.2: - resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} - engines: {node: '>=0.10.0'} - dev: true - /os-locale@1.4.0: resolution: {integrity: sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==} engines: {node: '>=0.10.0'} @@ -25934,13 +23412,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /osenv@0.1.5: - resolution: {integrity: sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==} - dependencies: - os-homedir: 1.0.2 - os-tmpdir: 1.0.2 - dev: true - /osx-release@1.1.0: resolution: {integrity: sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==} engines: {node: '>=0.10.0'} @@ -25979,6 +23450,7 @@ packages: /p-finally@1.0.0: resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} engines: {node: '>=4'} + dev: false /p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} @@ -26057,16 +23529,6 @@ packages: netmask: 2.0.2 dev: false - /package-json@4.0.1: - resolution: {integrity: sha512-q/R5GrMek0vzgoomq6rm9OX+3PQve8sLwTirmK30YB3Cu0Bbt9OX9M/SIUnroN5BGJkzwGsFwDaRGD9EwBOlCA==} - engines: {node: '>=4'} - dependencies: - got: 6.7.1 - registry-auth-token: 3.4.0 - registry-url: 3.1.0 - semver: 5.7.2 - dev: true - /package-json@6.5.0: resolution: {integrity: sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==} engines: {node: '>=8'} @@ -26080,48 +23542,12 @@ packages: /packet-reader@1.0.0: resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} - /pacote@2.7.38: - resolution: {integrity: sha512-XxHUyHQB7QCVBxoXeVu0yKxT+2PvJucsc0+1E+6f95lMUxEAYERgSAc71ckYXrYr35Ew3xFU/LrhdIK21GQFFA==} - dependencies: - bluebird: 3.7.2 - cacache: 9.3.0 - glob: 7.2.3 - lru-cache: 4.1.5 - make-fetch-happen: 2.6.0 - minimatch: 3.1.2 - mississippi: 1.3.1 - normalize-package-data: 2.5.0 - npm-package-arg: 5.1.2 - npm-pick-manifest: 1.0.4 - osenv: 0.1.5 - promise-inflight: 1.0.1(bluebird@3.7.2) - promise-retry: 1.1.1 - protoduck: 4.0.0 - safe-buffer: 5.2.1 - semver: 5.7.2 - ssri: 4.1.6 - tar-fs: 1.16.3 - tar-stream: 1.6.2 - unique-filename: 1.1.1 - which: 1.3.1 - transitivePeerDependencies: - - supports-color - dev: true - /pako@0.2.9: resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==} /pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - /parallel-transform@1.2.0: - resolution: {integrity: sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==} - dependencies: - cyclist: 1.0.2 - inherits: 2.0.4 - readable-stream: 2.3.8 - dev: true - /param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} dependencies: @@ -26160,19 +23586,6 @@ packages: is-hexadecimal: 1.0.4 dev: false - /parse-entities@4.0.1: - resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} - dependencies: - '@types/unist': 2.0.10 - character-entities: 2.0.2 - character-entities-legacy: 3.0.0 - character-reference-invalid: 2.0.1 - decode-named-character-reference: 1.0.2 - is-alphanumerical: 2.0.1 - is-decimal: 2.0.1 - is-hexadecimal: 2.0.1 - dev: true - /parse-filepath@1.0.2: resolution: {integrity: sha512-FwdRXKCohSVeXqwtYonZTXtbGJKrn+HNyWDYVcp5yuJlesTwNH4rsmRZ+GrKAPJ5bLpRxESMeS+Rl0VCHRvB2Q==} engines: {node: '>=0.8'} @@ -26182,23 +23595,6 @@ packages: path-root: 0.1.1 dev: false - /parse-git-config@0.2.0: - resolution: {integrity: sha512-amapZFADOJtHvX2URcRfbzG2OFcW+UAwmdK2kht2N2vsH5Py65VxI5yZTlD2DjmxVhTz6htFoVCxROYUJaYOXQ==} - engines: {node: '>=0.10.0'} - dependencies: - ini: 1.3.8 - dev: true - - /parse-git-config@1.1.1: - resolution: {integrity: sha512-S3LGXJZVSy/hswvbSkfdbKBRVsnqKrVu6j8fcvdtJ4TxosSELyQDsJPuGPXuZ+EyuYuJd3O4uAF8gcISR0OFrQ==} - engines: {node: '>=0.10.0'} - dependencies: - extend-shallow: 2.0.1 - fs-exists-sync: 0.1.0 - git-config-path: 1.0.1 - ini: 1.3.8 - dev: true - /parse-github-url@1.0.2: resolution: {integrity: sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==} engines: {node: '>=0.10.0'} @@ -26233,6 +23629,7 @@ packages: /parse-passwd@1.0.0: resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} engines: {node: '>=0.10.0'} + dev: false /parse-srcset@1.0.2: resolution: {integrity: sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q==} @@ -26245,19 +23642,6 @@ packages: /parse5@6.0.1: resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==} - /parse5@7.1.2: - resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} - dependencies: - entities: 4.5.0 - dev: true - - /parseley@0.12.1: - resolution: {integrity: sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw==} - dependencies: - leac: 0.6.0 - peberminta: 0.9.0 - dev: true - /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -26308,10 +23692,12 @@ packages: /path-is-inside@1.0.2: resolution: {integrity: sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==} + dev: false /path-key@2.0.1: resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} engines: {node: '>=4'} + dev: false /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} @@ -26426,10 +23812,6 @@ packages: - supports-color dev: true - /peberminta@0.9.0: - resolution: {integrity: sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==} - dev: true - /pend@1.2.0: resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} @@ -26638,11 +24020,6 @@ packages: extend-shallow: 3.0.2 dev: false - /pluralize@8.0.0: - resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} - engines: {node: '>=4'} - dev: true - /pm2-axon-rpc@0.7.1: resolution: {integrity: sha512-FbLvW60w+vEyvMjP/xom2UPhUN/2bVpdtLfKJeYM3gwzYhoTEEChCOICfFzxkxuoEleOlnpjie+n1nue91bDQw==} engines: {node: '>=5'} @@ -27226,11 +24603,6 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} - /prepend-http@1.0.4: - resolution: {integrity: sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==} - engines: {node: '>=0.10.0'} - dev: true - /prepend-http@2.0.0: resolution: {integrity: sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==} engines: {node: '>=4'} @@ -27243,23 +24615,6 @@ packages: fast-diff: 1.3.0 dev: false - /prettier-plugin-organize-imports@3.2.4(prettier@3.2.5)(typescript@4.9.5): - resolution: {integrity: sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==} - peerDependencies: - '@volar/vue-language-plugin-pug': ^1.0.4 - '@volar/vue-typescript': ^1.0.4 - prettier: '>=2.0' - typescript: '>=2.9' - peerDependenciesMeta: - '@volar/vue-language-plugin-pug': - optional: true - '@volar/vue-typescript': - optional: true - dependencies: - prettier: 3.2.5 - typescript: 4.9.5 - dev: true - /prettier-plugin-organize-imports@3.2.4(prettier@3.2.5)(typescript@5.4.4): resolution: {integrity: sha512-6m8WBhIp0dfwu0SkgfOxJqh+HpdyfqSSLfKKRZSFbDuEQXDDndb8fTpRWkUrX/uBenkex3MgnVk0J3b3Y5byog==} peerDependencies: @@ -27421,23 +24776,6 @@ packages: hasBin: true dev: true - /prism-react-renderer@1.3.5(react@18.2.0): - resolution: {integrity: sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg==} - peerDependencies: - react: '>=0.14.9' - dependencies: - react: 18.2.0 - dev: true - - /prism-themes@1.9.0: - resolution: {integrity: sha512-tX2AYsehKDw1EORwBps+WhBFKc2kxfoFpQAjxBndbZKr4fRmMkv47XN0BghC/K1qwodB1otbe4oF23vUTFDokw==} - dev: true - - /prismjs@1.29.0: - resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} - engines: {node: '>=6'} - dev: true - /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -27453,23 +24791,16 @@ packages: engines: {node: '>=18'} dev: false - /promise-inflight@1.0.1(bluebird@3.7.2): + /promise-inflight@1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} + requiresBuild: true peerDependencies: bluebird: '*' peerDependenciesMeta: bluebird: optional: true - dependencies: - bluebird: 3.7.2 - - /promise-retry@1.1.1: - resolution: {integrity: sha512-StEy2osPr28o17bIW776GtwO6+Q+M9zPiZkYfosciUUMYqjhU/ffwRAH0zN2+uvGyUsn8/YICIHRzLbPacpZGw==} - engines: {node: '>=0.12'} - dependencies: - err-code: 1.1.2 - retry: 0.10.1 - dev: true + dev: false + optional: true /promise-retry@2.0.1: resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} @@ -27494,20 +24825,10 @@ packages: object-assign: 4.1.1 react-is: 16.13.1 - /property-information@6.4.0: - resolution: {integrity: sha512-9t5qARVofg2xQqKtytzt+lZ4d1Qvj8t5B8fEwXK6qOfgRLgH/b13QlgEyDh033NOS31nXeFbYv7CLUDG1CeifQ==} - dev: true - /proto-list@1.2.4: resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} dev: false - /protoduck@4.0.0: - resolution: {integrity: sha512-9sxuz0YTU/68O98xuDn8NBxTVH9EuMhrBTxZdiBL0/qxRmWhB/5a8MagAebDa+98vluAZTs8kMZibCdezbRCeQ==} - dependencies: - genfun: 4.0.1 - dev: true - /proxy-agent@6.3.1: resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==} engines: {node: '>= 14'} @@ -27547,18 +24868,12 @@ packages: randombytes: 2.1.0 safe-buffer: 5.2.1 - /pump@1.0.3: - resolution: {integrity: sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==} - dependencies: - end-of-stream: 1.4.4 - once: 1.4.0 - dev: true - /pump@2.0.1: resolution: {integrity: sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==} dependencies: end-of-stream: 1.4.4 once: 1.4.0 + dev: false /pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} @@ -27572,6 +24887,7 @@ packages: duplexify: 3.7.1 inherits: 2.0.4 pump: 2.0.1 + dev: false /punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} @@ -27637,12 +24953,6 @@ packages: resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} dev: true - /queue@6.0.1: - resolution: {integrity: sha512-AJBQabRCCNr9ANq8v77RJEv73DPbn55cdTb+Giq4X0AVnNVZvMHlYp7XlQiN+1npCZj1DuSmaA2hYVUUDgxFDg==} - dependencies: - inherits: 2.0.4 - dev: true - /queue@6.0.2: resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} dependencies: @@ -27686,10 +24996,6 @@ packages: /railroad-diagrams@1.0.0: resolution: {integrity: sha512-cz93DjNeLY0idrCNOH6PviZGRN9GJhsdm9hpn1YCS879fj4W+x5IFJhhkRZcwVgMmFF7R82UA/7Oh+R8lLZg6A==} - /ramda@0.29.0: - resolution: {integrity: sha512-BBea6L67bYLtdbOqfp8f58fPMqEwx0doL+pAi8TZyp2YWz8R9G8z9x75CZI8W+ftqhFHCpEX2cRnUUXK130iKA==} - dev: true - /randexp@0.4.6: resolution: {integrity: sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==} engines: {node: '>=0.12'} @@ -27723,17 +25029,6 @@ packages: unpipe: 1.0.0 dev: false - /raw-loader@4.0.2(webpack@5.91.0): - resolution: {integrity: sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==} - engines: {node: '>= 10.13.0'} - peerDependencies: - webpack: ^4.0.0 || ^5.0.0 - dependencies: - loader-utils: 2.0.4 - schema-utils: 3.3.0 - webpack: 5.91.0 - dev: true - /rbush@3.0.1: resolution: {integrity: sha512-XRaVO0YecOpEuIvbhbpTrZgoiI6xBlz6hnlr6EHhd+0x9ase6EmeN+hdwwUaJvLcsFFQ8iWVF1GAK1yB0BWi0w==} dependencies: @@ -27809,21 +25104,6 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - /rc-drawer@6.5.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-QckxAnQNdhh4vtmKN0ZwDf3iakO83W9eZcSKWYYTDv4qcD2fHhRAZJJ/OE6v2ZlQ2kSqCJX5gYssF4HJFvsEPQ==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@babel/runtime': 7.24.1 - '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) - classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /rc-drawer@7.1.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-nBE1rF5iZvpavoyqhSSz2mk/yANltA7g3aF0U45xkx381n3we/RKs9cJfNKp9mSWCedOKWt9FLEwZDaAaOGn2w==} peerDependencies: @@ -27838,20 +25118,6 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - /rc-dropdown@4.1.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-VZjMunpBdlVzYpEdJSaV7WM7O0jf8uyDjirxXLZRNZ+tAC+NzD3PXPEtliFwGzVwBBdCmGuSqiS9DWcOLxQ9tw==} - peerDependencies: - react: '>=16.11.0' - react-dom: '>=16.11.0' - dependencies: - '@babel/runtime': 7.24.4 - '@rc-component/trigger': 1.18.3(react-dom@18.2.0)(react@18.2.0) - classnames: 2.5.1 - rc-util: 5.38.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /rc-dropdown@4.2.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-odM8Ove+gSh0zU27DUj5cG1gNKg7mLWBYzB5E4nNLrLwBmYEgYP43vHKDGOVZcJSVElQBI0+jTQgjnq0NfLjng==} peerDependencies: @@ -27949,22 +25215,6 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - /rc-menu@9.12.4(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-t2NcvPLV1mFJzw4F21ojOoRVofK2rWhpKPx69q2raUsiHPDP6DDevsBILEYdsIegqBeSXoWs2bf6CueBKg3BFg==} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@babel/runtime': 7.24.4 - '@rc-component/trigger': 1.18.3(react-dom@18.2.0)(react@18.2.0) - classnames: 2.5.1 - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.38.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /rc-menu@9.13.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-1l8ooCB3HcYJKCltC/s7OxRKRjgymdl9htrCeGZcXNaMct0RxZRK6OPV3lPhVksIvAGMgzPd54ClpZ5J4b8cZA==} peerDependencies: @@ -28219,24 +25469,6 @@ packages: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - /rc-tabs@12.15.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-aXFLRo7jo531Jed1LgRqrF0VmRnzM/Qki25PknM3S04gqyxpDaHNFpPba05pHhn+d1N+54qIi0IcY1odrCrF2A==} - engines: {node: '>=8.x'} - peerDependencies: - react: '>=16.9.0' - react-dom: '>=16.9.0' - dependencies: - '@babel/runtime': 7.24.4 - classnames: 2.5.1 - rc-dropdown: 4.1.0(react-dom@18.2.0)(react@18.2.0) - rc-menu: 9.12.4(react-dom@18.2.0)(react@18.2.0) - rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0) - rc-resize-observer: 1.4.0(react-dom@18.2.0)(react@18.2.0) - rc-util: 5.39.1(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - dev: true - /rc-tabs@14.1.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-5nOr9PVpJy2SWHTLgv1+kESDOb0tFzl0cYU9r9d8LfL0Wg9i/n1B558rmkxdQHgBwMqxmwoyPSAbQROxMQe8nw==} engines: {node: '>=8.x'} @@ -28354,6 +25586,7 @@ packages: rc-virtual-list: 3.11.3(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: false /rc-tree@5.8.5(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-PRfcZtVDNkR7oh26RuNe1hpw11c1wfgzwmPFL0lnxGnYefe9lDAO6cg5wJKIAwyXFVt5zHgpjYmaz0CPy1ZtKg==} @@ -28433,6 +25666,7 @@ packages: rc-util: 5.38.1(react-dom@18.2.0)(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + dev: false /rc-virtual-list@3.11.4(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-NbBi0fvyIu26gP69nQBiWgUMTPX3mr4FcuBQiVqagU0BnuX8WQkiivnMs105JROeuUIFczLrlgUhLQwTWV1XDA==} @@ -28456,6 +25690,7 @@ packages: ini: 1.3.8 minimist: 1.2.8 strip-json-comments: 2.0.1 + dev: false /react-beautiful-dnd@13.1.1(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-0Lvs4tq2VcrEjEgDXHjT98r+63drkKEgqyxdA7qD3mvKwga6a5SscbdLPO2IExotU1jW8L0Ksdl0Cj2AF67nPQ==} @@ -28511,16 +25746,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: true - /react-copy-to-clipboard@5.1.0(react@18.2.0): - resolution: {integrity: sha512-k61RsNgAayIJNoy9yDsYzDe/yAZAzEbEgcz3DZMhF686LEyukcE1hzurxe85JandPUG+yTfGVFzuEw3xt8WP/A==} - peerDependencies: - react: ^15.3.0 || 16 || 17 || 18 - dependencies: - copy-to-clipboard: 3.3.3 - prop-types: 15.8.1 - react: 18.2.0 - dev: true - /react-dom@18.1.0(react@18.1.0): resolution: {integrity: sha512-fU1Txz7Budmvamp7bshe4Zi32d0ll7ect+ccxNu9FlObT605GOEB8BfO4tmRJ39R5Zj831VCpvQ05QPBW5yb+w==} peerDependencies: @@ -28661,29 +25886,6 @@ packages: react-modal: 3.16.1(react-dom@18.2.0)(react@18.2.0) dev: false - /react-intl@6.5.5(react@18.2.0)(typescript@4.9.5): - resolution: {integrity: sha512-cI5UKvBh4tc1zxLIziHBYGMX3dhYWDEFlvUDVN6NfT2i96zTXz/zH2AmM8+2waqgOhwkFUzd+7kK1G9q7fiC2g==} - peerDependencies: - react: ^16.6.0 || 17 || 18 - typescript: '5' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@formatjs/ecma402-abstract': 1.18.0 - '@formatjs/icu-messageformat-parser': 2.7.3 - '@formatjs/intl': 2.9.9(typescript@4.9.5) - '@formatjs/intl-displaynames': 6.6.4 - '@formatjs/intl-listformat': 7.5.3 - '@types/hoist-non-react-statics': 3.3.5 - '@types/react': 18.2.75 - hoist-non-react-statics: 3.3.2 - intl-messageformat: 10.5.8 - react: 18.2.0 - tslib: 2.6.2 - typescript: 4.9.5 - dev: true - /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} @@ -28947,25 +26149,6 @@ packages: dependencies: loose-envify: 1.4.0 - /reactflow@11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-Q616fElAc5/N37tMwjuRkkgm/VgmnLLTNNCj61z5mvJxae+/VXZQMfot1K6a5LLz9G3SVKqU97PMb9Ga1PRXew==} - peerDependencies: - react: '>=17' - react-dom: '>=17' - dependencies: - '@reactflow/background': 11.3.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@reactflow/controls': 11.2.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@reactflow/core': 11.10.1(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@reactflow/minimap': 11.7.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@reactflow/node-resizer': 2.2.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - '@reactflow/node-toolbar': 1.3.6(@types/react@18.2.75)(react-dom@18.2.0)(react@18.2.0) - react: 18.2.0 - react-dom: 18.2.0(react@18.2.0) - transitivePeerDependencies: - - '@types/react' - - immer - dev: true - /read-ini-file@4.0.0: resolution: {integrity: sha512-zz4qv/sKETv7nAkATqSJ9YMbKD8NXRPuA8d17VdYCuNYrVstB1S6UAMU6aytf5vRa9MESbZN7jLZdcmrOxz4gg==} engines: {node: '>=14.6'} @@ -29229,13 +26412,6 @@ packages: safe-buffer: 5.2.1 dev: false - /registry-auth-token@3.4.0: - resolution: {integrity: sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==} - dependencies: - rc: 1.2.8 - safe-buffer: 5.2.1 - dev: true - /registry-auth-token@4.2.2: resolution: {integrity: sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==} engines: {node: '>=6.0.0'} @@ -29248,6 +26424,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: rc: 1.2.8 + dev: false /registry-url@5.1.0: resolution: {integrity: sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==} @@ -29263,103 +26440,10 @@ packages: jsesc: 0.5.0 dev: false - /rehype-autolink-headings@6.1.1: - resolution: {integrity: sha512-NMYzZIsHM3sA14nC5rAFuUPIOfg+DFmf9EY1YMhaNlB7+3kK/ZlE6kqPfuxr1tsJ1XWkTrMtMoyHosU70d35mA==} - dependencies: - '@types/hast': 2.3.8 - extend: 3.0.2 - hast-util-has-property: 2.0.1 - hast-util-heading-rank: 2.1.1 - hast-util-is-element: 2.1.3 - unified: 10.1.2 - unist-util-visit: 4.1.2 - dev: true - - /rehype-remove-comments@5.0.0: - resolution: {integrity: sha512-sfiVT+u1in19sxo9vv/SDQVbHE2mADScNrpeVsUxBFl14zOMZnfPb6l4hR+lXqe10G13UFVqv5pt8zDbCR4JYQ==} - dependencies: - '@types/hast': 2.3.8 - hast-util-is-conditional-comment: 2.0.0 - unified: 10.1.2 - unist-util-filter: 4.0.1 - dev: true - - /rehype-stringify@9.0.4: - resolution: {integrity: sha512-Uk5xu1YKdqobe5XpSskwPvo1XeHUUucWEQSl8hTrXt5selvca1e8K1EZ37E6YoZ4BT8BCqCdVfQW7OfHfthtVQ==} - dependencies: - '@types/hast': 2.3.8 - hast-util-to-html: 8.0.4 - unified: 10.1.2 - dev: true - /relateurl@0.2.7: resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} engines: {node: '>= 0.10'} - /remark-directive@2.0.1: - resolution: {integrity: sha512-oosbsUAkU/qmUE78anLaJePnPis4ihsE7Agp0T/oqTzvTea8pOiaYEtfInU/+xMOVTS9PN5AhGOiaIVe4GD8gw==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-directive: 2.2.4 - micromark-extension-directive: 2.2.1 - unified: 10.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /remark-frontmatter@4.0.1: - resolution: {integrity: sha512-38fJrB0KnmD3E33a5jZC/5+gGAC2WKNiPw1/fdXJvijBlhA7RCsvJklrYJakS0HedninvaCYW8lQGf9C918GfA==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-frontmatter: 1.0.1 - micromark-extension-frontmatter: 1.1.1 - unified: 10.1.2 - dev: true - - /remark-gfm@3.0.1: - resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-gfm: 2.0.2 - micromark-extension-gfm: 2.0.3 - unified: 10.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /remark-parse@10.0.2: - resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} - dependencies: - '@types/mdast': 3.0.15 - mdast-util-from-markdown: 1.3.1 - unified: 10.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /remark-rehype@10.1.0: - resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} - dependencies: - '@types/hast': 2.3.8 - '@types/mdast': 3.0.15 - mdast-util-to-hast: 12.3.0 - unified: 10.1.2 - dev: true - - /remote-origin-url@0.4.0: - resolution: {integrity: sha512-HYhdsT2pNd0LP4Osb0vtQ1iassxIc3Yk1oze7j8dMJFciMkW8e0rdg9E/mOunqtSVHSzvMfwLDIYzPnEDmpk6Q==} - engines: {node: '>= 0.8.0'} - dependencies: - parse-git-config: 0.2.0 - dev: true - - /remote-origin-url@0.5.3: - resolution: {integrity: sha512-crQ7Xk1m/F2IiwBx5oTqk/c0hjoumrEz+a36+ZoVupskQRE/q7pAwHKsTNeiZ31sbSTELvVlVv4h1W0Xo5szKg==} - engines: {node: '>= 0.8.0'} - dependencies: - parse-git-config: 1.1.1 - dev: true - /remove-bom-buffer@3.0.0: resolution: {integrity: sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==} engines: {node: '>=0.10.0'} @@ -29381,11 +26465,6 @@ packages: resolution: {integrity: sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==} dev: false - /rename-keys@1.2.0: - resolution: {integrity: sha512-U7XpAktpbSgHTRSNRrjKSrjYkZKuhUukfoBlXWXUExCAqhzh1TU3BDRAfJmarcl5voKS+pbKU9MvyLWKZ4UEEg==} - engines: {node: '>= 0.8.0'} - dev: true - /renderkid@3.0.0: resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} dependencies: @@ -29494,14 +26573,6 @@ packages: /resize-observer-polyfill@1.5.1: resolution: {integrity: sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==} - /resolve-dir@0.1.1: - resolution: {integrity: sha512-QxMPqI6le2u0dCLyiGzgy92kjkkL6zO0XyvHzjdTNH3zM6e5Hz3BwG6+aEyNgiQ5Xz6PwTwgQEj3U50dByPKIA==} - engines: {node: '>=0.10.0'} - dependencies: - expand-tilde: 1.2.2 - global-modules: 0.2.3 - dev: true - /resolve-dir@1.0.1: resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} engines: {node: '>=0.10.0'} @@ -29604,10 +26675,6 @@ packages: /retry-as-promised@7.0.4: resolution: {integrity: sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==} - /retry@0.10.1: - resolution: {integrity: sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==} - dev: true - /retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} @@ -29786,12 +26853,6 @@ packages: dependencies: queue-microtask: 1.2.3 - /run-queue@1.0.3: - resolution: {integrity: sha512-ntymy489o0/QQplUDnpYAYUsO50K9SBrIVaKCWDOJzYJts0f9WH9RFJkyagebkw5+y1oi00R7ynNW/d12GBumg==} - dependencies: - aproba: 1.2.0 - dev: true - /run-series@1.1.9: resolution: {integrity: sha512-Arc4hUN896vjkqCYrUXquBFtRZdv1PfLbTYP71efP6butxyQ0kWpiNJyAgsxscmQg1cqvHY32/UCBzXedTpU2g==} dev: false @@ -29815,13 +26876,6 @@ packages: dependencies: tslib: 2.6.2 - /sade@1.8.1: - resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} - engines: {node: '>=6'} - dependencies: - mri: 1.2.0 - dev: true - /safe-array-concat@1.0.1: resolution: {integrity: sha512-6XbUAseYE2KtOuGueyeobCySj9L4+66Tn6KQMOPQJrAJEowYKW/YR/MGJZl7FdydUdaFu4LYyDZjxf4/Nmo23Q==} engines: {node: '>=0.4'} @@ -29894,19 +26948,6 @@ packages: postcss: 8.4.35 dev: false - /sass@1.69.5: - resolution: {integrity: sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==} - engines: {node: '>=14.0.0'} - hasBin: true - dependencies: - chokidar: 3.6.0 - immutable: 4.3.4 - source-map-js: 1.0.2 - - /sax@1.2.4: - resolution: {integrity: sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==} - dev: true - /sax@1.3.0: resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} @@ -29965,12 +27006,6 @@ packages: dependencies: commander: 2.20.3 - /selderee@0.11.0: - resolution: {integrity: sha512-5TF+l7p4+OsnP8BCCvSyZiSPc4x4//p5uPwK8TCnVPJYRmU2aYKMpOXvw8zM5a5JvuuCGN1jmsMwuU2W02ukfA==} - dependencies: - parseley: 0.12.1 - dev: true - /select-hose@2.0.0: resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} @@ -29983,6 +27018,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: semver: 5.7.2 + dev: false /semver-greatest-satisfied-range@1.1.0: resolution: {integrity: sha512-Ny/iyOzSSa8M5ML46IAx3iXc6tfOsYU2R4AXi2UpHk60Zrgyq6eqPj/xiOfS0rRl/iiQ/rdJkVjw/5cdUyCntQ==} @@ -30225,13 +27261,6 @@ packages: resolution: {integrity: sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==} dev: false - /shortid@2.2.16: - resolution: {integrity: sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - dependencies: - nanoid: 2.1.11 - dev: true - /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: @@ -30283,17 +27312,6 @@ packages: dependencies: is-arrayish: 0.3.2 - /sitemap@7.1.1: - resolution: {integrity: sha512-mK3aFtjz4VdJN0igpIJrinf3EO8U8mxOPsTBzSsy06UtjZQJ3YY3o3Xa7zSc5nMqcMrRwlChHZ18Kxg0caiPBg==} - engines: {node: '>=12.0.0', npm: '>=5.6.0'} - hasBin: true - dependencies: - '@types/node': 20.12.7 - '@types/sax': 1.2.7 - arg: 5.0.2 - sax: 1.3.0 - dev: true - /size-sensor@1.0.2: resolution: {integrity: sha512-2NCmWxY7A9pYKGXNBfteo4hy14gWu47rg5692peVMst6lQLPKrVjhY+UTEsPI5ceFRJSl3gVgMYaUi/hKuaiKw==} dev: false @@ -30335,11 +27353,6 @@ packages: resolution: {integrity: sha512-KyFkIfr8QBlFG3uc3NaljaXdYcsbRy1KrSfc4tsQV8jW68jAktGeOcifu530Vx/5LC+PULHT0Rv8LiI8Gw+c1g==} dev: true - /smart-buffer@1.1.15: - resolution: {integrity: sha512-1+8bxygjTsNfvQe0/0pNBesTOlSHtOeG6b6LYbvsZCCHDKYZ40zcQo6YTnZBWrBSLWOCbrHljLdEmGMYebu7aQ==} - engines: {node: '>= 0.10.15', npm: '>= 1.3.5'} - dev: true - /smart-buffer@4.2.0: resolution: {integrity: sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==} engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} @@ -30390,13 +27403,6 @@ packages: - supports-color dev: false - /socks-proxy-agent@3.0.1: - resolution: {integrity: sha512-ZwEDymm204mTzvdqyUqOdovVr2YRd2NYskrYrF2LXyZ9qDiMAoFESGK8CRphiO7rtbo2Y757k2Nia3x2hGtalA==} - dependencies: - agent-base: 4.3.0 - socks: 1.1.10 - dev: true - /socks-proxy-agent@6.2.1: resolution: {integrity: sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==} engines: {node: '>= 10'} @@ -30421,15 +27427,6 @@ packages: - supports-color dev: false - /socks@1.1.10: - resolution: {integrity: sha512-ArX4vGPULWjKDKgUnW8YzfI2uXW7kzgkJuB0GnFBA/PfT3exrrOk+7Wk2oeb894Qf20u1PWv9LEgrO0Z82qAzA==} - engines: {node: '>= 0.10.0', npm: '>= 1.3.5'} - deprecated: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0 - dependencies: - ip: 1.1.8 - smart-buffer: 1.1.15 - dev: true - /socks@2.7.1: resolution: {integrity: sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==} engines: {node: '>= 10.13.0', npm: '>= 3.0.0'} @@ -30485,6 +27482,7 @@ packages: /source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + dev: false /source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} @@ -30501,14 +27499,6 @@ packages: urix: 0.1.0 dev: false - /source-map-resolve@0.6.0: - resolution: {integrity: sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==} - deprecated: See https://github.com/lydell/source-map-resolve#deprecated - dependencies: - atob: 2.1.2 - decode-uri-component: 0.2.2 - dev: true - /source-map-support@0.3.3: resolution: {integrity: sha512-9O4+y9n64RewmFoKUZ/5Tx9IHIcXM6Q+RTSw6ehnqybUz4a7iwR3Eaw80uLtqqQ5D0C+5H03D4KKGo9PdP33Gg==} dependencies: @@ -30550,10 +27540,6 @@ packages: whatwg-url: 7.1.0 dev: false - /space-separated-tokens@2.0.2: - resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} - dev: true - /sparkles@1.0.1: resolution: {integrity: sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==} engines: {node: '>= 0.10'} @@ -30689,18 +27675,6 @@ packages: tweetnacl: 0.14.5 dev: true - /ssri@4.1.6: - resolution: {integrity: sha512-WUbCdgSAMQjTFZRWvSPpauryvREEA+Krn19rx67UlJEJx/M192ZHxMmJXjZ4tkdFm+Sb0SXGlENeQVlA5wY7kA==} - dependencies: - safe-buffer: 5.2.1 - dev: true - - /ssri@5.3.0: - resolution: {integrity: sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==} - dependencies: - safe-buffer: 5.2.1 - dev: true - /ssri@8.0.1: resolution: {integrity: sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==} engines: {node: '>= 8'} @@ -30778,13 +27752,6 @@ packages: readable-stream: 3.6.2 dev: true - /stream-each@1.2.3: - resolution: {integrity: sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==} - dependencies: - end-of-stream: 1.4.4 - stream-shift: 1.0.1 - dev: true - /stream-exhaust@1.0.2: resolution: {integrity: sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==} dev: false @@ -30810,6 +27777,7 @@ packages: /stream-shift@1.0.1: resolution: {integrity: sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==} + dev: false /stream-shift@1.0.3: resolution: {integrity: sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==} @@ -30978,13 +27946,6 @@ packages: dependencies: safe-buffer: 5.2.1 - /stringify-entities@4.0.3: - resolution: {integrity: sha512-BP9nNHMhhfcMbiuQKCqMjhDP5yBCAxsPu4pHFFzJ6Alo9dZgY4VLDPutXqIjpRiMoKdp7Av85Gr73Q5uH9k7+g==} - dependencies: - character-entities-html4: 2.1.0 - character-entities-legacy: 3.0.0 - dev: true - /strip-ansi@3.0.1: resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} engines: {node: '>=0.10.0'} @@ -31044,6 +28005,7 @@ packages: /strip-eof@1.0.0: resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} engines: {node: '>=0.10.0'} + dev: false /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} @@ -31062,6 +28024,7 @@ packages: /strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} + dev: false /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -31079,12 +28042,6 @@ packages: /style-search@0.1.0: resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==} - /style-to-object@0.4.4: - resolution: {integrity: sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==} - dependencies: - inline-style-parser: 0.1.1 - dev: true - /styled-components@5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0): resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} engines: {node: '>=10'} @@ -31278,33 +28235,9 @@ packages: resolution: {integrity: sha512-jGCUqcQyXpfe38R7RFfhrMyfXcBmpMNJI/B+4CE9/Unkh98UporAc461GTthv+TVDuZXsBx7/WiwJb1Oh4tt4A==} dev: true - /svg-pathdata@5.0.5: - resolution: {integrity: sha512-TAAvLNSE3fEhyl/Da19JWfMAdhSXTYeviXsLSoDT1UM76ADj5ndwAPX1FKQEgB/gFMPavOy6tOqfalXKUiXrow==} - engines: {node: '>=6.9.5'} - dev: true - /svg-tags@1.0.0: resolution: {integrity: sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==} - /svgo-browser@1.3.8: - resolution: {integrity: sha512-yOgDNIcewFZN3+jXdWeh/rQzbWJjCq1dTHphLz2r4T4AfTm+nqCxZ5B89v9bjQbFKA/s/k7TUc7J90+pP2HTyw==} - engines: {node: '>=4.0.0'} - hasBin: true - dependencies: - chalk: 2.4.2 - coa: 2.0.2 - css-select: 2.1.0 - css-select-base-adapter: 0.1.1 - css-tree: 1.0.0-alpha.37 - csso: 4.2.0 - js-yaml: 3.14.1 - mkdirp: 0.5.6 - sax: 1.2.4 - stable: 0.1.8 - unquote: 1.1.1 - util.promisify: 1.0.1 - dev: true - /svgo@2.8.0: resolution: {integrity: sha512-+N/Q9kV1+F+UeWYoSiULYo4xYSDQlTgb+ayMobAXPwMnLvop7oxKMo9OzIrX5x3eS4L4f2UHhc9axXwY8DpChg==} engines: {node: '>=10.13.0'} @@ -31318,14 +28251,6 @@ packages: picocolors: 1.0.0 stable: 0.1.8 - /svgson@4.1.0: - resolution: {integrity: sha512-DodISxHtdLKUghDYA+PGK4Qq350+CbBAkdvGLkBFSmWd9WKSg4dijgjB1IiRPTmsUCd+a7KYe+ILHtklYgQyzQ==} - dependencies: - deep-rename-keys: 0.2.1 - omit-deep: 0.3.0 - xml-reader: 2.4.3 - dev: true - /swagger-ui-dist@5.10.5: resolution: {integrity: sha512-Uv8E7hV/nXALQKgW86X1i58gl1O6DFg+Uq54sDwhYqucBBxj/47dLNw872TNILNlOTuPA6dRvUMGQdmlpaX8qQ==} dev: true @@ -31417,15 +28342,6 @@ packages: resolve: 1.22.8 string.prototype.trim: 1.2.8 - /tar-fs@1.16.3: - resolution: {integrity: sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==} - dependencies: - chownr: 1.1.4 - mkdirp: 0.5.6 - pump: 1.0.3 - tar-stream: 1.6.2 - dev: true - /tar-fs@3.0.4: resolution: {integrity: sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==} dependencies: @@ -31509,6 +28425,7 @@ packages: engines: {node: '>=4'} dependencies: execa: 0.7.0 + dev: false /term-size@2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} @@ -31568,11 +28485,6 @@ packages: /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - /textextensions@2.6.0: - resolution: {integrity: sha512-49WtAWS+tcsy93dRt6P0P3AMD2m5PvXRhuEA0kaXos5ZLlujtYmpmFsB+QvWUSxE1ZsstmYXfQ7L40+EcQgpAQ==} - engines: {node: '>=0.8'} - dev: true - /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -31611,6 +28523,7 @@ packages: dependencies: readable-stream: 2.3.8 xtend: 4.0.2 + dev: false /through2@3.0.2: resolution: {integrity: sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==} @@ -31632,11 +28545,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /timed-out@4.0.1: - resolution: {integrity: sha512-G7r3AhovYtr5YKOWQkta8RKAPb+J9IsO4uVmzjl8AZwfhs8UcUwTiD6gcJYSgOtzyjvQKrKYn41syHbUWMkafA==} - engines: {node: '>=0.10.0'} - dev: true - /timers-browserify@2.0.12: resolution: {integrity: sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==} engines: {node: '>=0.6.0'} @@ -31794,10 +28702,6 @@ packages: dependencies: punycode: 2.3.1 - /transformation-matrix@2.15.0: - resolution: {integrity: sha512-HN3kCvvH4ug3Xm/ycOfCFQOOktg5htxlC4Ih1Z7Wb6BMtQho+q+irOdGo10ARRKpqkRBXgBzQFw/AVmR0oIf0g==} - dev: true - /traverse@0.3.9: resolution: {integrity: sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==} dev: true @@ -31807,10 +28711,6 @@ packages: hasBin: true dev: false - /trim-lines@3.0.1: - resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} - dev: true - /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} @@ -31820,10 +28720,6 @@ packages: engines: {node: '>= 14.0.0'} dev: false - /trough@2.1.0: - resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} - dev: true - /ts-api-utils@1.0.3(typescript@5.4.4): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} @@ -31927,10 +28823,6 @@ packages: yn: 3.1.1 dev: false - /ts-toolbelt@9.6.0: - resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} - dev: true - /tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} dependencies: @@ -32005,16 +28897,6 @@ packages: - ts-node dev: false - /tsutils@3.21.0(typescript@4.9.5): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 4.9.5 - dev: true - /tsutils@3.21.0(typescript@5.4.4): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -32242,12 +29124,6 @@ packages: /typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - /types-ramda@0.29.6: - resolution: {integrity: sha512-VJoOk1uYNh9ZguGd3eZvqkdhD4hTGtnjRBUx5Zc0U9ftmnCgiWcSj/lsahzKunbiwRje1MxxNkEy1UdcXRCpYw==} - dependencies: - ts-toolbelt: 9.6.0 - dev: true - /typescript@4.9.5: resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} engines: {node: '>=4.2.0'} @@ -32346,57 +29222,6 @@ packages: - webpack-plugin-serve dev: false - /umi@4.1.8(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(sass@1.69.5)(stylelint@14.16.1)(typescript@4.9.5)(webpack@5.91.0): - resolution: {integrity: sha512-XQ7SpvU2upXE8DSsfxms963izeagHX431jOi4wpZvBYaOQGVg39MnyUAhyCBqVHJbyfOahDRWDLWMWTQzY8Q7Q==} - engines: {node: '>=14'} - hasBin: true - dependencies: - '@babel/runtime': 7.23.6 - '@umijs/bundler-utils': 4.1.8 - '@umijs/bundler-webpack': 4.1.8(typescript@4.9.5)(webpack@5.91.0) - '@umijs/core': 4.1.8 - '@umijs/lint': 4.1.8(eslint@8.55.0)(stylelint@14.16.1)(typescript@4.9.5) - '@umijs/preset-umi': 4.1.8(@types/node@20.12.7)(@types/react@18.2.75)(sass@1.69.5)(typescript@4.9.5)(webpack@5.91.0) - '@umijs/renderer-react': 4.1.8(react-dom@18.2.0)(react@18.2.0) - '@umijs/server': 4.1.8 - '@umijs/test': 4.1.8(@babel/core@7.22.10) - '@umijs/utils': 4.1.8 - prettier-plugin-organize-imports: 3.2.4(prettier@3.2.5)(typescript@4.9.5) - prettier-plugin-packagejson: 2.4.3(prettier@3.2.5) - transitivePeerDependencies: - - '@babel/core' - - '@types/node' - - '@types/react' - - '@types/webpack' - - '@volar/vue-language-plugin-pug' - - '@volar/vue-typescript' - - eslint - - jest - - lightningcss - - postcss-html - - postcss-jsx - - postcss-less - - postcss-markdown - - postcss-scss - - prettier - - react - - react-dom - - rollup - - sass - - sockjs-client - - stylelint - - stylus - - sugarss - - supports-color - - terser - - type-fest - - typescript - - webpack - - webpack-dev-server - - webpack-hot-middleware - - webpack-plugin-serve - dev: true - /umi@4.1.8(@babel/core@7.22.10)(@types/node@20.12.7)(@types/react@18.2.75)(eslint@8.55.0)(prettier@3.2.5)(react-dom@18.2.0)(react@18.2.0)(stylelint@14.16.1)(typescript@5.4.5)(webpack@5.91.0): resolution: {integrity: sha512-XQ7SpvU2upXE8DSsfxms963izeagHX431jOi4wpZvBYaOQGVg39MnyUAhyCBqVHJbyfOahDRWDLWMWTQzY8Q7Q==} engines: {node: '>=14'} @@ -32565,18 +29390,6 @@ packages: tiny-inflate: 1.0.3 dev: true - /unified@10.1.2: - resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} - dependencies: - '@types/unist': 2.0.10 - bail: 2.0.2 - extend: 3.0.2 - is-buffer: 2.0.5 - is-plain-obj: 4.1.0 - trough: 2.1.0 - vfile: 5.3.7 - dev: true - /union-value@1.0.1: resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} engines: {node: '>=0.10.0'} @@ -32589,13 +29402,19 @@ packages: /unique-filename@1.1.1: resolution: {integrity: sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==} + requiresBuild: true dependencies: unique-slug: 2.0.2 + dev: false + optional: true /unique-slug@2.0.2: resolution: {integrity: sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==} + requiresBuild: true dependencies: imurmurhash: 0.1.4 + dev: false + optional: true /unique-stream@2.3.1: resolution: {integrity: sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==} @@ -32609,6 +29428,7 @@ packages: engines: {node: '>=4'} dependencies: crypto-random-string: 1.0.0 + dev: false /unique-string@2.0.0: resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} @@ -32617,57 +29437,12 @@ packages: crypto-random-string: 2.0.0 dev: false - /unist-util-filter@4.0.1: - resolution: {integrity: sha512-RynicUM/vbOSTSiUK+BnaK9XMfmQUh6gyi7L6taNgc7FIf84GukXVV3ucGzEN/PhUUkdP5hb1MmXc+3cvPUm5Q==} - dependencies: - '@types/unist': 2.0.10 - unist-util-is: 5.2.1 - unist-util-visit-parents: 5.1.3 - dev: true - - /unist-util-generated@2.0.1: - resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==} - dev: true - - /unist-util-is@5.2.1: - resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==} - dependencies: - '@types/unist': 2.0.10 - dev: true - - /unist-util-position@4.0.4: - resolution: {integrity: sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==} - dependencies: - '@types/unist': 2.0.10 - dev: true - /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} dependencies: '@types/unist': 2.0.10 dev: false - /unist-util-stringify-position@3.0.3: - resolution: {integrity: sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==} - dependencies: - '@types/unist': 2.0.10 - dev: true - - /unist-util-visit-parents@5.1.3: - resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} - dependencies: - '@types/unist': 2.0.10 - unist-util-is: 5.2.1 - dev: true - - /unist-util-visit@4.1.2: - resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} - dependencies: - '@types/unist': 2.0.10 - unist-util-is: 5.2.1 - unist-util-visit-parents: 5.1.3 - dev: true - /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -32685,18 +29460,6 @@ packages: engines: {node: '>= 0.8'} dev: false - /unquote@1.1.1: - resolution: {integrity: sha512-vRCqFv6UhXpWxZPyGDh/F3ZpNv8/qo7w6iufLpQg9aKnQ71qM4B5KiI7Mia9COcjEhrO9LueHpMYjYzsWH3OIg==} - dev: true - - /unset-value@0.1.2: - resolution: {integrity: sha512-yhv5I4TsldLdE3UcVQn0hD2T5sNCPv4+qm/CTUpRKIpwthYRIipsAPdsrNpOI79hPQa0rTTeW22Fq6JWRcTgNg==} - engines: {node: '>=0.10.0'} - dependencies: - has-value: 0.3.1 - isobject: 3.0.1 - dev: true - /unset-value@1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} @@ -32709,11 +29472,6 @@ packages: resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} engines: {node: '>=8'} - /unzip-response@2.0.1: - resolution: {integrity: sha512-N0XH6lqDtFH84JxptQoZYmloF4nzrQqqrAymNj+/gW60AO2AZgOcf4O/nUXJcYfyQkqvMo9lSupBZmmgvuVXlw==} - engines: {node: '>=4'} - dev: true - /unzipper@0.10.14: resolution: {integrity: sha512-ti4wZj+0bQTiX2KmKWuwj7lhV+2n//uXEotUmGuQqrbVZSEGFMbI68+c6JCQ8aAmUWYvtHEz2A8K6wXvueR/6g==} dependencies: @@ -32761,22 +29519,6 @@ packages: registry-url: 3.1.0 dev: false - /update-notifier@2.5.0: - resolution: {integrity: sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==} - engines: {node: '>=4'} - dependencies: - boxen: 1.3.0 - chalk: 2.4.2 - configstore: 3.1.5 - import-lazy: 2.1.0 - is-ci: 1.2.1 - is-installed-globally: 0.1.0 - is-npm: 1.0.0 - latest-version: 3.1.0 - semver-diff: 2.1.0 - xdg-basedir: 3.0.0 - dev: true - /update-notifier@3.0.0: resolution: {integrity: sha512-6Xe3oF2bvuoj4YECUc52yxVs94yWrxwqHbzyveDktTS1WhnlTRpNcQMxUshcB7nRVGi1jEXiqL5cW1S5WSyzKg==} engines: {node: '>=8'} @@ -32810,13 +29552,6 @@ packages: deprecated: Please see https://github.com/lydell/urix#deprecated dev: false - /url-parse-lax@1.0.0: - resolution: {integrity: sha512-BVA4lR5PIviy2PMseNd2jbFQ+jwSwQGdJejf5ctd1rEXt0Ypd7yanUK9+lYechVlN5VaTJGsu2U/3MDDu6KgBA==} - engines: {node: '>=0.10.0'} - dependencies: - prepend-http: 1.0.4 - dev: true - /url-parse-lax@3.0.0: resolution: {integrity: sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==} engines: {node: '>=4'} @@ -32863,14 +29598,6 @@ packages: - supports-color dev: true - /use-debouncy@4.3.1(react@18.2.0): - resolution: {integrity: sha512-K+qtK89KojRB2GbTGtmJRysSii+wVg540bYeW9YBF7jqtwoGjIpY3m71BP0NeZzOMCcbZ6ZodLw6QeN3ascTZg==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - dev: true - /use-debouncy@4.6.0(react@18.2.0): resolution: {integrity: sha512-5N3n/oQYMuU3QKLXDa9p/xtdPKBcNbGQdLqJJPrkT164IMpHdke5xqoehDZCmgDciy+wJC+iqyE3g8c+k03lGg==} peerDependencies: @@ -32931,15 +29658,6 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - /util.promisify@1.0.1: - resolution: {integrity: sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==} - dependencies: - define-properties: 1.2.1 - es-abstract: 1.22.3 - has-symbols: 1.0.3 - object.getownpropertydescriptors: 2.1.7 - dev: true - /util@0.10.4: resolution: {integrity: sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==} dependencies: @@ -32987,17 +29705,6 @@ packages: hasBin: true dev: false - /uvu@0.5.6: - resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} - engines: {node: '>=8'} - hasBin: true - dependencies: - dequal: 2.0.3 - diff: 5.1.0 - kleur: 4.1.5 - sade: 1.8.1 - dev: true - /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true @@ -33018,12 +29725,6 @@ packages: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - /validate-npm-package-name@3.0.0: - resolution: {integrity: sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==} - dependencies: - builtins: 1.0.3 - dev: true - /validate-npm-package-name@5.0.0: resolution: {integrity: sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -33040,10 +29741,6 @@ packages: engines: {node: '>= 0.10'} dev: false - /vanilla-jsoneditor@0.16.1: - resolution: {integrity: sha512-Wirg6DoCrJpYwMHxkwyvgQ16gr4kgH9zzueHSSSovzQDvlg/XSqpY/stVsI5lz1vqJW1RAtr0Ilyyg1AbokRXA==} - dev: true - /vanilla-jsoneditor@0.17.10: resolution: {integrity: sha512-2ScoLNqq3kRSJ1+sG8rzbh4YtetrgEXbRX0OYxOk1Lqlg6tSkELGPsTA4KADFwk1s84oPj2ozMmFY6SwbZRJhg==} dev: true @@ -33061,29 +29758,6 @@ packages: extsprintf: 1.4.1 dev: true - /vfile-location@4.1.0: - resolution: {integrity: sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==} - dependencies: - '@types/unist': 2.0.10 - vfile: 5.3.7 - dev: true - - /vfile-message@3.1.4: - resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} - dependencies: - '@types/unist': 2.0.10 - unist-util-stringify-position: 3.0.3 - dev: true - - /vfile@5.3.7: - resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} - dependencies: - '@types/unist': 2.0.10 - is-buffer: 2.0.5 - unist-util-stringify-position: 3.0.3 - vfile-message: 3.1.4 - dev: true - /vinyl-fs@3.0.3: resolution: {integrity: sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==} engines: {node: '>= 0.10'} @@ -33216,7 +29890,7 @@ packages: fsevents: 2.3.3 dev: false - /vite@4.5.2(@types/node@20.12.7)(less@4.1.3)(sass@1.69.5): + /vite@4.5.2(@types/node@20.12.7)(less@4.1.3): resolution: {integrity: sha512-tBCZBNSBbHQkaGyhGCDUGqeo2ph8Fstyp6FMSvTtsXeZSPpSMGlviAOav2hxVTqFcx8Hj/twtWKsMJXNY0xI8w==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -33249,7 +29923,6 @@ packages: less: 4.1.3 postcss: 8.4.38 rollup: 3.29.4 - sass: 1.69.5 optionalDependencies: fsevents: 2.3.3 @@ -33437,10 +30110,6 @@ packages: defaults: 1.0.4 dev: true - /web-namespaces@2.0.1: - resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} - dev: true - /web-streams-polyfill@3.3.3: resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} engines: {node: '>= 8'} @@ -33655,6 +30324,7 @@ packages: engines: {node: '>=4'} dependencies: string-width: 2.1.1 + dev: false /widest-line@3.1.0: resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} @@ -33783,6 +30453,7 @@ packages: graceful-fs: 4.2.11 imurmurhash: 0.1.4 signal-exit: 3.0.7 + dev: false /write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} @@ -33847,6 +30518,7 @@ packages: /xdg-basedir@3.0.0: resolution: {integrity: sha512-1Dly4xqlulvPD3fZUQJLY+FUIeqN3N2MM3uqe4rCJftAvOjFa3jFGfctOgluGx4ahPbUCsZkmJILiP0Vi4T6lQ==} engines: {node: '>=4'} + dev: false /xlsx@0.17.5: resolution: {integrity: sha512-lXNU0TuYsvElzvtI6O7WIVb9Zar1XYw7Xb3VAx2wn8N/n0whBYrCnHMxtFyIiUU1Wjf09WzmLALDfBO5PqTb1g==} @@ -33879,22 +30551,9 @@ packages: xpath: 0.0.32 dev: true - /xml-lexer@0.2.2: - resolution: {integrity: sha512-G0i98epIwiUEiKmMcavmVdhtymW+pCAohMRgybyIME9ygfVu8QheIi+YoQh3ngiThsT0SQzJT4R0sKDEv8Ou0w==} - dependencies: - eventemitter3: 2.0.3 - dev: true - /xml-name-validator@3.0.0: resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==} - /xml-reader@2.4.3: - resolution: {integrity: sha512-xWldrIxjeAMAu6+HSf9t50ot1uL5M+BtOidRCWHXIeewvSeIpscWCsp4Zxjk8kHHhdqFBrfK8U0EJeCcnyQ/gA==} - dependencies: - eventemitter3: 2.0.3 - xml-lexer: 0.2.2 - dev: true - /xml2js@0.4.23: resolution: {integrity: sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==} engines: {node: '>=4.0.0'} @@ -33964,6 +30623,7 @@ packages: /y18n@3.2.2: resolution: {integrity: sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==} + dev: false /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} @@ -34124,27 +30784,3 @@ packages: compress-commons: 4.1.2 readable-stream: 3.6.2 dev: true - - /zustand@4.4.7(@types/react@18.2.75)(react@18.2.0): - resolution: {integrity: sha512-QFJWJMdlETcI69paJwhSMJz7PPWjVP8Sjhclxmxmxv/RYI7ZOvR5BHX+ktH0we9gTWQMxcne8q1OY8xxz604gw==} - engines: {node: '>=12.7.0'} - peerDependencies: - '@types/react': '>=16.8' - immer: '>=9.0' - react: '>=16.8' - peerDependenciesMeta: - '@types/react': - optional: true - immer: - optional: true - react: - optional: true - dependencies: - '@types/react': 18.2.75 - react: 18.2.0 - use-sync-external-store: 1.2.0(react@18.2.0) - dev: true - - /zwitch@2.0.4: - resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} - dev: true diff --git a/tsconfig.json b/tsconfig.json index 2b5430e50..c4b5c0bbf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,7 +26,7 @@ "module": "commonjs" } }, - "include": [".dumi/**/*", ".dumirc.ts", "packages/**/*", "playwright.config.ts", "vitest.config.mts"], + "include": ["packages/**/*", "playwright.config.ts", "vitest.config.mts"], "exclude": [ "packages/**/node_modules", "packages/**/dist",