@plitzi/sdk-style 0.38.10 → 0.38.12
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 +289 -0
- package/dist/StyleMap/helpers/isValueValid.mjs +5 -4
- package/dist/StyleMap/helpers/utils.mjs +13 -12
- package/dist/components/InputEasing/InputEasingButton.mjs +1 -1
- package/dist/components/InputEasing/InputEasingList.mjs +5 -5
- package/dist/components/Selector/Selector.mjs +2 -1
- package/dist/components/Selector/SelectorItem/ItemOptions.mjs +45 -41
- package/dist/components/Selector/SelectorItem/SelectorItem.mjs +4 -4
- package/dist/components/Selector/SelectorItem/helpers.d.ts +2 -0
- package/dist/components/Selector/SelectorItem/helpers.mjs +4 -0
- package/dist/components/StyleInspector/Inspector.mjs +185 -171
- package/dist/components/StyleInspector/InspectorSearchContext.d.ts +3 -0
- package/dist/components/StyleInspector/InspectorSearchContext.mjs +6 -0
- package/dist/components/StyleInspector/StyleInspector.mjs +213 -187
- package/dist/components/StyleInspector/categories/Background/Background.mjs +84 -177
- package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.mjs +53 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundAttachment/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +159 -153
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts +11 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs +45 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.mjs +26 -23
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.mjs +65 -56
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts +4 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs +8 -0
- package/dist/components/StyleInspector/categories/Background/components/BackgroundTile/BackgroundTile.mjs +28 -27
- 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/components/GradientStopBar/GradientPreviewBar.d.ts +4 -2
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientPreviewBar.mjs +19 -18
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.d.ts +4 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopBar.mjs +48 -80
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.d.ts +5 -3
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +51 -41
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.d.ts +5 -1
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopHandle.mjs +54 -32
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.d.ts +3 -1
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopTrack.mjs +14 -13
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/components/GradientStopBar/helpers.mjs +8 -0
- package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +11 -0
- package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.d.ts +3 -0
- package/dist/components/StyleInspector/categories/Background/components/LayerGroup/index.mjs +5 -0
- package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.d.ts +21 -7
- package/dist/components/StyleInspector/categories/Background/helpers/backgroundParser.mjs +114 -113
- package/dist/components/StyleInspector/categories/Background/helpers/layerValues.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/helpers/layerValues.mjs +11 -0
- package/dist/components/StyleInspector/categories/Background/modes/ConicGradientMode.mjs +22 -79
- package/dist/components/StyleInspector/categories/Background/modes/ImageMode.mjs +16 -77
- package/dist/components/StyleInspector/categories/Background/modes/LinearGradientMode.mjs +19 -62
- package/dist/components/StyleInspector/categories/Background/modes/RadialGradientMode.mjs +58 -98
- package/dist/components/StyleInspector/categories/Background/modes/RawMode.d.ts +8 -0
- package/dist/components/StyleInspector/categories/Background/modes/RawMode.mjs +22 -0
- package/dist/components/StyleInspector/categories/Background/modes/helpers.d.ts +19 -0
- package/dist/components/StyleInspector/categories/Background/modes/helpers.mjs +54 -0
- package/dist/components/StyleInspector/categories/Border/Border.mjs +26 -43
- package/dist/components/StyleInspector/categories/Border/BorderPlacements.mjs +60 -51
- package/dist/components/StyleInspector/categories/Display/Display.mjs +65 -81
- 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/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +13 -36
- package/dist/components/StyleInspector/categories/Effects/Effects.mjs +120 -204
- package/dist/components/StyleInspector/categories/Effects/Filters/Filter.mjs +23 -31
- package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.d.ts +9 -5
- package/dist/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +57 -124
- package/dist/components/StyleInspector/categories/Effects/Filters/helpers.d.ts +25 -0
- package/dist/components/StyleInspector/categories/Effects/Filters/helpers.mjs +87 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/Transform.mjs +18 -28
- package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.d.ts +1 -2
- package/dist/components/StyleInspector/categories/Effects/Transform/TransformItem.mjs +52 -76
- package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.d.ts +5 -0
- package/dist/components/StyleInspector/categories/Effects/Transform/transformFunctions.mjs +8 -2
- package/dist/components/StyleInspector/categories/Effects/Transition/Transition.mjs +21 -37
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.d.ts +10 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +92 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.d.ts +4 -4
- package/dist/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +78 -359
- package/dist/components/StyleInspector/categories/Effects/Transition/helpers.d.ts +39 -0
- package/dist/components/StyleInspector/categories/Effects/Transition/helpers.mjs +268 -0
- package/dist/components/StyleInspector/categories/List/List.mjs +21 -70
- package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +21 -70
- package/dist/components/StyleInspector/categories/Others/Others.mjs +63 -85
- package/dist/components/StyleInspector/categories/Position/Position.mjs +67 -75
- package/dist/components/StyleInspector/categories/RawStyle/RawStyle.mjs +19 -18
- package/dist/components/StyleInspector/categories/Size/Size.mjs +65 -85
- package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
- 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 -67
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +58 -67
- package/dist/components/StyleInspector/categories/Typography/TypographyFont.mjs +1 -1
- package/dist/components/StyleInspector/categories/Typography/TypographyStyle.mjs +1 -1
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadow.mjs +16 -40
- package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
- 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/categoryKeys.d.ts +45 -0
- package/dist/components/StyleInspector/categoryKeys.mjs +220 -0
- package/dist/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +43 -38
- package/dist/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +2 -1
- package/dist/components/StyleInspector/components/CategorySection/CategorySection.mjs +30 -15
- package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.d.ts +8 -0
- package/dist/components/StyleInspector/components/ColorSwatch/ColorSwatch.mjs +23 -0
- package/dist/components/StyleInspector/components/ColorSwatch/helpers.d.ts +3 -0
- package/dist/components/StyleInspector/components/ColorSwatch/helpers.mjs +9 -0
- package/dist/components/StyleInspector/components/ColorSwatch/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/ColorSwatch/index.mjs +5 -0
- package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.d.ts +1 -0
- package/dist/components/StyleInspector/components/InspectorDots/InspectorDots.mjs +11 -11
- package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.d.ts +11 -0
- package/dist/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +38 -0
- package/dist/components/StyleInspector/components/InspectorFooter/helpers.d.ts +2 -0
- package/dist/components/StyleInspector/components/InspectorFooter/helpers.mjs +11 -0
- package/dist/components/StyleInspector/components/InspectorFooter/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/InspectorFooter/index.mjs +5 -0
- package/dist/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +34 -31
- package/dist/components/StyleInspector/components/InspectorLabel/helpers.d.ts +17 -0
- package/dist/components/StyleInspector/components/InspectorLabel/helpers.mjs +16 -0
- package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.d.ts +7 -0
- package/dist/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +24 -0
- package/dist/components/StyleInspector/components/InspectorSearch/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/InspectorSearch/index.mjs +5 -0
- package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.d.ts +9 -0
- package/dist/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +110 -0
- package/dist/components/StyleInspector/components/ShadowItem/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/ShadowItem/index.mjs +5 -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/components/TargetSummary/TargetSummary.d.ts +7 -0
- package/dist/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +24 -0
- package/dist/components/StyleInspector/components/TargetSummary/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/TargetSummary/index.mjs +5 -0
- package/dist/components/StyleInspector/components/ValueList/ValueList.d.ts +12 -0
- package/dist/components/StyleInspector/components/ValueList/ValueList.mjs +25 -0
- package/dist/components/StyleInspector/components/ValueList/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/ValueList/index.mjs +5 -0
- package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.d.ts +16 -0
- package/dist/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +71 -0
- package/dist/components/StyleInspector/components/ValueListItem/index.d.ts +3 -0
- package/dist/components/StyleInspector/components/ValueListItem/index.mjs +5 -0
- package/dist/components/StyleInspector/cssValues.d.ts +13 -0
- package/dist/components/StyleInspector/cssValues.mjs +23 -0
- package/dist/components/StyleInspector/helpers.d.ts +17 -1
- package/dist/components/StyleInspector/helpers.mjs +9 -2
- package/dist/components/StyleInspector/hooks/useInspectorValues.mjs +42 -45
- package/dist/components/StyleInspector/hooks/usePropertyChange.d.ts +6 -0
- package/dist/components/StyleInspector/hooks/usePropertyChange.mjs +9 -0
- package/dist/components/StyleInspector/search.d.ts +11 -0
- package/dist/components/StyleInspector/search.mjs +14 -0
- package/dist/components/StyleInspector/shadowValue.d.ts +20 -0
- package/dist/components/StyleInspector/shadowValue.mjs +36 -0
- package/dist/components/StyleManager/StyleSelectorTag.mjs +1 -1
- package/package.json +225 -21
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.d.ts +0 -8
- package/dist/components/StyleInspector/categories/Display/DisplayGridGap.mjs +0 -27
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.d.ts +0 -8
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadowItem.mjs +0 -132
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.d.ts +0 -2
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/helpers.mjs +0 -18
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.d.ts +0 -8
- package/dist/components/StyleInspector/categories/Typography/TypographyTextShadowItem.mjs +0 -83
|
@@ -1,64 +1,49 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "../../
|
|
3
|
-
import n from "../../
|
|
1
|
+
import { BLEND_MODES as e } from "../blendModes.mjs";
|
|
2
|
+
import t from "../../StyleInspectorContext.mjs";
|
|
3
|
+
import n from "../../hooks/useInspectorValues.mjs";
|
|
4
4
|
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 "../../
|
|
9
|
-
import f from "../../components/
|
|
10
|
-
import p from "
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
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";
|
|
14
17
|
//#region src/components/StyleInspector/categories/Background/Background.tsx
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"background-attachment",
|
|
19
|
-
"background-position",
|
|
20
|
-
"background-repeat",
|
|
21
|
-
"background-clip",
|
|
22
|
-
"background-size",
|
|
23
|
-
"background-blend-mode",
|
|
24
|
-
"mask-image"
|
|
25
|
-
], C = [
|
|
26
|
-
"background-image",
|
|
27
|
-
"background-size",
|
|
28
|
-
"background-position",
|
|
29
|
-
"background-repeat",
|
|
30
|
-
"background-attachment",
|
|
31
|
-
"background-clip"
|
|
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,
|
|
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,
|
|
35
21
|
asValue: !0,
|
|
36
|
-
strictMode: !0
|
|
37
|
-
|
|
38
|
-
}), { "background-color": A, "background-blend-mode": j, "mask-image": M } = t({
|
|
22
|
+
strictMode: !0
|
|
23
|
+
}), { "background-color": j, "background-blend-mode": M, "mask-image": N } = n({
|
|
39
24
|
keys: [
|
|
40
25
|
"background-color",
|
|
41
26
|
"background-blend-mode",
|
|
42
27
|
"mask-image"
|
|
43
28
|
],
|
|
44
29
|
asValue: !0,
|
|
45
|
-
replaceTokens:
|
|
46
|
-
}),
|
|
47
|
-
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
let [
|
|
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) => {
|
|
53
38
|
let t = l(e);
|
|
54
|
-
|
|
55
|
-
}, [
|
|
39
|
+
I.current = h(t), R(e), k(void 0, t);
|
|
40
|
+
}, [k]), U = b((e, t) => {
|
|
56
41
|
if (e === t) return;
|
|
57
|
-
let n = [...
|
|
58
|
-
n.splice(t, 0, r),
|
|
59
|
-
}, [
|
|
60
|
-
|
|
61
|
-
}, [
|
|
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(() => {
|
|
62
47
|
let e = s(), t = {
|
|
63
48
|
...a,
|
|
64
49
|
id: e,
|
|
@@ -73,147 +58,69 @@ var S = [
|
|
|
73
58
|
position: "100%"
|
|
74
59
|
}]
|
|
75
60
|
};
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
title:
|
|
88
|
-
dotKeys:
|
|
89
|
-
advancedKeys:
|
|
90
|
-
isCollapsed:
|
|
91
|
-
onCollapse:
|
|
92
|
-
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", {
|
|
93
78
|
className: "flex flex-col gap-2",
|
|
94
79
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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",
|
|
113
|
-
children: "No layers — click Add to start"
|
|
114
|
-
}),
|
|
115
|
-
I.length > 0 && /* @__PURE__ */ y("div", {
|
|
116
|
-
className: "flex flex-col gap-1",
|
|
117
|
-
children: I.map((e, t) => /* @__PURE__ */ y(u, {
|
|
118
|
-
index: t,
|
|
119
|
-
layer: e,
|
|
120
|
-
expanded: R === e.id,
|
|
121
|
-
onExpand: B,
|
|
122
|
-
onChange: U(t),
|
|
123
|
-
onRemove: G(t),
|
|
124
|
-
onReorder: H
|
|
125
|
-
}, e.id))
|
|
126
|
-
})
|
|
127
|
-
]
|
|
80
|
+
/* @__PURE__ */ w(_, {
|
|
81
|
+
label: "Layers",
|
|
82
|
+
keys: m,
|
|
83
|
+
addLabel: "Add a layer — the first one is drawn on top",
|
|
84
|
+
onAdd: G,
|
|
85
|
+
children: [!L.length && /* @__PURE__ */ C("p", {
|
|
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",
|
|
87
|
+
children: "No layers. Add one for a gradient or an image."
|
|
88
|
+
}), L.length > 0 && L.map((e, t) => /* @__PURE__ */ C(u, {
|
|
89
|
+
index: t,
|
|
90
|
+
layer: e,
|
|
91
|
+
expanded: z === e.id,
|
|
92
|
+
onExpand: V,
|
|
93
|
+
onChange: W(t),
|
|
94
|
+
onRemove: K(t),
|
|
95
|
+
onReorder: U
|
|
96
|
+
}, e.id))]
|
|
128
97
|
}),
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
label: "
|
|
131
|
-
keys:
|
|
132
|
-
children: /* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ C(i, {
|
|
99
|
+
label: "Color",
|
|
100
|
+
keys: E,
|
|
101
|
+
children: /* @__PURE__ */ C(r, {
|
|
133
102
|
type: "color",
|
|
134
|
-
value:
|
|
135
|
-
onChange:
|
|
103
|
+
value: j,
|
|
104
|
+
onChange: q
|
|
136
105
|
})
|
|
137
106
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ C(f, { children: /* @__PURE__ */ w(i, {
|
|
139
108
|
label: "",
|
|
140
|
-
children: [/* @__PURE__ */
|
|
109
|
+
children: [/* @__PURE__ */ C(r, {
|
|
141
110
|
keys: ["background-blend-mode"],
|
|
142
111
|
label: "Blend",
|
|
143
|
-
value:
|
|
144
|
-
onChange:
|
|
112
|
+
value: M,
|
|
113
|
+
onChange: J,
|
|
145
114
|
type: "select",
|
|
146
|
-
children: [
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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, {
|
|
115
|
+
children: e.map(([e, t]) => /* @__PURE__ */ C("option", {
|
|
116
|
+
value: e,
|
|
117
|
+
children: t
|
|
118
|
+
}, e))
|
|
119
|
+
}), /* @__PURE__ */ C(r, {
|
|
213
120
|
keys: ["mask-image"],
|
|
214
121
|
label: "Mask",
|
|
215
|
-
value:
|
|
216
|
-
onChange:
|
|
122
|
+
value: N,
|
|
123
|
+
onChange: Y
|
|
217
124
|
})]
|
|
218
125
|
}) })
|
|
219
126
|
]
|
|
@@ -221,4 +128,4 @@ var S = [
|
|
|
221
128
|
});
|
|
222
129
|
});
|
|
223
130
|
//#endregion
|
|
224
|
-
export {
|
|
131
|
+
export { D as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BackgroundLayer } from '../../helpers/backgroundParser';
|
|
2
|
+
export type BackgroundAttachmentProps = {
|
|
3
|
+
layer: BackgroundLayer;
|
|
4
|
+
onChange?: (layer: BackgroundLayer) => void;
|
|
5
|
+
};
|
|
6
|
+
/** Whether the layer scrolls with the element, with its content, or stays put while the page moves under it. */
|
|
7
|
+
declare const BackgroundAttachment: ({ layer, onChange }: BackgroundAttachmentProps) => import('react').JSX.Element;
|
|
8
|
+
export default BackgroundAttachment;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { useCallback as r, useMemo as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundAttachment/BackgroundAttachment.tsx
|
|
7
|
+
var o = ({ layer: o, onChange: s }) => {
|
|
8
|
+
let c = i(() => [
|
|
9
|
+
{
|
|
10
|
+
value: "scroll",
|
|
11
|
+
icon: /* @__PURE__ */ a("span", {
|
|
12
|
+
className: "px-1.5 text-xs select-none",
|
|
13
|
+
children: "Scroll"
|
|
14
|
+
}),
|
|
15
|
+
description: "Scrolls with the element",
|
|
16
|
+
active: o.attachment === "scroll",
|
|
17
|
+
size: "custom"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
value: "local",
|
|
21
|
+
icon: /* @__PURE__ */ a("span", {
|
|
22
|
+
className: "px-1.5 text-xs select-none",
|
|
23
|
+
children: "Local"
|
|
24
|
+
}),
|
|
25
|
+
description: "Scrolls with the element’s content",
|
|
26
|
+
active: o.attachment === "local",
|
|
27
|
+
size: "custom"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "fixed",
|
|
31
|
+
icon: /* @__PURE__ */ a("span", {
|
|
32
|
+
className: "px-1.5 text-xs select-none",
|
|
33
|
+
children: "Fixed"
|
|
34
|
+
}),
|
|
35
|
+
description: "Stays put while the page scrolls",
|
|
36
|
+
active: o.attachment === "fixed",
|
|
37
|
+
size: "custom"
|
|
38
|
+
}
|
|
39
|
+
], [o.attachment]), l = r((t) => s?.({
|
|
40
|
+
...o,
|
|
41
|
+
attachment: e(t)
|
|
42
|
+
}), [o, s]);
|
|
43
|
+
return /* @__PURE__ */ a(n, {
|
|
44
|
+
label: "Attachment",
|
|
45
|
+
children: /* @__PURE__ */ a(t, {
|
|
46
|
+
type: "iconGroup",
|
|
47
|
+
items: c,
|
|
48
|
+
onChange: l
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { o as default };
|