@plitzi/sdk-style 0.38.5 → 0.38.7

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.
@@ -23,149 +23,159 @@ 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
- var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, styleState: M, styleVariant: N, styleAncestor: P, styleSelector: F = "base", element: I, displayMode: L, mode: R = "element" }) => {
27
- let { builderHandler: z } = _(T), [B, V] = E(`builder-state.styleInspector.${R}.collapsedCache`, {}), [H, U] = E(`builder-state.styleInspector.${R}.showAllOptions`, !1), [W, G] = E(`builder-state.styleInspector.${R}.replaceTokens`, !1), K = h({
28
- element: I,
26
+ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, styleState: M, styleVariant: N, styleAncestor: P, stylePseudo: F, styleCondition: I, styleSelector: L = "base", element: R, displayMode: z, mode: B = "element" }) => {
27
+ let { builderHandler: V } = _(T), [H, U] = E(`builder-state.styleInspector.${B}.collapsedCache`, {}), [W, G] = E(`builder-state.styleInspector.${B}.showAllOptions`, !1), [K, q] = E(`builder-state.styleInspector.${B}.replaceTokens`, !1), J = h({
28
+ element: R,
29
29
  componentType: k,
30
30
  componentSubType: A,
31
31
  selector: j?.name,
32
- styleSelector: F,
32
+ styleSelector: L,
33
33
  styleState: M,
34
34
  styleVariant: N,
35
- styleAncestor: P
36
- }), q = v((e, t) => V((n) => ({
35
+ styleAncestor: P,
36
+ stylePseudo: F,
37
+ styleCondition: I
38
+ }), Y = v((e, t) => U((n) => ({
37
39
  ...n,
38
40
  [e]: t
39
- })), [V]), J = v((e) => U(e.target.checked), [U]), Y = v((e) => G(e.target.checked), [G]), X = v((t, n) => {
41
+ })), [U]), X = v((e) => G(e.target.checked), [G]), Z = v((e) => q(e.target.checked), [q]), Q = v((t, n) => {
40
42
  if (j) {
41
- z("styleUpdateSelector", L, j.name, t, n, {
43
+ V("styleUpdateSelector", z, j.name, t, n, {
42
44
  componentType: j.type === "element" ? k : void 0,
43
- styleSelector: F,
45
+ styleSelector: L,
44
46
  styleState: M,
45
47
  styleVariant: N,
46
- styleAncestor: P
48
+ styleAncestor: P,
49
+ stylePseudo: F,
50
+ styleCondition: I
47
51
  });
48
52
  return;
49
53
  }
50
54
  if (!k) return;
51
- let r = e(k, F);
52
- if (z("styleAddSelector", L, r, "class", t, n, {
53
- styleSelector: F,
55
+ let r = e(k, L);
56
+ if (V("styleAddSelector", z, r, "class", t, n, {
57
+ styleSelector: L,
54
58
  styleState: M,
55
59
  styleVariant: N,
56
- styleAncestor: P
57
- }), !I) return;
58
- let i = b(I, `definition.styleSelectors.${F}`);
59
- z("schemaUpdateElement", S(I, (e) => {
60
- i ? x(e, `definition.styleSelectors.${F}`, `${i} ${r}`) : x(e, `definition.styleSelectors.${F}`, r);
60
+ styleAncestor: P,
61
+ stylePseudo: F,
62
+ styleCondition: I
63
+ }), !R) return;
64
+ let i = b(R, `definition.styleSelectors.${L}`);
65
+ V("schemaUpdateElement", S(R, (e) => {
66
+ i ? x(e, `definition.styleSelectors.${L}`, `${i} ${r}`) : x(e, `definition.styleSelectors.${L}`, r);
61
67
  }));
62
68
  }, [
63
- z,
69
+ V,
64
70
  k,
65
- L,
66
- I,
71
+ z,
72
+ R,
67
73
  j,
68
- F,
74
+ L,
69
75
  M,
70
76
  N,
71
- P
72
- ]), Z = y(() => {
73
- let e = I?.definition.type;
74
- return H || R === "manager" || e === "list" || e === "listItem";
77
+ P,
78
+ F,
79
+ I
80
+ ]), $ = y(() => {
81
+ let e = R?.definition.type;
82
+ return W || B === "manager" || e === "list" || e === "listItem";
75
83
  }, [
76
- I?.definition.type,
77
- R,
78
- H
79
- ]), Q = y(() => H || R === "manager" || b(K, "parentStyle.display", "block") === "flex", [
80
- K,
81
- R,
82
- H
83
- ]), $ = y(() => b(K, "parentStyle.flex-direction", "row") === "column", [K]);
84
+ R?.definition.type,
85
+ B,
86
+ W
87
+ ]), ee = y(() => W || B === "manager" || b(J, "parentStyle.display", "block") === "flex", [
88
+ J,
89
+ B,
90
+ W
91
+ ]), te = y(() => b(J, "parentStyle.flex-direction", "row") === "column", [J]);
84
92
  return /* @__PURE__ */ C(g, {
85
93
  componentType: k,
86
- displayMode: L,
87
- styleSelector: F,
94
+ displayMode: z,
95
+ styleSelector: L,
88
96
  styleState: M,
89
97
  styleVariant: N,
90
98
  styleAncestor: P,
99
+ stylePseudo: F,
100
+ styleCondition: I,
91
101
  selector: j,
92
- element: I,
93
- inheritData: K,
94
- onChange: X,
102
+ element: R,
103
+ inheritData: J,
104
+ onChange: Q,
95
105
  children: /* @__PURE__ */ w("div", {
96
106
  className: "flex grow flex-col justify-between",
97
107
  children: [/* @__PURE__ */ w("div", {
98
108
  className: "flex grow flex-col",
99
109
  children: [
100
- Z && /* @__PURE__ */ C(o, {
101
- replaceTokens: W,
102
- isCollapsed: B.list ?? !0,
103
- onCollapse: q
110
+ $ && /* @__PURE__ */ C(o, {
111
+ replaceTokens: K,
112
+ isCollapsed: H.list ?? !0,
113
+ onCollapse: Y
104
114
  }),
105
- Z && /* @__PURE__ */ C(s, {
106
- replaceTokens: W,
107
- isCollapsed: B.listItem ?? !0,
108
- onCollapse: q
115
+ $ && /* @__PURE__ */ C(s, {
116
+ replaceTokens: K,
117
+ isCollapsed: H.listItem ?? !0,
118
+ onCollapse: Y
109
119
  }),
110
120
  /* @__PURE__ */ C(r, {
111
- replaceTokens: W,
112
- isCollapsed: B.display ?? !0,
113
- onCollapse: q
121
+ replaceTokens: K,
122
+ isCollapsed: H.display ?? !0,
123
+ onCollapse: Y
114
124
  }),
115
- Q && /* @__PURE__ */ C(i, {
116
- replaceTokens: W,
117
- isCollapsed: B.displayFlexChild ?? !0,
118
- isFlexVertical: $,
119
- onCollapse: q
125
+ ee && /* @__PURE__ */ C(i, {
126
+ replaceTokens: K,
127
+ isCollapsed: H.displayFlexChild ?? !0,
128
+ isFlexVertical: te,
129
+ onCollapse: Y
120
130
  }),
121
131
  /* @__PURE__ */ C(f, {
122
- replaceTokens: W,
123
- isCollapsed: B.spacing ?? !0,
124
- onCollapse: q
132
+ replaceTokens: K,
133
+ isCollapsed: H.spacing ?? !0,
134
+ onCollapse: Y
125
135
  }),
126
136
  /* @__PURE__ */ C(d, {
127
- replaceTokens: W,
128
- isCollapsed: B.size ?? !0,
129
- onCollapse: q
137
+ replaceTokens: K,
138
+ isCollapsed: H.size ?? !0,
139
+ onCollapse: Y
130
140
  }),
131
141
  /* @__PURE__ */ C(l, {
132
- replaceTokens: W,
133
- isCollapsed: B.position ?? !0,
134
- onCollapse: q
142
+ replaceTokens: K,
143
+ isCollapsed: H.position ?? !0,
144
+ onCollapse: Y
135
145
  }),
136
146
  /* @__PURE__ */ C(p, {
137
- replaceTokens: W,
138
- isCollapsed: B.typography ?? !0,
139
- onCollapse: q
147
+ replaceTokens: K,
148
+ isCollapsed: H.typography ?? !0,
149
+ onCollapse: Y
140
150
  }),
141
151
  /* @__PURE__ */ C(t, {
142
- replaceTokens: W,
143
- isCollapsed: B.background ?? !0,
144
- onCollapse: q
152
+ replaceTokens: K,
153
+ isCollapsed: H.background ?? !0,
154
+ onCollapse: Y
145
155
  }),
146
156
  /* @__PURE__ */ C(n, {
147
- replaceTokens: W,
148
- isCollapsed: B.border ?? !0,
149
- onCollapse: q
157
+ replaceTokens: K,
158
+ isCollapsed: H.border ?? !0,
159
+ onCollapse: Y
150
160
  }),
151
161
  /* @__PURE__ */ C(a, {
152
- replaceTokens: W,
153
- isCollapsed: B.effects ?? !0,
154
- onCollapse: q
162
+ replaceTokens: K,
163
+ isCollapsed: H.effects ?? !0,
164
+ onCollapse: Y
155
165
  }),
156
166
  /* @__PURE__ */ C(c, {
157
- replaceTokens: W,
158
- isCollapsed: B.others ?? !0,
159
- onCollapse: q
167
+ replaceTokens: K,
168
+ isCollapsed: H.others ?? !0,
169
+ onCollapse: Y
160
170
  }),
161
171
  /* @__PURE__ */ C(m, {
162
- isCollapsed: B.variables ?? !0,
163
- onCollapse: q
172
+ isCollapsed: H.variables ?? !0,
173
+ onCollapse: Y
164
174
  }),
165
175
  /* @__PURE__ */ C(u, {
166
- isCollapsed: B.rawStyle ?? !0,
176
+ isCollapsed: H.rawStyle ?? !0,
167
177
  selectors: O,
168
- onCollapse: q
178
+ onCollapse: Y
169
179
  })
170
180
  ]
171
181
  }), /* @__PURE__ */ w("div", {
@@ -173,13 +183,13 @@ var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, sty
173
183
  children: [/* @__PURE__ */ C(D, {
174
184
  size: "xs",
175
185
  label: "Replace Tokens",
176
- checked: W,
177
- onChange: Y
178
- }), R === "element" && /* @__PURE__ */ C(D, {
186
+ checked: K,
187
+ onChange: Z
188
+ }), B === "element" && /* @__PURE__ */ C(D, {
179
189
  size: "xs",
180
190
  label: "Show All Options",
181
- checked: H,
182
- onChange: J
191
+ checked: W,
192
+ onChange: X
183
193
  })]
184
194
  })]
185
195
  })