x-runtime-lib 0.8.224 → 0.9.1

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.
@@ -7,27 +7,43 @@ export type CompType = (typeof compTypes)[number];
7
7
  export type Tag = 'pageUi' | 'compUi' | 'page3d' | 'comp3d';
8
8
  export declare function getTag(type: string, subtype: string): Tag;
9
9
  export type ZItem = {
10
- title: string;
11
10
  value: string;
11
+ title: string;
12
12
  };
13
13
  type ZTypeBase = {
14
- title: string;
15
14
  value: string;
16
- validator: (v: any) => boolean;
15
+ title: string;
16
+ validator: (v: unknown) => boolean;
17
17
  };
18
18
  type ZTypeWord = {
19
- ui: 'word';
19
+ trait: 'word';
20
+ default: string;
21
+ } & ZTypeBase;
22
+ type ZTypePixel = {
23
+ trait: 'pixel';
24
+ precision?: number;
25
+ min?: number;
26
+ max?: number;
27
+ step?: number;
20
28
  default: string;
21
29
  } & ZTypeBase;
22
- type ZTypeNumInput = {
23
- ui: 'pixelInput' | 'percentInput';
30
+ type ZTypePercent = {
31
+ trait: 'percent';
24
32
  precision?: number;
25
33
  min?: number;
26
34
  max?: number;
27
35
  step?: number;
28
36
  default: string;
29
37
  } & ZTypeBase;
30
- export type ZType = ZTypeWord | ZTypeNumInput;
38
+ type ZTypeHexColor = {
39
+ trait: 'hexColor';
40
+ default: string;
41
+ } & ZTypeBase;
42
+ type ZTypeThemeColor = {
43
+ trait: 'themeColor';
44
+ default: string;
45
+ } & ZTypeBase;
46
+ export type ZType = ZTypeWord | ZTypePixel | ZTypePercent | ZTypeHexColor | ZTypeThemeColor;
31
47
  type ZPropertyBranch = {
32
48
  key: string;
33
49
  name: string;
@@ -77,7 +93,7 @@ type ZPropertyJsonEditor = {
77
93
  } & ZPropertyBase;
78
94
  type ZPropertyMultiTypes = {
79
95
  ui: 'multiTypes';
80
- types: 'borderWidthTypesV1' | 'leftRightTypesV1' | 'marginTypesV1' | 'paddingTypesV1' | 'sizeTypesV1' | 'tableColumnAlignTypesV1' | 'topBottomTypesV1';
96
+ types: 'borderWidthTypesV1' | 'colorTypesV1' | 'leftRightTypesV1' | 'marginTypesV1' | 'paddingTypesV1' | 'sizeTypesV1' | 'tableColumnAlignTypesV1' | 'topBottomTypesV1';
81
97
  default: string;
82
98
  } & ZPropertyBase;
83
99
  type ZPropertySelectComp = {
@@ -1,8 +1,10 @@
1
1
  export declare function genId(len: number): string;
2
- export declare function isPixelStr(v: unknown): boolean;
3
- export declare function isPercentStr(v: unknown): boolean;
4
- export declare function parsePixelStr(v: unknown): number | undefined;
5
- export declare function parsePercentStr(v: unknown): number | undefined;
2
+ export declare function isPixel(v: unknown): boolean;
3
+ export declare function parsePixel(v: unknown): number | undefined;
4
+ export declare function isPercent(v: unknown): boolean;
5
+ export declare function parsePercent(v: unknown): number | undefined;
6
+ export declare function isHexColor(v: unknown): boolean;
7
+ export declare function isThemeColor(v: unknown): boolean;
6
8
  export declare const breakpoints: string[];
7
9
  export declare const reverseBreakpoints: string[];
8
10
  export type Breakpoint = (typeof breakpoints)[number];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.8.224",
4
+ "version": "0.9.1",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import { ZItem } from '@/types';
2
- export declare const colorModeItemsV1: ZItem[];
@@ -1,2 +0,0 @@
1
- import { ZProperty } from '@/types';
2
- export declare const colorV1: ZProperty;