@plitzi/sdk-style 0.37.8 → 0.37.10
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 +827 -0
- package/dist/BuilderStyleContextProvider.mjs +3 -3
- package/dist/StyleAdvanceEditor.mjs +25 -24
- package/dist/StyleContext.mjs +2 -3
- package/dist/StyleHelper.mjs +19 -24
- package/dist/StyleReducer.d.ts +4 -4
- package/dist/StyleReducer.mjs +44 -48
- package/dist/components/Selector/Selector.mjs +3 -3
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +39 -38
- package/dist/components/StyleInspector/categories/Others/Others.mjs +65 -74
- package/dist/components/StyleInspector/categories/Others/OthersScrollSnap.d.ts +16 -0
- package/dist/components/StyleInspector/categories/Others/OthersScrollSnap.mjs +93 -0
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +30 -30
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +8 -8
- package/dist/helpers/calculateInheriting.mjs +33 -33
- package/package.json +9 -5
|
@@ -6,108 +6,99 @@ import i from "./OthersForm.mjs";
|
|
|
6
6
|
import a from "./OthersInteraction.mjs";
|
|
7
7
|
import o from "./OthersOutline.mjs";
|
|
8
8
|
import s from "./OthersScrollbar.mjs";
|
|
9
|
-
import c from "./
|
|
10
|
-
import l from "./
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
9
|
+
import c from "./OthersScrollSnap.mjs";
|
|
10
|
+
import l from "./OthersSvg.mjs";
|
|
11
|
+
import u from "./OthersTable.mjs";
|
|
12
|
+
import { memo as d, use as f, useCallback as p } from "react";
|
|
13
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
13
14
|
//#region src/components/StyleInspector/categories/Others/Others.tsx
|
|
14
|
-
var
|
|
15
|
-
"pointer-events",
|
|
16
|
-
"user-select",
|
|
15
|
+
var g = /* @__PURE__ */ "pointer-events.user-select.touch-action.resize.appearance.scroll-behavior.overscroll-behavior.scroll-snap-type.scroll-snap-align.scroll-snap-stop.scroll-padding-top.scroll-margin-top.accent-color.caret-color.color-scheme.scrollbar-width.scrollbar-color.outline-width.outline-style.outline-color.outline-offset.border-collapse.border-spacing.table-layout.fill.stroke.stroke-width".split("."), _ = [
|
|
17
16
|
"touch-action",
|
|
18
17
|
"resize",
|
|
19
18
|
"appearance",
|
|
20
19
|
"scroll-behavior",
|
|
21
20
|
"overscroll-behavior",
|
|
21
|
+
"scroll-snap-type",
|
|
22
|
+
"scroll-snap-align",
|
|
23
|
+
"scroll-snap-stop",
|
|
24
|
+
"scroll-padding-top",
|
|
25
|
+
"scroll-margin-top",
|
|
22
26
|
"accent-color",
|
|
23
27
|
"caret-color",
|
|
24
28
|
"color-scheme",
|
|
25
29
|
"scrollbar-width",
|
|
26
30
|
"scrollbar-color",
|
|
27
|
-
"outline-width",
|
|
28
|
-
"outline-style",
|
|
29
|
-
"outline-color",
|
|
30
|
-
"outline-offset",
|
|
31
31
|
"border-collapse",
|
|
32
32
|
"border-spacing",
|
|
33
33
|
"table-layout",
|
|
34
34
|
"fill",
|
|
35
35
|
"stroke",
|
|
36
36
|
"stroke-width"
|
|
37
|
-
],
|
|
38
|
-
"touch-action",
|
|
39
|
-
|
|
40
|
-
"appearance",
|
|
41
|
-
"scroll-behavior",
|
|
42
|
-
"overscroll-behavior",
|
|
43
|
-
"accent-color",
|
|
44
|
-
"caret-color",
|
|
45
|
-
"color-scheme",
|
|
46
|
-
"scrollbar-width",
|
|
47
|
-
"scrollbar-color",
|
|
48
|
-
"border-collapse",
|
|
49
|
-
"border-spacing",
|
|
50
|
-
"table-layout",
|
|
51
|
-
"fill",
|
|
52
|
-
"stroke",
|
|
53
|
-
"stroke-width"
|
|
54
|
-
], _ = u(({ replaceTokens: u = !1, isCollapsed: _ = !0, onCollapse: v }) => {
|
|
55
|
-
let { setValue: y } = d(e), { "pointer-events": b, "user-select": x, "touch-action": S, resize: C, appearance: w, "scroll-behavior": T, "overscroll-behavior": E, "accent-color": D, "caret-color": O, "color-scheme": k, "scrollbar-width": A, "scrollbar-color": j, "outline-width": M, "outline-style": N, "outline-color": P, "outline-offset": F, "border-collapse": I, "border-spacing": L, "table-layout": R, fill: z, stroke: B, "stroke-width": V } = t({
|
|
56
|
-
keys: h,
|
|
37
|
+
], v = d(({ replaceTokens: d = !1, isCollapsed: v = !0, onCollapse: y }) => {
|
|
38
|
+
let { setValue: b } = f(e), { "pointer-events": x, "user-select": S, "touch-action": C, resize: w, appearance: T, "scroll-behavior": E, "overscroll-behavior": D, "scroll-snap-type": O, "scroll-snap-align": k, "scroll-snap-stop": A, "scroll-padding-top": j, "scroll-margin-top": M, "accent-color": N, "caret-color": P, "color-scheme": F, "scrollbar-width": I, "scrollbar-color": L, "outline-width": R, "outline-style": z, "outline-color": B, "outline-offset": V, "border-collapse": H, "border-spacing": U, "table-layout": W, fill: G, stroke: K, "stroke-width": q } = t({
|
|
39
|
+
keys: g,
|
|
57
40
|
asValue: !0,
|
|
58
|
-
replaceTokens:
|
|
59
|
-
}),
|
|
60
|
-
return /* @__PURE__ */
|
|
41
|
+
replaceTokens: d
|
|
42
|
+
}), J = p((e) => y?.("others", e), [y]), Y = p((e) => (t) => b(e, t), [b]);
|
|
43
|
+
return /* @__PURE__ */ h(r, {
|
|
61
44
|
title: "Others",
|
|
62
|
-
dotKeys:
|
|
63
|
-
advancedKeys:
|
|
64
|
-
isCollapsed:
|
|
65
|
-
onCollapse:
|
|
45
|
+
dotKeys: g,
|
|
46
|
+
advancedKeys: _,
|
|
47
|
+
isCollapsed: v,
|
|
48
|
+
onCollapse: J,
|
|
66
49
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
pointerEvents:
|
|
69
|
-
userSelect:
|
|
70
|
-
touchAction:
|
|
71
|
-
resize:
|
|
72
|
-
appearance:
|
|
73
|
-
scrollBehavior:
|
|
74
|
-
overscrollBehavior:
|
|
75
|
-
onChange:
|
|
50
|
+
/* @__PURE__ */ m(a, {
|
|
51
|
+
pointerEvents: x,
|
|
52
|
+
userSelect: S,
|
|
53
|
+
touchAction: C,
|
|
54
|
+
resize: w,
|
|
55
|
+
appearance: T,
|
|
56
|
+
scrollBehavior: E,
|
|
57
|
+
overscrollBehavior: D,
|
|
58
|
+
onChange: Y
|
|
76
59
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
outlineWidth:
|
|
79
|
-
outlineStyle:
|
|
80
|
-
outlineColor:
|
|
81
|
-
outlineOffset:
|
|
82
|
-
onChange:
|
|
60
|
+
/* @__PURE__ */ m(o, {
|
|
61
|
+
outlineWidth: R,
|
|
62
|
+
outlineStyle: z,
|
|
63
|
+
outlineColor: B,
|
|
64
|
+
outlineOffset: V,
|
|
65
|
+
onChange: Y
|
|
83
66
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
scrollbarWidth:
|
|
87
|
-
scrollbarColor:
|
|
88
|
-
onChange:
|
|
67
|
+
/* @__PURE__ */ h(n, { children: [
|
|
68
|
+
/* @__PURE__ */ m(s, {
|
|
69
|
+
scrollbarWidth: I,
|
|
70
|
+
scrollbarColor: L,
|
|
71
|
+
onChange: Y
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ m(c, {
|
|
74
|
+
scrollSnapType: O,
|
|
75
|
+
scrollSnapAlign: k,
|
|
76
|
+
scrollSnapStop: A,
|
|
77
|
+
scrollPaddingTop: j,
|
|
78
|
+
scrollMarginTop: M,
|
|
79
|
+
onChange: Y
|
|
89
80
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
accentColor:
|
|
92
|
-
caretColor:
|
|
93
|
-
colorScheme:
|
|
94
|
-
onChange:
|
|
81
|
+
/* @__PURE__ */ m(i, {
|
|
82
|
+
accentColor: N,
|
|
83
|
+
caretColor: P,
|
|
84
|
+
colorScheme: F,
|
|
85
|
+
onChange: Y
|
|
95
86
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
borderCollapse:
|
|
98
|
-
borderSpacing:
|
|
99
|
-
tableLayout:
|
|
100
|
-
onChange:
|
|
87
|
+
/* @__PURE__ */ m(u, {
|
|
88
|
+
borderCollapse: H,
|
|
89
|
+
borderSpacing: U,
|
|
90
|
+
tableLayout: W,
|
|
91
|
+
onChange: Y
|
|
101
92
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
fill:
|
|
104
|
-
stroke:
|
|
105
|
-
strokeWidth:
|
|
106
|
-
onChange:
|
|
93
|
+
/* @__PURE__ */ m(l, {
|
|
94
|
+
fill: G,
|
|
95
|
+
stroke: K,
|
|
96
|
+
strokeWidth: q,
|
|
97
|
+
onChange: Y
|
|
107
98
|
})
|
|
108
99
|
] })
|
|
109
100
|
]
|
|
110
101
|
});
|
|
111
102
|
});
|
|
112
103
|
//#endregion
|
|
113
|
-
export {
|
|
104
|
+
export { v as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
export type OthersScrollSnapProps = {
|
|
3
|
+
scrollSnapType?: StyleValue;
|
|
4
|
+
scrollSnapAlign?: StyleValue;
|
|
5
|
+
scrollSnapStop?: StyleValue;
|
|
6
|
+
scrollPaddingTop?: StyleValue;
|
|
7
|
+
scrollMarginTop?: StyleValue;
|
|
8
|
+
onChange?: (category: StyleCategory) => (value: StyleValue | Record<StyleCategory, StyleValue> | boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Where scrolling comes to rest. On the box that scrolls, the axis it snaps on; on each child, where it lines up — a row
|
|
12
|
+
* of cards that stops on a card, a carousel that stops on a slide. And for a page with a fixed header, the room an
|
|
13
|
+
* anchor lands with (`scroll-padding-top` on the page, `scroll-margin-top` on the section).
|
|
14
|
+
*/
|
|
15
|
+
declare const OthersScrollSnap: ({ scrollSnapType, scrollSnapAlign, scrollSnapStop, scrollPaddingTop, scrollMarginTop, onChange }: OthersScrollSnapProps) => import('react').JSX.Element;
|
|
16
|
+
export default OthersScrollSnap;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import e from "../../components/CategoryOption/index.mjs";
|
|
2
|
+
import t from "../../components/CategorySection/index.mjs";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/StyleInspector/categories/Others/OthersScrollSnap.tsx
|
|
5
|
+
var i = ({ scrollSnapType: i, scrollSnapAlign: a, scrollSnapStop: o, scrollPaddingTop: s, scrollMarginTop: c, onChange: l }) => /* @__PURE__ */ r(t, {
|
|
6
|
+
label: "Scroll snap",
|
|
7
|
+
children: [
|
|
8
|
+
/* @__PURE__ */ r(e, {
|
|
9
|
+
keys: ["scroll-snap-type"],
|
|
10
|
+
label: "Snap",
|
|
11
|
+
value: i,
|
|
12
|
+
onChange: l?.("scroll-snap-type"),
|
|
13
|
+
type: "select",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ n("option", {
|
|
16
|
+
value: "none",
|
|
17
|
+
children: "None"
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ n("option", {
|
|
20
|
+
value: "x mandatory",
|
|
21
|
+
children: "Across, always"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ n("option", {
|
|
24
|
+
value: "x proximity",
|
|
25
|
+
children: "Across, when close"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ n("option", {
|
|
28
|
+
value: "y mandatory",
|
|
29
|
+
children: "Down, always"
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ n("option", {
|
|
32
|
+
value: "y proximity",
|
|
33
|
+
children: "Down, when close"
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ r(e, {
|
|
38
|
+
keys: ["scroll-snap-align"],
|
|
39
|
+
label: "Align",
|
|
40
|
+
value: a,
|
|
41
|
+
onChange: l?.("scroll-snap-align"),
|
|
42
|
+
type: "select",
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ n("option", {
|
|
45
|
+
value: "none",
|
|
46
|
+
children: "None"
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ n("option", {
|
|
49
|
+
value: "start",
|
|
50
|
+
children: "Start"
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ n("option", {
|
|
53
|
+
value: "center",
|
|
54
|
+
children: "Center"
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ n("option", {
|
|
57
|
+
value: "end",
|
|
58
|
+
children: "End"
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ r(e, {
|
|
63
|
+
keys: ["scroll-snap-stop"],
|
|
64
|
+
label: "Stop",
|
|
65
|
+
value: o,
|
|
66
|
+
onChange: l?.("scroll-snap-stop"),
|
|
67
|
+
type: "select",
|
|
68
|
+
children: [/* @__PURE__ */ n("option", {
|
|
69
|
+
value: "normal",
|
|
70
|
+
children: "Normal"
|
|
71
|
+
}), /* @__PURE__ */ n("option", {
|
|
72
|
+
value: "always",
|
|
73
|
+
children: "Always"
|
|
74
|
+
})]
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ n(e, {
|
|
77
|
+
keys: ["scroll-padding-top"],
|
|
78
|
+
label: "Padding top",
|
|
79
|
+
value: s,
|
|
80
|
+
onChange: l?.("scroll-padding-top"),
|
|
81
|
+
type: "input"
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ n(e, {
|
|
84
|
+
keys: ["scroll-margin-top"],
|
|
85
|
+
label: "Margin top",
|
|
86
|
+
value: c,
|
|
87
|
+
onChange: l?.("scroll-margin-top"),
|
|
88
|
+
type: "input"
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
export { i as default };
|
|
@@ -15,8 +15,8 @@ import f from "./TypographyStyle.mjs";
|
|
|
15
15
|
import p from "./TypographyTextShadow.mjs";
|
|
16
16
|
import m from "./TypographyTransform.mjs";
|
|
17
17
|
import { memo as h, use as g, useCallback as _ } from "react";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
18
|
+
import { primaryFamily as v } from "@plitzi/sdk-shared/style";
|
|
19
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
20
20
|
//#region src/components/StyleInspector/categories/Typography/Typography.tsx
|
|
21
21
|
var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.text-align.font-style.text-decoration.text-decoration-thickness.text-underline-offset.letter-spacing.word-spacing.text-indent.text-transform.direction.text-shadow.white-space.text-wrap.word-break.overflow-wrap.hyphens.vertical-align.text-overflow.line-clamp.font-variant-numeric.font-feature-settings.-webkit-text-fill-color".split("."), S = [
|
|
22
22
|
"text-decoration-thickness",
|
|
@@ -38,36 +38,36 @@ var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.tex
|
|
|
38
38
|
keys: x,
|
|
39
39
|
asValue: !0,
|
|
40
40
|
replaceTokens: h
|
|
41
|
-
}), re = _((e) => T?.("typography", e), [T]), ie = E.find((e) => e.family ===
|
|
42
|
-
return /* @__PURE__ */
|
|
41
|
+
}), re = _((e) => T?.("typography", e), [T]), ie = E.find((e) => e.family === v(typeof O == "string" ? O : "")), $ = _((e) => (t) => D(e, t), [D]), ae = _((e) => D(void 0, e), [D]);
|
|
42
|
+
return /* @__PURE__ */ b(a, {
|
|
43
43
|
title: "Typography",
|
|
44
44
|
dotKeys: x,
|
|
45
45
|
advancedKeys: S,
|
|
46
46
|
isCollapsed: w,
|
|
47
47
|
onCollapse: re,
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ y(ee, {
|
|
50
50
|
partialValue: M,
|
|
51
51
|
onChange: $("text-align")
|
|
52
52
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
53
|
+
/* @__PURE__ */ y(d, {
|
|
54
54
|
partialValue: O,
|
|
55
55
|
onChange: $("font-family")
|
|
56
56
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
57
|
+
/* @__PURE__ */ b(r, {
|
|
58
58
|
label: "",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
59
|
+
children: [/* @__PURE__ */ y(n, {
|
|
60
60
|
keys: ["font-weight"],
|
|
61
61
|
label: "Weight",
|
|
62
62
|
value: k,
|
|
63
63
|
onChange: $("font-weight"),
|
|
64
64
|
type: "select",
|
|
65
|
-
children: Object.keys(c).map((e) => /* @__PURE__ */
|
|
65
|
+
children: Object.keys(c).map((e) => /* @__PURE__ */ y("option", {
|
|
66
66
|
value: e,
|
|
67
67
|
disabled: !ie?.weights.includes(Number(e)),
|
|
68
68
|
children: c[Number(e)]
|
|
69
69
|
}, e))
|
|
70
|
-
}), /* @__PURE__ */
|
|
70
|
+
}), /* @__PURE__ */ y(n, {
|
|
71
71
|
keys: ["color"],
|
|
72
72
|
label: "Color",
|
|
73
73
|
type: "color",
|
|
@@ -75,15 +75,15 @@ var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.tex
|
|
|
75
75
|
onChange: $("color")
|
|
76
76
|
})]
|
|
77
77
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ b(r, {
|
|
79
79
|
label: "",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ y(n, {
|
|
81
81
|
keys: ["font-size"],
|
|
82
82
|
label: "Size",
|
|
83
83
|
value: A,
|
|
84
84
|
onChange: $("font-size"),
|
|
85
85
|
type: "metric"
|
|
86
|
-
}), /* @__PURE__ */
|
|
86
|
+
}), /* @__PURE__ */ y(n, {
|
|
87
87
|
keys: ["line-height"],
|
|
88
88
|
label: "Line Height",
|
|
89
89
|
value: K,
|
|
@@ -91,32 +91,32 @@ var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.tex
|
|
|
91
91
|
type: "metric"
|
|
92
92
|
})]
|
|
93
93
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ y(f, {
|
|
95
95
|
fontStyle: j,
|
|
96
96
|
textDecoration: N,
|
|
97
97
|
textDecorationThickness: P,
|
|
98
98
|
textUnderlineOffset: te,
|
|
99
99
|
onChange: $
|
|
100
100
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ b(r, {
|
|
102
102
|
label: "Letter",
|
|
103
103
|
keys: C,
|
|
104
104
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ y(n, {
|
|
106
106
|
keys: ["letter-spacing"],
|
|
107
107
|
label: "Spacing",
|
|
108
108
|
value: J,
|
|
109
109
|
onChange: $("letter-spacing"),
|
|
110
110
|
type: "metric"
|
|
111
111
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ y(n, {
|
|
113
113
|
keys: ["word-spacing"],
|
|
114
114
|
label: "Word",
|
|
115
115
|
value: Y,
|
|
116
116
|
onChange: $("word-spacing"),
|
|
117
117
|
type: "metric"
|
|
118
118
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ y(n, {
|
|
120
120
|
keys: ["text-indent"],
|
|
121
121
|
label: "Indent",
|
|
122
122
|
value: F,
|
|
@@ -125,12 +125,12 @@ var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.tex
|
|
|
125
125
|
})
|
|
126
126
|
]
|
|
127
127
|
}),
|
|
128
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ y(m, {
|
|
129
129
|
textTransform: I,
|
|
130
130
|
direction: X,
|
|
131
131
|
onChange: $
|
|
132
132
|
}),
|
|
133
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ y(o, {
|
|
134
134
|
whiteSpace: R,
|
|
135
135
|
textWrap: z,
|
|
136
136
|
wordBreak: B,
|
|
@@ -139,45 +139,45 @@ var x = /* @__PURE__ */ "font-family.font-weight.font-size.line-height.color.tex
|
|
|
139
139
|
verticalAlign: U,
|
|
140
140
|
onChange: $
|
|
141
141
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ b(r, {
|
|
143
143
|
label: "",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
144
|
+
children: [/* @__PURE__ */ b(n, {
|
|
145
145
|
keys: ["text-overflow"],
|
|
146
146
|
label: "Overflow",
|
|
147
147
|
value: W,
|
|
148
148
|
onChange: $("text-overflow"),
|
|
149
149
|
type: "select",
|
|
150
150
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ y("option", {
|
|
152
152
|
value: "clip",
|
|
153
153
|
children: "Clip"
|
|
154
154
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ y("option", {
|
|
156
156
|
value: "ellipsis",
|
|
157
157
|
children: "Ellipsis"
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ y("option", {
|
|
160
160
|
value: "string",
|
|
161
161
|
children: "String"
|
|
162
162
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ y("option", {
|
|
164
164
|
value: "initial",
|
|
165
165
|
children: "Initial"
|
|
166
166
|
}),
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ y("option", {
|
|
168
168
|
value: "inherit",
|
|
169
169
|
children: "Inherit"
|
|
170
170
|
})
|
|
171
171
|
]
|
|
172
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ y(s, {
|
|
173
173
|
value: G,
|
|
174
174
|
onChange: ae
|
|
175
175
|
})]
|
|
176
176
|
}),
|
|
177
|
-
/* @__PURE__ */
|
|
177
|
+
/* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(p, {
|
|
178
178
|
value: L,
|
|
179
179
|
onChange: $("text-shadow")
|
|
180
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ y(l, {
|
|
181
181
|
fontVariantNumeric: Z,
|
|
182
182
|
fontFeatureSettings: Q,
|
|
183
183
|
textFillColor: ne,
|
|
@@ -2,23 +2,23 @@ import e from "../../components/CategoryOption/index.mjs";
|
|
|
2
2
|
import t from "../../components/CategorySection/index.mjs";
|
|
3
3
|
import n from "../../../../hooks/useSpaceFonts.mjs";
|
|
4
4
|
import { useCallback as r } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { fontFamilyStack as i, primaryFamily as a } from "@plitzi/sdk-shared/style";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/StyleInspector/categories/Typography/TypographyFont.tsx
|
|
8
8
|
var s = ({ partialValue: s, onChange: c }) => {
|
|
9
|
-
let l = n(), u = typeof s == "string" ?
|
|
9
|
+
let l = n(), u = typeof s == "string" ? a(s) : "", d = r((e) => {
|
|
10
10
|
let t = l.find((t) => t.family === e);
|
|
11
|
-
c?.(t ?
|
|
11
|
+
c?.(t ? i(t) : e);
|
|
12
12
|
}, [l, c]);
|
|
13
|
-
return /* @__PURE__ */
|
|
13
|
+
return /* @__PURE__ */ o(t, {
|
|
14
14
|
label: "F. Family",
|
|
15
15
|
keys: ["font-family"],
|
|
16
|
-
children: /* @__PURE__ */
|
|
16
|
+
children: /* @__PURE__ */ o(e, {
|
|
17
17
|
value: u,
|
|
18
18
|
onChange: d,
|
|
19
19
|
type: "select",
|
|
20
|
-
children: l.map((e) => /* @__PURE__ */
|
|
21
|
-
style: { fontFamily:
|
|
20
|
+
children: l.map((e) => /* @__PURE__ */ o("option", {
|
|
21
|
+
style: { fontFamily: i(e) },
|
|
22
22
|
value: e.family,
|
|
23
23
|
children: e.family
|
|
24
24
|
}, e.family))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { inheritableAttributesBase as e } from "@plitzi/sdk-shared/style";
|
|
2
|
+
import { get as t, pick as n } from "@plitzi/plitzi-ui/helpers";
|
|
3
3
|
//#region src/helpers/calculateInheriting.ts
|
|
4
4
|
var r = (e, t) => {
|
|
5
5
|
let n = [], r = t;
|
|
@@ -28,12 +28,12 @@ var r = (e, t) => {
|
|
|
28
28
|
e && e.name && !["class", "element"].includes(e.type) && (o.has(e.name) || (o.add(e.name), a.push(e)));
|
|
29
29
|
}
|
|
30
30
|
return a;
|
|
31
|
-
}, a = (
|
|
32
|
-
let a =
|
|
31
|
+
}, a = (e, n, r, i) => {
|
|
32
|
+
let a = t(i, `${e}.defaultStyle`, void 0);
|
|
33
33
|
if (a) return a.subTypes && !n && (n = Object.keys(a.subTypes)[0]), n && a.subTypes?.[n] && (a = a.subTypes[n]), {
|
|
34
34
|
name: "defaultStyle",
|
|
35
|
-
attributes: { [r]:
|
|
36
|
-
componentType:
|
|
35
|
+
attributes: { [r]: t(a, `style.${r}`, {}) },
|
|
36
|
+
componentType: e,
|
|
37
37
|
isParent: !1,
|
|
38
38
|
isAncestor: !1,
|
|
39
39
|
isDefault: !0
|
|
@@ -58,21 +58,21 @@ var r = (e, t) => {
|
|
|
58
58
|
...c,
|
|
59
59
|
...l
|
|
60
60
|
};
|
|
61
|
-
}, s = (e, t, n, r, i) => o(e.attributes, t, n, r, i), c = (
|
|
61
|
+
}, s = (e, t, n, r, i) => o(e.attributes, t, n, r, i), c = (t, o, c, l, u = {}, d = {}) => {
|
|
62
62
|
let { componentSubType: f, styleSelector: p = "base", styleState: m, styleVariant: h, styleAncestor: g, includeSelf: _ = !1, skipSelectors: v = [], addSelectors: y = [] } = d, b = {
|
|
63
63
|
tree: [],
|
|
64
64
|
style: {},
|
|
65
65
|
parentStyle: {}
|
|
66
|
-
}, x =
|
|
67
|
-
for (let
|
|
68
|
-
let n = l[
|
|
66
|
+
}, x = t ? r(c, t) : [], S = /* @__PURE__ */ new Set();
|
|
67
|
+
for (let e of Object.keys(l)) {
|
|
68
|
+
let n = l[e];
|
|
69
69
|
if (n) {
|
|
70
|
-
if (!
|
|
71
|
-
for (let
|
|
72
|
-
let r = n[
|
|
70
|
+
if (!t && !o) {
|
|
71
|
+
for (let t of y) {
|
|
72
|
+
let r = n[t];
|
|
73
73
|
r && b.tree.push({
|
|
74
|
-
name:
|
|
75
|
-
displayMode:
|
|
74
|
+
name: t,
|
|
75
|
+
displayMode: e,
|
|
76
76
|
attributes: r.attributes,
|
|
77
77
|
isParent: !1,
|
|
78
78
|
isAncestor: !1
|
|
@@ -80,8 +80,8 @@ var r = (e, t) => {
|
|
|
80
80
|
}
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
|
-
if (!
|
|
84
|
-
let
|
|
83
|
+
if (!t && o) {
|
|
84
|
+
let t = i({
|
|
85
85
|
definition: {
|
|
86
86
|
type: o,
|
|
87
87
|
styleSelectors: {},
|
|
@@ -89,9 +89,9 @@ var r = (e, t) => {
|
|
|
89
89
|
},
|
|
90
90
|
attributes: {}
|
|
91
91
|
}, o, n, p, y);
|
|
92
|
-
for (let n of
|
|
92
|
+
for (let n of t) v.includes(n.name) || b.tree.push({
|
|
93
93
|
name: n.name,
|
|
94
|
-
displayMode:
|
|
94
|
+
displayMode: e,
|
|
95
95
|
attributes: n.attributes,
|
|
96
96
|
isParent: !1,
|
|
97
97
|
isAncestor: !1
|
|
@@ -99,18 +99,18 @@ var r = (e, t) => {
|
|
|
99
99
|
let r = a(o, f, p, u);
|
|
100
100
|
r && b.tree.push({
|
|
101
101
|
...r,
|
|
102
|
-
displayMode:
|
|
102
|
+
displayMode: e
|
|
103
103
|
});
|
|
104
104
|
continue;
|
|
105
105
|
}
|
|
106
106
|
for (let r of x) {
|
|
107
|
-
let s =
|
|
107
|
+
let s = t?.definition.parentId === r.id, c = r.id !== t?.id, l = i(r, r.definition.type === o ? o : void 0, n, p, y);
|
|
108
108
|
!_ && !c && !m && !h && Object.keys(l).length && (l = l.filter((e) => e.type === "element"));
|
|
109
|
-
for (let
|
|
110
|
-
name:
|
|
111
|
-
displayMode:
|
|
112
|
-
attributes:
|
|
113
|
-
componentType:
|
|
109
|
+
for (let t of l) (!v.includes(t.name) || c) && b.tree.push({
|
|
110
|
+
name: t.name,
|
|
111
|
+
displayMode: e,
|
|
112
|
+
attributes: t.attributes,
|
|
113
|
+
componentType: t.componentType,
|
|
114
114
|
isParent: s,
|
|
115
115
|
isAncestor: c,
|
|
116
116
|
isDefault: !1
|
|
@@ -118,7 +118,7 @@ var r = (e, t) => {
|
|
|
118
118
|
let d = a(r.definition.type, r.attributes.subType, p, u);
|
|
119
119
|
d && !S.has(r.definition.type) && (S.add(r.definition.type), b.tree.push({
|
|
120
120
|
...d,
|
|
121
|
-
displayMode:
|
|
121
|
+
displayMode: e,
|
|
122
122
|
isParent: s,
|
|
123
123
|
isAncestor: !1
|
|
124
124
|
}));
|
|
@@ -126,12 +126,12 @@ var r = (e, t) => {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
let C = {};
|
|
129
|
-
for (let
|
|
130
|
-
let r = s(
|
|
131
|
-
if (r && Object.keys(r).length && ((
|
|
132
|
-
key:
|
|
133
|
-
value: r[
|
|
134
|
-
displayMode:
|
|
129
|
+
for (let t of b.tree) {
|
|
130
|
+
let r = s(t, p, m, h, g);
|
|
131
|
+
if (r && Object.keys(r).length && ((t.isAncestor || t.isDefault && t.componentType !== o) && (r = n(r, e)), Object.keys(r).length)) for (let e of Object.keys(r)) C[e] || (C[e] = []), C[e].push({
|
|
132
|
+
key: t.name,
|
|
133
|
+
value: r[e],
|
|
134
|
+
displayMode: t.displayMode
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
let w = b.tree.filter((e) => e.isParent).reduce((e, t) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plitzi/sdk-style",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.10",
|
|
4
4
|
"license": "AGPL-3.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -526,6 +526,10 @@
|
|
|
526
526
|
"types": "./dist/components/StyleInspector/categories/Others/OthersOutline.d.ts",
|
|
527
527
|
"import": "./dist/components/StyleInspector/categories/Others/OthersOutline.mjs"
|
|
528
528
|
},
|
|
529
|
+
"./components/StyleInspector/categories/Others/OthersScrollSnap": {
|
|
530
|
+
"types": "./dist/components/StyleInspector/categories/Others/OthersScrollSnap.d.ts",
|
|
531
|
+
"import": "./dist/components/StyleInspector/categories/Others/OthersScrollSnap.mjs"
|
|
532
|
+
},
|
|
529
533
|
"./components/StyleInspector/categories/Others/OthersScrollbar": {
|
|
530
534
|
"types": "./dist/components/StyleInspector/categories/Others/OthersScrollbar.d.ts",
|
|
531
535
|
"import": "./dist/components/StyleInspector/categories/Others/OthersScrollbar.mjs"
|
|
@@ -936,10 +940,10 @@
|
|
|
936
940
|
"build:prod": "vite build && node ../sdk-shared/scripts/generate-exports.mjs"
|
|
937
941
|
},
|
|
938
942
|
"dependencies": {
|
|
939
|
-
"@plitzi/plitzi-ui": "^1.6.
|
|
940
|
-
"@plitzi/sdk-plugins": "0.37.
|
|
941
|
-
"@plitzi/sdk-shared": "0.37.
|
|
942
|
-
"@plitzi/sdk-variables": "0.37.
|
|
943
|
+
"@plitzi/plitzi-ui": "^1.6.29",
|
|
944
|
+
"@plitzi/sdk-plugins": "0.37.10",
|
|
945
|
+
"@plitzi/sdk-shared": "0.37.10",
|
|
946
|
+
"@plitzi/sdk-variables": "0.37.10",
|
|
943
947
|
"clsx": "^2.1.1",
|
|
944
948
|
"immer": "^11.1.18",
|
|
945
949
|
"prop-types": "^15.8.1",
|