@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.
- package/CHANGELOG.md +119 -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,187 +1,126 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../
|
|
3
|
-
import n from "../../
|
|
4
|
-
import r from "../../components/
|
|
5
|
-
import
|
|
6
|
-
import l from "./
|
|
7
|
-
import
|
|
8
|
-
import d from "../../
|
|
9
|
-
import f from "../../components/
|
|
10
|
-
import
|
|
11
|
-
import h from "./helpers/
|
|
12
|
-
import g from "
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import w from "
|
|
1
|
+
import { BLEND_MODES as e } from "../blendModes.mjs";
|
|
2
|
+
import t from "../../StyleInspectorContext.mjs";
|
|
3
|
+
import n from "../../hooks/useInspectorValues.mjs";
|
|
4
|
+
import r from "../../components/CategoryOption/index.mjs";
|
|
5
|
+
import i from "../../components/CategorySection/index.mjs";
|
|
6
|
+
import { DEFAULT_LAYER_PROPS as a, DEFAULT_STOPS as o, newLayerId as s, newStopId as c, serializeLayersToCSS as l } from "./helpers/backgroundParser.mjs";
|
|
7
|
+
import u from "./components/BackgroundLayer/index.mjs";
|
|
8
|
+
import { BACKGROUND_KEYS as d } from "../../categoryKeys.mjs";
|
|
9
|
+
import f from "../../components/CategoryAdvanced/index.mjs";
|
|
10
|
+
import p from "../../components/CategoryContainer/index.mjs";
|
|
11
|
+
import { BG_LAYER_KEYS as m, layerValuesKey as h } from "./helpers/layerValues.mjs";
|
|
12
|
+
import g from "./helpers/parseToBgLayers.mjs";
|
|
13
|
+
import _ from "../../components/ValueList/index.mjs";
|
|
14
|
+
import { memo as v, use as y, useCallback as b, useRef as x, useState as S } from "react";
|
|
15
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
16
|
+
import T from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
|
|
16
17
|
//#region src/components/StyleInspector/categories/Background/Background.tsx
|
|
17
|
-
var
|
|
18
|
-
let { setValue:
|
|
19
|
-
keys:
|
|
18
|
+
var E = ["background-color"], D = v(({ replaceTokens: v = !1, isCollapsed: D = !0, onCollapse: O }) => {
|
|
19
|
+
let { setValue: k } = y(t), A = n({
|
|
20
|
+
keys: m,
|
|
20
21
|
asValue: !0,
|
|
21
22
|
strictMode: !0
|
|
22
|
-
}), { "background-color":
|
|
23
|
+
}), { "background-color": j, "background-blend-mode": M, "mask-image": N } = n({
|
|
23
24
|
keys: [
|
|
24
25
|
"background-color",
|
|
25
26
|
"background-blend-mode",
|
|
26
27
|
"mask-image"
|
|
27
28
|
],
|
|
28
29
|
asValue: !0,
|
|
29
|
-
replaceTokens:
|
|
30
|
-
}),
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
let [
|
|
37
|
-
let t =
|
|
38
|
-
|
|
39
|
-
}, [
|
|
30
|
+
replaceTokens: v
|
|
31
|
+
}), P = h(A), F = x(A);
|
|
32
|
+
F.current = A;
|
|
33
|
+
let I = x(null), [L, R] = S(() => g(A));
|
|
34
|
+
T(() => {
|
|
35
|
+
P !== I.current && (R(g(F.current)), I.current = P);
|
|
36
|
+
}, [P]);
|
|
37
|
+
let [z, B] = S(null), V = b((e) => B((t) => t === e ? null : e), []), H = b((e) => {
|
|
38
|
+
let t = l(e);
|
|
39
|
+
I.current = h(t), R(e), k(void 0, t);
|
|
40
|
+
}, [k]), U = b((e, t) => {
|
|
40
41
|
if (e === t) return;
|
|
41
|
-
let n = [...
|
|
42
|
-
n.splice(t, 0, r),
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
let e =
|
|
47
|
-
...
|
|
42
|
+
let n = [...L], [r] = n.splice(e, 1);
|
|
43
|
+
n.splice(t, 0, r), H(n);
|
|
44
|
+
}, [L, H]), W = b((e) => (t) => {
|
|
45
|
+
H(L.map((n, r) => r === e ? t : n));
|
|
46
|
+
}, [L, H]), G = b(() => {
|
|
47
|
+
let e = s(), t = {
|
|
48
|
+
...a,
|
|
48
49
|
id: e,
|
|
49
50
|
type: "linear-gradient",
|
|
50
51
|
stops: [{
|
|
51
|
-
id:
|
|
52
|
-
color:
|
|
52
|
+
id: c(),
|
|
53
|
+
color: o[0].color,
|
|
53
54
|
position: "0%"
|
|
54
55
|
}, {
|
|
55
|
-
id:
|
|
56
|
-
color:
|
|
56
|
+
id: c(),
|
|
57
|
+
color: o[1].color,
|
|
57
58
|
position: "100%"
|
|
58
59
|
}]
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
}, [
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
|
|
65
|
-
}, [
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
title:
|
|
72
|
-
dotKeys:
|
|
73
|
-
advancedKeys:
|
|
74
|
-
isCollapsed:
|
|
75
|
-
onCollapse:
|
|
76
|
-
children: /* @__PURE__ */
|
|
61
|
+
B(e), H([...L, t]);
|
|
62
|
+
}, [L, H]), K = b((e) => () => {
|
|
63
|
+
H(L.filter((t, n) => n !== e));
|
|
64
|
+
}, [L, H]), q = b((e) => {
|
|
65
|
+
k("background-color", e);
|
|
66
|
+
}, [k]), J = b((e) => {
|
|
67
|
+
k("background-blend-mode", e);
|
|
68
|
+
}, [k]), Y = b((e) => {
|
|
69
|
+
k("mask-image", e);
|
|
70
|
+
}, [k]), X = b((e) => O?.("background", e), [O]);
|
|
71
|
+
return /* @__PURE__ */ C(p, {
|
|
72
|
+
title: d.title,
|
|
73
|
+
dotKeys: d.dot,
|
|
74
|
+
advancedKeys: d.advanced,
|
|
75
|
+
isCollapsed: D,
|
|
76
|
+
onCollapse: X,
|
|
77
|
+
children: /* @__PURE__ */ w("div", {
|
|
77
78
|
className: "flex flex-col gap-2",
|
|
78
79
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ w(_, {
|
|
80
81
|
label: "Layers",
|
|
81
|
-
keys:
|
|
82
|
+
keys: m,
|
|
82
83
|
addLabel: "Add a layer — the first one is drawn on top",
|
|
83
|
-
onAdd:
|
|
84
|
-
children: [!
|
|
84
|
+
onAdd: G,
|
|
85
|
+
children: [!L.length && /* @__PURE__ */ C("p", {
|
|
85
86
|
className: "m-0 rounded-md border border-dashed border-gray-300 px-3 py-2.5 text-center text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400",
|
|
86
87
|
children: "No layers. Add one for a gradient or an image."
|
|
87
|
-
}),
|
|
88
|
+
}), L.length > 0 && L.map((e, t) => /* @__PURE__ */ C(u, {
|
|
88
89
|
index: t,
|
|
89
90
|
layer: e,
|
|
90
|
-
expanded:
|
|
91
|
-
onExpand:
|
|
92
|
-
onChange:
|
|
93
|
-
onRemove:
|
|
94
|
-
onReorder:
|
|
91
|
+
expanded: z === e.id,
|
|
92
|
+
onExpand: V,
|
|
93
|
+
onChange: W(t),
|
|
94
|
+
onRemove: K(t),
|
|
95
|
+
onReorder: U
|
|
95
96
|
}, e.id))]
|
|
96
97
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ C(i, {
|
|
98
99
|
label: "Color",
|
|
99
|
-
keys:
|
|
100
|
-
children: /* @__PURE__ */
|
|
100
|
+
keys: E,
|
|
101
|
+
children: /* @__PURE__ */ C(r, {
|
|
101
102
|
type: "color",
|
|
102
|
-
value:
|
|
103
|
-
onChange:
|
|
103
|
+
value: j,
|
|
104
|
+
onChange: q
|
|
104
105
|
})
|
|
105
106
|
}),
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ C(f, { children: /* @__PURE__ */ w(i, {
|
|
107
108
|
label: "",
|
|
108
|
-
children: [/* @__PURE__ */ C(
|
|
109
|
+
children: [/* @__PURE__ */ C(r, {
|
|
109
110
|
keys: ["background-blend-mode"],
|
|
110
111
|
label: "Blend",
|
|
111
|
-
value:
|
|
112
|
-
onChange:
|
|
112
|
+
value: M,
|
|
113
|
+
onChange: J,
|
|
113
114
|
type: "select",
|
|
114
|
-
children: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */ S("option", {
|
|
120
|
-
value: "multiply",
|
|
121
|
-
children: "Multiply"
|
|
122
|
-
}),
|
|
123
|
-
/* @__PURE__ */ S("option", {
|
|
124
|
-
value: "screen",
|
|
125
|
-
children: "Screen"
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ S("option", {
|
|
128
|
-
value: "overlay",
|
|
129
|
-
children: "Overlay"
|
|
130
|
-
}),
|
|
131
|
-
/* @__PURE__ */ S("option", {
|
|
132
|
-
value: "darken",
|
|
133
|
-
children: "Darken"
|
|
134
|
-
}),
|
|
135
|
-
/* @__PURE__ */ S("option", {
|
|
136
|
-
value: "lighten",
|
|
137
|
-
children: "Lighten"
|
|
138
|
-
}),
|
|
139
|
-
/* @__PURE__ */ S("option", {
|
|
140
|
-
value: "color-dodge",
|
|
141
|
-
children: "Color Dodge"
|
|
142
|
-
}),
|
|
143
|
-
/* @__PURE__ */ S("option", {
|
|
144
|
-
value: "color-burn",
|
|
145
|
-
children: "Color Burn"
|
|
146
|
-
}),
|
|
147
|
-
/* @__PURE__ */ S("option", {
|
|
148
|
-
value: "hard-light",
|
|
149
|
-
children: "Hard Light"
|
|
150
|
-
}),
|
|
151
|
-
/* @__PURE__ */ S("option", {
|
|
152
|
-
value: "soft-light",
|
|
153
|
-
children: "Soft Light"
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ S("option", {
|
|
156
|
-
value: "difference",
|
|
157
|
-
children: "Difference"
|
|
158
|
-
}),
|
|
159
|
-
/* @__PURE__ */ S("option", {
|
|
160
|
-
value: "exclusion",
|
|
161
|
-
children: "Exclusion"
|
|
162
|
-
}),
|
|
163
|
-
/* @__PURE__ */ S("option", {
|
|
164
|
-
value: "hue",
|
|
165
|
-
children: "Hue"
|
|
166
|
-
}),
|
|
167
|
-
/* @__PURE__ */ S("option", {
|
|
168
|
-
value: "saturation",
|
|
169
|
-
children: "Saturation"
|
|
170
|
-
}),
|
|
171
|
-
/* @__PURE__ */ S("option", {
|
|
172
|
-
value: "color",
|
|
173
|
-
children: "Color"
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ S("option", {
|
|
176
|
-
value: "luminosity",
|
|
177
|
-
children: "Luminosity"
|
|
178
|
-
})
|
|
179
|
-
]
|
|
180
|
-
}), /* @__PURE__ */ S(n, {
|
|
115
|
+
children: e.map(([e, t]) => /* @__PURE__ */ C("option", {
|
|
116
|
+
value: e,
|
|
117
|
+
children: t
|
|
118
|
+
}, e))
|
|
119
|
+
}), /* @__PURE__ */ C(r, {
|
|
181
120
|
keys: ["mask-image"],
|
|
182
121
|
label: "Mask",
|
|
183
|
-
value:
|
|
184
|
-
onChange:
|
|
122
|
+
value: N,
|
|
123
|
+
onChange: Y
|
|
185
124
|
})]
|
|
186
125
|
}) })
|
|
187
126
|
]
|
|
@@ -189,4 +128,4 @@ var T = ["background-color"], E = _(({ replaceTokens: _ = !1, isCollapsed: E = !
|
|
|
189
128
|
});
|
|
190
129
|
});
|
|
191
130
|
//#endregion
|
|
192
|
-
export {
|
|
131
|
+
export { D as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type GradientCenterProps = {
|
|
2
|
+
/** The gradient's `at …`: `''` is the centre. */
|
|
3
|
+
position: string;
|
|
4
|
+
onChange: (position: string) => void;
|
|
5
|
+
};
|
|
6
|
+
/** Where a radial or conic gradient is centred, as its two halves. */
|
|
7
|
+
declare const GradientCenter: ({ position, onChange }: GradientCenterProps) => import('react').JSX.Element;
|
|
8
|
+
export default GradientCenter;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { asText as e } from "../../../../cssValues.mjs";
|
|
2
|
+
import t from "../../../../components/CategoryOption/index.mjs";
|
|
3
|
+
import n from "../../../../components/CategorySection/index.mjs";
|
|
4
|
+
import { CENTER_X_WORDS as r, CENTER_Y_WORDS as i, centerParts as a, joinCenter as o } from "../../modes/helpers.mjs";
|
|
5
|
+
import { useCallback as s } from "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/StyleInspector/categories/Background/components/GradientCenter/GradientCenter.tsx
|
|
8
|
+
var u = ({ position: u, onChange: d }) => {
|
|
9
|
+
let [f, p] = a(u), m = s((t) => d(o(e(t), p)), [p, d]), h = s((t) => d(o(f, e(t))), [f, d]);
|
|
10
|
+
return /* @__PURE__ */ l(n, {
|
|
11
|
+
label: "Center",
|
|
12
|
+
children: [/* @__PURE__ */ c(t, {
|
|
13
|
+
type: "metric",
|
|
14
|
+
value: f,
|
|
15
|
+
allowedWords: r,
|
|
16
|
+
min: -Infinity,
|
|
17
|
+
onChange: m
|
|
18
|
+
}), /* @__PURE__ */ c(t, {
|
|
19
|
+
type: "metric",
|
|
20
|
+
value: p,
|
|
21
|
+
allowedWords: i,
|
|
22
|
+
min: -Infinity,
|
|
23
|
+
onChange: h
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { u as default };
|
|
@@ -1,65 +1,43 @@
|
|
|
1
1
|
import { asText as e } from "../../../cssValues.mjs";
|
|
2
2
|
import t from "../../../components/CategoryOption/index.mjs";
|
|
3
3
|
import n from "../../../components/CategorySection/index.mjs";
|
|
4
|
-
import { ANGLE_UNITS as r
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
4
|
+
import { ANGLE_UNITS as r } from "./helpers.mjs";
|
|
5
|
+
import i from "../components/GradientCenter/index.mjs";
|
|
6
|
+
import a from "../components/GradientStopBar/index.mjs";
|
|
7
|
+
import { useCallback as o } from "react";
|
|
8
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/StyleInspector/categories/Background/modes/ConicGradientMode.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
...
|
|
10
|
+
var u = ({ layer: u, onChange: d }) => {
|
|
11
|
+
let f = o((t) => d?.({
|
|
12
|
+
...u,
|
|
12
13
|
conicAngle: e(t)
|
|
13
|
-
}), [
|
|
14
|
-
...
|
|
15
|
-
conicPosition:
|
|
16
|
-
}), [
|
|
17
|
-
|
|
18
|
-
p,
|
|
19
|
-
m
|
|
20
|
-
]), y = l((t) => m?.({
|
|
21
|
-
...p,
|
|
22
|
-
conicPosition: s(h, e(t))
|
|
23
|
-
}), [
|
|
24
|
-
h,
|
|
25
|
-
p,
|
|
26
|
-
m
|
|
27
|
-
]), b = l((e) => m?.({
|
|
28
|
-
...p,
|
|
14
|
+
}), [u, d]), p = o((e) => d?.({
|
|
15
|
+
...u,
|
|
16
|
+
conicPosition: e
|
|
17
|
+
}), [u, d]), m = o((e) => d?.({
|
|
18
|
+
...u,
|
|
29
19
|
stops: e
|
|
30
|
-
}), [
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
20
|
+
}), [u, d]);
|
|
21
|
+
return /* @__PURE__ */ l(s, { children: [
|
|
22
|
+
/* @__PURE__ */ c(n, {
|
|
33
23
|
label: "Start angle",
|
|
34
|
-
children: /* @__PURE__ */
|
|
24
|
+
children: /* @__PURE__ */ c(t, {
|
|
35
25
|
type: "metric",
|
|
36
|
-
value:
|
|
26
|
+
value: u.conicAngle,
|
|
37
27
|
units: r,
|
|
38
28
|
min: -Infinity,
|
|
39
|
-
onChange:
|
|
29
|
+
onChange: f
|
|
40
30
|
})
|
|
41
31
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type: "metric",
|
|
46
|
-
value: h,
|
|
47
|
-
allowedWords: i,
|
|
48
|
-
min: -Infinity,
|
|
49
|
-
onChange: v
|
|
50
|
-
}), /* @__PURE__ */ d(t, {
|
|
51
|
-
type: "metric",
|
|
52
|
-
value: g,
|
|
53
|
-
allowedWords: a,
|
|
54
|
-
min: -Infinity,
|
|
55
|
-
onChange: y
|
|
56
|
-
})]
|
|
32
|
+
/* @__PURE__ */ c(i, {
|
|
33
|
+
position: u.conicPosition,
|
|
34
|
+
onChange: p
|
|
57
35
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
stops:
|
|
60
|
-
onChange:
|
|
36
|
+
/* @__PURE__ */ c(a, {
|
|
37
|
+
stops: u.stops,
|
|
38
|
+
onChange: m
|
|
61
39
|
})
|
|
62
40
|
] });
|
|
63
41
|
};
|
|
64
42
|
//#endregion
|
|
65
|
-
export {
|
|
43
|
+
export { u as default };
|
|
@@ -1,102 +1,80 @@
|
|
|
1
1
|
import { asText as e } from "../../../cssValues.mjs";
|
|
2
2
|
import t from "../../../components/CategoryOption/index.mjs";
|
|
3
3
|
import n from "../../../components/CategorySection/index.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
4
|
+
import { RADIAL_EXTENTS as r, customExtentFor as i, isExtentKeyword as a } from "./helpers.mjs";
|
|
5
|
+
import o from "../components/GradientCenter/index.mjs";
|
|
6
|
+
import s from "../components/GradientStopBar/index.mjs";
|
|
7
|
+
import { useCallback as c } from "react";
|
|
8
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
9
|
//#region src/components/StyleInspector/categories/Background/modes/RadialGradientMode.tsx
|
|
9
|
-
var
|
|
10
|
-
let
|
|
11
|
-
...
|
|
10
|
+
var f = "custom", p = ({ layer: p, onChange: m }) => {
|
|
11
|
+
let h = !a(p.radialExtent), g = c((t) => m?.({
|
|
12
|
+
...p,
|
|
12
13
|
radialShape: e(t) === "circle" ? "circle" : "ellipse"
|
|
13
|
-
}), [
|
|
14
|
+
}), [p, m]), _ = c((t) => {
|
|
14
15
|
let n = e(t);
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
radialExtent: n ===
|
|
16
|
+
m?.({
|
|
17
|
+
...p,
|
|
18
|
+
radialExtent: n === f ? i(p.radialShape) : n
|
|
18
19
|
});
|
|
19
|
-
}, [
|
|
20
|
-
...
|
|
20
|
+
}, [p, m]), v = c((t) => m?.({
|
|
21
|
+
...p,
|
|
21
22
|
radialExtent: e(t)
|
|
22
|
-
}), [
|
|
23
|
-
...
|
|
24
|
-
radialPosition:
|
|
25
|
-
}), [
|
|
26
|
-
|
|
27
|
-
g,
|
|
28
|
-
_
|
|
29
|
-
]), T = d((t) => _?.({
|
|
30
|
-
...g,
|
|
31
|
-
radialPosition: l(v, e(t))
|
|
32
|
-
}), [
|
|
33
|
-
v,
|
|
34
|
-
g,
|
|
35
|
-
_
|
|
36
|
-
]), E = d((e) => _?.({
|
|
37
|
-
...g,
|
|
23
|
+
}), [p, m]), y = c((e) => m?.({
|
|
24
|
+
...p,
|
|
25
|
+
radialPosition: e
|
|
26
|
+
}), [p, m]), b = c((e) => m?.({
|
|
27
|
+
...p,
|
|
38
28
|
stops: e
|
|
39
|
-
}), [
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */
|
|
29
|
+
}), [p, m]);
|
|
30
|
+
return /* @__PURE__ */ d(l, { children: [
|
|
31
|
+
/* @__PURE__ */ u(n, {
|
|
42
32
|
label: "Shape",
|
|
43
|
-
children: /* @__PURE__ */
|
|
33
|
+
children: /* @__PURE__ */ d(t, {
|
|
44
34
|
type: "select",
|
|
45
|
-
value:
|
|
46
|
-
onChange:
|
|
47
|
-
children: [/* @__PURE__ */
|
|
35
|
+
value: p.radialShape,
|
|
36
|
+
onChange: g,
|
|
37
|
+
children: [/* @__PURE__ */ u("option", {
|
|
48
38
|
value: "ellipse",
|
|
49
39
|
children: "Ellipse"
|
|
50
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ u("option", {
|
|
51
41
|
value: "circle",
|
|
52
42
|
children: "Circle"
|
|
53
43
|
})]
|
|
54
44
|
})
|
|
55
45
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ u(n, {
|
|
57
47
|
label: "Extent",
|
|
58
|
-
children: /* @__PURE__ */
|
|
48
|
+
children: /* @__PURE__ */ d(t, {
|
|
59
49
|
type: "select",
|
|
60
|
-
value:
|
|
61
|
-
onChange:
|
|
62
|
-
children: [
|
|
50
|
+
value: h ? f : p.radialExtent,
|
|
51
|
+
onChange: _,
|
|
52
|
+
children: [r.map((e) => /* @__PURE__ */ u("option", {
|
|
63
53
|
value: e.value,
|
|
64
54
|
children: e.label
|
|
65
|
-
}, e.value)), /* @__PURE__ */
|
|
66
|
-
value:
|
|
55
|
+
}, e.value)), /* @__PURE__ */ u("option", {
|
|
56
|
+
value: f,
|
|
67
57
|
children: "Custom size"
|
|
68
58
|
})]
|
|
69
59
|
})
|
|
70
60
|
}),
|
|
71
|
-
|
|
61
|
+
h && /* @__PURE__ */ u(n, {
|
|
72
62
|
label: "Radius",
|
|
73
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ u(t, {
|
|
74
64
|
type: "input",
|
|
75
|
-
value:
|
|
76
|
-
onChange:
|
|
65
|
+
value: p.radialExtent,
|
|
66
|
+
onChange: v
|
|
77
67
|
})
|
|
78
68
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
type: "metric",
|
|
83
|
-
value: v,
|
|
84
|
-
allowedWords: r,
|
|
85
|
-
min: -Infinity,
|
|
86
|
-
onChange: w
|
|
87
|
-
}), /* @__PURE__ */ p(t, {
|
|
88
|
-
type: "metric",
|
|
89
|
-
value: y,
|
|
90
|
-
allowedWords: i,
|
|
91
|
-
min: -Infinity,
|
|
92
|
-
onChange: T
|
|
93
|
-
})]
|
|
69
|
+
/* @__PURE__ */ u(o, {
|
|
70
|
+
position: p.radialPosition,
|
|
71
|
+
onChange: y
|
|
94
72
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
stops:
|
|
97
|
-
onChange:
|
|
73
|
+
/* @__PURE__ */ u(s, {
|
|
74
|
+
stops: p.stops,
|
|
75
|
+
onChange: b
|
|
98
76
|
})
|
|
99
77
|
] });
|
|
100
78
|
};
|
|
101
79
|
//#endregion
|
|
102
|
-
export {
|
|
80
|
+
export { p as default };
|