@plitzi/sdk-style 0.38.10 → 0.38.11
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 +180 -0
- 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 +154 -128
- package/dist/components/StyleInspector/categories/Background/Background.mjs +82 -114
- 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/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 +52 -87
- 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 +79 -97
- 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 +32 -49
- package/dist/components/StyleInspector/categories/DisplayFlexChild/DisplayFlexChild.mjs +33 -38
- package/dist/components/StyleInspector/categories/Effects/BoxShadow/BoxShadow.mjs +21 -33
- package/dist/components/StyleInspector/categories/Effects/Effects.mjs +131 -154
- 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 +39 -38
- package/dist/components/StyleInspector/categories/ListItem/ListItem.mjs +29 -29
- package/dist/components/StyleInspector/categories/Others/Others.mjs +66 -88
- 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 +68 -88
- package/dist/components/StyleInspector/categories/Spacing/Spacing.mjs +18 -27
- package/dist/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +2 -2
- package/dist/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +4 -3
- package/dist/components/StyleInspector/categories/Typography/Typography.mjs +88 -98
- 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 +26 -39
- package/dist/components/StyleInspector/categories/Variables/Variables.mjs +38 -37
- 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/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 +15 -0
- package/dist/components/StyleInspector/cssValues.mjs +27 -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/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 +185 -17
- 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,172 +1,178 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import p from "
|
|
11
|
-
import m from "
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
value: "content-box",
|
|
31
|
-
label: "Content Box"
|
|
32
|
-
}
|
|
33
|
-
], v = s(({ layer: s, index: v, expanded: y, onExpand: b, onChange: x, onRemove: S, onReorder: C }) => {
|
|
34
|
-
let [w, T] = u(!1), E = l(() => n(s), [s]), D = c((e) => {
|
|
35
|
-
let t = String(e);
|
|
36
|
-
x({
|
|
37
|
-
...s,
|
|
38
|
-
type: t
|
|
1
|
+
import { CLIP_OPTIONS as e, LAYER_TYPES as t, LAYER_TYPE_LABELS as n, isGradient as r, layerSummary as i } from "./helpers.mjs";
|
|
2
|
+
import { asText as a } from "../../../../cssValues.mjs";
|
|
3
|
+
import o from "../../../../components/CategoryOption/index.mjs";
|
|
4
|
+
import s from "../../../../components/CategorySection/index.mjs";
|
|
5
|
+
import c from "../../../../components/ColorSwatch/index.mjs";
|
|
6
|
+
import { serializeLayerImage as l } from "../../helpers/backgroundParser.mjs";
|
|
7
|
+
import u from "../../modes/ConicGradientMode.mjs";
|
|
8
|
+
import d from "../../modes/ImageMode.mjs";
|
|
9
|
+
import f from "../../modes/LinearGradientMode.mjs";
|
|
10
|
+
import p from "../../modes/RadialGradientMode.mjs";
|
|
11
|
+
import m from "../../modes/RawMode.mjs";
|
|
12
|
+
import h from "../BackgroundAttachment/index.mjs";
|
|
13
|
+
import g from "../BackgroundPosition/index.mjs";
|
|
14
|
+
import _ from "../BackgroundSize/index.mjs";
|
|
15
|
+
import v from "../BackgroundTile/index.mjs";
|
|
16
|
+
import y from "../LayerGroup/index.mjs";
|
|
17
|
+
import { memo as b, useCallback as x, useMemo as S, useState as C } from "react";
|
|
18
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
19
|
+
import E from "clsx";
|
|
20
|
+
import D from "@plitzi/plitzi-ui/Switch";
|
|
21
|
+
import { nodeOf as O } from "@plitzi/sdk-shared/helpers/eventTarget";
|
|
22
|
+
var k = b(({ layer: b, index: k, expanded: A, onExpand: j, onChange: M, onRemove: N, onReorder: P }) => {
|
|
23
|
+
let [F, I] = C(!1), L = S(() => l(b), [b]), R = x((e) => {
|
|
24
|
+
let n = t.find((t) => t === a(e));
|
|
25
|
+
n && M({
|
|
26
|
+
...b,
|
|
27
|
+
type: n
|
|
39
28
|
});
|
|
40
|
-
}, [
|
|
41
|
-
...
|
|
42
|
-
|
|
43
|
-
}), [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
29
|
+
}, [b, M]), z = x((e) => M({
|
|
30
|
+
...b,
|
|
31
|
+
repeating: e.target.checked
|
|
32
|
+
}), [b, M]), B = x((e) => M({
|
|
33
|
+
...b,
|
|
34
|
+
clip: a(e)
|
|
35
|
+
}), [b, M]), V = x(() => j(b.id), [j, b.id]), H = x((e) => {
|
|
36
|
+
e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), j(b.id));
|
|
37
|
+
}, [j, b.id]), U = x((e) => e.stopPropagation(), []), W = x((e) => {
|
|
38
|
+
e.stopPropagation(), N();
|
|
39
|
+
}, [N]), G = x((e) => {
|
|
40
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(k));
|
|
41
|
+
}, [k]), K = x(() => I(!1), []), q = x((e) => {
|
|
42
|
+
e.preventDefault(), I(!0);
|
|
43
|
+
}, []), J = x((e) => {
|
|
44
|
+
e.currentTarget.contains(O(e.relatedTarget)) || I(!1);
|
|
45
|
+
}, []), Y = x((e) => {
|
|
46
|
+
e.preventDefault(), I(!1);
|
|
53
47
|
let t = parseInt(e.dataTransfer.getData("text/plain"), 10);
|
|
54
|
-
isNaN(t) ||
|
|
55
|
-
}, [
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
className:
|
|
58
|
-
"border-
|
|
59
|
-
"border-
|
|
48
|
+
isNaN(t) || P(t, k);
|
|
49
|
+
}, [k, P]), X = r(b.type), Z = b.type !== "none";
|
|
50
|
+
return /* @__PURE__ */ T("div", {
|
|
51
|
+
className: E("rounded-md border transition-colors duration-150", {
|
|
52
|
+
"border-primary-500 bg-primary-500/5 dark:border-primary-400 dark:bg-primary-400/10": F,
|
|
53
|
+
"border-primary-500/60 dark:border-primary-400/60": A && !F,
|
|
54
|
+
"border-gray-200 dark:border-zinc-700": !A && !F
|
|
60
55
|
}),
|
|
61
|
-
onDragOver:
|
|
62
|
-
onDragLeave:
|
|
63
|
-
onDrop:
|
|
64
|
-
children: [/* @__PURE__ */
|
|
65
|
-
className: "flex h-8 items-center gap-
|
|
56
|
+
onDragOver: q,
|
|
57
|
+
onDragLeave: J,
|
|
58
|
+
onDrop: Y,
|
|
59
|
+
children: [/* @__PURE__ */ T("div", {
|
|
60
|
+
className: "group flex h-8 cursor-pointer items-center gap-2 px-1.5 select-none",
|
|
61
|
+
role: "button",
|
|
62
|
+
tabIndex: 0,
|
|
63
|
+
"aria-expanded": A,
|
|
64
|
+
onClick: V,
|
|
65
|
+
onKeyDown: H,
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ w("span", {
|
|
68
68
|
draggable: !0,
|
|
69
|
-
className: "cursor-grab
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
77
|
-
s.type !== "none" && /* @__PURE__ */ d("div", {
|
|
78
|
-
className: "h-4 w-4 shrink-0 rounded-sm border border-gray-300 dark:border-zinc-600",
|
|
79
|
-
style: { background: E }
|
|
69
|
+
className: "flex h-5 w-4 cursor-grab items-center justify-center text-zinc-400 hover:text-zinc-700 active:cursor-grabbing dark:text-zinc-500 dark:hover:text-zinc-200",
|
|
70
|
+
title: "Drag to reorder — the first layer is drawn on top",
|
|
71
|
+
onClick: U,
|
|
72
|
+
onDragStart: G,
|
|
73
|
+
onDragEnd: K,
|
|
74
|
+
children: /* @__PURE__ */ w("i", { className: "fa-solid fa-grip-vertical text-xs" })
|
|
80
75
|
}),
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
className: "
|
|
83
|
-
|
|
76
|
+
/* @__PURE__ */ w(c, {
|
|
77
|
+
className: "h-5 w-5",
|
|
78
|
+
value: L,
|
|
79
|
+
property: "background"
|
|
84
80
|
}),
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
title: y ? "Collapse" : "Expand",
|
|
90
|
-
children: /* @__PURE__ */ d(m, {
|
|
91
|
-
icon: y ? "fa-solid fa-angle-up" : "fa-solid fa-angle-down",
|
|
92
|
-
size: "xs"
|
|
93
|
-
})
|
|
81
|
+
/* @__PURE__ */ w("span", {
|
|
82
|
+
className: "min-w-0 grow truncate text-xs text-zinc-700 dark:text-zinc-200",
|
|
83
|
+
title: i(b),
|
|
84
|
+
children: i(b)
|
|
94
85
|
}),
|
|
95
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ w("i", { className: E("fa-solid text-xs text-zinc-400 dark:text-zinc-500", {
|
|
87
|
+
"fa-angle-up": A,
|
|
88
|
+
"fa-angle-down": !A
|
|
89
|
+
}) }),
|
|
90
|
+
/* @__PURE__ */ w("button", {
|
|
96
91
|
type: "button",
|
|
97
|
-
className: "cursor-pointer
|
|
98
|
-
onClick: S,
|
|
92
|
+
className: "flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-zinc-400 hover:bg-red-500/10 hover:text-red-600 dark:text-zinc-500 dark:hover:text-red-400",
|
|
99
93
|
title: "Remove layer",
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})
|
|
94
|
+
"aria-label": "Remove layer",
|
|
95
|
+
onClick: W,
|
|
96
|
+
children: /* @__PURE__ */ w("i", { className: "fa-solid fa-xmark text-xs" })
|
|
104
97
|
})
|
|
105
98
|
]
|
|
106
|
-
}),
|
|
107
|
-
className: "flex flex-col gap-
|
|
108
|
-
children: [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
}), A && /* @__PURE__ */ T("div", {
|
|
100
|
+
className: "flex flex-col gap-4 border-t border-gray-200 p-2.5 dark:border-zinc-700",
|
|
101
|
+
children: [/* @__PURE__ */ T(y, {
|
|
102
|
+
title: X ? "Gradient" : n[b.type],
|
|
103
|
+
children: [
|
|
104
|
+
/* @__PURE__ */ w(o, {
|
|
105
|
+
label: "Type",
|
|
112
106
|
type: "select",
|
|
113
|
-
value:
|
|
114
|
-
onChange:
|
|
115
|
-
children:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
107
|
+
value: b.type,
|
|
108
|
+
onChange: R,
|
|
109
|
+
children: t.map((e) => /* @__PURE__ */ w("option", {
|
|
110
|
+
value: e,
|
|
111
|
+
children: n[e]
|
|
112
|
+
}, e))
|
|
113
|
+
}),
|
|
114
|
+
b.type === "url" && /* @__PURE__ */ w(d, {
|
|
115
|
+
layer: b,
|
|
116
|
+
onChange: M
|
|
117
|
+
}),
|
|
118
|
+
b.type === "raw" && /* @__PURE__ */ w(m, {
|
|
119
|
+
layer: b,
|
|
120
|
+
onChange: M
|
|
121
|
+
}),
|
|
122
|
+
b.type === "linear-gradient" && /* @__PURE__ */ w(f, {
|
|
123
|
+
layer: b,
|
|
124
|
+
onChange: M
|
|
125
|
+
}),
|
|
126
|
+
b.type === "radial-gradient" && /* @__PURE__ */ w(p, {
|
|
127
|
+
layer: b,
|
|
128
|
+
onChange: M
|
|
129
|
+
}),
|
|
130
|
+
b.type === "conic-gradient" && /* @__PURE__ */ w(u, {
|
|
131
|
+
layer: b,
|
|
132
|
+
onChange: M
|
|
133
|
+
}),
|
|
134
|
+
X && /* @__PURE__ */ w(D, {
|
|
135
|
+
size: "xs",
|
|
136
|
+
label: "Repeat the gradient",
|
|
137
|
+
checked: b.repeating,
|
|
138
|
+
onChange: z
|
|
137
139
|
})
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
value:
|
|
163
|
-
|
|
164
|
-
|
|
140
|
+
]
|
|
141
|
+
}), Z && /* @__PURE__ */ T(y, {
|
|
142
|
+
title: "Placement",
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ w(_, {
|
|
145
|
+
layer: b,
|
|
146
|
+
onChange: M
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ w(g, {
|
|
149
|
+
layer: b,
|
|
150
|
+
onChange: M
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ w(v, {
|
|
153
|
+
layer: b,
|
|
154
|
+
onChange: M
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ w(h, {
|
|
157
|
+
layer: b,
|
|
158
|
+
onChange: M
|
|
159
|
+
}),
|
|
160
|
+
/* @__PURE__ */ w(s, {
|
|
161
|
+
label: "Clip",
|
|
162
|
+
children: /* @__PURE__ */ w(o, {
|
|
163
|
+
type: "select",
|
|
164
|
+
value: b.clip,
|
|
165
|
+
onChange: B,
|
|
166
|
+
children: e.map((e) => /* @__PURE__ */ w("option", {
|
|
167
|
+
value: e.value,
|
|
168
|
+
children: e.label
|
|
169
|
+
}, e.value))
|
|
170
|
+
})
|
|
165
171
|
})
|
|
166
|
-
|
|
167
|
-
]
|
|
172
|
+
]
|
|
173
|
+
})]
|
|
168
174
|
})]
|
|
169
175
|
});
|
|
170
176
|
});
|
|
171
177
|
//#endregion
|
|
172
|
-
export {
|
|
178
|
+
export { k as default };
|
package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BackgroundLayer, BackgroundLayerType } from '../../helpers/backgroundParser';
|
|
2
|
+
export declare const LAYER_TYPE_LABELS: Record<BackgroundLayerType, string>;
|
|
3
|
+
/** The order the type picker lists them in. */
|
|
4
|
+
export declare const LAYER_TYPES: BackgroundLayerType[];
|
|
5
|
+
export declare const CLIP_OPTIONS: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const isGradient: (type: BackgroundLayerType) => boolean;
|
|
10
|
+
/** How a layer's row names it: what it is, and the one detail that tells two of a kind apart. */
|
|
11
|
+
export declare const layerSummary: (layer: BackgroundLayer) => string;
|
package/dist/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundLayer/helpers.ts
|
|
2
|
+
var e = {
|
|
3
|
+
none: "None",
|
|
4
|
+
url: "Image",
|
|
5
|
+
"linear-gradient": "Linear gradient",
|
|
6
|
+
"radial-gradient": "Radial gradient",
|
|
7
|
+
"conic-gradient": "Conic gradient",
|
|
8
|
+
raw: "Custom (CSS)"
|
|
9
|
+
}, t = [
|
|
10
|
+
"linear-gradient",
|
|
11
|
+
"radial-gradient",
|
|
12
|
+
"conic-gradient",
|
|
13
|
+
"url",
|
|
14
|
+
"raw",
|
|
15
|
+
"none"
|
|
16
|
+
], n = [
|
|
17
|
+
{
|
|
18
|
+
value: "border-box",
|
|
19
|
+
label: "Border box"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: "padding-box",
|
|
23
|
+
label: "Padding box"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
value: "content-box",
|
|
27
|
+
label: "Content box"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: "text",
|
|
31
|
+
label: "Text"
|
|
32
|
+
}
|
|
33
|
+
], r = (e) => e === "linear-gradient" || e === "radial-gradient" || e === "conic-gradient", i = (e) => e.split(/[?#]/)[0].split("/").filter(Boolean).at(-1) ?? e, a = (t) => {
|
|
34
|
+
let n = `${t.repeating ? "Repeating " : ""}${e[t.type]}`;
|
|
35
|
+
switch (t.type) {
|
|
36
|
+
case "url": return t.url ? `${n} · ${i(t.url)}` : `${n} · no URL yet`;
|
|
37
|
+
case "raw": return `Custom · ${t.raw}`;
|
|
38
|
+
case "linear-gradient": return `${n} · ${t.angle || "to bottom"}`;
|
|
39
|
+
case "radial-gradient": return `${n} · ${t.radialShape}`;
|
|
40
|
+
case "conic-gradient": return `${n} · from ${t.conicAngle || "0deg"}`;
|
|
41
|
+
default: return n;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { n as CLIP_OPTIONS, t as LAYER_TYPES, e as LAYER_TYPE_LABELS, r as isGradient, a as layerSummary };
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import e from "../../../../
|
|
2
|
-
import t from "../../../../components/
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
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 } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/StyleInspector/categories/Background/components/BackgroundPosition/BackgroundPosition.tsx
|
|
6
|
-
var
|
|
7
|
+
var o = [
|
|
7
8
|
"center",
|
|
8
9
|
"top",
|
|
9
10
|
"right",
|
|
10
11
|
"bottom",
|
|
11
12
|
"left",
|
|
12
13
|
"auto"
|
|
13
|
-
],
|
|
14
|
-
let
|
|
15
|
-
...
|
|
16
|
-
positionX:
|
|
17
|
-
}), [
|
|
18
|
-
...
|
|
19
|
-
positionY:
|
|
20
|
-
}), [
|
|
21
|
-
return /* @__PURE__ */
|
|
14
|
+
], s = ({ layer: s, onChange: c }) => {
|
|
15
|
+
let l = r((t) => c?.({
|
|
16
|
+
...s,
|
|
17
|
+
positionX: e(t)
|
|
18
|
+
}), [s, c]), u = r((t) => c?.({
|
|
19
|
+
...s,
|
|
20
|
+
positionY: e(t)
|
|
21
|
+
}), [s, c]);
|
|
22
|
+
return /* @__PURE__ */ a(n, {
|
|
22
23
|
label: "Position",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
24
|
+
children: [/* @__PURE__ */ i(t, {
|
|
24
25
|
label: "X",
|
|
25
26
|
type: "metric",
|
|
26
|
-
value:
|
|
27
|
-
allowedWords:
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
value: s.positionX,
|
|
28
|
+
allowedWords: o,
|
|
29
|
+
min: -Infinity,
|
|
30
|
+
onChange: l
|
|
31
|
+
}), /* @__PURE__ */ i(t, {
|
|
30
32
|
label: "Y",
|
|
31
33
|
type: "metric",
|
|
32
|
-
value:
|
|
33
|
-
allowedWords:
|
|
34
|
-
|
|
34
|
+
value: s.positionY,
|
|
35
|
+
allowedWords: o,
|
|
36
|
+
min: -Infinity,
|
|
37
|
+
onChange: u
|
|
35
38
|
})]
|
|
36
39
|
});
|
|
37
40
|
};
|
|
38
41
|
//#endregion
|
|
39
|
-
export {
|
|
42
|
+
export { s as default };
|
|
@@ -1,86 +1,95 @@
|
|
|
1
|
-
import e from "../../../../
|
|
2
|
-
import t from "../../../../components/
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
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 { sizeParts as r, sizePreset as i } from "./helpers.mjs";
|
|
5
|
+
import { useCallback as a, useMemo as o } from "react";
|
|
6
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
7
|
//#region src/components/StyleInspector/categories/Background/components/BackgroundSize/BackgroundSize.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
else {
|
|
14
|
-
let e = s.size;
|
|
15
|
-
c?.({
|
|
16
|
-
...s,
|
|
17
|
-
size: e === "cover" || e === "contain" ? "auto auto" : e
|
|
8
|
+
var u = ({ layer: u, onChange: d }) => {
|
|
9
|
+
let f = i(u.size), [p, m] = r(u.size), h = a((t) => {
|
|
10
|
+
let n = e(t);
|
|
11
|
+
if (n !== "custom") {
|
|
12
|
+
d?.({
|
|
13
|
+
...u,
|
|
14
|
+
size: n
|
|
18
15
|
});
|
|
16
|
+
return;
|
|
19
17
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
d?.({
|
|
19
|
+
...u,
|
|
20
|
+
size: f === "custom" ? u.size : "auto"
|
|
21
|
+
});
|
|
22
|
+
}, [
|
|
23
|
+
u,
|
|
24
|
+
d,
|
|
25
|
+
f
|
|
26
|
+
]), g = a((t) => d?.({
|
|
27
|
+
...u,
|
|
28
|
+
size: `${e(t)} ${m}`
|
|
23
29
|
}), [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
]),
|
|
28
|
-
...
|
|
29
|
-
size: `${
|
|
30
|
+
m,
|
|
31
|
+
u,
|
|
32
|
+
d
|
|
33
|
+
]), _ = a((t) => d?.({
|
|
34
|
+
...u,
|
|
35
|
+
size: `${p} ${e(t)}`
|
|
30
36
|
}), [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
]),
|
|
37
|
+
u,
|
|
38
|
+
d,
|
|
39
|
+
p
|
|
40
|
+
]), v = o(() => [
|
|
35
41
|
{
|
|
36
|
-
value: "
|
|
37
|
-
icon: /* @__PURE__ */
|
|
38
|
-
className: "px-1 text-xs select-none",
|
|
42
|
+
value: "custom",
|
|
43
|
+
icon: /* @__PURE__ */ c("span", {
|
|
44
|
+
className: "px-1.5 text-xs select-none",
|
|
39
45
|
children: "Custom"
|
|
40
46
|
}),
|
|
41
|
-
description: "
|
|
42
|
-
active: f === "
|
|
47
|
+
description: "A width and a height of its own",
|
|
48
|
+
active: f === "custom",
|
|
43
49
|
size: "custom"
|
|
44
50
|
},
|
|
45
51
|
{
|
|
46
52
|
value: "cover",
|
|
47
|
-
icon: /* @__PURE__ */
|
|
48
|
-
className: "px-1 text-xs select-none",
|
|
53
|
+
icon: /* @__PURE__ */ c("span", {
|
|
54
|
+
className: "px-1.5 text-xs select-none",
|
|
49
55
|
children: "Cover"
|
|
50
56
|
}),
|
|
51
|
-
description: "
|
|
57
|
+
description: "Fill the element, cropping what overflows",
|
|
52
58
|
active: f === "cover",
|
|
53
59
|
size: "custom"
|
|
54
60
|
},
|
|
55
61
|
{
|
|
56
62
|
value: "contain",
|
|
57
|
-
icon: /* @__PURE__ */
|
|
58
|
-
className: "px-1 text-xs select-none",
|
|
63
|
+
icon: /* @__PURE__ */ c("span", {
|
|
64
|
+
className: "px-1.5 text-xs select-none",
|
|
59
65
|
children: "Contain"
|
|
60
66
|
}),
|
|
61
|
-
description: "Fit inside the element",
|
|
67
|
+
description: "Fit inside the element, whole",
|
|
62
68
|
active: f === "contain",
|
|
63
69
|
size: "custom"
|
|
64
70
|
}
|
|
65
71
|
], [f]);
|
|
66
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(n, {
|
|
67
73
|
label: "Size",
|
|
68
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ c(t, {
|
|
69
75
|
type: "iconGroup",
|
|
70
|
-
items:
|
|
71
|
-
onChange:
|
|
76
|
+
items: v,
|
|
77
|
+
onChange: h
|
|
72
78
|
})
|
|
73
|
-
}),
|
|
74
|
-
label: "
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
}), f === "custom" && /* @__PURE__ */ l(n, {
|
|
80
|
+
label: "",
|
|
81
|
+
children: [/* @__PURE__ */ c(t, {
|
|
82
|
+
label: "Width",
|
|
83
|
+
type: "metric",
|
|
84
|
+
value: p,
|
|
85
|
+
onChange: g
|
|
86
|
+
}), /* @__PURE__ */ c(t, {
|
|
87
|
+
label: "Height",
|
|
88
|
+
type: "metric",
|
|
89
|
+
value: m,
|
|
90
|
+
onChange: _
|
|
91
|
+
})]
|
|
92
|
+
})] });
|
|
84
93
|
};
|
|
85
94
|
//#endregion
|
|
86
|
-
export {
|
|
95
|
+
export { u as default };
|
package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Which of the three ways a size is written: one of the two keywords, or a width and a height. */
|
|
2
|
+
export declare const sizePreset: (size: string) => "cover" | "contain" | "custom";
|
|
3
|
+
/** A size as its width and its height. One value is the width, the height then follows the image (`auto`). */
|
|
4
|
+
export declare const sizeParts: (size: string) => [string, string];
|
package/dist/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/categories/Background/components/BackgroundSize/helpers.ts
|
|
2
|
+
var e = (e) => e === "cover" || e === "contain" ? e : "custom", t = (t) => {
|
|
3
|
+
if (e(t) !== "custom") return ["auto", "auto"];
|
|
4
|
+
let [n = "auto", r = "auto"] = t.split(" ").filter(Boolean);
|
|
5
|
+
return [n, r];
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as sizeParts, e as sizePreset };
|