@plitzi/sdk-variables 0.37.10 → 0.38.2
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @plitzi/sdk-variables
|
|
2
2
|
|
|
3
|
+
## 0.38.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.38.2
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/sdk-shared@0.38.2
|
|
10
|
+
|
|
11
|
+
## 0.38.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 266e691: ## A shutdown that does not wait on idle connections
|
|
16
|
+
|
|
17
|
+
A server shutting down while it answered a request waited, once the answer was sent, for the client to let go of the
|
|
18
|
+
keep-alive connection it came on — three seconds for Node's own `fetch`, longer for others — before it could stop. The
|
|
19
|
+
connection is now closed as soon as its answer is finished.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [266e691]
|
|
22
|
+
- @plitzi/sdk-shared@0.38.1
|
|
23
|
+
|
|
24
|
+
## 0.38.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- v0.38.0
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies
|
|
33
|
+
- @plitzi/sdk-shared@0.38.0
|
|
34
|
+
|
|
3
35
|
## 0.37.10
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -3,11 +3,11 @@ import n from "@plitzi/plitzi-ui/Button";
|
|
|
3
3
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
import a, { useForm as o, useFormWatch as s } from "@plitzi/plitzi-ui/Form";
|
|
5
5
|
import { z as c } from "zod";
|
|
6
|
-
import { StyleVariableCategory as l } from "@plitzi/sdk-shared";
|
|
6
|
+
import { StyleVariableCategory as l, isStyleVariableCategory as u } from "@plitzi/sdk-shared";
|
|
7
7
|
//#region src/models/StyleVariableForm/StyleVariableForm.tsx
|
|
8
|
-
var
|
|
8
|
+
var d = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([a-zA-Z_][a-zA-Z0-9_-]+)$/i, "Invalid Name"), f = c.discriminatedUnion("category", [
|
|
9
9
|
c.object({
|
|
10
|
-
name:
|
|
10
|
+
name: d,
|
|
11
11
|
category: c.literal(l.COLOR),
|
|
12
12
|
value: c.object({
|
|
13
13
|
light: c.string().min(1),
|
|
@@ -16,21 +16,21 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
16
16
|
})
|
|
17
17
|
}),
|
|
18
18
|
c.object({
|
|
19
|
-
name:
|
|
19
|
+
name: d,
|
|
20
20
|
category: c.literal(l.SHADOW),
|
|
21
21
|
value: c.string().min(1)
|
|
22
22
|
}),
|
|
23
23
|
c.object({
|
|
24
|
-
name:
|
|
24
|
+
name: d,
|
|
25
25
|
category: c.literal(l.SPACING),
|
|
26
26
|
value: c.string().trim().refine((e) => !!(e === "0" || e === "auto" || /^-?\d*\.?\d+(px|rem|em|%|vh|vw|vmin|vmax|dvh|svh|lvh|ch|ex|cm|mm|in|pt|pc)$/i.test(e) || /^(calc|min|max|clamp)\(.+\)$/i.test(e)), "Invalid CSS value")
|
|
27
27
|
}),
|
|
28
28
|
c.object({
|
|
29
|
-
name:
|
|
29
|
+
name: d,
|
|
30
30
|
category: c.literal(l.CUSTOM),
|
|
31
31
|
value: c.string().min(1)
|
|
32
32
|
})
|
|
33
|
-
]),
|
|
33
|
+
]), p = (e, t, n) => {
|
|
34
34
|
switch (e) {
|
|
35
35
|
case l.COLOR: {
|
|
36
36
|
let { default: r = "", light: i = "", dark: a = "" } = n;
|
|
@@ -53,20 +53,20 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
53
53
|
value: typeof n == "string" ? n : ""
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
},
|
|
57
|
-
let [
|
|
58
|
-
defaultValues:
|
|
59
|
-
config: { schema:
|
|
60
|
-
}),
|
|
61
|
-
|
|
56
|
+
}, m = ({ name: c = "New Page", category: d = l.COLOR, value: m, isNewRecord: h = !1, onClose: g, onSubmit: _ }) => {
|
|
57
|
+
let [v, y] = t(p(d, c, m)), b = o({
|
|
58
|
+
defaultValues: v,
|
|
59
|
+
config: { schema: f }
|
|
60
|
+
}), x = s(b.formMethods, "category"), S = e((e) => {
|
|
61
|
+
u(e) && (b.formMethods.setValue("value", e === l.COLOR ? {
|
|
62
62
|
default: "",
|
|
63
63
|
light: "",
|
|
64
64
|
dark: ""
|
|
65
|
-
} : ""),
|
|
66
|
-
}, [
|
|
65
|
+
} : ""), y(p(e, c, e)));
|
|
66
|
+
}, [b.formMethods, c]), C = e((e) => _?.(e), [_]);
|
|
67
67
|
return /* @__PURE__ */ i(a, {
|
|
68
|
-
form:
|
|
69
|
-
onSubmit:
|
|
68
|
+
form: b,
|
|
69
|
+
onSubmit: C,
|
|
70
70
|
className: "w-full gap-4 rounded border border-gray-300 bg-white p-2 text-zinc-700 dark:border-zinc-700 dark:bg-zinc-800/50 dark:text-zinc-300",
|
|
71
71
|
children: [/* @__PURE__ */ i(a.Body, {
|
|
72
72
|
gap: 2,
|
|
@@ -75,12 +75,12 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
75
75
|
name: "name",
|
|
76
76
|
placeholder: "Name",
|
|
77
77
|
size: "xs",
|
|
78
|
-
disabled: !
|
|
78
|
+
disabled: !h
|
|
79
79
|
}),
|
|
80
80
|
/* @__PURE__ */ i(a.Select, {
|
|
81
81
|
name: "category",
|
|
82
82
|
size: "xs",
|
|
83
|
-
onChange:
|
|
83
|
+
onChange: S,
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ r("option", {
|
|
86
86
|
value: l.COLOR,
|
|
@@ -100,7 +100,7 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
100
100
|
})
|
|
101
101
|
]
|
|
102
102
|
}),
|
|
103
|
-
|
|
103
|
+
x === l.COLOR && /* @__PURE__ */ i("div", {
|
|
104
104
|
className: "flex w-full gap-2",
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ r(a.Color, {
|
|
@@ -126,7 +126,7 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
126
126
|
})
|
|
127
127
|
]
|
|
128
128
|
}),
|
|
129
|
-
|
|
129
|
+
x !== l.COLOR && /* @__PURE__ */ r(a.Input, {
|
|
130
130
|
name: "value",
|
|
131
131
|
placeholder: "Value",
|
|
132
132
|
size: "xs",
|
|
@@ -134,7 +134,7 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
134
134
|
})
|
|
135
135
|
]
|
|
136
136
|
}), /* @__PURE__ */ i(a.Footer, { children: [/* @__PURE__ */ r(n, {
|
|
137
|
-
onClick:
|
|
137
|
+
onClick: g,
|
|
138
138
|
size: "xs",
|
|
139
139
|
className: "grow basis-0",
|
|
140
140
|
children: "Cancel"
|
|
@@ -142,9 +142,9 @@ var u = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
142
142
|
type: "submit",
|
|
143
143
|
size: "xs",
|
|
144
144
|
className: "grow basis-0",
|
|
145
|
-
children:
|
|
145
|
+
children: h ? "Add" : "Update"
|
|
146
146
|
})] })]
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
149
|
//#endregion
|
|
150
|
-
export {
|
|
150
|
+
export { m as default, f as styleVariableFormSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-variables",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.2",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -152,14 +152,14 @@
|
|
|
152
152
|
},
|
|
153
153
|
"dependencies": {
|
|
154
154
|
"@plitzi/plitzi-ui": "^1.6.29",
|
|
155
|
-
"@plitzi/sdk-shared": "0.
|
|
155
|
+
"@plitzi/sdk-shared": "0.38.2",
|
|
156
156
|
"clsx": "^2.1.1",
|
|
157
157
|
"zod": "^4.6.5"
|
|
158
158
|
},
|
|
159
159
|
"devDependencies": {
|
|
160
160
|
"eslint": "^9.39.5",
|
|
161
161
|
"typescript": "^6.0.3",
|
|
162
|
-
"vite": "^8.3.
|
|
163
|
-
"vitest": "^5.0.
|
|
162
|
+
"vite": "^8.3.2",
|
|
163
|
+
"vitest": "^5.0.3"
|
|
164
164
|
}
|
|
165
165
|
}
|