@weasel-js/ui 1.7.1 → 1.7.2
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/dist/chunks/{BandEditor-Dd0egAgE.js → BandEditor-B4jUAHQ8.js} +13 -13
- package/dist/chunks/BandEditor-B4jUAHQ8.js.map +1 -0
- package/dist/chunks/{ColorField-BLs9fbeq.js → ColorField-BwlelY26.js} +4 -4
- package/dist/chunks/ColorField-BwlelY26.js.map +1 -0
- package/dist/chunks/{ComboBox-CuTLRmUg.js → ComboBox-DKln_mOd.js} +11 -11
- package/dist/chunks/ComboBox-DKln_mOd.js.map +1 -0
- package/dist/chunks/{CurveEditor-jVBEqqdv.js → CurveEditor-0EE00D6s.js} +2 -2
- package/dist/chunks/{CurveEditor-jVBEqqdv.js.map → CurveEditor-0EE00D6s.js.map} +1 -1
- package/dist/chunks/{DataGrid-BklgBqS0.js → DataGrid-CmHJe57v.js} +22 -17
- package/dist/chunks/DataGrid-CmHJe57v.js.map +1 -0
- package/dist/chunks/DetailList-BpU50XVe.js +54 -0
- package/dist/chunks/DetailList-BpU50XVe.js.map +1 -0
- package/dist/chunks/{DetentSlider-Bh7EpMqT.js → DetentSlider-DNTAk8xP.js} +2 -2
- package/dist/chunks/{DetentSlider-Bh7EpMqT.js.map → DetentSlider-DNTAk8xP.js.map} +1 -1
- package/dist/chunks/{FallthroughDiagram-C7BUe8eU.js → FallthroughDiagram-CS1IhQaU.js} +14 -14
- package/dist/chunks/FallthroughDiagram-CS1IhQaU.js.map +1 -0
- package/dist/chunks/{Field-DsBlnFKf.js → Field-DiX_WByH.js} +2 -2
- package/dist/chunks/{Field-DsBlnFKf.js.map → Field-DiX_WByH.js.map} +1 -1
- package/dist/chunks/{FillStrokeSwatch-CgsYQgew.js → FillStrokeSwatch-C4h3rUFM.js} +2 -2
- package/dist/chunks/FillStrokeSwatch-C4h3rUFM.js.map +1 -0
- package/dist/chunks/{FontFamilySelect-CGJ5OIOy.js → FontFamilySelect-DEvMXyZd.js} +2 -2
- package/dist/chunks/{FontFamilySelect-CGJ5OIOy.js.map → FontFamilySelect-DEvMXyZd.js.map} +1 -1
- package/dist/chunks/{FontWeightSelect-RbcXYJPS.js → FontWeightSelect-BLQ_LMJF.js} +2 -2
- package/dist/chunks/{FontWeightSelect-RbcXYJPS.js.map → FontWeightSelect-BLQ_LMJF.js.map} +1 -1
- package/dist/chunks/{GradientEditor-DypXzMc-.js → GradientEditor-DD2OjQtn.js} +4 -4
- package/dist/chunks/{GradientEditor-DypXzMc-.js.map → GradientEditor-DD2OjQtn.js.map} +1 -1
- package/dist/chunks/{InlineRange-P01ABSzo.js → InlineRange-DPjIsJB3.js} +3 -3
- package/dist/chunks/InlineRange-DPjIsJB3.js.map +1 -0
- package/dist/chunks/{Input-CzwvCZs_.js → Input-D7SDKbST.js} +2 -2
- package/dist/chunks/{Input-CzwvCZs_.js.map → Input-D7SDKbST.js.map} +1 -1
- package/dist/chunks/{Jog-DfNUYejm.js → Jog-BrkzdGV2.js} +6 -6
- package/dist/chunks/Jog-BrkzdGV2.js.map +1 -0
- package/dist/chunks/{LayerList-CsDqwYh-.js → LayerList-Bxj1N6bj.js} +3 -3
- package/dist/chunks/{LayerList-CsDqwYh-.js.map → LayerList-Bxj1N6bj.js.map} +1 -1
- package/dist/chunks/{ListEditor-BnGzqERm.js → ListEditor-OQDzG4A5.js} +2 -2
- package/dist/chunks/{ListEditor-BnGzqERm.js.map → ListEditor-OQDzG4A5.js.map} +1 -1
- package/dist/chunks/{MenuButton-L9f5vido.js → MenuButton-TAFg88Lp.js} +2 -2
- package/dist/chunks/{MenuButton-L9f5vido.js.map → MenuButton-TAFg88Lp.js.map} +1 -1
- package/dist/chunks/{MeshEditor-GbqqiPk8.js → MeshEditor-DWpvg8H6.js} +2 -2
- package/dist/chunks/{MeshEditor-GbqqiPk8.js.map → MeshEditor-DWpvg8H6.js.map} +1 -1
- package/dist/chunks/{NumberField-DLXXgh48.js → NumberField-DS0WSiin.js} +7 -7
- package/dist/chunks/NumberField-DS0WSiin.js.map +1 -0
- package/dist/chunks/{PaintField-C0hoXc0Y.js → PaintField-BdmQM53v.js} +2 -2
- package/dist/chunks/{PaintField-C0hoXc0Y.js.map → PaintField-BdmQM53v.js.map} +1 -1
- package/dist/chunks/{PaintInput-jQRxM95Y.js → PaintInput-DaQMeBsI.js} +4 -4
- package/dist/chunks/{PaintInput-jQRxM95Y.js.map → PaintInput-DaQMeBsI.js.map} +1 -1
- package/dist/chunks/{PatternPicker-CaMYXzhF.js → PatternPicker-B3HcMZWg.js} +2 -2
- package/dist/chunks/{PatternPicker-CaMYXzhF.js.map → PatternPicker-B3HcMZWg.js.map} +1 -1
- package/dist/chunks/{Plot2D-BHNbgCAl.js → Plot2D-BrvQS0dh.js} +7 -7
- package/dist/chunks/Plot2D-BrvQS0dh.js.map +1 -0
- package/dist/chunks/{PointPlotter-BZ_vk6gV.js → PointPlotter-BBXpQ_QD.js} +2 -2
- package/dist/chunks/{PointPlotter-BZ_vk6gV.js.map → PointPlotter-BBXpQ_QD.js.map} +1 -1
- package/dist/chunks/{Prefs-CkyldX-e.js → Prefs-C4MZ28SX.js} +76 -66
- package/dist/chunks/Prefs-C4MZ28SX.js.map +1 -0
- package/dist/chunks/{Properties-D15c8NP-.js → Properties-DseN56WI.js} +24 -24
- package/dist/chunks/{Properties-D15c8NP-.js.map → Properties-DseN56WI.js.map} +1 -1
- package/dist/chunks/{PropertyField-CV_Gw57S.js → PropertyField-BbNqK8xr.js} +243 -186
- package/dist/chunks/PropertyField-BbNqK8xr.js.map +1 -0
- package/dist/chunks/{RadioGroup-4dbzqvGy.js → RadioGroup-B70_M-gT.js} +2 -2
- package/dist/chunks/{RadioGroup-4dbzqvGy.js.map → RadioGroup-B70_M-gT.js.map} +1 -1
- package/dist/chunks/{RangeSlider-BxokZViJ.js → RangeSlider-DO5TZVk7.js} +8 -8
- package/dist/chunks/RangeSlider-DO5TZVk7.js.map +1 -0
- package/dist/chunks/{Select-BppLsJTz.js → Select-ouV8O6cp.js} +19 -19
- package/dist/chunks/Select-ouV8O6cp.js.map +1 -0
- package/dist/chunks/{SelectionPanel-Cm1qu-ZX.js → SelectionPanel-C3WzyaZV.js} +2 -2
- package/dist/chunks/{SelectionPanel-Cm1qu-ZX.js.map → SelectionPanel-C3WzyaZV.js.map} +1 -1
- package/dist/chunks/{Slider-Cl5RCeZ7.js → Slider-DSrlMEq8.js} +19 -19
- package/dist/chunks/Slider-DSrlMEq8.js.map +1 -0
- package/dist/chunks/{StatusBar-Ca9Dvhhq.js → StatusBar-BEOfOX0D.js} +6 -6
- package/dist/chunks/StatusBar-BEOfOX0D.js.map +1 -0
- package/dist/chunks/{SwatchStrip-Cw0l8Om7.js → SwatchStrip-Bi9iPLoh.js} +2 -2
- package/dist/chunks/{SwatchStrip-Cw0l8Om7.js.map → SwatchStrip-Bi9iPLoh.js.map} +1 -1
- package/dist/chunks/{Timeline-pqnYk5cV.js → Timeline-sMCH2fah.js} +99 -84
- package/dist/chunks/Timeline-sMCH2fah.js.map +1 -0
- package/dist/chunks/{TokenPanel-DAkL6vwQ.js → TokenPanel-WtKGY2Db.js} +29 -29
- package/dist/chunks/TokenPanel-WtKGY2Db.js.map +1 -0
- package/dist/chunks/{ToolOptionsBar-COsTJ1cu.js → ToolOptionsBar-CZTYPoC2.js} +2 -2
- package/dist/chunks/{ToolOptionsBar-COsTJ1cu.js.map → ToolOptionsBar-CZTYPoC2.js.map} +1 -1
- package/dist/chunks/{createKeyframeLayer-BTa4LyJE.js → createKeyframeLayer-DSVf13Su.js} +2 -2
- package/dist/chunks/{createKeyframeLayer-BTa4LyJE.js.map → createKeyframeLayer-DSVf13Su.js.map} +1 -1
- package/dist/chunks/field.module-B27pWv0i.js +15 -0
- package/dist/chunks/{field.module-Bh7BTKMh.js.map → field.module-B27pWv0i.js.map} +1 -1
- package/dist/chunks/{model-B1-gMBIW.js → model-qsAFK7_0.js} +2 -2
- package/dist/chunks/{model-B1-gMBIW.js.map → model-qsAFK7_0.js.map} +1 -1
- package/dist/components/BandEditor/index.js +1 -1
- package/dist/components/ColorField/index.js +1 -1
- package/dist/components/ComboBox/index.js +1 -1
- package/dist/components/CurveEditor/index.js +2 -2
- package/dist/components/DataGrid/DataGrid.d.ts +3 -0
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -1
- package/dist/components/DetailList/DetailList.d.ts +1 -1
- package/dist/components/DetailList/DetailList.d.ts.map +1 -1
- package/dist/components/DetailList/index.js +1 -1
- package/dist/components/DetentSlider/index.js +1 -1
- package/dist/components/FallthroughDiagram/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts +5 -2
- package/dist/components/FillStrokeSwatch/FillStrokeSwatch.d.ts.map +1 -1
- package/dist/components/FillStrokeSwatch/index.js +1 -1
- package/dist/components/FontFamilySelect/index.js +1 -1
- package/dist/components/FontWeightSelect/index.js +1 -1
- package/dist/components/GradientEditor/index.js +1 -1
- package/dist/components/InlineRange/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/Jog/index.js +1 -1
- package/dist/components/LayerList/index.js +1 -1
- package/dist/components/ListEditor/index.js +1 -1
- package/dist/components/MenuButton/index.js +1 -1
- package/dist/components/MeshEditor/index.js +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/PaintField/index.js +1 -1
- package/dist/components/PaintInput/index.js +1 -1
- package/dist/components/PatternPicker/index.js +1 -1
- package/dist/components/Plot2D/index.js +1 -1
- package/dist/components/PointPlotter/index.js +1 -1
- package/dist/components/Prefs/PrefsForm.d.ts +14 -0
- package/dist/components/Prefs/PrefsForm.d.ts.map +1 -1
- package/dist/components/Prefs/PrefsRow.d.ts +4 -0
- package/dist/components/Prefs/PrefsRow.d.ts.map +1 -1
- package/dist/components/Prefs/index.js +1 -1
- package/dist/components/Properties/PropertyField.d.ts.map +1 -1
- package/dist/components/Properties/PropertyPanel.d.ts +18 -1
- package/dist/components/Properties/PropertyPanel.d.ts.map +1 -1
- package/dist/components/Properties/index.d.ts +2 -2
- package/dist/components/Properties/index.d.ts.map +1 -1
- package/dist/components/Properties/index.js +3 -3
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/RangeSlider/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionPanel/index.js +2 -2
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/StatusBar/StatusBar.d.ts +1 -1
- package/dist/components/StatusBar/index.js +1 -1
- package/dist/components/SwatchStrip/index.js +1 -1
- package/dist/components/Timeline/Transport.d.ts.map +1 -1
- package/dist/components/Timeline/index.js +1 -1
- package/dist/components/TokenPanel/index.js +1 -1
- package/dist/components/ToolOptionsBar/index.js +1 -1
- package/dist/index.js +75 -75
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/dist/chunks/BandEditor-Dd0egAgE.js.map +0 -1
- package/dist/chunks/ColorField-BLs9fbeq.js.map +0 -1
- package/dist/chunks/ComboBox-CuTLRmUg.js.map +0 -1
- package/dist/chunks/DataGrid-BklgBqS0.js.map +0 -1
- package/dist/chunks/DetailList-DFtqdOJj.js +0 -52
- package/dist/chunks/DetailList-DFtqdOJj.js.map +0 -1
- package/dist/chunks/FallthroughDiagram-C7BUe8eU.js.map +0 -1
- package/dist/chunks/FillStrokeSwatch-CgsYQgew.js.map +0 -1
- package/dist/chunks/InlineRange-P01ABSzo.js.map +0 -1
- package/dist/chunks/Jog-DfNUYejm.js.map +0 -1
- package/dist/chunks/NumberField-DLXXgh48.js.map +0 -1
- package/dist/chunks/Plot2D-BHNbgCAl.js.map +0 -1
- package/dist/chunks/Prefs-CkyldX-e.js.map +0 -1
- package/dist/chunks/PropertyField-CV_Gw57S.js.map +0 -1
- package/dist/chunks/RangeSlider-BxokZViJ.js.map +0 -1
- package/dist/chunks/Select-BppLsJTz.js.map +0 -1
- package/dist/chunks/Slider-Cl5RCeZ7.js.map +0 -1
- package/dist/chunks/StatusBar-Ca9Dvhhq.js.map +0 -1
- package/dist/chunks/Timeline-pqnYk5cV.js.map +0 -1
- package/dist/chunks/TokenPanel-DAkL6vwQ.js.map +0 -1
- package/dist/chunks/field.module-Bh7BTKMh.js +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./Dialog-DKfsk5VN.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as r } from "./Input-
|
|
2
|
+
import { c as t, t as n } from "./PropertyField-BbNqK8xr.js";
|
|
3
|
+
import { t as r } from "./Input-D7SDKbST.js";
|
|
4
4
|
import { t as i } from "./useRovingTabIndex-D7u22Ia_.js";
|
|
5
5
|
import { a, n as o, o as s, r as c, s as l, t as u } from "./prefField-BE_Ytr2H.js";
|
|
6
6
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
@@ -67,63 +67,69 @@ function S() {
|
|
|
67
67
|
return typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
68
68
|
}
|
|
69
69
|
var C = {
|
|
70
|
-
columns: "
|
|
71
|
-
column: "
|
|
72
|
-
panel: "
|
|
73
|
-
subpanel: "
|
|
74
|
-
groupHeader: "
|
|
75
|
-
groupTitle: "
|
|
76
|
-
groupDesc: "
|
|
77
|
-
rows: "
|
|
78
|
-
row: "
|
|
79
|
-
rowControl: "
|
|
80
|
-
unrenderable: "
|
|
81
|
-
titleRow: "
|
|
82
|
-
objectLeaf: "
|
|
83
|
-
objectRow: "
|
|
84
|
-
objectGroup: "
|
|
85
|
-
columnsLayout: "
|
|
86
|
-
railLayout: "
|
|
87
|
-
railBody: "
|
|
88
|
-
rail: "
|
|
89
|
-
railList: "
|
|
90
|
-
railItem: "
|
|
91
|
-
railSub: "
|
|
92
|
-
railOpen: "
|
|
93
|
-
railInView: "
|
|
94
|
-
railName: "
|
|
95
|
-
railCount: "
|
|
96
|
-
pane: "
|
|
97
|
-
paneHead: "
|
|
98
|
-
paneTitle: "
|
|
99
|
-
paneDesc: "
|
|
100
|
-
paneSection: "
|
|
101
|
-
paneSubsection: "
|
|
102
|
-
sectionTitle: "
|
|
103
|
-
subsectionTitle: "
|
|
104
|
-
filter: "
|
|
105
|
-
noMatches: "
|
|
106
|
-
clearFilter: "
|
|
70
|
+
columns: "_columns_1u8b6_5",
|
|
71
|
+
column: "_column_1u8b6_5",
|
|
72
|
+
panel: "_panel_1u8b6_23",
|
|
73
|
+
subpanel: "_subpanel_1u8b6_34",
|
|
74
|
+
groupHeader: "_groupHeader_1u8b6_46",
|
|
75
|
+
groupTitle: "_groupTitle_1u8b6_59",
|
|
76
|
+
groupDesc: "_groupDesc_1u8b6_68",
|
|
77
|
+
rows: "_rows_1u8b6_75",
|
|
78
|
+
row: "_row_1u8b6_75",
|
|
79
|
+
rowControl: "_rowControl_1u8b6_90",
|
|
80
|
+
unrenderable: "_unrenderable_1u8b6_97",
|
|
81
|
+
titleRow: "_titleRow_1u8b6_104",
|
|
82
|
+
objectLeaf: "_objectLeaf_1u8b6_118",
|
|
83
|
+
objectRow: "_objectRow_1u8b6_126",
|
|
84
|
+
objectGroup: "_objectGroup_1u8b6_133",
|
|
85
|
+
columnsLayout: "_columnsLayout_1u8b6_148",
|
|
86
|
+
railLayout: "_railLayout_1u8b6_155",
|
|
87
|
+
railBody: "_railBody_1u8b6_168",
|
|
88
|
+
rail: "_rail_1u8b6_155",
|
|
89
|
+
railList: "_railList_1u8b6_208",
|
|
90
|
+
railItem: "_railItem_1u8b6_214",
|
|
91
|
+
railSub: "_railSub_1u8b6_238",
|
|
92
|
+
railOpen: "_railOpen_1u8b6_242",
|
|
93
|
+
railInView: "_railInView_1u8b6_248",
|
|
94
|
+
railName: "_railName_1u8b6_252",
|
|
95
|
+
railCount: "_railCount_1u8b6_261 _numeric_zns9n_4",
|
|
96
|
+
pane: "_pane_1u8b6_23",
|
|
97
|
+
paneHead: "_paneHead_1u8b6_275",
|
|
98
|
+
paneTitle: "_paneTitle_1u8b6_282",
|
|
99
|
+
paneDesc: "_paneDesc_1u8b6_289",
|
|
100
|
+
paneSection: "_paneSection_1u8b6_296",
|
|
101
|
+
paneSubsection: "_paneSubsection_1u8b6_303",
|
|
102
|
+
sectionTitle: "_sectionTitle_1u8b6_312",
|
|
103
|
+
subsectionTitle: "_subsectionTitle_1u8b6_330",
|
|
104
|
+
filter: "_filter_1u8b6_356",
|
|
105
|
+
noMatches: "_noMatches_1u8b6_360",
|
|
106
|
+
clearFilter: "_clearFilter_1u8b6_374"
|
|
107
107
|
};
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/Prefs/PrefsRow.tsx
|
|
110
110
|
function w({ ctx: e, path: n, pref: r }) {
|
|
111
|
-
let i = s(e.values, n), a = {
|
|
111
|
+
let i = s(e.values, n), a = e.auto?.has(n) ?? !1, { onAutoChange: o } = e, c = o !== void 0 && (e.canInherit?.(n) ?? !0), l = (e) => {
|
|
112
|
+
c && o(n, e);
|
|
113
|
+
}, u = {
|
|
112
114
|
path: n,
|
|
113
115
|
pref: r,
|
|
114
116
|
value: i === void 0 ? r.default : i,
|
|
115
117
|
setValue: (t) => e.onChange(n, t),
|
|
116
|
-
auto:
|
|
117
|
-
setAuto:
|
|
118
|
-
},
|
|
119
|
-
return
|
|
118
|
+
auto: a,
|
|
119
|
+
setAuto: l
|
|
120
|
+
}, p = e.renderers?.[r.kind], m = p ? p(u) : T(u);
|
|
121
|
+
return p && m === null ? null : r.block ? /* @__PURE__ */ f(d, { children: m }) : /* @__PURE__ */ f(t, {
|
|
120
122
|
label: r.name,
|
|
121
123
|
description: r.description,
|
|
122
124
|
layout: "inline",
|
|
123
125
|
className: C.row,
|
|
126
|
+
auto: a,
|
|
127
|
+
autoControl: "dimmed",
|
|
128
|
+
onAutoChange: c ? l : void 0,
|
|
129
|
+
hint: a ? e.inheritHint?.(n) : void 0,
|
|
124
130
|
children: /* @__PURE__ */ f("span", {
|
|
125
131
|
className: C.rowControl,
|
|
126
|
-
children:
|
|
132
|
+
children: m
|
|
127
133
|
})
|
|
128
134
|
});
|
|
129
135
|
}
|
|
@@ -318,48 +324,52 @@ function A(e) {
|
|
|
318
324
|
//#endregion
|
|
319
325
|
//#region src/components/Prefs/PrefsForm.tsx
|
|
320
326
|
function j(e) {
|
|
321
|
-
let { schema: t, values: n, onChange: i, renderers: a, showHidden: s = !1, layout: u = "columns", filterable: d = !1,
|
|
327
|
+
let { schema: t, values: n, onChange: i, renderers: a, showHidden: s = !1, layout: u = "columns", filterable: d = !1, auto: m, onAutoChange: h, canInherit: _, inheritHint: y, className: b } = e, [x, S] = v(""), T = g(() => {
|
|
322
328
|
let e = l(t, s);
|
|
323
|
-
return e === null ? null : o(e,
|
|
329
|
+
return e === null ? null : o(e, x);
|
|
324
330
|
}, [
|
|
325
331
|
t,
|
|
326
332
|
s,
|
|
327
|
-
|
|
328
|
-
]),
|
|
333
|
+
x
|
|
334
|
+
]), E = {
|
|
329
335
|
values: n,
|
|
330
336
|
onChange: i,
|
|
331
|
-
renderers: a
|
|
332
|
-
|
|
337
|
+
renderers: a,
|
|
338
|
+
auto: m,
|
|
339
|
+
onAutoChange: h,
|
|
340
|
+
canInherit: _,
|
|
341
|
+
inheritHint: y
|
|
342
|
+
}, D = d ? /* @__PURE__ */ f("div", {
|
|
333
343
|
className: C.filter,
|
|
334
344
|
children: /* @__PURE__ */ f(r, {
|
|
335
|
-
value:
|
|
336
|
-
onChange:
|
|
345
|
+
value: x,
|
|
346
|
+
onChange: S,
|
|
337
347
|
"aria-label": `Filter ${t.name}`,
|
|
338
348
|
placeholder: "Filter settings"
|
|
339
349
|
})
|
|
340
350
|
}) : null;
|
|
341
351
|
return u === "rail" ? /* @__PURE__ */ f(M, {
|
|
342
352
|
...e,
|
|
343
|
-
root:
|
|
344
|
-
ctx:
|
|
345
|
-
query:
|
|
346
|
-
filterField:
|
|
347
|
-
onClearFilter: () =>
|
|
353
|
+
root: T,
|
|
354
|
+
ctx: E,
|
|
355
|
+
query: x,
|
|
356
|
+
filterField: D,
|
|
357
|
+
onClearFilter: () => S("")
|
|
348
358
|
}) : /* @__PURE__ */ p("div", {
|
|
349
|
-
className: [C.columnsLayout,
|
|
350
|
-
children: [
|
|
351
|
-
query:
|
|
352
|
-
onClear: () =>
|
|
359
|
+
className: [C.columnsLayout, b].filter(Boolean).join(" "),
|
|
360
|
+
children: [D, T === null ? /* @__PURE__ */ f(I, {
|
|
361
|
+
query: x,
|
|
362
|
+
onClear: () => S("")
|
|
353
363
|
}) : /* @__PURE__ */ f("div", {
|
|
354
364
|
className: C.columns,
|
|
355
|
-
children: Object.entries(
|
|
365
|
+
children: Object.entries(T.children).map(([e, t]) => /* @__PURE__ */ f("div", {
|
|
356
366
|
className: C.column,
|
|
357
367
|
children: c(t) ? /* @__PURE__ */ f(w, {
|
|
358
|
-
ctx:
|
|
368
|
+
ctx: E,
|
|
359
369
|
path: e,
|
|
360
370
|
pref: t
|
|
361
371
|
}) : /* @__PURE__ */ f(L, {
|
|
362
|
-
ctx:
|
|
372
|
+
ctx: E,
|
|
363
373
|
group: t,
|
|
364
374
|
path: e,
|
|
365
375
|
depth: 0
|
|
@@ -498,4 +508,4 @@ function R(t) {
|
|
|
498
508
|
//#endregion
|
|
499
509
|
export { y as a, O as i, j as n, x as o, A as r, R as t };
|
|
500
510
|
|
|
501
|
-
//# sourceMappingURL=Prefs-
|
|
511
|
+
//# sourceMappingURL=Prefs-C4MZ28SX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prefs-C4MZ28SX.js","names":["_Fragment","s","s","s","s","s","Dialog","PropertyRow","PropertyControl","Input","useRovingTabIndex","filterPrefSubtree","prefValueAtPath","isPrefLeaf","visiblePrefSubtree","prefFieldProps","pickActiveSection","active","offsets","top","slack","id","SETTLE_MS","useScrollSpy","options","setActive","useState","heldRef","useRef","timerRef","releaseRef","key","ids","measure","useCallback","root","rootRef","rootTop","el","scrollTo","release","prefersReducedMotion","useEffect","Prefs_module_default","PrefRow","stored","ctx","path","inherited","toggles","onAutoChange","setAuto","next","renderCtx","pref","v","custom","control","renderBuiltin","Fragment","ObjectLeaf","field","settledOnly","held","value","objectRows","out","child","children","inner","base","PrefsPane","props","leaves","group","entry","groups","childPath","className","scrollRef","leaf","PaneSection","Heading","depth","p","PrefsRail","activate","item","items","index","onOpen","onScrollTo","roving","i","section","ariaLabel","header","open","inView","current","showCounts","PrefsForm","query","setQuery","useMemo","visible","schema","showHidden","filterable","layout","RailLayout","NoMatches","GroupBody","prefRailItems","uncontrolled","setUncontrolled","subPages","requested","hasLeaves","paneGroup","spy","setOpen","whole","opensTop","leavesOf","filterField","onClearFilter","rootName","node","cursor","seg","onClear","PrefsDialog","form","rail","title","dialogClassName","headerExtra"],"sources":["../../src/useScrollSpy.ts","../../src/components/Prefs/Prefs.module.css","../../src/components/Prefs/PrefsRow.tsx","../../src/components/Prefs/PrefsPane.tsx","../../src/components/Prefs/PrefsRail.tsx","../../src/components/Prefs/PrefsForm.tsx","../../src/components/Prefs/PrefsDialog.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState, type RefObject } from 'react';\n\n/** One observed section: its id and its top edge, in the container's\n * coordinates (its `getBoundingClientRect().top` less the container's). */\nexport interface SectionOffset {\n id: string;\n top: number;\n}\n\n/**\n * The section a reader is looking at: the last one whose top edge has passed\n * the container's, within `slack` of it so a heading flush with the top counts\n * as arrived. Null until one has — the settings above the first section belong\n * to the group itself, and marking a section the reader has not reached yet\n * points them at the wrong place.\n *\n * Offsets arrive in document order and are not re-sorted — a caller reading\n * them off the DOM already has them that way, and sorting would hide a\n * measurement that came back wrong.\n */\nexport function pickActiveSection(\n offsets: readonly SectionOffset[],\n slack = 8,\n): string | null {\n let active: string | null = null;\n for (const { id, top } of offsets) {\n if (top - slack > 0) break;\n active = id;\n }\n return active;\n}\n\n/** Options for {@link useScrollSpy}. */\nexport interface UseScrollSpyOptions {\n /** The scrolling element holding the sections. */\n rootRef: RefObject<HTMLElement | null>;\n /** Section element ids, in document order. */\n ids: readonly string[];\n /** Pixels of tolerance at the container's top edge. */\n slack?: number;\n}\n\n/** What {@link useScrollSpy} returns. */\nexport interface ScrollSpy {\n /** Id of the section in view, or null before anything is measured. */\n active: string | null;\n /**\n * Scroll `id` to the container's top and hold that answer until the scroll\n * settles. Without the hold, the scroll the click causes is observed on its\n * way past every intervening section and the rail flickers through them.\n */\n scrollTo: (id: string) => void;\n}\n\n/** How long to keep a programmatic scroll's answer when `scrollend` never\n * arrives — Safari and Firefox have not shipped it. Comfortably longer than a\n * smooth scroll, short enough that a reader who then scrolls by hand is not\n * left looking at a stale highlight. */\nconst SETTLE_MS = 700;\n\n/**\n * Which of a scrolling container's sections is in view, for a navigation rail\n * that follows the reader. Positions are read on the container's own `scroll`\n * event — already throttled to the frame by the browser — rather than through\n * `IntersectionObserver`, so the decision stays a pure function of measured\n * offsets ({@link pickActiveSection}) and is testable apart from the DOM.\n */\nexport function useScrollSpy(options: UseScrollSpyOptions): ScrollSpy {\n const { rootRef, ids, slack } = options;\n const [active, setActive] = useState<string | null>(null);\n // Set while a programmatic scroll runs: what to report, instead of what the\n // moving container would say.\n const heldRef = useRef<string | null>(null);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const releaseRef = useRef<(() => void) | null>(null);\n const key = ids.join('\\u0000');\n\n const measure = useCallback((): void => {\n const root = rootRef.current;\n if (!root) return;\n if (heldRef.current !== null) {\n setActive(heldRef.current);\n return;\n }\n const rootTop = root.getBoundingClientRect().top;\n const offsets: SectionOffset[] = [];\n for (const id of ids) {\n const el = root.querySelector<HTMLElement>(`[data-spy-section=\"${CSS.escape(id)}\"]`);\n if (el) offsets.push({ id, top: el.getBoundingClientRect().top - rootTop });\n }\n setActive(pickActiveSection(offsets, slack));\n // `ids` is compared by content through `key`: a caller deriving the array\n // each render would otherwise resubscribe on every one.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [rootRef, key, slack]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) return;\n measure();\n root.addEventListener('scroll', measure, { passive: true });\n return () => root.removeEventListener('scroll', measure);\n }, [rootRef, measure]);\n\n const scrollTo = useCallback((id: string): void => {\n const root = rootRef.current;\n if (!root) return;\n const el = root.querySelector<HTMLElement>(`[data-spy-section=\"${CSS.escape(id)}\"]`);\n heldRef.current = id;\n setActive(id);\n const release = (): void => {\n heldRef.current = null;\n root.removeEventListener('scrollend', release);\n measure();\n };\n // A scroll interrupted by the next one would otherwise leave its\n // `scrollend` listener behind to fire against a later scroll.\n releaseRef.current?.();\n if (timerRef.current !== null) clearTimeout(timerRef.current);\n releaseRef.current = release;\n timerRef.current = setTimeout(release, SETTLE_MS);\n root.addEventListener('scrollend', release);\n if (!el) return;\n const top = el.getBoundingClientRect().top - root.getBoundingClientRect().top + root.scrollTop;\n root.scrollTo?.({ top, behavior: prefersReducedMotion() ? 'auto' : 'smooth' });\n }, [rootRef, measure]);\n\n useEffect(() => () => {\n if (timerRef.current !== null) clearTimeout(timerRef.current);\n releaseRef.current?.();\n }, []);\n\n return { active, scrollTo };\n}\n\nfunction prefersReducedMotion(): boolean {\n return typeof matchMedia === 'function'\n && matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n","/* Ported from WeaselDraw's wd-prefs-* rules (apps/draw/src/app.css),\n * generalized onto theme tokens. Column width is overridable via\n * --wzl-prefs-column-width at any ancestor scope. */\n\n.columns {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: var(--wzl-space-6);\n overflow-y: auto;\n padding-right: var(--wzl-space-2);\n}\n\n.column {\n flex: 0 0 var(--wzl-prefs-column-width, 300px);\n width: var(--wzl-prefs-column-width, 300px);\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n}\n\n.panel {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n padding: var(--wzl-space-5);\n background: var(--wzl-surface-sunken);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n --wzl-input-surface: var(--wzl-surface);\n}\n\n.subpanel {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n margin-top: var(--wzl-space-3);\n padding: var(--wzl-space-4) var(--wzl-space-4) var(--wzl-space-4) var(--wzl-space-5);\n background: var(--wzl-surface-sunken);\n border-left: 2px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n --wzl-input-surface: var(--wzl-surface);\n}\n\n.groupHeader {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-1);\n padding-bottom: var(--wzl-space-2);\n border-bottom: 1px solid var(--wzl-border);\n}\n\n.subpanel .groupHeader {\n border-bottom: none;\n padding-bottom: var(--wzl-space-1);\n}\n\n.groupTitle {\n margin: 0;\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n color: var(--wzl-fg);\n letter-spacing: var(--wzl-params-label-tracking, var(--wzl-tracking-wider));\n text-transform: var(--wzl-params-label-case, uppercase);\n}\n\n.groupDesc {\n margin: 0;\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n line-height: 1.35;\n}\n\n.rows {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n}\n\n/* A leaf's row is a PropertyRow, inline; this only sets the form's type. */\n.row {\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg);\n cursor: default;\n}\n\n/* Control slot — fixed width so the label can take the rest of the row.\n * Kit form controls render as block-level flex columns that fill it. */\n.rowControl {\n flex: 0 0 110px;\n min-width: 0;\n display: flex;\n align-items: center;\n}\n\n.unrenderable {\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n}\n\n/* PrefsDialog header row: title text + optional headerExtra chrome. */\n.titleRow {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-6);\n flex: 1;\n min-width: 0;\n}\n\n.titleRow > span:first-child {\n flex: 1;\n min-width: 0;\n}\n\n/* An object leaf renders its fields as its own rows. */\n.objectLeaf {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n inline-size: 100%;\n}\n\n/* Outranks the PropertyRow it styles, which is a flex row. */\n.objectLeaf .objectRow {\n display: grid;\n grid-template-columns: 96px 1fr;\n gap: var(--wzl-space-4);\n align-items: center;\n}\n\n.objectGroup {\n margin: var(--wzl-space-2) 0 0;\n font-size: var(--wzl-font-size-xs);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: var(--wzl-params-label-case, uppercase);\n letter-spacing: var(--wzl-params-label-tracking, var(--wzl-tracking-wide));\n opacity: 0.55;\n}\n\n/* ---------------------------------------------------------------------------\n * Rail layout. The rail is the only chrome: no panels, because the surface\n * the form sits on already has a border and a card inside it restates one.\n * Width is overridable via --wzl-prefs-rail-width at any ancestor scope.\n * ------------------------------------------------------------------------ */\n\n.columnsLayout {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-4);\n min-height: 0;\n}\n\n.railLayout {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n min-height: 0;\n block-size: 100%;\n /* The pane scrolls, not the layout: a rail that scrolled away with the\n settings would be useless exactly when it is needed. */\n overflow: hidden;\n}\n\n/* What `PrefsDialog` hands `Dialog` for its body in rail layout: the pane\n inside does the scrolling and the rail meets the dialog's own edges. */\n.railBody {\n padding: 0;\n overflow: hidden;\n /* The modal sets only `max-height`, so the layout's `block-size: 100%`\n resolves against nothing and the pane grows to fit every row. As a flex\n item the layout takes the body's flexed height, which the cap does bound. */\n display: flex;\n flex-direction: column;\n /* A settled height: without one the dialog grows and shrinks as the reader\n moves between a two-row group and a twenty-row one, and the rail entry\n they are aiming at moves while they aim at it. */\n min-block-size: min(60vh, 420px);\n /* Same reason across: a filter that narrows the schema to two rows should\n not pull the dialog's edges in around them. */\n min-inline-size: min(760px, 90vw);\n}\n\n.railBody > .railLayout {\n flex: 1 1 auto;\n}\n\n.rail {\n /* Never more than two fifths of the box: at its full width in a narrow\n container the rail takes the space the settings need and leaves a pane\n too thin to hold a row. The clamp belongs on the flex basis — an\n `inline-size` here is simply ignored, which is what made a first attempt\n at this look right and do nothing. */\n flex: 0 1 min(var(--wzl-prefs-rail-width, 216px), 40%);\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-2);\n padding: var(--wzl-space-3) var(--wzl-space-2);\n background: var(--wzl-surface-sunken);\n border-right: 1px solid var(--wzl-border);\n overflow-y: auto;\n /* The rail is itself sunken, so a field taking the default surface would be\n the same color as the rail behind it. */\n --wzl-input-surface: var(--wzl-surface);\n}\n\n.railList {\n display: flex;\n flex-direction: column;\n gap: 1px;\n}\n\n.railItem {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-2);\n padding: var(--wzl-space-2) var(--wzl-space-3);\n border: none;\n border-radius: var(--wzl-radius-sm);\n background: none;\n color: var(--wzl-fg);\n font: inherit;\n font-size: var(--wzl-font-size-sm);\n text-align: start;\n cursor: default;\n}\n\n.railItem:hover {\n background: var(--wzl-surface-raised);\n}\n\n.railItem:focus-visible {\n outline: 2px solid var(--wzl-focus-ring);\n outline-offset: -2px;\n}\n\n.railSub {\n padding-left: var(--wzl-space-7);\n}\n\n.railOpen,\n.railOpen:hover {\n background: var(--wzl-accent);\n color: var(--wzl-fg-on-accent);\n}\n\n.railInView {\n box-shadow: inset 2px 0 0 var(--wzl-accent);\n}\n\n.railName {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Last in the row: a count that changes as the reader types would otherwise\n shove the name on every keystroke. */\n.railCount {\n composes: numeric from '@weasel-js/theme/numeric.module.css';\n margin-left: auto;\n font-size: var(--wzl-font-size-xs);\n opacity: 0.6;\n}\n\n.pane {\n flex: 1;\n min-width: 0;\n overflow-y: auto;\n padding: var(--wzl-space-5) var(--wzl-space-6);\n}\n\n.paneHead {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-1);\n margin-bottom: var(--wzl-space-5);\n}\n\n.paneTitle {\n margin: 0;\n font-size: var(--wzl-font-size-lg);\n font-weight: var(--wzl-font-weight-medium);\n color: var(--wzl-fg);\n}\n\n.paneDesc {\n margin: 0;\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n line-height: 1.35;\n}\n\n.paneSection {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-3);\n margin-top: var(--wzl-space-6);\n}\n\n.paneSubsection {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-2);\n margin-top: var(--wzl-space-4);\n padding-left: var(--wzl-space-4);\n border-left: 2px solid var(--wzl-border);\n}\n\n.sectionTitle {\n position: sticky;\n /* Sticky offsets are measured from the scrollport's edge, not from inside\n the pane's padding, so this is 0 and the heading's own padding is what\n keeps the text off the edge. */\n top: 0;\n z-index: 1;\n margin: 0;\n padding: var(--wzl-space-3) 0 var(--wzl-space-2);\n background: var(--wzl-surface);\n border-bottom: 1px solid var(--wzl-border);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-bold);\n color: var(--wzl-fg-subtle);\n letter-spacing: var(--wzl-params-label-tracking, var(--wzl-tracking-wider));\n text-transform: var(--wzl-params-label-case, uppercase);\n}\n\n.subsectionTitle {\n margin: 0;\n font-size: var(--wzl-font-size-xs);\n font-weight: var(--wzl-font-weight-bold);\n color: var(--wzl-fg-subtle);\n letter-spacing: var(--wzl-params-label-tracking, var(--wzl-tracking-wide));\n text-transform: var(--wzl-params-label-case, uppercase);\n}\n\n/* In the rail layout a row is a grid, so the control track grows with the\n pane instead of holding at the columns layout's fixed slot. */\n.railLayout .row {\n display: grid;\n /* The control track is capped rather than taking the rest: a number field\n as wide as the pane reads as a text area, and every row's control starts\n at the same x either way. */\n grid-template-columns:\n minmax(140px, var(--wzl-params-label-width, 240px))\n minmax(180px, 260px);\n align-items: center;\n}\n\n.railLayout .rowControl {\n flex: 1 1 auto;\n}\n\n.filter {\n padding: 0 var(--wzl-space-1) var(--wzl-space-2);\n}\n\n.noMatches {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--wzl-space-3);\n padding: var(--wzl-space-6) 0;\n font-size: var(--wzl-font-size-sm);\n color: var(--wzl-fg-subtle);\n}\n\n.noMatches p {\n margin: 0;\n}\n\n.clearFilter {\n padding: var(--wzl-space-1) var(--wzl-space-3);\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n background: var(--wzl-surface-raised);\n color: var(--wzl-fg);\n font: inherit;\n font-size: var(--wzl-font-size-sm);\n}\n","import { type ReactNode } from 'react';\nimport { PropertyControl } from '../Properties/PropertyField';\nimport { PropertyRow } from '../Properties/PropertyPanel';\nimport { prefFieldProps } from './prefField';\nimport {\n isPrefLeaf,\n prefValueAtPath,\n type PrefGroup,\n type PrefLeaf,\n type PrefObject,\n} from './schema';\nimport s from './Prefs.module.css';\n\n/** What a {@link PrefRenderer} is given for the leaf it is rendering. */\nexport interface PrefRenderContext {\n /** Dotted path of the leaf within the schema root. */\n path: string;\n /** The schema node. App renderers narrow this to their own kind shape. */\n pref: PrefLeaf;\n /** Current value — `values` at `path`, falling back to `pref.default`. */\n value: unknown;\n setValue: (value: unknown) => void;\n /** Whether this leaf is currently auto — not pinned, computed by the owner. */\n auto: boolean;\n /** Toggle this leaf's auto state. */\n setAuto: (next: boolean) => void;\n}\n\n/**\n * Renders the control cell for one preference leaf. Returning `null`\n * collapses the row.\n */\nexport type PrefRenderer = (ctx: PrefRenderContext) => ReactNode;\n\nexport interface WalkCtx {\n values: unknown;\n onChange: (path: string, value: unknown) => void;\n renderers?: Record<string, PrefRenderer>;\n auto?: ReadonlySet<string>;\n onAutoChange?: (path: string, next: boolean) => void;\n inheritHint?: (path: string) => string | undefined;\n canInherit?: (path: string) => boolean;\n}\n\nexport function PrefRow({ ctx, path, pref }: { ctx: WalkCtx; path: string; pref: PrefLeaf }) {\n const stored = prefValueAtPath(ctx.values, path);\n const inherited = ctx.auto?.has(path) ?? false;\n const { onAutoChange } = ctx;\n const toggles = onAutoChange !== undefined && (ctx.canInherit?.(path) ?? true);\n const setAuto = (next: boolean): void => {\n if (toggles) onAutoChange(path, next);\n };\n const renderCtx: PrefRenderContext = {\n path,\n pref,\n value: stored !== undefined ? stored : pref.default,\n setValue: (v) => ctx.onChange(path, v),\n auto: inherited,\n setAuto,\n };\n\n const custom = ctx.renderers?.[pref.kind];\n const control = custom ? custom(renderCtx) : renderBuiltin(renderCtx);\n if (custom && control === null) return null;\n\n // `block` leaves own their chrome (embedded editors with their own\n // header) — no label/tooltip row.\n if (pref.block) return <>{control}</>;\n\n return (\n <PropertyRow\n label={pref.name}\n description={pref.description}\n layout=\"inline\"\n className={s.row}\n // The owner passes an inherited leaf's value already resolved, so the\n // control keeps drawing it; editing it pins, through `onChange`.\n auto={inherited}\n autoControl=\"dimmed\"\n onAutoChange={toggles ? setAuto : undefined}\n hint={inherited ? ctx.inheritHint?.(path) : undefined}\n >\n <span className={s.rowControl}>{control}</span>\n </PropertyRow>\n );\n}\n\nfunction renderBuiltin(\n ctx: PrefRenderContext,\n // The object a nested leaf is a field of — what an enum `encoding` and a\n // font's weight and slant read against. Undefined for a top-level leaf.\n siblings?: Record<string, unknown>,\n): ReactNode {\n const { pref, value, setValue } = ctx;\n if (pref.kind === 'object') return <ObjectLeaf ctx={ctx} />;\n const field = prefFieldProps(pref, { value, siblings, setValue });\n if (field === null) {\n // App-defined kind with no `renderers` entry: labeled placeholder, not a\n // crash — a missing wiring should be visible and recoverable.\n return <span className={s.unrenderable}>({pref.kind}: no renderer)</span>;\n }\n switch (field.kind) {\n // A form stores what was settled on: a number once it is entered, a color\n // once its gesture ends.\n case 'number':\n return (\n <PropertyControl\n {...field}\n name={pref.name}\n onInput={settledOnly}\n steppers={field.accepts === undefined}\n />\n );\n case 'color':\n return <PropertyControl {...field} name={pref.name} onInput={settledOnly} />;\n default:\n return <PropertyControl {...field} name={pref.name} />;\n }\n}\n\nconst settledOnly = (): void => {};\n\n/** One value with its fields hanging off it: each field renders its own\n * control and commits the parent object whole. */\nfunction ObjectLeaf({ ctx }: { ctx: PrefRenderContext }) {\n const pref = ctx.pref as PrefObject;\n const { value, setValue } = ctx;\n const held = typeof value === 'object' && value !== null\n ? (value as Record<string, unknown>)\n : undefined;\n const objectRows = (children: Record<string, PrefLeaf | PrefGroup>): ReactNode[] => {\n const out: ReactNode[] = [];\n for (const [key, child] of Object.entries(children)) {\n if (!isPrefLeaf(child)) {\n const inner = objectRows(child.children);\n if (inner.length === 0) continue;\n out.push(<h4 key={`group:${key}`} className={s.objectGroup}>{child.name}</h4>, ...inner);\n continue;\n }\n out.push(\n <PropertyRow\n key={key}\n label={child.name}\n layout=\"inline\"\n className={s.objectRow}\n >\n <span className={s.rowControl}>\n {renderBuiltin({\n path: `${ctx.path}.${key}`,\n pref: child,\n value: held?.[key],\n setValue: (v) => {\n const base = held ?? pref.fromScalar?.(value) ?? {};\n setValue({ ...base, [key]: v });\n },\n // A field is not pinned on its own — it shares the state of\n // the object leaf it hangs off.\n auto: ctx.auto,\n setAuto: ctx.setAuto,\n }, held)}\n </span>\n </PropertyRow>,\n );\n }\n return out;\n };\n return <div className={s.objectLeaf}>{objectRows(pref.children)}</div>;\n}\n","import { type RefObject } from 'react';\nimport { isPrefLeaf, type PrefGroup, type PrefLeaf } from './schema';\nimport { PrefRow, type WalkCtx } from './PrefsRow';\nimport s from './Prefs.module.css';\n\n/** Props for {@link PrefsPane}. */\nexport interface PrefsPaneProps {\n ctx: WalkCtx;\n /** The open group, or a synthetic one holding the root's loose leaves. */\n group: PrefGroup;\n /** Dotted path of `group`. Empty for the loose-leaf pane. */\n path: string;\n /** The pane's scroll container, for the rail's scroll spy. */\n scrollRef: RefObject<HTMLDivElement | null>;\n className?: string;\n}\n\n/**\n * One rail section's settings: the group's own leaves, then one headed\n * section per nested group.\n *\n * Nothing here draws a panel. The rail is the layout's structure, and a card\n * inside a dialog that already has a border only restates it — the columns\n * layout's sunken panels are what this is the alternative to.\n */\nexport function PrefsPane(props: PrefsPaneProps) {\n const { ctx, group, path, scrollRef, className } = props;\n const leaves = Object.entries(group.children).filter(\n (entry): entry is [string, PrefLeaf] => isPrefLeaf(entry[1]),\n );\n const groups = Object.entries(group.children).filter(\n (entry): entry is [string, PrefGroup] => !isPrefLeaf(entry[1]),\n );\n const childPath = (key: string): string => (path === '' ? key : `${path}.${key}`);\n\n return (\n <div className={[s.pane, className].filter(Boolean).join(' ')} ref={scrollRef}>\n <div className={s.paneHead}>\n <h3 className={s.paneTitle}>{group.name}</h3>\n {group.description !== undefined && (\n <p className={s.paneDesc}>{group.description}</p>\n )}\n </div>\n {leaves.length > 0 && (\n <div className={s.rows}>\n {leaves.map(([key, leaf]) => (\n <PrefRow key={key} ctx={ctx} path={childPath(key)} pref={leaf} />\n ))}\n </div>\n )}\n {groups.map(([key, child]) => (\n <PaneSection\n key={key}\n ctx={ctx}\n group={child}\n path={childPath(key)}\n depth={0}\n />\n ))}\n </div>\n );\n}\n\n/**\n * A nested group inside a pane. Depth 0 sections are the ones the rail links\n * to and carry `data-spy-section`; deeper ones indent and are reached only by\n * scrolling, which is what keeps the rail two levels deep whatever the schema\n * does.\n */\nfunction PaneSection({ ctx, group, path, depth }: {\n ctx: WalkCtx;\n group: PrefGroup;\n path: string;\n depth: number;\n}) {\n const Heading = depth === 0 ? 'h4' : 'h5';\n return (\n <section\n className={depth === 0 ? s.paneSection : s.paneSubsection}\n data-spy-section={depth === 0 ? path : undefined}\n aria-label={group.name}\n >\n <Heading className={depth === 0 ? s.sectionTitle : s.subsectionTitle}>\n {group.name}\n </Heading>\n {group.description !== undefined && (\n <p className={s.paneDesc}>{group.description}</p>\n )}\n <div className={s.rows}>\n {Object.entries(group.children).map(([key, child]) => {\n const p = `${path}.${key}`;\n return isPrefLeaf(child) ? (\n <PrefRow key={key} ctx={ctx} path={p} pref={child} />\n ) : (\n <PaneSection key={key} ctx={ctx} group={child} path={p} depth={depth + 1} />\n );\n })}\n </div>\n </section>\n );\n}\n","import type { ReactNode } from 'react';\nimport { useRovingTabIndex } from '../../useRovingTabIndex';\nimport type { PrefRailItem } from './schema';\nimport s from './Prefs.module.css';\n\n/** Props for {@link PrefsRail}. */\nexport interface PrefsRailProps {\n items: readonly PrefRailItem[];\n /** Path of the open group: depth 0, or depth 1 under `subPages`. */\n section: string;\n /** Path of the depth-1 group in view, from the pane's scroll spy. */\n current: string | null;\n /** A depth-0 entry was chosen: open its pane. */\n onOpen: (path: string) => void;\n /** A depth-1 entry was chosen: scroll the open pane to it, or, under\n * `subPages`, open it. */\n onScrollTo: (path: string) => void;\n /** Accessible name for the rail's landmark. */\n ariaLabel: string;\n /** Rendered above the list — the filter field, when there is one. */\n header?: ReactNode;\n /** Show each entry's match count. Only meaningful while filtering. */\n showCounts?: boolean;\n}\n\n/**\n * The rail beside a `PrefsForm` pane: depth-0 groups, each followed by the\n * depth-1 groups that scroll within it.\n *\n * A list of buttons rather than a tablist, because only half of these entries\n * switch anything — the nested ones scroll the pane the selected entry already\n * opened, and a tab that does not own a panel has no honest role. The open\n * group is `aria-current=\"page\"`; the nested group in view is\n * `aria-current=\"location\"`.\n */\nexport function PrefsRail(props: PrefsRailProps) {\n const { items, section, current, onOpen, onScrollTo, ariaLabel, header, showCounts } = props;\n const activate = (index: number): void => {\n const item = items[index];\n if (!item) return;\n if (item.depth === 0) onOpen(item.path);\n else onScrollTo(item.path);\n };\n const roving = useRovingTabIndex<HTMLDivElement>({\n itemSelector: `.${s.railItem}`,\n tabStopIndex: Math.max(0, items.findIndex((i) => i.path === section)),\n });\n\n return (\n <nav className={s.rail} aria-label={ariaLabel}>\n {header}\n <div className={s.railList} ref={roving.rootRef} onKeyDown={roving.onKeyDown}>\n {items.map((item, index) => {\n const open = item.path === section;\n const inView = item.depth === 1 && item.path === current;\n return (\n <button\n key={item.path === '' ? '\\u0000root' : item.path}\n type=\"button\"\n className={[s.railItem, item.depth === 1 && s.railSub, open && s.railOpen, inView && s.railInView]\n .filter(Boolean)\n .join(' ')}\n aria-current={open ? 'page' : inView ? 'location' : undefined}\n onClick={() => activate(index)}\n >\n <span className={s.railName}>{item.name}</span>\n {showCounts ? <span className={s.railCount}>{item.matches}</span> : null}\n </button>\n );\n })}\n </div>\n </nav>\n );\n}\n","import { useMemo, useRef, useState, type ReactNode } from 'react';\nimport { Input } from '../Input';\nimport { useScrollSpy } from '../../useScrollSpy';\nimport {\n filterPrefSubtree,\n isPrefLeaf,\n prefRailItems,\n visiblePrefSubtree,\n type PrefGroup,\n} from './schema';\nimport { PrefRow, type PrefRenderer, type WalkCtx } from './PrefsRow';\nimport { PrefsPane } from './PrefsPane';\nimport { PrefsRail } from './PrefsRail';\nimport s from './Prefs.module.css';\n\nexport type { PrefRenderer, PrefRenderContext } from './PrefsRow';\n\n/** How a {@link PrefsForm} lays its groups out. */\nexport type PrefsLayout = 'columns' | 'rail';\n\n/** Props for {@link PrefsForm}. */\nexport interface PrefsFormProps {\n /** Root of the schema tree. Core `ToolPrefGroup`s assign structurally. */\n schema: PrefGroup;\n /** Nested value tree (shape mirrors the schema). Sparse is fine —\n * missing leaves fall back to their schema `default`. */\n values?: unknown;\n /** Change callback with the leaf's dotted path. Values apply live;\n * there is no dirty/commit state. */\n onChange: (path: string, value: unknown) => void;\n /**\n * Per-kind renderers for app-defined kinds. Entries also override the\n * built-in kinds when keys collide. A renderer owns the control cell\n * (the label/tooltip row chrome stays with the form, unless the leaf\n * sets `block`); returning `null` collapses the row entirely. Unknown\n * kinds with no renderer show a labeled placeholder instead of\n * crashing.\n */\n renderers?: Record<string, PrefRenderer>;\n /** Reveal `hidden` leaves (dev tooling). Default false. */\n showHidden?: boolean;\n /**\n * `'columns'` (the default) wraps each top-level group into its own panel\n * column. `'rail'` puts a two-level navigation rail beside one group's\n * settings at a time — what a dialog-sized surface wants, since columns\n * overflow sideways once there are more than two.\n */\n layout?: PrefsLayout;\n /** Show a filter field that narrows the form to matching leaves. */\n filterable?: boolean;\n /** Rail layout: path of the open top-level group. Controlled. */\n section?: string;\n /** Rail layout: path of the group open before the reader picks one.\n * Defaults to the first in the schema. */\n defaultSection?: string;\n onSectionChange?: (path: string) => void;\n /**\n * Rail layout: a nested entry opens a page of its own group instead of\n * scrolling the open one to it, and a top-level entry's page holds only its\n * own leaves (or opens its first nested entry when it has none). For a\n * top-level group whose subgroups are long enough that one page of all of\n * them reads as a wall. Default false.\n */\n subPages?: boolean;\n /** Dotted paths whose leaves currently inherit: each still draws its control,\n * dimmed, showing the value in `values` — pass it already resolved. Editing\n * it calls `onChange` as usual, which is the owner's cue to pin it. */\n auto?: ReadonlySet<string>;\n /** Given, a leaf's label toggles whether it inherits: `next` true unpins it,\n * false pins it at the value it shows. Leaves `canInherit` refuses keep a\n * plain label. */\n onAutoChange?: (path: string, next: boolean) => void;\n /** Which leaves can inherit, and so get a label toggle. Default: every leaf,\n * once `onAutoChange` is given. */\n canInherit?: (path: string) => boolean;\n /** Small text after an inherited leaf's label, e.g. `() => 'from Defaults'`.\n * Default: none. */\n inheritHint?: (path: string) => string | undefined;\n className?: string;\n}\n\n/**\n * Schema-driven preferences form. Leaves render as label + control rows;\n * how the groups around them are arranged is `layout`'s to say — columns of\n * panels, or a navigation rail beside one group at a time.\n *\n * Storage-agnostic: pair with `PrefsDialog` for the modal composition, and\n * persist however the app likes via `onChange`.\n */\nexport function PrefsForm(props: PrefsFormProps) {\n const {\n schema,\n values,\n onChange,\n renderers,\n showHidden = false,\n layout = 'columns',\n filterable = false,\n auto,\n onAutoChange,\n canInherit,\n inheritHint,\n className,\n } = props;\n const [query, setQuery] = useState('');\n const root = useMemo(() => {\n const visible = visiblePrefSubtree(schema, showHidden);\n return visible === null ? null : filterPrefSubtree(visible, query);\n }, [schema, showHidden, query]);\n\n const ctx: WalkCtx = { values, onChange, renderers, auto, onAutoChange, canInherit, inheritHint };\n const field = filterable ? (\n <div className={s.filter}>\n <Input\n value={query}\n onChange={setQuery}\n aria-label={`Filter ${schema.name}`}\n placeholder=\"Filter settings\"\n />\n </div>\n ) : null;\n\n if (layout === 'rail') {\n return (\n <RailLayout\n {...props}\n root={root}\n ctx={ctx}\n query={query}\n filterField={field}\n onClearFilter={() => setQuery('')}\n />\n );\n }\n\n return (\n <div className={[s.columnsLayout, className].filter(Boolean).join(' ')}>\n {field}\n {root === null ? (\n <NoMatches query={query} onClear={() => setQuery('')} />\n ) : (\n <div className={s.columns}>\n {Object.entries(root.children).map(([key, child]) => (\n <div key={key} className={s.column}>\n {isPrefLeaf(child) ? (\n // Top-level leaves are unusual but legal — give each its own\n // column for symmetry with grouped siblings.\n <PrefRow ctx={ctx} path={key} pref={child} />\n ) : (\n <GroupBody ctx={ctx} group={child} path={key} depth={0} />\n )}\n </div>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n/** The rail layout's own state: which group is open, and where the pane is\n * scrolled to within it. Split out so the columns layout runs none of it. */\nfunction RailLayout(props: PrefsFormProps & {\n root: PrefGroup | null;\n ctx: WalkCtx;\n query: string;\n filterField: ReactNode;\n onClearFilter: () => void;\n}) {\n const { schema, root, ctx, query, filterField, onClearFilter, className } = props;\n const items = useMemo(() => (root === null ? [] : prefRailItems(root)), [root]);\n const [uncontrolled, setUncontrolled] = useState(\n () => props.defaultSection ?? '',\n );\n const subPages = props.subPages === true;\n const requested = props.section ?? uncontrolled;\n // A filter can take the open group out of the rail entirely, and a section\n // the schema never had can arrive from a consumer's stale state. Either way\n // the first surviving entry is what the reader should be looking at.\n let open = items.some((i) => i.path === requested && (i.depth === 0 || subPages))\n ? requested\n : (items.find((i) => i.depth === 0)?.path ?? '');\n if (subPages && root !== null && !hasLeaves(paneGroup(root, open, schema.name))) {\n open = items.find((i) => i.depth === 1 && i.section === open)?.path ?? open;\n }\n\n const scrollRef = useRef<HTMLDivElement | null>(null);\n const sectionIds = useMemo(\n () =>\n subPages\n ? []\n : items.filter((i) => i.depth === 1 && i.section === open).map((i) => i.path),\n [items, open, subPages],\n );\n const spy = useScrollSpy({ rootRef: scrollRef, ids: sectionIds });\n\n const setOpen = (path: string): void => {\n if (props.section === undefined) setUncontrolled(path);\n props.onSectionChange?.(path);\n // Optional-called: jsdom's elements have no `scrollTo`, and neither does\n // a pane that is not the scrolling box in some consumer's layout.\n scrollRef.current?.scrollTo?.({ top: 0 });\n };\n\n const whole = root === null ? null : paneGroup(root, open, schema.name);\n const opensTop = items.some((i) => i.path === open && i.depth === 0);\n const group = subPages && opensTop && whole !== null ? leavesOf(whole) : whole;\n\n return (\n <div className={[s.railLayout, className].filter(Boolean).join(' ')}>\n <PrefsRail\n items={items}\n section={open}\n current={subPages ? null : spy.active}\n onOpen={setOpen}\n onScrollTo={subPages ? setOpen : spy.scrollTo}\n ariaLabel={schema.name}\n header={filterField}\n showCounts={query.trim() !== ''}\n />\n {group === null ? (\n <div className={s.pane}>\n <NoMatches query={query} onClear={onClearFilter} />\n </div>\n ) : (\n <PrefsPane ctx={ctx} group={group} path={open} scrollRef={scrollRef} />\n )}\n </div>\n );\n}\n\n/**\n * The group a rail path opens. The empty path is the root's loose leaves,\n * which belong to no group of their own and are handed back as one named for\n * the schema — the rail lists them under the same name.\n */\nfunction paneGroup(root: PrefGroup, path: string, rootName: string): PrefGroup | null {\n if (path === '') {\n const children = Object.fromEntries(\n Object.entries(root.children).filter(([, child]) => isPrefLeaf(child)),\n );\n return Object.keys(children).length === 0\n ? null\n : { ...root, name: rootName, children };\n }\n let node: PrefGroup | undefined;\n let cursor = root;\n for (const seg of path.split('.')) {\n const next = cursor.children[seg];\n if (next === undefined || isPrefLeaf(next)) return null;\n node = next;\n cursor = next;\n }\n return node ?? null;\n}\n\n/** Whether a group holds any leaf directly, not counting its subgroups. */\nfunction hasLeaves(group: PrefGroup | null): boolean {\n return group !== null && Object.values(group.children).some(isPrefLeaf);\n}\n\n/** A group cut down to its direct leaves, for a page its subgroups each get their own of. */\nfunction leavesOf(group: PrefGroup): PrefGroup {\n return {\n ...group,\n children: Object.fromEntries(\n Object.entries(group.children).filter(([, child]) => isPrefLeaf(child)),\n ),\n };\n}\n\n/** What a filter matching nothing leaves behind. */\nfunction NoMatches({ query, onClear }: { query: string; onClear: () => void }) {\n return (\n <div className={s.noMatches}>\n <p>No settings match “{query.trim()}”.</p>\n <button type=\"button\" className={s.clearFilter} onClick={onClear}>\n Clear filter\n </button>\n </div>\n );\n}\n\nfunction GroupBody({ ctx, group, path, depth }: {\n ctx: WalkCtx;\n group: PrefGroup;\n path: string;\n depth: number;\n}) {\n return (\n <div className={depth === 0 ? s.panel : s.subpanel}>\n <div className={s.groupHeader}>\n <h3 className={s.groupTitle}>{group.name}</h3>\n {group.description !== undefined && (\n <p className={s.groupDesc}>{group.description}</p>\n )}\n </div>\n <div className={s.rows}>\n {Object.entries(group.children).map(([key, child]) => {\n const childPath = `${path}.${key}`;\n return isPrefLeaf(child) ? (\n <PrefRow key={key} ctx={ctx} path={childPath} pref={child} />\n ) : (\n <GroupBody key={key} ctx={ctx} group={child} path={childPath} depth={depth + 1} />\n );\n })}\n </div>\n </div>\n );\n}\n\n","import type { ReactNode } from 'react';\nimport { Dialog } from '../Dialog';\nimport { PrefsForm, type PrefsFormProps } from './PrefsForm';\nimport s from './Prefs.module.css';\n\n/**\n * Props for {@link PrefsDialog} — everything {@link PrefsForm} takes, plus\n * the dialog's own open state and chrome.\n */\nexport interface PrefsDialogProps extends PrefsFormProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n /** Dialog heading. Defaults to the schema root's `name`. */\n title?: ReactNode;\n /** Extra chrome rendered at the end of the title row (e.g. a dev-mode\n * \"Show hidden\" switch). An action the reader acts on when they are done\n * — resetting, importing — belongs in `footer` instead, where a dialog's\n * actions live. */\n headerExtra?: ReactNode;\n /** Footer slot, passed through to `Dialog` — typically a reset or done\n * action. */\n footer?: ReactNode;\n /** Class applied to the dialog's modal box. */\n dialogClassName?: string;\n}\n\n/**\n * The kit's preferences dialog: `Dialog` + `PrefsForm`. Changes apply\n * live through `onChange` — there is no OK/Cancel staging. For custom\n * placement (sidebar, popover, inline page), compose `PrefsForm`\n * directly; this wrapper is intentionally thin.\n *\n * `layout=\"rail\"` is what a dialog usually wants: the default columns wrap\n * sideways past two groups, and this box is 900px at its widest.\n */\nexport function PrefsDialog(props: PrefsDialogProps) {\n const { isOpen, onOpenChange, title, headerExtra, footer, dialogClassName, ...form } = props;\n const rail = form.layout === 'rail';\n return (\n <Dialog\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n aria-label={typeof title === 'string' ? title : form.schema.name}\n className={dialogClassName}\n footer={footer}\n bodyClassName={rail ? s.railBody : undefined}\n title={\n headerExtra !== undefined ? (\n <span className={s.titleRow}>\n <span>{title ?? form.schema.name}</span>\n {headerExtra}\n </span>\n ) : (\n title ?? form.schema.name\n )\n }\n >\n <PrefsForm {...form} />\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;AAoBA,SAAgBgB,EACd,GACA,IAAQ,GACO;CACf,IAAIC,IAAwB;CAC5B,KAAK,IAAM,EAAE,OAAI,YAASC,GAAS;EACjC,IAAIC,IAAMC,IAAQ,GAAG;EACrB,IAASC;CACX;CACA,OAAOJ;AACT;AA4BA,IAAMK,IAAY;AASlB,SAAgBC,EAAa,GAAyC;CACpE,IAAM,EAAE,YAAS,QAAK,aAAUC,GAC1B,CAACP,GAAQQ,KAAaC,EAAwB,IAAI,GAGlDC,IAAUC,EAAsB,IAAI,GACpCC,IAAWD,EAA6C,IAAI,GAC5DE,IAAaF,EAA4B,IAAI,GAC7CG,IAAMC,EAAI,KAAK,IAAQ,GAEvBC,IAAUC,QAAwB;EACtC,IAAMC,IAAOC,EAAQ;EACrB,IAAI,CAACD,GAAM;EACX,IAAIR,EAAQ,YAAY,MAAM;GAC5B,EAAUA,EAAQ,OAAO;GACzB;EACF;EACA,IAAMU,IAAUF,EAAK,sBAAsB,CAAC,CAAC,KACvCjB,IAA2B,CAAC;EAClC,KAAK,IAAMG,KAAMW,GAAK;GACpB,IAAMM,IAAKH,EAAK,cAA2B,sBAAsB,IAAI,OAAOd,CAAE,EAAE,GAAG;GACnF,AAAIiB,KAAIpB,EAAQ,KAAK;IAAE;IAAI,KAAKoB,EAAG,sBAAsB,CAAC,CAAC,MAAMD;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AAA,IAMdF,KAASF,EAAK,OAAO,OALrB,kBAAC,QAAD;GAAM,WAAWhI,EAAE;GAAnB,UAAA,CACE,kBAAC,QAAD,EAAA,UAAOkI,KAASF,EAAK,OAAO,KAAW,CAAA,GACtCI,CACG;EAEN,CAAA;EAIJ,UAAA,kBAACpC,GAAD,EAAW,GAAIgC,EAAO,CAAA;CAChB,CAAA;AAEZ"}
|
|
@@ -2,9 +2,9 @@ import { t as e } from "./dlog-F0I8KsIW.js";
|
|
|
2
2
|
import { t } from "./stance-BFQpS_fL.js";
|
|
3
3
|
import { t as n } from "./Button-XB-T75YL.js";
|
|
4
4
|
import { t as r } from "./Disclosure-Ch2KxYuB.js";
|
|
5
|
-
import { n as i } from "./CurveEditor-
|
|
5
|
+
import { n as i } from "./CurveEditor-0EE00D6s.js";
|
|
6
6
|
import { t as a } from "./Dialog-DKfsk5VN.js";
|
|
7
|
-
import {
|
|
7
|
+
import { c as o, d as s, o as c, u as l } from "./PropertyField-BbNqK8xr.js";
|
|
8
8
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
9
|
import { useCallback as f, useId as p, useMemo as m, useState as h } from "react";
|
|
10
10
|
var g = {
|
|
@@ -155,12 +155,12 @@ function _({ values: t, min: n, max: r, step: a, width: o, height: s = 110, defa
|
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/components/Properties/DialogRow.tsx
|
|
158
|
-
function v({ label: e, summary: t, children: r, title: i, footer:
|
|
158
|
+
function v({ label: e, summary: t, children: r, title: i, footer: c, layout: l, description: f, readout: p, span: m, density: g, align: _, auto: v, onAutoChange: b }) {
|
|
159
159
|
let [x, S] = h(!1), C = () => S(!1), w = typeof e == "string" ? e : void 0;
|
|
160
|
-
return /* @__PURE__ */ d(
|
|
160
|
+
return /* @__PURE__ */ d(o, {
|
|
161
161
|
label: e,
|
|
162
162
|
readout: p,
|
|
163
|
-
layout:
|
|
163
|
+
layout: l,
|
|
164
164
|
description: f,
|
|
165
165
|
span: m,
|
|
166
166
|
density: g,
|
|
@@ -170,15 +170,15 @@ function v({ label: e, summary: t, children: r, title: i, footer: o, layout: s,
|
|
|
170
170
|
group: !0,
|
|
171
171
|
children: [/* @__PURE__ */ d("button", {
|
|
172
172
|
type: "button",
|
|
173
|
-
className:
|
|
173
|
+
className: s.dialogTrigger,
|
|
174
174
|
"aria-haspopup": "dialog",
|
|
175
175
|
"aria-label": w === void 0 ? void 0 : `Edit ${w}`,
|
|
176
176
|
onClick: () => S(!0),
|
|
177
177
|
children: [/* @__PURE__ */ u("span", {
|
|
178
|
-
className:
|
|
178
|
+
className: s.dialogSummary,
|
|
179
179
|
children: t
|
|
180
180
|
}), /* @__PURE__ */ u("span", {
|
|
181
|
-
className:
|
|
181
|
+
className: s.dialogGlyph,
|
|
182
182
|
"aria-hidden": "true",
|
|
183
183
|
children: "…"
|
|
184
184
|
})]
|
|
@@ -186,11 +186,11 @@ function v({ label: e, summary: t, children: r, title: i, footer: o, layout: s,
|
|
|
186
186
|
isOpen: x,
|
|
187
187
|
onOpenChange: S,
|
|
188
188
|
title: i ?? e,
|
|
189
|
-
footer:
|
|
189
|
+
footer: c === void 0 ? /* @__PURE__ */ u(n, {
|
|
190
190
|
variant: "primary",
|
|
191
191
|
onClick: C,
|
|
192
192
|
children: "Done"
|
|
193
|
-
}) :
|
|
193
|
+
}) : c ?? void 0,
|
|
194
194
|
children: typeof r == "function" ? /* @__PURE__ */ u(y, {
|
|
195
195
|
render: r,
|
|
196
196
|
close: C
|
|
@@ -203,30 +203,30 @@ function y({ render: e, close: t }) {
|
|
|
203
203
|
}
|
|
204
204
|
//#endregion
|
|
205
205
|
//#region src/components/Properties/PropertyGroup.tsx
|
|
206
|
-
function b({ title: e, leading: n, actions: i, description: a, hidden:
|
|
206
|
+
function b({ title: e, leading: n, actions: i, description: a, hidden: o, collapsible: f, defaultCollapsed: m, collapsed: g, onCollapsedChange: _, children: v, className: y, span: b, pack: x = "auto-color", density: S, align: C, stance: w, tone: T }) {
|
|
207
207
|
let E = p(), D = p(), [O, k] = h(m ?? !1), A = t({
|
|
208
208
|
stance: w,
|
|
209
209
|
tone: T
|
|
210
210
|
});
|
|
211
|
-
if (
|
|
211
|
+
if (o) return null;
|
|
212
212
|
let j = f ?? (m !== void 0 || g !== void 0 || _ !== void 0), M = j && (g ?? O), N = () => {
|
|
213
213
|
g === void 0 && k(!M), _?.(!M);
|
|
214
|
-
}, P = `${
|
|
214
|
+
}, P = `${s.group}${x === "pairs" ? ` ${s.groupPairs}` : x === "one-up" ? ` ${s.groupOneUp}` : ""}`, F = l(b ? `${P} ${s.span}` : P, {
|
|
215
215
|
density: S,
|
|
216
216
|
align: C
|
|
217
217
|
}, y), I = /* @__PURE__ */ d("h3", {
|
|
218
|
-
className:
|
|
218
|
+
className: s.groupTitle,
|
|
219
219
|
"aria-labelledby": j ? D : void 0,
|
|
220
220
|
children: [
|
|
221
221
|
/* @__PURE__ */ u("hr", {}),
|
|
222
222
|
/* @__PURE__ */ d("span", {
|
|
223
|
-
className:
|
|
223
|
+
className: s.groupTitleMid,
|
|
224
224
|
children: [j ? /* @__PURE__ */ u(r, {
|
|
225
225
|
open: !M,
|
|
226
226
|
onToggle: N,
|
|
227
227
|
label: typeof e == "string" ? e : "this section",
|
|
228
228
|
controls: E,
|
|
229
|
-
className:
|
|
229
|
+
className: s.groupTwisty
|
|
230
230
|
}) : null, /* @__PURE__ */ u("span", {
|
|
231
231
|
id: D,
|
|
232
232
|
children: e
|
|
@@ -235,15 +235,15 @@ function b({ title: e, leading: n, actions: i, description: a, hidden: c, collap
|
|
|
235
235
|
/* @__PURE__ */ u("hr", {})
|
|
236
236
|
]
|
|
237
237
|
}), L = n === void 0 && i === void 0 ? I : /* @__PURE__ */ d("div", {
|
|
238
|
-
className:
|
|
238
|
+
className: s.groupHeadRow,
|
|
239
239
|
children: [
|
|
240
240
|
n === void 0 ? null : /* @__PURE__ */ u("span", {
|
|
241
|
-
className:
|
|
241
|
+
className: s.groupLeading,
|
|
242
242
|
children: n
|
|
243
243
|
}),
|
|
244
244
|
I,
|
|
245
245
|
i === void 0 ? null : /* @__PURE__ */ u("span", {
|
|
246
|
-
className:
|
|
246
|
+
className: s.groupActions,
|
|
247
247
|
children: i
|
|
248
248
|
})
|
|
249
249
|
]
|
|
@@ -253,10 +253,10 @@ function b({ title: e, leading: n, actions: i, description: a, hidden: c, collap
|
|
|
253
253
|
...A,
|
|
254
254
|
children: [
|
|
255
255
|
L,
|
|
256
|
-
a !== void 0 && a !== "" && /* @__PURE__ */ u(
|
|
256
|
+
a !== void 0 && a !== "" && /* @__PURE__ */ u(c, { children: a }),
|
|
257
257
|
/* @__PURE__ */ u("div", {
|
|
258
258
|
id: E,
|
|
259
|
-
className:
|
|
259
|
+
className: s.groupBody,
|
|
260
260
|
hidden: M,
|
|
261
261
|
children: v
|
|
262
262
|
})
|
|
@@ -266,7 +266,7 @@ function b({ title: e, leading: n, actions: i, description: a, hidden: c, collap
|
|
|
266
266
|
//#endregion
|
|
267
267
|
//#region src/components/Properties/Subpanel.tsx
|
|
268
268
|
function x({ title: e, children: n, className: r, density: i, align: a, stance: o, tone: c }) {
|
|
269
|
-
let f = s
|
|
269
|
+
let f = l(s.subpanel, {
|
|
270
270
|
density: i,
|
|
271
271
|
align: a
|
|
272
272
|
}, r);
|
|
@@ -277,7 +277,7 @@ function x({ title: e, children: n, className: r, density: i, align: a, stance:
|
|
|
277
277
|
tone: c
|
|
278
278
|
}),
|
|
279
279
|
children: [/* @__PURE__ */ d("h4", {
|
|
280
|
-
className:
|
|
280
|
+
className: s.subpanelTitle,
|
|
281
281
|
children: [/* @__PURE__ */ u("span", { children: e }), /* @__PURE__ */ u("hr", {})]
|
|
282
282
|
}), n]
|
|
283
283
|
});
|
|
@@ -285,4 +285,4 @@ function x({ title: e, children: n, className: r, density: i, align: a, stance:
|
|
|
285
285
|
//#endregion
|
|
286
286
|
export { _ as i, b as n, v as r, x as t };
|
|
287
287
|
|
|
288
|
-
//# sourceMappingURL=Properties-
|
|
288
|
+
//# sourceMappingURL=Properties-DseN56WI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Properties-D15c8NP-.js","names":["s","s","s","s","dlog","Button","Disclosure","CurveEditor","Dialog","PropertyNote","propertyMetricClass","PropertyRow","Properties_module_default","CurveField_module_default","CurveField","points","useMemo","out","i","values","handleChange","useCallback","flat","next","ySnap","step","y","min","max","onChange","handleFlip","flipped","a","b","p","handleFlipVertical","mid","marks","width","height","color","m","x0","x1","left","w","x","defaults","DialogRow","open","setOpen","useState","close","name","label","summary","title","footer","children","DialogBody","render","PropertyGroup","bodyId","useId","titleId","own","setOwn","defaultCollapsed","stanced","useStance","hidden","folds","collapsible","collapsed","onCollapsedChange","folded","toggle","base","pack","cls","span","className","titled","heading","leading","actions","description","Subpanel"],"sources":["../../src/components/Properties/CurveField.module.css","../../src/components/Properties/CurveField.tsx","../../src/components/Properties/DialogRow.tsx","../../src/components/Properties/PropertyGroup.tsx","../../src/components/Properties/Subpanel.tsx"],"sourcesContent":[".field {\n display: grid;\n gap: var(--wzl-space-3);\n grid-column: 1 / -1;\n box-sizing: border-box;\n}\n\n.field * {\n box-sizing: border-box;\n}\n\n.plot {\n position: relative;\n width: 100%;\n}\n\n.marks {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.actions {\n display: flex;\n gap: var(--wzl-space-3);\n justify-self: start;\n}\n\n.action {\n background: transparent;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n padding: var(--wzl-space-2) var(--wzl-space-5);\n font: inherit;\n font-size: var(--wzl-font-size-sm);\n cursor: pointer;\n}\n\n.action:hover {\n background: var(--wzl-surface-raised);\n}\n","import { useCallback, useMemo } from 'react';\nimport { dlog } from '../../dlog';\nimport { type ControlPoint, CurveEditor } from '../CurveEditor';\nimport s from './CurveField.module.css';\n\n/** An annotation drawn over a curve plot: a shaded band across a range of x,\n * or a vertical line at one x. */\nexport type CurveMark =\n | { kind: 'band'; x: [number, number]; color?: string }\n | { kind: 'line'; x: number; color?: string };\n\n/** Props for `<CurveField>`. */\nexport interface CurveFieldProps {\n /** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs\n * serialize in JSON snapshots. */\n values: number[];\n min: number;\n max: number;\n step: number;\n /** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */\n width: number;\n /** Plot height in CSS px. Default 110. */\n height?: number;\n /** Flat default curve. When provided, a Reset button restores it. */\n defaults?: readonly number[];\n onChange: (next: number[]) => void;\n /** Optional vertical marks overlaid on the plot (e.g. landmarks). */\n marks?: readonly CurveMark[];\n}\n\n/**\n * A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop\n * numeric readouts and flip buttons. Wraps weasel-ui's\n * `CurveEditor`; consumers wanting the raw editor (2D paths,\n * custom anchors) should import that instead.\n */\nexport function CurveField({\n values,\n min,\n max,\n step,\n width,\n height = 110,\n defaults,\n onChange,\n marks,\n}: CurveFieldProps) {\n const points: ControlPoint[] = useMemo(() => {\n const out: ControlPoint[] = [];\n for (let i = 0; i + 1 < values.length; i += 2) out.push({ x: values[i], y: values[i + 1] });\n return out;\n }, [values]);\n\n const handleChange = useCallback(\n (next: ControlPoint[]) => {\n const flat: number[] = new Array(next.length * 2);\n for (let i = 0; i < next.length; i++) {\n const ySnap = Math.round(next[i].y / step) * step;\n const y = Math.max(min, Math.min(max, ySnap));\n flat[i * 2] = next[i].x;\n flat[i * 2 + 1] = y;\n }\n dlog('curve-field', 'handleChange', {\n nLen: next.length,\n flatLen: flat.length,\n sample: flat.slice(0, 4),\n });\n onChange(flat);\n },\n [onChange, min, max, step],\n );\n\n const handleFlip = useCallback(() => {\n const flipped: Array<{ x: number; y: number }> = [];\n for (let i = 0; i + 1 < values.length; i += 2) {\n flipped.push({ x: 1 - values[i], y: values[i + 1] });\n }\n flipped.sort((a, b) => a.x - b.x);\n const out: number[] = [];\n for (const p of flipped) out.push(p.x, p.y);\n onChange(out);\n }, [values, onChange]);\n\n const handleFlipVertical = useCallback(() => {\n const mid = (min + max) / 2;\n const flipped: number[] = new Array(values.length);\n for (let i = 0; i + 1 < values.length; i += 2) {\n flipped[i] = values[i];\n flipped[i + 1] = 2 * mid - values[i + 1];\n }\n onChange(flipped);\n }, [values, min, max, onChange]);\n\n return (\n <div className={s.field}>\n <div className={s.plot}>\n <CurveEditor\n value={points}\n onInput={handleChange}\n domain=\"1d\"\n constrain=\"function\"\n xRange={[0, 1]}\n yRange={[min, max]}\n width={width}\n height={height}\n endpoints=\"pinned-x\"\n addPointMode=\"click-curve\"\n minPoints={2}\n grid={{}}\n history={false}\n />\n {marks && marks.length > 0 && (\n <svg\n className={s.marks}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n aria-hidden=\"true\"\n >\n {marks.map((m) => {\n const color = m.color ?? '#ffcc00';\n if (m.kind === 'band') {\n const x0 = Math.max(0, Math.min(1, m.x[0])) * width;\n const x1 = Math.max(0, Math.min(1, m.x[1])) * width;\n const left = Math.min(x0, x1);\n const w = Math.abs(x1 - x0);\n return (\n <g key={`band-${m.x[0]}-${m.x[1]}-${color}`}>\n <rect x={left} y={0} width={w} height={height} fill={color} fillOpacity={0.4} />\n <line\n x1={left}\n y1={0}\n x2={left}\n y2={height}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1}\n />\n <line\n x1={left + w}\n y1={0}\n x2={left + w}\n y2={height}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1}\n />\n </g>\n );\n }\n const x = Math.max(0, Math.min(1, m.x)) * width;\n return (\n <line\n key={`mark-${m.x}-${color}`}\n x1={x}\n y1={0}\n x2={x}\n y2={height}\n stroke={color}\n strokeWidth={1}\n />\n );\n })}\n </svg>\n )}\n </div>\n <div className={s.actions}>\n <button type=\"button\" className={s.action} onClick={handleFlip}>\n Flip horizontally\n </button>\n <button type=\"button\" className={s.action} onClick={handleFlipVertical}>\n Flip vertically\n </button>\n {defaults && (\n <button\n type=\"button\"\n className={s.action}\n onClick={() => onChange([...defaults])}\n >\n Reset\n </button>\n )}\n </div>\n </div>\n );\n}\n","import { type ReactNode, useState } from 'react';\nimport { Button } from '../Button';\nimport { Dialog } from '../Dialog';\nimport { type PropertyMetricProps, type PropertyRowLayout, PropertyRow } from './PropertyPanel';\nimport s from './Properties.module.css';\n\n/** Props for `<DialogRow>`. */\nexport interface DialogRowProps extends PropertyMetricProps {\n label: ReactNode;\n /** What the row shows of the value, on the button that opens the dialog. One\n * line; a longer one is cut off with an ellipsis. */\n summary: ReactNode;\n /** The dialog's body. A function runs only while the dialog is open, as a\n * component — it may use hooks — and is handed `close`. */\n children: ReactNode | ((close: () => void) => ReactNode);\n /** The dialog's heading. Defaults to `label`. */\n title?: ReactNode;\n /** Dialog footer. Defaults to a Done button; `null` draws none. */\n footer?: ReactNode | null;\n layout?: PropertyRowLayout;\n description?: string;\n /** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */\n readout?: ReactNode;\n /** Take the full width of the enclosing grid — see `<PropertyRow span>`. */\n span?: boolean;\n /** The row is auto — see `<PropertyRow auto>`. */\n auto?: boolean;\n /** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */\n onAutoChange?: (next: boolean) => void;\n}\n\n/**\n * A row for a value too big to edit in place: it shows a one-line summary on a\n * button, and the button opens a modal holding whatever editor the row is\n * given. The body edits live — the dialog is room, not a transaction.\n */\nexport function DialogRow({\n label,\n summary,\n children,\n title,\n footer,\n layout,\n description,\n readout,\n span,\n density,\n align,\n auto,\n onAutoChange,\n}: DialogRowProps) {\n const [open, setOpen] = useState(false);\n const close = (): void => setOpen(false);\n const name = typeof label === 'string' ? label : undefined;\n return (\n <PropertyRow\n label={label}\n readout={readout}\n layout={layout}\n description={description}\n span={span}\n density={density}\n align={align}\n auto={auto}\n onAutoChange={onAutoChange}\n // A `<label>` hands a click on its text to its button, which would open\n // the dialog from the label — and the label is the auto toggle.\n group\n >\n <button\n type=\"button\"\n className={s.dialogTrigger}\n aria-haspopup=\"dialog\"\n aria-label={name === undefined ? undefined : `Edit ${name}`}\n onClick={() => setOpen(true)}\n >\n <span className={s.dialogSummary}>{summary}</span>\n <span className={s.dialogGlyph} aria-hidden=\"true\">\n …\n </span>\n </button>\n <Dialog\n isOpen={open}\n onOpenChange={setOpen}\n title={title ?? label}\n footer={\n footer === undefined ? (\n <Button variant=\"primary\" onClick={close}>\n Done\n </Button>\n ) : (\n (footer ?? undefined)\n )\n }\n >\n {typeof children === 'function' ? <DialogBody render={children} close={close} /> : children}\n </Dialog>\n </PropertyRow>\n );\n}\n\n/** Calls a function body as a component, so it runs only while the dialog is\n * mounted and may use hooks of its own. */\nfunction DialogBody({\n render,\n close,\n}: {\n render: (close: () => void) => ReactNode;\n close: () => void;\n}) {\n return render(close);\n}\n","import { type ReactNode, useId, useState } from 'react';\nimport { Disclosure } from '../Disclosure';\nimport { type StanceProps, useStance } from '../stance';\nimport s from './Properties.module.css';\nimport {\n type PropertyListPack,\n type PropertyMetricProps,\n PropertyNote,\n propertyMetricClass,\n} from './PropertyPanel';\n\n/** Props for `<PropertyGroup>`. */\nexport interface PropertyGroupProps extends PropertyMetricProps, StanceProps {\n /** Title rendered between two rules at the top of the group. */\n title: ReactNode;\n /** Before the title: a drag handle, an ordinal. Clicks here do not fold the group. */\n leading?: ReactNode;\n /** After the title: a summary of the group's value, a remove button. Clicks here do not fold the group. */\n actions?: ReactNode;\n /** Help text for the whole group, drawn under the title and above the\n * rows. `<PropertyRow description>` covers the per-row case. */\n description?: ReactNode;\n /** When true the group renders nothing — useful for conditional sections. */\n hidden?: boolean;\n /**\n * Give the title a twisty that folds the rows away. Implied by any of the\n * three props below, so it is only needed for a group that starts open and\n * keeps its own state.\n */\n collapsible?: boolean;\n /** Start folded. Read once; the group owns the state from then on. */\n defaultCollapsed?: boolean;\n /**\n * Folded or not, as the consumer holds it. Given, the group keeps no state\n * of its own and every toggle arrives at `onCollapsedChange` instead — which\n * is what a panel that remembers its sections past a reload needs.\n */\n collapsed?: boolean;\n onCollapsedChange?: (next: boolean) => void;\n children: ReactNode;\n className?: string;\n /** Take the whole width of a packed grid, like `<PropertyRow span>`: a group\n * lays its own rows out, so half a column leaves them overlapping. */\n span?: boolean;\n /** How rows pack into the 2-column grid — see `<PropertyList pack>`. */\n pack?: PropertyListPack;\n}\n\n/**\n * Visually-bordered group inside a PropertyList. Use to scope a set of\n * related rows under a heading (e.g. \"Aqua\", \"Bevel\", \"Dome\" sections\n * inside a fill effect's controls).\n *\n * A collapsible group keeps its rows mounted and hides them, so a control's\n * local state survives being folded away. `stance` and `tone` work as on\n * `<PropertyPanel>`; a tone also draws the group's leading edge in it, which\n * is how a list of like groups — effects, tails — tells its members apart.\n * `leading` and `actions` put a handle and controls in the title row, and the\n * groups of a `<PropertyList>` reorder with `useReorderDragList`.\n */\nexport function PropertyGroup({\n title,\n leading,\n actions,\n description,\n hidden,\n collapsible,\n defaultCollapsed,\n collapsed,\n onCollapsedChange,\n children,\n className,\n span,\n pack = 'auto-color',\n density,\n align,\n stance,\n tone,\n}: PropertyGroupProps) {\n const bodyId = useId();\n const titleId = useId();\n const [own, setOwn] = useState(defaultCollapsed ?? false);\n const stanced = useStance({ stance, tone });\n if (hidden) return null;\n\n const folds =\n collapsible ??\n (defaultCollapsed !== undefined || collapsed !== undefined || onCollapsedChange !== undefined);\n const folded = folds && (collapsed ?? own);\n const toggle = () => {\n if (collapsed === undefined) setOwn(!folded);\n onCollapsedChange?.(!folded);\n };\n\n const base = `${s.group}${pack === 'pairs' ? ` ${s.groupPairs}` : pack === 'one-up' ? ` ${s.groupOneUp}` : ''}`;\n const cls = propertyMetricClass(span ? `${base} ${s.span}` : base, { density, align }, className);\n // The twisty sits in the title, between the rules, so the two read as one\n // unit, without moving the centered text. The heading is named by the title\n // alone, not the twisty's label too.\n const titled = (\n <h3 className={s.groupTitle} aria-labelledby={folds ? titleId : undefined}>\n <hr />\n <span className={s.groupTitleMid}>\n {folds ? (\n <Disclosure\n open={!folded}\n onToggle={toggle}\n label={typeof title === 'string' ? title : 'this section'}\n controls={bodyId}\n className={s.groupTwisty}\n />\n ) : null}\n <span id={titleId}>{title}</span>\n </span>\n <hr />\n </h3>\n );\n const heading =\n leading === undefined && actions === undefined ? (\n titled\n ) : (\n <div className={s.groupHeadRow}>\n {leading === undefined ? null : <span className={s.groupLeading}>{leading}</span>}\n {titled}\n {actions === undefined ? null : <span className={s.groupActions}>{actions}</span>}\n </div>\n );\n return (\n <div className={cls} {...stanced}>\n {heading}\n {description !== undefined && description !== '' && <PropertyNote>{description}</PropertyNote>}\n <div id={bodyId} className={s.groupBody} hidden={folded}>\n {children}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StanceProps, useStance } from '../stance';\nimport s from './Properties.module.css';\nimport { type PropertyMetricProps, propertyMetricClass } from './PropertyPanel';\n\n/** Props for `<Subpanel>`. */\nexport interface SubpanelProps extends PropertyMetricProps, StanceProps {\n title: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\n/** A typographic divider inside a property list: a small title flanked by a\n * rule. Purely a heading — use `<PropertyGroup>` for a bordered section. A\n * stance or tone colors the title and rule. */\nexport function Subpanel({ title, children, className, density, align, stance, tone }: SubpanelProps) {\n const cls = propertyMetricClass(s.subpanel, { density, align }, className);\n return (\n <div className={cls} {...useStance({ stance, tone })}>\n <h4 className={s.subpanelTitle}>\n <span>{title}</span>\n <hr />\n </h4>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;ACoCA,SAAgBc,EAAW,EACzB,WACA,QACA,QACA,SACA,UACA,YAAS,KACT,aACA,aACA,YACkB;CAClB,IAAMC,IAAyBC,QAAc;EAC3C,IAAMC,IAAsB,CAAC;EAC7B,KAAK,IAAIC,IAAI,GAAGA,IAAI,IAAIC,EAAO,QAAQ,KAAK,GAAG,EAAI,KAAK;GAAE,GAAGA,EAAOD;GAAI,GAAGC,EAAOD,IAAI;EAAG,CAAC;EAC1F,OAAOD;CACT,GAAG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AAA,CACE,kBAAC,QAAD,EAAA,UAAOqD,EAAY,CAAA,GACnB,kBAAC,MAAD,CAAK,CAAA,CACH;EACH,CAAA,GAAAE,CACE;;AAET"}
|
|
1
|
+
{"version":3,"file":"Properties-DseN56WI.js","names":["s","s","s","s","dlog","Button","Disclosure","CurveEditor","Dialog","PropertyRow","Properties_module_default","PropertyNote","propertyMetricClass","CurveField_module_default","CurveField","points","useMemo","out","i","values","handleChange","useCallback","flat","next","ySnap","step","y","min","max","onChange","handleFlip","flipped","a","b","p","handleFlipVertical","mid","marks","width","height","color","m","x0","x1","left","w","x","defaults","DialogRow","open","setOpen","useState","close","name","label","summary","title","footer","children","DialogBody","render","PropertyGroup","bodyId","useId","titleId","own","setOwn","defaultCollapsed","stanced","useStance","hidden","folds","collapsible","collapsed","onCollapsedChange","folded","toggle","base","pack","cls","span","className","titled","heading","leading","actions","description","Subpanel"],"sources":["../../src/components/Properties/CurveField.module.css","../../src/components/Properties/CurveField.tsx","../../src/components/Properties/DialogRow.tsx","../../src/components/Properties/PropertyGroup.tsx","../../src/components/Properties/Subpanel.tsx"],"sourcesContent":[".field {\n display: grid;\n gap: var(--wzl-space-3);\n grid-column: 1 / -1;\n box-sizing: border-box;\n}\n\n.field * {\n box-sizing: border-box;\n}\n\n.plot {\n position: relative;\n width: 100%;\n}\n\n.marks {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.actions {\n display: flex;\n gap: var(--wzl-space-3);\n justify-self: start;\n}\n\n.action {\n background: transparent;\n border: 1px solid var(--wzl-border);\n border-radius: var(--wzl-radius-sm);\n color: var(--wzl-fg);\n padding: var(--wzl-space-2) var(--wzl-space-5);\n font: inherit;\n font-size: var(--wzl-font-size-sm);\n cursor: pointer;\n}\n\n.action:hover {\n background: var(--wzl-surface-raised);\n}\n","import { useCallback, useMemo } from 'react';\nimport { dlog } from '../../dlog';\nimport { type ControlPoint, CurveEditor } from '../CurveEditor';\nimport s from './CurveField.module.css';\n\n/** An annotation drawn over a curve plot: a shaded band across a range of x,\n * or a vertical line at one x. */\nexport type CurveMark =\n | { kind: 'band'; x: [number, number]; color?: string }\n | { kind: 'line'; x: number; color?: string };\n\n/** Props for `<CurveField>`. */\nexport interface CurveFieldProps {\n /** Flat [x0, y0, x1, y1, …] — matches how curve-as-array configs\n * serialize in JSON snapshots. */\n values: number[];\n min: number;\n max: number;\n step: number;\n /** Plot width in CSS px. Caller sizes (typically uses a ResizeObserver). */\n width: number;\n /** Plot height in CSS px. Default 110. */\n height?: number;\n /** Flat default curve. When provided, a Reset button restores it. */\n defaults?: readonly number[];\n onChange: (next: number[]) => void;\n /** Optional vertical marks overlaid on the plot (e.g. landmarks). */\n marks?: readonly CurveMark[];\n}\n\n/**\n * A function-domain (y = f(x), x ∈ [0,1]) curve editor with per-stop\n * numeric readouts and flip buttons. Wraps weasel-ui's\n * `CurveEditor`; consumers wanting the raw editor (2D paths,\n * custom anchors) should import that instead.\n */\nexport function CurveField({\n values,\n min,\n max,\n step,\n width,\n height = 110,\n defaults,\n onChange,\n marks,\n}: CurveFieldProps) {\n const points: ControlPoint[] = useMemo(() => {\n const out: ControlPoint[] = [];\n for (let i = 0; i + 1 < values.length; i += 2) out.push({ x: values[i], y: values[i + 1] });\n return out;\n }, [values]);\n\n const handleChange = useCallback(\n (next: ControlPoint[]) => {\n const flat: number[] = new Array(next.length * 2);\n for (let i = 0; i < next.length; i++) {\n const ySnap = Math.round(next[i].y / step) * step;\n const y = Math.max(min, Math.min(max, ySnap));\n flat[i * 2] = next[i].x;\n flat[i * 2 + 1] = y;\n }\n dlog('curve-field', 'handleChange', {\n nLen: next.length,\n flatLen: flat.length,\n sample: flat.slice(0, 4),\n });\n onChange(flat);\n },\n [onChange, min, max, step],\n );\n\n const handleFlip = useCallback(() => {\n const flipped: Array<{ x: number; y: number }> = [];\n for (let i = 0; i + 1 < values.length; i += 2) {\n flipped.push({ x: 1 - values[i], y: values[i + 1] });\n }\n flipped.sort((a, b) => a.x - b.x);\n const out: number[] = [];\n for (const p of flipped) out.push(p.x, p.y);\n onChange(out);\n }, [values, onChange]);\n\n const handleFlipVertical = useCallback(() => {\n const mid = (min + max) / 2;\n const flipped: number[] = new Array(values.length);\n for (let i = 0; i + 1 < values.length; i += 2) {\n flipped[i] = values[i];\n flipped[i + 1] = 2 * mid - values[i + 1];\n }\n onChange(flipped);\n }, [values, min, max, onChange]);\n\n return (\n <div className={s.field}>\n <div className={s.plot}>\n <CurveEditor\n value={points}\n onInput={handleChange}\n domain=\"1d\"\n constrain=\"function\"\n xRange={[0, 1]}\n yRange={[min, max]}\n width={width}\n height={height}\n endpoints=\"pinned-x\"\n addPointMode=\"click-curve\"\n minPoints={2}\n grid={{}}\n history={false}\n />\n {marks && marks.length > 0 && (\n <svg\n className={s.marks}\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n aria-hidden=\"true\"\n >\n {marks.map((m) => {\n const color = m.color ?? '#ffcc00';\n if (m.kind === 'band') {\n const x0 = Math.max(0, Math.min(1, m.x[0])) * width;\n const x1 = Math.max(0, Math.min(1, m.x[1])) * width;\n const left = Math.min(x0, x1);\n const w = Math.abs(x1 - x0);\n return (\n <g key={`band-${m.x[0]}-${m.x[1]}-${color}`}>\n <rect x={left} y={0} width={w} height={height} fill={color} fillOpacity={0.4} />\n <line\n x1={left}\n y1={0}\n x2={left}\n y2={height}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1}\n />\n <line\n x1={left + w}\n y1={0}\n x2={left + w}\n y2={height}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1}\n />\n </g>\n );\n }\n const x = Math.max(0, Math.min(1, m.x)) * width;\n return (\n <line\n key={`mark-${m.x}-${color}`}\n x1={x}\n y1={0}\n x2={x}\n y2={height}\n stroke={color}\n strokeWidth={1}\n />\n );\n })}\n </svg>\n )}\n </div>\n <div className={s.actions}>\n <button type=\"button\" className={s.action} onClick={handleFlip}>\n Flip horizontally\n </button>\n <button type=\"button\" className={s.action} onClick={handleFlipVertical}>\n Flip vertically\n </button>\n {defaults && (\n <button\n type=\"button\"\n className={s.action}\n onClick={() => onChange([...defaults])}\n >\n Reset\n </button>\n )}\n </div>\n </div>\n );\n}\n","import { type ReactNode, useState } from 'react';\nimport { Button } from '../Button';\nimport { Dialog } from '../Dialog';\nimport { type PropertyMetricProps, type PropertyRowLayout, PropertyRow } from './PropertyPanel';\nimport s from './Properties.module.css';\n\n/** Props for `<DialogRow>`. */\nexport interface DialogRowProps extends PropertyMetricProps {\n label: ReactNode;\n /** What the row shows of the value, on the button that opens the dialog. One\n * line; a longer one is cut off with an ellipsis. */\n summary: ReactNode;\n /** The dialog's body. A function runs only while the dialog is open, as a\n * component — it may use hooks — and is handed `close`. */\n children: ReactNode | ((close: () => void) => ReactNode);\n /** The dialog's heading. Defaults to `label`. */\n title?: ReactNode;\n /** Dialog footer. Defaults to a Done button; `null` draws none. */\n footer?: ReactNode | null;\n layout?: PropertyRowLayout;\n description?: string;\n /** Right-aligned readout shown next to the label — see `<PropertyRow readout>`. */\n readout?: ReactNode;\n /** Take the full width of the enclosing grid — see `<PropertyRow span>`. */\n span?: boolean;\n /** The row is auto — see `<PropertyRow auto>`. */\n auto?: boolean;\n /** Toggles `auto` from the row's label — see `<PropertyRow onAutoChange>`. */\n onAutoChange?: (next: boolean) => void;\n}\n\n/**\n * A row for a value too big to edit in place: it shows a one-line summary on a\n * button, and the button opens a modal holding whatever editor the row is\n * given. The body edits live — the dialog is room, not a transaction.\n */\nexport function DialogRow({\n label,\n summary,\n children,\n title,\n footer,\n layout,\n description,\n readout,\n span,\n density,\n align,\n auto,\n onAutoChange,\n}: DialogRowProps) {\n const [open, setOpen] = useState(false);\n const close = (): void => setOpen(false);\n const name = typeof label === 'string' ? label : undefined;\n return (\n <PropertyRow\n label={label}\n readout={readout}\n layout={layout}\n description={description}\n span={span}\n density={density}\n align={align}\n auto={auto}\n onAutoChange={onAutoChange}\n // A `<label>` hands a click on its text to its button, which would open\n // the dialog from the label — and the label is the auto toggle.\n group\n >\n <button\n type=\"button\"\n className={s.dialogTrigger}\n aria-haspopup=\"dialog\"\n aria-label={name === undefined ? undefined : `Edit ${name}`}\n onClick={() => setOpen(true)}\n >\n <span className={s.dialogSummary}>{summary}</span>\n <span className={s.dialogGlyph} aria-hidden=\"true\">\n …\n </span>\n </button>\n <Dialog\n isOpen={open}\n onOpenChange={setOpen}\n title={title ?? label}\n footer={\n footer === undefined ? (\n <Button variant=\"primary\" onClick={close}>\n Done\n </Button>\n ) : (\n (footer ?? undefined)\n )\n }\n >\n {typeof children === 'function' ? <DialogBody render={children} close={close} /> : children}\n </Dialog>\n </PropertyRow>\n );\n}\n\n/** Calls a function body as a component, so it runs only while the dialog is\n * mounted and may use hooks of its own. */\nfunction DialogBody({\n render,\n close,\n}: {\n render: (close: () => void) => ReactNode;\n close: () => void;\n}) {\n return render(close);\n}\n","import { type ReactNode, useId, useState } from 'react';\nimport { Disclosure } from '../Disclosure';\nimport { type StanceProps, useStance } from '../stance';\nimport s from './Properties.module.css';\nimport {\n type PropertyListPack,\n type PropertyMetricProps,\n PropertyNote,\n propertyMetricClass,\n} from './PropertyPanel';\n\n/** Props for `<PropertyGroup>`. */\nexport interface PropertyGroupProps extends PropertyMetricProps, StanceProps {\n /** Title rendered between two rules at the top of the group. */\n title: ReactNode;\n /** Before the title: a drag handle, an ordinal. Clicks here do not fold the group. */\n leading?: ReactNode;\n /** After the title: a summary of the group's value, a remove button. Clicks here do not fold the group. */\n actions?: ReactNode;\n /** Help text for the whole group, drawn under the title and above the\n * rows. `<PropertyRow description>` covers the per-row case. */\n description?: ReactNode;\n /** When true the group renders nothing — useful for conditional sections. */\n hidden?: boolean;\n /**\n * Give the title a twisty that folds the rows away. Implied by any of the\n * three props below, so it is only needed for a group that starts open and\n * keeps its own state.\n */\n collapsible?: boolean;\n /** Start folded. Read once; the group owns the state from then on. */\n defaultCollapsed?: boolean;\n /**\n * Folded or not, as the consumer holds it. Given, the group keeps no state\n * of its own and every toggle arrives at `onCollapsedChange` instead — which\n * is what a panel that remembers its sections past a reload needs.\n */\n collapsed?: boolean;\n onCollapsedChange?: (next: boolean) => void;\n children: ReactNode;\n className?: string;\n /** Take the whole width of a packed grid, like `<PropertyRow span>`: a group\n * lays its own rows out, so half a column leaves them overlapping. */\n span?: boolean;\n /** How rows pack into the 2-column grid — see `<PropertyList pack>`. */\n pack?: PropertyListPack;\n}\n\n/**\n * Visually-bordered group inside a PropertyList. Use to scope a set of\n * related rows under a heading (e.g. \"Aqua\", \"Bevel\", \"Dome\" sections\n * inside a fill effect's controls).\n *\n * A collapsible group keeps its rows mounted and hides them, so a control's\n * local state survives being folded away. `stance` and `tone` work as on\n * `<PropertyPanel>`; a tone also draws the group's leading edge in it, which\n * is how a list of like groups — effects, tails — tells its members apart.\n * `leading` and `actions` put a handle and controls in the title row, and the\n * groups of a `<PropertyList>` reorder with `useReorderDragList`.\n */\nexport function PropertyGroup({\n title,\n leading,\n actions,\n description,\n hidden,\n collapsible,\n defaultCollapsed,\n collapsed,\n onCollapsedChange,\n children,\n className,\n span,\n pack = 'auto-color',\n density,\n align,\n stance,\n tone,\n}: PropertyGroupProps) {\n const bodyId = useId();\n const titleId = useId();\n const [own, setOwn] = useState(defaultCollapsed ?? false);\n const stanced = useStance({ stance, tone });\n if (hidden) return null;\n\n const folds =\n collapsible ??\n (defaultCollapsed !== undefined || collapsed !== undefined || onCollapsedChange !== undefined);\n const folded = folds && (collapsed ?? own);\n const toggle = () => {\n if (collapsed === undefined) setOwn(!folded);\n onCollapsedChange?.(!folded);\n };\n\n const base = `${s.group}${pack === 'pairs' ? ` ${s.groupPairs}` : pack === 'one-up' ? ` ${s.groupOneUp}` : ''}`;\n const cls = propertyMetricClass(span ? `${base} ${s.span}` : base, { density, align }, className);\n // The twisty sits in the title, between the rules, so the two read as one\n // unit, without moving the centered text. The heading is named by the title\n // alone, not the twisty's label too.\n const titled = (\n <h3 className={s.groupTitle} aria-labelledby={folds ? titleId : undefined}>\n <hr />\n <span className={s.groupTitleMid}>\n {folds ? (\n <Disclosure\n open={!folded}\n onToggle={toggle}\n label={typeof title === 'string' ? title : 'this section'}\n controls={bodyId}\n className={s.groupTwisty}\n />\n ) : null}\n <span id={titleId}>{title}</span>\n </span>\n <hr />\n </h3>\n );\n const heading =\n leading === undefined && actions === undefined ? (\n titled\n ) : (\n <div className={s.groupHeadRow}>\n {leading === undefined ? null : <span className={s.groupLeading}>{leading}</span>}\n {titled}\n {actions === undefined ? null : <span className={s.groupActions}>{actions}</span>}\n </div>\n );\n return (\n <div className={cls} {...stanced}>\n {heading}\n {description !== undefined && description !== '' && <PropertyNote>{description}</PropertyNote>}\n <div id={bodyId} className={s.groupBody} hidden={folded}>\n {children}\n </div>\n </div>\n );\n}\n","import type { ReactNode } from 'react';\nimport { type StanceProps, useStance } from '../stance';\nimport s from './Properties.module.css';\nimport { type PropertyMetricProps, propertyMetricClass } from './PropertyPanel';\n\n/** Props for `<Subpanel>`. */\nexport interface SubpanelProps extends PropertyMetricProps, StanceProps {\n title: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\n/** A typographic divider inside a property list: a small title flanked by a\n * rule. Purely a heading — use `<PropertyGroup>` for a bordered section. A\n * stance or tone colors the title and rule. */\nexport function Subpanel({ title, children, className, density, align, stance, tone }: SubpanelProps) {\n const cls = propertyMetricClass(s.subpanel, { density, align }, className);\n return (\n <div className={cls} {...useStance({ stance, tone })}>\n <h4 className={s.subpanelTitle}>\n <span>{title}</span>\n <hr />\n </h4>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;ACoCA,SAAgBc,EAAW,EACzB,WACA,QACA,QACA,SACA,UACA,YAAS,KACT,aACA,aACA,YACkB;CAClB,IAAMC,IAAyBC,QAAc;EAC3C,IAAMC,IAAsB,CAAC;EAC7B,KAAK,IAAIC,IAAI,GAAGA,IAAI,IAAIC,EAAO,QAAQ,KAAK,GAAG,EAAI,KAAK;GAAE,GAAGA,EAAOD;GAAI,GAAGC,EAAOD,IAA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