@webstudio-is/react-sdk 0.5.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/LICENSE +21 -0
- package/README.md +4 -0
- package/lib/arg-types/utils.d.ts +6 -0
- package/lib/arg-types/utils.d.ts.map +1 -0
- package/lib/arg-types/utils.js +80 -0
- package/lib/components/bold.d.ts +3 -0
- package/lib/components/bold.d.ts.map +1 -0
- package/lib/components/bold.js +8 -0
- package/lib/components/bold.props.json +2204 -0
- package/lib/components/bold.stories.d.ts +6 -0
- package/lib/components/bold.stories.d.ts.map +1 -0
- package/lib/components/bold.stories.js +19 -0
- package/lib/components/box.d.ts +3 -0
- package/lib/components/box.d.ts.map +1 -0
- package/lib/components/box.js +8 -0
- package/lib/components/box.props.json +2204 -0
- package/lib/components/box.stories.d.ts +6 -0
- package/lib/components/box.stories.d.ts.map +1 -0
- package/lib/components/box.stories.js +17 -0
- package/lib/components/button.d.ts +6 -0
- package/lib/components/button.d.ts.map +1 -0
- package/lib/components/button.js +11 -0
- package/lib/components/button.props.json +2461 -0
- package/lib/components/button.stories.d.ts +6 -0
- package/lib/components/button.stories.d.ts.map +1 -0
- package/lib/components/button.stories.js +19 -0
- package/lib/components/form.d.ts +3 -0
- package/lib/components/form.d.ts.map +1 -0
- package/lib/components/form.js +8 -0
- package/lib/components/form.props.json +2380 -0
- package/lib/components/form.stories.d.ts +6 -0
- package/lib/components/form.stories.d.ts.map +1 -0
- package/lib/components/form.stories.js +17 -0
- package/lib/components/heading.d.ts +8 -0
- package/lib/components/heading.d.ts.map +1 -0
- package/lib/components/heading.js +12 -0
- package/lib/components/heading.props.json +2246 -0
- package/lib/components/heading.stories.d.ts +10 -0
- package/lib/components/heading.stories.d.ts.map +1 -0
- package/lib/components/heading.stories.js +19 -0
- package/lib/components/index.d.ts +11 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +26 -0
- package/lib/components/input.d.ts +3 -0
- package/lib/components/input.d.ts.map +1 -0
- package/lib/components/input.js +8 -0
- package/lib/components/input.props.json +2955 -0
- package/lib/components/input.stories.d.ts +6 -0
- package/lib/components/input.stories.d.ts.map +1 -0
- package/lib/components/input.stories.js +17 -0
- package/lib/components/italic.d.ts +3 -0
- package/lib/components/italic.d.ts.map +1 -0
- package/lib/components/italic.js +8 -0
- package/lib/components/italic.props.json +2204 -0
- package/lib/components/italic.stories.d.ts +6 -0
- package/lib/components/italic.stories.d.ts.map +1 -0
- package/lib/components/italic.stories.js +19 -0
- package/lib/components/link.d.ts +8 -0
- package/lib/components/link.d.ts.map +1 -0
- package/lib/components/link.js +8 -0
- package/lib/components/link.props.json +2441 -0
- package/lib/components/link.stories.d.ts +6 -0
- package/lib/components/link.stories.d.ts.map +1 -0
- package/lib/components/link.stories.js +19 -0
- package/lib/components/meta.d.ts +11 -0
- package/lib/components/meta.d.ts.map +1 -0
- package/lib/components/meta.js +26 -0
- package/lib/components/paragraph.d.ts +3 -0
- package/lib/components/paragraph.d.ts.map +1 -0
- package/lib/components/paragraph.js +8 -0
- package/lib/components/paragraph.props.json +2204 -0
- package/lib/components/paragraph.stories.d.ts +6 -0
- package/lib/components/paragraph.stories.d.ts.map +1 -0
- package/lib/components/paragraph.stories.js +19 -0
- package/lib/components/text-block.d.ts +3 -0
- package/lib/components/text-block.d.ts.map +1 -0
- package/lib/components/text-block.js +8 -0
- package/lib/components/text-block.props.json +2204 -0
- package/lib/components/text-block.stories.d.ts +6 -0
- package/lib/components/text-block.stories.d.ts.map +1 -0
- package/lib/components/text-block.stories.js +19 -0
- package/lib/css/breakpoints.d.ts +4 -0
- package/lib/css/breakpoints.d.ts.map +1 -0
- package/lib/css/breakpoints.js +9 -0
- package/lib/css/categories.d.ts +408 -0
- package/lib/css/categories.d.ts.map +1 -0
- package/lib/css/categories.js +229 -0
- package/lib/css/get-browser-style.d.ts +3 -0
- package/lib/css/get-browser-style.d.ts.map +1 -0
- package/lib/css/get-browser-style.js +43 -0
- package/lib/css/index.d.ts +9 -0
- package/lib/css/index.d.ts.map +1 -0
- package/lib/css/index.js +24 -0
- package/lib/css/keyword-values.d.ts +302 -0
- package/lib/css/keyword-values.d.ts.map +1 -0
- package/lib/css/keyword-values.js +6619 -0
- package/lib/css/properties.d.ts +3197 -0
- package/lib/css/properties.d.ts.map +1 -0
- package/lib/css/properties.js +3200 -0
- package/lib/css/schema.d.ts +151 -0
- package/lib/css/schema.d.ts.map +1 -0
- package/lib/css/schema.js +38 -0
- package/lib/css/types.d.ts +15 -0
- package/lib/css/types.d.ts.map +1 -0
- package/lib/css/types.js +2 -0
- package/lib/css/units.d.ts +2 -0
- package/lib/css/units.d.ts.map +1 -0
- package/lib/css/units.js +35 -0
- package/lib/db/index.d.ts +3 -0
- package/lib/db/index.d.ts.map +1 -0
- package/lib/db/index.js +18 -0
- package/lib/db/instance.d.ts +11 -0
- package/lib/db/instance.d.ts.map +1 -0
- package/lib/db/instance.js +13 -0
- package/lib/db/types.d.ts +12 -0
- package/lib/db/types.d.ts.map +1 -0
- package/lib/db/types.js +2 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +37 -0
- package/lib/prisma.server.d.ts +3 -0
- package/lib/prisma.server.d.ts.map +1 -0
- package/lib/prisma.server.js +8 -0
- package/lib/pubsub/index.d.ts +3 -0
- package/lib/pubsub/index.d.ts.map +1 -0
- package/lib/pubsub/index.js +18 -0
- package/lib/pubsub/publish.d.ts +17 -0
- package/lib/pubsub/publish.d.ts.map +1 -0
- package/lib/pubsub/publish.js +27 -0
- package/lib/pubsub/subscribe.d.ts +8 -0
- package/lib/pubsub/subscribe.d.ts.map +1 -0
- package/lib/pubsub/subscribe.js +31 -0
- package/lib/stitches/critical-css.d.ts +4 -0
- package/lib/stitches/critical-css.d.ts.map +1 -0
- package/lib/stitches/critical-css.js +12 -0
- package/lib/stitches/css.d.ts +9 -0
- package/lib/stitches/css.d.ts.map +1 -0
- package/lib/stitches/css.js +32 -0
- package/lib/stitches/index.d.ts +4 -0
- package/lib/stitches/index.d.ts.map +1 -0
- package/lib/stitches/index.js +19 -0
- package/lib/stitches/to-css.d.ts +8 -0
- package/lib/stitches/to-css.d.ts.map +1 -0
- package/lib/stitches/to-css.js +44 -0
- package/lib/stitches/to-css.test.d.ts +2 -0
- package/lib/stitches/to-css.test.d.ts.map +1 -0
- package/lib/stitches/to-css.test.js +63 -0
- package/lib/tree/create-elements-tree.d.ts +23 -0
- package/lib/tree/create-elements-tree.d.ts.map +1 -0
- package/lib/tree/create-elements-tree.js +28 -0
- package/lib/tree/index.d.ts +4 -0
- package/lib/tree/index.d.ts.map +1 -0
- package/lib/tree/index.js +19 -0
- package/lib/tree/root.d.ts +16 -0
- package/lib/tree/root.d.ts.map +1 -0
- package/lib/tree/root.js +26 -0
- package/lib/tree/wrapper-component.d.ts +12 -0
- package/lib/tree/wrapper-component.d.ts.map +1 -0
- package/lib/tree/wrapper-component.js +53 -0
- package/lib/user-props/all-user-props.d.ts +8 -0
- package/lib/user-props/all-user-props.d.ts.map +1 -0
- package/lib/user-props/all-user-props.js +20 -0
- package/lib/user-props/index.d.ts +5 -0
- package/lib/user-props/index.d.ts.map +1 -0
- package/lib/user-props/index.js +20 -0
- package/lib/user-props/schema.d.ts +34 -0
- package/lib/user-props/schema.d.ts.map +1 -0
- package/lib/user-props/schema.js +11 -0
- package/lib/user-props/types.d.ts +15 -0
- package/lib/user-props/types.d.ts.map +1 -0
- package/lib/user-props/types.js +2 -0
- package/lib/user-props/use-user-props.d.ts +12 -0
- package/lib/user-props/use-user-props.d.ts.map +1 -0
- package/lib/user-props/use-user-props.js +33 -0
- package/package.json +78 -0
- package/prisma/schema.prisma +71 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const UnitSchema: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
|
|
3
|
+
export declare const StyleValueSchema: z.ZodUnion<[z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"unit">;
|
|
5
|
+
unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
|
|
6
|
+
value: z.ZodNumber;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
9
|
+
value: number;
|
|
10
|
+
type: "unit";
|
|
11
|
+
}, {
|
|
12
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
13
|
+
value: number;
|
|
14
|
+
type: "unit";
|
|
15
|
+
}>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"keyword">;
|
|
17
|
+
value: z.ZodString;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
value: string;
|
|
20
|
+
type: "keyword";
|
|
21
|
+
}, {
|
|
22
|
+
value: string;
|
|
23
|
+
type: "keyword";
|
|
24
|
+
}>, z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"invalid">;
|
|
26
|
+
value: z.ZodString;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
value: string;
|
|
29
|
+
type: "invalid";
|
|
30
|
+
}, {
|
|
31
|
+
value: string;
|
|
32
|
+
type: "invalid";
|
|
33
|
+
}>]>;
|
|
34
|
+
export declare const StyleSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"unit">;
|
|
36
|
+
unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
|
|
37
|
+
value: z.ZodNumber;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
40
|
+
value: number;
|
|
41
|
+
type: "unit";
|
|
42
|
+
}, {
|
|
43
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
44
|
+
value: number;
|
|
45
|
+
type: "unit";
|
|
46
|
+
}>, z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"keyword">;
|
|
48
|
+
value: z.ZodString;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
value: string;
|
|
51
|
+
type: "keyword";
|
|
52
|
+
}, {
|
|
53
|
+
value: string;
|
|
54
|
+
type: "keyword";
|
|
55
|
+
}>, z.ZodObject<{
|
|
56
|
+
type: z.ZodLiteral<"invalid">;
|
|
57
|
+
value: z.ZodString;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
value: string;
|
|
60
|
+
type: "invalid";
|
|
61
|
+
}, {
|
|
62
|
+
value: string;
|
|
63
|
+
type: "invalid";
|
|
64
|
+
}>]>>;
|
|
65
|
+
export declare const CssRuleSchema: z.ZodObject<{
|
|
66
|
+
style: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"unit">;
|
|
68
|
+
unit: z.ZodUnion<[z.ZodEnum<["ch", "cm", "deg", "dpcm", "dpi", "dppx", "em", "ex", "fr", "grad", "Hz", "in", "kHz", "mm", "ms", "pc", "pt", "px", "Q", "rad", "rem", "s", "turn", "vh", "vmax", "vmin", "vw", "x", "%"]>, z.ZodLiteral<"number">]>;
|
|
69
|
+
value: z.ZodNumber;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
72
|
+
value: number;
|
|
73
|
+
type: "unit";
|
|
74
|
+
}, {
|
|
75
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
76
|
+
value: number;
|
|
77
|
+
type: "unit";
|
|
78
|
+
}>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"keyword">;
|
|
80
|
+
value: z.ZodString;
|
|
81
|
+
}, "strip", z.ZodTypeAny, {
|
|
82
|
+
value: string;
|
|
83
|
+
type: "keyword";
|
|
84
|
+
}, {
|
|
85
|
+
value: string;
|
|
86
|
+
type: "keyword";
|
|
87
|
+
}>, z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"invalid">;
|
|
89
|
+
value: z.ZodString;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
value: string;
|
|
92
|
+
type: "invalid";
|
|
93
|
+
}, {
|
|
94
|
+
value: string;
|
|
95
|
+
type: "invalid";
|
|
96
|
+
}>]>>;
|
|
97
|
+
breakpoint: z.ZodString;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
style: Record<string, {
|
|
100
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
101
|
+
value: number;
|
|
102
|
+
type: "unit";
|
|
103
|
+
} | {
|
|
104
|
+
value: string;
|
|
105
|
+
type: "keyword";
|
|
106
|
+
} | {
|
|
107
|
+
value: string;
|
|
108
|
+
type: "invalid";
|
|
109
|
+
}>;
|
|
110
|
+
breakpoint: string;
|
|
111
|
+
}, {
|
|
112
|
+
style: Record<string, {
|
|
113
|
+
unit: "number" | "px" | "%" | "ch" | "cm" | "deg" | "dpcm" | "dpi" | "dppx" | "em" | "ex" | "fr" | "grad" | "Hz" | "in" | "kHz" | "mm" | "ms" | "pc" | "pt" | "Q" | "rad" | "rem" | "s" | "turn" | "vh" | "vmax" | "vmin" | "vw" | "x";
|
|
114
|
+
value: number;
|
|
115
|
+
type: "unit";
|
|
116
|
+
} | {
|
|
117
|
+
value: string;
|
|
118
|
+
type: "keyword";
|
|
119
|
+
} | {
|
|
120
|
+
value: string;
|
|
121
|
+
type: "invalid";
|
|
122
|
+
}>;
|
|
123
|
+
breakpoint: string;
|
|
124
|
+
}>;
|
|
125
|
+
export declare const BreakpointSchema: z.ZodObject<{
|
|
126
|
+
id: z.ZodString;
|
|
127
|
+
label: z.ZodString;
|
|
128
|
+
minWidth: z.ZodNumber;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
id: string;
|
|
131
|
+
label: string;
|
|
132
|
+
minWidth: number;
|
|
133
|
+
}, {
|
|
134
|
+
id: string;
|
|
135
|
+
label: string;
|
|
136
|
+
minWidth: number;
|
|
137
|
+
}>;
|
|
138
|
+
export declare const BreakpointsSchema: z.ZodArray<z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
label: z.ZodString;
|
|
141
|
+
minWidth: z.ZodNumber;
|
|
142
|
+
}, "strip", z.ZodTypeAny, {
|
|
143
|
+
id: string;
|
|
144
|
+
label: string;
|
|
145
|
+
minWidth: number;
|
|
146
|
+
}, {
|
|
147
|
+
id: string;
|
|
148
|
+
label: string;
|
|
149
|
+
minWidth: number;
|
|
150
|
+
}>, "many">;
|
|
151
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/css/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU,8OAAgD,CAAC;AAqBxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAI3B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAAyC,CAAC;AAElE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;WAA4B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BreakpointsSchema = exports.BreakpointSchema = exports.CssRuleSchema = exports.StyleSchema = exports.StyleValueSchema = exports.UnitSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const units_1 = require("./units");
|
|
6
|
+
exports.UnitSchema = zod_1.z.union([zod_1.z.enum(units_1.units), zod_1.z.literal("number")]);
|
|
7
|
+
const UnitValueSchema = zod_1.z.object({
|
|
8
|
+
type: zod_1.z.literal("unit"),
|
|
9
|
+
unit: exports.UnitSchema,
|
|
10
|
+
value: zod_1.z.number(),
|
|
11
|
+
});
|
|
12
|
+
const KeywordValueSchema = zod_1.z.object({
|
|
13
|
+
type: zod_1.z.literal("keyword"),
|
|
14
|
+
// @todo use exact type
|
|
15
|
+
value: zod_1.z.string(),
|
|
16
|
+
});
|
|
17
|
+
// We want to be able to render the invalid value
|
|
18
|
+
// and show it is invalid visually, without saving it to the db
|
|
19
|
+
const InvalidValueSchema = zod_1.z.object({
|
|
20
|
+
type: zod_1.z.literal("invalid"),
|
|
21
|
+
value: zod_1.z.string(),
|
|
22
|
+
});
|
|
23
|
+
exports.StyleValueSchema = zod_1.z.union([
|
|
24
|
+
UnitValueSchema,
|
|
25
|
+
KeywordValueSchema,
|
|
26
|
+
InvalidValueSchema,
|
|
27
|
+
]);
|
|
28
|
+
exports.StyleSchema = zod_1.z.record(zod_1.z.string(), exports.StyleValueSchema);
|
|
29
|
+
exports.CssRuleSchema = zod_1.z.object({
|
|
30
|
+
style: exports.StyleSchema,
|
|
31
|
+
breakpoint: zod_1.z.string(),
|
|
32
|
+
});
|
|
33
|
+
exports.BreakpointSchema = zod_1.z.object({
|
|
34
|
+
id: zod_1.z.string(),
|
|
35
|
+
label: zod_1.z.string(),
|
|
36
|
+
minWidth: zod_1.z.number(),
|
|
37
|
+
});
|
|
38
|
+
exports.BreakpointsSchema = zod_1.z.array(exports.BreakpointSchema);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { properties } from "./properties";
|
|
3
|
+
import { BreakpointSchema, CssRuleSchema, StyleValueSchema, UnitSchema } from "./schema";
|
|
4
|
+
declare type Properties = typeof properties;
|
|
5
|
+
export declare type StyleProperty = keyof Properties;
|
|
6
|
+
export declare type AppliesTo = Properties[StyleProperty]["appliesTo"];
|
|
7
|
+
export declare type Style = {
|
|
8
|
+
[property in StyleProperty]?: StyleValue;
|
|
9
|
+
};
|
|
10
|
+
export declare type CssRule = z.infer<typeof CssRuleSchema>;
|
|
11
|
+
export declare type Unit = z.infer<typeof UnitSchema>;
|
|
12
|
+
export declare type StyleValue = z.infer<typeof StyleValueSchema>;
|
|
13
|
+
export declare type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/css/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACX,MAAM,UAAU,CAAC;AAElB,aAAK,UAAU,GAAG,OAAO,UAAU,CAAC;AAEpC,oBAAY,aAAa,GAAG,MAAM,UAAU,CAAC;AAE7C,oBAAY,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,CAAC;AAE/D,oBAAY,KAAK,GAAG;KACjB,QAAQ,IAAI,aAAa,CAAC,CAAC,EAAE,UAAU;CACzC,CAAC;AAEF,oBAAY,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD,oBAAY,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAE9C,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,oBAAY,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/lib/css/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src/css/units.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,KAAK,sMA8BR,CAAC"}
|
package/lib/css/units.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.units = void 0;
|
|
4
|
+
// This file was generated by yarn mdn-data
|
|
5
|
+
exports.units = [
|
|
6
|
+
"ch",
|
|
7
|
+
"cm",
|
|
8
|
+
"deg",
|
|
9
|
+
"dpcm",
|
|
10
|
+
"dpi",
|
|
11
|
+
"dppx",
|
|
12
|
+
"em",
|
|
13
|
+
"ex",
|
|
14
|
+
"fr",
|
|
15
|
+
"grad",
|
|
16
|
+
"Hz",
|
|
17
|
+
"in",
|
|
18
|
+
"kHz",
|
|
19
|
+
"mm",
|
|
20
|
+
"ms",
|
|
21
|
+
"pc",
|
|
22
|
+
"pt",
|
|
23
|
+
"px",
|
|
24
|
+
"Q",
|
|
25
|
+
"rad",
|
|
26
|
+
"rem",
|
|
27
|
+
"s",
|
|
28
|
+
"turn",
|
|
29
|
+
"vh",
|
|
30
|
+
"vmax",
|
|
31
|
+
"vmin",
|
|
32
|
+
"vw",
|
|
33
|
+
"x",
|
|
34
|
+
"%",
|
|
35
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|
package/lib/db/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./instance"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as components from "../components";
|
|
3
|
+
import { type CssRule } from "../css";
|
|
4
|
+
export declare type Instance = {
|
|
5
|
+
id: string;
|
|
6
|
+
component: keyof typeof components;
|
|
7
|
+
children: Array<Instance | string>;
|
|
8
|
+
cssRules: Array<CssRule>;
|
|
9
|
+
};
|
|
10
|
+
export declare const InstanceSchema: z.ZodType<Instance, z.ZodTypeDef, Instance>;
|
|
11
|
+
//# sourceMappingURL=instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/db/instance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAErD,oBAAY,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,OAAO,UAAU,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,cAAc,6CASH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstanceSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const css_1 = require("../css");
|
|
6
|
+
exports.InstanceSchema = zod_1.z.lazy(() => zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
component: zod_1.z.string(),
|
|
9
|
+
children: zod_1.z.array(zod_1.z.union([exports.InstanceSchema, zod_1.z.string()])),
|
|
10
|
+
cssRules: zod_1.z.array(css_1.CssRuleSchema),
|
|
11
|
+
})
|
|
12
|
+
// @todo can't figure out how to make component to be z.enum(Object.keys(components))
|
|
13
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { InstanceProps as DbInstanceProps, Project, User, Breakpoints, Asset } from "@prisma/client";
|
|
2
|
+
import type { UserProp } from "../user-props";
|
|
3
|
+
import type { Instance } from "./instance";
|
|
4
|
+
export declare type Tree = {
|
|
5
|
+
id: string;
|
|
6
|
+
root: Instance;
|
|
7
|
+
};
|
|
8
|
+
export declare type InstanceProps = Omit<DbInstanceProps, "props"> & {
|
|
9
|
+
props: Array<UserProp>;
|
|
10
|
+
};
|
|
11
|
+
export type { DbInstanceProps, Project, User, Breakpoints, Asset };
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/db/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,IAAI,eAAe,EAChC,OAAO,EACP,IAAI,EACJ,WAAW,EACX,KAAK,EACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB,CAAC;AAEF,oBAAY,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,GAAG;IAC3D,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;CACxB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC"}
|
package/lib/db/types.js
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./css";
|
|
2
|
+
export * from "./tree";
|
|
3
|
+
export * from "./stitches";
|
|
4
|
+
export * as components from "./components";
|
|
5
|
+
export * as componentsMeta from "./components/meta";
|
|
6
|
+
export * from "./user-props";
|
|
7
|
+
export * from "./pubsub";
|
|
8
|
+
export * from "./db";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAC;AACpD,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.componentsMeta = exports.components = void 0;
|
|
30
|
+
__exportStar(require("./css"), exports);
|
|
31
|
+
__exportStar(require("./tree"), exports);
|
|
32
|
+
__exportStar(require("./stitches"), exports);
|
|
33
|
+
exports.components = __importStar(require("./components"));
|
|
34
|
+
exports.componentsMeta = __importStar(require("./components/meta"));
|
|
35
|
+
__exportStar(require("./user-props"), exports);
|
|
36
|
+
__exportStar(require("./pubsub"), exports);
|
|
37
|
+
__exportStar(require("./db"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma.server.d.ts","sourceRoot":"","sources":["../src/prisma.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrismaClientKnownRequestError = exports.Prisma = exports.PrismaClient = void 0;
|
|
4
|
+
var client_1 = require("@prisma/client");
|
|
5
|
+
Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return client_1.PrismaClient; } });
|
|
6
|
+
Object.defineProperty(exports, "Prisma", { enumerable: true, get: function () { return client_1.Prisma; } });
|
|
7
|
+
var runtime_1 = require("@prisma/client/runtime");
|
|
8
|
+
Object.defineProperty(exports, "PrismaClientKnownRequestError", { enumerable: true, get: function () { return runtime_1.PrismaClientKnownRequestError; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pubsub/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./publish"), exports);
|
|
18
|
+
__exportStar(require("./subscribe"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MutableRefObject } from "react";
|
|
2
|
+
declare type Action<Type, Payload> = {
|
|
3
|
+
type: Type;
|
|
4
|
+
payload?: Payload;
|
|
5
|
+
};
|
|
6
|
+
export declare type Publish = <Type, Payload = undefined>(action: Action<Type, Payload>) => void;
|
|
7
|
+
declare type UsePublish = [Publish, MutableRefObject<HTMLIFrameElement | null>];
|
|
8
|
+
/**
|
|
9
|
+
* To publish a postMessage event on the iframe and parent window from the parent window.
|
|
10
|
+
*/
|
|
11
|
+
export declare const usePublish: () => UsePublish;
|
|
12
|
+
/**
|
|
13
|
+
* To publish a postMessage event on the current window and parent window from the iframe.
|
|
14
|
+
*/
|
|
15
|
+
export declare const publish: <Type extends string, Payload = undefined>(action: Action<Type, Payload>) => void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/pubsub/publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9D,aAAK,MAAM,CAAC,IAAI,EAAE,OAAO,IAAI;IAC3B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,oBAAY,OAAO,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAC9C,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,KAC1B,IAAI,CAAC;AAEV,aAAK,UAAU,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,UAAU,kBAYtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,mFAKnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publish = exports.usePublish = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* To publish a postMessage event on the iframe and parent window from the parent window.
|
|
7
|
+
*/
|
|
8
|
+
const usePublish = () => {
|
|
9
|
+
const iframeRef = (0, react_1.useRef)(null);
|
|
10
|
+
const publishCallback = (0, react_1.useCallback)((action) => {
|
|
11
|
+
const element = iframeRef.current;
|
|
12
|
+
if ((element === null || element === void 0 ? void 0 : element.contentWindow) == null)
|
|
13
|
+
return;
|
|
14
|
+
element.contentWindow.postMessage(action, "*");
|
|
15
|
+
window.postMessage(action, "*");
|
|
16
|
+
}, [iframeRef]);
|
|
17
|
+
return [publishCallback, iframeRef];
|
|
18
|
+
};
|
|
19
|
+
exports.usePublish = usePublish;
|
|
20
|
+
/**
|
|
21
|
+
* To publish a postMessage event on the current window and parent window from the iframe.
|
|
22
|
+
*/
|
|
23
|
+
const publish = (action) => {
|
|
24
|
+
window.parent.postMessage(action, "*");
|
|
25
|
+
window.postMessage(action, "*");
|
|
26
|
+
};
|
|
27
|
+
exports.publish = publish;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare type Events = Record<string, any>;
|
|
2
|
+
export declare const emitter: import("mitt").Emitter<Events>;
|
|
3
|
+
/**
|
|
4
|
+
* To subscribe a message event on the current window.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useSubscribe: <Type extends string, Payload = undefined>(type: Type, onAction: (payload: Payload) => void) => void;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=subscribe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/pubsub/subscribe.ts"],"names":[],"mappings":"AAOA,aAAK,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,gCAAiB,CAAC;AAgBtC;;GAEG;AACH,eAAO,MAAM,YAAY,yFAES,IAAI,SAQrC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSubscribe = exports.emitter = void 0;
|
|
7
|
+
const mitt_1 = __importDefault(require("mitt"));
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
exports.emitter = (0, mitt_1.default)();
|
|
10
|
+
if (typeof window === "object") {
|
|
11
|
+
window.addEventListener("message", (event) => {
|
|
12
|
+
var _a;
|
|
13
|
+
// @todo this has no type safety built in, could be anything from any source.
|
|
14
|
+
// we could potentially maintain a list of valid event types, but see prior contra points.
|
|
15
|
+
if (typeof ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) === "string") {
|
|
16
|
+
exports.emitter.emit(event.data.type, event.data.payload);
|
|
17
|
+
}
|
|
18
|
+
}, false);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* To subscribe a message event on the current window.
|
|
22
|
+
*/
|
|
23
|
+
const useSubscribe = (type, onAction) => {
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
exports.emitter.on(type, onAction);
|
|
26
|
+
return () => {
|
|
27
|
+
exports.emitter.off(type, onAction);
|
|
28
|
+
};
|
|
29
|
+
}, [type, onAction]);
|
|
30
|
+
};
|
|
31
|
+
exports.useSubscribe = useSubscribe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critical-css.d.ts","sourceRoot":"","sources":["../../src/stitches/critical-css.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIxD,eAAO,MAAM,WAAW,QAAO,WAAW,GAAG,IACsB,CAAC;AAEpE,eAAO,MAAM,iBAAiB,WACpB,MAAM,eACF,wBAAwB,KACnC,MAEF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.insertCriticalCss = exports.CriticalCss = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const css_1 = require("./css");
|
|
6
|
+
const criticalCssMarker = "__critical-css__";
|
|
7
|
+
const CriticalCss = () => typeof document === "undefined" ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: criticalCssMarker }) : null;
|
|
8
|
+
exports.CriticalCss = CriticalCss;
|
|
9
|
+
const insertCriticalCss = (markup, getCssText = css_1.getCssText) => {
|
|
10
|
+
return markup.replace(criticalCssMarker, `<style>${getCssText()}</style>`);
|
|
11
|
+
};
|
|
12
|
+
exports.insertCriticalCss = insertCriticalCss;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { globalCss, type CSS, css as createCss } from "@stitches/core";
|
|
2
|
+
import type { Breakpoint } from "../css";
|
|
3
|
+
export declare const getCachedConfig: () => any;
|
|
4
|
+
export declare const css: typeof createCss;
|
|
5
|
+
export { globalCss };
|
|
6
|
+
export { type CSS };
|
|
7
|
+
export declare const getCssText: () => string;
|
|
8
|
+
export declare const setBreakpoints: (breakpoints: Array<Breakpoint>) => void;
|
|
9
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/stitches/css.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,KAAK,GAAG,EACR,GAAG,IAAI,SAAS,EACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAOzC,eAAO,MAAM,eAAe,WAK3B,CAAC;AAEF,eAAO,MAAM,GAAG,EAAE,OAAO,SAExB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,OAAO,EAAE,KAAK,GAAG,EAAE,CAAC;AAEpB,eAAO,MAAM,UAAU,QAAO,MAE7B,CAAC;AAEF,eAAO,MAAM,cAAc,gBAAiB,MAAM,UAAU,CAAC,SAO5D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBreakpoints = exports.getCssText = exports.globalCss = exports.css = exports.getCachedConfig = void 0;
|
|
4
|
+
const core_1 = require("@stitches/core");
|
|
5
|
+
Object.defineProperty(exports, "globalCss", { enumerable: true, get: function () { return core_1.globalCss; } });
|
|
6
|
+
let media = {};
|
|
7
|
+
// @todo needs fixing
|
|
8
|
+
let stitches;
|
|
9
|
+
const getCachedConfig = () => {
|
|
10
|
+
if (stitches === undefined) {
|
|
11
|
+
stitches = (0, core_1.createStitches)({ media });
|
|
12
|
+
}
|
|
13
|
+
return stitches;
|
|
14
|
+
};
|
|
15
|
+
exports.getCachedConfig = getCachedConfig;
|
|
16
|
+
const css = (...args) => {
|
|
17
|
+
return (0, exports.getCachedConfig)().css(...args);
|
|
18
|
+
};
|
|
19
|
+
exports.css = css;
|
|
20
|
+
const getCssText = () => {
|
|
21
|
+
return (0, exports.getCachedConfig)().getCssText();
|
|
22
|
+
};
|
|
23
|
+
exports.getCssText = getCssText;
|
|
24
|
+
const setBreakpoints = (breakpoints) => {
|
|
25
|
+
const nextMedia = {};
|
|
26
|
+
for (const breakpoint of breakpoints) {
|
|
27
|
+
nextMedia[breakpoint.id] = `(min-width: ${breakpoint.minWidth}px)`;
|
|
28
|
+
}
|
|
29
|
+
media = nextMedia;
|
|
30
|
+
stitches = undefined;
|
|
31
|
+
};
|
|
32
|
+
exports.setBreakpoints = setBreakpoints;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stitches/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC"}
|