@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
|
@@ -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,
|
|
27
|
-
let { builderHandler:
|
|
28
|
-
element:
|
|
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:
|
|
32
|
+
styleSelector: L,
|
|
33
33
|
styleState: M,
|
|
34
34
|
styleVariant: N,
|
|
35
|
-
styleAncestor: P
|
|
36
|
-
|
|
35
|
+
styleAncestor: P,
|
|
36
|
+
stylePseudo: F,
|
|
37
|
+
styleCondition: I
|
|
38
|
+
}), Y = v((e, t) => U((n) => ({
|
|
37
39
|
...n,
|
|
38
40
|
[e]: t
|
|
39
|
-
})), [
|
|
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
|
-
|
|
43
|
+
V("styleUpdateSelector", z, j.name, t, n, {
|
|
42
44
|
componentType: j.type === "element" ? k : void 0,
|
|
43
|
-
styleSelector:
|
|
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,
|
|
52
|
-
if (
|
|
53
|
-
styleSelector:
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
69
|
+
V,
|
|
64
70
|
k,
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
z,
|
|
72
|
+
R,
|
|
67
73
|
j,
|
|
68
|
-
|
|
74
|
+
L,
|
|
69
75
|
M,
|
|
70
76
|
N,
|
|
71
|
-
P
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
]),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]),
|
|
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:
|
|
87
|
-
styleSelector:
|
|
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:
|
|
93
|
-
inheritData:
|
|
94
|
-
onChange:
|
|
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
|
-
|
|
101
|
-
replaceTokens:
|
|
102
|
-
isCollapsed:
|
|
103
|
-
onCollapse:
|
|
110
|
+
$ && /* @__PURE__ */ C(o, {
|
|
111
|
+
replaceTokens: K,
|
|
112
|
+
isCollapsed: H.list ?? !0,
|
|
113
|
+
onCollapse: Y
|
|
104
114
|
}),
|
|
105
|
-
|
|
106
|
-
replaceTokens:
|
|
107
|
-
isCollapsed:
|
|
108
|
-
onCollapse:
|
|
115
|
+
$ && /* @__PURE__ */ C(s, {
|
|
116
|
+
replaceTokens: K,
|
|
117
|
+
isCollapsed: H.listItem ?? !0,
|
|
118
|
+
onCollapse: Y
|
|
109
119
|
}),
|
|
110
120
|
/* @__PURE__ */ C(r, {
|
|
111
|
-
replaceTokens:
|
|
112
|
-
isCollapsed:
|
|
113
|
-
onCollapse:
|
|
121
|
+
replaceTokens: K,
|
|
122
|
+
isCollapsed: H.display ?? !0,
|
|
123
|
+
onCollapse: Y
|
|
114
124
|
}),
|
|
115
|
-
|
|
116
|
-
replaceTokens:
|
|
117
|
-
isCollapsed:
|
|
118
|
-
isFlexVertical:
|
|
119
|
-
onCollapse:
|
|
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:
|
|
123
|
-
isCollapsed:
|
|
124
|
-
onCollapse:
|
|
132
|
+
replaceTokens: K,
|
|
133
|
+
isCollapsed: H.spacing ?? !0,
|
|
134
|
+
onCollapse: Y
|
|
125
135
|
}),
|
|
126
136
|
/* @__PURE__ */ C(d, {
|
|
127
|
-
replaceTokens:
|
|
128
|
-
isCollapsed:
|
|
129
|
-
onCollapse:
|
|
137
|
+
replaceTokens: K,
|
|
138
|
+
isCollapsed: H.size ?? !0,
|
|
139
|
+
onCollapse: Y
|
|
130
140
|
}),
|
|
131
141
|
/* @__PURE__ */ C(l, {
|
|
132
|
-
replaceTokens:
|
|
133
|
-
isCollapsed:
|
|
134
|
-
onCollapse:
|
|
142
|
+
replaceTokens: K,
|
|
143
|
+
isCollapsed: H.position ?? !0,
|
|
144
|
+
onCollapse: Y
|
|
135
145
|
}),
|
|
136
146
|
/* @__PURE__ */ C(p, {
|
|
137
|
-
replaceTokens:
|
|
138
|
-
isCollapsed:
|
|
139
|
-
onCollapse:
|
|
147
|
+
replaceTokens: K,
|
|
148
|
+
isCollapsed: H.typography ?? !0,
|
|
149
|
+
onCollapse: Y
|
|
140
150
|
}),
|
|
141
151
|
/* @__PURE__ */ C(t, {
|
|
142
|
-
replaceTokens:
|
|
143
|
-
isCollapsed:
|
|
144
|
-
onCollapse:
|
|
152
|
+
replaceTokens: K,
|
|
153
|
+
isCollapsed: H.background ?? !0,
|
|
154
|
+
onCollapse: Y
|
|
145
155
|
}),
|
|
146
156
|
/* @__PURE__ */ C(n, {
|
|
147
|
-
replaceTokens:
|
|
148
|
-
isCollapsed:
|
|
149
|
-
onCollapse:
|
|
157
|
+
replaceTokens: K,
|
|
158
|
+
isCollapsed: H.border ?? !0,
|
|
159
|
+
onCollapse: Y
|
|
150
160
|
}),
|
|
151
161
|
/* @__PURE__ */ C(a, {
|
|
152
|
-
replaceTokens:
|
|
153
|
-
isCollapsed:
|
|
154
|
-
onCollapse:
|
|
162
|
+
replaceTokens: K,
|
|
163
|
+
isCollapsed: H.effects ?? !0,
|
|
164
|
+
onCollapse: Y
|
|
155
165
|
}),
|
|
156
166
|
/* @__PURE__ */ C(c, {
|
|
157
|
-
replaceTokens:
|
|
158
|
-
isCollapsed:
|
|
159
|
-
onCollapse:
|
|
167
|
+
replaceTokens: K,
|
|
168
|
+
isCollapsed: H.others ?? !0,
|
|
169
|
+
onCollapse: Y
|
|
160
170
|
}),
|
|
161
171
|
/* @__PURE__ */ C(m, {
|
|
162
|
-
isCollapsed:
|
|
163
|
-
onCollapse:
|
|
172
|
+
isCollapsed: H.variables ?? !0,
|
|
173
|
+
onCollapse: Y
|
|
164
174
|
}),
|
|
165
175
|
/* @__PURE__ */ C(u, {
|
|
166
|
-
isCollapsed:
|
|
176
|
+
isCollapsed: H.rawStyle ?? !0,
|
|
167
177
|
selectors: O,
|
|
168
|
-
onCollapse:
|
|
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:
|
|
177
|
-
onChange:
|
|
178
|
-
}),
|
|
186
|
+
checked: K,
|
|
187
|
+
onChange: Z
|
|
188
|
+
}), B === "element" && /* @__PURE__ */ C(D, {
|
|
179
189
|
size: "xs",
|
|
180
190
|
label: "Show All Options",
|
|
181
|
-
checked:
|
|
182
|
-
onChange:
|
|
191
|
+
checked: W,
|
|
192
|
+
onChange: X
|
|
183
193
|
})]
|
|
184
194
|
})]
|
|
185
195
|
})
|