x-runtime-lib 0.8.11 → 0.8.13
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/dist/composables/element/core/elementMethod.d.ts +2 -1
- package/dist/index.js +2583 -2527
- package/dist/interpreter/index.d.ts +3 -4
- package/dist/interpreter/runtime/event.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interpreter.d.ts +11 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/provideInject.d.ts +2 -1
- package/dist/utils/reactivity.d.ts +2 -1
- package/dist/utils/sandbox.d.ts +38 -0
- package/dist/{vendor.ffvpnvqh.js → vendor.ghqz34q2.js} +9742 -9742
- package/package.json +1 -1
- package/dist/types/sandbox.d.ts +0 -28
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export
|
|
4
|
-
export declare function stopInterpreter(interpreter: Interpreter): void;
|
|
1
|
+
import bind from './bind';
|
|
2
|
+
import runtime from './runtime';
|
|
3
|
+
export { bind, runtime };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const event = "\nvar __events__ = {}\n\nfunction __onEventV1__(id,
|
|
1
|
+
declare const event = "\nvar __events__ = {}\n\nfunction __onEventV1__(id, callback) {\n if (typeof(id) !== 'string' || !id) {\n return\n }\n if (typeof(callback) !== 'function') {\n return\n }\n if (!__events__[id]) {\n __events__[id] = []\n }\n var callbacks = __events__[id]\n for (var i = 0; i < callbacks.length; i++) {\n if (callbacks[i] === callback) {\n return\n }\n }\n callbacks.push(callback)\n}\n\nfunction __triggerEventV1__(id, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) {\n if (typeof(id) !== 'string' || !id) {\n return\n }\n if (!__events__[id]) {\n return\n }\n var callbacks = __events__[id]\n if (!callbacks) {\n return\n }\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16)\n }\n}\n";
|
|
2
2
|
export default event;
|
package/dist/types/index.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { Data, Depends, Env, Mode
|
|
2
|
+
import { Data, Depends, Env, Mode } from '@/types';
|
|
3
|
+
import { Sandbox } from './sandbox';
|
|
3
4
|
export declare function provideOrg(org: string): void;
|
|
4
5
|
export declare function injectOrg(): string;
|
|
5
6
|
export declare function provideEnv(env: Env): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { Reactivity,
|
|
1
|
+
import { Reactivity, Trigger } from '@/types';
|
|
2
|
+
import { Sandbox } from './sandbox';
|
|
2
3
|
export declare function makeTriggerId(trigger: Trigger): string;
|
|
3
4
|
export declare function triggerReactivity(sandbox: Sandbox, reactivity: Reactivity, triggerId: string, newValue: any, oldValue: any): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Data, InterpreterContext } from '@/types';
|
|
2
|
+
export type PropKeys = string[] | string;
|
|
3
|
+
interface Hooks {
|
|
4
|
+
onElementPropChange: (nodeId: string, propKeys: PropKeys, newValue: any, oldValue: any) => void;
|
|
5
|
+
onCustomPropChange: (propId: string, newValue: any, oldValue: any) => void;
|
|
6
|
+
onCustomStateChange: (stateId: string, newValue: any, oldValue: any) => void;
|
|
7
|
+
onAdaptSlotPropChange: (propId: string, newValue: any, oldValue: any) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class Sandbox {
|
|
10
|
+
eventBus: import("mitt").Emitter<Record<import("mitt").EventType, unknown>>;
|
|
11
|
+
private hooks?;
|
|
12
|
+
constructor(hooks?: Hooks);
|
|
13
|
+
private nodes;
|
|
14
|
+
syncNodes(data: Data | undefined): void;
|
|
15
|
+
getElementPropInner(node: any, propKeys: PropKeys): any;
|
|
16
|
+
getElementProp(nodeId: string, propKeys: PropKeys): any;
|
|
17
|
+
setElementPropInner(node: any, propKeys: PropKeys, newValue: any): void;
|
|
18
|
+
setElementProp(nodeId: string, propKeys: PropKeys, newValue: any): void;
|
|
19
|
+
private customProps;
|
|
20
|
+
resetCustomProps(): void;
|
|
21
|
+
getCustomProp(propId: string): any;
|
|
22
|
+
setCustomProp(propId: string, newValue: any): void;
|
|
23
|
+
private customStates;
|
|
24
|
+
resetCustomStates(): void;
|
|
25
|
+
getCustomState(stateId: string): any;
|
|
26
|
+
setCustomState(stateId: string, newValue: string): void;
|
|
27
|
+
private adaptSlotProps;
|
|
28
|
+
resetAdaptSlotProps(): void;
|
|
29
|
+
getAdaptSlotProp(propId: string): any;
|
|
30
|
+
setAdaptSlotProp(propId: string, newValue: any): void;
|
|
31
|
+
private interpreter;
|
|
32
|
+
createInterpreter(context: InterpreterContext, code: string): void;
|
|
33
|
+
destroyInterpreter(): void;
|
|
34
|
+
getVariable(varName: string): any;
|
|
35
|
+
setVariable(varName: string, value: any): void;
|
|
36
|
+
callFunction(funcName: string, params?: any[]): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|