@plitzi/sdk-style 0.38.11 → 0.38.13

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 (43) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/dist/StyleMap/helpers/isValueValid.mjs +5 -4
  3. package/dist/StyleMap/helpers/utils.mjs +13 -12
  4. package/dist/components/StyleInspector/StyleInspector.mjs +217 -217
  5. package/dist/components/StyleInspector/categories/Background/Background.mjs +86 -147
  6. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.d.ts +8 -0
  7. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.mjs +28 -0
  8. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.d.ts +3 -0
  9. package/dist/components/StyleInspector/categories/Background/components/GradientCenter/index.mjs +5 -0
  10. package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +26 -48
  11. package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +45 -67
  12. package/dist/components/StyleInspector/categories/Display/Display.mjs +59 -58
  13. package/dist/components/StyleInspector/categories/Display/DisplayGap.d.ts +14 -1
  14. package/dist/components/StyleInspector/categories/Display/DisplayGap.mjs +26 -13
  15. package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +13 -24
  16. package/dist/components/StyleInspector/categories/Effects/Effects.mjs +41 -102
  17. package/dist/components/StyleInspector/categories/List/List.mjs +15 -65
  18. package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +15 -64
  19. package/dist/components/StyleInspector/categories/Others/Others.mjs +60 -60
  20. package/dist/components/StyleInspector/categories/Size/Size.mjs +67 -67
  21. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.d.ts +15 -0
  22. package/dist/components/StyleInspector/categories/Spacing/SpacingBox.mjs +63 -0
  23. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.d.ts +3 -11
  24. package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +18 -70
  25. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.d.ts +3 -7
  26. package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +16 -68
  27. package/dist/components/StyleInspector/categories/Typography/Typography.mjs +79 -78
  28. package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +17 -28
  29. package/dist/components/StyleInspector/categories/blendModes.d.ts +2 -0
  30. package/dist/components/StyleInspector/categories/blendModes.mjs +21 -0
  31. package/dist/components/StyleInspector/categories/listMarkers.d.ts +8 -0
  32. package/dist/components/StyleInspector/categories/listMarkers.mjs +25 -0
  33. package/dist/components/StyleInspector/components/ShadowList/ShadowList.d.ts +15 -0
  34. package/dist/components/StyleInspector/components/ShadowList/ShadowList.mjs +25 -0
  35. package/dist/components/StyleInspector/components/ShadowList/index.d.ts +3 -0
  36. package/dist/components/StyleInspector/components/ShadowList/index.mjs +5 -0
  37. package/dist/components/StyleInspector/cssValues.d.ts +2 -4
  38. package/dist/components/StyleInspector/cssValues.mjs +12 -16
  39. package/dist/components/StyleInspector/hooks/usePropertyChange.d.ts +6 -0
  40. package/dist/components/StyleInspector/hooks/usePropertyChange.mjs +9 -0
  41. package/package.json +44 -8
  42. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +0 -8
  43. package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +0 -27
@@ -1,70 +1,18 @@
1
- import e from "../../components/InspectorLabel/index.mjs";
2
- import t from "./SpacingNumber.mjs";
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-top",
8
- "padding-left",
9
- "padding-right",
10
- "padding-bottom"
11
- ], o = ({ fragmentSelected: o, values: s, isLinked: c = !1, onLinkSelected: l, onSelectFragment: u }) => {
12
- let d = n((e) => () => {
13
- e === o ? u?.(void 0) : u?.(e);
14
- }, [u, o]), { "padding-top": f, "padding-bottom": p, "padding-left": m, "padding-right": h } = s ?? {};
15
- return /* @__PURE__ */ i("div", {
16
- className: "relative grow rounded-md border border-gray-300 bg-gray-50 dark:border-zinc-600 dark:bg-zinc-800/70",
17
- children: [
18
- /* @__PURE__ */ i("div", {
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 { o as default };
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 "./TypographyAlign.mjs";
9
- import c from "./TypographyBreaking.mjs";
10
- import ee from "./TypographyClamp.mjs";
11
- import { weights as l } from "./TypographyConstants.mjs";
12
- import u from "./TypographyFigures.mjs";
13
- import d from "../../../../hooks/useSpaceFonts.mjs";
14
- import f from "./TypographyFont.mjs";
15
- import p from "./TypographyStyle.mjs";
16
- import m from "./TypographyTextShadow.mjs";
17
- import h from "./TypographyTransform.mjs";
18
- import { memo as g, use as _, useCallback as v } from "react";
19
- import { primaryFamily as y } from "@plitzi/sdk-shared/style";
20
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
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 S = [
23
+ var C = [
23
24
  "letter-spacing",
24
25
  "word-spacing",
25
26
  "text-indent"
26
- ], C = g(({ replaceTokens: g = !1, isCollapsed: C = !0, onCollapse: w }) => {
27
- let T = d(), { setValue: E } = _(e), { "font-family": D, "font-weight": O, "font-size": k, "font-style": A, "text-align": j, "text-decoration": M, "text-decoration-thickness": N, "text-underline-offset": P, "text-indent": te, "text-transform": F, "text-shadow": I, "white-space": L, "text-wrap": R, "word-break": z, "overflow-wrap": B, hyphens: V, "vertical-align": H, "text-overflow": U, "line-clamp": W, "line-height": G, color: K, "letter-spacing": q, "word-spacing": J, direction: Y, "font-variant-numeric": X, "font-feature-settings": Z, "-webkit-text-fill-color": Q } = t({
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: g
31
- }), ne = v((e) => w?.("typography", e), [w]), re = T.find((e) => e.family === y(typeof D == "string" ? D : "")), $ = v((e) => (t) => E(e, t), [E]), ie = v((e) => E(void 0, e), [E]);
32
- return /* @__PURE__ */ x(o, {
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: C,
37
- onCollapse: ne,
37
+ isCollapsed: w,
38
+ onCollapse: re,
38
39
  children: [
39
- /* @__PURE__ */ b(s, {
40
- partialValue: j,
40
+ /* @__PURE__ */ x(c, {
41
+ partialValue: M,
41
42
  onChange: $("text-align")
42
43
  }),
43
- /* @__PURE__ */ b(f, {
44
- partialValue: D,
44
+ /* @__PURE__ */ x(p, {
45
+ partialValue: O,
45
46
  onChange: $("font-family")
46
47
  }),
47
- /* @__PURE__ */ x(r, {
48
+ /* @__PURE__ */ S(r, {
48
49
  label: "",
49
- children: [/* @__PURE__ */ b(n, {
50
+ children: [/* @__PURE__ */ x(n, {
50
51
  keys: ["font-weight"],
51
52
  label: "Weight",
52
- value: O,
53
+ value: k,
53
54
  onChange: $("font-weight"),
54
55
  type: "select",
55
- children: Object.keys(l).map((e) => /* @__PURE__ */ b("option", {
56
+ children: Object.keys(u).map((e) => /* @__PURE__ */ x("option", {
56
57
  value: e,
57
- disabled: !re?.weights.includes(Number(e)),
58
- children: l[Number(e)]
58
+ disabled: !ie?.weights.includes(Number(e)),
59
+ children: u[Number(e)]
59
60
  }, e))
60
- }), /* @__PURE__ */ b(n, {
61
+ }), /* @__PURE__ */ x(n, {
61
62
  keys: ["color"],
62
63
  label: "Color",
63
64
  type: "color",
64
- value: K,
65
+ value: q,
65
66
  onChange: $("color")
66
67
  })]
67
68
  }),
68
- /* @__PURE__ */ x(r, {
69
+ /* @__PURE__ */ S(r, {
69
70
  label: "",
70
- children: [/* @__PURE__ */ b(n, {
71
+ children: [/* @__PURE__ */ x(n, {
71
72
  keys: ["font-size"],
72
73
  label: "Size",
73
- value: k,
74
+ value: A,
74
75
  onChange: $("font-size"),
75
76
  type: "metric"
76
- }), /* @__PURE__ */ b(n, {
77
+ }), /* @__PURE__ */ x(n, {
77
78
  keys: ["line-height"],
78
79
  label: "Line Height",
79
- value: G,
80
+ value: K,
80
81
  onChange: $("line-height"),
81
82
  type: "metric"
82
83
  })]
83
84
  }),
84
- /* @__PURE__ */ b(p, {
85
- fontStyle: A,
86
- textDecoration: M,
87
- textDecorationThickness: N,
85
+ /* @__PURE__ */ x(m, {
86
+ fontStyle: j,
87
+ textDecoration: N,
88
+ textDecorationThickness: te,
88
89
  textUnderlineOffset: P,
89
90
  onChange: $
90
91
  }),
91
- /* @__PURE__ */ x(r, {
92
+ /* @__PURE__ */ S(r, {
92
93
  label: "Spacing",
93
- keys: S,
94
+ keys: C,
94
95
  children: [
95
- /* @__PURE__ */ b(n, {
96
+ /* @__PURE__ */ x(n, {
96
97
  keys: ["letter-spacing"],
97
98
  label: "Letter",
98
- value: q,
99
+ value: J,
99
100
  onChange: $("letter-spacing"),
100
101
  type: "metric"
101
102
  }),
102
- /* @__PURE__ */ b(n, {
103
+ /* @__PURE__ */ x(n, {
103
104
  keys: ["word-spacing"],
104
105
  label: "Word",
105
- value: J,
106
+ value: Y,
106
107
  onChange: $("word-spacing"),
107
108
  type: "metric"
108
109
  }),
109
- /* @__PURE__ */ b(n, {
110
+ /* @__PURE__ */ x(n, {
110
111
  keys: ["text-indent"],
111
112
  label: "Indent",
112
- value: te,
113
+ value: F,
113
114
  onChange: $("text-indent"),
114
115
  type: "metric"
115
116
  })
116
117
  ]
117
118
  }),
118
- /* @__PURE__ */ b(h, {
119
- textTransform: F,
120
- direction: Y,
119
+ /* @__PURE__ */ x(g, {
120
+ textTransform: I,
121
+ direction: X,
121
122
  onChange: $
122
123
  }),
123
- /* @__PURE__ */ b(c, {
124
- whiteSpace: L,
125
- textWrap: R,
126
- wordBreak: z,
127
- overflowWrap: B,
128
- hyphens: V,
129
- verticalAlign: H,
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__ */ x(r, {
133
+ /* @__PURE__ */ S(r, {
133
134
  label: "",
134
- children: [/* @__PURE__ */ x(n, {
135
+ children: [/* @__PURE__ */ S(n, {
135
136
  keys: ["text-overflow"],
136
137
  label: "Overflow",
137
- value: U,
138
+ value: W,
138
139
  onChange: $("text-overflow"),
139
140
  type: "select",
140
141
  children: [
141
- /* @__PURE__ */ b("option", {
142
+ /* @__PURE__ */ x("option", {
142
143
  value: "clip",
143
144
  children: "Clip"
144
145
  }),
145
- /* @__PURE__ */ b("option", {
146
+ /* @__PURE__ */ x("option", {
146
147
  value: "ellipsis",
147
148
  children: "Ellipsis"
148
149
  }),
149
- /* @__PURE__ */ b("option", {
150
+ /* @__PURE__ */ x("option", {
150
151
  value: "string",
151
152
  children: "String"
152
153
  }),
153
- /* @__PURE__ */ b("option", {
154
+ /* @__PURE__ */ x("option", {
154
155
  value: "initial",
155
156
  children: "Initial"
156
157
  }),
157
- /* @__PURE__ */ b("option", {
158
+ /* @__PURE__ */ x("option", {
158
159
  value: "inherit",
159
160
  children: "Inherit"
160
161
  })
161
162
  ]
162
- }), /* @__PURE__ */ b(ee, {
163
- value: W,
164
- onChange: ie
163
+ }), /* @__PURE__ */ x(l, {
164
+ value: G,
165
+ onChange: ae
165
166
  })]
166
167
  }),
167
- /* @__PURE__ */ x(a, { children: [/* @__PURE__ */ b(m, {
168
- value: I,
168
+ /* @__PURE__ */ S(a, { children: [/* @__PURE__ */ x(h, {
169
+ value: L,
169
170
  onChange: $("text-shadow")
170
- }), /* @__PURE__ */ b(u, {
171
- fontVariantNumeric: X,
172
- fontFeatureSettings: Z,
173
- textFillColor: Q,
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 { C as default };
181
+ export { w as default };
@@ -1,30 +1,19 @@
1
- import { splitByCommaOutsideParens as e } from "../../cssValues.mjs";
2
- import t from "../../components/ValueList/index.mjs";
3
- import { DEFAULT_SHADOW as n, serializeShadow as r } from "../../shadowValue.mjs";
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 s = ["text-shadow"], c = ({ value: c, onChange: l }) => {
9
- let u = typeof c == "string" && c !== "" ? e(c).map((e) => e.trim()) : [], d = a((e) => l?.(e.length > 0 ? e.join(", ") : ""), [l]), f = (e) => () => d(u.filter((t, n) => n !== e)), p = (e) => (t) => {
10
- t !== u[e] && d(u.map((n, r) => r === e ? t : n));
11
- };
12
- return /* @__PURE__ */ o(t, {
13
- label: "Text Shadow",
14
- keys: s,
15
- addLabel: "Add text shadow",
16
- onAdd: () => d([...u, r({
17
- ...n,
18
- y: "1px",
19
- blur: "2px"
20
- }, { withSpread: !1 })]),
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 { c as default };
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 };
@@ -0,0 +1,3 @@
1
+ import { default as ShadowList } from './ShadowList';
2
+ export * from './ShadowList';
3
+ export default ShadowList;
@@ -0,0 +1,5 @@
1
+ import e from "./ShadowList.mjs";
2
+ //#region src/components/StyleInspector/components/ShadowList/index.ts
3
+ var t = e;
4
+ //#endregion
5
+ export { t 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 t = [], n = "", r = 0;
6
- for (let i = 0; i < e.length; i++) {
7
- let a = e[i];
8
- a === "(" ? (r++, n += a) : a === ")" ? (r--, n += a) : a === "," && r === 0 ? (t.push(n), n = "") : n += a;
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 n && t.push(n), t;
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
- }, a = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "";
21
+ }, o = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "";
26
22
  //#endregion
27
- export { a as asText, i as resolveTokens, n as splitByCommaOutsideParens, r as splitBySpaceOutsideParens };
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 };