@plitzi/sdk-variables 0.39.1 → 0.39.3
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 +15 -0
- package/dist/VariablesContext.mjs +1 -2
- package/dist/VariablesHelper.mjs +1 -2
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/builder/components/SchemaVariables/SchemaVariable.mjs +5 -6
- package/dist/builder/components/SchemaVariables/SchemaVariables.mjs +7 -8
- package/dist/builder/components/SchemaVariables/VariableDetails.mjs +22 -23
- package/dist/builder/components/SchemaVariables/VariableValue.mjs +1 -2
- package/dist/builder/components/SchemaVariables/index.mjs +1 -2
- package/dist/builder/components/StyleVariables/StyleVariable.mjs +1 -2
- package/dist/builder/components/StyleVariables/StyleVariables.mjs +5 -6
- package/dist/builder/components/StyleVariables/VariableDetails.mjs +12 -13
- package/dist/builder/components/StyleVariables/VariableGroup.mjs +1 -2
- package/dist/builder/components/StyleVariables/VariableList.mjs +1 -2
- package/dist/builder/components/StyleVariables/VariableValue.mjs +1 -2
- package/dist/builder/components/StyleVariables/index.mjs +1 -2
- package/dist/builder/components/VariableActions/VariableActions.mjs +1 -2
- package/dist/builder/components/VariableActions/index.mjs +1 -2
- package/dist/builder/components/index.mjs +1 -2
- package/dist/builder/index.mjs +3 -3
- package/dist/builder/models/SchemaVariableForm/SchemaVariableForm.mjs +7 -8
- package/dist/builder/models/SchemaVariableForm/VariableSubValue.mjs +14 -15
- package/dist/builder/models/SchemaVariableForm/VariableSubValueActions.mjs +1 -2
- package/dist/builder/models/SchemaVariableForm/VariableValue.mjs +1 -2
- package/dist/builder/models/SchemaVariableForm/index.mjs +1 -2
- package/dist/builder/models/StyleVariableForm/StyleVariableForm.mjs +1 -2
- package/dist/builder/models/StyleVariableForm/index.mjs +1 -2
- package/dist/builder/models/index.mjs +1 -2
- package/package.json +11 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @plitzi/sdk-variables
|
|
2
2
|
|
|
3
|
+
## 0.39.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @plitzi/sdk-shared@0.39.3
|
|
8
|
+
|
|
9
|
+
## 0.39.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fad1264: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
14
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
15
|
+
- Updated dependencies [fad1264]
|
|
16
|
+
- @plitzi/sdk-shared@0.39.2
|
|
17
|
+
|
|
3
18
|
## 0.39.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/VariablesHelper.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/VariablesHelper.ts
|
|
2
2
|
var e = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/, t = /^rgba?\(\s*(\d{1,3}%?\s*,\s*){2,3}\d{1,3}%?\s*\)$/, n = /^hsla?\(\s*\d{1,3}(deg|rad|turn)?\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%(\s*,\s*(0|0?\.\d+|1))?\s*\)$/, r = /* @__PURE__ */ new Set([
|
|
3
3
|
"black",
|
|
4
4
|
"white",
|
|
@@ -39,5 +39,4 @@ var e = /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/, t = /^rgba?\(\s*(\d
|
|
|
39
39
|
let u = (e) => t === ":root" ? `${t}.${e}, .${e}` : `.${e} ${t}`, d = (e) => t === ":root" ? `${t}:not(.${e})` : `:root:not(.${e}) ${t}`;
|
|
40
40
|
return a.length && (l += `\n\n@media (prefers-color-scheme: light) {\n${s}${d("dark")} {\n${a.join("\n")}\n }\n}`), o.length && (l += `\n\n@media (prefers-color-scheme: dark) {\n${s}${d("light")} {\n${o.join("\n")}\n }\n}`), a.length && (l += `\n\n${u("light")} {\n${a.join("\n")}\n}`), o.length && (l += `\n\n${u("dark")} {\n${o.join("\n")}\n}`), l;
|
|
41
41
|
}, s = (e, t, n = 2, r = !0) => o(e, t, n, r);
|
|
42
|
-
//#endregion
|
|
43
42
|
export { a as schemaVariablesToCss, s as styleSelectorVariablesToCss, o as styleVariablesToCss };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var e = Object.defineProperty, t = (t, n) => {
|
|
3
3
|
let r = {};
|
|
4
4
|
for (var i in t) e(r, i, {
|
|
@@ -7,5 +7,4 @@ var e = Object.defineProperty, t = (t, n) => {
|
|
|
7
7
|
});
|
|
8
8
|
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { t as __exportAll };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import e from "../VariableActions/index.mjs";
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
2
|
+
import t from "./VariableDetails.mjs";
|
|
3
|
+
import n from "./VariableValue.mjs";
|
|
4
4
|
import r from "../../models/SchemaVariableForm/index.mjs";
|
|
5
5
|
import { omit as i } from "@plitzi/plitzi-ui/helpers";
|
|
6
6
|
import { useCallback as a, useState as o } from "react";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
-
|
|
8
|
+
// src/builder/components/SchemaVariables/SchemaVariable.tsx
|
|
9
9
|
var l = ({ name: l = "variable", value: u = "", type: d = "text", category: f = "", subValues: p, whenData: m, onChange: h, onRemove: g }) => {
|
|
10
10
|
let [_, v] = o(!1), [y, b] = o(!1), x = a((e) => {
|
|
11
11
|
e.stopPropagation(), g(l);
|
|
@@ -46,7 +46,7 @@ var l = ({ name: l = "variable", value: u = "", type: d = "text", category: f =
|
|
|
46
46
|
className: "font-bold",
|
|
47
47
|
title: l,
|
|
48
48
|
children: l
|
|
49
|
-
}), /* @__PURE__ */ s(
|
|
49
|
+
}), /* @__PURE__ */ s(n, {
|
|
50
50
|
className: "truncate text-xs",
|
|
51
51
|
type: d,
|
|
52
52
|
value: u
|
|
@@ -57,12 +57,11 @@ var l = ({ name: l = "variable", value: u = "", type: d = "text", category: f =
|
|
|
57
57
|
onUpdate: S,
|
|
58
58
|
onRemove: x
|
|
59
59
|
})]
|
|
60
|
-
}), y && /* @__PURE__ */ s(
|
|
60
|
+
}), y && /* @__PURE__ */ s(t, {
|
|
61
61
|
name: l,
|
|
62
62
|
type: d,
|
|
63
63
|
subValues: p
|
|
64
64
|
})]
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
//#endregion
|
|
68
67
|
export { l as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
1
|
+
import e from "./SchemaVariable.mjs";
|
|
2
|
+
import t from "../../models/SchemaVariableForm/index.mjs";
|
|
3
3
|
import { useCallback as n } from "react";
|
|
4
4
|
import r from "clsx";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
// src/builder/components/SchemaVariables/SchemaVariables.tsx
|
|
7
7
|
var o = {
|
|
8
8
|
name: "variable",
|
|
9
9
|
type: "text",
|
|
@@ -20,7 +20,7 @@ var o = {
|
|
|
20
20
|
return /* @__PURE__ */ a("div", {
|
|
21
21
|
className: r("flex w-full flex-col gap-3", s),
|
|
22
22
|
children: [
|
|
23
|
-
u && /* @__PURE__ */ i(
|
|
23
|
+
u && /* @__PURE__ */ i(t, {
|
|
24
24
|
...o,
|
|
25
25
|
isNewRecord: !0,
|
|
26
26
|
onSubmit: g,
|
|
@@ -29,9 +29,9 @@ var o = {
|
|
|
29
29
|
!u && (c ?? []).length === 0 && f,
|
|
30
30
|
/* @__PURE__ */ i("div", {
|
|
31
31
|
className: "flex min-h-0 grow basis-0 flex-col gap-1 overflow-y-auto",
|
|
32
|
-
children: c?.map((
|
|
33
|
-
let { name: n, type: r, value: a, category: o, subValues: s } =
|
|
34
|
-
return /* @__PURE__ */ i(
|
|
32
|
+
children: c?.map((t) => {
|
|
33
|
+
let { name: n, type: r, value: a, category: o, subValues: s } = t;
|
|
34
|
+
return /* @__PURE__ */ i(e, {
|
|
35
35
|
name: n,
|
|
36
36
|
category: o,
|
|
37
37
|
type: r,
|
|
@@ -46,5 +46,4 @@ var o = {
|
|
|
46
46
|
]
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
|
-
//#endregion
|
|
50
49
|
export { s as default };
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
import e from "./VariableValue.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
2
|
+
import { useCallback as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { QueryBuilderFormatter as i } from "@plitzi/plitzi-ui/QueryBuilder";
|
|
5
|
+
import { useToast as a } from "@plitzi/plitzi-ui/Toast";
|
|
6
|
+
import { NOT_COPIED_REASON as o, copyText as s } from "@plitzi/sdk-shared/helpers";
|
|
7
|
+
// src/builder/components/SchemaVariables/VariableDetails.tsx
|
|
8
8
|
var c = ({ name: c, subValues: l = [], type: u = "text" }) => {
|
|
9
|
-
let { addToast: d } =
|
|
10
|
-
|
|
9
|
+
let { addToast: d } = a(), f = t(() => {
|
|
10
|
+
s(`{{${c}}}`).then((e) => d(e ? "Variable copied into the clipboard" : o, {
|
|
11
11
|
appeareance: e ? "success" : "error",
|
|
12
12
|
autoDismiss: !0,
|
|
13
13
|
placement: "top-right"
|
|
14
14
|
}));
|
|
15
15
|
}, [d, c]);
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ r("div", {
|
|
17
17
|
className: "flex w-full flex-col gap-2",
|
|
18
|
-
children: [l.length > 0 && /* @__PURE__ */
|
|
18
|
+
children: [l.length > 0 && /* @__PURE__ */ n("div", {
|
|
19
19
|
className: "flex w-full flex-col gap-1",
|
|
20
|
-
children: l.map((t,
|
|
20
|
+
children: l.map((t, a) => /* @__PURE__ */ r("div", {
|
|
21
21
|
className: "flex w-full flex-col rounded-sm border border-gray-300 text-xs",
|
|
22
|
-
children: [/* @__PURE__ */
|
|
22
|
+
children: [/* @__PURE__ */ r("div", {
|
|
23
23
|
className: "flex items-center gap-1 px-1 py-0.5",
|
|
24
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ n("div", {
|
|
25
25
|
className: "font-bold",
|
|
26
26
|
children: "Value:"
|
|
27
|
-
}), /* @__PURE__ */
|
|
27
|
+
}), /* @__PURE__ */ n(e, {
|
|
28
28
|
className: "text-xs",
|
|
29
29
|
value: String(t.value),
|
|
30
30
|
type: u
|
|
31
31
|
})]
|
|
32
|
-
}), /* @__PURE__ */
|
|
32
|
+
}), /* @__PURE__ */ r("div", {
|
|
33
33
|
className: "flex gap-1 border-t border-gray-300 px-1 py-0.5",
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ n("div", {
|
|
35
35
|
className: "font-bold",
|
|
36
36
|
children: "When:"
|
|
37
|
-
}),
|
|
37
|
+
}), i(t.when)]
|
|
38
38
|
})]
|
|
39
|
-
},
|
|
40
|
-
}), /* @__PURE__ */
|
|
39
|
+
}, a))
|
|
40
|
+
}), /* @__PURE__ */ r("div", {
|
|
41
41
|
className: "flex items-center justify-between gap-2",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
42
|
+
children: [/* @__PURE__ */ r("div", {
|
|
43
43
|
className: "flex gap-1",
|
|
44
|
-
children: ["Token:", /* @__PURE__ */
|
|
44
|
+
children: ["Token:", /* @__PURE__ */ n("div", {
|
|
45
45
|
className: "truncate font-bold",
|
|
46
46
|
title: c,
|
|
47
47
|
children: `{{${c}}}`
|
|
48
48
|
})]
|
|
49
|
-
}), /* @__PURE__ */
|
|
49
|
+
}), /* @__PURE__ */ n("i", {
|
|
50
50
|
className: "fa-solid fa-copy cursor-pointer hover:text-blue-400",
|
|
51
51
|
onClick: f,
|
|
52
52
|
title: "Copy"
|
|
@@ -54,5 +54,4 @@ var c = ({ name: c, subValues: l = [], type: u = "text" }) => {
|
|
|
54
54
|
})]
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
//#endregion
|
|
58
57
|
export { c as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
|
|
2
|
+
// src/builder/components/SchemaVariables/VariableValue.tsx
|
|
3
3
|
var n = ({ type: n, value: r }) => /* @__PURE__ */ t("div", {
|
|
4
4
|
className: "flex items-center gap-1 truncate text-xs",
|
|
5
5
|
children: [n === "color" && /* @__PURE__ */ e("div", {
|
|
@@ -12,5 +12,4 @@ var n = ({ type: n, value: r }) => /* @__PURE__ */ t("div", {
|
|
|
12
12
|
children: r
|
|
13
13
|
})]
|
|
14
14
|
});
|
|
15
|
-
//#endregion
|
|
16
15
|
export { n as default };
|
|
@@ -6,7 +6,7 @@ import { omit as i } from "@plitzi/plitzi-ui/helpers";
|
|
|
6
6
|
import { useCallback as a, useState as o } from "react";
|
|
7
7
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
import { StyleVariableCategory as l } from "@plitzi/sdk-shared";
|
|
9
|
-
|
|
9
|
+
// src/builder/components/StyleVariables/StyleVariable.tsx
|
|
10
10
|
var u = ({ category: u, name: d, value: f, onUpdate: p, onRemove: m }) => {
|
|
11
11
|
let [h, g] = o(!1), [_, v] = o(!1), y = a((e) => {
|
|
12
12
|
e.stopPropagation(), g(!0);
|
|
@@ -59,5 +59,4 @@ var u = ({ category: u, name: d, value: f, onUpdate: p, onRemove: m }) => {
|
|
|
59
59
|
}), _ && /* @__PURE__ */ s(t, { name: d })]
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
|
-
//#endregion
|
|
63
62
|
export { u as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
1
|
+
import e from "./VariableList.mjs";
|
|
2
|
+
import t from "../../models/StyleVariableForm/index.mjs";
|
|
3
3
|
import { useCallback as n } from "react";
|
|
4
4
|
import r from "clsx";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
import { StyleVariableCategory as o } from "@plitzi/sdk-shared";
|
|
7
|
-
|
|
7
|
+
// src/builder/components/StyleVariables/StyleVariables.tsx
|
|
8
8
|
var s = {
|
|
9
9
|
name: "",
|
|
10
10
|
category: o.COLOR,
|
|
@@ -27,14 +27,14 @@ var s = {
|
|
|
27
27
|
return /* @__PURE__ */ a("div", {
|
|
28
28
|
className: r("flex flex-col gap-2", o),
|
|
29
29
|
children: [
|
|
30
|
-
l && /* @__PURE__ */ i(
|
|
30
|
+
l && /* @__PURE__ */ i(t, {
|
|
31
31
|
...s,
|
|
32
32
|
isNewRecord: !0,
|
|
33
33
|
onSubmit: h,
|
|
34
34
|
onClose: v
|
|
35
35
|
}),
|
|
36
36
|
!l && y && d,
|
|
37
|
-
/* @__PURE__ */ i(
|
|
37
|
+
/* @__PURE__ */ i(e, {
|
|
38
38
|
variables: c,
|
|
39
39
|
onUpdate: g,
|
|
40
40
|
onRemove: _
|
|
@@ -42,5 +42,4 @@ var s = {
|
|
|
42
42
|
]
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
//#endregion
|
|
46
45
|
export { c as default };
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { useToast as r } from "@plitzi/plitzi-ui/Toast";
|
|
4
|
+
import { NOT_COPIED_REASON as i, copyText as a } from "@plitzi/sdk-shared/helpers";
|
|
5
|
+
// src/builder/components/StyleVariables/VariableDetails.tsx
|
|
6
6
|
var o = ({ name: o }) => {
|
|
7
|
-
let { addToast: s } =
|
|
8
|
-
|
|
9
|
-
appeareance:
|
|
7
|
+
let { addToast: s } = r(), c = e(() => {
|
|
8
|
+
a(`var(--${o})`).then((e) => s(e ? "Variable copied into the clipboard" : i, {
|
|
9
|
+
appeareance: e ? "success" : "error",
|
|
10
10
|
autoDismiss: !0,
|
|
11
11
|
placement: "top-right"
|
|
12
12
|
}));
|
|
13
13
|
}, [s, o]);
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ n("div", {
|
|
15
15
|
className: "flex w-full items-center justify-between gap-2",
|
|
16
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ n("div", {
|
|
17
17
|
className: "flex gap-1",
|
|
18
|
-
children: ["Token:", /* @__PURE__ */
|
|
18
|
+
children: ["Token:", /* @__PURE__ */ t("div", {
|
|
19
19
|
className: "truncate font-bold",
|
|
20
20
|
title: o,
|
|
21
21
|
children: `var(--${o})`
|
|
22
22
|
})]
|
|
23
|
-
}), /* @__PURE__ */
|
|
23
|
+
}), /* @__PURE__ */ t("i", {
|
|
24
24
|
className: "fa-solid fa-copy cursor-pointer hover:text-blue-400",
|
|
25
25
|
onClick: c,
|
|
26
26
|
title: "Copy"
|
|
27
27
|
})]
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
//#endregion
|
|
31
30
|
export { o as default };
|
|
@@ -2,7 +2,7 @@ import e from "./StyleVariable.mjs";
|
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import r from "@plitzi/plitzi-ui/ContainerCollapsable";
|
|
4
4
|
import i from "@plitzi/plitzi-ui/Icon";
|
|
5
|
-
|
|
5
|
+
// src/builder/components/StyleVariables/VariableGroup.tsx
|
|
6
6
|
var a = ({ category: a, variables: o = {}, onUpdate: s, onRemove: c }) => {
|
|
7
7
|
let l = Object.keys(o).length;
|
|
8
8
|
return /* @__PURE__ */ n(r, {
|
|
@@ -31,5 +31,4 @@ var a = ({ category: a, variables: o = {}, onUpdate: s, onRemove: c }) => {
|
|
|
31
31
|
})]
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
//#endregion
|
|
35
34
|
export { a as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./VariableGroup.mjs";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { StyleVariableCategory as n } from "@plitzi/sdk-shared";
|
|
4
|
-
|
|
4
|
+
// src/builder/components/StyleVariables/VariableList.tsx
|
|
5
5
|
var r = ({ variables: r, onUpdate: i, onRemove: a }) => {
|
|
6
6
|
if (r) return /* @__PURE__ */ t("div", {
|
|
7
7
|
className: "flex grow flex-col overflow-y-auto",
|
|
@@ -13,5 +13,4 @@ var r = ({ variables: r, onUpdate: i, onRemove: a }) => {
|
|
|
13
13
|
}, n))
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
//#endregion
|
|
17
16
|
export { r as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo as e } from "react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/builder/components/StyleVariables/VariableValue.tsx
|
|
4
4
|
var r = ({ type: r, value: i }) => {
|
|
5
5
|
let a = e(() => typeof i == "object" ? Object.keys(i).sort((e) => e === "default" ? -1 : 1) : [], [i]);
|
|
6
6
|
return /* @__PURE__ */ n("div", {
|
|
@@ -23,5 +23,4 @@ var r = ({ type: r, value: i }) => {
|
|
|
23
23
|
})]
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
//#endregion
|
|
27
26
|
export { r as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "@plitzi/plitzi-ui/Button";
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/builder/components/VariableActions/VariableActions.tsx
|
|
5
5
|
var i = ({ onUpdate: i, onRemove: a, selected: o = !1 }) => /* @__PURE__ */ r("div", {
|
|
6
6
|
className: t("flex items-center gap-2 text-xs", {
|
|
7
7
|
flex: o,
|
|
@@ -29,5 +29,4 @@ var i = ({ onUpdate: i, onRemove: a, selected: o = !1 }) => /* @__PURE__ */ r("d
|
|
|
29
29
|
})
|
|
30
30
|
})]
|
|
31
31
|
});
|
|
32
|
-
//#endregion
|
|
33
32
|
export { i as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { __exportAll as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
import t from "./SchemaVariables/index.mjs";
|
|
3
3
|
import n from "./StyleVariables/index.mjs";
|
|
4
|
-
|
|
4
|
+
// src/builder/components/index.ts
|
|
5
5
|
var r = /* @__PURE__ */ e({
|
|
6
6
|
SchemaVariables: () => t,
|
|
7
7
|
StyleVariables: () => n
|
|
8
8
|
});
|
|
9
|
-
//#endregion
|
|
10
9
|
export { t as SchemaVariables, n as StyleVariables, r as components_exports };
|
package/dist/builder/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import t from "./models/SchemaVariableForm/index.mjs";
|
|
|
3
3
|
import n from "./components/SchemaVariables/index.mjs";
|
|
4
4
|
import { styleVariableFormSchema as r } from "./models/StyleVariableForm/StyleVariableForm.mjs";
|
|
5
5
|
import i from "./models/StyleVariableForm/index.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { components_exports as a } from "./components/index.mjs";
|
|
7
7
|
import o from "./components/StyleVariables/index.mjs";
|
|
8
|
-
import {
|
|
9
|
-
export { t as SchemaVariableForm, n as SchemaVariables, i as StyleVariableForm, o as StyleVariables,
|
|
8
|
+
import { models_exports as s } from "./models/index.mjs";
|
|
9
|
+
export { t as SchemaVariableForm, n as SchemaVariables, i as StyleVariableForm, o as StyleVariables, a as components, s as forms, e as schemaVariableFormSchema, r as styleVariableFormSchema };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
1
|
+
import e from "./VariableSubValue.mjs";
|
|
2
|
+
import t from "./VariableValue.mjs";
|
|
3
3
|
import { useCallback as n } from "react";
|
|
4
4
|
import r from "@plitzi/plitzi-ui/Button";
|
|
5
5
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
6
|
import o from "@plitzi/plitzi-ui/Alert";
|
|
7
7
|
import s, { useFieldArray as c, useForm as l, useFormWatch as u } from "@plitzi/plitzi-ui/Form";
|
|
8
8
|
import { z as d } from "zod";
|
|
9
|
-
|
|
9
|
+
// src/builder/models/SchemaVariableForm/SchemaVariableForm.tsx
|
|
10
10
|
var f = d.object({
|
|
11
11
|
name: d.string().min(4).regex(/^(?:\w+\s+|)([a-zA-Z_][a-zA-Z0-9_]+)$/i, { message: "Name only can be letters, numbers and _ -" }),
|
|
12
12
|
category: d.string(),
|
|
@@ -119,7 +119,7 @@ var f = d.object({
|
|
|
119
119
|
size: "xs",
|
|
120
120
|
className: "w-full grow basis-0"
|
|
121
121
|
}),
|
|
122
|
-
/* @__PURE__ */ i(
|
|
122
|
+
/* @__PURE__ */ i(t, {
|
|
123
123
|
valueType: E,
|
|
124
124
|
hasSubValues: k,
|
|
125
125
|
name: "value"
|
|
@@ -133,9 +133,9 @@ var f = d.object({
|
|
|
133
133
|
className: "flex flex-col gap-2",
|
|
134
134
|
children: [/* @__PURE__ */ i("div", {
|
|
135
135
|
className: "flex flex-col gap-2",
|
|
136
|
-
children: S.map((
|
|
136
|
+
children: S.map((t, n) => /* @__PURE__ */ i("div", {
|
|
137
137
|
className: "flex gap-2",
|
|
138
|
-
children: /* @__PURE__ */ i(
|
|
138
|
+
children: /* @__PURE__ */ i(e, {
|
|
139
139
|
whenData: _,
|
|
140
140
|
valueType: E,
|
|
141
141
|
index: n,
|
|
@@ -144,7 +144,7 @@ var f = d.object({
|
|
|
144
144
|
onClickUp: j(n),
|
|
145
145
|
onClickDown: M(n)
|
|
146
146
|
})
|
|
147
|
-
},
|
|
147
|
+
}, t.id))
|
|
148
148
|
}), /* @__PURE__ */ i(r, {
|
|
149
149
|
size: "xs",
|
|
150
150
|
title: "Down",
|
|
@@ -167,5 +167,4 @@ var f = d.object({
|
|
|
167
167
|
})]
|
|
168
168
|
});
|
|
169
169
|
};
|
|
170
|
-
//#endregion
|
|
171
170
|
export { p as default, f as schemaVariableFormSchema };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import e from "./VariableValue.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import a from "@plitzi/
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/QueryBuilder";
|
|
5
|
+
import { getPathsFromObject as a } from "@plitzi/sdk-shared/helpers";
|
|
6
6
|
import o from "@plitzi/plitzi-ui/Form";
|
|
7
7
|
import s from "@plitzi/plitzi-ui/Heading";
|
|
8
|
-
|
|
8
|
+
// src/builder/models/SchemaVariableForm/VariableSubValue.tsx
|
|
9
9
|
var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onClickRemove: f, onClickUp: p, onClickDown: m }) => {
|
|
10
|
-
let h =
|
|
10
|
+
let h = t(() => a(u).reduce((e, t) => ({
|
|
11
11
|
...e,
|
|
12
12
|
[t]: {
|
|
13
13
|
name: t,
|
|
@@ -15,9 +15,9 @@ var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onCl
|
|
|
15
15
|
placeholder: `Enter ${t}`
|
|
16
16
|
}
|
|
17
17
|
}), {}), [u]);
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ r("div", {
|
|
19
19
|
className: "flex min-w-0 grow basis-0 flex-col gap-3 rounded-sm border border-gray-300 p-2",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ n(e, {
|
|
21
21
|
valueType: l,
|
|
22
22
|
name: `subValues.${c}.value`,
|
|
23
23
|
isSubValue: !0,
|
|
@@ -26,23 +26,23 @@ var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onCl
|
|
|
26
26
|
onClickRemove: f,
|
|
27
27
|
onClickUp: p,
|
|
28
28
|
onClickDown: m
|
|
29
|
-
}), /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ n(o.Custom, {
|
|
30
30
|
name: `subValues.${c}.when`,
|
|
31
|
-
render: ({ field: { ref: e, value: t, onChange:
|
|
31
|
+
render: ({ field: { ref: e, value: t, onChange: a }, fieldState: { error: o } }) => /* @__PURE__ */ r("div", {
|
|
32
32
|
className: "flex flex-col gap-1",
|
|
33
33
|
ref: e,
|
|
34
|
-
children: [/* @__PURE__ */
|
|
34
|
+
children: [/* @__PURE__ */ n(s, {
|
|
35
35
|
as: "h5",
|
|
36
36
|
children: "When Happens"
|
|
37
|
-
}), /* @__PURE__ */
|
|
37
|
+
}), /* @__PURE__ */ n("div", {
|
|
38
38
|
className: "flex flex-col",
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ n(i, {
|
|
40
40
|
direction: "vertical",
|
|
41
41
|
intent: "gray",
|
|
42
42
|
className: "w-full",
|
|
43
43
|
query: t,
|
|
44
44
|
fields: h,
|
|
45
|
-
onChange:
|
|
45
|
+
onChange: a,
|
|
46
46
|
showBranches: !0,
|
|
47
47
|
error: !!o?.message
|
|
48
48
|
})
|
|
@@ -51,5 +51,4 @@ var c = ({ index: c = 0, valueType: l = "text", whenData: u, indexLimit: d, onCl
|
|
|
51
51
|
})]
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
|
-
//#endregion
|
|
55
54
|
export { c as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "@plitzi/plitzi-ui/Button";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/builder/models/SchemaVariableForm/VariableSubValueActions.tsx
|
|
4
4
|
var r = ({ indexLimit: r = 0, index: i = 0, onClickRemove: a, onClickUp: o, onClickDown: s }) => /* @__PURE__ */ n("div", {
|
|
5
5
|
className: "flex gap-2",
|
|
6
6
|
children: [
|
|
@@ -28,5 +28,4 @@ var r = ({ indexLimit: r = 0, index: i = 0, onClickRemove: a, onClickUp: o, onCl
|
|
|
28
28
|
})
|
|
29
29
|
]
|
|
30
30
|
});
|
|
31
|
-
//#endregion
|
|
32
31
|
export { r as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./VariableSubValueActions.mjs";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import r from "@plitzi/plitzi-ui/Form";
|
|
4
|
-
|
|
4
|
+
// src/builder/models/SchemaVariableForm/VariableValue.tsx
|
|
5
5
|
var i = ({ valueType: i = "text", hasSubValues: a = !1, name: o = "value", index: s, indexLimit: c, isSubValue: l = !1, onClickRemove: u, onClickUp: d, onClickDown: f }) => {
|
|
6
6
|
let p = a ? "Fallback Value" : "Value", m = {
|
|
7
7
|
name: o,
|
|
@@ -33,5 +33,4 @@ var i = ({ valueType: i = "text", hasSubValues: a = !1, name: o = "value", index
|
|
|
33
33
|
]
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
//#endregion
|
|
37
36
|
export { i as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import e, { schemaVariableFormSchema as t } from "./SchemaVariableForm.mjs";
|
|
2
|
-
|
|
2
|
+
// src/builder/models/SchemaVariableForm/index.ts
|
|
3
3
|
var n = e;
|
|
4
|
-
//#endregion
|
|
5
4
|
export { n as default, t as schemaVariableFormSchema };
|
|
@@ -4,7 +4,7 @@ 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
6
|
import { StyleVariableCategory as l, isStyleVariableCategory as u } from "@plitzi/sdk-shared";
|
|
7
|
-
|
|
7
|
+
// src/builder/models/StyleVariableForm/StyleVariableForm.tsx
|
|
8
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
10
|
name: d,
|
|
@@ -146,5 +146,4 @@ var d = c.string().min(3, "Too Short").max(20, "Too Long").regex(/^(?:\w+\s+|)([
|
|
|
146
146
|
})] })]
|
|
147
147
|
});
|
|
148
148
|
};
|
|
149
|
-
//#endregion
|
|
150
149
|
export { m as default, f as styleVariableFormSchema };
|
|
@@ -3,12 +3,11 @@ import { schemaVariableFormSchema as t } from "./SchemaVariableForm/SchemaVariab
|
|
|
3
3
|
import n from "./SchemaVariableForm/index.mjs";
|
|
4
4
|
import { styleVariableFormSchema as r } from "./StyleVariableForm/StyleVariableForm.mjs";
|
|
5
5
|
import i from "./StyleVariableForm/index.mjs";
|
|
6
|
-
|
|
6
|
+
// src/builder/models/index.ts
|
|
7
7
|
var a = /* @__PURE__ */ e({
|
|
8
8
|
SchemaVariableForm: () => n,
|
|
9
9
|
StyleVariableForm: () => i,
|
|
10
10
|
schemaVariableFormSchema: () => t,
|
|
11
11
|
styleVariableFormSchema: () => r
|
|
12
12
|
});
|
|
13
|
-
//#endregion
|
|
14
13
|
export { n as SchemaVariableForm, i as StyleVariableForm, a as models_exports, t as schemaVariableFormSchema, r as styleVariableFormSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-variables",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.3",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -9,19 +9,21 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"@plitzi/source": "./src/index.ts",
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.mjs"
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
13
14
|
},
|
|
14
15
|
"./*": {
|
|
15
16
|
"@plitzi/source": "./src/*/index.ts",
|
|
16
17
|
"types": "./dist/*/index.d.ts",
|
|
17
|
-
"import": "./dist/*/index.mjs"
|
|
18
|
+
"import": "./dist/*/index.mjs",
|
|
19
|
+
"default": "./dist/*/index.mjs"
|
|
18
20
|
}
|
|
19
21
|
},
|
|
20
22
|
"type": "module",
|
|
21
23
|
"sideEffects": false,
|
|
22
24
|
"scripts": {
|
|
23
|
-
"lint": "eslint ./src",
|
|
24
|
-
"typecheck": "tsc -p tsconfig.app.json --noEmit",
|
|
25
|
+
"lint": "eslint --cache --cache-location .eslintcache --cache-strategy content ./src",
|
|
26
|
+
"typecheck": "tsc -p tsconfig.app.json --noEmit --incremental --tsBuildInfoFile .tsbuildinfo/app.tsbuildinfo",
|
|
25
27
|
"build:dev": "vite build --mode development --minify false",
|
|
26
28
|
"build:dev-watch": "vite build --mode development --watch --minify false",
|
|
27
29
|
"build:prod": "vite build",
|
|
@@ -29,8 +31,8 @@
|
|
|
29
31
|
"test:watch": "vitest"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
33
|
-
"@plitzi/sdk-shared": "0.39.
|
|
34
|
+
"@plitzi/plitzi-ui": "^1.6.38",
|
|
35
|
+
"@plitzi/sdk-shared": "0.39.3",
|
|
34
36
|
"clsx": "^2.1.1",
|
|
35
37
|
"zod": "^4.6.7"
|
|
36
38
|
},
|
|
@@ -38,8 +40,8 @@
|
|
|
38
40
|
"eslint": "^9.39.5",
|
|
39
41
|
"react": "^19.3.1",
|
|
40
42
|
"typescript": "^6.0.3",
|
|
41
|
-
"vite": "^8.3.
|
|
42
|
-
"vitest": "^5.0
|
|
43
|
+
"vite": "^8.3.7",
|
|
44
|
+
"vitest": "^5.1.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"react": "^19"
|