x-runtime-lib 0.9.20 → 0.9.21

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.
@@ -13,36 +13,6 @@ type ZPropertyBase = {
13
13
  static?: boolean;
14
14
  value?: any;
15
15
  };
16
- type ZPropertyTempString = {
17
- ui: 'temp';
18
- type: 'string';
19
- default: string;
20
- } & ZPropertyBase;
21
- type ZPropertyTempNumber = {
22
- ui: 'temp';
23
- type: 'number';
24
- default: number;
25
- } & ZPropertyBase;
26
- type ZPropertyTempBoolean = {
27
- ui: 'temp';
28
- type: 'boolean';
29
- default: boolean;
30
- } & ZPropertyBase;
31
- type ZPropertyTempObject = {
32
- ui: 'temp';
33
- type: 'object';
34
- default: object;
35
- } & ZPropertyBase;
36
- type ZPropertyTempArray = {
37
- ui: 'temp';
38
- type: 'array';
39
- default: object;
40
- } & ZPropertyBase;
41
- type ZPropertyTempAny = {
42
- ui: 'temp';
43
- type: 'any';
44
- default: any;
45
- } & ZPropertyBase;
46
16
  type ZPropertyDummy = {
47
17
  ui: 'dummy';
48
18
  default: any;
@@ -93,6 +63,36 @@ type ZPropertySelectAdaptSlot = {
93
63
  ui: 'selectAdaptSlot';
94
64
  default: string;
95
65
  } & ZPropertyBase;
66
+ type ZPropertyRuntimeString = {
67
+ ui: 'runtime';
68
+ type: 'string';
69
+ default: string;
70
+ } & ZPropertyBase;
71
+ type ZPropertyRuntimeNumber = {
72
+ ui: 'runtime';
73
+ type: 'number';
74
+ default: number;
75
+ } & ZPropertyBase;
76
+ type ZPropertyRuntimeBoolean = {
77
+ ui: 'runtime';
78
+ type: 'boolean';
79
+ default: boolean;
80
+ } & ZPropertyBase;
81
+ type ZPropertyRuntimeObject = {
82
+ ui: 'runtime';
83
+ type: 'object';
84
+ default: object;
85
+ } & ZPropertyBase;
86
+ type ZPropertyRuntimeArray = {
87
+ ui: 'runtime';
88
+ type: 'array';
89
+ default: object;
90
+ } & ZPropertyBase;
91
+ type ZPropertyRuntimeAny = {
92
+ ui: 'runtime';
93
+ type: 'any';
94
+ default: any;
95
+ } & ZPropertyBase;
96
96
  type WithArray<T extends {
97
97
  default: unknown;
98
98
  }> = (T & {
@@ -106,5 +106,5 @@ export type ZProperty = ({
106
106
  } & ZPropertyBranch) | ({
107
107
  array: true;
108
108
  defaultArray: any[];
109
- } & ZPropertyBranch) | WithArray<ZPropertyTempString> | WithArray<ZPropertyTempNumber> | WithArray<ZPropertyTempBoolean> | WithArray<ZPropertyTempObject> | WithArray<ZPropertyTempArray> | WithArray<ZPropertyTempAny> | WithArray<ZPropertyDummy> | WithArray<ZPropertyStrInput> | WithArray<ZPropertyNumInput> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyColorPicker> | WithArray<ZPropertyJsonEditor> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertySelectComp> | WithArray<ZPropertySelectSlot> | WithArray<ZPropertyStrInput> | WithArray<ZPropertySelectAdaptSlot>;
109
+ } & ZPropertyBranch) | WithArray<ZPropertyDummy> | WithArray<ZPropertyStrInput> | WithArray<ZPropertyNumInput> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyColorPicker> | WithArray<ZPropertyJsonEditor> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertySelectComp> | WithArray<ZPropertySelectSlot> | WithArray<ZPropertyStrInput> | WithArray<ZPropertySelectAdaptSlot> | ZPropertyRuntimeString | ZPropertyRuntimeNumber | ZPropertyRuntimeBoolean | ZPropertyRuntimeObject | ZPropertyRuntimeArray | ZPropertyRuntimeAny;
110
110
  export {};
@@ -39,18 +39,26 @@ export declare class Sandbox {
39
39
  getNode(nodeId: string): Node | undefined;
40
40
  isEqualOfElementSlot(elementKey: string, slotKey: string): boolean;
41
41
  isEqualOfCustomSlot(compId: string, slotId: string): boolean;
42
+ runtimeProperties: {
43
+ [nodeId: string]: {
44
+ [key: string]: any;
45
+ };
46
+ };
42
47
  customProperties: {
43
48
  [key: string]: any;
44
49
  };
45
50
  customSlotProperties: {
46
51
  [key: string]: any;
47
52
  };
53
+ private resetRuntimeProperties;
48
54
  private resetCustomProperties;
49
55
  private resetCustomSlotProperties;
50
- isValidOfElementProperty(elementKey: string, propertyKey: string): boolean;
51
- isValidOfElementSlotProperty(elementKey: string, slotKey: string, propertyKey: string): boolean;
52
- isValidOfCustomProperty(propertyId: string): boolean;
53
- isValidOfCustomSlotProperty(compId: string, slotId: string, propertyId: string): boolean;
56
+ initRuntimeProperty(nodeId: string, propertyKey: string, initValue?: any): void;
57
+ private getMetaOfElementProperty;
58
+ private isValidOfElementProperty;
59
+ private isValidOfElementSlotProperty;
60
+ private isValidOfCustomProperty;
61
+ private isValidOfCustomSlotProperty;
54
62
  getProperty(id: string, instance?: string): any;
55
63
  private getElementProperty;
56
64
  private getRefProperty;
@@ -1,5 +1,5 @@
1
1
  import { ZProperty } from '@/meta';
2
2
  import { Node } from '@/types';
3
- export declare function getPropertyDefaultArray(property: ZProperty): any[] | string[] | number[] | boolean[] | object[];
3
+ export declare function getPropertyDefaultArray(property: ZProperty): any[];
4
4
  export declare function getPropertyDefault(property: ZProperty): any;
5
5
  export declare function initProperties(node: Node, properties: ZProperty[]): void;
@@ -30,12 +30,12 @@ export declare function provideRuntime(runtime: QuickJSRuntime): void;
30
30
  export declare function injectRuntime(): QuickJSRuntime;
31
31
  export declare function provideSandbox(sandbox: Sandbox): void;
32
32
  export declare function injectSandbox(): Sandbox | undefined;
33
- export declare function provideNodeLite(nodeLite: NodeLite): void;
34
- export declare function injectNodeLite(): NodeLite | undefined;
35
- export declare function provideNode(node: Node): void;
36
- export declare function injectNode(): Node | undefined;
33
+ export declare function provideNodeLite(nodeLite: Ref<NodeLite>): void;
34
+ export declare function injectNodeLite(): Ref<NodeLite> | undefined;
35
+ export declare function provideNode(node: Ref<Node>): void;
36
+ export declare function injectNode(): Ref<Node> | undefined;
37
37
  export interface ActivatorContext {
38
38
  props?: Record<string, any>;
39
39
  }
40
- export declare function provideActivatorContext(activator: ActivatorContext): void;
41
- export declare function injectActivatorContext(): ActivatorContext | undefined;
40
+ export declare function provideSlotProps(slotProps: Record<string, any>): void;
41
+ export declare function injectSlotProps(): Record<string, any> | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.9.20",
4
+ "version": "0.9.21",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",