@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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { InheritData } from '../../../../helpers';
|
|
2
|
+
import { StyleCategory } from '@plitzi/sdk-shared';
|
|
3
|
+
/** Where the value a row shows comes from — what the label's colour says, from strongest to weakest. */
|
|
4
|
+
export type LabelSource = 'binding' | 'variable' | 'value' | 'inherit' | 'none';
|
|
5
|
+
export type LabelFlags = {
|
|
6
|
+
hasValues: boolean;
|
|
7
|
+
hasInherit: boolean;
|
|
8
|
+
hasBinding: boolean;
|
|
9
|
+
hasVariables: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const labelSource: ({ hasValues, hasInherit, hasBinding, hasVariables }: LabelFlags) => LabelSource;
|
|
12
|
+
/**
|
|
13
|
+
* What hovering the label tells: where its value comes from, and — when a value is set here — that a click clears it (a
|
|
14
|
+
* binding alone is not, and the label does not promise it). An inherited value names the selector and the breakpoint
|
|
15
|
+
* it comes from, the same one the control shows.
|
|
16
|
+
*/
|
|
17
|
+
export declare const labelHint: (source: LabelSource, resettable: boolean, keys: StyleCategory[] | undefined, inheritData: InheritData["style"] | undefined) => string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/components/InspectorLabel/helpers.ts
|
|
2
|
+
var e = ({ hasValues: e, hasInherit: t, hasBinding: n, hasVariables: r }) => n ? "binding" : r ? "variable" : e ? "value" : t ? "inherit" : "none", t = {
|
|
3
|
+
binding: "Bound to data",
|
|
4
|
+
variable: "Set on this selector, from a token",
|
|
5
|
+
value: "Set on this selector"
|
|
6
|
+
}, n = (e, n, r, i) => {
|
|
7
|
+
if (e !== "none") {
|
|
8
|
+
if (e === "inherit") {
|
|
9
|
+
let e = r?.map((e) => i?.[e]?.[0]).find((e) => e !== void 0);
|
|
10
|
+
return e ? `Inherited from ${e.key} (${e.displayMode}): ${String(e.value)}` : "Inherited";
|
|
11
|
+
}
|
|
12
|
+
return n ? `${t[e]} — click to reset` : t[e];
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as labelHint, e as labelSource };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type InspectorSearchProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
};
|
|
5
|
+
/** Finds the category that holds a property — by its CSS name, or the category's title — and opens it. */
|
|
6
|
+
declare const InspectorSearch: ({ value, onChange }: InspectorSearchProps) => import('react').JSX.Element;
|
|
7
|
+
export default InspectorSearch;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback as e } from "react";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import n from "@plitzi/plitzi-ui/Input";
|
|
4
|
+
//#region src/components/StyleInspector/components/InspectorSearch/InspectorSearch.tsx
|
|
5
|
+
var r = ({ value: r, onChange: i }) => {
|
|
6
|
+
let a = e((e) => {
|
|
7
|
+
e.key === "Escape" && r && (e.stopPropagation(), i(""));
|
|
8
|
+
}, [i, r]);
|
|
9
|
+
return /* @__PURE__ */ t("div", {
|
|
10
|
+
className: "border-b border-gray-200 px-2 py-1.5 dark:border-zinc-800",
|
|
11
|
+
children: /* @__PURE__ */ t(n, {
|
|
12
|
+
size: "xs",
|
|
13
|
+
value: r,
|
|
14
|
+
placeholder: "Find a property — gap, radius, shadow…",
|
|
15
|
+
clearable: !0,
|
|
16
|
+
"aria-label": "Find a style property",
|
|
17
|
+
onChange: i,
|
|
18
|
+
onKeyDown: a,
|
|
19
|
+
children: /* @__PURE__ */ t(n.Icon, { icon: "fa-solid fa-magnifying-glass" })
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { r as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ShadowItemProps = {
|
|
2
|
+
value: string;
|
|
3
|
+
/** A box shadow's: `inset` and `spread`. A text shadow has neither. */
|
|
4
|
+
withSpread: boolean;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: import('react').MemoExoticComponent<({ value, withSpread, onChange, onRemove }: ShadowItemProps) => import('react').JSX.Element>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { asText as e } from "../../cssValues.mjs";
|
|
2
|
+
import t from "../CategoryOption/index.mjs";
|
|
3
|
+
import n from "../ColorSwatch/index.mjs";
|
|
4
|
+
import { parseShadow as r, serializeShadow as i } from "../../shadowValue.mjs";
|
|
5
|
+
import a from "../ValueListItem/index.mjs";
|
|
6
|
+
import { memo as o, useCallback as s, useMemo as c, useRef as l } from "react";
|
|
7
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
var p = o(({ value: o, withSpread: p, onChange: m, onRemove: h }) => {
|
|
9
|
+
let g = r(o), _ = l(g);
|
|
10
|
+
_.current = g;
|
|
11
|
+
let v = s((t) => (n) => {
|
|
12
|
+
let r = _.current;
|
|
13
|
+
r && m(i({
|
|
14
|
+
...r,
|
|
15
|
+
[t]: e(n)
|
|
16
|
+
}, { withSpread: p }));
|
|
17
|
+
}, [m, p]), y = s((e) => {
|
|
18
|
+
let t = _.current;
|
|
19
|
+
t && m(i({
|
|
20
|
+
...t,
|
|
21
|
+
inset: e === "inset"
|
|
22
|
+
}, { withSpread: p }));
|
|
23
|
+
}, [m, p]), b = s((t) => m(e(t)), [m]), x = c(() => [{
|
|
24
|
+
value: "outset",
|
|
25
|
+
icon: /* @__PURE__ */ d("span", {
|
|
26
|
+
className: "px-1.5 text-xs select-none",
|
|
27
|
+
children: "Outside"
|
|
28
|
+
}),
|
|
29
|
+
description: "Cast outside the box",
|
|
30
|
+
active: !g?.inset,
|
|
31
|
+
size: "custom"
|
|
32
|
+
}, {
|
|
33
|
+
value: "inset",
|
|
34
|
+
icon: /* @__PURE__ */ d("span", {
|
|
35
|
+
className: "px-1.5 text-xs select-none",
|
|
36
|
+
children: "Inside"
|
|
37
|
+
}),
|
|
38
|
+
description: "Cast inside the box",
|
|
39
|
+
active: !!g?.inset,
|
|
40
|
+
size: "custom"
|
|
41
|
+
}], [g?.inset]), S = p ? "Box shadow" : "Text shadow";
|
|
42
|
+
return /* @__PURE__ */ f(a, {
|
|
43
|
+
summary: o,
|
|
44
|
+
preview: g && /* @__PURE__ */ d(n, {
|
|
45
|
+
className: "h-4 w-4",
|
|
46
|
+
value: g.color
|
|
47
|
+
}),
|
|
48
|
+
title: S,
|
|
49
|
+
removeLabel: `Remove ${S.toLowerCase()}`,
|
|
50
|
+
onRemove: h,
|
|
51
|
+
children: [
|
|
52
|
+
!g && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(t, {
|
|
53
|
+
label: "Value",
|
|
54
|
+
type: "input",
|
|
55
|
+
value: o,
|
|
56
|
+
onChange: b
|
|
57
|
+
}), /* @__PURE__ */ d("p", {
|
|
58
|
+
className: "m-0 text-[11px] text-zinc-500 dark:text-zinc-400",
|
|
59
|
+
children: "Not a single shadow the editor can split into parts (a token, for one), so it is edited as written."
|
|
60
|
+
})] }),
|
|
61
|
+
g && p && /* @__PURE__ */ d(t, {
|
|
62
|
+
label: "Type",
|
|
63
|
+
type: "iconGroup",
|
|
64
|
+
items: x,
|
|
65
|
+
onChange: y
|
|
66
|
+
}),
|
|
67
|
+
g && /* @__PURE__ */ f("div", {
|
|
68
|
+
className: "grid grid-cols-2 gap-2",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ d(t, {
|
|
71
|
+
label: "X offset",
|
|
72
|
+
type: "metric",
|
|
73
|
+
value: g.x,
|
|
74
|
+
min: -Infinity,
|
|
75
|
+
onChange: v("x")
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ d(t, {
|
|
78
|
+
label: "Y offset",
|
|
79
|
+
type: "metric",
|
|
80
|
+
value: g.y,
|
|
81
|
+
min: -Infinity,
|
|
82
|
+
onChange: v("y")
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ d(t, {
|
|
85
|
+
label: "Blur",
|
|
86
|
+
type: "metric",
|
|
87
|
+
value: g.blur,
|
|
88
|
+
min: 0,
|
|
89
|
+
onChange: v("blur")
|
|
90
|
+
}),
|
|
91
|
+
p && /* @__PURE__ */ d(t, {
|
|
92
|
+
label: "Spread",
|
|
93
|
+
type: "metric",
|
|
94
|
+
value: g.spread,
|
|
95
|
+
min: -Infinity,
|
|
96
|
+
onChange: v("spread")
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
}),
|
|
100
|
+
g && /* @__PURE__ */ d(t, {
|
|
101
|
+
label: "Color",
|
|
102
|
+
type: "color",
|
|
103
|
+
value: g.color,
|
|
104
|
+
onChange: v("color")
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
//#endregion
|
|
110
|
+
export { p as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type TargetSummaryProps = {
|
|
2
|
+
selectorName?: string;
|
|
3
|
+
parts: string[];
|
|
4
|
+
onReset: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('react').MemoExoticComponent<({ selectorName, parts, onReset }: TargetSummaryProps) => import('react').JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { memo as e } from "react";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/Icon";
|
|
4
|
+
var i = e(({ selectorName: e, parts: i, onReset: a }) => /* @__PURE__ */ n("div", {
|
|
5
|
+
className: "bg-primary-500/10 dark:bg-primary-400/10 flex items-center gap-2 rounded-md px-2 py-1 text-xs",
|
|
6
|
+
children: [
|
|
7
|
+
/* @__PURE__ */ t("span", {
|
|
8
|
+
className: "shrink-0 text-zinc-500 dark:text-zinc-400",
|
|
9
|
+
children: "Editing"
|
|
10
|
+
}),
|
|
11
|
+
/* @__PURE__ */ t("span", {
|
|
12
|
+
className: "text-primary-700 dark:text-primary-300 min-w-0 grow truncate font-medium",
|
|
13
|
+
children: [e, ...i].filter(Boolean).join(" › ")
|
|
14
|
+
}),
|
|
15
|
+
/* @__PURE__ */ t(r, {
|
|
16
|
+
className: "shrink-0 cursor-pointer text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100",
|
|
17
|
+
icon: "fa-solid fa-xmark",
|
|
18
|
+
title: "Back to the selector's own rules",
|
|
19
|
+
onClick: a
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
}));
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StyleCategory } from '@plitzi/sdk-shared';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export type ValueListProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
keys: StyleCategory[];
|
|
6
|
+
/** What the add button says it adds — "Add box shadow" — its tooltip and its name for a screen reader. */
|
|
7
|
+
addLabel: string;
|
|
8
|
+
onAdd: () => void;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('react').MemoExoticComponent<({ label, keys, addLabel, onAdd, children }: ValueListProps) => import('react').JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "../InspectorLabel/index.mjs";
|
|
2
|
+
import { memo as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
var i = t(({ label: t, keys: i, addLabel: a, onAdd: o, children: s }) => /* @__PURE__ */ r("div", {
|
|
5
|
+
className: "flex flex-col gap-1.5",
|
|
6
|
+
children: [/* @__PURE__ */ r("div", {
|
|
7
|
+
className: "flex items-center justify-between gap-2",
|
|
8
|
+
children: [/* @__PURE__ */ n(e, {
|
|
9
|
+
keyValue: i,
|
|
10
|
+
children: t
|
|
11
|
+
}), /* @__PURE__ */ n("button", {
|
|
12
|
+
type: "button",
|
|
13
|
+
className: "focus-visible:outline-primary-500 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-zinc-500 transition-colors duration-150 hover:bg-gray-100 hover:text-zinc-900 focus-visible:outline-2 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-100",
|
|
14
|
+
title: a,
|
|
15
|
+
"aria-label": a,
|
|
16
|
+
onClick: o,
|
|
17
|
+
children: /* @__PURE__ */ n("i", { className: "fa-solid fa-plus text-xs" })
|
|
18
|
+
})]
|
|
19
|
+
}), s && /* @__PURE__ */ n("div", {
|
|
20
|
+
className: "flex flex-col gap-1",
|
|
21
|
+
children: s
|
|
22
|
+
})]
|
|
23
|
+
}));
|
|
24
|
+
//#endregion
|
|
25
|
+
export { i as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ValueListItemProps = {
|
|
3
|
+
/** The item as CSS writes it, drawn in the row. */
|
|
4
|
+
summary: string;
|
|
5
|
+
/** What sits before the summary — a swatch of the shadow's color, the layer's preview. */
|
|
6
|
+
preview?: ReactNode;
|
|
7
|
+
/** The popover's title: what kind of item it edits. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** What removing says it removes — "Remove shadow". */
|
|
10
|
+
removeLabel: string;
|
|
11
|
+
onRemove: () => void;
|
|
12
|
+
/** The popover's controls. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import('react').MemoExoticComponent<({ summary, preview, title, removeLabel, onRemove, children }: ValueListItemProps) => import('react').JSX.Element>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { memo as e, useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
2
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
3
|
+
import s from "@plitzi/plitzi-ui/ContainerFloating";
|
|
4
|
+
import c from "clsx";
|
|
5
|
+
var l = e(({ summary: e, preview: l, title: u, removeLabel: d, onRemove: f, children: p }) => {
|
|
6
|
+
let [m, h] = i(!1), g = r(null);
|
|
7
|
+
n(() => {
|
|
8
|
+
if (!m) return;
|
|
9
|
+
let e = requestAnimationFrame(() => g.current?.focus({ preventScroll: !0 }));
|
|
10
|
+
return () => cancelAnimationFrame(e);
|
|
11
|
+
}, [m]);
|
|
12
|
+
let _ = t(() => h((e) => !e), []), v = t(() => h(!1), []), y = t((e) => {
|
|
13
|
+
e.stopPropagation(), e.preventDefault(), f();
|
|
14
|
+
}, [f]);
|
|
15
|
+
return /* @__PURE__ */ o(s, {
|
|
16
|
+
className: "w-full min-w-0",
|
|
17
|
+
closeOnClick: !1,
|
|
18
|
+
containerTopOffset: 4,
|
|
19
|
+
open: m,
|
|
20
|
+
onOpenChange: h,
|
|
21
|
+
children: [/* @__PURE__ */ o(s.Trigger, {
|
|
22
|
+
className: c("group flex h-7 w-full min-w-0 cursor-pointer items-center gap-2 rounded-md border px-2 text-xs transition-colors duration-150 select-none", {
|
|
23
|
+
"border-primary-500/60 bg-primary-500/5 dark:border-primary-400/60 dark:bg-primary-400/10": m,
|
|
24
|
+
"border-gray-200 bg-white hover:border-gray-300 hover:bg-gray-50 dark:border-zinc-700 dark:bg-zinc-800/50 dark:hover:border-zinc-600 dark:hover:bg-zinc-800": !m
|
|
25
|
+
}),
|
|
26
|
+
onClick: _,
|
|
27
|
+
children: [
|
|
28
|
+
l,
|
|
29
|
+
/* @__PURE__ */ a("span", {
|
|
30
|
+
className: "min-w-0 grow truncate font-mono text-[11px] text-zinc-700 dark:text-zinc-200",
|
|
31
|
+
title: e,
|
|
32
|
+
children: e
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ a("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: "flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-zinc-400 transition-colors duration-150 group-hover:text-zinc-500 hover:bg-red-500/10 hover:text-red-600 dark:text-zinc-500 dark:group-hover:text-zinc-400 dark:hover:text-red-400",
|
|
37
|
+
title: d,
|
|
38
|
+
"aria-label": d,
|
|
39
|
+
onClick: y,
|
|
40
|
+
children: /* @__PURE__ */ a("i", { className: "fa-solid fa-xmark text-xs" })
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}), /* @__PURE__ */ a(s.Content, {
|
|
44
|
+
className: "w-64",
|
|
45
|
+
children: /* @__PURE__ */ o("div", {
|
|
46
|
+
ref: g,
|
|
47
|
+
className: "flex w-full flex-col outline-none",
|
|
48
|
+
tabIndex: -1,
|
|
49
|
+
children: [/* @__PURE__ */ o("div", {
|
|
50
|
+
className: "flex items-center justify-between gap-2 border-b border-gray-200 px-3 py-2 dark:border-zinc-700",
|
|
51
|
+
children: [/* @__PURE__ */ a("span", {
|
|
52
|
+
className: "text-xs font-semibold text-zinc-800 dark:text-zinc-100",
|
|
53
|
+
children: u
|
|
54
|
+
}), /* @__PURE__ */ a("button", {
|
|
55
|
+
type: "button",
|
|
56
|
+
className: "flex h-5 w-5 cursor-pointer items-center justify-center rounded text-zinc-400 hover:bg-gray-100 hover:text-zinc-900 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-100",
|
|
57
|
+
title: "Close",
|
|
58
|
+
"aria-label": "Close",
|
|
59
|
+
onClick: v,
|
|
60
|
+
children: /* @__PURE__ */ a("i", { className: "fa-solid fa-xmark text-xs" })
|
|
61
|
+
})]
|
|
62
|
+
}), /* @__PURE__ */ a("div", {
|
|
63
|
+
className: "flex flex-col gap-3 p-3",
|
|
64
|
+
children: p
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
export { l as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { StyleCategory, StyleValue } from '@plitzi/sdk-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Reading CSS values that hold lists — shadows, filters, transitions, background layers — where a comma or a space
|
|
4
|
+
* inside a function (`rgba(0, 0, 0, .5)`, `cubic-bezier(.4, 0, .2, 1)`) is not a separator.
|
|
5
|
+
*/
|
|
6
|
+
export declare const splitByCommaOutsideParens: (value: string) => string[];
|
|
7
|
+
export declare const splitBySpaceOutsideParens: (value: string) => string[];
|
|
8
|
+
/**
|
|
9
|
+
* A value with its tokens (`var(--accent)`, `{{ accent }}`) replaced by what the space's variables say they are — for
|
|
10
|
+
* what the editor itself draws (a swatch, a preview), whose document has none of the space's custom properties. A
|
|
11
|
+
* token the space does not declare stays as it was.
|
|
12
|
+
*/
|
|
13
|
+
export declare const resolveTokens: (value: string, variables: Record<string, unknown>) => string;
|
|
14
|
+
/** What a control answered as the text a stylesheet holds: a word or a number, and nothing for anything else. */
|
|
15
|
+
export declare const asText: (value: StyleValue | Record<StyleCategory, StyleValue> | boolean | undefined) => string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { get as e } from "@plitzi/plitzi-ui/helpers";
|
|
2
|
+
import { VARIABLE_REGEX as t } from "@plitzi/sdk-shared/schema/schemaConstants";
|
|
3
|
+
//#region src/components/StyleInspector/cssValues.ts
|
|
4
|
+
var n = (e) => {
|
|
5
|
+
let t = [], n = "", r = 0;
|
|
6
|
+
for (let i = 0; i < e.length; i++) {
|
|
7
|
+
let a = e[i];
|
|
8
|
+
a === "(" ? (r++, n += a) : a === ")" ? (r--, n += a) : a === "," && r === 0 ? (t.push(n), n = "") : n += a;
|
|
9
|
+
}
|
|
10
|
+
return n && t.push(n), t;
|
|
11
|
+
}, r = (e) => {
|
|
12
|
+
let t = [], n = "", r = 0;
|
|
13
|
+
for (let i = 0; i < e.length; i++) {
|
|
14
|
+
let a = e[i];
|
|
15
|
+
a === "(" ? (r++, n += a) : a === ")" ? (r--, n += a) : a === " " && r === 0 ? (n && t.push(n), n = "") : n += a;
|
|
16
|
+
}
|
|
17
|
+
return n && t.push(n), t;
|
|
18
|
+
}, i = (n, r) => {
|
|
19
|
+
let i = n;
|
|
20
|
+
for (let a of n.matchAll(new RegExp(t, "g"))) {
|
|
21
|
+
let t = a[1] || a[2], n = e(r, t, void 0);
|
|
22
|
+
(typeof n == "string" || typeof n == "number") && (i = i.replace(a[0], String(n)));
|
|
23
|
+
}
|
|
24
|
+
return i;
|
|
25
|
+
}, a = (e) => typeof e == "string" || typeof e == "number" ? String(e) : "";
|
|
26
|
+
//#endregion
|
|
27
|
+
export { a as asText, i as resolveTokens, n as splitByCommaOutsideParens, r as splitBySpaceOutsideParens };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Option } from '@plitzi/plitzi-ui/Select2';
|
|
2
|
-
import { DisplayMode, Element, Schema, Style, StyleAncestors, StyleBlock, StyleItem, StyleState } from '@plitzi/sdk-shared';
|
|
2
|
+
import { DisplayMode, Element, Schema, Style, StyleAncestors, StyleBlock, StyleItem, StylePseudo, StyleState } from '@plitzi/sdk-shared';
|
|
3
3
|
/** The states a selector can react to, as the state picker offers them — from the one list every layer reads. */
|
|
4
4
|
export declare const STYLE_STATE_OPTIONS: Option[];
|
|
5
5
|
/** How an ancestor key reads in the inspector: its class, or the parent it stands for. */
|
|
@@ -44,3 +44,19 @@ export type AncestorRemoval = {
|
|
|
44
44
|
};
|
|
45
45
|
/** Where a selector has rules under any of `ancestors`, at every breakpoint and slot: what purging them takes. */
|
|
46
46
|
export declare const ancestorRemovals: (platform: Style["platform"], name: string, ancestors: Set<string>) => AncestorRemoval[];
|
|
47
|
+
export type InspectorTarget = {
|
|
48
|
+
styleSelector: string;
|
|
49
|
+
styleVariant?: string;
|
|
50
|
+
styleState?: StyleState;
|
|
51
|
+
styleAncestor?: string;
|
|
52
|
+
stylePseudo?: StylePseudo;
|
|
53
|
+
styleCondition?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* What the inspector writes to besides the selector's own plain rules, step by step as the summary above the
|
|
57
|
+
* categories reads it — empty while it writes those. An ancestor comes first: with one picked, the variant and the state
|
|
58
|
+
* are the ancestor's.
|
|
59
|
+
*/
|
|
60
|
+
export declare const targetParts: ({ styleSelector, styleVariant, styleState, styleAncestor, stylePseudo, styleCondition }: InspectorTarget) => string[];
|
|
61
|
+
/** What the toggle for the rarer targets says it does — or, while one of them is in use, why it cannot fold them. */
|
|
62
|
+
export declare const moreTargetsHint: (inUse: boolean, shown: boolean) => string;
|
|
@@ -61,6 +61,13 @@ var u = a.map((e) => ({
|
|
|
61
61
|
displayMode: r,
|
|
62
62
|
styleSelector: e,
|
|
63
63
|
styleAncestor: t
|
|
64
|
-
}))))
|
|
64
|
+
})))), S = ({ styleSelector: e, styleVariant: n, styleState: i, styleAncestor: a, stylePseudo: s, styleCondition: c }) => [
|
|
65
|
+
e === "base" ? void 0 : `${e} part`,
|
|
66
|
+
a ? `inside ${d(a)}` : void 0,
|
|
67
|
+
n ? `variant ${n}` : void 0,
|
|
68
|
+
i ? o[i] : void 0,
|
|
69
|
+
s ? r[s] : void 0,
|
|
70
|
+
c ? t(c) : void 0
|
|
71
|
+
].filter((e) => !!e), C = (e, t) => e ? "An ancestor, pseudo-element or condition is in use" : t ? "Hide ancestor, pseudo-element and condition" : "Target an ancestor, a pseudo-element or a condition";
|
|
65
72
|
//#endregion
|
|
66
|
-
export { u as STYLE_STATE_OPTIONS, m as ancestorClasses, _ as ancestorConditions, d as ancestorName, v as ancestorOptions, x as ancestorRemovals, p as conditionOptions, f as pseudoOptions, b as unusedAncestors };
|
|
73
|
+
export { u as STYLE_STATE_OPTIONS, m as ancestorClasses, _ as ancestorConditions, d as ancestorName, v as ancestorOptions, x as ancestorRemovals, p as conditionOptions, C as moreTargetsHint, f as pseudoOptions, S as targetParts, b as unusedAncestors };
|
|
@@ -1,55 +1,52 @@
|
|
|
1
|
-
import e from "../
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { resolveTokens as e } from "../cssValues.mjs";
|
|
2
|
+
import t from "../StyleInspectorContext.mjs";
|
|
3
|
+
import { use as n, useMemo as r } from "react";
|
|
4
|
+
import { get as i, pick as a } from "@plitzi/plitzi-ui/helpers";
|
|
5
|
+
import { baseDefaultValue as o } from "@plitzi/sdk-shared";
|
|
6
|
+
import { VARIABLE_REGEX as s } from "@plitzi/sdk-shared/schema/schemaConstants";
|
|
6
7
|
//#region src/components/StyleInspector/hooks/useInspectorValues.ts
|
|
7
|
-
var
|
|
8
|
-
let { inheritData:
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
m,
|
|
13
|
-
u
|
|
14
|
-
]), b = n(() => !!s && !u && Object.keys(h).filter((e) => s.includes(e) || s.length === 0).length > 0, [
|
|
15
|
-
s,
|
|
8
|
+
var c = ({ keys: c, skipContext: l = !1, context: u = {}, asValue: d = !1, defaultValues: f, strictMode: p = !1, replaceTokens: m = !1 }) => {
|
|
9
|
+
let { inheritData: h, bindingData: g, variables: _, getValues: v } = {};
|
|
10
|
+
l ? {inheritData: h, bindingData: g, variables: _, getValues: v} = u : {inheritData: h, bindingData: g, variables: _, getValues: v} = n(t);
|
|
11
|
+
let y = v(), b = r(() => !!c && !d && Object.keys(h).filter((e) => c.includes(e) || c.length === 0).length > 0, [
|
|
12
|
+
c,
|
|
16
13
|
h,
|
|
17
|
-
|
|
18
|
-
]), x =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
]), S =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]), C =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}), e[n] =
|
|
35
|
-
}),
|
|
14
|
+
d
|
|
15
|
+
]), x = r(() => !!c && !d && Object.keys(g).filter((e) => c.includes(e) || c.length === 0).length > 0, [
|
|
16
|
+
c,
|
|
17
|
+
g,
|
|
18
|
+
d
|
|
19
|
+
]), S = r(() => !!c && !d && Object.keys(a(y, c)).filter((e) => typeof y[e] == "string" && s.test(y[e])).length > 0, [
|
|
20
|
+
c,
|
|
21
|
+
y,
|
|
22
|
+
d
|
|
23
|
+
]), C = r(() => c ? c.length > 0 ? !d && Object.keys(a(y, c)).length > 0 : !d && Object.keys(y).length > 0 : !1, [
|
|
24
|
+
c,
|
|
25
|
+
d,
|
|
26
|
+
y
|
|
27
|
+
]), w = r(() => {
|
|
28
|
+
let t = {};
|
|
29
|
+
return c && c.forEach((n) => {
|
|
30
|
+
let r;
|
|
31
|
+
r = p ? i(y, n, i(f ?? {}, n)) : i(y, n, i(g, n, i(h, `${n}.0.value`, i(f ?? {}, n, o[n])))), m && typeof r == "string" && (r = e(r, _)), t[n] = r;
|
|
32
|
+
}), t;
|
|
36
33
|
}, [
|
|
37
|
-
|
|
38
|
-
f,
|
|
34
|
+
c,
|
|
39
35
|
p,
|
|
40
|
-
v,
|
|
41
|
-
d,
|
|
42
36
|
m,
|
|
37
|
+
y,
|
|
38
|
+
f,
|
|
43
39
|
h,
|
|
44
|
-
g
|
|
40
|
+
g,
|
|
41
|
+
_
|
|
45
42
|
]);
|
|
46
|
-
return
|
|
47
|
-
values:
|
|
48
|
-
hasInherit:
|
|
49
|
-
hasBinding:
|
|
50
|
-
hasVariables:
|
|
51
|
-
hasValues:
|
|
43
|
+
return d ? w : {
|
|
44
|
+
values: w,
|
|
45
|
+
hasInherit: b,
|
|
46
|
+
hasBinding: x,
|
|
47
|
+
hasVariables: S,
|
|
48
|
+
hasValues: C
|
|
52
49
|
};
|
|
53
50
|
};
|
|
54
51
|
//#endregion
|
|
55
|
-
export {
|
|
52
|
+
export { c as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CategoryKeys } from './categoryKeys';
|
|
2
|
+
import { StyleCategory } from '@plitzi/sdk-shared';
|
|
3
|
+
/**
|
|
4
|
+
* A query as the property names are written: lower case, and words joined by hyphens, so `border radius` finds
|
|
5
|
+
* `border-radius`. Empty when there is nothing to search for.
|
|
6
|
+
*/
|
|
7
|
+
export declare const normalizeQuery: (raw: string) => string;
|
|
8
|
+
/** Whether a category holds what was typed: its title, or any property it edits. Everything matches no query. */
|
|
9
|
+
export declare const categoryMatches: ({ title, dot }: CategoryKeys, query: string) => boolean;
|
|
10
|
+
/** Whether what was typed lives behind the category's advanced toggle — which a search then opens. */
|
|
11
|
+
export declare const advancedMatches: (advanced: StyleCategory[] | undefined, query: string) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/StyleInspector/search.ts
|
|
2
|
+
var e = {
|
|
3
|
+
bg: "background",
|
|
4
|
+
colour: "color",
|
|
5
|
+
rounded: "radius",
|
|
6
|
+
corner: "radius",
|
|
7
|
+
layer: "z-index",
|
|
8
|
+
stack: "z-index"
|
|
9
|
+
}, t = (t) => {
|
|
10
|
+
let n = t.trim().toLowerCase().replace(/\s+/g, "-");
|
|
11
|
+
return e[n] ?? n;
|
|
12
|
+
}, n = (e, t) => t.split("-").every((t) => !t || e.includes(t)), r = (e, t) => e.some((e) => n(e, t)), i = ({ title: e, dot: t }, i) => !i || n(e.toLowerCase().replace(/\s+/g, "-"), i) || r(t, i), a = (e, t) => !!t && !!e && r(e, t);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as advancedMatches, i as categoryMatches, t as normalizeQuery };
|