x-runtime-lib 0.8.29 → 0.8.32

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.
@@ -12,24 +12,24 @@ export interface Node {
12
12
  export interface View {
13
13
  nodes: Node[];
14
14
  }
15
- interface TriggerElementProp {
16
- type: 'elementProp';
15
+ interface TriggerElementProperty {
16
+ type: 'elementProperty';
17
17
  nodeId: string;
18
- propKeys: string;
18
+ propertyKeys: string;
19
19
  }
20
- interface TriggerCustomProp {
21
- type: 'customProp';
22
- propId: string;
20
+ interface TriggerCustomProperty {
21
+ type: 'customProperty';
22
+ propertyId: string;
23
23
  }
24
24
  interface TriggerCustomState {
25
25
  type: 'customState';
26
26
  stateId: string;
27
27
  }
28
- interface TriggerAdaptSlotProp {
29
- type: 'adaptSlotProp';
30
- propId: string;
28
+ interface TriggerAdaptSlotProperty {
29
+ type: 'adaptSlotProperty';
30
+ propertyId: string;
31
31
  }
32
- export type Trigger = (TriggerElementProp | TriggerCustomProp | TriggerCustomState | TriggerAdaptSlotProp) & {
32
+ export type Trigger = (TriggerElementProperty | TriggerCustomProperty | TriggerCustomState | TriggerAdaptSlotProperty) & {
33
33
  subKeys?: string;
34
34
  };
35
35
  export interface Reactivity {
@@ -22,28 +22,28 @@ type ZTypeNumInput = {
22
22
  default: string;
23
23
  } & ZTypeBase;
24
24
  export type ZType = ZTypeWord | ZTypeNumInput;
25
- type ZPropBase = {
25
+ type ZPropertyBase = {
26
26
  key: string;
27
27
  name: string;
28
28
  };
29
- type ZPropBranch = {
29
+ type ZPropertyBranch = {
30
30
  ui?: undefined;
31
- children: ZProp[];
31
+ children: ZProperty[];
32
32
  default?: undefined;
33
- } & ZPropBase;
34
- type ZPropDummy = {
33
+ } & ZPropertyBase;
34
+ type ZPropertyDummy = {
35
35
  ui: 'dummy';
36
36
  readonly?: boolean;
37
37
  default: string | number | boolean | object | undefined;
38
- } & ZPropBase;
39
- type ZPropStrInput = {
38
+ } & ZPropertyBase;
39
+ type ZPropertyStrInput = {
40
40
  ui: 'strInput';
41
41
  readonly?: boolean;
42
42
  static?: boolean;
43
43
  value?: unknown;
44
44
  default: string;
45
- } & ZPropBase;
46
- type ZPropNumInput = {
45
+ } & ZPropertyBase;
46
+ type ZPropertyNumInput = {
47
47
  ui: 'numInput';
48
48
  precision?: number;
49
49
  min?: number;
@@ -51,92 +51,92 @@ type ZPropNumInput = {
51
51
  step?: number;
52
52
  readonly?: boolean;
53
53
  default: number;
54
- } & ZPropBase;
55
- type ZPropSwitch = {
54
+ } & ZPropertyBase;
55
+ type ZPropertySwitch = {
56
56
  ui: 'switch';
57
57
  readonly?: boolean;
58
58
  default: boolean;
59
- } & ZPropBase;
60
- type ZPropSelect = {
59
+ } & ZPropertyBase;
60
+ type ZPropertySelect = {
61
61
  ui: 'select';
62
62
  items: 'alignTabsItemsV1' | 'axisTypeItemsV1' | 'borderStyleItemsV1' | 'colorModeItemsV1' | 'densityItemsV1' | 'directionItemsV1' | 'fieldVariantItemsV1' | 'flexCrossAlignItemsV1' | 'flexDirectionItemsV1' | 'flexMainAlignItemsV1' | 'flexWrapItemsV1' | 'fontWeightItemsV1' | 'sheetVariantItemsV1' | 'showTicksItemsV1' | 'sizeItemsV1' | 'textAlignItemsV1' | 'textDecorationItemsV1' | 'textEmphasisItemsV1' | 'textStyleItemsV1' | 'themeColorItemsV1' | 'thumbLabelItemsV1' | 'timelineAlignItemsV1' | 'timelineDirectionItemsV1' | 'timelineSideItemsV1' | 'timelineTruncateLineItemsV1';
63
63
  readonly?: boolean;
64
64
  default: string;
65
- } & ZPropBase;
66
- type ZPropColorPicker = {
65
+ } & ZPropertyBase;
66
+ type ZPropertyColorPicker = {
67
67
  ui: 'colorPicker';
68
68
  readonly?: boolean;
69
69
  default: string | undefined;
70
- } & ZPropBase;
71
- type ZPropJsonEditor = {
70
+ } & ZPropertyBase;
71
+ type ZPropertyJsonEditor = {
72
72
  ui: 'jsonEditor';
73
73
  readonly?: boolean;
74
74
  default: string;
75
- } & ZPropBase;
76
- type ZPropMultiTypes = {
75
+ } & ZPropertyBase;
76
+ type ZPropertyMultiTypes = {
77
77
  ui: 'multiTypes';
78
78
  types: 'borderWidthTypesV1' | 'leftRightTypesV1' | 'marginTypesV1' | 'paddingTypesV1' | 'sizeTypesV1' | 'tableColumnAlignTypesV1' | 'topBottomTypesV1';
79
79
  readonly?: boolean;
80
80
  default: string;
81
- } & ZPropBase;
82
- type ZPropCompSelect = {
81
+ } & ZPropertyBase;
82
+ type ZPropertyCompSelect = {
83
83
  ui: 'compSelect';
84
84
  readonly?: boolean;
85
85
  default: string | undefined;
86
- } & ZPropBase;
87
- export type ZProp = ({
86
+ } & ZPropertyBase;
87
+ export type ZProperty = ({
88
88
  array?: false;
89
- } & ZPropBranch) | ({
89
+ } & ZPropertyBranch) | ({
90
90
  array: true;
91
91
  defaultArray: object[];
92
- } & ZPropBranch) | ({
92
+ } & ZPropertyBranch) | ({
93
93
  array?: false;
94
- } & ZPropDummy) | ({
94
+ } & ZPropertyDummy) | ({
95
95
  array: true;
96
96
  defaultArray: string[] | number[] | boolean | object[];
97
- } & ZPropDummy) | ({
97
+ } & ZPropertyDummy) | ({
98
98
  array?: false;
99
- } & ZPropStrInput) | ({
99
+ } & ZPropertyStrInput) | ({
100
100
  array: true;
101
101
  defaultArray: string[];
102
- } & ZPropStrInput) | ({
102
+ } & ZPropertyStrInput) | ({
103
103
  array?: false;
104
- } & ZPropNumInput) | ({
104
+ } & ZPropertyNumInput) | ({
105
105
  array: true;
106
106
  defaultArray: number[];
107
- } & ZPropNumInput) | ({
107
+ } & ZPropertyNumInput) | ({
108
108
  array?: false;
109
- } & ZPropSwitch) | ({
109
+ } & ZPropertySwitch) | ({
110
110
  array: true;
111
111
  defaultArray: boolean[];
112
- } & ZPropSwitch) | ({
112
+ } & ZPropertySwitch) | ({
113
113
  array?: false;
114
- } & ZPropSelect) | ({
114
+ } & ZPropertySelect) | ({
115
115
  array: true;
116
116
  defaultArray: string[];
117
- } & ZPropSelect) | ({
117
+ } & ZPropertySelect) | ({
118
118
  array?: false;
119
- } & ZPropColorPicker) | ({
119
+ } & ZPropertyColorPicker) | ({
120
120
  array: true;
121
121
  defaultArray: string[];
122
- } & ZPropColorPicker) | ({
122
+ } & ZPropertyColorPicker) | ({
123
123
  array?: false;
124
- } & ZPropJsonEditor) | ({
124
+ } & ZPropertyJsonEditor) | ({
125
125
  array: true;
126
126
  defaultArray: string[];
127
- } & ZPropJsonEditor) | ({
127
+ } & ZPropertyJsonEditor) | ({
128
128
  array?: false;
129
- } & ZPropMultiTypes) | ({
129
+ } & ZPropertyMultiTypes) | ({
130
130
  array: true;
131
131
  defaultArray: string[];
132
- } & ZPropMultiTypes) | ({
132
+ } & ZPropertyMultiTypes) | ({
133
133
  array?: false;
134
- } & ZPropCompSelect) | ({
134
+ } & ZPropertyCompSelect) | ({
135
135
  array: true;
136
136
  defaultArray: string[];
137
- } & ZPropCompSelect);
138
- export type ZProps = {
139
- [key: string]: ZProp[];
137
+ } & ZPropertyCompSelect);
138
+ export type ZProperties = {
139
+ [key: string]: ZProperty[];
140
140
  };
141
141
  export type ZEvent = {
142
142
  key: string;
@@ -190,7 +190,7 @@ export type ZElement = {
190
190
  key: string;
191
191
  name: string;
192
192
  comp: any;
193
- props: ZProps;
193
+ properties: ZProperties;
194
194
  events: ZEvent[];
195
195
  methods: ZMethod[];
196
196
  slots: ZSlot[];
@@ -1,7 +1,7 @@
1
1
  export * from './misc';
2
2
  export * from './name';
3
3
  export * from './node';
4
- export * from './prop';
4
+ export * from './property';
5
5
  export * from './provideInject';
6
6
  export * from './reactivity';
7
7
  export * from './sandbox';
@@ -0,0 +1,4 @@
1
+ import { ZProperty } from '@/types';
2
+ export declare function getPropertyTag(type: string, subtype: string): string | undefined;
3
+ export declare function getPropertyDefault(property: ZProperty, arrayEntry?: boolean): unknown;
4
+ export declare function initProperties(node: any, properties: ZProperty[]): void;
@@ -1,10 +1,10 @@
1
1
  import { Data, Env, Mode } from '@/types';
2
- export type PropKeys = string[] | string;
2
+ export type PropertyKeys = string[] | string;
3
3
  interface Hooks {
4
- onElementPropChange: (nodeId: string, propKeys: PropKeys, newValue: any, oldValue: any) => void;
5
- onCustomPropChange: (propId: string, newValue: any, oldValue: any) => void;
4
+ onElementPropertyChange: (nodeId: string, propertyKeys: PropertyKeys, newValue: any, oldValue: any) => void;
5
+ onCustomPropertyChange: (propertyId: string, newValue: any, oldValue: any) => void;
6
6
  onCustomStateChange: (stateId: string, newValue: any, oldValue: any) => void;
7
- onAdaptSlotPropChange: (propId: string, newValue: any, oldValue: any) => void;
7
+ onAdaptSlotPropertyChange: (propertyId: string, newValue: any, oldValue: any) => void;
8
8
  }
9
9
  export declare class Sandbox {
10
10
  org: string;
@@ -16,22 +16,22 @@ export declare class Sandbox {
16
16
  constructor(org: string, env: Env, mode: Mode, type: 'page' | 'comp', hooks?: Hooks);
17
17
  private nodes;
18
18
  syncNodes(data: Data | undefined): void;
19
- getElementPropInner(node: any, propKeys: PropKeys): any;
20
- getElementProp(nodeId: string, propKeys: PropKeys): any;
21
- setElementPropInner(node: any, propKeys: PropKeys, newValue: any): void;
22
- setElementProp(nodeId: string, propKeys: PropKeys, newValue: any): void;
23
- private customProps;
24
- resetCustomProps(): void;
25
- getCustomProp(propId: string): any;
26
- setCustomProp(propId: string, newValue: any): void;
19
+ getElementPropertyInner(node: any, propertyKeys: PropertyKeys): any;
20
+ getElementProperty(nodeId: string, propertyKeys: PropertyKeys): any;
21
+ setElementPropertyInner(node: any, propertyKeys: PropertyKeys, newValue: any): void;
22
+ setElementProperty(nodeId: string, propertyKeys: PropertyKeys, newValue: any): void;
23
+ private customProperties;
24
+ resetCustomProperties(): void;
25
+ getCustomProperty(propertyId: string): any;
26
+ setCustomProperty(propertyId: string, newValue: any): void;
27
27
  private customStates;
28
28
  resetCustomStates(): void;
29
29
  getCustomState(stateId: string): any;
30
30
  setCustomState(stateId: string, newValue: string): void;
31
- private adaptSlotProps;
32
- resetAdaptSlotProps(): void;
33
- getAdaptSlotProp(propId: string): any;
34
- setAdaptSlotProp(propId: string, newValue: any): void;
31
+ private adaptSlotProperties;
32
+ resetAdaptSlotProperties(): void;
33
+ getAdaptSlotProperty(propertyId: string): any;
34
+ setAdaptSlotProperty(propertyId: string, newValue: any): void;
35
35
  private interpreter;
36
36
  createInterpreter(code: string): void;
37
37
  destroyInterpreter(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.29",
4
+ "version": "0.8.32",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,4 +0,0 @@
1
- import { BaseProps } from '@/types';
2
- export declare function useElementProp(props: BaseProps, keys: string[], json?: boolean): {
3
- prop: import("vue").Ref<any, any>;
4
- };
@@ -1,4 +0,0 @@
1
- import { ZProp } from '@/types';
2
- export declare function getPropTag(type: string, subtype: string): string | undefined;
3
- export declare function getPropDefault(prop: ZProp, arrayEntry?: boolean): unknown;
4
- export declare function initProps(node: any, props: ZProp[]): void;