@plitzi/sdk-style 0.33.2 → 0.34.1
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 +26 -0
- package/dist/BuilderStyleContextProvider.d.ts +11 -2
- package/dist/BuilderStyleContextProvider.mjs +76 -54
- package/dist/SdkStyleContextProvider.mjs +4 -4
- package/dist/StyleAdvanceEditor.mjs +30 -30
- package/dist/StyleMap/StyleMap.d.ts +14 -1
- package/dist/StyleMap/StyleMap.mjs +24 -2
- package/dist/StyleMap/helpers/isValueValid.mjs +1 -1
- package/dist/StyleReducer.d.ts +15 -4
- package/dist/StyleReducer.mjs +39 -18
- package/dist/components/InputEasing/InputEasing.mjs +21 -21
- package/dist/components/InputEasing/InputEasingButton.mjs +5 -5
- package/dist/components/InputEasing/InputEasingList.mjs +76 -76
- package/dist/components/Selector/Selector.mjs +29 -29
- package/dist/components/Selector/SelectorItem/ItemOptions.mjs +16 -16
- package/dist/components/Selector/SelectorItem/SelectorItem.mjs +10 -10
- package/dist/components/StyleInspector/Inspector.mjs +33 -33
- package/dist/components/StyleInspector/StyleInspector.mjs +45 -45
- package/dist/components/StyleInspector/StyleInspectorProvider.mjs +14 -14
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +46 -46
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +20 -20
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +11 -11
- package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +20 -20
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayAlignSelf.mjs +12 -12
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +22 -21
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +66 -65
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +2 -0
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +18 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +15 -15
- package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +16 -16
- package/dist/components/StyleInspector/categories/Spacing/SpacingEditor.mjs +12 -12
- package/dist/components/StyleInspector/categories/Spacing/SpacingNumber.mjs +5 -5
- package/dist/components/StyleInspector/categories/Typography/Typography.d.ts +1 -5
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +58 -57
- package/dist/components/StyleInspector/categories/Typography/TypographyConstants.d.ts +0 -4
- package/dist/components/StyleInspector/categories/Typography/TypographyConstants.mjs +2 -160
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.d.ts +1 -4
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +24 -17
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +15 -15
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +17 -17
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.mjs +8 -8
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.mjs +4 -4
- package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +13 -13
- package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +13 -13
- package/dist/components/StyleInspector/hooks/useStyleBinding.mjs +12 -12
- package/dist/components/StyleInspector/hooks/useStyleInherit.mjs +3 -3
- package/dist/components/StyleManager/ManagerSelector.mjs +35 -35
- package/dist/components/StyleManager/StyleManager.mjs +12 -12
- package/dist/components/StyleManager/StyleSelectorTag.mjs +20 -20
- package/dist/helpers/calculateInheriting.mjs +2 -2
- package/dist/helpers/generateStyleSelector.mjs +1 -1
- package/dist/helpers/processSelectorAttributes.mjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/useSpaceFonts.d.ts +10 -0
- package/dist/hooks/useSpaceFonts.mjs +10 -0
- package/dist/index.mjs +16 -16
- package/package.json +26 -9
|
@@ -7,15 +7,17 @@ import a from "../../components/CategoryContainer/index.mjs";
|
|
|
7
7
|
import o from "./TypographyAlign.mjs";
|
|
8
8
|
import s from "./TypographyBreaking.mjs";
|
|
9
9
|
import c from "./TypographyClamp.mjs";
|
|
10
|
-
import {
|
|
10
|
+
import { weights as l } from "./TypographyConstants.mjs";
|
|
11
|
+
import u from "../../../../hooks/useSpaceFonts.mjs";
|
|
11
12
|
import d from "./TypographyFont.mjs";
|
|
12
13
|
import f from "./TypographyStyle.mjs";
|
|
13
14
|
import p from "./TypographyTextShadow.mjs";
|
|
14
15
|
import m from "./TypographyTransform.mjs";
|
|
15
16
|
import { memo as h, use as g, useCallback as _ } from "react";
|
|
16
17
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
18
|
+
import { primaryFamily as b } from "@plitzi/sdk-shared/style";
|
|
17
19
|
//#region src/components/StyleInspector/categories/Typography/Typography.tsx
|
|
18
|
-
var
|
|
20
|
+
var x = [
|
|
19
21
|
"font-family",
|
|
20
22
|
"font-weight",
|
|
21
23
|
"font-size",
|
|
@@ -40,7 +42,7 @@ var b = [
|
|
|
40
42
|
"vertical-align",
|
|
41
43
|
"text-overflow",
|
|
42
44
|
"line-clamp"
|
|
43
|
-
],
|
|
45
|
+
], S = [
|
|
44
46
|
"text-decoration-thickness",
|
|
45
47
|
"text-underline-offset",
|
|
46
48
|
"word-break",
|
|
@@ -48,51 +50,50 @@ var b = [
|
|
|
48
50
|
"hyphens",
|
|
49
51
|
"vertical-align",
|
|
50
52
|
"text-shadow"
|
|
51
|
-
],
|
|
53
|
+
], C = [
|
|
52
54
|
"letter-spacing",
|
|
53
55
|
"word-spacing",
|
|
54
56
|
"text-indent"
|
|
55
|
-
],
|
|
56
|
-
let { setValue:
|
|
57
|
-
keys:
|
|
57
|
+
], w = h(({ replaceTokens: h = !1, isCollapsed: w = !0, onCollapse: T }) => {
|
|
58
|
+
let E = u(), { setValue: D } = g(e), { "font-family": O, "font-weight": k, "font-size": A, "font-style": j, "text-align": M, "text-decoration": N, "text-decoration-thickness": P, "text-underline-offset": F, "text-indent": ee, "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 } = t({
|
|
59
|
+
keys: x,
|
|
58
60
|
asValue: !0,
|
|
59
61
|
replaceTokens: h
|
|
60
|
-
}),
|
|
62
|
+
}), Z = _((e) => T?.("typography", e), [T]), Q = E.find((e) => e.family === b(typeof O == "string" ? O : "")), $ = _((e) => (t) => D(e, t), [D]), te = _((e) => D(void 0, e), [D]);
|
|
61
63
|
return /* @__PURE__ */ y(a, {
|
|
62
64
|
title: "Typography",
|
|
63
|
-
dotKeys:
|
|
64
|
-
advancedKeys:
|
|
65
|
-
isCollapsed:
|
|
66
|
-
onCollapse:
|
|
65
|
+
dotKeys: x,
|
|
66
|
+
advancedKeys: S,
|
|
67
|
+
isCollapsed: w,
|
|
68
|
+
onCollapse: Z,
|
|
67
69
|
children: [
|
|
68
70
|
/* @__PURE__ */ v(o, {
|
|
69
|
-
partialValue:
|
|
70
|
-
onChange:
|
|
71
|
+
partialValue: M,
|
|
72
|
+
onChange: $("text-align")
|
|
71
73
|
}),
|
|
72
74
|
/* @__PURE__ */ v(d, {
|
|
73
|
-
partialValue:
|
|
74
|
-
|
|
75
|
-
onChange: Q("font-family")
|
|
75
|
+
partialValue: O,
|
|
76
|
+
onChange: $("font-family")
|
|
76
77
|
}),
|
|
77
78
|
/* @__PURE__ */ y(r, {
|
|
78
79
|
label: "",
|
|
79
80
|
children: [/* @__PURE__ */ v(n, {
|
|
80
81
|
keys: ["font-weight"],
|
|
81
82
|
label: "Weight",
|
|
82
|
-
value:
|
|
83
|
-
onChange:
|
|
83
|
+
value: k,
|
|
84
|
+
onChange: $("font-weight"),
|
|
84
85
|
type: "select",
|
|
85
|
-
children: Object.keys(
|
|
86
|
+
children: Object.keys(l).map((e) => /* @__PURE__ */ v("option", {
|
|
86
87
|
value: e,
|
|
87
|
-
disabled: !
|
|
88
|
-
children:
|
|
88
|
+
disabled: !Q?.weights.includes(Number(e)),
|
|
89
|
+
children: l[Number(e)]
|
|
89
90
|
}, e))
|
|
90
91
|
}), /* @__PURE__ */ v(n, {
|
|
91
92
|
keys: ["color"],
|
|
92
93
|
label: "Color",
|
|
93
94
|
type: "color",
|
|
94
|
-
value:
|
|
95
|
-
onChange:
|
|
95
|
+
value: q,
|
|
96
|
+
onChange: $("color")
|
|
96
97
|
})]
|
|
97
98
|
}),
|
|
98
99
|
/* @__PURE__ */ y(r, {
|
|
@@ -100,72 +101,72 @@ var b = [
|
|
|
100
101
|
children: [/* @__PURE__ */ v(n, {
|
|
101
102
|
keys: ["font-size"],
|
|
102
103
|
label: "Size",
|
|
103
|
-
value:
|
|
104
|
-
onChange:
|
|
104
|
+
value: A,
|
|
105
|
+
onChange: $("font-size"),
|
|
105
106
|
type: "metric"
|
|
106
107
|
}), /* @__PURE__ */ v(n, {
|
|
107
108
|
keys: ["line-height"],
|
|
108
109
|
label: "Line Height",
|
|
109
|
-
value:
|
|
110
|
-
onChange:
|
|
110
|
+
value: K,
|
|
111
|
+
onChange: $("line-height"),
|
|
111
112
|
type: "metric"
|
|
112
113
|
})]
|
|
113
114
|
}),
|
|
114
115
|
/* @__PURE__ */ v(f, {
|
|
115
|
-
fontStyle:
|
|
116
|
-
textDecoration:
|
|
117
|
-
textDecorationThickness:
|
|
118
|
-
textUnderlineOffset:
|
|
119
|
-
onChange:
|
|
116
|
+
fontStyle: j,
|
|
117
|
+
textDecoration: N,
|
|
118
|
+
textDecorationThickness: P,
|
|
119
|
+
textUnderlineOffset: F,
|
|
120
|
+
onChange: $
|
|
120
121
|
}),
|
|
121
122
|
/* @__PURE__ */ y(r, {
|
|
122
123
|
label: "Letter",
|
|
123
|
-
keys:
|
|
124
|
+
keys: C,
|
|
124
125
|
children: [
|
|
125
126
|
/* @__PURE__ */ v(n, {
|
|
126
127
|
keys: ["letter-spacing"],
|
|
127
128
|
label: "Spacing",
|
|
128
|
-
value:
|
|
129
|
-
onChange:
|
|
129
|
+
value: J,
|
|
130
|
+
onChange: $("letter-spacing"),
|
|
130
131
|
type: "metric"
|
|
131
132
|
}),
|
|
132
133
|
/* @__PURE__ */ v(n, {
|
|
133
134
|
keys: ["word-spacing"],
|
|
134
135
|
label: "Word",
|
|
135
|
-
value:
|
|
136
|
-
onChange:
|
|
136
|
+
value: Y,
|
|
137
|
+
onChange: $("word-spacing"),
|
|
137
138
|
type: "metric"
|
|
138
139
|
}),
|
|
139
140
|
/* @__PURE__ */ v(n, {
|
|
140
141
|
keys: ["text-indent"],
|
|
141
142
|
label: "Indent",
|
|
142
|
-
value:
|
|
143
|
-
onChange:
|
|
143
|
+
value: ee,
|
|
144
|
+
onChange: $("text-indent"),
|
|
144
145
|
type: "metric"
|
|
145
146
|
})
|
|
146
147
|
]
|
|
147
148
|
}),
|
|
148
149
|
/* @__PURE__ */ v(m, {
|
|
149
|
-
textTransform:
|
|
150
|
-
direction:
|
|
151
|
-
onChange:
|
|
150
|
+
textTransform: I,
|
|
151
|
+
direction: X,
|
|
152
|
+
onChange: $
|
|
152
153
|
}),
|
|
153
154
|
/* @__PURE__ */ v(s, {
|
|
154
|
-
whiteSpace:
|
|
155
|
-
textWrap:
|
|
156
|
-
wordBreak:
|
|
157
|
-
overflowWrap:
|
|
158
|
-
hyphens:
|
|
159
|
-
verticalAlign:
|
|
160
|
-
onChange:
|
|
155
|
+
whiteSpace: R,
|
|
156
|
+
textWrap: z,
|
|
157
|
+
wordBreak: B,
|
|
158
|
+
overflowWrap: V,
|
|
159
|
+
hyphens: H,
|
|
160
|
+
verticalAlign: U,
|
|
161
|
+
onChange: $
|
|
161
162
|
}),
|
|
162
163
|
/* @__PURE__ */ y(r, {
|
|
163
164
|
label: "",
|
|
164
165
|
children: [/* @__PURE__ */ y(n, {
|
|
165
166
|
keys: ["text-overflow"],
|
|
166
167
|
label: "Overflow",
|
|
167
|
-
value:
|
|
168
|
-
onChange:
|
|
168
|
+
value: W,
|
|
169
|
+
onChange: $("text-overflow"),
|
|
169
170
|
type: "select",
|
|
170
171
|
children: [
|
|
171
172
|
/* @__PURE__ */ v("option", {
|
|
@@ -190,16 +191,16 @@ var b = [
|
|
|
190
191
|
})
|
|
191
192
|
]
|
|
192
193
|
}), /* @__PURE__ */ v(c, {
|
|
193
|
-
value:
|
|
194
|
-
onChange:
|
|
194
|
+
value: G,
|
|
195
|
+
onChange: te
|
|
195
196
|
})]
|
|
196
197
|
}),
|
|
197
198
|
/* @__PURE__ */ v(i, { children: /* @__PURE__ */ v(p, {
|
|
198
|
-
value:
|
|
199
|
-
onChange:
|
|
199
|
+
value: L,
|
|
200
|
+
onChange: $("text-shadow")
|
|
200
201
|
}) })
|
|
201
202
|
]
|
|
202
203
|
});
|
|
203
204
|
});
|
|
204
205
|
//#endregion
|
|
205
|
-
export {
|
|
206
|
+
export { w as default };
|
|
@@ -1,163 +1,5 @@
|
|
|
1
1
|
//#region src/components/StyleInspector/categories/Typography/TypographyConstants.ts
|
|
2
|
-
var e =
|
|
3
|
-
{
|
|
4
|
-
name: "Arial",
|
|
5
|
-
weights: ["400", "700"]
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
name: "Bitter",
|
|
9
|
-
weights: ["400", "700"]
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: "Changa One",
|
|
13
|
-
weights: ["400"]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "Droid Sans",
|
|
17
|
-
weights: ["400", "700"]
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "Droid Serif",
|
|
21
|
-
weights: ["400", "700"]
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "Exo",
|
|
25
|
-
weights: [
|
|
26
|
-
"100",
|
|
27
|
-
"200",
|
|
28
|
-
"300",
|
|
29
|
-
"400",
|
|
30
|
-
"500",
|
|
31
|
-
"600",
|
|
32
|
-
"700"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "Georgia",
|
|
37
|
-
weights: ["400", "700"]
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: "Great Vibes",
|
|
41
|
-
weights: ["400"]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "Impact",
|
|
45
|
-
weights: ["700"]
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: "Inconsolata",
|
|
49
|
-
weights: ["400", "700"]
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "Lato",
|
|
53
|
-
weights: [
|
|
54
|
-
"100",
|
|
55
|
-
"300",
|
|
56
|
-
"400",
|
|
57
|
-
"700",
|
|
58
|
-
"900"
|
|
59
|
-
]
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: "Merriweather",
|
|
63
|
-
weights: [
|
|
64
|
-
"300",
|
|
65
|
-
"400",
|
|
66
|
-
"700",
|
|
67
|
-
"900"
|
|
68
|
-
]
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "Montserrat",
|
|
72
|
-
weights: [
|
|
73
|
-
"100",
|
|
74
|
-
"200",
|
|
75
|
-
"300",
|
|
76
|
-
"400",
|
|
77
|
-
"500",
|
|
78
|
-
"600",
|
|
79
|
-
"700"
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "Open Sans",
|
|
84
|
-
weights: [
|
|
85
|
-
"300",
|
|
86
|
-
"400",
|
|
87
|
-
"600",
|
|
88
|
-
"700",
|
|
89
|
-
"800"
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
name: "Oswald",
|
|
94
|
-
weights: [
|
|
95
|
-
"200",
|
|
96
|
-
"300",
|
|
97
|
-
"400",
|
|
98
|
-
"500",
|
|
99
|
-
"600",
|
|
100
|
-
"700"
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
name: "PT Sans",
|
|
105
|
-
weights: ["400", "700"]
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "Palatino Linotype",
|
|
109
|
-
weights: ["400", "700"]
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "Tahoma",
|
|
113
|
-
weights: ["400", "700"]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
name: "Times New Roman",
|
|
117
|
-
weights: ["400", "700"]
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "Trebuchet MS",
|
|
121
|
-
weights: ["400", "700"]
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
name: "Ubuntu",
|
|
125
|
-
weights: [
|
|
126
|
-
"300",
|
|
127
|
-
"400",
|
|
128
|
-
"500",
|
|
129
|
-
"700"
|
|
130
|
-
]
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: "Varela",
|
|
134
|
-
weights: ["400"]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "Varela Round",
|
|
138
|
-
weights: ["400"]
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "Verdana",
|
|
142
|
-
weights: ["400", "700"]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: "Vollkorn",
|
|
146
|
-
weights: ["400", "700"]
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
name: "system-ui",
|
|
150
|
-
weights: [
|
|
151
|
-
"100",
|
|
152
|
-
"200",
|
|
153
|
-
"300",
|
|
154
|
-
"400",
|
|
155
|
-
"500",
|
|
156
|
-
"600",
|
|
157
|
-
"700"
|
|
158
|
-
]
|
|
159
|
-
}
|
|
160
|
-
], t = {
|
|
2
|
+
var e = {
|
|
161
3
|
100: "Thin",
|
|
162
4
|
200: "Extra Light",
|
|
163
5
|
300: "Light",
|
|
@@ -169,4 +11,4 @@ var e = [
|
|
|
169
11
|
900: "Black"
|
|
170
12
|
};
|
|
171
13
|
//#endregion
|
|
172
|
-
export { e as
|
|
14
|
+
export { e as weights };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
2
|
export type TypographyFontProps = {
|
|
3
3
|
partialValue?: StyleValue;
|
|
4
|
-
fonts?: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
4
|
onChange?: (value: StyleValue | Record<StyleCategory, StyleValue> | boolean) => void;
|
|
8
5
|
};
|
|
9
|
-
declare const TypographyFont: ({ partialValue,
|
|
6
|
+
declare const TypographyFont: ({ partialValue, onChange }: TypographyFontProps) => import("react").JSX.Element;
|
|
10
7
|
export default TypographyFont;
|
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
import e from "../../components/CategoryOption/index.mjs";
|
|
2
2
|
import t from "../../components/CategorySection/index.mjs";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import n from "../../../../hooks/useSpaceFonts.mjs";
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
5
|
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import { fontFamilyStack as a, primaryFamily as o } from "@plitzi/sdk-shared/style";
|
|
6
7
|
//#region src/components/StyleInspector/categories/Typography/TypographyFont.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
value:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
8
|
+
var s = ({ partialValue: s, onChange: c }) => {
|
|
9
|
+
let l = n(), u = typeof s == "string" ? o(s) : "", d = r((e) => {
|
|
10
|
+
let t = l.find((t) => t.family === e);
|
|
11
|
+
c?.(t ? a(t) : e);
|
|
12
|
+
}, [l, c]);
|
|
13
|
+
return /* @__PURE__ */ i(t, {
|
|
14
|
+
label: "F. Family",
|
|
15
|
+
keys: ["font-family"],
|
|
16
|
+
children: /* @__PURE__ */ i(e, {
|
|
17
|
+
value: u,
|
|
18
|
+
onChange: d,
|
|
19
|
+
type: "select",
|
|
20
|
+
children: l.map((e) => /* @__PURE__ */ i("option", {
|
|
21
|
+
style: { fontFamily: a(e) },
|
|
22
|
+
value: e.family,
|
|
23
|
+
children: e.family
|
|
24
|
+
}, e.family))
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
21
28
|
//#endregion
|
|
22
|
-
export {
|
|
29
|
+
export { s as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import e from "../../hooks/useInspectorValues.mjs";
|
|
2
2
|
import t from "../CategoryAdvanced/CategoryAdvancedContext.mjs";
|
|
3
3
|
import n from "../InspectorDots/index.mjs";
|
|
4
|
-
import r from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
4
|
+
import { useCallback as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "clsx";
|
|
7
7
|
import s from "@plitzi/plitzi-ui/Icon";
|
|
8
8
|
import c from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
9
9
|
import l from "@plitzi/plitzi-ui/ContainerCollapsable";
|
|
@@ -12,26 +12,26 @@ var u = ({ className: u, classNameContent: d, children: f, title: p = "Title", d
|
|
|
12
12
|
let [v, y] = c(`builder-state.styleInspector.advanced.${p}`, !1), { hasValues: b } = e({
|
|
13
13
|
keys: h,
|
|
14
14
|
asValue: !1
|
|
15
|
-
}), x =
|
|
15
|
+
}), x = r((e) => {
|
|
16
16
|
e.stopPropagation(), y((e) => !e);
|
|
17
17
|
}, [y]);
|
|
18
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ a(l, {
|
|
19
19
|
className: u,
|
|
20
20
|
collapsed: g,
|
|
21
21
|
onChange: _,
|
|
22
|
-
children: [/* @__PURE__ */
|
|
23
|
-
className:
|
|
22
|
+
children: [/* @__PURE__ */ i(l.Header, {
|
|
23
|
+
className: o("h-8", {
|
|
24
24
|
"border-b border-gray-200 hover:bg-slate-100 dark:border-zinc-700 dark:hover:bg-zinc-700/50": g,
|
|
25
25
|
"bg-slate-100 dark:bg-zinc-700/50": !g
|
|
26
26
|
}),
|
|
27
27
|
title: p,
|
|
28
28
|
placement: "right",
|
|
29
|
-
iconCollapsed: /* @__PURE__ */
|
|
30
|
-
iconExpanded: /* @__PURE__ */
|
|
31
|
-
children: /* @__PURE__ */
|
|
29
|
+
iconCollapsed: /* @__PURE__ */ i(s, { icon: "fa-solid fa-angle-down" }),
|
|
30
|
+
iconExpanded: /* @__PURE__ */ i(s, { icon: "fa-solid fa-angle-up" }),
|
|
31
|
+
children: /* @__PURE__ */ a("div", {
|
|
32
32
|
className: "flex items-center gap-2",
|
|
33
|
-
children: [/* @__PURE__ */
|
|
34
|
-
className:
|
|
33
|
+
children: [/* @__PURE__ */ i(n, { styleKeys: m }), !!h?.length && !g && /* @__PURE__ */ i(s, {
|
|
34
|
+
className: o("cursor-pointer text-xs", {
|
|
35
35
|
"text-blue-500": v,
|
|
36
36
|
"text-orange-500": !v && b,
|
|
37
37
|
"text-gray-400 hover:text-gray-600 dark:text-zinc-500 dark:hover:text-zinc-300": !v && !b
|
|
@@ -41,9 +41,9 @@ var u = ({ className: u, classNameContent: d, children: f, title: p = "Title", d
|
|
|
41
41
|
onClick: x
|
|
42
42
|
})]
|
|
43
43
|
})
|
|
44
|
-
}), /* @__PURE__ */
|
|
45
|
-
className:
|
|
46
|
-
children: /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ i(l.Content, {
|
|
45
|
+
className: o("flex flex-col gap-3 p-2", { "border-b border-gray-200 dark:border-zinc-700": !g }, d),
|
|
46
|
+
children: /* @__PURE__ */ i(t, {
|
|
47
47
|
value: v,
|
|
48
48
|
children: f
|
|
49
49
|
})
|
package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { useCallback as e, useMemo as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "clsx";
|
|
4
4
|
import i from "@plitzi/plitzi-ui/IconGroup";
|
|
5
5
|
//#region src/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.tsx
|
|
6
6
|
var a = ({ items: a = [], onChange: o }) => {
|
|
7
|
-
let s =
|
|
8
|
-
return /* @__PURE__ */
|
|
7
|
+
let s = t(() => a.filter((e) => typeof e.isVisible != "boolean" || e.isVisible), [a]), c = e((e) => () => o?.(e), [o]);
|
|
8
|
+
return /* @__PURE__ */ n(i, {
|
|
9
9
|
className: "w-full px-1.5 py-1",
|
|
10
10
|
gap: 1,
|
|
11
11
|
size: "md",
|
|
12
|
-
children: s.map((
|
|
13
|
-
size:
|
|
14
|
-
className:
|
|
15
|
-
"bg-zinc-300 dark:bg-zinc-800":
|
|
16
|
-
"text-xs": typeof
|
|
17
|
-
"h-5 w-5":
|
|
12
|
+
children: s.map((e, t) => /* @__PURE__ */ n(i.Icon, {
|
|
13
|
+
size: e.size,
|
|
14
|
+
className: r("cursor-pointer rounded-sm p-0.5", {
|
|
15
|
+
"bg-zinc-300 dark:bg-zinc-800": e.active,
|
|
16
|
+
"text-xs": typeof e.icon == "string",
|
|
17
|
+
"h-5 w-5": e.size !== "custom"
|
|
18
18
|
}),
|
|
19
|
-
active:
|
|
20
|
-
onClick: c(
|
|
21
|
-
icon: typeof
|
|
22
|
-
title:
|
|
23
|
-
children: typeof
|
|
24
|
-
},
|
|
19
|
+
active: e.active,
|
|
20
|
+
onClick: c(e.value),
|
|
21
|
+
icon: typeof e.icon == "string" ? e.icon : void 0,
|
|
22
|
+
title: e.description,
|
|
23
|
+
children: typeof e.icon != "string" && e.icon
|
|
24
|
+
}, t))
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
//#endregion
|
package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "clsx";
|
|
4
4
|
import i from "@plitzi/plitzi-ui/MetricInput";
|
|
5
5
|
//#region src/components/StyleInspector/components/CategoryOption/categoryTypes/OptionMetricInput.tsx
|
|
6
6
|
var a = ({ value: a, className: o, preffix: s = "", min: c, max: l, step: u, units: d = [
|
|
@@ -45,13 +45,13 @@ var a = ({ value: a, className: o, preffix: s = "", min: c, max: l, step: u, uni
|
|
|
45
45
|
value: "lvw"
|
|
46
46
|
}
|
|
47
47
|
], allowedWords: f = ["auto", "none"], allowVariables: p = !0, onChange: m }) => {
|
|
48
|
-
let h =
|
|
49
|
-
return /* @__PURE__ */
|
|
48
|
+
let h = e((e) => m?.(e), [m]);
|
|
49
|
+
return /* @__PURE__ */ n("div", {
|
|
50
50
|
className: "flex items-center gap-1",
|
|
51
|
-
children: [s && /* @__PURE__ */
|
|
51
|
+
children: [s && /* @__PURE__ */ n("span", {
|
|
52
52
|
className: "text-xs",
|
|
53
53
|
children: [s, ":"]
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
}), /* @__PURE__ */ t(i, {
|
|
55
55
|
size: "xs",
|
|
56
56
|
value: a,
|
|
57
57
|
min: c,
|
|
@@ -61,7 +61,7 @@ var a = ({ value: a, className: o, preffix: s = "", min: c, max: l, step: u, uni
|
|
|
61
61
|
allowedWords: f,
|
|
62
62
|
allowVariables: p,
|
|
63
63
|
onChange: h,
|
|
64
|
-
className:
|
|
64
|
+
className: r("w-full min-w-0", o)
|
|
65
65
|
})]
|
|
66
66
|
});
|
|
67
67
|
};
|
package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import t from "clsx";
|
|
3
3
|
import n from "@plitzi/plitzi-ui/Select";
|
|
4
4
|
//#region src/components/StyleInspector/components/CategoryOption/categoryTypes/OptionSelect.tsx
|
|
5
|
-
var r = ({ children: r, className: i, value: a, onChange: o }) => /* @__PURE__ */
|
|
5
|
+
var r = ({ children: r, className: i, value: a, onChange: o }) => /* @__PURE__ */ e(n, {
|
|
6
6
|
size: "xs",
|
|
7
7
|
value: a,
|
|
8
8
|
onChange: o,
|
|
9
|
-
className:
|
|
9
|
+
className: t("w-full min-w-0", i),
|
|
10
10
|
children: r
|
|
11
11
|
});
|
|
12
12
|
//#endregion
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import e from "../../StyleInspectorContext.mjs";
|
|
2
2
|
import t from "../../hooks/useInspectorValues.mjs";
|
|
3
|
-
import n from "
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
var s =
|
|
7
|
-
let { resetValue: d } =
|
|
8
|
-
keys:
|
|
3
|
+
import { memo as n, use as r, useCallback as i } from "react";
|
|
4
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
5
|
+
import o from "clsx";
|
|
6
|
+
var s = n(({ keyValue: n, children: s, className: c = "", size: l = "small", sectionTitle: u = !1 }) => {
|
|
7
|
+
let { resetValue: d } = r(e), { hasValues: f, hasInherit: p, hasBinding: m, hasVariables: h } = t({
|
|
8
|
+
keys: n,
|
|
9
9
|
asValue: !1
|
|
10
|
-
}), g =
|
|
11
|
-
|
|
10
|
+
}), g = i(() => {
|
|
11
|
+
f && n && d(n);
|
|
12
12
|
}, [
|
|
13
13
|
d,
|
|
14
14
|
f,
|
|
15
|
-
|
|
15
|
+
n
|
|
16
16
|
]);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
className:
|
|
17
|
+
return /* @__PURE__ */ a("div", {
|
|
18
|
+
className: o("inspector__label flex min-w-[50px] shrink-0 items-center select-none", c, {
|
|
19
19
|
"text-xs": l === "small",
|
|
20
20
|
"text-sm": l === "medium",
|
|
21
21
|
"text-base": l === "normal",
|
|
22
22
|
"mb-[-1px] p-0": u
|
|
23
23
|
}),
|
|
24
24
|
title: typeof s == "string" ? s : void 0,
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
-
className:
|
|
25
|
+
children: /* @__PURE__ */ a("label", {
|
|
26
|
+
className: o("m-0 truncate", {
|
|
27
27
|
"px-1": !u,
|
|
28
28
|
"rounded-tl rounded-tr border border-gray-300 bg-gray-100 px-2 font-bold text-zinc-700 dark:border-zinc-600 dark:bg-zinc-700 dark:text-zinc-200": u,
|
|
29
29
|
"cursor-pointer bg-blue-200 text-blue-600 dark:bg-blue-900/50 dark:text-blue-400": f && !m && !h,
|