@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.
Files changed (29) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/VariablesContext.mjs +1 -2
  3. package/dist/VariablesHelper.mjs +1 -2
  4. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  5. package/dist/builder/components/SchemaVariables/SchemaVariable.mjs +5 -6
  6. package/dist/builder/components/SchemaVariables/SchemaVariables.mjs +7 -8
  7. package/dist/builder/components/SchemaVariables/VariableDetails.mjs +22 -23
  8. package/dist/builder/components/SchemaVariables/VariableValue.mjs +1 -2
  9. package/dist/builder/components/SchemaVariables/index.mjs +1 -2
  10. package/dist/builder/components/StyleVariables/StyleVariable.mjs +1 -2
  11. package/dist/builder/components/StyleVariables/StyleVariables.mjs +5 -6
  12. package/dist/builder/components/StyleVariables/VariableDetails.mjs +12 -13
  13. package/dist/builder/components/StyleVariables/VariableGroup.mjs +1 -2
  14. package/dist/builder/components/StyleVariables/VariableList.mjs +1 -2
  15. package/dist/builder/components/StyleVariables/VariableValue.mjs +1 -2
  16. package/dist/builder/components/StyleVariables/index.mjs +1 -2
  17. package/dist/builder/components/VariableActions/VariableActions.mjs +1 -2
  18. package/dist/builder/components/VariableActions/index.mjs +1 -2
  19. package/dist/builder/components/index.mjs +1 -2
  20. package/dist/builder/index.mjs +3 -3
  21. package/dist/builder/models/SchemaVariableForm/SchemaVariableForm.mjs +7 -8
  22. package/dist/builder/models/SchemaVariableForm/VariableSubValue.mjs +14 -15
  23. package/dist/builder/models/SchemaVariableForm/VariableSubValueActions.mjs +1 -2
  24. package/dist/builder/models/SchemaVariableForm/VariableValue.mjs +1 -2
  25. package/dist/builder/models/SchemaVariableForm/index.mjs +1 -2
  26. package/dist/builder/models/StyleVariableForm/StyleVariableForm.mjs +1 -2
  27. package/dist/builder/models/StyleVariableForm/index.mjs +1 -2
  28. package/dist/builder/models/index.mjs +1 -2
  29. 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
@@ -1,4 +1,3 @@
1
- import { sharedContext as e } from "@plitzi/sdk-shared/helpers";
1
+ import { sharedContext as e } from "@plitzi/sdk-shared/react";
2
2
  var t = e("VariablesContext", void 0);
3
- //#endregion
4
3
  export { t as default };
@@ -1,4 +1,4 @@
1
- //#region src/VariablesHelper.ts
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
- //#region \0rolldown/runtime.js
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 "./VariableValue.mjs";
3
- import n from "./VariableDetails.mjs";
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
- //#region src/builder/components/SchemaVariables/SchemaVariable.tsx
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(t, {
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(n, {
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 "../../models/SchemaVariableForm/index.mjs";
2
- import t from "./SchemaVariable.mjs";
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
- //#region src/builder/components/SchemaVariables/SchemaVariables.tsx
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(e, {
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((e) => {
33
- let { name: n, type: r, value: a, category: o, subValues: s } = e;
34
- return /* @__PURE__ */ i(t, {
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 { NOT_COPIED_REASON as t, copyText as n } from "@plitzi/sdk-shared/helpers";
3
- import { useCallback as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import { QueryBuilderFormatter as o } from "@plitzi/plitzi-ui/QueryBuilder";
6
- import { useToast as s } from "@plitzi/plitzi-ui/Toast";
7
- //#region src/builder/components/SchemaVariables/VariableDetails.tsx
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 } = s(), f = r(() => {
10
- n(`{{${c}}}`).then((e) => d(e ? "Variable copied into the clipboard" : t, {
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__ */ a("div", {
16
+ return /* @__PURE__ */ r("div", {
17
17
  className: "flex w-full flex-col gap-2",
18
- children: [l.length > 0 && /* @__PURE__ */ i("div", {
18
+ children: [l.length > 0 && /* @__PURE__ */ n("div", {
19
19
  className: "flex w-full flex-col gap-1",
20
- children: l.map((t, n) => /* @__PURE__ */ a("div", {
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__ */ a("div", {
22
+ children: [/* @__PURE__ */ r("div", {
23
23
  className: "flex items-center gap-1 px-1 py-0.5",
24
- children: [/* @__PURE__ */ i("div", {
24
+ children: [/* @__PURE__ */ n("div", {
25
25
  className: "font-bold",
26
26
  children: "Value:"
27
- }), /* @__PURE__ */ i(e, {
27
+ }), /* @__PURE__ */ n(e, {
28
28
  className: "text-xs",
29
29
  value: String(t.value),
30
30
  type: u
31
31
  })]
32
- }), /* @__PURE__ */ a("div", {
32
+ }), /* @__PURE__ */ r("div", {
33
33
  className: "flex gap-1 border-t border-gray-300 px-1 py-0.5",
34
- children: [/* @__PURE__ */ i("div", {
34
+ children: [/* @__PURE__ */ n("div", {
35
35
  className: "font-bold",
36
36
  children: "When:"
37
- }), o(t.when)]
37
+ }), i(t.when)]
38
38
  })]
39
- }, n))
40
- }), /* @__PURE__ */ a("div", {
39
+ }, a))
40
+ }), /* @__PURE__ */ r("div", {
41
41
  className: "flex items-center justify-between gap-2",
42
- children: [/* @__PURE__ */ a("div", {
42
+ children: [/* @__PURE__ */ r("div", {
43
43
  className: "flex gap-1",
44
- children: ["Token:", /* @__PURE__ */ i("div", {
44
+ children: ["Token:", /* @__PURE__ */ n("div", {
45
45
  className: "truncate font-bold",
46
46
  title: c,
47
47
  children: `{{${c}}}`
48
48
  })]
49
- }), /* @__PURE__ */ i("i", {
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
- //#region src/builder/components/SchemaVariables/VariableValue.tsx
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 };
@@ -1,5 +1,4 @@
1
1
  import e from "./SchemaVariables.mjs";
2
- //#region src/builder/components/SchemaVariables/index.ts
2
+ // src/builder/components/SchemaVariables/index.ts
3
3
  var t = e;
4
- //#endregion
5
4
  export { t 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
- //#region src/builder/components/StyleVariables/StyleVariable.tsx
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 "../../models/StyleVariableForm/index.mjs";
2
- import t from "./VariableList.mjs";
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
- //#region src/builder/components/StyleVariables/StyleVariables.tsx
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(e, {
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(t, {
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 { NOT_COPIED_REASON as e, copyText as t } from "@plitzi/sdk-shared/helpers";
2
- import { useCallback as n } from "react";
3
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { useToast as a } from "@plitzi/plitzi-ui/Toast";
5
- //#region src/builder/components/StyleVariables/VariableDetails.tsx
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 } = a(), c = n(() => {
8
- t(`var(--${o})`).then((t) => s(t ? "Variable copied into the clipboard" : e, {
9
- appeareance: t ? "success" : "error",
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__ */ i("div", {
14
+ return /* @__PURE__ */ n("div", {
15
15
  className: "flex w-full items-center justify-between gap-2",
16
- children: [/* @__PURE__ */ i("div", {
16
+ children: [/* @__PURE__ */ n("div", {
17
17
  className: "flex gap-1",
18
- children: ["Token:", /* @__PURE__ */ r("div", {
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__ */ r("i", {
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
- //#region src/builder/components/StyleVariables/VariableGroup.tsx
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
- //#region src/builder/components/StyleVariables/VariableList.tsx
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
- //#region src/builder/components/StyleVariables/VariableValue.tsx
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,5 +1,4 @@
1
1
  import e from "./StyleVariables.mjs";
2
- //#region src/builder/components/StyleVariables/index.ts
2
+ // src/builder/components/StyleVariables/index.ts
3
3
  var t = e;
4
- //#endregion
5
4
  export { t 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
- //#region src/builder/components/VariableActions/VariableActions.tsx
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,5 +1,4 @@
1
1
  import e from "./VariableActions.mjs";
2
- //#region src/builder/components/VariableActions/index.ts
2
+ // src/builder/components/VariableActions/index.ts
3
3
  var t = e;
4
- //#endregion
5
4
  export { t 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
- //#region src/builder/components/index.ts
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 };
@@ -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 { models_exports as a } from "./models/index.mjs";
6
+ import { components_exports as a } from "./components/index.mjs";
7
7
  import o from "./components/StyleVariables/index.mjs";
8
- import { components_exports as s } from "./components/index.mjs";
9
- export { t as SchemaVariableForm, n as SchemaVariables, i as StyleVariableForm, o as StyleVariables, s as components, a as forms, e as schemaVariableFormSchema, r as styleVariableFormSchema };
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 "./VariableValue.mjs";
2
- import t from "./VariableSubValue.mjs";
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
- //#region src/builder/models/SchemaVariableForm/SchemaVariableForm.tsx
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(e, {
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((e, n) => /* @__PURE__ */ i("div", {
136
+ children: S.map((t, n) => /* @__PURE__ */ i("div", {
137
137
  className: "flex gap-2",
138
- children: /* @__PURE__ */ i(t, {
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
- }, e.id))
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 { getPathsFromObject as t } from "@plitzi/sdk-shared/helpers";
3
- import { useMemo as n } from "react";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import a from "@plitzi/plitzi-ui/QueryBuilder";
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
- //#region src/builder/models/SchemaVariableForm/VariableSubValue.tsx
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 = n(() => t(u).reduce((e, t) => ({
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__ */ i("div", {
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__ */ r(e, {
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__ */ r(o.Custom, {
29
+ }), /* @__PURE__ */ n(o.Custom, {
30
30
  name: `subValues.${c}.when`,
31
- render: ({ field: { ref: e, value: t, onChange: n }, fieldState: { error: o } }) => /* @__PURE__ */ i("div", {
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__ */ r(s, {
34
+ children: [/* @__PURE__ */ n(s, {
35
35
  as: "h5",
36
36
  children: "When Happens"
37
- }), /* @__PURE__ */ r("div", {
37
+ }), /* @__PURE__ */ n("div", {
38
38
  className: "flex flex-col",
39
- children: /* @__PURE__ */ r(a, {
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: n,
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
- //#region src/builder/models/SchemaVariableForm/VariableSubValueActions.tsx
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
- //#region src/builder/models/SchemaVariableForm/VariableValue.tsx
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
- //#region src/builder/models/SchemaVariableForm/index.ts
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
- //#region src/builder/models/StyleVariableForm/StyleVariableForm.tsx
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 };
@@ -1,5 +1,4 @@
1
1
  import e, { styleVariableFormSchema as t } from "./StyleVariableForm.mjs";
2
- //#region src/builder/models/StyleVariableForm/index.ts
2
+ // src/builder/models/StyleVariableForm/index.ts
3
3
  var n = e;
4
- //#endregion
5
4
  export { n as default, t 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
- //#region src/builder/models/index.ts
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.1",
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.36",
33
- "@plitzi/sdk-shared": "0.39.1",
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.4",
42
- "vitest": "^5.0.5"
43
+ "vite": "^8.3.7",
44
+ "vitest": "^5.1.0"
43
45
  },
44
46
  "peerDependencies": {
45
47
  "react": "^19"