@plitzi/sdk-style 0.38.6 → 0.38.8
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 +211 -0
- package/dist/StyleMap/helpers/isValueValid.d.ts +2 -0
- package/dist/StyleMap/helpers/isValueValid.mjs +6 -4
- package/dist/StyleMap/helpers/utils.d.ts +3 -4
- package/dist/StyleMap/helpers/utils.mjs +36 -46
- package/dist/StyleMap/methods/addSelector.mjs +13 -12
- package/dist/StyleMap/methods/updateSelector.mjs +6 -5
- package/dist/components/StyleInspector/Inspector.d.ts +4 -2
- package/dist/components/StyleInspector/Inspector.mjs +98 -88
- package/dist/components/StyleInspector/StyleInspector.mjs +203 -155
- package/dist/components/StyleInspector/StyleInspectorContext.d.ts +3 -1
- package/dist/components/StyleInspector/StyleInspectorProvider.d.ts +4 -2
- package/dist/components/StyleInspector/StyleInspectorProvider.mjs +56 -53
- package/dist/components/StyleInspector/components/AncestorRules/AncestorRuleChip.mjs +23 -22
- package/dist/components/StyleInspector/helpers.d.ts +11 -1
- package/dist/components/StyleInspector/helpers.mjs +31 -19
- package/dist/components/StyleInspector/hooks/useStyleInherit.d.ts +4 -2
- package/dist/components/StyleInspector/hooks/useStyleInherit.mjs +10 -6
- package/dist/helpers/calculateInheriting.d.ts +3 -1
- package/dist/helpers/calculateInheriting.mjs +60 -35
- package/dist/helpers/processSelector.mjs +64 -46
- package/dist/helpers/processSelectorAttributes.d.ts +12 -4
- package/dist/helpers/processSelectorAttributes.mjs +26 -10
- package/package.json +5 -5
|
@@ -1,118 +1,135 @@
|
|
|
1
|
-
import { STYLE_STATE_OPTIONS as e, ancestorClasses as t, ancestorConditions as n, ancestorOptions as r, ancestorRemovals as i,
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { use as
|
|
6
|
-
import { useBuilderStore as
|
|
7
|
-
import { get as
|
|
8
|
-
import { produce as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
1
|
+
import { STYLE_STATE_OPTIONS as e, ancestorClasses as t, ancestorConditions as n, ancestorOptions as r, ancestorRemovals as i, conditionOptions as ee, pseudoOptions as a, unusedAncestors as te } from "./helpers.mjs";
|
|
2
|
+
import ne from "../Selector/index.mjs";
|
|
3
|
+
import re from "./components/AncestorRules/index.mjs";
|
|
4
|
+
import ie from "./Inspector.mjs";
|
|
5
|
+
import { use as ae, useCallback as o, useEffect as oe, useMemo as s, useState as c } from "react";
|
|
6
|
+
import { useBuilderStore as se, useBuilderStoreSync as l } from "@plitzi/sdk-shared/store";
|
|
7
|
+
import { get as u, pick as ce, set as le } from "@plitzi/plitzi-ui/helpers";
|
|
8
|
+
import { produce as ue } from "immer";
|
|
9
|
+
import { canonicalCondition as de } from "@plitzi/sdk-shared/style/styleConditions";
|
|
10
|
+
import { isParentAncestor as fe } from "@plitzi/sdk-shared/style/styleStates";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
12
|
+
import { clsx as pe } from "clsx";
|
|
13
|
+
import me from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
|
|
14
|
+
import p from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
|
|
15
|
+
import m from "@plitzi/plitzi-ui/Select";
|
|
16
|
+
import h from "@plitzi/plitzi-ui/Select2";
|
|
15
17
|
//#region src/components/StyleInspector/StyleInspector.tsx
|
|
16
|
-
var
|
|
17
|
-
let [
|
|
18
|
-
|
|
19
|
-
let [B, V] =
|
|
20
|
-
|
|
21
|
-
let [[H, U]] =
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
var g = ({ displayMode: g, selectors: _, value: v, element: y, mode: b = "element", componentType: x, styleSelectors: S, styleSelectorsAvailables: C, componentSubTypesAvailables: w, allowStyleSelector: he = !0, allowStyleState: T = !0, allowStyleVariant: E = !0, onChange: D, onRemoveVariant: O }) => {
|
|
19
|
+
let [ge, k] = c(void 0), [A, j] = c("base"), [M, N] = c(void 0), [P, F] = c(void 0);
|
|
20
|
+
l("styleSelector", A, { enabled: b === "element" }), l("styleVariant", M, { enabled: b === "element" });
|
|
21
|
+
let [I, L] = c(void 0), [R, z] = c(void 0), [B, V] = c(void 0);
|
|
22
|
+
l("styleState", P, { enabled: b === "element" }), l("styleAncestor", I, { enabled: b === "element" }), l("stylePseudo", R, { enabled: b === "element" }), l("styleCondition", B, { enabled: b === "element" });
|
|
23
|
+
let [[H, U]] = se(["schema.flat", "style.platform"]), { builderHandler: W } = ae(me), G = s(() => u(S, A, ""), [S, A]), _e = s(() => Object.values(ce(_ ?? {}, y ? [y.definition.type, ...G.split(" ")] : G.split(" "))), [
|
|
24
|
+
_,
|
|
25
|
+
y,
|
|
24
26
|
G
|
|
25
|
-
]), K =
|
|
26
|
-
|
|
27
|
+
]), K = s(() => v ? u(_, v) : void 0, [_, v]), q = K?.attributes[A]?.ancestors, J = s(() => b === "element" ? t(H, y) : Object.values(_ ?? {}).filter((e) => e.type === "class" && e.name !== v).map((e) => e.name).sort((e, t) => e.localeCompare(t)), [
|
|
28
|
+
y,
|
|
27
29
|
H,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]), Y =
|
|
30
|
+
b,
|
|
31
|
+
_,
|
|
32
|
+
v
|
|
33
|
+
]), Y = s(() => r(J, q), [J, q]), X = s(() => n(q), [q]), Z = s(() => K ? te(H, K) : /* @__PURE__ */ new Set(), [H, K]), ve = s(() => {
|
|
32
34
|
let e = Object.keys(q ?? {}).length;
|
|
33
35
|
return e ? `When an ancestor is… (${e} set)` : "When an ancestor is…";
|
|
34
|
-
}, [q]),
|
|
35
|
-
let e = K?.attributes[
|
|
36
|
+
}, [q]), ye = s(() => {
|
|
37
|
+
let e = K?.attributes[A], t = I ? [...Object.keys(_?.[I]?.attributes.base.variants ?? {}), ...Object.keys(e?.ancestors?.[I]?.variants ?? {})] : Object.keys(e?.variants ?? {});
|
|
36
38
|
return [...new Set(t)].map((e) => ({
|
|
37
39
|
label: e,
|
|
38
40
|
value: e
|
|
39
41
|
}));
|
|
40
42
|
}, [
|
|
41
43
|
K?.attributes,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]);
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
let e =
|
|
49
|
-
|
|
50
|
-
}, [
|
|
51
|
-
if (
|
|
52
|
-
if (
|
|
53
|
-
let e =
|
|
54
|
-
|
|
44
|
+
_,
|
|
45
|
+
I,
|
|
46
|
+
A
|
|
47
|
+
]), Q = s(() => a(K?.attributes[A]), [K?.attributes, A]), be = s(() => ee(K?.attributes[A]), [K?.attributes, A]), xe = !!I && fe(I);
|
|
48
|
+
oe(() => {
|
|
49
|
+
if (j("base"), b !== "element") return;
|
|
50
|
+
let e = u(S, "base", "").split(" "), t = e[e.length - 1];
|
|
51
|
+
D?.(t || ""), F(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
|
|
52
|
+
}, [D, S]), p(() => {
|
|
53
|
+
if (b === "element") {
|
|
54
|
+
if (v !== y?.definition.type) {
|
|
55
|
+
let e = u(S, A, "").split(" ");
|
|
56
|
+
D?.(e[e.length - 1]);
|
|
55
57
|
}
|
|
56
|
-
|
|
58
|
+
F(void 0), N(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
|
|
57
59
|
}
|
|
58
|
-
}, [
|
|
59
|
-
|
|
60
|
-
}, [
|
|
61
|
-
let
|
|
60
|
+
}, [A]), p(() => {
|
|
61
|
+
F(void 0), N(void 0), L(void 0), z(void 0), V(void 0), k(void 0);
|
|
62
|
+
}, [v]);
|
|
63
|
+
let Se = o((e, t, n) => {
|
|
62
64
|
if (t && !n) return;
|
|
63
65
|
let { name: r, type: i } = e;
|
|
64
|
-
!t && r !== "" && !
|
|
65
|
-
styleSelector:
|
|
66
|
-
componentType: i === "element" ?
|
|
67
|
-
}) : t && n && n.name !== r &&
|
|
68
|
-
styleSelector:
|
|
69
|
-
componentType: i === "element" ?
|
|
66
|
+
!t && r !== "" && !_?.[r] ? W("styleAddSelector", g, r, i, void 0, void 0, {
|
|
67
|
+
styleSelector: A,
|
|
68
|
+
componentType: i === "element" ? x : void 0
|
|
69
|
+
}) : t && n && n.name !== r && _?.[n.name] && !_[r] && W("styleAddSelector", g, r, i, void 0, u(_, `${n.name}.attributes.${A}.default`, {}), {
|
|
70
|
+
styleSelector: A,
|
|
71
|
+
componentType: i === "element" ? x : void 0
|
|
70
72
|
});
|
|
71
73
|
}, [
|
|
72
74
|
W,
|
|
73
|
-
T,
|
|
74
|
-
b,
|
|
75
75
|
x,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
g,
|
|
77
|
+
_,
|
|
78
|
+
A
|
|
79
|
+
]), Ce = o((e) => {
|
|
80
|
+
if (!e || v && v === e.name) {
|
|
81
|
+
D?.(void 0);
|
|
80
82
|
return;
|
|
81
83
|
}
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
D?.(e.name);
|
|
85
|
+
}, [D, v]), we = o((e) => {
|
|
86
|
+
y && W("schemaUpdateElement", ue(y, (t) => {
|
|
87
|
+
le(t, `definition.styleSelectors.${A}`, e);
|
|
86
88
|
}));
|
|
87
89
|
}, [
|
|
88
|
-
|
|
90
|
+
y,
|
|
89
91
|
W,
|
|
90
|
-
|
|
91
|
-
]),
|
|
92
|
-
W("styleRemoveSelector",
|
|
93
|
-
}, [W,
|
|
94
|
-
|
|
95
|
-
}, []),
|
|
96
|
-
|
|
97
|
-
}, []),
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
A
|
|
93
|
+
]), Te = o((e) => {
|
|
94
|
+
W("styleRemoveSelector", g, e.name);
|
|
95
|
+
}, [W, g]), Ee = o((e) => k(e), []), De = o((e) => {
|
|
96
|
+
j(e);
|
|
97
|
+
}, []), Oe = o((e) => F(e?.value), []), ke = o((e) => {
|
|
98
|
+
L(e?.value), F(void 0), N(void 0), z(void 0), V(void 0);
|
|
99
|
+
}, []), Ae = o((e) => z(e?.value), []), je = o((e) => {
|
|
100
|
+
let t = e ? de(e.value) : void 0;
|
|
101
|
+
(!e || t) && (V(t), t && (N(void 0), L(void 0)));
|
|
102
|
+
}, []), Me = o((e) => {
|
|
103
|
+
e.value === B && (V(void 0), F(void 0)), K?.attributes[A]?.conditions?.[e.value] && W("styleUpdateSelector", g, K.name, void 0, void 0, {
|
|
104
|
+
styleSelector: A,
|
|
105
|
+
styleCondition: e.value,
|
|
101
106
|
componentType: K.componentType
|
|
102
107
|
});
|
|
103
108
|
}, [
|
|
104
109
|
W,
|
|
105
|
-
|
|
110
|
+
g,
|
|
106
111
|
K,
|
|
107
112
|
B,
|
|
108
|
-
|
|
109
|
-
]),
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
A
|
|
114
|
+
]), Ne = o((e) => {
|
|
115
|
+
e.value === I && (L(void 0), F(void 0), N(void 0)), K?.attributes[A]?.ancestors?.[e.value] && W("styleUpdateSelector", g, K.name, void 0, void 0, {
|
|
116
|
+
styleSelector: A,
|
|
117
|
+
styleAncestor: e.value,
|
|
118
|
+
componentType: K.componentType
|
|
119
|
+
});
|
|
120
|
+
}, [
|
|
121
|
+
W,
|
|
122
|
+
g,
|
|
123
|
+
K,
|
|
124
|
+
I,
|
|
125
|
+
A
|
|
126
|
+
]), Pe = o((e) => {
|
|
127
|
+
L(e.ancestor), N(e.variant), F(e.state), z(void 0), V(void 0);
|
|
128
|
+
}, []), Fe = o((e) => {
|
|
112
129
|
if (!K) return;
|
|
113
130
|
let { ancestor: t, state: n, variant: r } = e;
|
|
114
|
-
t ===
|
|
115
|
-
styleSelector:
|
|
131
|
+
t === I && n === P && r === M && (F(void 0), N(void 0)), W("styleUpdateSelector", g, K.name, void 0, n || r ? void 0 : {}, {
|
|
132
|
+
styleSelector: A,
|
|
116
133
|
styleAncestor: t,
|
|
117
134
|
styleState: n,
|
|
118
135
|
styleVariant: r,
|
|
@@ -120,15 +137,15 @@ var b = ({ displayMode: b, selectors: x, value: S, element: C, mode: w = "elemen
|
|
|
120
137
|
});
|
|
121
138
|
}, [
|
|
122
139
|
W,
|
|
123
|
-
|
|
140
|
+
g,
|
|
124
141
|
K,
|
|
125
|
-
|
|
142
|
+
I,
|
|
143
|
+
A,
|
|
126
144
|
P,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
]), Se = s(() => {
|
|
145
|
+
M
|
|
146
|
+
]), Ie = o(() => {
|
|
130
147
|
if (K) {
|
|
131
|
-
|
|
148
|
+
I && Z.has(I) && (L(void 0), F(void 0), N(void 0));
|
|
132
149
|
for (let e of i(U, K.name, Z)) W("styleUpdateSelector", e.displayMode, K.name, void 0, void 0, {
|
|
133
150
|
styleSelector: e.styleSelector,
|
|
134
151
|
styleAncestor: e.styleAncestor,
|
|
@@ -139,134 +156,165 @@ var b = ({ displayMode: b, selectors: x, value: S, element: C, mode: w = "elemen
|
|
|
139
156
|
W,
|
|
140
157
|
U,
|
|
141
158
|
K,
|
|
142
|
-
|
|
159
|
+
I,
|
|
143
160
|
Z
|
|
144
|
-
]),
|
|
145
|
-
|
|
146
|
-
}, []),
|
|
147
|
-
|
|
148
|
-
styleSelector:
|
|
161
|
+
]), Le = o((e) => {
|
|
162
|
+
N(e?.value), e && V(void 0);
|
|
163
|
+
}, []), Re = o((e) => {
|
|
164
|
+
O?.(e.value), P && F(void 0), e.value === M && N(void 0), W("styleUpdateSelector", g, K?.name, void 0, void 0, {
|
|
165
|
+
styleSelector: A,
|
|
149
166
|
styleVariant: e.value,
|
|
150
|
-
styleAncestor:
|
|
167
|
+
styleAncestor: I,
|
|
151
168
|
componentType: K?.componentType
|
|
152
169
|
});
|
|
153
170
|
}, [
|
|
154
171
|
W,
|
|
155
|
-
|
|
156
|
-
|
|
172
|
+
g,
|
|
173
|
+
O,
|
|
157
174
|
K?.componentType,
|
|
158
175
|
K?.name,
|
|
176
|
+
A,
|
|
159
177
|
P,
|
|
160
|
-
|
|
161
|
-
I
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return /* @__PURE__ */ g("div", {
|
|
178
|
+
M,
|
|
179
|
+
I
|
|
180
|
+
]), $ = E || T || !!C?.length || !!w?.length;
|
|
181
|
+
return /* @__PURE__ */ f("div", {
|
|
165
182
|
className: "flex w-full grow flex-col gap-2",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ f("div", {
|
|
167
184
|
className: "flex w-full flex-col gap-2 px-1",
|
|
168
185
|
children: [
|
|
169
|
-
|
|
186
|
+
b === "element" && /* @__PURE__ */ d(ne, {
|
|
170
187
|
className: "min-h-0 w-full",
|
|
171
188
|
value: G,
|
|
172
|
-
selectors:
|
|
189
|
+
selectors: _,
|
|
173
190
|
selector: K,
|
|
174
|
-
componentType:
|
|
175
|
-
onAdd:
|
|
176
|
-
onChange:
|
|
177
|
-
onRemove:
|
|
178
|
-
onSelectorSelected:
|
|
191
|
+
componentType: x,
|
|
192
|
+
onAdd: Se,
|
|
193
|
+
onChange: we,
|
|
194
|
+
onRemove: Te,
|
|
195
|
+
onSelectorSelected: Ce
|
|
179
196
|
}),
|
|
180
|
-
$ && /* @__PURE__ */
|
|
181
|
-
className:
|
|
197
|
+
$ && /* @__PURE__ */ f("div", {
|
|
198
|
+
className: pe("flex w-full items-center gap-2", { "mt-2": b === "manager" }),
|
|
182
199
|
children: [
|
|
183
|
-
!!
|
|
200
|
+
!!w?.length && /* @__PURE__ */ d(m, {
|
|
184
201
|
className: "grow basis-0",
|
|
185
202
|
size: "xs",
|
|
186
|
-
value:
|
|
187
|
-
onChange:
|
|
188
|
-
children:
|
|
203
|
+
value: ge,
|
|
204
|
+
onChange: Ee,
|
|
205
|
+
children: w.map((e) => /* @__PURE__ */ d("option", {
|
|
189
206
|
value: e,
|
|
190
207
|
children: e
|
|
191
208
|
}, e))
|
|
192
209
|
}),
|
|
193
|
-
|
|
210
|
+
he && C && C.length > 1 && /* @__PURE__ */ d(m, {
|
|
194
211
|
className: "grow basis-0",
|
|
195
212
|
size: "xs",
|
|
196
|
-
onChange:
|
|
197
|
-
value:
|
|
198
|
-
children:
|
|
213
|
+
onChange: De,
|
|
214
|
+
value: A,
|
|
215
|
+
children: C.map((e) => /* @__PURE__ */ d("option", {
|
|
199
216
|
value: e,
|
|
200
217
|
children: e
|
|
201
218
|
}, e))
|
|
202
219
|
}),
|
|
203
|
-
|
|
220
|
+
E && !xe && /* @__PURE__ */ d("div", {
|
|
204
221
|
className: "grow basis-0",
|
|
205
|
-
children: /* @__PURE__ */ h
|
|
222
|
+
children: /* @__PURE__ */ d(h, {
|
|
206
223
|
className: "grow basis-0",
|
|
207
|
-
value:
|
|
208
|
-
options:
|
|
224
|
+
value: M,
|
|
225
|
+
options: ye,
|
|
209
226
|
placeholder: "Variant",
|
|
210
227
|
size: "xs",
|
|
211
228
|
allowCreateOptions: !0,
|
|
212
229
|
allowRemoveOptions: !0,
|
|
213
230
|
clearable: !0,
|
|
214
|
-
onChange:
|
|
215
|
-
onRemove:
|
|
231
|
+
onChange: Le,
|
|
232
|
+
onRemove: Re
|
|
216
233
|
})
|
|
217
234
|
}),
|
|
218
|
-
|
|
235
|
+
T && /* @__PURE__ */ d("div", {
|
|
219
236
|
className: "grow basis-0",
|
|
220
|
-
children: /* @__PURE__ */ h
|
|
237
|
+
children: /* @__PURE__ */ d(h, {
|
|
221
238
|
className: "grow basis-0",
|
|
222
|
-
value:
|
|
239
|
+
value: P,
|
|
223
240
|
options: e,
|
|
224
241
|
placeholder: "State",
|
|
225
242
|
size: "xs",
|
|
226
243
|
clearable: !0,
|
|
227
|
-
onChange:
|
|
244
|
+
onChange: Oe
|
|
228
245
|
})
|
|
229
246
|
})
|
|
230
247
|
]
|
|
231
248
|
}),
|
|
232
|
-
$ &&
|
|
249
|
+
$ && T && !!Y.length && /* @__PURE__ */ d(h, {
|
|
233
250
|
className: "w-full",
|
|
234
|
-
value:
|
|
251
|
+
value: I,
|
|
235
252
|
options: Y,
|
|
236
|
-
placeholder:
|
|
253
|
+
placeholder: ve,
|
|
237
254
|
size: "xs",
|
|
238
255
|
clearable: !0,
|
|
239
256
|
allowRemoveOptions: !0,
|
|
240
|
-
onChange:
|
|
241
|
-
onRemove:
|
|
257
|
+
onChange: ke,
|
|
258
|
+
onRemove: Ne
|
|
259
|
+
}),
|
|
260
|
+
$ && T && !I && /* @__PURE__ */ f("div", {
|
|
261
|
+
className: "flex w-full items-center gap-2",
|
|
262
|
+
children: [/* @__PURE__ */ d("div", {
|
|
263
|
+
className: "grow basis-0",
|
|
264
|
+
children: /* @__PURE__ */ d(h, {
|
|
265
|
+
className: "grow basis-0",
|
|
266
|
+
value: R,
|
|
267
|
+
options: Q,
|
|
268
|
+
placeholder: "Pseudo-element",
|
|
269
|
+
size: "xs",
|
|
270
|
+
clearable: !0,
|
|
271
|
+
onChange: Ae
|
|
272
|
+
})
|
|
273
|
+
}), /* @__PURE__ */ d("div", {
|
|
274
|
+
className: "grow basis-0",
|
|
275
|
+
children: /* @__PURE__ */ d(h, {
|
|
276
|
+
className: "grow basis-0",
|
|
277
|
+
value: B,
|
|
278
|
+
options: be,
|
|
279
|
+
placeholder: "Condition",
|
|
280
|
+
size: "xs",
|
|
281
|
+
clearable: !0,
|
|
282
|
+
allowCreateOptions: !0,
|
|
283
|
+
allowRemoveOptions: !0,
|
|
284
|
+
onChange: je,
|
|
285
|
+
onRemove: Me
|
|
286
|
+
})
|
|
287
|
+
})]
|
|
242
288
|
}),
|
|
243
|
-
|
|
289
|
+
T && X.length > 0 && /* @__PURE__ */ d(re, {
|
|
244
290
|
conditions: X,
|
|
245
291
|
unused: Z,
|
|
246
|
-
activeAncestor:
|
|
247
|
-
activeState:
|
|
248
|
-
activeVariant:
|
|
249
|
-
onSelect:
|
|
250
|
-
onRemove:
|
|
251
|
-
onRemoveUnused:
|
|
292
|
+
activeAncestor: I,
|
|
293
|
+
activeState: P,
|
|
294
|
+
activeVariant: M,
|
|
295
|
+
onSelect: Pe,
|
|
296
|
+
onRemove: Fe,
|
|
297
|
+
onRemoveUnused: Ie
|
|
252
298
|
})
|
|
253
299
|
]
|
|
254
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ d("div", {
|
|
255
301
|
className: "flex grow basis-0 flex-col overflow-auto border-t border-gray-300 dark:border-zinc-700",
|
|
256
|
-
children: /* @__PURE__ */
|
|
257
|
-
selectors:
|
|
258
|
-
componentType:
|
|
302
|
+
children: /* @__PURE__ */ d(ie, {
|
|
303
|
+
selectors: _e,
|
|
304
|
+
componentType: x,
|
|
259
305
|
selector: K,
|
|
260
|
-
styleSelector:
|
|
261
|
-
styleState:
|
|
262
|
-
styleVariant:
|
|
263
|
-
styleAncestor:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
306
|
+
styleSelector: A,
|
|
307
|
+
styleState: P,
|
|
308
|
+
styleVariant: M,
|
|
309
|
+
styleAncestor: I,
|
|
310
|
+
stylePseudo: R,
|
|
311
|
+
styleCondition: B,
|
|
312
|
+
element: y,
|
|
313
|
+
displayMode: g,
|
|
314
|
+
mode: b
|
|
267
315
|
})
|
|
268
316
|
})]
|
|
269
317
|
});
|
|
270
318
|
};
|
|
271
319
|
//#endregion
|
|
272
|
-
export {
|
|
320
|
+
export { g as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InheritData } from '../../helpers';
|
|
2
|
-
import { DisplayMode, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
import { DisplayMode, StyleCategory, StyleItem, StyleObject, StylePseudo, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
3
3
|
export type SetValues = {
|
|
4
4
|
(path?: undefined, values?: StyleObject): void;
|
|
5
5
|
(path: StyleCategory, values?: StyleValue): void;
|
|
@@ -11,6 +11,8 @@ export type StyleInspectorContextValue = {
|
|
|
11
11
|
styleState?: StyleState;
|
|
12
12
|
styleAncestor?: string;
|
|
13
13
|
styleVariant?: string;
|
|
14
|
+
stylePseudo?: StylePseudo;
|
|
15
|
+
styleCondition?: string;
|
|
14
16
|
displayMode: DisplayMode;
|
|
15
17
|
variables: Record<string, unknown>;
|
|
16
18
|
inheritData: InheritData['style'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InheritData } from '../../helpers';
|
|
2
|
-
import { DisplayMode, Element, StyleCategory, StyleItem, StyleObject, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
import { DisplayMode, Element, StyleCategory, StyleItem, StyleObject, StylePseudo, StyleState, StyleValue } from '@plitzi/sdk-shared';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
export type StyleInspectorProviderProps = {
|
|
5
5
|
children: ReactNode;
|
|
@@ -9,10 +9,12 @@ export type StyleInspectorProviderProps = {
|
|
|
9
9
|
styleState?: StyleState;
|
|
10
10
|
styleVariant?: string;
|
|
11
11
|
styleAncestor?: string;
|
|
12
|
+
stylePseudo?: StylePseudo;
|
|
13
|
+
styleCondition?: string;
|
|
12
14
|
element?: Element;
|
|
13
15
|
inheritData: InheritData;
|
|
14
16
|
displayMode: DisplayMode;
|
|
15
17
|
onChange?: (path?: StyleCategory, values?: StyleObject | StyleValue) => void;
|
|
16
18
|
};
|
|
17
|
-
declare const StyleInspectorProvider: ({ children, componentType, selector, styleSelector, styleState, styleVariant, styleAncestor, element, inheritData, displayMode, onChange }: StyleInspectorProviderProps) => import('react').JSX.Element;
|
|
19
|
+
declare const StyleInspectorProvider: ({ children, componentType, selector, styleSelector, styleState, styleVariant, styleAncestor, stylePseudo, styleCondition, element, inheritData, displayMode, onChange }: StyleInspectorProviderProps) => import('react').JSX.Element;
|
|
18
20
|
export default StyleInspectorProvider;
|