@plitzi/sdk-style 0.33.2 → 0.34.1

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 (58) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/BuilderStyleContextProvider.d.ts +11 -2
  3. package/dist/BuilderStyleContextProvider.mjs +76 -54
  4. package/dist/SdkStyleContextProvider.mjs +4 -4
  5. package/dist/StyleAdvanceEditor.mjs +30 -30
  6. package/dist/StyleMap/StyleMap.d.ts +14 -1
  7. package/dist/StyleMap/StyleMap.mjs +24 -2
  8. package/dist/StyleMap/helpers/isValueValid.mjs +1 -1
  9. package/dist/StyleReducer.d.ts +15 -4
  10. package/dist/StyleReducer.mjs +39 -18
  11. package/dist/components/InputEasing/InputEasing.mjs +21 -21
  12. package/dist/components/InputEasing/InputEasingButton.mjs +5 -5
  13. package/dist/components/InputEasing/InputEasingList.mjs +76 -76
  14. package/dist/components/Selector/Selector.mjs +29 -29
  15. package/dist/components/Selector/SelectorItem/ItemOptions.mjs +16 -16
  16. package/dist/components/Selector/SelectorItem/SelectorItem.mjs +10 -10
  17. package/dist/components/StyleInspector/Inspector.mjs +33 -33
  18. package/dist/components/StyleInspector/StyleInspector.mjs +45 -45
  19. package/dist/components/StyleInspector/StyleInspectorProvider.mjs +14 -14
  20. package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +46 -46
  21. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +20 -20
  22. package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +11 -11
  23. package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +20 -20
  24. package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayAlignSelf.mjs +12 -12
  25. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +22 -21
  26. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +66 -65
  27. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +2 -0
  28. package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +18 -0
  29. package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +15 -15
  30. package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +16 -16
  31. package/dist/components/StyleInspector/categories/Spacing/SpacingEditor.mjs +12 -12
  32. package/dist/components/StyleInspector/categories/Spacing/SpacingNumber.mjs +5 -5
  33. package/dist/components/StyleInspector/categories/Typography/Typography.d.ts +1 -5
  34. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +58 -57
  35. package/dist/components/StyleInspector/categories/Typography/TypographyConstants.d.ts +0 -4
  36. package/dist/components/StyleInspector/categories/Typography/TypographyConstants.mjs +2 -160
  37. package/dist/components/StyleInspector/categories/Typography/TypographyFont.d.ts +1 -4
  38. package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +24 -17
  39. package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +15 -15
  40. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +17 -17
  41. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.mjs +8 -8
  42. package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.mjs +4 -4
  43. package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +13 -13
  44. package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +13 -13
  45. package/dist/components/StyleInspector/hooks/useStyleBinding.mjs +12 -12
  46. package/dist/components/StyleInspector/hooks/useStyleInherit.mjs +3 -3
  47. package/dist/components/StyleManager/ManagerSelector.mjs +35 -35
  48. package/dist/components/StyleManager/StyleManager.mjs +12 -12
  49. package/dist/components/StyleManager/StyleSelectorTag.mjs +20 -20
  50. package/dist/helpers/calculateInheriting.mjs +2 -2
  51. package/dist/helpers/generateStyleSelector.mjs +1 -1
  52. package/dist/helpers/processSelectorAttributes.mjs +1 -1
  53. package/dist/hooks/index.d.ts +2 -0
  54. package/dist/hooks/index.mjs +2 -0
  55. package/dist/hooks/useSpaceFonts.d.ts +10 -0
  56. package/dist/hooks/useSpaceFonts.mjs +10 -0
  57. package/dist/index.mjs +16 -16
  58. package/package.json +26 -9
@@ -2,23 +2,23 @@ import { selectorFormatter as e } from "./SelectorHelper.mjs";
2
2
  import t from "./SelectorItem/index.mjs";
3
3
  import n from "./SelectorSuggestions/index.mjs";
4
4
  import r from "../StyleManager/index.mjs";
5
- import { get as i, omit as a, pick as o } from "@plitzi/plitzi-ui/helpers";
6
- import s from "clsx";
7
- import { memo as c, useCallback as l, useMemo as u, useRef as d, useState as f } from "react";
8
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { memo as i, useCallback as a, useMemo as o, useRef as s, useState as c } from "react";
6
+ import { get as l, omit as u, pick as d } from "@plitzi/plitzi-ui/helpers";
7
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import m from "@plitzi/plitzi-ui/Button";
9
9
  import h, { useFloating as g } from "@plitzi/plitzi-ui/ContainerFloating";
10
- import _ from "@plitzi/plitzi-ui/Button";
10
+ import _ from "clsx";
11
11
  import { usePopup as v } from "@plitzi/plitzi-ui/Popup";
12
- var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, componentType: S, disabled: C = !1, onChange: w, onSelectorSelected: T, onAdd: E, onRemove: D }) => {
13
- let O = d(null), [k, A] = f(""), [j, M, , N, P] = g({ disabled: C }), { existsPopup: F, addPopup: I } = v("floating"), L = u(() => Object.values(b ?? {}).find((e) => e.type === "element" && e.componentType === S), [S, b]), R = u(() => Object.values(o(b ?? {}, y.split(" "))).map((e) => o(e, ["name", "type"])), [b, y]), z = u(() => Object.values(a(b ?? {}, y.split(" "))), [b, y]), B = l((e) => {
12
+ var y = i(({ className: i = "", value: y = "", selectors: b, selector: x, componentType: S, disabled: C = !1, onChange: w, onSelectorSelected: T, onAdd: E, onRemove: D }) => {
13
+ let O = s(null), [k, A] = c(""), [j, M, , N, P] = g({ disabled: C }), { existsPopup: F, addPopup: I } = v("floating"), L = o(() => Object.values(b ?? {}).find((e) => e.type === "element" && e.componentType === S), [S, b]), R = o(() => Object.values(d(b ?? {}, y.split(" "))).map((e) => d(e, ["name", "type"])), [b, y]), z = o(() => Object.values(u(b ?? {}, y.split(" "))), [b, y]), B = a((e) => {
14
14
  M(e.target.value.length > 0), A(e.target.value);
15
- }, [M]), V = l(() => {
15
+ }, [M]), V = a(() => {
16
16
  O.current?.focus(), M(k.length > 0);
17
17
  }, [
18
18
  O,
19
19
  k,
20
20
  M
21
- ]), H = l((e) => T?.(e), [T]), U = l((e) => (t, n = !0) => {
21
+ ]), H = a((e) => T?.(e), [T]), U = a((e) => (t, n = !0) => {
22
22
  let r = [...R.filter((t, n) => n !== e), t].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
23
23
  E?.(t, !1), w?.(r), n && T?.(t);
24
24
  }, [
@@ -26,18 +26,18 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
26
26
  E,
27
27
  w,
28
28
  T
29
- ]), W = l((e) => (t, n) => {
29
+ ]), W = a((e) => (t, n) => {
30
30
  switch (t) {
31
31
  case "remove":
32
32
  case "delete": {
33
33
  let n = R.filter((t, n) => n !== e), r = n.reduce((e, t) => `${e} ${t.name}`, "").trim();
34
- x && R[e].name === x.name && T?.(i(n, "0")), w?.(r), t === "delete" && D?.(R[e]);
34
+ x && R[e].name === x.name && T?.(l(n, "0")), w?.(r), t === "delete" && D?.(R[e]);
35
35
  break;
36
36
  }
37
37
  case "duplicate": {
38
38
  if (!n) break;
39
39
  let t = [...R, n].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
40
- E?.(n, !0, i(R, `${e}`)), w?.(t);
40
+ E?.(n, !0, l(R, `${e}`)), w?.(t);
41
41
  break;
42
42
  }
43
43
  }
@@ -48,7 +48,7 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
48
48
  T,
49
49
  E,
50
50
  D
51
- ]), G = l((t) => {
51
+ ]), G = a((t) => {
52
52
  switch (t.key) {
53
53
  case "Enter": {
54
54
  let { value: n } = t.target;
@@ -79,7 +79,7 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
79
79
  w,
80
80
  T,
81
81
  M
82
- ]), K = l((e) => {
82
+ ]), K = a((e) => {
83
83
  setTimeout(() => A(""), 0), M(!1);
84
84
  let t = [...R, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
85
85
  w?.(t), T?.(e);
@@ -88,7 +88,7 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
88
88
  w,
89
89
  T,
90
90
  M
91
- ]), q = l((e) => {
91
+ ]), q = a((e) => {
92
92
  setTimeout(() => A(""), 0), M(!1);
93
93
  let t = [...R, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
94
94
  w?.(t), E?.(e, !1), T?.(e);
@@ -98,9 +98,9 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
98
98
  E,
99
99
  T,
100
100
  M
101
- ]), J = l((e) => {
102
- e.preventDefault(), e.stopPropagation(), F("styleManager") || I("styleManager", /* @__PURE__ */ p(r, {}), {
103
- icon: /* @__PURE__ */ p("i", { className: "fas fa-swatchbook text-base" }),
101
+ ]), J = a((e) => {
102
+ e.preventDefault(), e.stopPropagation(), F("styleManager") || I("styleManager", /* @__PURE__ */ f(r, {}), {
103
+ icon: /* @__PURE__ */ f("i", { className: "fas fa-swatchbook text-base" }),
104
104
  title: "Style Manager",
105
105
  resizeHandles: ["se"],
106
106
  allowLeftSide: !0,
@@ -108,30 +108,30 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
108
108
  placement: "floating",
109
109
  width: 600
110
110
  });
111
- }, [I, F]), Y = u(() => ({ width: P?.width }), [P]), X = L ? [L, ...R] : R;
112
- return /* @__PURE__ */ m(h, {
111
+ }, [I, F]), Y = o(() => ({ width: P?.width }), [P]), X = L ? [L, ...R] : R;
112
+ return /* @__PURE__ */ p(h, {
113
113
  ref: N,
114
114
  className: "w-full",
115
115
  open: j,
116
- children: [/* @__PURE__ */ p(h.Trigger, {
116
+ children: [/* @__PURE__ */ f(h.Trigger, {
117
117
  className: "w-full",
118
- children: /* @__PURE__ */ m("div", {
119
- className: s("bg-grayviolet-200 relative flex flex-wrap gap-1 rounded-sm p-1 dark:bg-zinc-800", c, {
118
+ children: /* @__PURE__ */ p("div", {
119
+ className: _("bg-grayviolet-200 relative flex flex-wrap gap-1 rounded-sm p-1 dark:bg-zinc-800", i, {
120
120
  "pointer-events-none cursor-not-allowed bg-gray-100 dark:bg-zinc-900": C,
121
121
  "cursor-pointer": !C
122
122
  }),
123
123
  onClick: V,
124
124
  onKeyDown: G,
125
125
  children: [
126
- /* @__PURE__ */ p(_, {
126
+ /* @__PURE__ */ f(m, {
127
127
  intent: "secondary",
128
128
  size: "custom",
129
129
  onClick: J,
130
130
  className: "h-7 w-7 rounded-sm bg-white dark:bg-zinc-700 dark:text-zinc-200",
131
131
  title: "Style Manager",
132
- children: /* @__PURE__ */ p(_.Icon, { icon: "fas fa-swatchbook" })
132
+ children: /* @__PURE__ */ f(m.Icon, { icon: "fas fa-swatchbook" })
133
133
  }),
134
- X.map((e, n) => /* @__PURE__ */ p(t, {
134
+ X.map((e, n) => /* @__PURE__ */ f(t, {
135
135
  selector: e.name,
136
136
  type: e.type,
137
137
  editable: e.type !== "element",
@@ -140,7 +140,7 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
140
140
  onClick: H,
141
141
  onChange: U(L ? n - 1 : n)
142
142
  }, `${n}_${e.name}`)),
143
- /* @__PURE__ */ p("input", {
143
+ /* @__PURE__ */ f("input", {
144
144
  ref: O,
145
145
  className: "flex min-h-0 w-0 border-none bg-transparent px-1 py-0 text-xs text-inherit outline-hidden focus:min-w-[50px] focus:grow focus:ring-transparent",
146
146
  autoComplete: "off",
@@ -152,9 +152,9 @@ var y = c(({ className: c = "", value: y = "", selectors: b, selector: x, compon
152
152
  })
153
153
  ]
154
154
  })
155
- }), /* @__PURE__ */ p(h.Content, {
155
+ }), /* @__PURE__ */ f(h.Content, {
156
156
  style: Y,
157
- children: /* @__PURE__ */ p(n, {
157
+ children: /* @__PURE__ */ f(n, {
158
158
  selector: k,
159
159
  selectors: z,
160
160
  onSelect: K,
@@ -1,49 +1,49 @@
1
1
  import { useCallback as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import r from "@plitzi/plitzi-ui/ContainerFloating";
4
- import i from "@plitzi/plitzi-ui/Icon";
5
- import a, { useModal as o } from "@plitzi/plitzi-ui/Modal";
6
- import { makeId as s } from "@plitzi/sdk-shared/helpers/utils";
2
+ import { makeId as t } from "@plitzi/sdk-shared/helpers/utils";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import i from "@plitzi/plitzi-ui/ContainerFloating";
5
+ import a from "@plitzi/plitzi-ui/Icon";
6
+ import o, { useModal as s } from "@plitzi/plitzi-ui/Modal";
7
7
  //#region src/components/Selector/SelectorItem/ItemOptions.tsx
8
8
  var c = ({ selector: c = "", type: l = "class", onAction: u }) => {
9
- let { showDialog: d } = o(), f = e(() => u?.("duplicate", {
10
- name: `${c}-${s(4)}`,
9
+ let { showDialog: d } = s(), f = e(() => u?.("duplicate", {
10
+ name: `${c}-${t(4)}`,
11
11
  type: l
12
12
  }), [
13
13
  u,
14
14
  c,
15
15
  l
16
16
  ]), p = e(() => u?.("remove"), [u]), m = e(async () => {
17
- await d(/* @__PURE__ */ t(a.Header, { children: /* @__PURE__ */ t("h4", { children: "Remove Selector" }) }), /* @__PURE__ */ t(a.Body, { children: /* @__PURE__ */ t("h4", { children: "Do you want to remove this item ?" }) }), void 0, { size: "sm" }, c) && u?.("delete");
17
+ await d(/* @__PURE__ */ n(o.Header, { children: /* @__PURE__ */ n("h4", { children: "Remove Selector" }) }), /* @__PURE__ */ n(o.Body, { children: /* @__PURE__ */ n("h4", { children: "Do you want to remove this item ?" }) }), void 0, { size: "sm" }, c) && u?.("delete");
18
18
  }, [
19
19
  u,
20
20
  c,
21
21
  d
22
22
  ]);
23
- return /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ t(r.Trigger, { children: /* @__PURE__ */ t(i, {
23
+ return /* @__PURE__ */ r(i, { children: [/* @__PURE__ */ n(i.Trigger, { children: /* @__PURE__ */ n(a, {
24
24
  icon: "fa-solid fa-ellipsis-vertical",
25
25
  className: "h-4 w-4 !min-w-4"
26
- }) }), /* @__PURE__ */ t(r.Content, {
26
+ }) }), /* @__PURE__ */ n(i.Content, {
27
27
  className: "text-xs text-zinc-700 dark:text-zinc-300",
28
- children: /* @__PURE__ */ n("div", {
28
+ children: /* @__PURE__ */ r("div", {
29
29
  className: "rounded border border-gray-200 bg-gray-50 py-1 dark:border-zinc-700 dark:bg-zinc-800",
30
- children: [/* @__PURE__ */ t("div", {
30
+ children: [/* @__PURE__ */ n("div", {
31
31
  className: "mb-1 px-2 font-bold text-zinc-800 dark:text-zinc-200",
32
32
  children: "Actions"
33
- }), /* @__PURE__ */ n("ul", {
33
+ }), /* @__PURE__ */ r("ul", {
34
34
  className: "flex flex-col gap-1 px-2",
35
35
  children: [
36
- /* @__PURE__ */ t("li", {
36
+ /* @__PURE__ */ n("li", {
37
37
  onClick: f,
38
38
  className: "cursor-pointer rounded-sm px-2 py-1 hover:bg-gray-200 dark:hover:bg-zinc-700",
39
39
  children: "Duplicate"
40
40
  }),
41
- /* @__PURE__ */ t("li", {
41
+ /* @__PURE__ */ n("li", {
42
42
  onClick: p,
43
43
  className: "cursor-pointer rounded-sm px-2 py-1 hover:bg-gray-200 dark:hover:bg-zinc-700",
44
44
  children: "Remove"
45
45
  }),
46
- /* @__PURE__ */ t("li", {
46
+ /* @__PURE__ */ n("li", {
47
47
  onClick: m,
48
48
  className: "cursor-pointer rounded-sm px-2 py-1 text-red-400 hover:bg-gray-200 dark:hover:bg-zinc-700",
49
49
  children: "Delete"
@@ -1,12 +1,12 @@
1
1
  import { selectorFormatter as e } from "../SelectorHelper.mjs";
2
2
  import t from "./ItemOptions.mjs";
3
- import n from "clsx";
4
- import { useCallback as r } from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ import { useCallback as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import a from "clsx";
6
6
  import o from "@plitzi/plitzi-ui/ContentEditable";
7
7
  //#region src/components/Selector/SelectorItem/SelectorItem.tsx
8
8
  var s = ({ className: s = "", selector: c = "", type: l = "class", editable: u = !0, active: d = !1, readOnly: f = !1, onClick: p, onChange: m, onAction: h }) => {
9
- let g = r((e) => {
9
+ let g = n((e) => {
10
10
  e.preventDefault(), f || e.stopPropagation(), p?.({
11
11
  name: c,
12
12
  type: l
@@ -16,14 +16,14 @@ var s = ({ className: s = "", selector: c = "", type: l = "class", editable: u =
16
16
  f,
17
17
  c,
18
18
  l
19
- ]), _ = r((t) => {
19
+ ]), _ = n((t) => {
20
20
  m?.({
21
21
  name: e(t),
22
22
  type: l
23
23
  });
24
24
  }, [l, m]);
25
- return /* @__PURE__ */ a("div", {
26
- className: n("relative flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-white select-none", s, {
25
+ return /* @__PURE__ */ i("div", {
26
+ className: a("relative flex cursor-pointer items-center gap-1 rounded-sm px-2 py-1 text-white select-none", s, {
27
27
  "bg-primary-400": l === "element" && d,
28
28
  "bg-secondary-400": l !== "element" && d,
29
29
  "bg-gray-500": !d,
@@ -31,15 +31,15 @@ var s = ({ className: s = "", selector: c = "", type: l = "class", editable: u =
31
31
  }),
32
32
  onClick: g,
33
33
  title: `${l}: ${c}`,
34
- children: [/* @__PURE__ */ a("div", {
34
+ children: [/* @__PURE__ */ i("div", {
35
35
  className: "flex min-w-0 grow basis-0 text-xs",
36
- children: [u && /* @__PURE__ */ i(o, {
36
+ children: [u && /* @__PURE__ */ r(o, {
37
37
  className: "inline text-nowrap focus-visible:m-[1px] focus-visible:px-1 focus-visible:outline-1 focus-visible:outline-dashed",
38
38
  value: c,
39
39
  openMode: "doubleClick",
40
40
  onChange: _
41
41
  }), !u && c]
42
- }), u && l !== "element" && /* @__PURE__ */ i(t, {
42
+ }), u && l !== "element" && /* @__PURE__ */ r(t, {
43
43
  selector: c,
44
44
  type: l,
45
45
  onAction: h
@@ -15,16 +15,16 @@ import p from "./categories/Typography/index.mjs";
15
15
  import m from "./categories/Variables/index.mjs";
16
16
  import h from "./hooks/useStyleInherit.mjs";
17
17
  import g from "./StyleInspectorProvider.mjs";
18
- import { get as _, set as v } from "@plitzi/plitzi-ui/helpers";
19
- import { use as y, useCallback as b, useMemo as x } from "react";
20
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
21
- import { produce as w } from "immer";
18
+ import { use as _, useCallback as v, useMemo as y } from "react";
19
+ import { get as b, set as x } from "@plitzi/plitzi-ui/helpers";
20
+ import { produce as S } from "immer";
21
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
22
22
  import T from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
23
23
  import E from "@plitzi/plitzi-ui/hooks/useStorage";
24
24
  import D from "@plitzi/plitzi-ui/Switch";
25
25
  //#region src/components/StyleInspector/Inspector.tsx
26
26
  var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, styleState: M, styleVariant: N, styleSelector: P = "base", element: F, displayMode: I, mode: L = "element" }) => {
27
- let { builderHandler: R } = y(T), [z, B] = E(`builder-state.styleInspector.${L}.collapsedCache`, {}), [V, H] = E(`builder-state.styleInspector.${L}.showAllOptions`, !1), [U, W] = E(`builder-state.styleInspector.${L}.replaceTokens`, !1), G = h({
27
+ let { builderHandler: R } = _(T), [z, B] = E(`builder-state.styleInspector.${L}.collapsedCache`, {}), [V, H] = E(`builder-state.styleInspector.${L}.showAllOptions`, !1), [U, W] = E(`builder-state.styleInspector.${L}.replaceTokens`, !1), G = h({
28
28
  element: F,
29
29
  componentType: k,
30
30
  componentSubType: A,
@@ -32,10 +32,10 @@ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, sty
32
32
  styleSelector: P,
33
33
  styleState: M,
34
34
  styleVariant: N
35
- }), K = b((e, t) => B((n) => ({
35
+ }), K = v((e, t) => B((n) => ({
36
36
  ...n,
37
37
  [e]: t
38
- })), [B]), q = b((e) => H(e.target.checked), [H]), J = b((e) => W(e.target.checked), [W]), Y = b((t, n) => {
38
+ })), [B]), q = v((e) => H(e.target.checked), [H]), J = v((e) => W(e.target.checked), [W]), Y = v((t, n) => {
39
39
  if (j) {
40
40
  R("styleUpdateSelector", I, j.name, t, n, {
41
41
  componentType: j.type === "element" ? k : void 0,
@@ -52,9 +52,9 @@ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, sty
52
52
  styleState: M,
53
53
  styleVariant: N
54
54
  }), !F) return;
55
- let i = _(F, `definition.styleSelectors.${P}`);
56
- R("schemaUpdateElement", w(F, (e) => {
57
- i ? v(e, `definition.styleSelectors.${P}`, `${i} ${r}`) : v(e, `definition.styleSelectors.${P}`, r);
55
+ let i = b(F, `definition.styleSelectors.${P}`);
56
+ R("schemaUpdateElement", S(F, (e) => {
57
+ i ? x(e, `definition.styleSelectors.${P}`, `${i} ${r}`) : x(e, `definition.styleSelectors.${P}`, r);
58
58
  }));
59
59
  }, [
60
60
  R,
@@ -65,19 +65,19 @@ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, sty
65
65
  P,
66
66
  M,
67
67
  N
68
- ]), X = x(() => {
68
+ ]), X = y(() => {
69
69
  let e = F?.definition.type;
70
70
  return V || L === "manager" || e === "list" || e === "listItem";
71
71
  }, [
72
72
  F?.definition.type,
73
73
  L,
74
74
  V
75
- ]), Z = x(() => V || L === "manager" || _(G, "parentStyle.display", "block") === "flex", [
75
+ ]), Z = y(() => V || L === "manager" || b(G, "parentStyle.display", "block") === "flex", [
76
76
  G,
77
77
  L,
78
78
  V
79
- ]), Q = x(() => _(G, "parentStyle.flex-direction", "row") === "column", [G]);
80
- return /* @__PURE__ */ S(g, {
79
+ ]), Q = y(() => b(G, "parentStyle.flex-direction", "row") === "column", [G]);
80
+ return /* @__PURE__ */ C(g, {
81
81
  componentType: k,
82
82
  displayMode: I,
83
83
  styleSelector: P,
@@ -87,90 +87,90 @@ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, sty
87
87
  element: F,
88
88
  inheritData: G,
89
89
  onChange: Y,
90
- children: /* @__PURE__ */ C("div", {
90
+ children: /* @__PURE__ */ w("div", {
91
91
  className: "flex grow flex-col justify-between",
92
- children: [/* @__PURE__ */ C("div", {
92
+ children: [/* @__PURE__ */ w("div", {
93
93
  className: "flex grow flex-col",
94
94
  children: [
95
- X && /* @__PURE__ */ S(o, {
95
+ X && /* @__PURE__ */ C(o, {
96
96
  replaceTokens: U,
97
97
  isCollapsed: z.list ?? !0,
98
98
  onCollapse: K
99
99
  }),
100
- X && /* @__PURE__ */ S(s, {
100
+ X && /* @__PURE__ */ C(s, {
101
101
  replaceTokens: U,
102
102
  isCollapsed: z.listItem ?? !0,
103
103
  onCollapse: K
104
104
  }),
105
- /* @__PURE__ */ S(r, {
105
+ /* @__PURE__ */ C(r, {
106
106
  replaceTokens: U,
107
107
  isCollapsed: z.display ?? !0,
108
108
  onCollapse: K
109
109
  }),
110
- Z && /* @__PURE__ */ S(i, {
110
+ Z && /* @__PURE__ */ C(i, {
111
111
  replaceTokens: U,
112
112
  isCollapsed: z.displayFlexChild ?? !0,
113
113
  isFlexVertical: Q,
114
114
  onCollapse: K
115
115
  }),
116
- /* @__PURE__ */ S(f, {
116
+ /* @__PURE__ */ C(f, {
117
117
  replaceTokens: U,
118
118
  isCollapsed: z.spacing ?? !0,
119
119
  onCollapse: K
120
120
  }),
121
- /* @__PURE__ */ S(d, {
121
+ /* @__PURE__ */ C(d, {
122
122
  replaceTokens: U,
123
123
  isCollapsed: z.size ?? !0,
124
124
  onCollapse: K
125
125
  }),
126
- /* @__PURE__ */ S(l, {
126
+ /* @__PURE__ */ C(l, {
127
127
  replaceTokens: U,
128
128
  isCollapsed: z.position ?? !0,
129
129
  onCollapse: K
130
130
  }),
131
- /* @__PURE__ */ S(p, {
131
+ /* @__PURE__ */ C(p, {
132
132
  replaceTokens: U,
133
133
  isCollapsed: z.typography ?? !0,
134
134
  onCollapse: K
135
135
  }),
136
- /* @__PURE__ */ S(t, {
136
+ /* @__PURE__ */ C(t, {
137
137
  replaceTokens: U,
138
138
  isCollapsed: z.background ?? !0,
139
139
  onCollapse: K
140
140
  }),
141
- /* @__PURE__ */ S(n, {
141
+ /* @__PURE__ */ C(n, {
142
142
  replaceTokens: U,
143
143
  isCollapsed: z.border ?? !0,
144
144
  onCollapse: K
145
145
  }),
146
- /* @__PURE__ */ S(a, {
146
+ /* @__PURE__ */ C(a, {
147
147
  replaceTokens: U,
148
148
  isCollapsed: z.effects ?? !0,
149
149
  onCollapse: K
150
150
  }),
151
- /* @__PURE__ */ S(c, {
151
+ /* @__PURE__ */ C(c, {
152
152
  replaceTokens: U,
153
153
  isCollapsed: z.others ?? !0,
154
154
  onCollapse: K
155
155
  }),
156
- /* @__PURE__ */ S(m, {
156
+ /* @__PURE__ */ C(m, {
157
157
  isCollapsed: z.variables ?? !0,
158
158
  onCollapse: K
159
159
  }),
160
- /* @__PURE__ */ S(u, {
160
+ /* @__PURE__ */ C(u, {
161
161
  isCollapsed: z.rawStyle ?? !0,
162
162
  selectors: O,
163
163
  onCollapse: K
164
164
  })
165
165
  ]
166
- }), /* @__PURE__ */ C("div", {
166
+ }), /* @__PURE__ */ w("div", {
167
167
  className: "flex items-center justify-end gap-4 border-t border-gray-200 px-2 py-1 dark:border-zinc-700",
168
- children: [/* @__PURE__ */ S(D, {
168
+ children: [/* @__PURE__ */ C(D, {
169
169
  size: "xs",
170
170
  label: "Replace Tokens",
171
171
  checked: U,
172
172
  onChange: J
173
- }), L === "element" && /* @__PURE__ */ S(D, {
173
+ }), L === "element" && /* @__PURE__ */ C(D, {
174
174
  size: "xs",
175
175
  label: "Show All Options",
176
176
  checked: V,
@@ -1,35 +1,35 @@
1
- import e from "./Inspector.mjs";
2
- import t from "../Selector/index.mjs";
3
- import { get as n, pick as r, set as i } from "@plitzi/plitzi-ui/helpers";
4
- import { clsx as a } from "clsx";
5
- import { use as o, useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
6
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { useBuilderStoreSync as p } from "@plitzi/sdk-shared/store";
8
- import { produce as m } from "immer";
1
+ import e from "../Selector/index.mjs";
2
+ import t from "./Inspector.mjs";
3
+ import { use as n, useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
4
+ import { useBuilderStoreSync as s } from "@plitzi/sdk-shared/store";
5
+ import { get as c, pick as l, set as u } from "@plitzi/plitzi-ui/helpers";
6
+ import { produce as d } from "immer";
7
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import { clsx as m } from "clsx";
9
9
  import h from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
10
10
  import g from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
11
11
  import _ from "@plitzi/plitzi-ui/Select";
12
12
  import v from "@plitzi/plitzi-ui/Select2";
13
13
  //#region src/components/StyleInspector/StyleInspector.tsx
14
14
  var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "element", componentType: w, styleSelectors: T, styleSelectorsAvailables: E, componentSubTypesAvailables: D, allowStyleSelector: O = !0, allowStyleState: k = !0, allowStyleVariant: A = !0, onChange: j, onRemoveVariant: M }) => {
15
- let [N, P] = u(void 0), [F, I] = u("base"), [L, R] = u(void 0), [z, B] = u(void 0);
16
- p("styleSelector", F, { enabled: C === "element" }), p("styleVariant", L, { enabled: C === "element" }), p("styleState", z, { enabled: C === "element" });
17
- let { builderHandler: V } = o(h), H = l(() => n(T, F, ""), [T, F]), U = l(() => Object.values(r(b ?? {}, S ? [S.definition.type, ...H.split(" ")] : H.split(" "))), [
15
+ let [N, P] = o(void 0), [F, I] = o("base"), [L, R] = o(void 0), [z, B] = o(void 0);
16
+ s("styleSelector", F, { enabled: C === "element" }), s("styleVariant", L, { enabled: C === "element" }), s("styleState", z, { enabled: C === "element" });
17
+ let { builderHandler: V } = n(h), H = a(() => c(T, F, ""), [T, F]), U = a(() => Object.values(l(b ?? {}, S ? [S.definition.type, ...H.split(" ")] : H.split(" "))), [
18
18
  b,
19
19
  S,
20
20
  H
21
- ]), W = l(() => x ? n(b, x) : void 0, [b, x]), G = l(() => Object.keys(W?.attributes[F]?.variants ?? {}).map((e) => ({
21
+ ]), W = a(() => x ? c(b, x) : void 0, [b, x]), G = a(() => Object.keys(W?.attributes[F]?.variants ?? {}).map((e) => ({
22
22
  label: e,
23
23
  value: e
24
24
  })), [W?.attributes, F]);
25
- c(() => {
25
+ i(() => {
26
26
  if (I("base"), C !== "element") return;
27
- let e = n(T, "base", "").split(" "), t = e[e.length - 1];
27
+ let e = c(T, "base", "").split(" "), t = e[e.length - 1];
28
28
  j?.(t || ""), B(void 0), P(void 0);
29
29
  }, [j, T]), g(() => {
30
30
  if (C === "element") {
31
31
  if (x !== S?.definition.type) {
32
- let e = n(T, F, "").split(" ");
32
+ let e = c(T, F, "").split(" ");
33
33
  j?.(e[e.length - 1]);
34
34
  }
35
35
  B(void 0), R(void 0), P(void 0);
@@ -37,15 +37,15 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
37
37
  }, [F]), g(() => {
38
38
  B(void 0), R(void 0), P(void 0);
39
39
  }, [x]);
40
- let K = s((e, t, r) => {
41
- if (t && !r) return;
42
- let { name: i, type: a } = e;
43
- !t && i !== "" && !b?.[i] ? V("styleAddSelector", y, i, a, void 0, void 0, {
40
+ let K = r((e, t, n) => {
41
+ if (t && !n) return;
42
+ let { name: r, type: i } = e;
43
+ !t && r !== "" && !b?.[r] ? V("styleAddSelector", y, r, i, void 0, void 0, {
44
44
  styleSelector: F,
45
- componentType: a === "element" ? w : void 0
46
- }) : t && r && r.name !== i && b?.[r.name] && !b[i] && V("styleAddSelector", y, i, a, void 0, n(b, `${r.name}.attributes`, {}), {
45
+ componentType: i === "element" ? w : void 0
46
+ }) : t && n && n.name !== r && b?.[n.name] && !b[r] && V("styleAddSelector", y, r, i, void 0, c(b, `${n.name}.attributes.${F}.default`, {}), {
47
47
  styleSelector: F,
48
- componentType: a === "element" ? w : void 0
48
+ componentType: i === "element" ? w : void 0
49
49
  });
50
50
  }, [
51
51
  V,
@@ -53,27 +53,27 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
53
53
  y,
54
54
  b,
55
55
  F
56
- ]), q = s((e) => {
56
+ ]), q = r((e) => {
57
57
  if (!e || x && x === e.name) {
58
58
  j?.(void 0);
59
59
  return;
60
60
  }
61
61
  j?.(e.name);
62
- }, [j, x]), J = s((e) => {
63
- S && V("schemaUpdateElement", m(S, (t) => {
64
- i(t, `definition.styleSelectors.${F}`, e);
62
+ }, [j, x]), J = r((e) => {
63
+ S && V("schemaUpdateElement", d(S, (t) => {
64
+ u(t, `definition.styleSelectors.${F}`, e);
65
65
  }));
66
66
  }, [
67
67
  S,
68
68
  V,
69
69
  F
70
- ]), Y = s((e) => {
70
+ ]), Y = r((e) => {
71
71
  V("styleRemoveSelector", y, e.name);
72
- }, [V, y]), X = s((e) => P(e), []), Z = s((e) => {
72
+ }, [V, y]), X = r((e) => P(e), []), Z = r((e) => {
73
73
  I(e);
74
- }, []), Q = s((e) => B(e?.value), []), $ = s((e) => {
74
+ }, []), Q = r((e) => B(e?.value), []), $ = r((e) => {
75
75
  R(e?.value);
76
- }, []), ee = s((e) => {
76
+ }, []), ee = r((e) => {
77
77
  M?.(e.value), z && B(void 0), e.value === L && R(void 0), V("styleUpdateSelector", y, W?.name, void 0, void 0, {
78
78
  styleSelector: F,
79
79
  styleVariant: e.value,
@@ -90,11 +90,11 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
90
90
  z,
91
91
  L
92
92
  ]), te = O && (A || k || !!E?.length || !!D?.length);
93
- return /* @__PURE__ */ f("div", {
93
+ return /* @__PURE__ */ p("div", {
94
94
  className: "flex w-full grow flex-col gap-2",
95
- children: [/* @__PURE__ */ f("div", {
95
+ children: [/* @__PURE__ */ p("div", {
96
96
  className: "flex w-full flex-col gap-2 px-1",
97
- children: [C === "element" && /* @__PURE__ */ d(t, {
97
+ children: [C === "element" && /* @__PURE__ */ f(e, {
98
98
  className: "min-h-0 w-full",
99
99
  value: H,
100
100
  selectors: b,
@@ -104,32 +104,32 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
104
104
  onChange: J,
105
105
  onRemove: Y,
106
106
  onSelectorSelected: q
107
- }), te && /* @__PURE__ */ f("div", {
108
- className: a("flex w-full items-center gap-2", { "mt-2": C === "manager" }),
107
+ }), te && /* @__PURE__ */ p("div", {
108
+ className: m("flex w-full items-center gap-2", { "mt-2": C === "manager" }),
109
109
  children: [
110
- !!D?.length && /* @__PURE__ */ d(_, {
110
+ !!D?.length && /* @__PURE__ */ f(_, {
111
111
  className: "grow basis-0",
112
112
  size: "xs",
113
113
  value: N,
114
114
  onChange: X,
115
- children: D.map((e) => /* @__PURE__ */ d("option", {
115
+ children: D.map((e) => /* @__PURE__ */ f("option", {
116
116
  value: e,
117
117
  children: e
118
118
  }, e))
119
119
  }),
120
- E && E.length > 1 && /* @__PURE__ */ d(_, {
120
+ E && E.length > 1 && /* @__PURE__ */ f(_, {
121
121
  className: "grow basis-0",
122
122
  size: "xs",
123
123
  onChange: Z,
124
124
  value: F,
125
- children: E.map((e) => /* @__PURE__ */ d("option", {
125
+ children: E.map((e) => /* @__PURE__ */ f("option", {
126
126
  value: e,
127
127
  children: e
128
128
  }, e))
129
129
  }),
130
- A && /* @__PURE__ */ d("div", {
130
+ A && /* @__PURE__ */ f("div", {
131
131
  className: "grow basis-0",
132
- children: /* @__PURE__ */ d(v, {
132
+ children: /* @__PURE__ */ f(v, {
133
133
  className: "grow basis-0",
134
134
  value: L,
135
135
  options: G,
@@ -142,9 +142,9 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
142
142
  onRemove: ee
143
143
  })
144
144
  }),
145
- k && /* @__PURE__ */ d("div", {
145
+ k && /* @__PURE__ */ f("div", {
146
146
  className: "grow basis-0",
147
- children: /* @__PURE__ */ d(v, {
147
+ children: /* @__PURE__ */ f(v, {
148
148
  className: "grow basis-0",
149
149
  value: z,
150
150
  options: [
@@ -181,9 +181,9 @@ var y = ({ displayMode: y, selectors: b, value: x, element: S, mode: C = "elemen
181
181
  })
182
182
  ]
183
183
  })]
184
- }), /* @__PURE__ */ d("div", {
184
+ }), /* @__PURE__ */ f("div", {
185
185
  className: "flex grow basis-0 flex-col overflow-auto border-t border-gray-300 dark:border-zinc-700",
186
- children: /* @__PURE__ */ d(e, {
186
+ children: /* @__PURE__ */ f(t, {
187
187
  selectors: U,
188
188
  componentType: w,
189
189
  selector: W,