@plitzi/sdk-style 0.38.11 → 0.38.12
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 +109 -0
- package/dist/StyleMap/helpers/isValueValid.mjs +5 -4
- package/dist/StyleMap/helpers/utils.mjs +13 -12
- package/dist/components/StyleInspector/StyleInspector.mjs +217 -217
- package/dist/components/StyleInspector/categories/Background/Background.mjs +86 -147
- package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.mjs +28 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +26 -48
- package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +45 -67
- package/dist/components/StyleInspector/categories/Display/Display.mjs +59 -58
- package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +14 -1
- package/dist/components/StyleInspector/categories/Display/DisplayGap.mjs +26 -13
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +13 -24
- package/dist/components/StyleInspector/categories/Effects/Effects.mjs +41 -102
- package/dist/components/StyleInspector/categories/List/List.mjs +15 -65
- package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +15 -64
- package/dist/components/StyleInspector/categories/Others/Others.mjs +60 -60
- package/dist/components/StyleInspector/categories/Size/Size.mjs +67 -67
- package/dist/components/StyleInspector/categories/Spacing/SpacingBox.d.ts +15 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingBox.mjs +63 -0
- package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +3 -11
- package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +18 -70
- package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +3 -7
- package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +16 -68
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +79 -78
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +17 -28
- package/dist/components/StyleInspector/categories/blendModes.d.ts +2 -0
- package/dist/components/StyleInspector/categories/blendModes.mjs +21 -0
- package/dist/components/StyleInspector/categories/listMarkers.d.ts +8 -0
- package/dist/components/StyleInspector/categories/listMarkers.mjs +25 -0
- package/dist/components/StyleInspector/components/ShadowList/ShadowList.d.ts +15 -0
- package/dist/components/StyleInspector/components/ShadowList/ShadowList.mjs +25 -0
- package/dist/components/StyleInspector/components/ShadowList/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/ShadowList/index.mjs +5 -0
- package/dist/components/StyleInspector/cssValues.d.ts +2 -4
- package/dist/components/StyleInspector/cssValues.mjs +12 -16
- package/dist/components/StyleInspector/hooks/usePropertyChange.d.ts +6 -0
- package/dist/components/StyleInspector/hooks/usePropertyChange.mjs +9 -0
- package/package.json +44 -8
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +0 -8
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +0 -27
|
@@ -1,70 +1,18 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "
|
|
3
|
-
import { useCallback as n } from "react";
|
|
4
|
-
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
1
|
+
import e from "./SpacingBox.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
5
3
|
//#region src/components/StyleInspector/categories/Spacing/SpacingPadding.tsx
|
|
6
|
-
var a =
|
|
7
|
-
"padding
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
className: "flex items-center justify-center py-0.5",
|
|
20
|
-
children: [/* @__PURE__ */ r(e, {
|
|
21
|
-
keyValue: a,
|
|
22
|
-
className: "absolute top-0 left-0 overflow-hidden rounded-br-md !p-0 text-[11px]",
|
|
23
|
-
size: "custom",
|
|
24
|
-
children: "PADDING"
|
|
25
|
-
}), /* @__PURE__ */ r(t, {
|
|
26
|
-
value: f,
|
|
27
|
-
active: o === "padding-top",
|
|
28
|
-
onClick: d("padding-top")
|
|
29
|
-
})]
|
|
30
|
-
}),
|
|
31
|
-
/* @__PURE__ */ i("div", {
|
|
32
|
-
className: "flex items-center justify-center",
|
|
33
|
-
children: [
|
|
34
|
-
/* @__PURE__ */ r("div", {
|
|
35
|
-
className: "flex items-center justify-center px-0.5",
|
|
36
|
-
children: /* @__PURE__ */ r(t, {
|
|
37
|
-
value: m,
|
|
38
|
-
active: o === "padding-left",
|
|
39
|
-
onClick: d("padding-left")
|
|
40
|
-
})
|
|
41
|
-
}),
|
|
42
|
-
/* @__PURE__ */ i("div", {
|
|
43
|
-
className: "flex grow items-center justify-center rounded border border-gray-300 bg-white py-1 text-zinc-500 hover:text-zinc-900 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",
|
|
44
|
-
title: c ? "Sides linked: a change applies to all four" : "Link the four sides",
|
|
45
|
-
onClick: l,
|
|
46
|
-
children: [c && /* @__PURE__ */ r("i", { className: "fa-solid fa-link text-sm" }), !c && /* @__PURE__ */ r("i", { className: "fa-solid fa-link-slash text-sm" })]
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ r("div", {
|
|
49
|
-
className: "flex items-center justify-center px-0.5",
|
|
50
|
-
children: /* @__PURE__ */ r(t, {
|
|
51
|
-
value: h,
|
|
52
|
-
active: o === "padding-right",
|
|
53
|
-
onClick: d("padding-right")
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ r("div", {
|
|
59
|
-
className: "flex items-center justify-center py-0.5",
|
|
60
|
-
children: /* @__PURE__ */ r(t, {
|
|
61
|
-
value: p,
|
|
62
|
-
active: o === "padding-bottom",
|
|
63
|
-
onClick: d("padding-bottom")
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
});
|
|
68
|
-
};
|
|
4
|
+
var r = ({ fragmentSelected: r, values: i, isLinked: a = !1, onLinkSelected: o, onSelectFragment: s }) => /* @__PURE__ */ t(e, {
|
|
5
|
+
property: "padding",
|
|
6
|
+
className: "relative grow rounded-md border border-gray-300 bg-gray-50 dark:border-zinc-600 dark:bg-zinc-800/70",
|
|
7
|
+
values: i,
|
|
8
|
+
fragmentSelected: r,
|
|
9
|
+
onSelectFragment: s,
|
|
10
|
+
children: /* @__PURE__ */ n("div", {
|
|
11
|
+
className: "flex grow items-center justify-center rounded border border-gray-300 bg-white py-1 text-zinc-500 hover:text-zinc-900 dark:border-zinc-600 dark:bg-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",
|
|
12
|
+
title: a ? "Sides linked: a change applies to all four" : "Link the four sides",
|
|
13
|
+
onClick: o,
|
|
14
|
+
children: [a && /* @__PURE__ */ t("i", { className: "fa-solid fa-link text-sm" }), !a && /* @__PURE__ */ t("i", { className: "fa-solid fa-link-slash text-sm" })]
|
|
15
|
+
})
|
|
16
|
+
});
|
|
69
17
|
//#endregion
|
|
70
|
-
export {
|
|
18
|
+
export { r as default };
|
|
@@ -5,176 +5,177 @@ import r from "../../components/CategorySection/index.mjs";
|
|
|
5
5
|
import { TYPOGRAPHY_KEYS as i } from "../../categoryKeys.mjs";
|
|
6
6
|
import a from "../../components/CategoryAdvanced/index.mjs";
|
|
7
7
|
import o from "../../components/CategoryContainer/index.mjs";
|
|
8
|
-
import s from "
|
|
9
|
-
import c from "./
|
|
10
|
-
import ee from "./
|
|
11
|
-
import
|
|
12
|
-
import u from "./
|
|
13
|
-
import d from "
|
|
14
|
-
import f from "
|
|
15
|
-
import p from "./
|
|
16
|
-
import m from "./
|
|
17
|
-
import h from "./
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
8
|
+
import s from "../../hooks/usePropertyChange.mjs";
|
|
9
|
+
import c from "./TypographyAlign.mjs";
|
|
10
|
+
import ee from "./TypographyBreaking.mjs";
|
|
11
|
+
import l from "./TypographyClamp.mjs";
|
|
12
|
+
import { weights as u } from "./TypographyConstants.mjs";
|
|
13
|
+
import d from "./TypographyFigures.mjs";
|
|
14
|
+
import f from "../../../../hooks/useSpaceFonts.mjs";
|
|
15
|
+
import p from "./TypographyFont.mjs";
|
|
16
|
+
import m from "./TypographyStyle.mjs";
|
|
17
|
+
import h from "./TypographyTextShadow.mjs";
|
|
18
|
+
import g from "./TypographyTransform.mjs";
|
|
19
|
+
import { memo as _, use as v, useCallback as y } from "react";
|
|
20
|
+
import { primaryFamily as b } from "@plitzi/sdk-shared/style";
|
|
21
|
+
import { jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
21
22
|
//#region src/components/StyleInspector/categories/Typography/Typography.tsx
|
|
22
|
-
var
|
|
23
|
+
var C = [
|
|
23
24
|
"letter-spacing",
|
|
24
25
|
"word-spacing",
|
|
25
26
|
"text-indent"
|
|
26
|
-
],
|
|
27
|
-
let
|
|
27
|
+
], w = _(({ replaceTokens: _ = !1, isCollapsed: w = !0, onCollapse: T }) => {
|
|
28
|
+
let E = f(), { setValue: D } = v(e), { "font-family": O, "font-weight": k, "font-size": A, "font-style": j, "text-align": M, "text-decoration": N, "text-decoration-thickness": te, "text-underline-offset": P, "text-indent": F, "text-transform": I, "text-shadow": L, "white-space": R, "text-wrap": z, "word-break": B, "overflow-wrap": V, hyphens: H, "vertical-align": U, "text-overflow": W, "line-clamp": G, "line-height": K, color: q, "letter-spacing": J, "word-spacing": Y, direction: X, "font-variant-numeric": Z, "font-feature-settings": Q, "-webkit-text-fill-color": ne } = t({
|
|
28
29
|
keys: i.dot,
|
|
29
30
|
asValue: !0,
|
|
30
|
-
replaceTokens:
|
|
31
|
-
}),
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
replaceTokens: _
|
|
32
|
+
}), re = y((e) => T?.("typography", e), [T]), ie = E.find((e) => e.family === b(typeof O == "string" ? O : "")), $ = s(), ae = y((e) => D(void 0, e), [D]);
|
|
33
|
+
return /* @__PURE__ */ S(o, {
|
|
33
34
|
title: i.title,
|
|
34
35
|
dotKeys: i.dot,
|
|
35
36
|
advancedKeys: i.advanced,
|
|
36
|
-
isCollapsed:
|
|
37
|
-
onCollapse:
|
|
37
|
+
isCollapsed: w,
|
|
38
|
+
onCollapse: re,
|
|
38
39
|
children: [
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
partialValue:
|
|
40
|
+
/* @__PURE__ */ x(c, {
|
|
41
|
+
partialValue: M,
|
|
41
42
|
onChange: $("text-align")
|
|
42
43
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
partialValue:
|
|
44
|
+
/* @__PURE__ */ x(p, {
|
|
45
|
+
partialValue: O,
|
|
45
46
|
onChange: $("font-family")
|
|
46
47
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ S(r, {
|
|
48
49
|
label: "",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ x(n, {
|
|
50
51
|
keys: ["font-weight"],
|
|
51
52
|
label: "Weight",
|
|
52
|
-
value:
|
|
53
|
+
value: k,
|
|
53
54
|
onChange: $("font-weight"),
|
|
54
55
|
type: "select",
|
|
55
|
-
children: Object.keys(
|
|
56
|
+
children: Object.keys(u).map((e) => /* @__PURE__ */ x("option", {
|
|
56
57
|
value: e,
|
|
57
|
-
disabled: !
|
|
58
|
-
children:
|
|
58
|
+
disabled: !ie?.weights.includes(Number(e)),
|
|
59
|
+
children: u[Number(e)]
|
|
59
60
|
}, e))
|
|
60
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ x(n, {
|
|
61
62
|
keys: ["color"],
|
|
62
63
|
label: "Color",
|
|
63
64
|
type: "color",
|
|
64
|
-
value:
|
|
65
|
+
value: q,
|
|
65
66
|
onChange: $("color")
|
|
66
67
|
})]
|
|
67
68
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ S(r, {
|
|
69
70
|
label: "",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
+
children: [/* @__PURE__ */ x(n, {
|
|
71
72
|
keys: ["font-size"],
|
|
72
73
|
label: "Size",
|
|
73
|
-
value:
|
|
74
|
+
value: A,
|
|
74
75
|
onChange: $("font-size"),
|
|
75
76
|
type: "metric"
|
|
76
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ x(n, {
|
|
77
78
|
keys: ["line-height"],
|
|
78
79
|
label: "Line Height",
|
|
79
|
-
value:
|
|
80
|
+
value: K,
|
|
80
81
|
onChange: $("line-height"),
|
|
81
82
|
type: "metric"
|
|
82
83
|
})]
|
|
83
84
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
fontStyle:
|
|
86
|
-
textDecoration:
|
|
87
|
-
textDecorationThickness:
|
|
85
|
+
/* @__PURE__ */ x(m, {
|
|
86
|
+
fontStyle: j,
|
|
87
|
+
textDecoration: N,
|
|
88
|
+
textDecorationThickness: te,
|
|
88
89
|
textUnderlineOffset: P,
|
|
89
90
|
onChange: $
|
|
90
91
|
}),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ S(r, {
|
|
92
93
|
label: "Spacing",
|
|
93
|
-
keys:
|
|
94
|
+
keys: C,
|
|
94
95
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ x(n, {
|
|
96
97
|
keys: ["letter-spacing"],
|
|
97
98
|
label: "Letter",
|
|
98
|
-
value:
|
|
99
|
+
value: J,
|
|
99
100
|
onChange: $("letter-spacing"),
|
|
100
101
|
type: "metric"
|
|
101
102
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ x(n, {
|
|
103
104
|
keys: ["word-spacing"],
|
|
104
105
|
label: "Word",
|
|
105
|
-
value:
|
|
106
|
+
value: Y,
|
|
106
107
|
onChange: $("word-spacing"),
|
|
107
108
|
type: "metric"
|
|
108
109
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ x(n, {
|
|
110
111
|
keys: ["text-indent"],
|
|
111
112
|
label: "Indent",
|
|
112
|
-
value:
|
|
113
|
+
value: F,
|
|
113
114
|
onChange: $("text-indent"),
|
|
114
115
|
type: "metric"
|
|
115
116
|
})
|
|
116
117
|
]
|
|
117
118
|
}),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
textTransform:
|
|
120
|
-
direction:
|
|
119
|
+
/* @__PURE__ */ x(g, {
|
|
120
|
+
textTransform: I,
|
|
121
|
+
direction: X,
|
|
121
122
|
onChange: $
|
|
122
123
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
whiteSpace:
|
|
125
|
-
textWrap:
|
|
126
|
-
wordBreak:
|
|
127
|
-
overflowWrap:
|
|
128
|
-
hyphens:
|
|
129
|
-
verticalAlign:
|
|
124
|
+
/* @__PURE__ */ x(ee, {
|
|
125
|
+
whiteSpace: R,
|
|
126
|
+
textWrap: z,
|
|
127
|
+
wordBreak: B,
|
|
128
|
+
overflowWrap: V,
|
|
129
|
+
hyphens: H,
|
|
130
|
+
verticalAlign: U,
|
|
130
131
|
onChange: $
|
|
131
132
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ S(r, {
|
|
133
134
|
label: "",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ S(n, {
|
|
135
136
|
keys: ["text-overflow"],
|
|
136
137
|
label: "Overflow",
|
|
137
|
-
value:
|
|
138
|
+
value: W,
|
|
138
139
|
onChange: $("text-overflow"),
|
|
139
140
|
type: "select",
|
|
140
141
|
children: [
|
|
141
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ x("option", {
|
|
142
143
|
value: "clip",
|
|
143
144
|
children: "Clip"
|
|
144
145
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ x("option", {
|
|
146
147
|
value: "ellipsis",
|
|
147
148
|
children: "Ellipsis"
|
|
148
149
|
}),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ x("option", {
|
|
150
151
|
value: "string",
|
|
151
152
|
children: "String"
|
|
152
153
|
}),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ x("option", {
|
|
154
155
|
value: "initial",
|
|
155
156
|
children: "Initial"
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ x("option", {
|
|
158
159
|
value: "inherit",
|
|
159
160
|
children: "Inherit"
|
|
160
161
|
})
|
|
161
162
|
]
|
|
162
|
-
}), /* @__PURE__ */
|
|
163
|
-
value:
|
|
164
|
-
onChange:
|
|
163
|
+
}), /* @__PURE__ */ x(l, {
|
|
164
|
+
value: G,
|
|
165
|
+
onChange: ae
|
|
165
166
|
})]
|
|
166
167
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
value:
|
|
168
|
+
/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ x(h, {
|
|
169
|
+
value: L,
|
|
169
170
|
onChange: $("text-shadow")
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
fontVariantNumeric:
|
|
172
|
-
fontFeatureSettings:
|
|
173
|
-
textFillColor:
|
|
171
|
+
}), /* @__PURE__ */ x(d, {
|
|
172
|
+
fontVariantNumeric: Z,
|
|
173
|
+
fontFeatureSettings: Q,
|
|
174
|
+
textFillColor: ne,
|
|
174
175
|
onChange: $
|
|
175
176
|
})] })
|
|
176
177
|
]
|
|
177
178
|
});
|
|
178
179
|
});
|
|
179
180
|
//#endregion
|
|
180
|
-
export {
|
|
181
|
+
export { w as default };
|
|
@@ -1,30 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import i from "../../components/ShadowItem/index.mjs";
|
|
5
|
-
import { useCallback as a } from "react";
|
|
6
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
1
|
+
import { DEFAULT_SHADOW as e, serializeShadow as t } from "../../shadowValue.mjs";
|
|
2
|
+
import n from "../../components/ShadowList/index.mjs";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
4
|
//#region src/components/StyleInspector/categories/Typography/TypographyTextShadow.tsx
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
children: u.length > 0 && u.map((e, t) => /* @__PURE__ */ o(i, {
|
|
22
|
-
value: e,
|
|
23
|
-
withSpread: !1,
|
|
24
|
-
onChange: p(t),
|
|
25
|
-
onRemove: f(t)
|
|
26
|
-
}, t))
|
|
27
|
-
});
|
|
28
|
-
};
|
|
5
|
+
var i = ["text-shadow"], a = t({
|
|
6
|
+
...e,
|
|
7
|
+
y: "1px",
|
|
8
|
+
blur: "2px"
|
|
9
|
+
}, { withSpread: !1 }), o = ({ value: e, onChange: t }) => /* @__PURE__ */ r(n, {
|
|
10
|
+
label: "Text Shadow",
|
|
11
|
+
keys: i,
|
|
12
|
+
addLabel: "Add text shadow",
|
|
13
|
+
withSpread: !1,
|
|
14
|
+
added: a,
|
|
15
|
+
value: e,
|
|
16
|
+
onChange: t
|
|
17
|
+
});
|
|
29
18
|
//#endregion
|
|
30
|
-
export {
|
|
19
|
+
export { o as default };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** The values of `mix-blend-mode` and `background-blend-mode`, which share the list, with the words the inspector shows. */
|
|
2
|
+
export declare const BLEND_MODES: readonly [readonly ["normal", "Normal"], readonly ["multiply", "Multiply"], readonly ["screen", "Screen"], readonly ["overlay", "Overlay"], readonly ["darken", "Darken"], readonly ["lighten", "Lighten"], readonly ["color-dodge", "Color Dodge"], readonly ["color-burn", "Color Burn"], readonly ["hard-light", "Hard Light"], readonly ["soft-light", "Soft Light"], readonly ["difference", "Difference"], readonly ["exclusion", "Exclusion"], readonly ["hue", "Hue"], readonly ["saturation", "Saturation"], readonly ["color", "Color"], readonly ["luminosity", "Luminosity"]];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/categories/blendModes.ts
|
|
2
|
+
var e = [
|
|
3
|
+
["normal", "Normal"],
|
|
4
|
+
["multiply", "Multiply"],
|
|
5
|
+
["screen", "Screen"],
|
|
6
|
+
["overlay", "Overlay"],
|
|
7
|
+
["darken", "Darken"],
|
|
8
|
+
["lighten", "Lighten"],
|
|
9
|
+
["color-dodge", "Color Dodge"],
|
|
10
|
+
["color-burn", "Color Burn"],
|
|
11
|
+
["hard-light", "Hard Light"],
|
|
12
|
+
["soft-light", "Soft Light"],
|
|
13
|
+
["difference", "Difference"],
|
|
14
|
+
["exclusion", "Exclusion"],
|
|
15
|
+
["hue", "Hue"],
|
|
16
|
+
["saturation", "Saturation"],
|
|
17
|
+
["color", "Color"],
|
|
18
|
+
["luminosity", "Luminosity"]
|
|
19
|
+
];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { e as BLEND_MODES };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
/** The markers a list and a list item offer, as icon buttons: `list-style` and `list-style-type` take the same words. */
|
|
3
|
+
export declare const listMarkerItems: (current: StyleValue | undefined) => {
|
|
4
|
+
value: "none" | "circle" | "disc" | "square" | "decimal" | "lower-alpha" | "lower-roman";
|
|
5
|
+
icon: import('react').JSX.Element;
|
|
6
|
+
description: string;
|
|
7
|
+
active: boolean;
|
|
8
|
+
}[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "@plitzi/plitzi-ui/icons/XMark";
|
|
3
|
+
import n from "@plitzi/plitzi-ui/icons/ListCircles";
|
|
4
|
+
import r from "@plitzi/plitzi-ui/icons/ListDots";
|
|
5
|
+
import i from "@plitzi/plitzi-ui/icons/ListLetters";
|
|
6
|
+
import a from "@plitzi/plitzi-ui/icons/ListNumbers";
|
|
7
|
+
import o from "@plitzi/plitzi-ui/icons/ListRoman";
|
|
8
|
+
import s from "@plitzi/plitzi-ui/icons/ListSquares";
|
|
9
|
+
//#region src/components/StyleInspector/categories/listMarkers.tsx
|
|
10
|
+
var c = (c) => [
|
|
11
|
+
["none", /* @__PURE__ */ e(t, {}, "none")],
|
|
12
|
+
["disc", /* @__PURE__ */ e(r, {}, "disc")],
|
|
13
|
+
["circle", /* @__PURE__ */ e(n, {}, "circle")],
|
|
14
|
+
["square", /* @__PURE__ */ e(s, {}, "square")],
|
|
15
|
+
["decimal", /* @__PURE__ */ e(a, {}, "decimal")],
|
|
16
|
+
["lower-alpha", /* @__PURE__ */ e(i, {}, "lower-alpha")],
|
|
17
|
+
["lower-roman", /* @__PURE__ */ e(o, {}, "lower-roman")]
|
|
18
|
+
].map(([e, t]) => ({
|
|
19
|
+
value: e,
|
|
20
|
+
icon: t,
|
|
21
|
+
description: "",
|
|
22
|
+
active: c === e
|
|
23
|
+
}));
|
|
24
|
+
//#endregion
|
|
25
|
+
export { c as listMarkerItems };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
export type ShadowListProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
keys: StyleCategory[];
|
|
5
|
+
addLabel: string;
|
|
6
|
+
/** A box shadow has a spread; a text shadow has none. */
|
|
7
|
+
withSpread: boolean;
|
|
8
|
+
/** What "add" puts at the end of the list. */
|
|
9
|
+
added: string;
|
|
10
|
+
value?: StyleValue;
|
|
11
|
+
onChange?: (value: StyleValue | Record<StyleCategory, StyleValue> | boolean) => void;
|
|
12
|
+
};
|
|
13
|
+
/** A property that holds a list of shadows, one row each — added, edited and removed in place. */
|
|
14
|
+
declare const ShadowList: ({ label, keys, addLabel, withSpread, added, value, onChange }: ShadowListProps) => import('react').JSX.Element;
|
|
15
|
+
export default ShadowList;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { splitByCommaOutsideParens as e } from "../../cssValues.mjs";
|
|
2
|
+
import t from "../ValueList/index.mjs";
|
|
3
|
+
import n from "../ShadowItem/index.mjs";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/StyleInspector/components/ShadowList/ShadowList.tsx
|
|
7
|
+
var a = ({ label: a, keys: o, addLabel: s, withSpread: c, added: l, value: u, onChange: d }) => {
|
|
8
|
+
let f = typeof u == "string" && u !== "" ? e(u).map((e) => e.trim()) : [], p = r((e) => d?.(e.length > 0 ? e.join(", ") : ""), [d]), m = (e) => () => p(f.filter((t, n) => n !== e)), h = (e) => (t) => {
|
|
9
|
+
t !== f[e] && p(f.map((n, r) => r === e ? t : n));
|
|
10
|
+
};
|
|
11
|
+
return /* @__PURE__ */ i(t, {
|
|
12
|
+
label: a,
|
|
13
|
+
keys: o,
|
|
14
|
+
addLabel: s,
|
|
15
|
+
onAdd: () => p([...f, l]),
|
|
16
|
+
children: f.map((e, t) => /* @__PURE__ */ i(n, {
|
|
17
|
+
value: e,
|
|
18
|
+
withSpread: c,
|
|
19
|
+
onChange: h(t),
|
|
20
|
+
onRemove: m(t)
|
|
21
|
+
}, t))
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as default };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
-
/**
|
|
3
|
-
* Reading CSS values that hold lists — shadows, filters, transitions, background layers — where a comma or a space
|
|
4
|
-
* inside a function (`rgba(0, 0, 0, .5)`, `cubic-bezier(.4, 0, .2, 1)`) is not a separator.
|
|
5
|
-
*/
|
|
2
|
+
/** `a,,b` keeps the empty middle: a list written with a gap in it is read with the gap. */
|
|
6
3
|
export declare const splitByCommaOutsideParens: (value: string) => string[];
|
|
4
|
+
/** Runs of spaces are one separator. */
|
|
7
5
|
export declare const splitBySpaceOutsideParens: (value: string) => string[];
|
|
8
6
|
/**
|
|
9
7
|
* A value with its tokens (`var(--accent)`, `{{ accent }}`) replaced by what the space's variables say they are — for
|
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { get as e } from "@plitzi/plitzi-ui/helpers";
|
|
2
2
|
import { VARIABLE_REGEX as t } from "@plitzi/sdk-shared/schema/schemaConstants";
|
|
3
3
|
//#region src/components/StyleInspector/cssValues.ts
|
|
4
|
-
var n = (e) => {
|
|
5
|
-
let
|
|
6
|
-
for (let
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
var n = (e, t, n) => {
|
|
5
|
+
let r = [], i = "", a = 0;
|
|
6
|
+
for (let o of e) {
|
|
7
|
+
if (o === t && a === 0) {
|
|
8
|
+
(n || i) && r.push(i), i = "";
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
o === "(" ? a++ : o === ")" && a--, i += o;
|
|
9
12
|
}
|
|
10
|
-
return
|
|
11
|
-
}, r = (e) => {
|
|
12
|
-
let t = [], n = "", r = 0;
|
|
13
|
-
for (let i = 0; i < e.length; i++) {
|
|
14
|
-
let a = e[i];
|
|
15
|
-
a === "(" ? (r++, n += a) : a === ")" ? (r--, n += a) : a === " " && r === 0 ? (n && t.push(n), n = "") : n += a;
|
|
16
|
-
}
|
|
17
|
-
return n && t.push(n), t;
|
|
18
|
-
}, i = (n, r) => {
|
|
13
|
+
return i && r.push(i), r;
|
|
14
|
+
}, r = (e) => n(e, ",", !0), i = (e) => n(e, " ", !1), a = (n, r) => {
|
|
19
15
|
let i = n;
|
|
20
16
|
for (let a of n.matchAll(new RegExp(t, "g"))) {
|
|
21
17
|
let t = a[1] || a[2], n = e(r, t, void 0);
|
|
22
18
|
(typeof n == "string" || typeof n == "number") && (i = i.replace(a[0], String(n)));
|
|
23
19
|
}
|
|
24
20
|
return i;
|
|
25
|
-
},
|
|
21
|
+
}, o = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
26
22
|
//#endregion
|
|
27
|
-
export {
|
|
23
|
+
export { o as asText, a as resolveTokens, r as splitByCommaOutsideParens, i as splitBySpaceOutsideParens };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
/** What a `CategoryOption` hands its `onChange`: the union of every kind of control it can be. */
|
|
3
|
+
type OptionValue = StyleValue | Record<StyleCategory, StyleValue> | boolean;
|
|
4
|
+
/** A control's change handler for one property — `onChange={handleChange('width')}` — writing to what is selected. */
|
|
5
|
+
declare const usePropertyChange: () => (type: StyleCategory) => (value: OptionValue) => void;
|
|
6
|
+
export default usePropertyChange;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import e from "../StyleInspectorContext.mjs";
|
|
2
|
+
import { use as t, useCallback as n } from "react";
|
|
3
|
+
//#region src/components/StyleInspector/hooks/usePropertyChange.ts
|
|
4
|
+
var r = () => {
|
|
5
|
+
let { setValue: r } = t(e);
|
|
6
|
+
return n((e) => (t) => r(e, t), [r]);
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { r as default };
|