x-runtime-lib 0.8.181 → 0.8.183

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.
@@ -1,8 +1,9 @@
1
1
  export interface Hooks {
2
- onElementPropertyChange: (nodeId: string, propertyKeys: string[], newValue: any, oldValue: any) => void;
2
+ onElementPropertyChange: (nodeId: string, propertyKeys: string[] | string, newValue: any, oldValue: any) => void;
3
3
  onElementSlotPropertyChange: (nodeId: string, elementId: string, slotKey: string, propertyKey: string, newValue: any, oldValue: any) => void;
4
4
  onMultipleElementSlotPropertyChange: (nodeId: string, spec: string, elementId: string, slotKey: string, propertyKey: string, newValue: any, oldValue: any) => void;
5
- onCustomPropertyChange: (propertyKey: string, newValue: any, oldValue: any) => void;
6
5
  onCustomSlotPropetyChange: (propertyKey: string, newValue: any, oldValue: any) => void;
6
+ onMultipleCustomSlotPropertyChange: (spec: string, propertyKey: string, newValue: any, oldValue: any) => void;
7
+ onCustomPropertyChange: (propertyKey: string, newValue: any, oldValue: any) => void;
7
8
  onStateChange: (stateId: string, newValue: any, oldValue: any) => void;
8
9
  }
@@ -36,14 +36,18 @@ export declare class Sandbox {
36
36
  getGlobalVariable(key: string): any;
37
37
  callFunctionSync(funcName: string, ...params: any[]): any;
38
38
  callFunctionAsync(funcName: string, ...params: any[]): Promise<any>;
39
- getElementProperty(nodeId: string, propertyKeys: string[]): Promise<any>;
40
- setElementProperty(nodeId: string, propertyKeys: string[], newValue: any): Promise<Error | undefined>;
39
+ isValidOfElementProperty(nodeId: string, propertyKeys: string[] | string): boolean;
40
+ getElementProperty(nodeId: string, propertyKeys: string[] | string): Promise<any>;
41
+ setElementProperty(nodeId: string, propertyKeys: string[] | string, newValue: any): Promise<Error | undefined>;
42
+ isValidOfElementSlotProperty(propertyKey: string): boolean;
41
43
  getElementSlotProperty(propertyKey: string): Promise<any>;
42
44
  setElementSlotProperty(propertyKey: string, value: any): Promise<void>;
45
+ isValidOfMultipleElementSlotProperty(propertyKey: string): boolean;
43
46
  getMultipleElementSlotProperty(spec: string, propertyKey: string): Promise<any>;
44
47
  setMultipeElementSlotProperty(spec: string, propertyKey: string, value: any): Promise<void>;
45
48
  private customProperties;
46
49
  private resetCustomProperties;
50
+ isValidOfCustomProperty(key: string): boolean;
47
51
  getCustomProperty(key: string): Promise<any>;
48
52
  setCustomProperty(key: string, newValue: any): Promise<void>;
49
53
  private customSlotProperties;
@@ -67,6 +71,7 @@ export declare class Sandbox {
67
71
  }>;
68
72
  private states;
69
73
  private resetStates;
74
+ isValidOfState(stateId: string): boolean;
70
75
  getState(stateId: string): any;
71
76
  setState(stateId: string, newValue: any): void;
72
77
  }
@@ -34,19 +34,43 @@ interface TriggerElementProperty {
34
34
  nodeId: string;
35
35
  propertyKeys: string;
36
36
  }
37
- interface TriggerCustomProperty {
38
- type: 'customProperty';
39
- propertyId: string;
37
+ interface TriggerElementSlotProperty {
38
+ type: 'elementSlotProperty';
39
+ nodeId: string;
40
+ elementKey: string;
41
+ slotKey: string;
42
+ propertyKey: string;
43
+ }
44
+ interface TriggerMultipleElementSlotProperty {
45
+ type: 'multipleElementSlotProperty';
46
+ nodeId: string;
47
+ elementKey: string;
48
+ spec: string;
49
+ slotKey: string;
50
+ propertyKey: string;
40
51
  }
41
52
  interface TriggerCustomSlotProperty {
42
53
  type: 'customSlotProperty';
54
+ compId: string;
55
+ slotId: string;
56
+ propertyId: string;
57
+ }
58
+ interface TriggerMultipleCustomSlotProperty {
59
+ type: 'multipleCustomSlotProperty';
60
+ spec: string;
61
+ compId: string;
62
+ slotId: string;
63
+ propertyId: string;
64
+ }
65
+ interface TriggerCustomProperty {
66
+ type: 'customProperty';
43
67
  propertyId: string;
44
68
  }
45
69
  interface TriggerState {
46
70
  type: 'state';
47
71
  stateId: string;
48
72
  }
49
- export type Trigger = (TriggerElementProperty | TriggerCustomProperty | TriggerCustomSlotProperty | TriggerState) & {
73
+ export type Trigger = (TriggerElementProperty | TriggerElementSlotProperty | TriggerMultipleElementSlotProperty | TriggerCustomSlotProperty | TriggerMultipleCustomSlotProperty | TriggerCustomProperty | TriggerState) & {
50
74
  subKeys?: string;
51
75
  };
52
76
  export interface Reactivity {
@@ -11,6 +11,8 @@ export declare function getIndexOfBreakpoint(breakpoint: Breakpoint): number;
11
11
  export declare function getBreakpointProp(current: Breakpoint, props: {
12
12
  [bp: Breakpoint]: any;
13
13
  }): any;
14
+ export declare function toDotString(target: string[] | string): string;
15
+ export declare function fromDotString(target: string[] | string): string[];
14
16
  export declare function getField(object: any, keys: string[] | string): any;
15
17
  export declare function setField(object: any, keys: string[] | string, value: any): void;
16
18
  export declare function addIndent(code: string, spaces?: number): string;
@@ -1,3 +1,4 @@
1
1
  import { Node, ZProperty } from '@/types';
2
2
  export declare function getPropertyDefault(property: ZProperty, arrayEntry?: boolean): unknown;
3
3
  export declare function initProperties(node: Node, properties: ZProperty[]): void;
4
+ export declare function isLeafOfPropertyKeys(elementKey: string, type: string, subtype: string, propertyKeys: string[] | string): boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.181",
4
+ "version": "0.8.183",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",