@plitzi/sdk-style 0.38.9 → 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 +189 -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,130 +1,63 @@
|
|
|
1
|
-
import e from "../../../
|
|
2
|
-
import t from "../../../components/
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import s from "
|
|
6
|
-
import
|
|
1
|
+
import { asText as e } from "../../../cssValues.mjs";
|
|
2
|
+
import t from "../../../components/CategoryOption/index.mjs";
|
|
3
|
+
import n from "../../../components/ValueListItem/index.mjs";
|
|
4
|
+
import { FILTER_GROUPS as r, FILTER_SPECS as i, parseFilter as a, serializeFilter as o } from "./helpers.mjs";
|
|
5
|
+
import { useCallback as s, useRef as c } from "react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/StyleInspector/categories/Effects/Filters/FilterItem.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
children:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
8
|
+
var f = Object.entries(i), p = ({ value: p, title: m, onRemove: h, onChange: g }) => {
|
|
9
|
+
let _ = a(p), v = c(_);
|
|
10
|
+
v.current = _;
|
|
11
|
+
let y = _ ? i[_.name] : void 0, b = s((t) => {
|
|
12
|
+
let n = e(t);
|
|
13
|
+
Object.hasOwn(i, n) && g(o({
|
|
14
|
+
name: n,
|
|
15
|
+
amount: i[n].default
|
|
16
|
+
}));
|
|
17
|
+
}, [g]), x = s((t) => {
|
|
18
|
+
v.current && g(o({
|
|
19
|
+
...v.current,
|
|
20
|
+
amount: e(t)
|
|
21
|
+
}));
|
|
22
|
+
}, [g]), S = s((t) => g(e(t)), [g]);
|
|
23
|
+
return /* @__PURE__ */ d(n, {
|
|
24
|
+
summary: p,
|
|
25
|
+
title: m,
|
|
26
|
+
removeLabel: `Remove ${m.toLowerCase()}`,
|
|
27
|
+
onRemove: h,
|
|
28
|
+
children: [!_ && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(t, {
|
|
29
|
+
label: "Value",
|
|
30
|
+
type: "input",
|
|
31
|
+
value: p,
|
|
32
|
+
onChange: S
|
|
33
|
+
}), /* @__PURE__ */ u("p", {
|
|
34
|
+
className: "m-0 text-[11px] text-zinc-500 dark:text-zinc-400",
|
|
35
|
+
children: "A function the editor has no control for, so it is edited as written."
|
|
36
|
+
})] }), _ && y && /* @__PURE__ */ d("div", {
|
|
37
|
+
className: "grid grid-cols-2 gap-2",
|
|
38
|
+
children: [/* @__PURE__ */ u(t, {
|
|
39
|
+
label: "Function",
|
|
40
|
+
type: "select",
|
|
41
|
+
value: _.name,
|
|
42
|
+
onChange: b,
|
|
43
|
+
children: r.map((e) => /* @__PURE__ */ u("optgroup", {
|
|
44
|
+
label: e,
|
|
45
|
+
children: f.filter(([, t]) => t.group === e).map(([e, t]) => /* @__PURE__ */ u("option", {
|
|
46
|
+
value: e,
|
|
47
|
+
children: t.label
|
|
48
|
+
}, e))
|
|
49
|
+
}, e))
|
|
50
|
+
}), /* @__PURE__ */ u(t, {
|
|
51
|
+
label: "Amount",
|
|
52
|
+
type: "metric",
|
|
53
|
+
value: _.amount,
|
|
54
|
+
units: y.units,
|
|
55
|
+
step: y.step,
|
|
56
|
+
min: _.name === "hue-rotate" ? -Infinity : 0,
|
|
57
|
+
onChange: x
|
|
56
58
|
})]
|
|
57
|
-
}), /* @__PURE__ */ a(s.Content, {
|
|
58
|
-
className: "w-[260px]",
|
|
59
|
-
children: /* @__PURE__ */ a("div", {
|
|
60
|
-
className: "flex w-full flex-col gap-2 p-2",
|
|
61
|
-
children: /* @__PURE__ */ o(t, {
|
|
62
|
-
label: "Type",
|
|
63
|
-
children: [/* @__PURE__ */ o(e, {
|
|
64
|
-
label: "Property",
|
|
65
|
-
onChange: g("propType"),
|
|
66
|
-
type: "select",
|
|
67
|
-
value: p,
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ a("optgroup", {
|
|
70
|
-
label: "General",
|
|
71
|
-
children: /* @__PURE__ */ a("option", {
|
|
72
|
-
value: "blur",
|
|
73
|
-
children: "Blur"
|
|
74
|
-
})
|
|
75
|
-
}),
|
|
76
|
-
/* @__PURE__ */ o("optgroup", {
|
|
77
|
-
label: "Color Adjustments",
|
|
78
|
-
children: [
|
|
79
|
-
/* @__PURE__ */ a("option", {
|
|
80
|
-
value: "brightness",
|
|
81
|
-
children: "Brightness"
|
|
82
|
-
}),
|
|
83
|
-
/* @__PURE__ */ a("option", {
|
|
84
|
-
value: "contrast",
|
|
85
|
-
children: "Contrast"
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ a("option", {
|
|
88
|
-
value: "hue-rotate",
|
|
89
|
-
children: "Hue Rotate"
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ a("option", {
|
|
92
|
-
value: "saturate",
|
|
93
|
-
children: "Saturation"
|
|
94
|
-
})
|
|
95
|
-
]
|
|
96
|
-
}),
|
|
97
|
-
/* @__PURE__ */ o("optgroup", {
|
|
98
|
-
label: "Color Effects",
|
|
99
|
-
children: [
|
|
100
|
-
/* @__PURE__ */ a("option", {
|
|
101
|
-
value: "grayscale",
|
|
102
|
-
children: "Grayscale"
|
|
103
|
-
}),
|
|
104
|
-
/* @__PURE__ */ a("option", {
|
|
105
|
-
value: "invert",
|
|
106
|
-
children: "Invert"
|
|
107
|
-
}),
|
|
108
|
-
/* @__PURE__ */ a("option", {
|
|
109
|
-
value: "sepia",
|
|
110
|
-
children: "Sepia"
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
})
|
|
114
|
-
]
|
|
115
|
-
}), /* @__PURE__ */ a(e, {
|
|
116
|
-
label: "Amount",
|
|
117
|
-
value: m,
|
|
118
|
-
onChange: g("amount"),
|
|
119
|
-
type: "metric",
|
|
120
|
-
units: _.units,
|
|
121
|
-
step: _.step,
|
|
122
|
-
max: _.max
|
|
123
|
-
})]
|
|
124
|
-
})
|
|
125
|
-
})
|
|
126
59
|
})]
|
|
127
60
|
});
|
|
128
61
|
};
|
|
129
62
|
//#endregion
|
|
130
|
-
export {
|
|
63
|
+
export { p as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** One function of a `filter` / `backdrop-filter` list: its name and its argument as written. */
|
|
2
|
+
export type FilterValue = {
|
|
3
|
+
name: string;
|
|
4
|
+
amount: string;
|
|
5
|
+
};
|
|
6
|
+
export type FilterSpec = {
|
|
7
|
+
label: string;
|
|
8
|
+
group: 'General' | 'Color adjustments' | 'Color effects';
|
|
9
|
+
default: string;
|
|
10
|
+
/** Besides none: a proportion is written `0.5` or `50%`, and past 1 the browser clamps it where CSS says to. */
|
|
11
|
+
units: {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}[];
|
|
15
|
+
step: number;
|
|
16
|
+
};
|
|
17
|
+
/** The functions the editor has a control for: how the picker names them, where a new one starts, what it takes. */
|
|
18
|
+
export declare const FILTER_SPECS: Record<string, FilterSpec>;
|
|
19
|
+
export declare const FILTER_GROUPS: readonly ["General", "Color adjustments", "Color effects"];
|
|
20
|
+
/**
|
|
21
|
+
* A filter function the editor has a control for. Any other — `drop-shadow(…)`, `url(#svg-filter)`, a token — answers
|
|
22
|
+
* `undefined` and is kept as text.
|
|
23
|
+
*/
|
|
24
|
+
export declare const parseFilter: (value: string) => FilterValue | undefined;
|
|
25
|
+
export declare const serializeFilter: ({ name, amount }: FilterValue) => string;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/categories/Effects/Filters/helpers.ts
|
|
2
|
+
var e = [{
|
|
3
|
+
label: "%",
|
|
4
|
+
value: "%"
|
|
5
|
+
}], t = {
|
|
6
|
+
blur: {
|
|
7
|
+
label: "Blur",
|
|
8
|
+
group: "General",
|
|
9
|
+
default: "5px",
|
|
10
|
+
units: [{
|
|
11
|
+
label: "PX",
|
|
12
|
+
value: "px"
|
|
13
|
+
}],
|
|
14
|
+
step: 1
|
|
15
|
+
},
|
|
16
|
+
opacity: {
|
|
17
|
+
label: "Opacity",
|
|
18
|
+
group: "General",
|
|
19
|
+
default: "0.5",
|
|
20
|
+
units: e,
|
|
21
|
+
step: .1
|
|
22
|
+
},
|
|
23
|
+
brightness: {
|
|
24
|
+
label: "Brightness",
|
|
25
|
+
group: "Color adjustments",
|
|
26
|
+
default: "1",
|
|
27
|
+
units: e,
|
|
28
|
+
step: .1
|
|
29
|
+
},
|
|
30
|
+
contrast: {
|
|
31
|
+
label: "Contrast",
|
|
32
|
+
group: "Color adjustments",
|
|
33
|
+
default: "1",
|
|
34
|
+
units: e,
|
|
35
|
+
step: .1
|
|
36
|
+
},
|
|
37
|
+
"hue-rotate": {
|
|
38
|
+
label: "Hue rotate",
|
|
39
|
+
group: "Color adjustments",
|
|
40
|
+
default: "0deg",
|
|
41
|
+
units: [{
|
|
42
|
+
label: "DEG",
|
|
43
|
+
value: "deg"
|
|
44
|
+
}],
|
|
45
|
+
step: 1
|
|
46
|
+
},
|
|
47
|
+
saturate: {
|
|
48
|
+
label: "Saturation",
|
|
49
|
+
group: "Color adjustments",
|
|
50
|
+
default: "1",
|
|
51
|
+
units: e,
|
|
52
|
+
step: .1
|
|
53
|
+
},
|
|
54
|
+
grayscale: {
|
|
55
|
+
label: "Grayscale",
|
|
56
|
+
group: "Color effects",
|
|
57
|
+
default: "0.5",
|
|
58
|
+
units: e,
|
|
59
|
+
step: .1
|
|
60
|
+
},
|
|
61
|
+
invert: {
|
|
62
|
+
label: "Invert",
|
|
63
|
+
group: "Color effects",
|
|
64
|
+
default: "0.5",
|
|
65
|
+
units: e,
|
|
66
|
+
step: .1
|
|
67
|
+
},
|
|
68
|
+
sepia: {
|
|
69
|
+
label: "Sepia",
|
|
70
|
+
group: "Color effects",
|
|
71
|
+
default: "0.5",
|
|
72
|
+
units: e,
|
|
73
|
+
step: .1
|
|
74
|
+
}
|
|
75
|
+
}, n = [
|
|
76
|
+
"General",
|
|
77
|
+
"Color adjustments",
|
|
78
|
+
"Color effects"
|
|
79
|
+
], r = /^([a-z-]+)\((.*)\)$/i, i = (e) => {
|
|
80
|
+
let n = r.exec(e.trim());
|
|
81
|
+
if (n && n[1].toLowerCase() in t) return {
|
|
82
|
+
name: n[1].toLowerCase(),
|
|
83
|
+
amount: n[2].trim()
|
|
84
|
+
};
|
|
85
|
+
}, a = ({ name: e, amount: t }) => `${e}(${t})`;
|
|
86
|
+
//#endregion
|
|
87
|
+
export { n as FILTER_GROUPS, t as FILTER_SPECS, i as parseFilter, a as serializeFilter };
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import e from "../../../components/
|
|
1
|
+
import e from "../../../components/ValueList/index.mjs";
|
|
2
2
|
import { DEFAULT_FUNCTION as t, createFunctionValue as n, parseTransforms as r, serializeTransforms as i } from "./transformFunctions.mjs";
|
|
3
3
|
import a from "./TransformItem.mjs";
|
|
4
4
|
import { useCallback as o } from "react";
|
|
5
|
-
import {
|
|
6
|
-
import u from "@plitzi/plitzi-ui/Icon";
|
|
5
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/StyleInspector/categories/Effects/Transform/Transform.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
children: "2D & 3D Transforms"
|
|
21
|
-
}), /* @__PURE__ */ c(u, {
|
|
22
|
-
className: "cursor-pointer",
|
|
23
|
-
icon: "fas fa-plus",
|
|
24
|
-
onClick: _
|
|
25
|
-
})]
|
|
26
|
-
}), p.length > 0 && /* @__PURE__ */ c("div", {
|
|
27
|
-
className: "flex flex-col gap-2",
|
|
28
|
-
children: p.map((e, t) => /* @__PURE__ */ c(a, {
|
|
7
|
+
var c = ["transform"], l = ({ value: l, onChange: u }) => {
|
|
8
|
+
let d = r(typeof l == "string" ? l : ""), f = o((e) => u?.(e.length > 0 ? i(e) : ""), [u]), p = (e) => () => f(d.filter((t, n) => n !== e)), m = (e) => (t) => {
|
|
9
|
+
f(d.map((n, r) => r === e ? t : n));
|
|
10
|
+
}, h = o(() => {
|
|
11
|
+
f([...d, n(t)]);
|
|
12
|
+
}, [f, d]);
|
|
13
|
+
return /* @__PURE__ */ s(e, {
|
|
14
|
+
label: "2D & 3D Transforms",
|
|
15
|
+
keys: c,
|
|
16
|
+
addLabel: "Add transform",
|
|
17
|
+
onAdd: h,
|
|
18
|
+
children: d.length > 0 && d.map((e, t) => /* @__PURE__ */ s(a, {
|
|
29
19
|
value: e,
|
|
30
|
-
onChange:
|
|
31
|
-
onRemove:
|
|
20
|
+
onChange: m(t),
|
|
21
|
+
onRemove: p(t)
|
|
32
22
|
}, t))
|
|
33
|
-
})
|
|
23
|
+
});
|
|
34
24
|
};
|
|
35
25
|
//#endregion
|
|
36
|
-
export {
|
|
26
|
+
export { l as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TransformFunctionValue } from './transformFunctions';
|
|
2
|
-
import { MouseEvent } from 'react';
|
|
3
2
|
export type TransformItemProps = {
|
|
4
3
|
value: TransformFunctionValue;
|
|
5
4
|
onChange?: (value: TransformFunctionValue) => void;
|
|
6
|
-
onRemove
|
|
5
|
+
onRemove: () => void;
|
|
7
6
|
};
|
|
8
7
|
declare const TransformItem: ({ value, onRemove, onChange }: TransformItemProps) => import('react').JSX.Element;
|
|
9
8
|
export default TransformItem;
|
|
@@ -1,89 +1,65 @@
|
|
|
1
1
|
import e from "../../../components/CategoryOption/index.mjs";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import u from "
|
|
6
|
-
import d from "@plitzi/plitzi-ui/Icon";
|
|
2
|
+
import t from "../../../components/ValueListItem/index.mjs";
|
|
3
|
+
import { TRANSFORM_FUNCTION_GROUPS as n, createFunctionValue as r, getFunctionSpec as i, serializeTransform as a, unitsForKind as o } from "./transformFunctions.mjs";
|
|
4
|
+
import { useCallback as s, useMemo as c } from "react";
|
|
5
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/StyleInspector/categories/Effects/Transform/TransformItem.tsx
|
|
8
|
-
var
|
|
9
|
-
let
|
|
10
|
-
return n ? n.specs.push(t) : e.push({
|
|
11
|
-
category: t.category,
|
|
12
|
-
specs: [t]
|
|
13
|
-
}), e;
|
|
14
|
-
}, []), p = ({ value: t, onRemove: p, onChange: m }) => {
|
|
15
|
-
let h = r(t.name), g = s(() => h ? h.args : t.args.map((e, t) => ({
|
|
7
|
+
var d = ({ value: d, onRemove: f, onChange: p }) => {
|
|
8
|
+
let m = i(d.name), h = c(() => m ? m.args : d.args.map((e, t) => ({
|
|
16
9
|
label: `#${t + 1}`,
|
|
17
10
|
kind: "length",
|
|
18
11
|
default: "0px"
|
|
19
|
-
})), [
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
name:
|
|
23
|
-
args:
|
|
12
|
+
})), [m, d.args]), g = c(() => h.map((e, t) => d.args[t] ?? e.default), [h, d.args]), _ = s((e) => p?.(r(e)), [p]), v = s((e) => (t) => {
|
|
13
|
+
let n = h.map((n, r) => r === e ? t : d.args[r] ?? n.default);
|
|
14
|
+
p?.({
|
|
15
|
+
name: d.name,
|
|
16
|
+
args: n
|
|
24
17
|
});
|
|
25
18
|
}, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
]),
|
|
31
|
-
name:
|
|
32
|
-
args:
|
|
19
|
+
h,
|
|
20
|
+
p,
|
|
21
|
+
d.args,
|
|
22
|
+
d.name
|
|
23
|
+
]), y = a({
|
|
24
|
+
name: d.name,
|
|
25
|
+
args: g
|
|
33
26
|
});
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
return /* @__PURE__ */ u(t, {
|
|
28
|
+
summary: y,
|
|
29
|
+
title: "Transform",
|
|
30
|
+
removeLabel: "Remove transform",
|
|
31
|
+
onRemove: f,
|
|
32
|
+
children: [/* @__PURE__ */ u(e, {
|
|
33
|
+
label: "Function",
|
|
34
|
+
value: d.name,
|
|
35
|
+
onChange: _,
|
|
36
|
+
type: "select",
|
|
37
|
+
children: [n.map((e) => /* @__PURE__ */ l("optgroup", {
|
|
38
|
+
label: e.category,
|
|
39
|
+
children: e.specs.map((e) => /* @__PURE__ */ l("option", {
|
|
40
|
+
value: e.name,
|
|
41
|
+
children: e.label
|
|
42
|
+
}, e.name))
|
|
43
|
+
}, e.category)), !m && /* @__PURE__ */ l("optgroup", {
|
|
44
|
+
label: "Other",
|
|
45
|
+
children: /* @__PURE__ */ l("option", {
|
|
46
|
+
value: d.name,
|
|
47
|
+
children: d.name
|
|
48
|
+
})
|
|
49
49
|
})]
|
|
50
|
-
}), /* @__PURE__ */
|
|
51
|
-
className: "
|
|
52
|
-
children: /* @__PURE__ */ l(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
value: e.name,
|
|
62
|
-
children: e.label
|
|
63
|
-
}, e.name))
|
|
64
|
-
}, e.category)), !h && /* @__PURE__ */ c("optgroup", {
|
|
65
|
-
label: "Other",
|
|
66
|
-
children: /* @__PURE__ */ c("option", {
|
|
67
|
-
value: t.name,
|
|
68
|
-
children: t.name
|
|
69
|
-
})
|
|
70
|
-
})]
|
|
71
|
-
}), /* @__PURE__ */ c("div", {
|
|
72
|
-
className: "flex flex-col gap-1.5",
|
|
73
|
-
children: g.map((t, n) => /* @__PURE__ */ c(e, {
|
|
74
|
-
label: t.label,
|
|
75
|
-
value: _[n],
|
|
76
|
-
onChange: y(n),
|
|
77
|
-
type: "metric",
|
|
78
|
-
direction: "row",
|
|
79
|
-
units: a(t.kind),
|
|
80
|
-
step: t.kind === "number" ? .1 : 1,
|
|
81
|
-
min: -Infinity
|
|
82
|
-
}, `${t.label}-${n}`))
|
|
83
|
-
})]
|
|
84
|
-
})
|
|
50
|
+
}), /* @__PURE__ */ l("div", {
|
|
51
|
+
className: "grid grid-cols-2 gap-2",
|
|
52
|
+
children: h.map((t, n) => /* @__PURE__ */ l(e, {
|
|
53
|
+
label: t.label,
|
|
54
|
+
value: g[n],
|
|
55
|
+
onChange: v(n),
|
|
56
|
+
type: "metric",
|
|
57
|
+
units: o(t.kind),
|
|
58
|
+
step: t.kind === "number" ? .1 : 1,
|
|
59
|
+
min: -Infinity
|
|
60
|
+
}, `${t.label}-${n}`))
|
|
85
61
|
})]
|
|
86
62
|
});
|
|
87
63
|
};
|
|
88
64
|
//#endregion
|
|
89
|
-
export {
|
|
65
|
+
export { d as default };
|
|
@@ -25,3 +25,8 @@ export declare const parseTransforms: (value: string) => TransformFunctionValue[
|
|
|
25
25
|
export declare const serializeTransform: ({ name, args }: TransformFunctionValue) => string;
|
|
26
26
|
export declare const serializeTransforms: (transforms: TransformFunctionValue[]) => string;
|
|
27
27
|
export declare const createFunctionValue: (name: string) => TransformFunctionValue;
|
|
28
|
+
/** The functions by category, in the order the picker lists them. */
|
|
29
|
+
export declare const TRANSFORM_FUNCTION_GROUPS: {
|
|
30
|
+
category: string;
|
|
31
|
+
specs: typeof TRANSFORM_FUNCTIONS;
|
|
32
|
+
}[];
|
|
@@ -186,6 +186,12 @@ var e = (e) => ({
|
|
|
186
186
|
name: e,
|
|
187
187
|
args: t ? t.args.map((e) => e.default) : ["0px"]
|
|
188
188
|
};
|
|
189
|
-
}
|
|
189
|
+
}, m = r.reduce((e, t) => {
|
|
190
|
+
let n = e.find((e) => e.category === t.category);
|
|
191
|
+
return n ? n.specs.push(t) : e.push({
|
|
192
|
+
category: t.category,
|
|
193
|
+
specs: [t]
|
|
194
|
+
}), e;
|
|
195
|
+
}, []);
|
|
190
196
|
//#endregion
|
|
191
|
-
export { i as DEFAULT_FUNCTION, r as TRANSFORM_FUNCTIONS, p as createFunctionValue, c as getFunctionSpec, u as parseTransforms, d as serializeTransform, f as serializeTransforms, o as unitsForKind };
|
|
197
|
+
export { i as DEFAULT_FUNCTION, r as TRANSFORM_FUNCTIONS, m as TRANSFORM_FUNCTION_GROUPS, p as createFunctionValue, c as getFunctionSpec, u as parseTransforms, d as serializeTransform, f as serializeTransforms, o as unitsForKind };
|
|
@@ -1,41 +1,25 @@
|
|
|
1
|
-
import e from "../../../
|
|
2
|
-
import t from "
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { splitByCommaOutsideParens as e } from "../../../cssValues.mjs";
|
|
2
|
+
import t from "../../../components/ValueList/index.mjs";
|
|
3
|
+
import { DEFAULT_TRANSITION as n, serializeTransition as r } from "./helpers.mjs";
|
|
4
|
+
import i from "./TransitionItem.mjs";
|
|
5
|
+
import { useCallback as a } from "react";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
6
7
|
//#region src/components/StyleInspector/categories/Effects/Transition/Transition.tsx
|
|
7
|
-
var s = ({ value:
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
c,
|
|
18
|
-
l.length,
|
|
19
|
-
s
|
|
20
|
-
]);
|
|
21
|
-
return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
|
|
22
|
-
className: "flex justify-between",
|
|
23
|
-
children: [/* @__PURE__ */ i(e, {
|
|
24
|
-
keyValue: ["transition"],
|
|
25
|
-
children: "Transitions"
|
|
26
|
-
}), /* @__PURE__ */ i(o, {
|
|
27
|
-
className: "cursor-pointer",
|
|
28
|
-
icon: "fas fa-plus",
|
|
29
|
-
onClick: f
|
|
30
|
-
})]
|
|
31
|
-
}), l.length > 0 && /* @__PURE__ */ i("div", {
|
|
32
|
-
className: "flex flex-col gap-2",
|
|
33
|
-
children: l.map((e, n) => /* @__PURE__ */ i(t, {
|
|
8
|
+
var s = ["transition"], c = ({ value: c, onChange: l }) => {
|
|
9
|
+
let u = typeof c == "string" && c !== "" ? e(c).map((e) => e.trim()) : [], d = a((e) => l?.(e.length > 0 ? e.join(", ") : ""), [l]), f = (e) => () => d(u.filter((t, n) => n !== e)), p = (e) => (t) => {
|
|
10
|
+
t !== u[e] && d(u.map((n, r) => r === e ? t : n));
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ o(t, {
|
|
13
|
+
label: "Transitions",
|
|
14
|
+
keys: s,
|
|
15
|
+
addLabel: "Add transition",
|
|
16
|
+
onAdd: () => d([...u, r(n)]),
|
|
17
|
+
children: u.length > 0 && u.map((e, t) => /* @__PURE__ */ o(i, {
|
|
34
18
|
value: e,
|
|
35
|
-
onChange:
|
|
36
|
-
onRemove:
|
|
37
|
-
},
|
|
38
|
-
})
|
|
19
|
+
onChange: p(t),
|
|
20
|
+
onRemove: f(t)
|
|
21
|
+
}, t))
|
|
22
|
+
});
|
|
39
23
|
};
|
|
40
24
|
//#endregion
|
|
41
|
-
export {
|
|
25
|
+
export { c as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type TransitionEasingProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (easing: string) => void;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* The easing of one transition: a picker of the named curves, and — opened from it — the curve itself, to drag into
|
|
7
|
+
* one of your own, with the presets drawn and a dot that runs along it.
|
|
8
|
+
*/
|
|
9
|
+
declare const TransitionEasing: ({ value, onChange }: TransitionEasingProps) => import('react').JSX.Element;
|
|
10
|
+
export default TransitionEasing;
|