@plitzi/sdk-style 0.39.4 → 0.39.7
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 +30 -0
- package/dist/builder/StyleAdvanceEditor.mjs +4 -3
- package/dist/builder/components/InputEasing/Curve.mjs +1 -1
- package/dist/builder/components/InputEasing/Grid.mjs +3 -3
- package/dist/builder/components/InputEasing/InputEasing.mjs +2 -2
- package/dist/builder/components/InputEasing/InputEasingButton.mjs +1 -1
- package/dist/builder/components/InputEasing/InputEasingList.mjs +4 -4
- package/dist/builder/components/Selector/Selector.mjs +143 -123
- package/dist/builder/components/Selector/SelectorItem/ItemOptions.mjs +4 -3
- package/dist/builder/components/Selector/SelectorItem/SelectorItem.mjs +29 -19
- package/dist/builder/components/Selector/SelectorItem/helpers.d.ts +1 -1
- package/dist/builder/components/Selector/SelectorItem/helpers.mjs +1 -1
- package/dist/builder/components/Selector/SelectorSuggestions/SelectorSuggestions.d.ts +6 -3
- package/dist/builder/components/Selector/SelectorSuggestions/SelectorSuggestions.mjs +56 -18
- package/dist/builder/components/Selector/SelectorSuggestions/helpers.d.ts +8 -0
- package/dist/builder/components/Selector/SelectorSuggestions/helpers.mjs +9 -0
- package/dist/builder/components/Selector/SelectorSuggestions/index.d.ts +1 -0
- package/dist/builder/components/Selector/SelectorSuggestions/index.mjs +3 -2
- package/dist/builder/components/StyleInspector/Inspector.mjs +1 -1
- package/dist/builder/components/StyleInspector/StyleInspector.mjs +2 -2
- package/dist/builder/components/StyleInspector/categories/Background/Background.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Background/components/BackgroundLayer/BackgroundLayer.mjs +6 -6
- package/dist/builder/components/StyleInspector/categories/Background/components/GradientStopBar/GradientStopEditor.mjs +3 -3
- package/dist/builder/components/StyleInspector/categories/Background/components/LayerGroup/LayerGroup.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Background/modes/RawMode.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Effects/Filters/FilterItem.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Effects/Transition/TransitionEasing.mjs +4 -4
- package/dist/builder/components/StyleInspector/categories/Effects/Transition/TransitionItem.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Position/PositionAdvanced.mjs +5 -5
- package/dist/builder/components/StyleInspector/categories/Spacing/SpacingEditor.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Spacing/SpacingMargin.mjs +1 -1
- package/dist/builder/components/StyleInspector/categories/Spacing/SpacingPadding.mjs +2 -2
- package/dist/builder/components/StyleInspector/components/AncestorRules/AncestorRuleChip.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/AncestorRules/AncestorRules.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/CategoryContainer/CategoryContainer.mjs +5 -5
- package/dist/builder/components/StyleInspector/components/CategoryOption/categoryTypes/OptionIconGroup.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/InspectorFooter/InspectorFooter.mjs +3 -3
- package/dist/builder/components/StyleInspector/components/InspectorLabel/InspectorLabel.mjs +2 -2
- package/dist/builder/components/StyleInspector/components/InspectorSearch/InspectorSearch.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/ShadowItem/ShadowItem.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/TargetSummary/TargetSummary.mjs +2 -2
- package/dist/builder/components/StyleInspector/components/ValueList/ValueList.mjs +1 -1
- package/dist/builder/components/StyleInspector/components/ValueListItem/ValueListItem.mjs +6 -6
- package/dist/builder/components/StyleManager/ManagerSelector.mjs +281 -123
- package/dist/builder/components/StyleManager/StyleManager.mjs +75 -35
- package/dist/builder/components/StyleManager/StyleSelectorTag.d.ts +5 -1
- package/dist/builder/components/StyleManager/StyleSelectorTag.mjs +81 -63
- package/dist/builder/hooks/useWindowedList.d.ts +19 -0
- package/dist/builder/hooks/useWindowedList.mjs +38 -0
- package/package.json +8 -8
- package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsCreator.d.ts +0 -7
- package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsCreator.mjs +0 -19
- package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsList.d.ts +0 -7
- package/dist/builder/components/Selector/SelectorSuggestions/SuggestionsList.mjs +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @plitzi/sdk-style
|
|
2
2
|
|
|
3
|
+
## 0.39.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 081d94e: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
8
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
9
|
+
- Updated dependencies [081d94e]
|
|
10
|
+
- @plitzi/sdk-event-bridge@0.39.7
|
|
11
|
+
- @plitzi/sdk-shared@0.39.7
|
|
12
|
+
- @plitzi/sdk-variables@0.39.7
|
|
13
|
+
|
|
14
|
+
## 0.39.6
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- @plitzi/sdk-event-bridge@0.39.6
|
|
19
|
+
- @plitzi/sdk-shared@0.39.6
|
|
20
|
+
- @plitzi/sdk-variables@0.39.6
|
|
21
|
+
|
|
22
|
+
## 0.39.5
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 4427674: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
|
|
27
|
+
`@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
|
|
28
|
+
- Updated dependencies [4427674]
|
|
29
|
+
- @plitzi/sdk-event-bridge@0.39.5
|
|
30
|
+
- @plitzi/sdk-shared@0.39.5
|
|
31
|
+
- @plitzi/sdk-variables@0.39.5
|
|
32
|
+
|
|
3
33
|
## 0.39.4
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -38,12 +38,12 @@ var _ = () => {
|
|
|
38
38
|
children: [/* @__PURE__ */ l("div", {
|
|
39
39
|
className: "flex flex-col items-end gap-2",
|
|
40
40
|
children: [/* @__PURE__ */ l("p", {
|
|
41
|
-
className: "self-stretch text-xs leading-relaxed
|
|
41
|
+
className: "text-ui-fg-muted self-stretch text-xs leading-relaxed",
|
|
42
42
|
children: [
|
|
43
43
|
"CSS of your own for the whole space, past what the style inspector writes.",
|
|
44
44
|
" ",
|
|
45
45
|
/* @__PURE__ */ c("span", {
|
|
46
|
-
className: "
|
|
46
|
+
className: "text-ui-fg font-medium",
|
|
47
47
|
children: "Ctrl + Space"
|
|
48
48
|
}),
|
|
49
49
|
" completes a token.",
|
|
@@ -65,10 +65,11 @@ var _ = () => {
|
|
|
65
65
|
children: [/* @__PURE__ */ c(f.Icon, { icon: "fa-solid fa-wand-magic-sparkles" }), "Format"]
|
|
66
66
|
})]
|
|
67
67
|
}), /* @__PURE__ */ c(p, {
|
|
68
|
-
className: "min-h-0 grow overflow-hidden rounded-md border
|
|
68
|
+
className: "border-ui-line-strong min-h-0 grow overflow-hidden rounded-md border",
|
|
69
69
|
value: S,
|
|
70
70
|
autoComplete: M,
|
|
71
71
|
theme: _,
|
|
72
|
+
size: "xs",
|
|
72
73
|
lineWrapping: !0,
|
|
73
74
|
onChange: A
|
|
74
75
|
})]
|
|
@@ -3,7 +3,7 @@ import { jsx as e } from "react/jsx-runtime";
|
|
|
3
3
|
var t = [], n = ({ value: n = t, xFrom: r = 0, xTo: i = 0, yFrom: a = 0, yTo: o = 0 }) => {
|
|
4
4
|
let s = (e, t, n) => e * (1 - n) + t * n, c = (e) => Math.round(s(r, i, e)), l = (e) => Math.round(s(a, o, e)), u = c(0), d = l(0), f = c(1), p = l(1), m = c(n[0]), h = l(n[1]), g = c(n[2]), _ = l(n[3]);
|
|
5
5
|
return /* @__PURE__ */ e("path", {
|
|
6
|
-
className: "fill-transparent stroke-
|
|
6
|
+
className: "stroke-ui-fg fill-transparent stroke-2",
|
|
7
7
|
d: `M${u},${d} C${m},${h} ${g},${_} ${f},${p}`
|
|
8
8
|
});
|
|
9
9
|
};
|
|
@@ -14,16 +14,16 @@ var n = ({ xFrom: n = 0, xTo: r = 0, yFrom: i = 0, yTo: a = 0 }) => {
|
|
|
14
14
|
}).join(" ");
|
|
15
15
|
return /* @__PURE__ */ t("g", { children: [
|
|
16
16
|
/* @__PURE__ */ e("path", {
|
|
17
|
-
className: "fill-
|
|
17
|
+
className: "fill-ui-panel",
|
|
18
18
|
d: b
|
|
19
19
|
}),
|
|
20
20
|
/* @__PURE__ */ e("path", {
|
|
21
|
-
className: "stroke-
|
|
21
|
+
className: "stroke-ui-fg-subtle",
|
|
22
22
|
strokeWidth: "1px",
|
|
23
23
|
d: x
|
|
24
24
|
}),
|
|
25
25
|
/* @__PURE__ */ e("path", {
|
|
26
|
-
className: "stroke-
|
|
26
|
+
className: "stroke-ui-fg-subtle",
|
|
27
27
|
strokeWidth: "2px",
|
|
28
28
|
d: S
|
|
29
29
|
}),
|
|
@@ -95,7 +95,7 @@ var l = [
|
|
|
95
95
|
cy: x,
|
|
96
96
|
r: f,
|
|
97
97
|
onMouseDown: this.handleMouseDown("bottom"),
|
|
98
|
-
className: "cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:
|
|
98
|
+
className: "group-hover:fill-ui-panel cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:stroke-[6px]"
|
|
99
99
|
})]
|
|
100
100
|
}), /* @__PURE__ */ s("g", {
|
|
101
101
|
className: "group",
|
|
@@ -110,7 +110,7 @@ var l = [
|
|
|
110
110
|
cy: O,
|
|
111
111
|
r: f,
|
|
112
112
|
onMouseDown: this.handleMouseDown("top"),
|
|
113
|
-
className: "cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:
|
|
113
|
+
className: "group-hover:fill-ui-panel cursor-pointer fill-blue-400 stroke-blue-400 stroke-[3px] group-hover:stroke-[6px]"
|
|
114
114
|
})]
|
|
115
115
|
})] })
|
|
116
116
|
]
|
|
@@ -5,7 +5,7 @@ var n = ({ children: n, title: r = "", className: i = "", onClick: a }) => /* @_
|
|
|
5
5
|
type: "button",
|
|
6
6
|
title: r,
|
|
7
7
|
onClick: a,
|
|
8
|
-
className: t("hover:text-primary-600 dark:hover:text-primary-300 m-0.5 h-7 w-7 cursor-pointer rounded-md p-1
|
|
8
|
+
className: t("hover:text-primary-600 dark:hover:text-primary-300 text-ui-fg-muted hover:bg-ui-hover m-0.5 h-7 w-7 cursor-pointer rounded-md p-1", i),
|
|
9
9
|
children: /* @__PURE__ */ e("svg", {
|
|
10
10
|
viewBox: "0 0 30 30",
|
|
11
11
|
className: "overflow-visible",
|
|
@@ -11,7 +11,7 @@ var a = ({ className: a = "", onChange: o }) => {
|
|
|
11
11
|
/* @__PURE__ */ r("div", {
|
|
12
12
|
className: "flex flex-col",
|
|
13
13
|
children: [/* @__PURE__ */ n("div", {
|
|
14
|
-
className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide
|
|
14
|
+
className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
|
|
15
15
|
children: "Default"
|
|
16
16
|
}), /* @__PURE__ */ r("div", {
|
|
17
17
|
className: "flex flex-wrap",
|
|
@@ -62,7 +62,7 @@ var a = ({ className: a = "", onChange: o }) => {
|
|
|
62
62
|
/* @__PURE__ */ r("div", {
|
|
63
63
|
className: "flex flex-col",
|
|
64
64
|
children: [/* @__PURE__ */ n("div", {
|
|
65
|
-
className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide
|
|
65
|
+
className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
|
|
66
66
|
children: "Ease In"
|
|
67
67
|
}), /* @__PURE__ */ r("div", {
|
|
68
68
|
className: "flex flex-wrap",
|
|
@@ -137,7 +137,7 @@ var a = ({ className: a = "", onChange: o }) => {
|
|
|
137
137
|
/* @__PURE__ */ r("div", {
|
|
138
138
|
className: "flex flex-col",
|
|
139
139
|
children: [/* @__PURE__ */ n("div", {
|
|
140
|
-
className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide
|
|
140
|
+
className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
|
|
141
141
|
children: "Ease Out"
|
|
142
142
|
}), /* @__PURE__ */ r("div", {
|
|
143
143
|
className: "flex flex-wrap",
|
|
@@ -212,7 +212,7 @@ var a = ({ className: a = "", onChange: o }) => {
|
|
|
212
212
|
/* @__PURE__ */ r("div", {
|
|
213
213
|
className: "flex flex-col",
|
|
214
214
|
children: [/* @__PURE__ */ n("div", {
|
|
215
|
-
className: "px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide
|
|
215
|
+
className: "text-ui-fg-subtle px-1 pt-2 pb-0.5 text-[11px] font-semibold tracking-wide uppercase",
|
|
216
216
|
children: "Ease In Out"
|
|
217
217
|
}), /* @__PURE__ */ r("div", {
|
|
218
218
|
className: "flex flex-wrap",
|
|
@@ -1,110 +1,124 @@
|
|
|
1
1
|
import { inStylesheetOrder as e, overriddenProperties as t, overrideNote as n, selectorFormatter as r } from "./SelectorHelper.mjs";
|
|
2
2
|
import i from "./SelectorItem/index.mjs";
|
|
3
|
-
import a from "./SelectorSuggestions/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
3
|
+
import { suggestionsFor as a } from "./SelectorSuggestions/helpers.mjs";
|
|
4
|
+
import ee from "./SelectorSuggestions/index.mjs";
|
|
5
|
+
import te from "../StyleManager/index.mjs";
|
|
6
|
+
import { memo as o, useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
import { get as p, omit as ne, pick as m } from "@plitzi/plitzi-ui/helpers";
|
|
9
|
+
import h from "@plitzi/plitzi-ui/Button";
|
|
10
|
+
import g from "clsx";
|
|
11
|
+
import _, { useFloating as v } from "@plitzi/plitzi-ui/ContainerFloating";
|
|
12
|
+
import { usePopup as y } from "@plitzi/plitzi-ui/Popup";
|
|
12
13
|
// src/builder/components/Selector/Selector.tsx
|
|
13
|
-
var
|
|
14
|
-
let N = u(
|
|
14
|
+
var b = "Classes apply left to right, in the order the stylesheet lists them: where two set the same property, the one further right wins.", x = o(({ className: o = "", value: x = "", selectors: S, selector: C, componentType: w, labels: T, disabled: E = !1, onChange: D, onSelectorSelected: O, onAdd: k, onRemove: A }) => {
|
|
15
|
+
let j = l(null), [M, N] = u(""), [P, F] = u(-1), [I, L, , R, z] = v({ disabled: E }), { existsPopup: B, addPopup: V } = y("floating"), H = c(() => Object.values(S ?? {}).find((e) => e.type === "element" && e.componentType === w), [w, S]), U = c(() => Object.values(m(S ?? {}, x.split(" "))).map((e) => m(e, ["name", "type"])), [S, x]), W = c(() => e(U.map((e, t) => ({
|
|
15
16
|
...e,
|
|
16
17
|
position: t
|
|
17
|
-
})), Object.keys(
|
|
18
|
-
L(
|
|
19
|
-
}, [L]),
|
|
20
|
-
|
|
21
|
-
}, [
|
|
22
|
-
N,
|
|
23
|
-
P,
|
|
24
|
-
L
|
|
25
|
-
]), X = c((e) => A?.(e), [A]), Z = c((e) => (t, n = !0) => {
|
|
18
|
+
})), Object.keys(S ?? {})), [U, S]), G = c(() => t(W.map(({ name: e }) => e), S ?? {}), [W, S]), K = c(() => n(C?.name.replace(/:.*/, ""), G), [C, G]), q = c(() => Object.values(ne(S ?? {}, x.split(" "))), [S, x]), J = c(() => a(M, q), [M, q]), Y = J.list.length + +!!J.creates, X = s((e) => {
|
|
19
|
+
L(!0), N(e.target.value), F(-1);
|
|
20
|
+
}, [L]), re = s(() => {
|
|
21
|
+
j.current?.focus(), L(!0);
|
|
22
|
+
}, [j, L]), Z = s((e) => O?.(e), [O]), ie = s((e) => (t, n = !0) => {
|
|
26
23
|
let r = [...U.filter((t, n) => n !== e), t].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
27
|
-
|
|
24
|
+
k?.(t, !1), D?.(r), n && O?.(t);
|
|
28
25
|
}, [
|
|
29
26
|
U,
|
|
30
|
-
j,
|
|
31
27
|
k,
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
D,
|
|
29
|
+
O
|
|
30
|
+
]), ae = s((e) => (t, n) => {
|
|
34
31
|
switch (t) {
|
|
35
32
|
case "remove":
|
|
36
33
|
case "delete": {
|
|
37
34
|
let n = U.filter((t, n) => n !== e), r = n.reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
38
|
-
|
|
35
|
+
C && U[e].name === C.name && O?.(p(n, "0")), D?.(r), t === "delete" && A?.(U[e]);
|
|
39
36
|
break;
|
|
40
37
|
}
|
|
41
38
|
case "duplicate": {
|
|
42
39
|
if (!n) break;
|
|
43
40
|
let t = [...U, n].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
44
|
-
|
|
41
|
+
k?.(n, !0, p(U, `${e}`)), D?.(t);
|
|
45
42
|
break;
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
}, [
|
|
49
46
|
U,
|
|
50
|
-
|
|
47
|
+
C,
|
|
48
|
+
D,
|
|
49
|
+
O,
|
|
50
|
+
k,
|
|
51
|
+
A
|
|
52
|
+
]), Q = s((e) => {
|
|
53
|
+
setTimeout(() => N(""), 0), L(!1);
|
|
54
|
+
let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
55
|
+
D?.(t), O?.(e);
|
|
56
|
+
}, [
|
|
57
|
+
U,
|
|
58
|
+
D,
|
|
59
|
+
O,
|
|
60
|
+
L
|
|
61
|
+
]), $ = s((e) => {
|
|
62
|
+
setTimeout(() => N(""), 0), L(!1);
|
|
63
|
+
let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
64
|
+
D?.(t), k?.(e, !1), O?.(e);
|
|
65
|
+
}, [
|
|
66
|
+
U,
|
|
67
|
+
D,
|
|
51
68
|
k,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
]), $ = c((e) => {
|
|
69
|
+
O,
|
|
70
|
+
L
|
|
71
|
+
]), oe = s((e) => {
|
|
56
72
|
switch (e.key) {
|
|
57
73
|
case "Enter": {
|
|
74
|
+
if (P >= 0) {
|
|
75
|
+
if (e.preventDefault(), J.creates && P === 0) $({
|
|
76
|
+
name: J.creates,
|
|
77
|
+
type: "class"
|
|
78
|
+
});
|
|
79
|
+
else {
|
|
80
|
+
let e = J.list.at(P - +!!J.creates);
|
|
81
|
+
e && Q(e);
|
|
82
|
+
}
|
|
83
|
+
F(-1);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
58
86
|
let { value: t } = e.currentTarget;
|
|
59
87
|
if (t !== "" && !U.find((e) => e.name === t)) {
|
|
60
|
-
|
|
88
|
+
N("");
|
|
61
89
|
let n = {
|
|
62
90
|
name: r(t),
|
|
63
91
|
type: "class"
|
|
64
92
|
}, i = [...U, n].filter((e) => !!e.name).reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
65
|
-
|
|
93
|
+
k?.(n, !1), D?.(i), L(!1), e.currentTarget.blur(), O?.(n);
|
|
66
94
|
}
|
|
67
95
|
setTimeout(() => {
|
|
68
|
-
|
|
96
|
+
j.current?.focus();
|
|
69
97
|
}, 0);
|
|
70
98
|
break;
|
|
71
99
|
}
|
|
72
100
|
case "ArrowUp":
|
|
73
|
-
|
|
101
|
+
e.preventDefault(), F((e) => Math.max(e - 1, -1));
|
|
74
102
|
break;
|
|
75
103
|
case "ArrowDown":
|
|
76
|
-
L(!0);
|
|
104
|
+
e.preventDefault(), L(!0), F((e) => Math.min(e + 1, Y - 1));
|
|
77
105
|
break;
|
|
78
|
-
case "Escape": e.stopPropagation(),
|
|
106
|
+
case "Escape": e.stopPropagation(), N(""), F(-1), L(!1), e.currentTarget.blur();
|
|
79
107
|
}
|
|
80
|
-
}, [
|
|
81
|
-
U,
|
|
82
|
-
j,
|
|
83
|
-
k,
|
|
84
|
-
A,
|
|
85
|
-
L
|
|
86
|
-
]), ee = c((e) => {
|
|
87
|
-
setTimeout(() => F(""), 0), L(!1);
|
|
88
|
-
let t = [...U, e].reduce((e, t) => `${e} ${t.name}`, "").trim();
|
|
89
|
-
k?.(t), A?.(e);
|
|
90
108
|
}, [
|
|
91
109
|
U,
|
|
92
110
|
k,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
L
|
|
105
|
-
]), ne = c((e) => {
|
|
106
|
-
e.preventDefault(), e.stopPropagation(), B("styleManager") || V("styleManager", /* @__PURE__ */ f(o, {}), {
|
|
107
|
-
icon: /* @__PURE__ */ f("i", { className: "fas fa-swatchbook text-base" }),
|
|
111
|
+
D,
|
|
112
|
+
O,
|
|
113
|
+
L,
|
|
114
|
+
P,
|
|
115
|
+
J,
|
|
116
|
+
Y,
|
|
117
|
+
$,
|
|
118
|
+
Q
|
|
119
|
+
]), se = s((e) => {
|
|
120
|
+
e.preventDefault(), e.stopPropagation(), B("styleManager") || V("styleManager", /* @__PURE__ */ d(te, {}), {
|
|
121
|
+
icon: /* @__PURE__ */ d("i", { className: "fas fa-swatchbook text-base" }),
|
|
108
122
|
title: "Style Manager",
|
|
109
123
|
resizeHandles: ["se"],
|
|
110
124
|
allowLeftSide: !0,
|
|
@@ -113,80 +127,86 @@ var S = "Classes apply left to right, in the order the stylesheet lists them: wh
|
|
|
113
127
|
width: 720,
|
|
114
128
|
height: 640
|
|
115
129
|
});
|
|
116
|
-
}, [V, B]),
|
|
117
|
-
return /* @__PURE__ */
|
|
130
|
+
}, [V, B]), ce = c(() => ({ width: z?.width }), [z]);
|
|
131
|
+
return /* @__PURE__ */ f("div", {
|
|
118
132
|
className: "flex w-full min-w-0 flex-col gap-1",
|
|
119
|
-
children: [/* @__PURE__ */
|
|
133
|
+
children: [/* @__PURE__ */ f(_, {
|
|
120
134
|
ref: R,
|
|
121
135
|
className: "w-full",
|
|
122
136
|
open: I,
|
|
123
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ d(_.Trigger, {
|
|
124
138
|
className: "w-full",
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
-
className:
|
|
127
|
-
"pointer-events-none cursor-not-allowed
|
|
128
|
-
"cursor-
|
|
139
|
+
children: /* @__PURE__ */ f("div", {
|
|
140
|
+
className: g("bg-ui-panel relative flex min-h-8 items-center gap-1 rounded-md border py-1 pr-1 pl-1", o, {
|
|
141
|
+
"border-ui-line pointer-events-none cursor-not-allowed opacity-60": E,
|
|
142
|
+
"focus-within:border-primary-500 focus-within:ring-primary-500/20 border-ui-line-strong cursor-text focus-within:ring-2": !E
|
|
129
143
|
}),
|
|
130
|
-
onClick:
|
|
131
|
-
onKeyDown:
|
|
132
|
-
children: [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
144
|
+
onClick: re,
|
|
145
|
+
onKeyDown: oe,
|
|
146
|
+
children: [/* @__PURE__ */ f("div", {
|
|
147
|
+
className: "flex min-w-0 grow flex-wrap items-center gap-1",
|
|
148
|
+
children: [
|
|
149
|
+
H && /* @__PURE__ */ d(i, {
|
|
150
|
+
selector: H.name,
|
|
151
|
+
type: H.type,
|
|
152
|
+
editable: !1,
|
|
153
|
+
active: H.name === C?.name.replace(/:.*/, ""),
|
|
154
|
+
onClick: Z
|
|
155
|
+
}),
|
|
156
|
+
W.map(({ position: e, ...t }) => /* @__PURE__ */ d(i, {
|
|
157
|
+
selector: t.name,
|
|
158
|
+
label: T?.[t.name],
|
|
159
|
+
type: t.type,
|
|
160
|
+
editable: t.type !== "element",
|
|
161
|
+
active: t.name === C?.name.replace(/:.*/, ""),
|
|
162
|
+
onAction: ae(e),
|
|
163
|
+
onClick: Z,
|
|
164
|
+
onChange: ie(e)
|
|
165
|
+
}, `${e}_${t.name}`)),
|
|
166
|
+
/* @__PURE__ */ d("input", {
|
|
167
|
+
ref: j,
|
|
168
|
+
className: "placeholder:text-ui-fg-subtle min-w-20 grow basis-0 border-none bg-transparent px-1 py-0.5 text-xs text-inherit outline-hidden focus:ring-transparent",
|
|
169
|
+
placeholder: W.length > 0 ? "Add class…" : "Add a class to style it…",
|
|
170
|
+
"aria-label": "Add a class",
|
|
171
|
+
"aria-expanded": I,
|
|
172
|
+
"aria-autocomplete": "list",
|
|
173
|
+
autoComplete: "off",
|
|
174
|
+
autoCorrect: "off",
|
|
175
|
+
autoCapitalize: "off",
|
|
176
|
+
spellCheck: "false",
|
|
177
|
+
value: M,
|
|
178
|
+
onChange: X
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
}), /* @__PURE__ */ d(h, {
|
|
182
|
+
intent: "secondary",
|
|
183
|
+
size: "custom",
|
|
184
|
+
onClick: se,
|
|
185
|
+
className: "text-ui-fg-subtle hover:bg-ui-hover hover:text-ui-fg h-6 w-6 shrink-0 self-start rounded bg-transparent dark:bg-transparent",
|
|
186
|
+
title: "Open the Style Manager: every class and element default of the space",
|
|
187
|
+
children: /* @__PURE__ */ d(h.Icon, { icon: "fas fa-swatchbook" })
|
|
188
|
+
})]
|
|
169
189
|
})
|
|
170
|
-
}), /* @__PURE__ */
|
|
171
|
-
style:
|
|
172
|
-
children: /* @__PURE__ */
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
onSelect:
|
|
176
|
-
onCreate:
|
|
190
|
+
}), /* @__PURE__ */ d(_.Content, {
|
|
191
|
+
style: ce,
|
|
192
|
+
children: /* @__PURE__ */ d(ee, {
|
|
193
|
+
suggestions: J,
|
|
194
|
+
highlighted: P,
|
|
195
|
+
onSelect: Q,
|
|
196
|
+
onCreate: $
|
|
177
197
|
})
|
|
178
198
|
})]
|
|
179
|
-
}), W.length > 1 && /* @__PURE__ */
|
|
180
|
-
className: "flex min-w-0 items-center gap-1.5 px-1 text-[11px]
|
|
181
|
-
title: K ??
|
|
182
|
-
children: [/* @__PURE__ */
|
|
199
|
+
}), W.length > 1 && /* @__PURE__ */ f("div", {
|
|
200
|
+
className: "text-ui-fg-subtle flex min-w-0 items-center gap-1.5 px-1 text-[11px]",
|
|
201
|
+
title: K ?? b,
|
|
202
|
+
children: [/* @__PURE__ */ d("i", {
|
|
183
203
|
className: "fas fa-circle-info shrink-0",
|
|
184
|
-
title:
|
|
185
|
-
}), /* @__PURE__ */
|
|
204
|
+
title: b
|
|
205
|
+
}), /* @__PURE__ */ d("span", {
|
|
186
206
|
className: "truncate",
|
|
187
207
|
children: K ?? "Left to right: the class further right wins where they overlap"
|
|
188
208
|
})]
|
|
189
209
|
})]
|
|
190
210
|
});
|
|
191
211
|
});
|
|
192
|
-
export {
|
|
212
|
+
export { x as default };
|
|
@@ -26,11 +26,12 @@ var l = ({ selector: l = "", type: u = "class", onAction: d }) => {
|
|
|
26
26
|
]);
|
|
27
27
|
return /* @__PURE__ */ r(a, { children: [/* @__PURE__ */ n(a.Trigger, { children: /* @__PURE__ */ n(o, {
|
|
28
28
|
icon: "fa-solid fa-ellipsis-vertical",
|
|
29
|
-
className: "h-4 w-
|
|
29
|
+
className: "h-4 w-3 !min-w-3 rounded-sm opacity-70 hover:opacity-100",
|
|
30
|
+
title: "Class actions: duplicate, remove, delete"
|
|
30
31
|
}) }), /* @__PURE__ */ n(a.Content, {
|
|
31
|
-
className: "text-
|
|
32
|
+
className: "text-ui-fg text-xs",
|
|
32
33
|
children: /* @__PURE__ */ n("div", {
|
|
33
|
-
className: "min-w-44 rounded-md border
|
|
34
|
+
className: "border-ui-line bg-ui-overlay min-w-44 rounded-md border p-1 shadow-lg",
|
|
34
35
|
children: /* @__PURE__ */ r("ul", {
|
|
35
36
|
className: "m-0 flex list-none flex-col p-0",
|
|
36
37
|
children: [
|
|
@@ -23,29 +23,39 @@ var c = ({ className: c = "", selector: l = "", label: u, type: d = "class", edi
|
|
|
23
23
|
});
|
|
24
24
|
}, [d, g]);
|
|
25
25
|
return /* @__PURE__ */ a("div", {
|
|
26
|
-
className: o("relative flex cursor-pointer items-center gap-1 rounded
|
|
27
|
-
"bg-primary-600 text-white": d !== "element" && p,
|
|
28
|
-
"bg-primary-500/
|
|
29
|
-
"bg-
|
|
26
|
+
className: o("relative flex h-6 cursor-pointer items-center gap-1 rounded px-1.5 select-none", c, {
|
|
27
|
+
"bg-primary-600 text-white shadow-sm": d !== "element" && p,
|
|
28
|
+
"bg-primary-500/15 text-primary-800 ring-primary-500/40 dark:text-primary-200 ring-1": d === "element" && p,
|
|
29
|
+
"bg-ui-raised text-ui-fg ring-ui-line hover:bg-ui-hover ring-1": !p,
|
|
30
30
|
"max-w-full min-w-0": !f
|
|
31
31
|
}),
|
|
32
32
|
onClick: v,
|
|
33
33
|
title: `${d}: ${l}`,
|
|
34
|
-
children: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
children: [
|
|
35
|
+
d === "element" && /* @__PURE__ */ i("i", {
|
|
36
|
+
className: "fa-solid fa-cube text-[9px] opacity-70",
|
|
37
|
+
"aria-hidden": !0
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ a("div", {
|
|
40
|
+
className: "flex min-w-0 grow basis-0 font-mono text-[11px]",
|
|
41
|
+
children: [f && /* @__PURE__ */ i(s, {
|
|
42
|
+
className: "inline text-nowrap focus-visible:m-[1px] focus-visible:px-1 focus-visible:outline-1 focus-visible:outline-dashed",
|
|
43
|
+
value: x,
|
|
44
|
+
openMode: "doubleClick",
|
|
45
|
+
onChange: w,
|
|
46
|
+
onEditOpen: S,
|
|
47
|
+
onEditClose: C
|
|
48
|
+
}), !f && /* @__PURE__ */ i("span", {
|
|
49
|
+
className: "truncate",
|
|
50
|
+
children: x
|
|
51
|
+
})]
|
|
52
|
+
}),
|
|
53
|
+
f && d !== "element" && /* @__PURE__ */ i(t, {
|
|
54
|
+
selector: l,
|
|
55
|
+
type: d,
|
|
56
|
+
onAction: _
|
|
57
|
+
})
|
|
58
|
+
]
|
|
49
59
|
});
|
|
50
60
|
};
|
|
51
61
|
export { c as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** An entry of a class's actions menu: a full-width button, highlighted under the pointer and the keyboard alike. */
|
|
2
|
-
export declare const ITEM_CLASS = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-
|
|
2
|
+
export declare const ITEM_CLASS = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-ui-hover focus-visible:bg-ui-hover focus-visible:outline-none";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// src/builder/components/Selector/SelectorItem/helpers.ts
|
|
2
|
-
var e = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-
|
|
2
|
+
var e = "w-full cursor-pointer rounded px-2 py-1.5 text-left hover:bg-ui-hover focus-visible:bg-ui-hover focus-visible:outline-none";
|
|
3
3
|
export { e as ITEM_CLASS };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { Suggestions } from './helpers';
|
|
1
2
|
import { SelectorValue } from '../Selector';
|
|
2
3
|
export type SelectorSuggestionsProps = {
|
|
3
|
-
|
|
4
|
+
suggestions: Suggestions;
|
|
5
|
+
/** The option the keys are on: 0 is the class to create when there is one, then the list. */
|
|
6
|
+
highlighted?: number;
|
|
4
7
|
onSelect?: (tag: SelectorValue) => void;
|
|
5
8
|
onCreate?: (tag: SelectorValue) => void;
|
|
6
|
-
selectors?: SelectorValue[];
|
|
7
9
|
};
|
|
8
|
-
|
|
10
|
+
/** The classes to add, filtered by what is typed, and the one to create when nothing has that name. */
|
|
11
|
+
declare const SelectorSuggestions: ({ suggestions, highlighted, onSelect, onCreate }: SelectorSuggestionsProps) => import('react').JSX.Element;
|
|
9
12
|
export default SelectorSuggestions;
|