@plitzi/sdk-style 0.32.19 → 0.32.21
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 +20 -0
- package/dist/components/StyleInspector/Inspector.mjs +137 -131
- package/dist/components/StyleInspector/categories/Background/Background.mjs +151 -69
- package/dist/components/StyleInspector/categories/Effects/Effects.mjs +257 -84
- package/dist/components/StyleInspector/categories/Effects/Filters/Filter.d.ts +3 -1
- package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +17 -17
- package/dist/components/StyleInspector/categories/Others/Others.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Others/Others.mjs +103 -0
- package/dist/components/StyleInspector/categories/Others/OthersForm.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Others/OthersForm.mjs +48 -0
- package/dist/components/StyleInspector/categories/Others/OthersInteraction.d.ts +13 -0
- package/dist/components/StyleInspector/categories/Others/OthersInteraction.mjs +162 -0
- package/dist/components/StyleInspector/categories/Others/OthersOutline.d.ts +10 -0
- package/dist/components/StyleInspector/categories/Others/OthersOutline.mjs +75 -0
- package/dist/components/StyleInspector/categories/Others/OthersSvg.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Others/OthersSvg.mjs +31 -0
- package/dist/components/StyleInspector/categories/Others/OthersTable.d.ts +9 -0
- package/dist/components/StyleInspector/categories/Others/OthersTable.mjs +44 -0
- package/dist/components/StyleInspector/categories/Others/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Others/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Position/Position.mjs +70 -69
- package/dist/components/StyleInspector/categories/Size/Size.mjs +82 -52
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +139 -158
- package/dist/components/StyleInspector/categories/Typography/TypographyBreaking.d.ts +12 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyBreaking.mjs +181 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyClamp.d.ts +7 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyClamp.mjs +35 -0
- package/dist/components/StyleInspector/categories/Typography/TypographyStyle.d.ts +3 -1
- package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +47 -32
- package/dist/components/StyleInspector/categories/Typography/TypographyTransform.mjs +10 -11
- package/dist/components/StyleInspector/components/CategoryAdvanced/CategoryAdvanced.d.ts +6 -0
- package/dist/components/StyleInspector/components/CategoryAdvanced/CategoryAdvanced.mjs +6 -0
- package/dist/components/StyleInspector/components/CategoryAdvanced/CategoryAdvancedContext.d.ts +2 -0
- package/dist/components/StyleInspector/components/CategoryAdvanced/CategoryAdvancedContext.mjs +5 -0
- package/dist/components/StyleInspector/components/CategoryAdvanced/index.d.ts +4 -0
- package/dist/components/StyleInspector/components/CategoryAdvanced/index.mjs +6 -0
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.d.ts +2 -1
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +52 -25
- package/package.json +60 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @plitzi/sdk-style
|
|
2
2
|
|
|
3
|
+
## 0.32.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- v0.32.21
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @plitzi/sdk-plugins@0.32.21
|
|
10
|
+
- @plitzi/sdk-shared@0.32.21
|
|
11
|
+
- @plitzi/sdk-variables@0.32.21
|
|
12
|
+
|
|
13
|
+
## 0.32.20
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- v0.32.20
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @plitzi/sdk-plugins@0.32.20
|
|
20
|
+
- @plitzi/sdk-shared@0.32.20
|
|
21
|
+
- @plitzi/sdk-variables@0.32.20
|
|
22
|
+
|
|
3
23
|
## 0.32.19
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -6,173 +6,179 @@ import i from "./categories/DisplayFlexChild/index.mjs";
|
|
|
6
6
|
import a from "./categories/Effects/index.mjs";
|
|
7
7
|
import o from "./categories/List/index.mjs";
|
|
8
8
|
import s from "./categories/ListItem/index.mjs";
|
|
9
|
-
import c from "./categories/
|
|
10
|
-
import l from "./categories/
|
|
11
|
-
import u from "./categories/
|
|
12
|
-
import d from "./categories/
|
|
13
|
-
import f from "./categories/
|
|
14
|
-
import p from "./categories/
|
|
15
|
-
import m from "./
|
|
16
|
-
import h from "./
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import w from "
|
|
22
|
-
import T from "@plitzi/
|
|
23
|
-
import E from "@plitzi/plitzi-ui/
|
|
9
|
+
import c from "./categories/Others/index.mjs";
|
|
10
|
+
import l from "./categories/Position/index.mjs";
|
|
11
|
+
import u from "./categories/RawStyle/index.mjs";
|
|
12
|
+
import d from "./categories/Size/index.mjs";
|
|
13
|
+
import f from "./categories/Spacing/index.mjs";
|
|
14
|
+
import p from "./categories/Typography/index.mjs";
|
|
15
|
+
import m from "./categories/Variables/index.mjs";
|
|
16
|
+
import h from "./hooks/useStyleInherit.mjs";
|
|
17
|
+
import g from "./StyleInspectorProvider.mjs";
|
|
18
|
+
import { get as _, set as v } from "@plitzi/plitzi-ui/helpers";
|
|
19
|
+
import { use as y, useCallback as b, useMemo as x } from "react";
|
|
20
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
21
|
+
import { produce as w } from "immer";
|
|
22
|
+
import T from "@plitzi/sdk-shared/builder/contexts/BuilderContext";
|
|
23
|
+
import E from "@plitzi/plitzi-ui/hooks/useStorage";
|
|
24
|
+
import D from "@plitzi/plitzi-ui/Switch";
|
|
24
25
|
//#region src/components/StyleInspector/Inspector.tsx
|
|
25
|
-
var
|
|
26
|
-
let { builderHandler:
|
|
27
|
-
element:
|
|
28
|
-
componentType:
|
|
29
|
-
componentSubType:
|
|
30
|
-
selector:
|
|
31
|
-
styleSelector:
|
|
32
|
-
styleState:
|
|
33
|
-
styleVariant:
|
|
34
|
-
}),
|
|
26
|
+
var O = ({ selectors: O, componentType: k, componentSubType: A, selector: j, styleState: M, styleVariant: N, styleSelector: P = "base", element: F, displayMode: I, mode: L = "element" }) => {
|
|
27
|
+
let { builderHandler: R } = y(T), [z, B] = E(`builder-state.styleInspector.${L}.collapsedCache`, {}), [V, H] = E(`builder-state.styleInspector.${L}.showAllOptions`, !1), [U, W] = E(`builder-state.styleInspector.${L}.replaceTokens`, !1), G = h({
|
|
28
|
+
element: F,
|
|
29
|
+
componentType: k,
|
|
30
|
+
componentSubType: A,
|
|
31
|
+
selector: j?.name,
|
|
32
|
+
styleSelector: P,
|
|
33
|
+
styleState: M,
|
|
34
|
+
styleVariant: N
|
|
35
|
+
}), K = b((e, t) => B((n) => ({
|
|
35
36
|
...n,
|
|
36
37
|
[e]: t
|
|
37
|
-
})), [
|
|
38
|
-
if (
|
|
39
|
-
|
|
40
|
-
componentType:
|
|
41
|
-
styleSelector:
|
|
42
|
-
styleState:
|
|
43
|
-
styleVariant:
|
|
38
|
+
})), [B]), q = b((e) => H(e.target.checked), [H]), J = b((e) => W(e.target.checked), [W]), Y = b((t, n) => {
|
|
39
|
+
if (j) {
|
|
40
|
+
R("styleUpdateSelector", I, j.name, t, n, {
|
|
41
|
+
componentType: j.type === "element" ? k : void 0,
|
|
42
|
+
styleSelector: P,
|
|
43
|
+
styleState: M,
|
|
44
|
+
styleVariant: N
|
|
44
45
|
});
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
if (!
|
|
48
|
-
let r = e(
|
|
49
|
-
if (
|
|
50
|
-
styleSelector:
|
|
51
|
-
styleState:
|
|
52
|
-
styleVariant:
|
|
53
|
-
}), !
|
|
54
|
-
let i =
|
|
55
|
-
|
|
56
|
-
i ?
|
|
48
|
+
if (!k) return;
|
|
49
|
+
let r = e(k, P);
|
|
50
|
+
if (R("styleAddSelector", I, r, "class", t, n, {
|
|
51
|
+
styleSelector: P,
|
|
52
|
+
styleState: M,
|
|
53
|
+
styleVariant: N
|
|
54
|
+
}), !F) return;
|
|
55
|
+
let i = _(F, `definition.styleSelectors.${P}`);
|
|
56
|
+
R("schemaUpdateElement", w(F, (e) => {
|
|
57
|
+
i ? v(e, `definition.styleSelectors.${P}`, `${i} ${r}`) : v(e, `definition.styleSelectors.${P}`, r);
|
|
57
58
|
}));
|
|
58
59
|
}, [
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
R,
|
|
61
|
+
k,
|
|
62
|
+
I,
|
|
61
63
|
F,
|
|
62
|
-
P,
|
|
63
|
-
A,
|
|
64
|
-
N,
|
|
65
64
|
j,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
P,
|
|
66
|
+
M,
|
|
67
|
+
N
|
|
68
|
+
]), X = x(() => {
|
|
69
|
+
let e = F?.definition.type;
|
|
70
|
+
return V || L === "manager" || e === "list" || e === "listItem";
|
|
70
71
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
]),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
]),
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
componentType:
|
|
81
|
-
displayMode:
|
|
82
|
-
styleSelector:
|
|
83
|
-
styleState:
|
|
84
|
-
styleVariant:
|
|
85
|
-
selector:
|
|
86
|
-
element:
|
|
87
|
-
inheritData:
|
|
88
|
-
onChange:
|
|
89
|
-
children: /* @__PURE__ */
|
|
72
|
+
F?.definition.type,
|
|
73
|
+
L,
|
|
74
|
+
V
|
|
75
|
+
]), Z = x(() => V || L === "manager" || _(G, "parentStyle.display", "block") === "flex", [
|
|
76
|
+
G,
|
|
77
|
+
L,
|
|
78
|
+
V
|
|
79
|
+
]), Q = x(() => _(G, "parentStyle.flex-direction", "row") === "column", [G]);
|
|
80
|
+
return /* @__PURE__ */ S(g, {
|
|
81
|
+
componentType: k,
|
|
82
|
+
displayMode: I,
|
|
83
|
+
styleSelector: P,
|
|
84
|
+
styleState: M,
|
|
85
|
+
styleVariant: N,
|
|
86
|
+
selector: j,
|
|
87
|
+
element: F,
|
|
88
|
+
inheritData: G,
|
|
89
|
+
onChange: Y,
|
|
90
|
+
children: /* @__PURE__ */ C("div", {
|
|
90
91
|
className: "flex grow flex-col justify-between",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ C("div", {
|
|
92
93
|
className: "flex grow flex-col",
|
|
93
94
|
children: [
|
|
94
|
-
|
|
95
|
-
replaceTokens:
|
|
96
|
-
isCollapsed:
|
|
97
|
-
onCollapse:
|
|
95
|
+
X && /* @__PURE__ */ S(o, {
|
|
96
|
+
replaceTokens: U,
|
|
97
|
+
isCollapsed: z.list ?? !0,
|
|
98
|
+
onCollapse: K
|
|
99
|
+
}),
|
|
100
|
+
X && /* @__PURE__ */ S(s, {
|
|
101
|
+
replaceTokens: U,
|
|
102
|
+
isCollapsed: z.listItem ?? !0,
|
|
103
|
+
onCollapse: K
|
|
98
104
|
}),
|
|
99
|
-
|
|
100
|
-
replaceTokens:
|
|
101
|
-
isCollapsed:
|
|
102
|
-
onCollapse:
|
|
105
|
+
/* @__PURE__ */ S(r, {
|
|
106
|
+
replaceTokens: U,
|
|
107
|
+
isCollapsed: z.display ?? !0,
|
|
108
|
+
onCollapse: K
|
|
103
109
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
replaceTokens:
|
|
106
|
-
isCollapsed:
|
|
107
|
-
|
|
110
|
+
Z && /* @__PURE__ */ S(i, {
|
|
111
|
+
replaceTokens: U,
|
|
112
|
+
isCollapsed: z.displayFlexChild ?? !0,
|
|
113
|
+
isFlexVertical: Q,
|
|
114
|
+
onCollapse: K
|
|
108
115
|
}),
|
|
109
|
-
|
|
110
|
-
replaceTokens:
|
|
111
|
-
isCollapsed:
|
|
112
|
-
|
|
113
|
-
onCollapse: G
|
|
116
|
+
/* @__PURE__ */ S(f, {
|
|
117
|
+
replaceTokens: U,
|
|
118
|
+
isCollapsed: z.spacing ?? !0,
|
|
119
|
+
onCollapse: K
|
|
114
120
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
replaceTokens:
|
|
117
|
-
isCollapsed:
|
|
118
|
-
onCollapse:
|
|
121
|
+
/* @__PURE__ */ S(d, {
|
|
122
|
+
replaceTokens: U,
|
|
123
|
+
isCollapsed: z.size ?? !0,
|
|
124
|
+
onCollapse: K
|
|
119
125
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
replaceTokens:
|
|
122
|
-
isCollapsed:
|
|
123
|
-
onCollapse:
|
|
126
|
+
/* @__PURE__ */ S(l, {
|
|
127
|
+
replaceTokens: U,
|
|
128
|
+
isCollapsed: z.position ?? !0,
|
|
129
|
+
onCollapse: K
|
|
124
130
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
replaceTokens:
|
|
127
|
-
isCollapsed:
|
|
128
|
-
onCollapse:
|
|
131
|
+
/* @__PURE__ */ S(p, {
|
|
132
|
+
replaceTokens: U,
|
|
133
|
+
isCollapsed: z.typography ?? !0,
|
|
134
|
+
onCollapse: K
|
|
129
135
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
replaceTokens:
|
|
132
|
-
isCollapsed:
|
|
133
|
-
onCollapse:
|
|
136
|
+
/* @__PURE__ */ S(t, {
|
|
137
|
+
replaceTokens: U,
|
|
138
|
+
isCollapsed: z.background ?? !0,
|
|
139
|
+
onCollapse: K
|
|
134
140
|
}),
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
replaceTokens:
|
|
137
|
-
isCollapsed:
|
|
138
|
-
onCollapse:
|
|
141
|
+
/* @__PURE__ */ S(n, {
|
|
142
|
+
replaceTokens: U,
|
|
143
|
+
isCollapsed: z.border ?? !0,
|
|
144
|
+
onCollapse: K
|
|
139
145
|
}),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
replaceTokens:
|
|
142
|
-
isCollapsed:
|
|
143
|
-
onCollapse:
|
|
146
|
+
/* @__PURE__ */ S(a, {
|
|
147
|
+
replaceTokens: U,
|
|
148
|
+
isCollapsed: z.effects ?? !0,
|
|
149
|
+
onCollapse: K
|
|
144
150
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
replaceTokens:
|
|
147
|
-
isCollapsed:
|
|
148
|
-
onCollapse:
|
|
151
|
+
/* @__PURE__ */ S(c, {
|
|
152
|
+
replaceTokens: U,
|
|
153
|
+
isCollapsed: z.others ?? !0,
|
|
154
|
+
onCollapse: K
|
|
149
155
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
isCollapsed:
|
|
152
|
-
onCollapse:
|
|
156
|
+
/* @__PURE__ */ S(m, {
|
|
157
|
+
isCollapsed: z.variables ?? !0,
|
|
158
|
+
onCollapse: K
|
|
153
159
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
isCollapsed:
|
|
156
|
-
selectors:
|
|
157
|
-
onCollapse:
|
|
160
|
+
/* @__PURE__ */ S(u, {
|
|
161
|
+
isCollapsed: z.rawStyle ?? !0,
|
|
162
|
+
selectors: O,
|
|
163
|
+
onCollapse: K
|
|
158
164
|
})
|
|
159
165
|
]
|
|
160
|
-
}), /* @__PURE__ */
|
|
166
|
+
}), /* @__PURE__ */ C("div", {
|
|
161
167
|
className: "flex items-center justify-end gap-4 border-t border-gray-200 px-2 py-1 dark:border-zinc-700",
|
|
162
|
-
children: [/* @__PURE__ */
|
|
168
|
+
children: [/* @__PURE__ */ S(D, {
|
|
163
169
|
size: "xs",
|
|
164
170
|
label: "Replace Tokens",
|
|
165
|
-
checked:
|
|
166
|
-
onChange:
|
|
167
|
-
}),
|
|
171
|
+
checked: U,
|
|
172
|
+
onChange: J
|
|
173
|
+
}), L === "element" && /* @__PURE__ */ S(D, {
|
|
168
174
|
size: "xs",
|
|
169
175
|
label: "Show All Options",
|
|
170
|
-
checked:
|
|
171
|
-
onChange:
|
|
176
|
+
checked: V,
|
|
177
|
+
onChange: q
|
|
172
178
|
})]
|
|
173
179
|
})]
|
|
174
180
|
})
|
|
175
181
|
});
|
|
176
182
|
};
|
|
177
183
|
//#endregion
|
|
178
|
-
export {
|
|
184
|
+
export { O as default };
|
|
@@ -5,13 +5,14 @@ import r from "../../components/CategoryOption/index.mjs";
|
|
|
5
5
|
import i from "../../components/CategorySection/index.mjs";
|
|
6
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
7
|
import u from "./components/BackgroundLayer/index.mjs";
|
|
8
|
-
import d from "../../components/
|
|
9
|
-
import f from "
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import b from "
|
|
8
|
+
import d from "../../components/CategoryAdvanced/index.mjs";
|
|
9
|
+
import f from "../../components/CategoryContainer/index.mjs";
|
|
10
|
+
import p from "./helpers/parseToBgLayers.mjs";
|
|
11
|
+
import { memo as m, use as h, useCallback as g, useRef as _, useState as v } from "react";
|
|
12
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
13
|
+
import x from "@plitzi/plitzi-ui/hooks/useDidUpdateEffect";
|
|
13
14
|
//#region src/components/StyleInspector/categories/Background/Background.tsx
|
|
14
|
-
var
|
|
15
|
+
var S = [
|
|
15
16
|
"background-color",
|
|
16
17
|
"background-image",
|
|
17
18
|
"background-attachment",
|
|
@@ -19,40 +20,45 @@ var x = [
|
|
|
19
20
|
"background-repeat",
|
|
20
21
|
"background-clip",
|
|
21
22
|
"background-size",
|
|
23
|
+
"background-blend-mode",
|
|
22
24
|
"mask-image"
|
|
23
|
-
],
|
|
25
|
+
], C = [
|
|
24
26
|
"background-image",
|
|
25
27
|
"background-size",
|
|
26
28
|
"background-position",
|
|
27
29
|
"background-repeat",
|
|
28
30
|
"background-attachment",
|
|
29
31
|
"background-clip"
|
|
30
|
-
],
|
|
31
|
-
let { setValue:
|
|
32
|
-
keys:
|
|
32
|
+
], w = ["background-blend-mode", "mask-image"], T = (e) => C.map((t) => String(e[t])).join("||"), E = m(({ replaceTokens: m = !1, isCollapsed: E = !0, onCollapse: D }) => {
|
|
33
|
+
let { setValue: O } = h(e), k = t({
|
|
34
|
+
keys: C,
|
|
33
35
|
asValue: !0,
|
|
34
36
|
strictMode: !0,
|
|
35
|
-
replaceTokens:
|
|
36
|
-
}), { "background-color":
|
|
37
|
-
keys: [
|
|
37
|
+
replaceTokens: m
|
|
38
|
+
}), { "background-color": A, "background-blend-mode": j, "mask-image": M } = t({
|
|
39
|
+
keys: [
|
|
40
|
+
"background-color",
|
|
41
|
+
"background-blend-mode",
|
|
42
|
+
"mask-image"
|
|
43
|
+
],
|
|
38
44
|
asValue: !0,
|
|
39
|
-
replaceTokens:
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
let [
|
|
45
|
+
replaceTokens: m
|
|
46
|
+
}), N = T(k), P = _(k);
|
|
47
|
+
P.current = k;
|
|
48
|
+
let F = _(null), [I, L] = v(() => p(k));
|
|
49
|
+
x(() => {
|
|
50
|
+
N !== F.current && (L(p(P.current)), F.current = N);
|
|
51
|
+
}, [N]);
|
|
52
|
+
let [R, z] = v(null), B = g((e) => z((t) => t === e ? null : e), []), V = g((e) => {
|
|
47
53
|
let t = l(e);
|
|
48
|
-
|
|
49
|
-
}, [
|
|
54
|
+
F.current = T(t), L(e), O(void 0, t);
|
|
55
|
+
}, [O]), H = g((e, t) => {
|
|
50
56
|
if (e === t) return;
|
|
51
|
-
let n = [...
|
|
52
|
-
n.splice(t, 0, r),
|
|
53
|
-
}, [
|
|
54
|
-
|
|
55
|
-
}, [
|
|
57
|
+
let n = [...I], [r] = n.splice(e, 1);
|
|
58
|
+
n.splice(t, 0, r), V(n);
|
|
59
|
+
}, [I, V]), U = g((e) => (t) => {
|
|
60
|
+
V(I.map((n, r) => r === e ? t : n));
|
|
61
|
+
}, [I, V]), W = g(() => {
|
|
56
62
|
let e = s(), t = {
|
|
57
63
|
...a,
|
|
58
64
|
id: e,
|
|
@@ -67,76 +73,152 @@ var x = [
|
|
|
67
73
|
position: "100%"
|
|
68
74
|
}]
|
|
69
75
|
};
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
76
|
+
z(e), V([...I, t]);
|
|
77
|
+
}, [I, V]), G = g((e) => () => {
|
|
78
|
+
V(I.filter((t, n) => n !== e));
|
|
79
|
+
}, [I, V]), K = g((e) => {
|
|
80
|
+
O("background-color", e);
|
|
81
|
+
}, [O]), q = g((e) => {
|
|
82
|
+
O("background-blend-mode", e);
|
|
83
|
+
}, [O]), J = g((e) => {
|
|
84
|
+
O("mask-image", e);
|
|
85
|
+
}, [O]), Y = g((e) => D?.("background", e), [D]);
|
|
86
|
+
return /* @__PURE__ */ y(f, {
|
|
79
87
|
title: "Background",
|
|
80
|
-
dotKeys:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
dotKeys: S,
|
|
89
|
+
advancedKeys: w,
|
|
90
|
+
isCollapsed: E,
|
|
91
|
+
onCollapse: Y,
|
|
92
|
+
children: /* @__PURE__ */ b("div", {
|
|
84
93
|
className: "flex flex-col gap-2",
|
|
85
94
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ b("div", {
|
|
87
96
|
className: "flex flex-col gap-1",
|
|
88
97
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ b("div", {
|
|
90
99
|
className: "flex items-center justify-between",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
-
keyValue:
|
|
100
|
+
children: [/* @__PURE__ */ y(n, {
|
|
101
|
+
keyValue: C,
|
|
93
102
|
children: "Layers"
|
|
94
|
-
}), /* @__PURE__ */
|
|
103
|
+
}), /* @__PURE__ */ b("button", {
|
|
95
104
|
type: "button",
|
|
96
105
|
className: "flex cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 text-xs text-blue-500 hover:bg-blue-50 hover:text-blue-700 dark:hover:bg-blue-900/30",
|
|
97
|
-
onClick:
|
|
106
|
+
onClick: W,
|
|
98
107
|
title: "Add background layer",
|
|
99
|
-
children: [/* @__PURE__ */
|
|
108
|
+
children: [/* @__PURE__ */ y("i", { className: "fas fa-plus text-[10px]" }), "Add"]
|
|
100
109
|
})]
|
|
101
110
|
}),
|
|
102
|
-
!
|
|
111
|
+
!I.length && /* @__PURE__ */ y("div", {
|
|
103
112
|
className: "rounded border border-dashed border-gray-300 py-3 text-center text-xs text-gray-400 dark:border-zinc-600 dark:text-zinc-500",
|
|
104
113
|
children: "No layers — click Add to start"
|
|
105
114
|
}),
|
|
106
|
-
|
|
115
|
+
I.length > 0 && /* @__PURE__ */ y("div", {
|
|
107
116
|
className: "flex flex-col gap-1",
|
|
108
|
-
children:
|
|
117
|
+
children: I.map((e, t) => /* @__PURE__ */ y(u, {
|
|
109
118
|
index: t,
|
|
110
119
|
layer: e,
|
|
111
|
-
expanded:
|
|
112
|
-
onExpand:
|
|
113
|
-
onChange:
|
|
114
|
-
onRemove:
|
|
115
|
-
onReorder:
|
|
120
|
+
expanded: R === e.id,
|
|
121
|
+
onExpand: B,
|
|
122
|
+
onChange: U(t),
|
|
123
|
+
onRemove: G(t),
|
|
124
|
+
onReorder: H
|
|
116
125
|
}, e.id))
|
|
117
126
|
})
|
|
118
127
|
]
|
|
119
128
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ y(i, {
|
|
121
130
|
label: "Base Color",
|
|
122
131
|
keys: ["background-color"],
|
|
123
|
-
children: /* @__PURE__ */
|
|
132
|
+
children: /* @__PURE__ */ y(r, {
|
|
124
133
|
type: "color",
|
|
125
|
-
value:
|
|
126
|
-
onChange:
|
|
134
|
+
value: A,
|
|
135
|
+
onChange: K
|
|
127
136
|
})
|
|
128
137
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
label: "
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
/* @__PURE__ */ y(d, { children: /* @__PURE__ */ b(i, {
|
|
139
|
+
label: "",
|
|
140
|
+
children: [/* @__PURE__ */ b(r, {
|
|
141
|
+
keys: ["background-blend-mode"],
|
|
142
|
+
label: "Blend",
|
|
143
|
+
value: j,
|
|
144
|
+
onChange: q,
|
|
145
|
+
type: "select",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ y("option", {
|
|
148
|
+
value: "normal",
|
|
149
|
+
children: "Normal"
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ y("option", {
|
|
152
|
+
value: "multiply",
|
|
153
|
+
children: "Multiply"
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ y("option", {
|
|
156
|
+
value: "screen",
|
|
157
|
+
children: "Screen"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ y("option", {
|
|
160
|
+
value: "overlay",
|
|
161
|
+
children: "Overlay"
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ y("option", {
|
|
164
|
+
value: "darken",
|
|
165
|
+
children: "Darken"
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ y("option", {
|
|
168
|
+
value: "lighten",
|
|
169
|
+
children: "Lighten"
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ y("option", {
|
|
172
|
+
value: "color-dodge",
|
|
173
|
+
children: "Color Dodge"
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ y("option", {
|
|
176
|
+
value: "color-burn",
|
|
177
|
+
children: "Color Burn"
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ y("option", {
|
|
180
|
+
value: "hard-light",
|
|
181
|
+
children: "Hard Light"
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ y("option", {
|
|
184
|
+
value: "soft-light",
|
|
185
|
+
children: "Soft Light"
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ y("option", {
|
|
188
|
+
value: "difference",
|
|
189
|
+
children: "Difference"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ y("option", {
|
|
192
|
+
value: "exclusion",
|
|
193
|
+
children: "Exclusion"
|
|
194
|
+
}),
|
|
195
|
+
/* @__PURE__ */ y("option", {
|
|
196
|
+
value: "hue",
|
|
197
|
+
children: "Hue"
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ y("option", {
|
|
200
|
+
value: "saturation",
|
|
201
|
+
children: "Saturation"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ y("option", {
|
|
204
|
+
value: "color",
|
|
205
|
+
children: "Color"
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ y("option", {
|
|
208
|
+
value: "luminosity",
|
|
209
|
+
children: "Luminosity"
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
}), /* @__PURE__ */ y(r, {
|
|
213
|
+
keys: ["mask-image"],
|
|
214
|
+
label: "Mask",
|
|
215
|
+
value: M,
|
|
216
|
+
onChange: J
|
|
217
|
+
})]
|
|
218
|
+
}) })
|
|
137
219
|
]
|
|
138
220
|
})
|
|
139
221
|
});
|
|
140
222
|
});
|
|
141
223
|
//#endregion
|
|
142
|
-
export {
|
|
224
|
+
export { E as default };
|