@webstudio-is/sdk 0.91.0 → 0.92.0
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/lib/index.js +12 -1
- package/lib/instances-utils.js +33 -0
- package/lib/instances-utils.test.js +58 -0
- package/lib/{assets.js → schema/assets.js} +6 -12
- package/lib/schema/breakpoints.js +22 -0
- package/lib/schema/data-sources.js +39 -0
- package/lib/schema/deployment.js +6 -0
- package/lib/schema/instances.js +19 -0
- package/lib/schema/pages.js +51 -0
- package/lib/schema/props.js +67 -0
- package/lib/schema/style-source-selections.js +9 -0
- package/lib/schema/style-sources.js +14 -0
- package/lib/schema/styles.js +16 -0
- package/lib/types/index.d.ts +11 -1
- package/lib/types/instances-utils.d.ts +27 -0
- package/lib/types/instances-utils.test.d.ts +1 -0
- package/lib/types/schema/breakpoints.d.ts +56 -0
- package/lib/types/schema/data-sources.d.ts +234 -0
- package/lib/types/schema/deployment.d.ts +12 -0
- package/lib/types/schema/instances.d.ts +123 -0
- package/lib/types/schema/pages.d.ts +35 -0
- package/lib/types/schema/props.d.ts +423 -0
- package/lib/types/schema/style-source-selections.d.ts +23 -0
- package/lib/types/schema/style-sources.d.ts +62 -0
- package/lib/types/schema/styles.d.ts +2489 -0
- package/package.json +12 -10
- package/lib/cjs/assets.js +0 -56
- package/lib/cjs/index.js +0 -18
- package/lib/cjs/package.json +0 -1
- package/src/assets.ts +0 -41
- package/src/index.ts +0 -1
- package/lib/types/{assets.d.ts → schema/assets.d.ts} +36 -36
package/lib/index.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
export * from "./schema/assets";
|
|
3
|
+
export * from "./schema/pages";
|
|
4
|
+
export * from "./schema/instances";
|
|
5
|
+
export * from "./schema/data-sources";
|
|
6
|
+
export * from "./schema/props";
|
|
7
|
+
export * from "./schema/breakpoints";
|
|
8
|
+
export * from "./schema/style-sources";
|
|
9
|
+
export * from "./schema/style-source-selections";
|
|
10
|
+
export * from "./schema/styles";
|
|
11
|
+
export * from "./schema/deployment";
|
|
12
|
+
export * from "./instances-utils";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const traverseInstances = (instances, instanceId, callback) => {
|
|
3
|
+
const instance = instances.get(instanceId);
|
|
4
|
+
if (instance === void 0) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
const skipTraversingChildren = callback(instance);
|
|
8
|
+
if (skipTraversingChildren === false) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
for (const child of instance.children) {
|
|
12
|
+
if (child.type === "id") {
|
|
13
|
+
traverseInstances(instances, child.value, callback);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export const findTreeInstanceIds = (instances, rootInstanceId) => {
|
|
18
|
+
const ids = /* @__PURE__ */ new Set();
|
|
19
|
+
traverseInstances(instances, rootInstanceId, (instance) => {
|
|
20
|
+
ids.add(instance.id);
|
|
21
|
+
});
|
|
22
|
+
return ids;
|
|
23
|
+
};
|
|
24
|
+
export const findTreeInstanceIdsExcludingSlotDescendants = (instances, rootInstanceId) => {
|
|
25
|
+
const ids = /* @__PURE__ */ new Set();
|
|
26
|
+
traverseInstances(instances, rootInstanceId, (instance) => {
|
|
27
|
+
ids.add(instance.id);
|
|
28
|
+
if (instance.component === "Slot") {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return ids;
|
|
33
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { expect, test } from "@jest/globals";
|
|
3
|
+
import {
|
|
4
|
+
findTreeInstanceIds,
|
|
5
|
+
findTreeInstanceIdsExcludingSlotDescendants
|
|
6
|
+
} from "./instances-utils";
|
|
7
|
+
const createInstance = (id, component, children) => {
|
|
8
|
+
return {
|
|
9
|
+
type: "instance",
|
|
10
|
+
id,
|
|
11
|
+
component,
|
|
12
|
+
children
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const createInstancePair = (id, component, children) => {
|
|
16
|
+
return [id, createInstance(id, component, children)];
|
|
17
|
+
};
|
|
18
|
+
test("find all tree instances", () => {
|
|
19
|
+
const instances = new Map([
|
|
20
|
+
createInstancePair("1", "Body", [{ type: "id", value: "3" }]),
|
|
21
|
+
// this is outside of subtree
|
|
22
|
+
createInstancePair("2", "Box", []),
|
|
23
|
+
// these should be matched
|
|
24
|
+
createInstancePair("3", "Box", [
|
|
25
|
+
{ type: "id", value: "4" },
|
|
26
|
+
{ type: "id", value: "5" }
|
|
27
|
+
]),
|
|
28
|
+
createInstancePair("4", "Box", []),
|
|
29
|
+
createInstancePair("5", "Box", []),
|
|
30
|
+
// this one is from other tree
|
|
31
|
+
createInstancePair("6", "Box", [])
|
|
32
|
+
]);
|
|
33
|
+
expect(findTreeInstanceIds(instances, "3")).toEqual(/* @__PURE__ */ new Set(["3", "4", "5"]));
|
|
34
|
+
});
|
|
35
|
+
test("find all tree instances excluding slot descendants", () => {
|
|
36
|
+
const instances = new Map([
|
|
37
|
+
createInstancePair("root", "Body", [
|
|
38
|
+
{ type: "id", value: "box1" },
|
|
39
|
+
{ type: "id", value: "box2" }
|
|
40
|
+
]),
|
|
41
|
+
// this is outside of subtree
|
|
42
|
+
createInstancePair("outside", "Box", []),
|
|
43
|
+
// these should be matched
|
|
44
|
+
createInstancePair("box1", "Box", [
|
|
45
|
+
{ type: "id", value: "slot11" },
|
|
46
|
+
{ type: "id", value: "box12" }
|
|
47
|
+
]),
|
|
48
|
+
createInstancePair("slot11", "Slot", [
|
|
49
|
+
{ type: "id", value: "box111" },
|
|
50
|
+
{ type: "id", value: "box112" }
|
|
51
|
+
]),
|
|
52
|
+
createInstancePair("box12", "Box", []),
|
|
53
|
+
createInstancePair("box2", "Box", [])
|
|
54
|
+
]);
|
|
55
|
+
expect(
|
|
56
|
+
findTreeInstanceIdsExcludingSlotDescendants(instances, "box1")
|
|
57
|
+
).toEqual(/* @__PURE__ */ new Set(["box1", "box12", "slot11"]));
|
|
58
|
+
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
import { FontFormat, FontMeta } from "@webstudio-is/fonts";
|
|
3
4
|
const AssetId = z.string();
|
|
@@ -9,28 +10,21 @@ const baseAsset = {
|
|
|
9
10
|
description: z.union([z.string(), z.null()]),
|
|
10
11
|
createdAt: z.string()
|
|
11
12
|
};
|
|
12
|
-
const FontAsset = z.object({
|
|
13
|
+
export const FontAsset = z.object({
|
|
13
14
|
...baseAsset,
|
|
14
15
|
format: FontFormat,
|
|
15
16
|
meta: FontMeta,
|
|
16
17
|
type: z.literal("font")
|
|
17
18
|
});
|
|
18
|
-
const ImageMeta = z.object({
|
|
19
|
+
export const ImageMeta = z.object({
|
|
19
20
|
width: z.number(),
|
|
20
21
|
height: z.number()
|
|
21
22
|
});
|
|
22
|
-
const ImageAsset = z.object({
|
|
23
|
+
export const ImageAsset = z.object({
|
|
23
24
|
...baseAsset,
|
|
24
25
|
format: z.string(),
|
|
25
26
|
meta: ImageMeta,
|
|
26
27
|
type: z.literal("image")
|
|
27
28
|
});
|
|
28
|
-
const Asset = z.union([FontAsset, ImageAsset]);
|
|
29
|
-
const Assets = z.map(AssetId, Asset);
|
|
30
|
-
export {
|
|
31
|
-
Asset,
|
|
32
|
-
Assets,
|
|
33
|
-
FontAsset,
|
|
34
|
-
ImageAsset,
|
|
35
|
-
ImageMeta
|
|
36
|
-
};
|
|
29
|
+
export const Asset = z.union([FontAsset, ImageAsset]);
|
|
30
|
+
export const Assets = z.map(AssetId, Asset);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const BreakpointId = z.string();
|
|
4
|
+
export const Breakpoint = z.object({
|
|
5
|
+
id: BreakpointId,
|
|
6
|
+
label: z.string(),
|
|
7
|
+
minWidth: z.number().optional(),
|
|
8
|
+
maxWidth: z.number().optional()
|
|
9
|
+
}).refine(({ minWidth, maxWidth }) => {
|
|
10
|
+
return (
|
|
11
|
+
// Either min or max width have to be defined
|
|
12
|
+
minWidth !== void 0 && maxWidth === void 0 || minWidth === void 0 && maxWidth !== void 0 || // This is a base breakpoint
|
|
13
|
+
minWidth === void 0 && maxWidth === void 0
|
|
14
|
+
);
|
|
15
|
+
}, "Either minWidth or maxWidth should be defined");
|
|
16
|
+
export const Breakpoints = z.map(BreakpointId, Breakpoint);
|
|
17
|
+
export const initialBreakpoints = [
|
|
18
|
+
{ id: "placeholder", label: "Base" },
|
|
19
|
+
{ id: "placeholder", label: "Tablet", maxWidth: 991 },
|
|
20
|
+
{ id: "placeholder", label: "Mobile landscape", maxWidth: 767 },
|
|
21
|
+
{ id: "placeholder", label: "Mobile portrait", maxWidth: 479 }
|
|
22
|
+
];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const DataSourceId = z.string();
|
|
4
|
+
export const DataSourceVariableValue = z.union([
|
|
5
|
+
z.object({
|
|
6
|
+
type: z.literal("number"),
|
|
7
|
+
// initial value of variable store
|
|
8
|
+
value: z.number()
|
|
9
|
+
}),
|
|
10
|
+
z.object({
|
|
11
|
+
type: z.literal("string"),
|
|
12
|
+
value: z.string()
|
|
13
|
+
}),
|
|
14
|
+
z.object({
|
|
15
|
+
type: z.literal("boolean"),
|
|
16
|
+
value: z.boolean()
|
|
17
|
+
}),
|
|
18
|
+
z.object({
|
|
19
|
+
type: z.literal("string[]"),
|
|
20
|
+
value: z.array(z.string())
|
|
21
|
+
})
|
|
22
|
+
]);
|
|
23
|
+
export const DataSource = z.union([
|
|
24
|
+
z.object({
|
|
25
|
+
type: z.literal("variable"),
|
|
26
|
+
id: DataSourceId,
|
|
27
|
+
scopeInstanceId: z.optional(z.string()),
|
|
28
|
+
name: z.string(),
|
|
29
|
+
value: DataSourceVariableValue
|
|
30
|
+
}),
|
|
31
|
+
z.object({
|
|
32
|
+
type: z.literal("expression"),
|
|
33
|
+
id: DataSourceId,
|
|
34
|
+
scopeInstanceId: z.optional(z.string()),
|
|
35
|
+
name: z.string(),
|
|
36
|
+
code: z.string()
|
|
37
|
+
})
|
|
38
|
+
]);
|
|
39
|
+
export const DataSources = z.map(DataSourceId, DataSource);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const Text = z.object({
|
|
4
|
+
type: z.literal("text"),
|
|
5
|
+
value: z.string()
|
|
6
|
+
});
|
|
7
|
+
const InstanceId = z.string();
|
|
8
|
+
export const Id = z.object({
|
|
9
|
+
type: z.literal("id"),
|
|
10
|
+
value: InstanceId
|
|
11
|
+
});
|
|
12
|
+
export const Instance = z.object({
|
|
13
|
+
type: z.literal("instance"),
|
|
14
|
+
id: InstanceId,
|
|
15
|
+
component: z.string(),
|
|
16
|
+
label: z.string().optional(),
|
|
17
|
+
children: z.array(z.union([Id, Text]))
|
|
18
|
+
});
|
|
19
|
+
export const Instances = z.map(InstanceId, Instance);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const MIN_TITLE_LENGTH = 2;
|
|
4
|
+
export const PageName = z.string().refine((value) => value.trim() !== "", "Can't be empty");
|
|
5
|
+
export const PageTitle = z.string().refine(
|
|
6
|
+
(val) => val.length >= MIN_TITLE_LENGTH,
|
|
7
|
+
`Minimum ${MIN_TITLE_LENGTH} characters required`
|
|
8
|
+
);
|
|
9
|
+
const commonPageFields = {
|
|
10
|
+
id: z.string(),
|
|
11
|
+
name: PageName,
|
|
12
|
+
title: PageTitle,
|
|
13
|
+
meta: z.record(z.string(), z.string()),
|
|
14
|
+
rootInstanceId: z.string()
|
|
15
|
+
};
|
|
16
|
+
export const HomePagePath = z.string().refine((path) => path === "", "Home page path must be empty");
|
|
17
|
+
const HomePage = z.object({
|
|
18
|
+
...commonPageFields,
|
|
19
|
+
path: HomePagePath
|
|
20
|
+
});
|
|
21
|
+
export const pathValidators = (baseValidator) => baseValidator.refine((path) => path !== "", "Can't be empty").refine((path) => path !== "/", "Can't be just a /").refine(
|
|
22
|
+
(path) => path === "" || path.startsWith("/"),
|
|
23
|
+
"Must start with a /"
|
|
24
|
+
).refine((path) => path.endsWith("/") === false, "Can't end with a /").refine(
|
|
25
|
+
(path) => path.includes("//") === false,
|
|
26
|
+
"Can't contain repeating /"
|
|
27
|
+
).refine(
|
|
28
|
+
(path) => /^[-_a-z0-9\\/]*$/.test(path),
|
|
29
|
+
"Only a-z, 0-9, -, _ and / are allowed"
|
|
30
|
+
).refine(
|
|
31
|
+
// We use /s for our system stuff like /s/css or /s/uploads
|
|
32
|
+
(path) => path !== "/s" && path.startsWith("/s/") === false,
|
|
33
|
+
"/s prefix is reserved for the system"
|
|
34
|
+
).refine(
|
|
35
|
+
// Remix serves build artefacts like JS bundles from /build
|
|
36
|
+
// And we cannot customize it due to bug in Remix: https://github.com/remix-run/remix/issues/2933
|
|
37
|
+
(path) => path !== "/build" && path.startsWith("/build/") === false,
|
|
38
|
+
"/build prefix is reserved for the system"
|
|
39
|
+
);
|
|
40
|
+
export const PagePath = pathValidators(z.string());
|
|
41
|
+
const Page = z.object({
|
|
42
|
+
...commonPageFields,
|
|
43
|
+
path: PagePath
|
|
44
|
+
});
|
|
45
|
+
export const Pages = z.object({
|
|
46
|
+
homePage: HomePage,
|
|
47
|
+
pages: z.array(Page).refine(
|
|
48
|
+
(array) => new Set(array.map((page) => page.path)).size === array.length,
|
|
49
|
+
"All paths must be unique"
|
|
50
|
+
)
|
|
51
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const PropId = z.string();
|
|
4
|
+
const baseProp = {
|
|
5
|
+
id: PropId,
|
|
6
|
+
instanceId: z.string(),
|
|
7
|
+
name: z.string(),
|
|
8
|
+
required: z.optional(z.boolean())
|
|
9
|
+
};
|
|
10
|
+
export const Prop = z.union([
|
|
11
|
+
z.object({
|
|
12
|
+
...baseProp,
|
|
13
|
+
type: z.literal("number"),
|
|
14
|
+
value: z.number()
|
|
15
|
+
}),
|
|
16
|
+
z.object({
|
|
17
|
+
...baseProp,
|
|
18
|
+
type: z.literal("string"),
|
|
19
|
+
value: z.string()
|
|
20
|
+
}),
|
|
21
|
+
z.object({
|
|
22
|
+
...baseProp,
|
|
23
|
+
type: z.literal("boolean"),
|
|
24
|
+
value: z.boolean()
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
...baseProp,
|
|
28
|
+
type: z.literal("asset"),
|
|
29
|
+
value: z.string()
|
|
30
|
+
// asset id
|
|
31
|
+
}),
|
|
32
|
+
z.object({
|
|
33
|
+
...baseProp,
|
|
34
|
+
type: z.literal("page"),
|
|
35
|
+
value: z.union([
|
|
36
|
+
z.string(),
|
|
37
|
+
// page id
|
|
38
|
+
z.object({
|
|
39
|
+
pageId: z.string(),
|
|
40
|
+
instanceId: z.string()
|
|
41
|
+
})
|
|
42
|
+
])
|
|
43
|
+
}),
|
|
44
|
+
z.object({
|
|
45
|
+
...baseProp,
|
|
46
|
+
type: z.literal("string[]"),
|
|
47
|
+
value: z.array(z.string())
|
|
48
|
+
}),
|
|
49
|
+
z.object({
|
|
50
|
+
...baseProp,
|
|
51
|
+
type: z.literal("dataSource"),
|
|
52
|
+
// data source id
|
|
53
|
+
value: z.string()
|
|
54
|
+
}),
|
|
55
|
+
z.object({
|
|
56
|
+
...baseProp,
|
|
57
|
+
type: z.literal("action"),
|
|
58
|
+
value: z.array(
|
|
59
|
+
z.object({
|
|
60
|
+
type: z.literal("execute"),
|
|
61
|
+
args: z.array(z.string()),
|
|
62
|
+
code: z.string()
|
|
63
|
+
})
|
|
64
|
+
)
|
|
65
|
+
})
|
|
66
|
+
]);
|
|
67
|
+
export const Props = z.map(PropId, Prop);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const InstanceId = z.string();
|
|
4
|
+
const StyleSourceId = z.string();
|
|
5
|
+
export const StyleSourceSelection = z.object({
|
|
6
|
+
instanceId: InstanceId,
|
|
7
|
+
values: z.array(StyleSourceId)
|
|
8
|
+
});
|
|
9
|
+
export const StyleSourceSelections = z.map(InstanceId, StyleSourceSelection);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const StyleSourceId = z.string();
|
|
4
|
+
const StyleSourceToken = z.object({
|
|
5
|
+
type: z.literal("token"),
|
|
6
|
+
id: StyleSourceId,
|
|
7
|
+
name: z.string()
|
|
8
|
+
});
|
|
9
|
+
const StyleSourceLocal = z.object({
|
|
10
|
+
type: z.literal("local"),
|
|
11
|
+
id: StyleSourceId
|
|
12
|
+
});
|
|
13
|
+
export const StyleSource = z.union([StyleSourceToken, StyleSourceLocal]);
|
|
14
|
+
export const StyleSources = z.map(StyleSourceId, StyleSource);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { StyleValue } from "@webstudio-is/css-engine";
|
|
4
|
+
const StyleDeclRaw = z.object({
|
|
5
|
+
styleSourceId: z.string(),
|
|
6
|
+
breakpointId: z.string(),
|
|
7
|
+
state: z.optional(z.string()),
|
|
8
|
+
// @todo can't figure out how to make property to be enum
|
|
9
|
+
property: z.string(),
|
|
10
|
+
value: StyleValue
|
|
11
|
+
});
|
|
12
|
+
export const StyleDecl = StyleDeclRaw;
|
|
13
|
+
export const getStyleDeclKey = (styleDecl) => {
|
|
14
|
+
return `${styleDecl.styleSourceId}:${styleDecl.breakpointId}:${styleDecl.property}:${styleDecl.state ?? ""}`;
|
|
15
|
+
};
|
|
16
|
+
export const Styles = z.map(z.string(), StyleDecl);
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
export * from "./assets";
|
|
1
|
+
export * from "./schema/assets";
|
|
2
|
+
export * from "./schema/pages";
|
|
3
|
+
export * from "./schema/instances";
|
|
4
|
+
export * from "./schema/data-sources";
|
|
5
|
+
export * from "./schema/props";
|
|
6
|
+
export * from "./schema/breakpoints";
|
|
7
|
+
export * from "./schema/style-sources";
|
|
8
|
+
export * from "./schema/style-source-selections";
|
|
9
|
+
export * from "./schema/styles";
|
|
10
|
+
export * from "./schema/deployment";
|
|
11
|
+
export * from "./instances-utils";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Instance } from "./schema/instances";
|
|
2
|
+
export declare const findTreeInstanceIds: (instances: Map<string, {
|
|
3
|
+
type: "instance";
|
|
4
|
+
id: string;
|
|
5
|
+
component: string;
|
|
6
|
+
children: ({
|
|
7
|
+
value: string;
|
|
8
|
+
type: "text";
|
|
9
|
+
} | {
|
|
10
|
+
value: string;
|
|
11
|
+
type: "id";
|
|
12
|
+
})[];
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
}>, rootInstanceId: Instance["id"]) => Set<string>;
|
|
15
|
+
export declare const findTreeInstanceIdsExcludingSlotDescendants: (instances: Map<string, {
|
|
16
|
+
type: "instance";
|
|
17
|
+
id: string;
|
|
18
|
+
component: string;
|
|
19
|
+
children: ({
|
|
20
|
+
value: string;
|
|
21
|
+
type: "text";
|
|
22
|
+
} | {
|
|
23
|
+
value: string;
|
|
24
|
+
type: "id";
|
|
25
|
+
})[];
|
|
26
|
+
label?: string | undefined;
|
|
27
|
+
}>, rootInstanceId: Instance["id"]) => Set<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const Breakpoint: z.ZodEffects<z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
id: string;
|
|
9
|
+
label: string;
|
|
10
|
+
minWidth?: number | undefined;
|
|
11
|
+
maxWidth?: number | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
minWidth?: number | undefined;
|
|
16
|
+
maxWidth?: number | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
minWidth?: number | undefined;
|
|
21
|
+
maxWidth?: number | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
minWidth?: number | undefined;
|
|
26
|
+
maxWidth?: number | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export type Breakpoint = z.infer<typeof Breakpoint>;
|
|
29
|
+
export declare const Breakpoints: z.ZodMap<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
label: z.ZodString;
|
|
32
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
minWidth?: number | undefined;
|
|
38
|
+
maxWidth?: number | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
minWidth?: number | undefined;
|
|
43
|
+
maxWidth?: number | undefined;
|
|
44
|
+
}>, {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
minWidth?: number | undefined;
|
|
48
|
+
maxWidth?: number | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
id: string;
|
|
51
|
+
label: string;
|
|
52
|
+
minWidth?: number | undefined;
|
|
53
|
+
maxWidth?: number | undefined;
|
|
54
|
+
}>>;
|
|
55
|
+
export type Breakpoints = z.infer<typeof Breakpoints>;
|
|
56
|
+
export declare const initialBreakpoints: Array<Breakpoint>;
|