@vtj/designer 0.8.172 → 0.9.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/LICENSE +21 -21
  2. package/dist/{Editor-C1dy1R3N.js → Editor-D0h3sJZq.js} +4 -4
  3. package/dist/css.worker-Cb_0heaR.js +25 -0
  4. package/dist/editor.worker-BtL2_YLX.js +25 -0
  5. package/dist/html.worker-CwsDGkIP.js +25 -0
  6. package/dist/index.mjs +10454 -4953
  7. package/dist/json.worker-DsbU5PJ7.js +25 -0
  8. package/dist/style.css +1 -1
  9. package/dist/{ts.worker-Dn3IQaLA.js → ts.worker-DPxAurls.js} +1 -1
  10. package/package.json +9 -8
  11. package/types/components/hooks/index.d.ts +2 -0
  12. package/types/components/hooks/useColSpan.d.ts +1 -1
  13. package/types/components/hooks/useOpenApi.d.ts +40 -0
  14. package/types/components/hooks/useTemplates.d.ts +20 -0
  15. package/types/components/shared/box.d.ts +17 -1
  16. package/types/components/shared/index.d.ts +2 -1
  17. package/types/components/shared/item.d.ts +5 -0
  18. package/types/components/shared/micro-app.d.ts +3 -0
  19. package/types/components/shared/panel.d.ts +8 -0
  20. package/types/components/widgets/actions/publisher.d.ts +10 -0
  21. package/types/components/widgets/docs/index.d.ts +1 -0
  22. package/types/components/widgets/index.d.ts +7 -0
  23. package/types/components/widgets/market/index.d.ts +5 -0
  24. package/types/components/widgets/templates/index.d.ts +5 -0
  25. package/types/constants.d.ts +4 -0
  26. package/types/framework/engine.d.ts +5 -1
  27. package/types/framework/renderer.d.ts +3 -2
  28. package/types/framework/simulator.d.ts +1 -0
  29. package/types/version.d.ts +2 -2
  30. package/types/wrappers/setter.d.ts +1 -1
  31. package/dist/css.worker-BkwH8iYE.js +0 -25
  32. package/dist/editor.worker-C8k3yDdT.js +0 -25
  33. package/dist/html.worker-DefZQYbA.js +0 -25
  34. package/dist/json.worker-05I1Fjzo.js +0 -25
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "@vtj/designer",
3
3
  "private": false,
4
- "version": "0.8.172",
4
+ "version": "0.9.0-alpha.0",
5
5
  "type": "module",
6
6
  "dependencies": {
7
+ "html2canvas": "~1.4.1",
7
8
  "mockjs": "~1.1.0",
8
- "monaco-editor": "~0.51.0",
9
- "@vtj/core": "~0.8.172",
10
- "@vtj/renderer": "~0.8.172",
11
- "@vtj/utils": "~0.8.172",
12
- "@vtj/icons": "~0.8.172",
13
- "@vtj/ui": "~0.8.172"
9
+ "monaco-editor": "~0.52.0",
10
+ "@vtj/icons": "~0.9.0-alpha.0",
11
+ "@vtj/core": "~0.9.0-alpha.0",
12
+ "@vtj/utils": "~0.9.0-alpha.0",
13
+ "@vtj/renderer": "~0.9.0-alpha.0",
14
+ "@vtj/ui": "~0.9.0-alpha.0"
14
15
  },
15
16
  "devDependencies": {
16
17
  "@types/mockjs": "~1.0.10",
17
18
  "vue": "~3.5.5",
18
19
  "vue-router": "~4.4.0",
19
- "@vtj/cli": "~0.8.39"
20
+ "@vtj/cli": "~0.9.0-alpha.0"
20
21
  },
21
22
  "files": [
22
23
  "dist",
@@ -13,3 +13,5 @@ export * from './useProject';
13
13
  export * from './useNodeEvents';
14
14
  export * from './useDirectives';
15
15
  export * from './useDataSources';
16
+ export * from './useOpenApi';
17
+ export * from './useTemplates';
@@ -1,6 +1,6 @@
1
1
  import { ComputedRef, ShallowReactive } from 'vue';
2
2
  import { Engine } from '../..';
3
- export declare function useColSpan(): {
3
+ export declare function useColSpan(size?: number): {
4
4
  span: ComputedRef<number>;
5
5
  engine: ShallowReactive<Engine>;
6
6
  };
@@ -0,0 +1,40 @@
1
+ import { BlockSchema } from '@vtj/core';
2
+ import { ShallowReactive } from 'vue';
3
+ import { Engine } from '../..';
4
+ import { Access } from '@vtj/renderer';
5
+ export interface PublishTemplateDto {
6
+ name: string;
7
+ title: string;
8
+ category: string;
9
+ cover: Blob;
10
+ share: boolean;
11
+ version: string;
12
+ latest?: string;
13
+ dsl: string;
14
+ id?: string;
15
+ }
16
+ export interface TemplateDto {
17
+ id: string;
18
+ name: string;
19
+ title: string;
20
+ vip: boolean;
21
+ share: boolean;
22
+ cover: string;
23
+ author: string;
24
+ category: string;
25
+ latest: string;
26
+ }
27
+ export declare function useOpenApi(): {
28
+ engine: ShallowReactive<Engine>;
29
+ access: Access | undefined;
30
+ remote: string | undefined;
31
+ auth: any;
32
+ toRemoteAuth: () => void;
33
+ isLogined: () => Promise<boolean>;
34
+ getTemplates: () => Promise<TemplateDto[]>;
35
+ getTemplateDsl: (id: string) => Promise<BlockSchema | null>;
36
+ getDictOptions: (code: string) => Promise<any>;
37
+ getTemplateCategories: () => Promise<any>;
38
+ publishTemplate: (dto: PublishTemplateDto) => Promise<any>;
39
+ getTemplateById: (id: string) => Promise<TemplateDto>;
40
+ };
@@ -0,0 +1,20 @@
1
+ import { Ref, ShallowReactive, ComputedRef } from 'vue';
2
+ import { TemplateDto } from './useOpenApi';
3
+ import { Engine } from '../..';
4
+ import { BlockSchema } from '@vtj/core';
5
+ import { MessageBoxData } from 'element-plus';
6
+ import { Dictionary } from 'lodash';
7
+ import { Access } from '@vtj/renderer';
8
+ export declare function useTemplates(): {
9
+ engine: ShallowReactive<Engine>;
10
+ templates: Ref<TemplateDto[], TemplateDto[]>;
11
+ toRemoteAuth: () => void;
12
+ isLogined: () => Promise<boolean>;
13
+ getTemplates: () => Promise<TemplateDto[]>;
14
+ getTemplateDsl: (id: string) => Promise< BlockSchema | null>;
15
+ installTemplate: (templateId: string) => Promise< MessageBoxData | undefined>;
16
+ groups: ComputedRef<Dictionary<TemplateDto[]>>;
17
+ access: Access | undefined;
18
+ refreshTemplates: () => void;
19
+ loading: Ref<boolean, boolean>;
20
+ };
@@ -8,15 +8,31 @@ export interface Props {
8
8
  tag?: string;
9
9
  tagType?: 'warning' | 'success' | 'danger' | 'primary';
10
10
  }
11
- declare const _default: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
11
+ declare function __VLS_template(): {
12
+ slots: {
13
+ default?(_: {}): any;
14
+ };
15
+ refs: {};
16
+ attrs: Partial<{}>;
17
+ };
18
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
+ declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
20
+ copy: (...args: any[]) => void;
12
21
  edit: (...args: any[]) => void;
13
22
  remove: (...args: any[]) => void;
14
23
  dragend: (...args: any[]) => void;
15
24
  dragstart: (...args: any[]) => void;
16
25
  }, string, PublicProps, Readonly<Props> & Readonly<{
26
+ onCopy?: ((...args: any[]) => any) | undefined;
17
27
  onEdit?: ((...args: any[]) => any) | undefined;
18
28
  onRemove?: ((...args: any[]) => any) | undefined;
19
29
  onDragend?: ((...args: any[]) => any) | undefined;
20
30
  onDragstart?: ((...args: any[]) => any) | undefined;
21
31
  }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
32
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
33
  export default _default;
34
+ type __VLS_WithTemplateSlots<T, S> = T & {
35
+ new (): {
36
+ $slots: S;
37
+ };
38
+ };
@@ -7,5 +7,6 @@ import { default as Binder } from './binder';
7
7
  import { default as Viewer } from './viewer';
8
8
  import { default as SlotsPicker } from './slots';
9
9
  import { default as Viewport } from './viewport';
10
+ import { default as MicroApp } from './micro-app';
10
11
  export * from './types';
11
- export { Icon, Panel, Tabs, Item, Box, Binder, Viewer, SlotsPicker, Viewport };
12
+ export { Icon, Panel, Tabs, Item, Box, Binder, Viewer, SlotsPicker, Viewport, MicroApp };
@@ -36,6 +36,10 @@ declare const builtInActions: {
36
36
  label: string;
37
37
  icon: Raw<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>>;
38
38
  };
39
+ share: {
40
+ label: string;
41
+ icon: Raw<DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>>;
42
+ };
39
43
  };
40
44
  export interface Props {
41
45
  icon?: Record<string, any> | string;
@@ -53,6 +57,7 @@ export interface Props {
53
57
  active?: boolean;
54
58
  hover?: boolean;
55
59
  small?: boolean;
60
+ actionInMore?: boolean;
56
61
  }
57
62
  declare function __VLS_template(): {
58
63
  slots: {
@@ -0,0 +1,3 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3
+ export default _default;
@@ -1,14 +1,17 @@
1
+ import { ActionMenuItem } from '@vtj/ui';
1
2
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
3
  export interface Props {
3
4
  title?: string;
4
5
  subtitle?: string;
5
6
  plus?: boolean;
7
+ refresh?: boolean;
6
8
  back?: boolean;
7
9
  edit?: boolean;
8
10
  remove?: boolean;
9
11
  save?: boolean;
10
12
  header?: boolean;
11
13
  collapsable?: boolean;
14
+ menus?: ActionMenuItem[];
12
15
  }
13
16
  declare function __VLS_template(): {
14
17
  slots: {
@@ -21,12 +24,16 @@ declare function __VLS_template(): {
21
24
  };
22
25
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
26
  declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
27
+ command: (...args: any[]) => void;
28
+ refresh: (...args: any[]) => void;
24
29
  plus: (...args: any[]) => void;
25
30
  back: (...args: any[]) => void;
26
31
  edit: (...args: any[]) => void;
27
32
  remove: (...args: any[]) => void;
28
33
  save: (...args: any[]) => void;
29
34
  }, string, PublicProps, Readonly<Props> & Readonly<{
35
+ onCommand?: ((...args: any[]) => any) | undefined;
36
+ onRefresh?: ((...args: any[]) => any) | undefined;
30
37
  onPlus?: ((...args: any[]) => any) | undefined;
31
38
  onBack?: ((...args: any[]) => any) | undefined;
32
39
  onEdit?: ((...args: any[]) => any) | undefined;
@@ -34,6 +41,7 @@ declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentO
34
41
  onSave?: ((...args: any[]) => any) | undefined;
35
42
  }>, {
36
43
  header: boolean;
44
+ menus: ActionMenuItem[];
37
45
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
38
46
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
39
47
  export default _default;
@@ -0,0 +1,10 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export interface Props {
3
+ id?: string;
4
+ canvas: any;
5
+ name: string;
6
+ title: string;
7
+ dsl: any;
8
+ }
9
+ declare const _default: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
10
+ export default _default;
@@ -4,6 +4,7 @@ export interface Props {
4
4
  }
5
5
  declare const _default: DefineComponent<Props, {
6
6
  refresh: () => void;
7
+ reload: () => void;
7
8
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
8
9
  url: string;
9
10
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
@@ -49,9 +49,16 @@ export declare const widgets: {
49
49
  Raw: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
50
50
  Docs: DefineComponent<Props, {
51
51
  refresh: () => void;
52
+ reload: () => void;
52
53
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< Props> & Readonly<{}>, {
53
54
  url: string;
54
55
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
55
56
  About: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
56
57
  ProjectConfig: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
58
+ Market: DefineComponent<{}, {
59
+ openDesigner: () => void;
60
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
61
+ Templates: DefineComponent<{}, {
62
+ refreshTemplates: () => void;
63
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
57
64
  };
@@ -0,0 +1,5 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {
3
+ openDesigner: () => void;
4
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
5
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<{}, {
3
+ refreshTemplates: () => void;
4
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
5
+ export default _default;
@@ -10,6 +10,10 @@ export declare const PAD_SIZE: {
10
10
  * 名称正则表达式
11
11
  */
12
12
  export declare const NAME_REGEX: RegExp;
13
+ /**
14
+ * 版本号表达式
15
+ */
16
+ export declare const VERSION_REGEX: RegExp;
13
17
  /**
14
18
  * 鼠标事件列表
15
19
  */
@@ -1,5 +1,5 @@
1
1
  import { ShallowReactive, InjectionKey, MaybeRef, App, Ref } from 'vue';
2
- import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema } from '@vtj/core';
2
+ import { Base, ProjectModel, BlockModel, HistoryModel, Service, Emitter, ProjectSchema, ProjectModelEvent } from '@vtj/core';
3
3
  import { Context, Provider, ProvideAdapter } from '@vtj/renderer';
4
4
  import { SkeletonWrapperInstance } from '../wrappers';
5
5
  import { Simulator } from './simulator';
@@ -15,7 +15,9 @@ export interface EngineOptions {
15
15
  globals?: Record<string, any>;
16
16
  adapter?: Partial<ProvideAdapter>;
17
17
  install?: (app: App, engine?: Engine) => void;
18
+ remoteHost?: string;
18
19
  }
20
+ export declare const SAVE_BLOCK_FILE_FINISH = "SAVE_BLOCK_FILE_FINISH";
19
21
  export declare class Engine extends Base {
20
22
  private options;
21
23
  app?: App;
@@ -31,6 +33,7 @@ export declare class Engine extends Base {
31
33
  isEmptyCurrent: Ref<boolean>;
32
34
  history: Ref<HistoryModel | null>;
33
35
  provider: Provider;
36
+ adapter?: Partial<ProvideAdapter>;
34
37
  /**
35
38
  * 当current变化时,更新该值,用于通知组件更新
36
39
  */
@@ -45,6 +48,7 @@ export declare class Engine extends Base {
45
48
  private updateCurrent;
46
49
  private saveProject;
47
50
  private saveBlockFile;
51
+ onSaveBlockFileFinish(callback: (e: ProjectModelEvent) => void): void;
48
52
  private saveMaterials;
49
53
  private saveCurrentFile;
50
54
  private initHistory;
@@ -1,5 +1,5 @@
1
1
  import { App } from 'vue';
2
- import { BlockSchema, NodeSchema, BlockModel, Service } from '@vtj/core';
2
+ import { BlockSchema, NodeSchema, BlockModel, Service, PageFile, BlockFile } from '@vtj/core';
3
3
  import { SimulatorEnv } from './simulator';
4
4
  import { Provider, Context } from '@vtj/renderer';
5
5
  import { Designer } from './designer';
@@ -13,9 +13,10 @@ export declare class Renderer {
13
13
  private nodeChange;
14
14
  private blockChange;
15
15
  context: Context | null;
16
+ private file?;
16
17
  constructor(env: SimulatorEnv, service: Service, provider: Provider, designer?: Designer | null);
17
18
  private install;
18
- render(block: BlockModel): void;
19
+ render(block: BlockModel, file?: PageFile | BlockFile | null): void;
19
20
  dispose(): void;
20
21
  updateChild(node: NodeSchema, parent: BlockSchema | NodeSchema): void;
21
22
  private __onNodeChange;
@@ -43,5 +43,6 @@ export declare class Simulator extends Base {
43
43
  emitReady(libraryExports?: string[], materialExports?: string[], materialMapLibrary?: Record<string, string>, libraryLocaleMap?: Record<string, string>): Promise<void>;
44
44
  createEnv(libraryExports?: string[], materialMapLibrary?: Record<string, string>, materials?: Material[], libraryLocaleMap?: Record<string, string>): SimulatorEnv;
45
45
  refresh(): void;
46
+ capture(): Promise<unknown>;
46
47
  dispose(): void;
47
48
  }
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/designer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.8.171
5
+ * @version 0.8.172
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.8.171";
8
+ export declare const version = "0.8.172";
@@ -88,8 +88,8 @@ export declare const SetterWrapper: DefineComponent<ExtractPropTypes<{
88
88
  value: string | number | boolean | Record<string, any> | unknown[];
89
89
  context: Context | null;
90
90
  setters: string | MaterialSetter | (string | MaterialSetter)[];
91
- current: BlockModel | null;
92
91
  options: unknown[];
92
+ current: BlockModel | null;
93
93
  removable: boolean;
94
94
  variable: boolean;
95
95
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;