@vtj/renderer 0.18.27 → 0.18.29

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/renderer",
3
3
  "private": false,
4
- "version": "0.18.27",
4
+ "version": "0.18.29",
5
5
  "type": "module",
6
6
  "keywords": [
7
7
  "低代码引擎",
@@ -22,15 +22,17 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "eval5": "^1.4.8",
25
- "@vtj/core": "~0.18.27",
26
- "@vtj/utils": "~0.18.27"
25
+ "@vtj/core": "~0.18.29",
26
+ "@vtj/utils": "~0.18.29"
27
+ },
28
+ "peerDependencies": {
29
+ "vue": "~3.5.37",
30
+ "vue-router": "~4.6.0"
27
31
  },
28
32
  "devDependencies": {
29
33
  "vue": "~3.5.37",
30
34
  "vue-router": "~4.6.0",
31
- "@vtj/cli": "~0.13.1",
32
- "@vtj/ui": "~0.18.27",
33
- "@vtj/icons": "~0.18.27"
35
+ "@vtj/cli": "~0.13.1"
34
36
  },
35
37
  "exports": {
36
38
  ".": {
@@ -1,4 +1,3 @@
1
- import { MenuDataItem } from '@vtj/ui';
2
1
  import { PageFile } from '@vtj/core';
3
2
  import { Access } from '../plugins';
4
3
  import { Ref } from 'vue';
@@ -7,13 +6,21 @@ export interface UseMaskOptions {
7
6
  menuPathPrefix?: string;
8
7
  disableMenusFilter?: boolean;
9
8
  }
10
- export declare function createMenus(menuPathPrefix: string, pageRouteName: string, pages?: PageFile[]): MenuDataItem[];
11
- export declare function menusFilter(menus: MenuDataItem[], access?: Access): MenuDataItem[];
9
+ export interface RendererMenuDataItem {
10
+ id: string | number;
11
+ title?: string;
12
+ icon?: PageFile['icon'];
13
+ hidden?: boolean;
14
+ children?: RendererMenuDataItem[];
15
+ url?: string;
16
+ }
17
+ export declare function createMenus(menuPathPrefix: string, pageRouteName: string, pages?: PageFile[]): RendererMenuDataItem[];
18
+ export declare function menusFilter(menus: RendererMenuDataItem[], access?: Access): RendererMenuDataItem[];
12
19
  export declare function useMask(options?: UseMaskOptions): {
13
20
  disabled: Ref<boolean, boolean>;
14
21
  logo: string | undefined;
15
22
  themeSwitchable: boolean | undefined;
16
23
  title: string;
17
- menus: MenuDataItem[];
24
+ menus: RendererMenuDataItem[];
18
25
  pure: Ref<boolean, boolean>;
19
26
  };
@@ -1,13 +1,10 @@
1
- import { DefineComponent, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
1
+ import { DefineComponent, ShallowRef, Ref, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
2
  import { Provider } from './provider';
3
- import { PageFile } from '@vtj/core';
4
- import { LocationQuery, RouteMeta, RouteLocationNormalizedLoadedGeneric } from 'vue-router';
3
+ import { RouteLocationNormalizedLoadedGeneric } from 'vue-router';
5
4
  export declare const PageContainer: DefineComponent<{}, {
6
5
  provider: Provider;
7
- component: any;
8
- file: PageFile | null;
9
- query: LocationQuery;
10
- meta: RouteMeta;
6
+ component: ShallowRef<any, any>;
7
+ file: ShallowRef<any, any>;
11
8
  sid: Ref<symbol, symbol>;
12
9
  route: RouteLocationNormalizedLoadedGeneric;
13
10
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -5,8 +5,7 @@ import { ContextMode } from '../constants';
5
5
  import { CreateRendererOptions } from '../render';
6
6
  import { ProvideAdapter } from './defaults';
7
7
  import { InitGlobalsOptions } from './globals';
8
- import { MenuDataItem } from '@vtj/ui';
9
- import { Context } from '..';
8
+ import { RendererMenuDataItem, Context, BlockLoader } from '..';
10
9
  export declare const providerKey: InjectionKey<Provider>;
11
10
  export interface ProviderOptions {
12
11
  service: Service;
@@ -62,6 +61,7 @@ export declare class Provider extends Base {
62
61
  private materialPath;
63
62
  private urlDslCaches;
64
63
  errorHandler: ((err: any) => void) | null;
64
+ initialization: Promise<Provider>;
65
65
  /**
66
66
  * 创建Provider实例
67
67
  * @param options 配置选项
@@ -98,7 +98,7 @@ export declare class Provider extends Base {
98
98
  getFile(id: string): PageFile | BlockFile | null;
99
99
  getPage(id: string): PageFile | null;
100
100
  getFirstPage(): PageFile | null;
101
- getMenus(name?: string, prefix?: string): MenuDataItem[];
101
+ getMenus(name?: string, prefix?: string): RendererMenuDataItem[];
102
102
  getHomepage(): PageFile | null;
103
103
  getDsl(id: string): Promise<BlockSchema | null>;
104
104
  getDslByUrl(url: string): Promise<BlockSchema | null>;
@@ -114,6 +114,7 @@ export declare class Provider extends Base {
114
114
  createDslRenderer(dsl: BlockSchema, opts?: Partial<CreateRendererOptions>): {
115
115
  renderer: any;
116
116
  context: Context;
117
+ loader: BlockLoader | undefined;
117
118
  };
118
119
  /**
119
120
  * 获取渲染组件
@@ -161,6 +162,7 @@ export declare class Provider extends Base {
161
162
  export declare function createProvider(options: ProviderOptions): {
162
163
  provider: Provider;
163
164
  onReady: (callback: () => void) => void;
165
+ ready: Promise<Provider>;
164
166
  };
165
167
  export interface UseProviderOptions {
166
168
  id?: string;
@@ -17,5 +17,6 @@ export interface CreateRendererOptions {
17
17
  export declare function createRenderer(options: CreateRendererOptions): {
18
18
  renderer: any;
19
19
  context: Context;
20
+ loader: BlockLoader | undefined;
20
21
  };
21
22
  export declare function createDataSources(dataSources: Record<string, DataSourceSchema>, context: Context): Record<string, DataSourceHandler>;
@@ -1,4 +1,4 @@
1
- declare class NodeCache {
1
+ export declare class NodeCache {
2
2
  private __props;
3
3
  private __events;
4
4
  private __nodes;
@@ -1,6 +1,7 @@
1
1
  import { ContextMode } from '../constants';
2
2
  import { BlockSchema, JSFunction, JSExpression } from '@vtj/core';
3
3
  import { Provider } from '../provider';
4
+ import { NodeCache } from './cache';
4
5
  export interface ContextOptions {
5
6
  mode: ContextMode;
6
7
  dsl?: BlockSchema;
@@ -13,6 +14,7 @@ export interface ContextAttrs {
13
14
  [key: string]: any;
14
15
  }
15
16
  export declare class Context {
17
+ readonly __cache: NodeCache;
16
18
  __id: string | null;
17
19
  __mode: ContextMode;
18
20
  __instance: any | null;
@@ -1,7 +1,9 @@
1
1
  import { DefineComponent } from 'vue';
2
2
  import { NodeFrom, BlockSchema, NodeFromPlugin, BlockPlugin } from '@vtj/core';
3
3
  import { CreateRendererOptions } from './block';
4
- export type BlockLoader = (id: string, name: string, from?: NodeFrom, Vue?: any) => string | DefineComponent;
4
+ export type BlockLoader = ((id: string, name: string, from?: NodeFrom, Vue?: any) => string | DefineComponent) & {
5
+ clear: () => void;
6
+ };
5
7
  export declare const defaultLoader: BlockLoader;
6
8
  export declare function getPlugin(from: NodeFromPlugin, global?: any): Promise<BlockPlugin | null>;
7
9
  export interface CreateLoaderOptions {
@@ -10,4 +12,4 @@ export interface CreateLoaderOptions {
10
12
  options: Partial<CreateRendererOptions>;
11
13
  }
12
14
  export declare function createLoader(opts: CreateLoaderOptions): BlockLoader;
13
- export declare function clearLoaderCache(): void;
15
+ export declare function clearLoaderCache(loader?: BlockLoader): void;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2026, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.18.26
5
+ * @version 0.18.28
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.18.26";
8
+ export declare const version = "0.18.28";