x-runtime-lib 0.7.32 → 0.7.34

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,3 +1,3 @@
1
1
  import Interpreter from 'js-interpreter';
2
- import { SandboxContext } from '../../types';
2
+ import { SandboxContext } from '@/types';
3
3
  export declare function bindView(context: SandboxContext, interpreter: Interpreter, globalObject: object): void;
@@ -1,9 +1,5 @@
1
1
  export type Env = 'dev' | 'prod';
2
2
  export type Mode = 'runtime' | 'preview' | 'editor';
3
- export type Device = {
4
- width: number;
5
- height: number;
6
- };
7
- export type Type = 'page' | 'comp';
8
- export declare const fieldTypes: readonly ["string", "number", "boolean", "array", "object"];
9
- export type FieldType = (typeof fieldTypes)[number];
3
+ export declare const types: readonly ["string", "number", "boolean", "array", "object"];
4
+ export type Type = (typeof types)[number];
5
+ export declare function getTypeColor(type: Type): string;
@@ -1,4 +1,4 @@
1
- import { FieldType } from './basic';
1
+ import { Type } from './basic';
2
2
  import { Node } from './data';
3
3
  export type ZItem = {
4
4
  title: string;
@@ -144,7 +144,7 @@ export type ZEvent = {
144
144
  params: {
145
145
  key: string;
146
146
  name: string;
147
- type: FieldType;
147
+ type: Type;
148
148
  }[];
149
149
  };
150
150
  export type ZMethod = {
@@ -153,12 +153,12 @@ export type ZMethod = {
153
153
  inputs: {
154
154
  key: string;
155
155
  name: string;
156
- type: FieldType;
156
+ type: Type;
157
157
  }[];
158
158
  outputs: {
159
159
  key: string;
160
160
  name: string;
161
- type: FieldType;
161
+ type: Type;
162
162
  }[];
163
163
  };
164
164
  export type ZSlot = {
@@ -167,7 +167,7 @@ export type ZSlot = {
167
167
  props: {
168
168
  key: string;
169
169
  name: string;
170
- type: FieldType;
170
+ type: Type;
171
171
  }[];
172
172
  methods: {
173
173
  key: string;
@@ -175,12 +175,12 @@ export type ZSlot = {
175
175
  inputs: {
176
176
  key: string;
177
177
  name: string;
178
- type: FieldType;
178
+ type: Type;
179
179
  }[];
180
180
  outputs: {
181
181
  key: string;
182
182
  name: string;
183
- type: FieldType;
183
+ type: Type;
184
184
  }[];
185
185
  }[];
186
186
  };
@@ -1,20 +1,20 @@
1
- import { FieldType } from './basic';
1
+ import { Type } from './basic';
2
2
  export type Field = {
3
3
  id: string;
4
4
  name: string;
5
- type: FieldType;
5
+ type: Type;
6
6
  desc: string;
7
7
  };
8
8
  export type State = {
9
9
  id: string;
10
10
  name: string;
11
- type: FieldType;
11
+ type: Type;
12
12
  desc: string;
13
13
  };
14
14
  export type Argument = {
15
15
  id: string;
16
16
  name: string;
17
- type: FieldType;
17
+ type: Type;
18
18
  desc: string;
19
19
  };
20
20
  export type PageMeta = {
@@ -25,7 +25,7 @@ export type PageMeta = {
25
25
  export type Property = {
26
26
  id: string;
27
27
  name: string;
28
- type: FieldType;
28
+ type: Type;
29
29
  desc: string;
30
30
  };
31
31
  export type Method = {
@@ -1,13 +1,13 @@
1
1
  import Interpreter from 'js-interpreter';
2
2
  import { Emitter, EventType } from 'mitt';
3
- import { Env, Mode, Type } from './basic';
3
+ import { Env, Mode } from './basic';
4
4
  import { Data } from './data';
5
5
  type EventBus = Emitter<Record<EventType, unknown>>;
6
6
  export interface SandboxContext {
7
7
  org: string;
8
8
  env: Env;
9
9
  mode: Mode;
10
- type: Type;
10
+ type: 'page' | 'comp';
11
11
  data: Data;
12
12
  eventBus?: EventBus;
13
13
  }
@@ -1,17 +1,21 @@
1
1
  import { Ref } from 'vue';
2
- import { Data, Depends, Device, Env, Mode, Sandbox, Type } from '../types';
2
+ import { Data, Depends, Env, Mode, Sandbox } from '@/types';
3
3
  export declare function provideOrg(org: string): void;
4
4
  export declare function injectOrg(): string;
5
5
  export declare function provideEnv(env: Env): void;
6
6
  export declare function injectEnv(): Env;
7
7
  export declare function provideMode(mode: Mode): void;
8
8
  export declare function injectMode(): Mode;
9
+ export type Device = {
10
+ width: number;
11
+ height: number;
12
+ };
9
13
  export declare function provideDevice(device: Ref<Device>): void;
10
14
  export declare function injectDevice(): Ref<Device>;
11
15
  export declare function provideDark(dark: Ref<boolean>): void;
12
16
  export declare function injectDark(): Ref<boolean>;
13
- export declare function provideType(type: Type): void;
14
- export declare function injectType(): Type;
17
+ export declare function provideType(type: 'page' | 'comp'): void;
18
+ export declare function injectType(): "page" | "comp";
15
19
  export declare function provideData(data: Ref<Data>): void;
16
20
  export declare function injectData(): Ref<Data>;
17
21
  export declare function provideDepends(depends: Ref<Depends>): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.7.32",
4
+ "version": "0.7.34",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,4 +0,0 @@
1
- import { Ref } from 'vue';
2
- export declare function useThemeV1(dark: Ref<boolean>): {
3
- theme: import("vue").ComputedRef<"dark" | "light">;
4
- };
@@ -1,2 +0,0 @@
1
- import { BaseProps, Sandbox } from '../../../types';
2
- export declare function useCallMethod(sandbox: Sandbox, props: BaseProps, hook: (params: unknown) => void): void;
@@ -1,3 +0,0 @@
1
- export declare function useReactive(): {
2
- reactives: any;
3
- };