x-runtime-lib 0.8.36 → 0.8.37

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,7 +1,8 @@
1
1
  export interface RefContext {
2
2
  parent?: RefContext;
3
- refid: string;
3
+ compId: string;
4
4
  }
5
+ export declare function isCircularRef(refContext: RefContext): boolean;
5
6
  export interface BaseProps {
6
7
  node: any;
7
8
  outer?: boolean;
@@ -4,7 +4,7 @@ export interface Node {
4
4
  key: string;
5
5
  alias?: string;
6
6
  };
7
- ref?: {
7
+ reference?: {
8
8
  comp: string | undefined;
9
9
  };
10
10
  children?: Node[];
@@ -1,5 +1,5 @@
1
1
  export * from './basic';
2
- export * from './component';
2
+ export * from './comp';
3
3
  export * from './context';
4
4
  export * from './data';
5
5
  export * from './depend';
@@ -1,6 +1,6 @@
1
- export type PropertyKind = 'elementProperty' | 'refProperty' | 'customProperty' | 'elementSlotProperty' | 'customSlotProperty';
1
+ export type PropertyKind = 'elementProperty' | 'referenceProperty' | 'multipleRefProperty' | 'customProperty' | 'elementSlotProperty' | 'customSlotProperty';
2
2
  export declare function isLocaleOfPropertyKind(kind: PropertyKind): kind is "elementProperty" | "elementSlotProperty";
3
- export type MethodKind = 'elementMethod' | 'refMethod' | 'customMethod' | 'elementSlotMethod' | 'customSlotMethod';
3
+ export type MethodKind = 'elementMethod' | 'referenceMethod' | 'multipleRefMethod' | 'customMethod' | 'elementSlotMethod' | 'customSlotMethod';
4
4
  export declare function isLocaleOfMethodKind(kind: MethodKind): kind is "elementMethod" | "elementSlotMethod";
5
- export type EventKind = 'elementEvent' | 'refEvent' | 'customEvent' | 'elementPropertyChangeEvent' | 'customPropertyChangeEvent' | 'stateChangeEvent';
5
+ export type EventKind = 'elementEvent' | 'referenceEvent' | 'multipleRefEvent' | 'customEvent' | 'elementPropertyChangeEvent' | 'customPropertyChangeEvent' | 'stateChangeEvent';
6
6
  export declare function isLocaleOfEventKind(kind: EventKind): kind is "elementEvent" | "elementPropertyChangeEvent";
@@ -1,5 +1,5 @@
1
1
  import { Node } from '../types';
2
- export declare function spawnNode(type: string, subtype: string, version: string, ref: boolean, keyOrRefid: string): Node | undefined;
2
+ export declare function spawnNode(type: string, subtype: string, version: string, ref: boolean, keyOrRefId: string): Node | undefined;
3
3
  export declare function getNode(nodes: Node[], id: string): Node | undefined;
4
4
  export declare function duplicateNode(src: Node): Node;
5
5
  export declare function duplicateNodes(src: Node[]): Node[];
@@ -4,17 +4,18 @@ export declare function dotPropertyKeys(propertyKeys: PropertyKeys): string;
4
4
  interface Hooks {
5
5
  onElementPropertyChange: (nodeId: string, propertyKeys: PropertyKeys, newValue: any, oldValue: any) => void;
6
6
  onCustomPropertyChange: (propertyId: string, newValue: any, oldValue: any) => void;
7
- onStateChange: (stateId: string, newValue: any, oldValue: any) => void;
8
7
  onAdaptSlotPropertyChange: (propertyId: string, newValue: any, oldValue: any) => void;
8
+ onStateChange: (stateId: string, newValue: any, oldValue: any) => void;
9
9
  }
10
10
  export declare class Sandbox {
11
+ parent: Sandbox | undefined;
11
12
  org: string;
12
13
  env: Env;
13
14
  mode: Mode;
14
15
  type: 'page' | 'comp';
15
16
  eventBus: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
16
17
  private hooks?;
17
- constructor(org: string, env: Env, mode: Mode, type: 'page' | 'comp', hooks?: Hooks);
18
+ constructor(parent: Sandbox | undefined, org: string, env: Env, mode: Mode, type: 'page' | 'comp', hooks?: Hooks);
18
19
  private nodes;
19
20
  syncNodes(data: Data | undefined): void;
20
21
  getElementPropertyInner(node: any, propertyKeys: PropertyKeys): any;
@@ -25,14 +26,14 @@ export declare class Sandbox {
25
26
  resetCustomProperties(): void;
26
27
  getCustomProperty(propertyId: string): any;
27
28
  setCustomProperty(propertyId: string, newValue: any): void;
28
- private states;
29
- resetStates(): void;
30
- getState(stateId: string): any;
31
- setState(stateId: string, newValue: string): void;
32
29
  private adaptSlotProperties;
33
30
  resetAdaptSlotProperties(): void;
34
31
  getAdaptSlotProperty(propertyId: string): any;
35
32
  setAdaptSlotProperty(propertyId: string, newValue: any): void;
33
+ private states;
34
+ resetStates(): void;
35
+ getState(stateId: string): any;
36
+ setState(stateId: string, newValue: string): void;
36
37
  private interpreter;
37
38
  createInterpreter(code: string): void;
38
39
  destroyInterpreter(): void;
@@ -17,5 +17,3 @@ export declare function unwrapEventId(id: string): {
17
17
  nodeId: string;
18
18
  eventKey: string;
19
19
  };
20
- export declare function makeStateId(stateId: string): string;
21
- export declare function unwrapStateId(id: string): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.36",
4
+ "version": "0.8.37",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import { RefContext } from '@/types';
2
- interface Props {
3
- refContext: RefContext;
4
- }
5
- declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,3 +0,0 @@
1
- declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
- declare const _default: typeof __VLS_export;
3
- export default _default;
@@ -1,2 +0,0 @@
1
- import { ZElement } from '@/types';
2
- export declare const singleRefV1: ZElement;