@vtj/renderer 0.7.34 → 0.8.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vtj/renderer",
3
3
  "private": false,
4
- "version": "0.7.34",
4
+ "version": "0.8.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vue-tsc && vite build",
@@ -10,14 +10,14 @@
10
10
  "coverage": "vitest run --coverage"
11
11
  },
12
12
  "dependencies": {
13
- "@vtj/core": "^0.7.34",
14
- "@vtj/icons": "^0.7.34",
15
- "@vtj/ui": "^0.7.34",
16
- "@vtj/utils": "^0.7.34",
13
+ "@vtj/core": "^0.8.0",
14
+ "@vtj/icons": "^0.8.0",
15
+ "@vtj/ui": "^0.8.0",
16
+ "@vtj/utils": "^0.8.0",
17
17
  "mockjs": "~1.1.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@vtj/cli": "^0.7.21",
20
+ "@vtj/cli": "^0.8.0",
21
21
  "vue": "~3.4.15",
22
22
  "vue-router": "~4.3.0"
23
23
  },
@@ -35,7 +35,7 @@
35
35
  "dist",
36
36
  "types"
37
37
  ],
38
- "gitHead": "307cf220b3b712bdc2264e44ae800f95017e0f0a",
38
+ "gitHead": "911c3a0e2bb60548affe5dcf5a496577809d63b8",
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  }
@@ -1,6 +1,7 @@
1
+ import { CreateRendererOptions, Context } from '../render';
1
2
  import { ContextMode } from '../constants';
2
3
  import { IStaticRequest, Jsonp } from '@vtj/utils';
3
- import { ProjectSchema, PageFile, BlockFile, Service, BlockSchema, Base } from '@vtj/core';
4
+ import { ProjectSchema, PageFile, BlockFile, Service, BlockSchema, NodeFromPlugin, Base } from '@vtj/core';
4
5
  import { Router } from 'vue-router';
5
6
  import { App, InjectionKey } from 'vue';
6
7
 
@@ -37,6 +38,7 @@ export declare class Provider extends Base {
37
38
  nodeEnv: 'development' | 'production';
38
39
  private router;
39
40
  private materialPath;
41
+ private urlDslCaches;
40
42
  constructor(options: ProviderOptions);
41
43
  load(project: ProjectSchema): Promise<void>;
42
44
  private initRouter;
@@ -45,7 +47,14 @@ export declare class Provider extends Base {
45
47
  getPage(id: string): PageFile | null;
46
48
  getHomepage(): PageFile | null;
47
49
  getDsl(id: string): Promise<BlockSchema | null>;
50
+ getDslByUrl(url: string): Promise<BlockSchema | null>;
51
+ createDslRenderer(dsl: BlockSchema, opts?: Partial<CreateRendererOptions>): {
52
+ renderer: any;
53
+ context: Context;
54
+ };
48
55
  getRenderComponent(id: string): Promise<any>;
56
+ defineUrlSchemaComponent(url: string, name?: string): any;
57
+ definePluginComponent(from: NodeFromPlugin): any;
49
58
  }
50
59
  export declare function createProvider(options: ProviderOptions): {
51
60
  provider: Provider;
@@ -1,11 +1,13 @@
1
1
  import { CreateRendererOptions } from './block';
2
- import { NodeFrom, BlockSchema } from '@vtj/core';
2
+ import { NodeFrom, BlockSchema, NodeFromPlugin, BlockPlugin } from '@vtj/core';
3
3
  import { DefineComponent } from 'vue';
4
4
 
5
5
  export type BlockLoader = (name: string, from?: NodeFrom, Vue?: any) => string | DefineComponent;
6
6
  export declare const defaultLoader: BlockLoader;
7
+ export declare function getPlugin(from: NodeFromPlugin, global?: any): Promise<BlockPlugin | null>;
7
8
  export interface CreateLoaderOptions {
8
9
  getDsl: (id: string) => Promise<BlockSchema | null>;
10
+ getDslByUrl: (url: string) => Promise<BlockSchema | null>;
9
11
  options: Partial<CreateRendererOptions>;
10
12
  }
11
13
  export declare function createLoader(opts: CreateLoaderOptions): BlockLoader;
@@ -1,7 +1,9 @@
1
- import { ProjectSchema, PageFile, BlockFile, BlockSchema, MaterialDescription, HistorySchema, HistoryItem, Service } from '@vtj/core';
1
+ import { ProjectSchema, PageFile, BlockFile, BlockSchema, MaterialDescription, HistorySchema, HistoryItem, Service, StaticFileInfo, NodeFromPlugin } from '@vtj/core';
2
2
 
3
3
  export declare class BaseService implements Service {
4
4
  protected api: (type: string, data: any) => Promise<any>;
5
+ private pluginCaches;
6
+ protected uploader: (file: File, projectId: string) => Promise<StaticFileInfo>;
5
7
  constructor();
6
8
  init(project: ProjectSchema): Promise<ProjectSchema>;
7
9
  saveProject(project: ProjectSchema): Promise<boolean>;
@@ -20,4 +22,9 @@ export declare class BaseService implements Service {
20
22
  genVueContent(project: ProjectSchema, dsl: BlockSchema): Promise<string>;
21
23
  createRawPage(file: PageFile): Promise<boolean>;
22
24
  removeRawPage(id: string): Promise<boolean>;
25
+ uploadStaticFile(file: File, projectId: string): Promise<StaticFileInfo | null>;
26
+ getStaticFiles(projectId: string): Promise<StaticFileInfo[]>;
27
+ removeStaticFile(name: string, projectId: string): Promise<boolean>;
28
+ clearStaticFiles(projectId: string): Promise<boolean>;
29
+ getPluginMaterial(from: NodeFromPlugin): Promise<MaterialDescription | null>;
23
30
  }
@@ -2,6 +2,7 @@ import { BaseService } from './base';
2
2
  import { ProjectSchema, BlockSchema, HistorySchema, HistoryItem, MaterialDescription } from '@vtj/core';
3
3
 
4
4
  export declare class LocalService extends BaseService {
5
+ private getFileCaches;
5
6
  init(project: ProjectSchema): Promise<ProjectSchema>;
6
7
  saveProject(project: ProjectSchema): Promise<boolean>;
7
8
  saveMaterials(project: ProjectSchema, materials: Map<string, MaterialDescription>): Promise<boolean>;
@@ -3,6 +3,7 @@ import { Dependencie, MaterialDescription } from '@vtj/core';
3
3
  export declare function fillBasePath(urls: string[], basePath: string): string[];
4
4
  export declare function isCSSUrl(url: string): boolean;
5
5
  export declare function isJSUrl(url: string): boolean;
6
+ export declare function isJSON(url: string): boolean;
6
7
  export declare function createAssetScripts(scripts: string[]): string;
7
8
  export declare function createAssetsCss(css?: string[]): string;
8
9
  export declare function parseDeps(deps: Dependencie[], basePath: string): {
@@ -13,5 +14,6 @@ export declare function parseDeps(deps: Dependencie[], basePath: string): {
13
14
  materialExports: string[];
14
15
  materialMapLibrary: Record<string, string>;
15
16
  libraryMap: Record<string, string[]>;
17
+ libraryLocaleMap: Record<string, string>;
16
18
  };
17
19
  export declare function getRawComponent(desc: MaterialDescription, lib: any): any;
@@ -3,4 +3,6 @@ import { Plugin } from 'vue';
3
3
  export declare function toString(value: any): string;
4
4
  export declare function adoptedStyleSheets(global: Window, id: string, css: string): void;
5
5
  export declare function loadCss(id: string, url: string): Promise<void>;
6
+ export declare function loadCssUrl(urls: string[], global?: any): void;
7
+ export declare function loadScriptUrl(urls: string[], library: string, global?: any): Promise<any>;
6
8
  export declare function isVuePlugin(value: unknown): value is Plugin;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2024, VTJ.PRO All rights reserved.
3
3
  * @name @vtj/renderer
4
4
  * @author CHC chenhuachun1549@dingtalk.com
5
- * @version 0.7.33
5
+ * @version 0.7.34
6
6
  * @license <a href="https://vtj.pro/license.html">MIT License</a>
7
7
  */
8
- export declare const version = "0.7.33";
8
+ export declare const version = "0.7.34";