@pixerate/editor-react 0.200.0 → 0.201.0

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.
@@ -29,7 +29,7 @@ import {
29
29
  chip,
30
30
  panel,
31
31
  useAttempt
32
- } from "../chunk-GUBRH2OO.js";
32
+ } from "../chunk-IYYUBI3M.js";
33
33
 
34
34
  // src/paint-editor/usePaintEditor.ts
35
35
  import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
@@ -703,7 +703,7 @@ var PaintToolbar = ({ controller, tool, onToolChange, fillOptions: controlledFil
703
703
  };
704
704
 
705
705
  // src/paint-editor/BrushPanel.tsx
706
- import { useMemo as useMemo3, useRef as useRef4 } from "react";
706
+ import { useMemo as useMemo4, useRef as useRef4 } from "react";
707
707
  import { brushLoadColor, brushTakesPaint, downloadBytes as downloadBytes2, toggleStickerRef, DEFAULT_PAINT_GRADIENT } from "@pixerate/editor/paint-editor";
708
708
  import { addBrushSourceFromFile, importBrushFile, brushColourHex, brushPreviewColours, PAINT_PROFILE } from "@pixerate/editor/brushes";
709
709
 
@@ -735,32 +735,183 @@ var StickerPicker = ({ controller, selected, onPick, label = "Stickers" }) => {
735
735
  );
736
736
  };
737
737
 
738
+ // src/paint-editor/SpecialtyPanel.tsx
739
+ import { useEffect as useEffect4, useState as useState5 } from "react";
740
+ import { UV_LIGHT_SLIDERS, VIEW_TILT_SLIDERS, brushSpecialtyGuides, readPath as readPath2, requestDeviceTiltPermission, runBrushSpecialtyAction, startDeviceTilt as startDeviceTilt2, warmCanvasHeat } from "@pixerate/editor/paint-editor";
741
+
742
+ // src/paint-editor/FerroPanel.tsx
743
+ import { useMemo as useMemo3 } from "react";
744
+ import { MAGNET_SLIDERS, readPath } from "@pixerate/editor/paint-editor";
745
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
746
+ var FerroPanel = ({ controller, className }) => {
747
+ const state = usePaintEditorState(controller);
748
+ const [error, attempt] = useAttempt();
749
+ const magnets = state.document.magnets ?? [];
750
+ const activeId = state.document.activeLayerId;
751
+ const info = useMemo3(() => {
752
+ try {
753
+ return activeId ? controller.getFerrofluid(activeId) : null;
754
+ } catch {
755
+ return null;
756
+ }
757
+ }, [controller, state.document, activeId]);
758
+ return /* @__PURE__ */ jsxs4("div", { className: `${panel} ${className ?? ""}`, "data-testid": "ferro-panel", children: [
759
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between", children: [
760
+ /* @__PURE__ */ jsx5("span", { className: "font-medium text-slate-300", children: "Ferrofluid & magnets" }),
761
+ /* @__PURE__ */ jsxs4("div", { className: "flex gap-1", children: [
762
+ /* @__PURE__ */ jsx5(
763
+ "button",
764
+ {
765
+ type: "button",
766
+ className: button,
767
+ onClick: () => attempt(() => controller.addMagnet({ x: Math.round(state.document.canvas.width / 2), y: Math.round(state.document.canvas.height / 2) })),
768
+ children: "Add magnet"
769
+ }
770
+ ),
771
+ magnets.length > 0 && /* @__PURE__ */ jsx5("button", { type: "button", className: button, onClick: () => attempt(() => controller.removeMagnets()), children: "Clear magnets" })
772
+ ] })
773
+ ] }),
774
+ magnets.map((m) => /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-1 rounded border border-slate-800 p-1.5", "data-magnet": m.id, children: [
775
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between text-[11px]", children: [
776
+ /* @__PURE__ */ jsxs4("span", { className: "font-mono text-slate-300", children: [
777
+ m.id,
778
+ " (",
779
+ Math.round(m.x),
780
+ ", ",
781
+ Math.round(m.y),
782
+ ")"
783
+ ] }),
784
+ /* @__PURE__ */ jsx5("button", { type: "button", "aria-label": `Remove magnet ${m.id}`, className: "px-1 text-slate-400 hover:text-white", onClick: () => attempt(() => controller.removeMagnets([m.id])), children: "\xD7" })
785
+ ] }),
786
+ MAGNET_SLIDERS.map((c) => /* @__PURE__ */ jsx5(
787
+ PaintSlider,
788
+ {
789
+ control: { ...c, label: `${c.label} (${m.id})` },
790
+ value: readPath(m, c.path),
791
+ onCommit: (v) => attempt(() => controller.updateMagnet(m.id, { [c.path]: v }))
792
+ },
793
+ c.path
794
+ ))
795
+ ] }, m.id)),
796
+ /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2", children: [
797
+ /* @__PURE__ */ jsx5("span", { className: "text-[11px] text-slate-400", children: info?.ferro ? `${info.activeSpikeArea} spike px \xB7 max ${Math.round(info.maxSpikeHeight * 100)}%` : "No liquid ferrofluid on layer" }),
798
+ /* @__PURE__ */ jsx5("button", { type: "button", className: button, disabled: !info?.ferro, onClick: () => attempt(() => controller.cureFerrofluid()), children: "Cure ferrofluid" })
799
+ ] }),
800
+ /* @__PURE__ */ jsx5(ErrorLine, { error })
801
+ ] });
802
+ };
803
+
804
+ // src/paint-editor/SpecialtyPanel.tsx
805
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
806
+ var SpecialtyGuideCard = ({ controller, onOpenSpecialtyPanel, className }) => {
807
+ const state = usePaintEditorState(controller);
808
+ const [error, attempt] = useAttempt();
809
+ const guides = brushSpecialtyGuides(state);
810
+ if (!guides.length) return null;
811
+ return /* @__PURE__ */ jsxs5("div", { className: `flex flex-col gap-2 rounded-lg border border-indigo-500/40 bg-indigo-950/30 p-2 ${className ?? ""}`, "data-testid": "brush-specialty-guide", children: [
812
+ guides.map((g) => /* @__PURE__ */ jsx6(GuideItem, { guide: g, onAction: (a) => attempt(() => runBrushSpecialtyAction(controller, a)) }, g.kind)),
813
+ onOpenSpecialtyPanel && /* @__PURE__ */ jsx6("button", { type: "button", className: `${button} self-start`, onClick: onOpenSpecialtyPanel, children: "Open Specialty panel" }),
814
+ /* @__PURE__ */ jsx6(ErrorLine, { error })
815
+ ] });
816
+ };
817
+ var GuideItem = ({ guide: g, onAction }) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", "data-specialty": g.kind, children: [
818
+ /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-1.5", children: [
819
+ /* @__PURE__ */ jsx6("span", { className: "rounded bg-indigo-600 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-white", children: "Specialty" }),
820
+ /* @__PURE__ */ jsx6("span", { className: "font-medium text-slate-200", children: g.title })
821
+ ] }),
822
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] leading-snug text-slate-400", children: g.howToUse }),
823
+ /* @__PURE__ */ jsxs5("p", { role: "status", "data-ready": g.ready, className: `text-[11px] ${g.ready ? "text-emerald-400" : "text-amber-400"}`, children: [
824
+ g.ready ? "\u25CF " : "\u25CB ",
825
+ g.status
826
+ ] }),
827
+ g.actions.length > 0 && /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: g.actions.map((a) => /* @__PURE__ */ jsx6("button", { type: "button", className: button, "data-action": a.id, title: `${a.tool}`, onClick: () => onAction(a), children: a.label }, a.id)) })
828
+ ] });
829
+ var PICKS = ["ferrofluid", "uv-marker", "thermo-ink", "soap-film", "ghost-wash", "mutation-wash", "turing-wash"];
830
+ var SpecialtyPanel = ({ controller, className }) => {
831
+ const state = usePaintEditorState(controller);
832
+ const [error, attempt] = useAttempt();
833
+ const [tiltFollow, setTiltFollow] = useState5(false);
834
+ useEffect4(() => tiltFollow ? startDeviceTilt2(controller) : void 0, [controller, tiltFollow]);
835
+ const guides = brushSpecialtyGuides(state);
836
+ const picks = PICKS.filter((id) => state.brushes.some((b) => b.id === id));
837
+ const heat = state.heat;
838
+ const tilted = state.viewTilt.x !== 0 || state.viewTilt.y !== 0;
839
+ return /* @__PURE__ */ jsxs5("div", { className: `${panel} ${className ?? ""}`, "data-testid": "specialty-panel", children: [
840
+ guides.length ? /* @__PURE__ */ jsx6(SpecialtyGuideCard, { controller }) : /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1", "data-testid": "specialty-picks", children: [
841
+ /* @__PURE__ */ jsx6("span", { className: "text-slate-400", children: "The active brush is a standard one. Pick a specialty brush:" }),
842
+ /* @__PURE__ */ jsx6("div", { className: "flex flex-wrap gap-1", children: picks.map((id) => /* @__PURE__ */ jsx6("button", { type: "button", className: button, onClick: () => attempt(() => controller.setBrush({ id })), children: state.brushes.find((b) => b.id === id).name }, id)) })
843
+ ] }),
844
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1.5", "data-testid": "uv-heat-panel", children: [
845
+ /* @__PURE__ */ jsx6("span", { className: "font-medium text-slate-300", children: "UV blacklight & heat" }),
846
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] leading-snug text-slate-500", children: "UV-fluorescent ink (UV marker) glows in its own colour under the blacklight; invisible UV ink shows only under it. Thermochromic ink (Thermochromic ink preset) shifts toward its hot colour where the canvas is warm." }),
847
+ /* @__PURE__ */ jsxs5("label", { className: "flex items-center gap-2", children: [
848
+ /* @__PURE__ */ jsx6("input", { type: "checkbox", checked: state.uvLight.on, onChange: (e) => attempt(() => controller.setUvLight({ on: e.target.checked })) }),
849
+ " UV blacklight"
850
+ ] }),
851
+ UV_LIGHT_SLIDERS.map((c) => /* @__PURE__ */ jsx6(PaintSlider, { control: c, value: readPath2(state.uvLight, c.path), onChange: (v) => attempt(() => controller.setUvLight({ [c.path]: v })) }, c.path)),
852
+ /* @__PURE__ */ jsx6("span", { className: "text-[11px] text-slate-400", role: "status", children: heat.hotCells > 0 ? `Canvas heat: ${Math.round(heat.max * 100)}% at its warmest` : "Canvas is cool" }),
853
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-1", children: [
854
+ /* @__PURE__ */ jsx6("button", { type: "button", className: button, onClick: () => attempt(() => controller.paintHeat(warmCanvasHeat(state.document.canvas))), children: "Warm canvas" }),
855
+ /* @__PURE__ */ jsx6("button", { type: "button", className: button, disabled: heat.hotCells === 0, onClick: () => attempt(() => controller.advanceHeat(10)), children: "Step heat" }),
856
+ /* @__PURE__ */ jsx6("button", { type: "button", className: button, disabled: heat.hotCells === 0, onClick: () => attempt(() => controller.clearHeat()), children: "Cool canvas" })
857
+ ] })
858
+ ] }),
859
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1.5", children: [
860
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] leading-snug text-slate-500", children: "Ferrofluid and Ferro ink pool into liquid magnetic paint that magnets pull into 3D Rosensweig spikes." }),
861
+ /* @__PURE__ */ jsx6(FerroPanel, { controller })
862
+ ] }),
863
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1.5", "data-testid": "view-tilt-panel", children: [
864
+ /* @__PURE__ */ jsx6("span", { className: "font-medium text-slate-300", children: "Thin-film iridescence & view tilt" }),
865
+ /* @__PURE__ */ jsx6("p", { className: "text-[11px] leading-snug text-slate-500", children: "Scarab lacquer, Soap film and Pearl glaze shift colour with the viewing angle." }),
866
+ VIEW_TILT_SLIDERS.map((c) => /* @__PURE__ */ jsx6(PaintSlider, { control: c, value: readPath2(state.viewTilt, c.path), onChange: (v) => attempt(() => controller.setViewTilt({ [c.path]: v })) }, c.path)),
867
+ /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-1", children: [
868
+ /* @__PURE__ */ jsx6("button", { type: "button", className: button, disabled: !tilted, onClick: () => attempt(() => controller.setViewTilt({ x: 0, y: 0 })), children: "Reset tilt" }),
869
+ /* @__PURE__ */ jsx6(
870
+ "button",
871
+ {
872
+ type: "button",
873
+ "aria-pressed": tiltFollow,
874
+ className: chip(tiltFollow),
875
+ onClick: () => attempt(async () => {
876
+ if (!tiltFollow && !await requestDeviceTiltPermission()) return;
877
+ setTiltFollow((v) => !v);
878
+ }),
879
+ children: "Device tilt"
880
+ }
881
+ )
882
+ ] })
883
+ ] }),
884
+ /* @__PURE__ */ jsx6(ErrorLine, { error })
885
+ ] });
886
+ };
887
+
738
888
  // src/paint-editor/BrushPanel.tsx
739
- import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
740
- var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, className }) => {
889
+ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
890
+ var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, onOpenSpecialtyPanel, className }) => {
741
891
  const state = usePaintEditorState(controller);
742
892
  const [error, attempt] = useAttempt();
743
893
  const fileRef = useRef4(null);
744
894
  const { brush, brushes } = state;
745
895
  const paper = state.document.paper;
746
- const thumbs = useMemo3(
896
+ const thumbs = useMemo4(
747
897
  // Each in a colour that reads on the paper (the brush's own default when it has one).
748
898
  () => new Map(brushes.map((b) => [b.id, controller.brushThumbnail(b.id, { width: thumbnailWidth, height: thumbnailHeight, color: brushPreviewColours(controller.getBrushSpec(b.id), { paper: paper.color }).color })])),
749
899
  // Thumbnails follow the library and the paper.
750
900
  // eslint-disable-next-line react-hooks/exhaustive-deps
751
901
  [controller, brushes, paper, thumbnailWidth, thumbnailHeight]
752
902
  );
753
- const entries = useMemo3(() => brushes.map((b) => ({ brush: controller.getBrushSpec(b.id), builtin: Boolean(b.builtin) })), [controller, brushes]);
754
- const spec = useMemo3(() => controller.getBrushSpec(), [controller, brush]);
903
+ const entries = useMemo4(() => brushes.map((b) => ({ brush: controller.getBrushSpec(b.id), builtin: Boolean(b.builtin) })), [controller, brushes]);
904
+ const spec = useMemo4(() => controller.getBrushSpec(), [controller, brush]);
755
905
  const own = typeof spec.colour?.default === "string" && /^#[0-9a-f]{6}/i.test(spec.colour.default) ? spec.colour.default.slice(0, 7) : void 0;
756
- const preview = useMemo3(() => controller.brushThumbnail(brush.id, { width: 240, height: 64, color: own }), [controller, brush, paper, state.color, own]);
906
+ const preview = useMemo4(() => controller.brushThumbnail(brush.id, { width: 240, height: 64, color: own }), [controller, brush, paper, state.color, own]);
757
907
  const carried = brushLoadColor(state.mixerLoad);
758
908
  const palette = (spec.colour?.palette ?? []).flatMap((c) => brushColourHex(c, state.colorScheme) ?? []);
759
909
  const slug = (name) => name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "brush";
760
910
  const loads = (["dab", "mixer", "impasto"].includes(brush.engine) || brush.engine === "wet" && brush.wet.tool === "paint") && !brush.ghost && !brush.mutation;
761
- return /* @__PURE__ */ jsxs4("div", { className: `${panel} ${className ?? ""}`, "data-testid": "brush-panel", children: [
762
- /* @__PURE__ */ jsx5(BrushLibraryBrowser, { entries, activeId: brush.id, onSelect: (id) => controller.setBrush({ id }), thumbnail: (id) => thumbs.get(id) ?? null, thumbnailWidth, thumbnailHeight }),
763
- /* @__PURE__ */ jsx5(
911
+ return /* @__PURE__ */ jsxs6("div", { className: `${panel} ${className ?? ""}`, "data-testid": "brush-panel", children: [
912
+ /* @__PURE__ */ jsx7(BrushLibraryBrowser, { entries, activeId: brush.id, onSelect: (id) => controller.setBrush({ id }), thumbnail: (id) => thumbs.get(id) ?? null, thumbnailWidth, thumbnailHeight }),
913
+ /* @__PURE__ */ jsx7(SpecialtyGuideCard, { controller, onOpenSpecialtyPanel }),
914
+ /* @__PURE__ */ jsx7(
764
915
  BrushEditor,
765
916
  {
766
917
  brush: spec,
@@ -772,40 +923,40 @@ var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, clas
772
923
  onAddSource: async (file) => (await addBrushSourceFromFile(controller.brushLibrary, file)).ref,
773
924
  renderExtra: (section) => {
774
925
  if (section === "shape" && brush.engine === "sticker")
775
- return /* @__PURE__ */ jsx5(StickerPicker, { controller, label: "Sticker stamps", selected: brush.sticker.stamps, onPick: (ref) => controller.setBrush({ sticker: { stamps: toggleStickerRef(brush.sticker.stamps, ref) } }) });
926
+ return /* @__PURE__ */ jsx7(StickerPicker, { controller, label: "Sticker stamps", selected: brush.sticker.stamps, onPick: (ref) => controller.setBrush({ sticker: { stamps: toggleStickerRef(brush.sticker.stamps, ref) } }) });
776
927
  if (section === "behaviour")
777
- return /* @__PURE__ */ jsxs4(Fragment3, { children: [
778
- brush.mutation && !state.hasMutationAgent && /* @__PURE__ */ jsx5("p", { className: "text-[11px] text-amber-400", role: "status", "data-paint-mutation-unconnected": true, children: "No agent is connected \u2014 mutation strokes will stay as ordinary paint." }),
779
- loads && /* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-1", children: [
780
- /* @__PURE__ */ jsx5("span", { className: "text-slate-400", children: "Carries" }),
781
- /* @__PURE__ */ jsx5("span", { "aria-label": "Brush load", title: carried ?? "Clean", className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: carried ?? "transparent" } }),
782
- brush.engine === "mixer" && /* @__PURE__ */ jsx5("button", { type: "button", className: button, onClick: () => controller.loadMixerBrush(), children: "Load" }),
783
- /* @__PURE__ */ jsx5("button", { type: "button", className: button, onClick: () => controller.cleanMixerBrush(brush.engine === "mixer"), children: "Clean" })
928
+ return /* @__PURE__ */ jsxs6(Fragment3, { children: [
929
+ brush.mutation && !state.hasMutationAgent && /* @__PURE__ */ jsx7("p", { className: "text-[11px] text-amber-400", role: "status", "data-paint-mutation-unconnected": true, children: "No agent is connected \u2014 mutation strokes will stay as ordinary paint." }),
930
+ loads && /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-1", children: [
931
+ /* @__PURE__ */ jsx7("span", { className: "text-slate-400", children: "Carries" }),
932
+ /* @__PURE__ */ jsx7("span", { "aria-label": "Brush load", title: carried ?? "Clean", className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: carried ?? "transparent" } }),
933
+ brush.engine === "mixer" && /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => controller.loadMixerBrush(), children: "Load" }),
934
+ /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => controller.cleanMixerBrush(brush.engine === "mixer"), children: "Clean" })
784
935
  ] })
785
936
  ] });
786
937
  if (section === "colour")
787
- return /* @__PURE__ */ jsxs4(Fragment3, { children: [
788
- palette.length > 0 && /* @__PURE__ */ jsx5("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Paint with a palette colour", children: palette.map((hex, i) => /* @__PURE__ */ jsx5("button", { type: "button", "aria-label": `Paint with ${hex}`, title: hex, "aria-pressed": state.color === hex, className: `h-5 w-5 rounded ring-1 ${state.color === hex ? "ring-white" : "ring-slate-700"}`, style: { background: hex }, onClick: () => controller.setColor(hex) }, `${hex}-${i}`)) }),
789
- /* @__PURE__ */ jsxs4("label", { className: "flex items-center gap-2", title: "Choosing a brush with a default colour (the highlighter's yellow) makes it your colour unless this is on", children: [
790
- /* @__PURE__ */ jsx5("input", { type: "checkbox", "aria-label": "Keep my colour", checked: state.colorLocked, onChange: (e) => controller.setColorLocked(e.target.checked) }),
938
+ return /* @__PURE__ */ jsxs6(Fragment3, { children: [
939
+ palette.length > 0 && /* @__PURE__ */ jsx7("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Paint with a palette colour", children: palette.map((hex, i) => /* @__PURE__ */ jsx7("button", { type: "button", "aria-label": `Paint with ${hex}`, title: hex, "aria-pressed": state.color === hex, className: `h-5 w-5 rounded ring-1 ${state.color === hex ? "ring-white" : "ring-slate-700"}`, style: { background: hex }, onClick: () => controller.setColor(hex) }, `${hex}-${i}`)) }),
940
+ /* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-2", title: "Choosing a brush with a default colour (the highlighter's yellow) makes it your colour unless this is on", children: [
941
+ /* @__PURE__ */ jsx7("input", { type: "checkbox", "aria-label": "Keep my colour", checked: state.colorLocked, onChange: (e) => controller.setColorLocked(e.target.checked) }),
791
942
  " Keep my colour when choosing a brush"
792
943
  ] }),
793
- brushTakesPaint(brush) && /* @__PURE__ */ jsxs4("div", { className: "flex flex-col gap-1.5", "data-testid": "brush-gradient", children: [
794
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between gap-2", children: [
795
- /* @__PURE__ */ jsx5("span", { className: "text-slate-400", title: "A gradient of the brush's own, used instead of the paint (the multi-colour brush)", children: "Brush gradient" }),
796
- /* @__PURE__ */ jsx5("button", { type: "button", "aria-pressed": brush.paint !== null, className: chip(brush.paint !== null), onClick: () => attempt(() => controller.setBrush({ paint: brush.paint ? null : DEFAULT_PAINT_GRADIENT })), children: brush.paint ? "On" : "Off" })
944
+ brushTakesPaint(brush) && /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-1.5", "data-testid": "brush-gradient", children: [
945
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-2", children: [
946
+ /* @__PURE__ */ jsx7("span", { className: "text-slate-400", title: "A gradient of the brush's own, used instead of the paint (the multi-colour brush)", children: "Brush gradient" }),
947
+ /* @__PURE__ */ jsx7("button", { type: "button", "aria-pressed": brush.paint !== null, className: chip(brush.paint !== null), onClick: () => attempt(() => controller.setBrush({ paint: brush.paint ? null : DEFAULT_PAINT_GRADIENT })), children: brush.paint ? "On" : "Off" })
797
948
  ] }),
798
- brush.paint && /* @__PURE__ */ jsx5(PaintGradientEditor, { value: brush.paint, colors: { paint: state.color, secondary: state.secondaryColor }, onChange: (g) => attempt(() => controller.setBrush({ paint: g })) })
949
+ brush.paint && /* @__PURE__ */ jsx7(PaintGradientEditor, { value: brush.paint, colors: { paint: state.color, secondary: state.secondaryColor }, onChange: (g) => attempt(() => controller.setBrush({ paint: g })) })
799
950
  ] })
800
951
  ] });
801
952
  return null;
802
953
  }
803
954
  }
804
955
  ),
805
- /* @__PURE__ */ jsxs4("div", { className: "flex flex-wrap items-center gap-1", children: [
806
- /* @__PURE__ */ jsx5("button", { type: "button", className: button, onClick: () => attempt(async () => downloadBytes2(JSON.stringify(await controller.exportBrushes(), null, 2), "brushes.json", "application/json")), children: "Export" }),
807
- /* @__PURE__ */ jsx5("button", { type: "button", className: button, onClick: () => fileRef.current?.click(), children: "Import\u2026" }),
808
- /* @__PURE__ */ jsx5(
956
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-1", children: [
957
+ /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => attempt(async () => downloadBytes2(JSON.stringify(await controller.exportBrushes(), null, 2), "brushes.json", "application/json")), children: "Export" }),
958
+ /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => fileRef.current?.click(), children: "Import\u2026" }),
959
+ /* @__PURE__ */ jsx7(
809
960
  "input",
810
961
  {
811
962
  ref: fileRef,
@@ -821,88 +972,26 @@ var BrushPanel = ({ controller, thumbnailWidth = 112, thumbnailHeight = 32, clas
821
972
  }
822
973
  )
823
974
  ] }),
824
- /* @__PURE__ */ jsx5(ErrorLine, { error })
975
+ /* @__PURE__ */ jsx7(ErrorLine, { error })
825
976
  ] });
826
977
  };
827
978
 
828
979
  // src/paint-editor/PaperPanel.tsx
829
- import { useEffect as useEffect4, useMemo as useMemo5, useState as useState5 } from "react";
830
- import { DEFAULT_BACKLIGHT_COLOR, LIGHT_SLIDERS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_SLIDERS, UV_LIGHT_SLIDERS, VIEW_TILT_SLIDERS, patchPath, readPath as readPath4, renderPaper, requestDeviceTiltPermission, startDeviceTilt as startDeviceTilt2 } from "@pixerate/editor/paint-editor";
831
-
832
- // src/paint-editor/FerroPanel.tsx
833
- import { useMemo as useMemo4 } from "react";
834
- import { MAGNET_SLIDERS, readPath } from "@pixerate/editor/paint-editor";
835
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
836
- var FerroPanel = ({ controller, className }) => {
837
- const state = usePaintEditorState(controller);
838
- const [error, attempt] = useAttempt();
839
- const magnets = state.document.magnets ?? [];
840
- const activeId = state.document.activeLayerId;
841
- const info = useMemo4(() => {
842
- try {
843
- return activeId ? controller.getFerrofluid(activeId) : null;
844
- } catch {
845
- return null;
846
- }
847
- }, [controller, state.document, activeId]);
848
- return /* @__PURE__ */ jsxs5("div", { className: `${panel} ${className ?? ""}`, "data-testid": "ferro-panel", children: [
849
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
850
- /* @__PURE__ */ jsx6("span", { className: "font-medium text-slate-300", children: "Ferrofluid & magnets" }),
851
- /* @__PURE__ */ jsxs5("div", { className: "flex gap-1", children: [
852
- /* @__PURE__ */ jsx6(
853
- "button",
854
- {
855
- type: "button",
856
- className: button,
857
- onClick: () => attempt(() => controller.addMagnet({ x: Math.round(state.document.canvas.width / 2), y: Math.round(state.document.canvas.height / 2) })),
858
- children: "Add magnet"
859
- }
860
- ),
861
- magnets.length > 0 && /* @__PURE__ */ jsx6("button", { type: "button", className: button, onClick: () => attempt(() => controller.removeMagnets()), children: "Clear magnets" })
862
- ] })
863
- ] }),
864
- magnets.map((m) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1 rounded border border-slate-800 p-1.5", "data-magnet": m.id, children: [
865
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between text-[11px]", children: [
866
- /* @__PURE__ */ jsxs5("span", { className: "font-mono text-slate-300", children: [
867
- m.id,
868
- " (",
869
- Math.round(m.x),
870
- ", ",
871
- Math.round(m.y),
872
- ")"
873
- ] }),
874
- /* @__PURE__ */ jsx6("button", { type: "button", "aria-label": `Remove magnet ${m.id}`, className: "px-1 text-slate-400 hover:text-white", onClick: () => attempt(() => controller.removeMagnets([m.id])), children: "\xD7" })
875
- ] }),
876
- MAGNET_SLIDERS.map((c) => /* @__PURE__ */ jsx6(
877
- PaintSlider,
878
- {
879
- control: { ...c, label: `${c.label} (${m.id})` },
880
- value: readPath(m, c.path),
881
- onCommit: (v) => attempt(() => controller.updateMagnet(m.id, { [c.path]: v }))
882
- },
883
- c.path
884
- ))
885
- ] }, m.id)),
886
- /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between gap-2", children: [
887
- /* @__PURE__ */ jsx6("span", { className: "text-[11px] text-slate-400", children: info?.ferro ? `${info.activeSpikeArea} spike px \xB7 max ${Math.round(info.maxSpikeHeight * 100)}%` : "No liquid ferrofluid on layer" }),
888
- /* @__PURE__ */ jsx6("button", { type: "button", className: button, disabled: !info?.ferro, onClick: () => attempt(() => controller.cureFerrofluid()), children: "Cure ferrofluid" })
889
- ] }),
890
- /* @__PURE__ */ jsx6(ErrorLine, { error })
891
- ] });
892
- };
980
+ import { useMemo as useMemo5 } from "react";
981
+ import { DEFAULT_BACKLIGHT_COLOR, LIGHT_SLIDERS, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_SLIDERS, patchPath, readPath as readPath5, renderPaper } from "@pixerate/editor/paint-editor";
893
982
 
894
983
  // src/paint-editor/TimeMachinePanel.tsx
895
- import { AGE_SLIDERS, readPath as readPath2 } from "@pixerate/editor/paint-editor";
896
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
984
+ import { AGE_SLIDERS, readPath as readPath3 } from "@pixerate/editor/paint-editor";
985
+ import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
897
986
  var TimeMachinePanel = ({ controller, className }) => {
898
987
  const state = usePaintEditorState(controller);
899
988
  const [error, attempt] = useAttempt();
900
989
  const age = state.age;
901
- return /* @__PURE__ */ jsxs6("div", { className: `${panel} ${className ?? ""}`, "data-testid": "time-machine-panel", children: [
902
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between gap-1", children: [
903
- /* @__PURE__ */ jsx7("span", { className: "font-medium text-slate-300", children: "Time machine (ageing & X-ray)" }),
904
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap gap-1", children: [
905
- /* @__PURE__ */ jsx7(
990
+ return /* @__PURE__ */ jsxs7("div", { className: `${panel} ${className ?? ""}`, "data-testid": "time-machine-panel", children: [
991
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between gap-1", children: [
992
+ /* @__PURE__ */ jsx8("span", { className: "font-medium text-slate-300", children: "Time machine (ageing & X-ray)" }),
993
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap gap-1", children: [
994
+ /* @__PURE__ */ jsx8(
906
995
  "button",
907
996
  {
908
997
  type: "button",
@@ -911,11 +1000,11 @@ var TimeMachinePanel = ({ controller, className }) => {
911
1000
  children: "Age 300 yr"
912
1001
  }
913
1002
  ),
914
- age.years > 0 && /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => attempt(() => controller.setAge({ years: 0 })), children: "Fresh" })
1003
+ age.years > 0 && /* @__PURE__ */ jsx8("button", { type: "button", className: button, onClick: () => attempt(() => controller.setAge({ years: 0 })), children: "Fresh" })
915
1004
  ] })
916
1005
  ] }),
917
- /* @__PURE__ */ jsxs6("label", { className: "flex items-center gap-2", children: [
918
- /* @__PURE__ */ jsx7(
1006
+ /* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2", children: [
1007
+ /* @__PURE__ */ jsx8(
919
1008
  "input",
920
1009
  {
921
1010
  type: "checkbox",
@@ -926,17 +1015,17 @@ var TimeMachinePanel = ({ controller, className }) => {
926
1015
  " ",
927
1016
  "X-ray view (pentimento)"
928
1017
  ] }),
929
- AGE_SLIDERS.map((c) => /* @__PURE__ */ jsx7(
1018
+ AGE_SLIDERS.map((c) => /* @__PURE__ */ jsx8(
930
1019
  PaintSlider,
931
1020
  {
932
1021
  control: c,
933
- value: readPath2(age, c.path),
1022
+ value: readPath3(age, c.path),
934
1023
  onChange: (v) => attempt(() => controller.setAge({ [c.path]: v }))
935
1024
  },
936
1025
  c.path
937
1026
  )),
938
- /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-1.5", children: [
939
- /* @__PURE__ */ jsx7(
1027
+ /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1028
+ /* @__PURE__ */ jsx8(
940
1029
  "button",
941
1030
  {
942
1031
  type: "button",
@@ -946,8 +1035,8 @@ var TimeMachinePanel = ({ controller, className }) => {
946
1035
  children: "Bake age"
947
1036
  }
948
1037
  ),
949
- /* @__PURE__ */ jsx7("button", { type: "button", className: button, onClick: () => attempt(() => controller.setAge({ seed: age.seed + 1 })), children: "New crack seed" }),
950
- /* @__PURE__ */ jsx7(
1038
+ /* @__PURE__ */ jsx8("button", { type: "button", className: button, onClick: () => attempt(() => controller.setAge({ seed: age.seed + 1 })), children: "New crack seed" }),
1039
+ /* @__PURE__ */ jsx8(
951
1040
  "button",
952
1041
  {
953
1042
  type: "button",
@@ -957,13 +1046,13 @@ var TimeMachinePanel = ({ controller, className }) => {
957
1046
  }
958
1047
  )
959
1048
  ] }),
960
- /* @__PURE__ */ jsx7(ErrorLine, { error })
1049
+ /* @__PURE__ */ jsx8(ErrorLine, { error })
961
1050
  ] });
962
1051
  };
963
1052
 
964
1053
  // src/paint-editor/CulturePanel.tsx
965
- import { CULTURE_SLIDERS, readPath as readPath3 } from "@pixerate/editor/paint-editor";
966
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1054
+ import { CULTURE_SLIDERS, readPath as readPath4 } from "@pixerate/editor/paint-editor";
1055
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
967
1056
  var CulturePanel = ({ controller, className }) => {
968
1057
  const state = usePaintEditorState(controller);
969
1058
  const [error, attempt] = useAttempt();
@@ -973,12 +1062,12 @@ var CulturePanel = ({ controller, className }) => {
973
1062
  const totalTips = cultures.layers.reduce((acc, l) => acc + l.tips, 0);
974
1063
  const totalSegments = cultures.layers.reduce((acc, l) => acc + l.segments, 0);
975
1064
  const canCarryCulture = ["dab", "mixer", "impasto", "particle", "bristle"].includes(brush.engine);
976
- return /* @__PURE__ */ jsxs7("div", { className: `${panel} ${className ?? ""}`, "data-testid": "culture-panel", children: [
977
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
978
- /* @__PURE__ */ jsx8("span", { className: "font-medium text-slate-300", children: "Biopaint (mycelial ink)" }),
979
- /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
980
- /* @__PURE__ */ jsx8("button", { type: "button", className: button, onClick: () => attempt(() => controller.growCultures({ steps: 40 })), children: "Grow" }),
981
- /* @__PURE__ */ jsx8(
1065
+ return /* @__PURE__ */ jsxs8("div", { className: `${panel} ${className ?? ""}`, "data-testid": "culture-panel", children: [
1066
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
1067
+ /* @__PURE__ */ jsx9("span", { className: "font-medium text-slate-300", children: "Biopaint (mycelial ink)" }),
1068
+ /* @__PURE__ */ jsxs8("div", { className: "flex gap-1", children: [
1069
+ /* @__PURE__ */ jsx9("button", { type: "button", className: button, onClick: () => attempt(() => controller.growCultures({ steps: 40 })), children: "Grow" }),
1070
+ /* @__PURE__ */ jsx9(
982
1071
  "button",
983
1072
  {
984
1073
  type: "button",
@@ -988,7 +1077,7 @@ var CulturePanel = ({ controller, className }) => {
988
1077
  children: cultures.paused ? "Paused" : "Pause"
989
1078
  }
990
1079
  ),
991
- /* @__PURE__ */ jsx8(
1080
+ /* @__PURE__ */ jsx9(
992
1081
  "button",
993
1082
  {
994
1083
  type: "button",
@@ -1000,9 +1089,9 @@ var CulturePanel = ({ controller, className }) => {
1000
1089
  )
1001
1090
  ] })
1002
1091
  ] }),
1003
- /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-between text-[11px] text-slate-400", children: /* @__PURE__ */ jsx8("span", { children: activeColony ? `${totalTips} living tips \xB7 ${totalSegments} segments (${activeColony.status})` : "No mycelial colony on canvas" }) }),
1004
- /* @__PURE__ */ jsxs7("label", { className: "flex items-center gap-2 text-[11px]", children: [
1005
- /* @__PURE__ */ jsx8(
1092
+ /* @__PURE__ */ jsx9("div", { className: "flex items-center justify-between text-[11px] text-slate-400", children: /* @__PURE__ */ jsx9("span", { children: activeColony ? `${totalTips} living tips \xB7 ${totalSegments} segments (${activeColony.status})` : "No mycelial colony on canvas" }) }),
1093
+ /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-2 text-[11px]", children: [
1094
+ /* @__PURE__ */ jsx9(
1006
1095
  "input",
1007
1096
  {
1008
1097
  type: "checkbox",
@@ -1012,10 +1101,10 @@ var CulturePanel = ({ controller, className }) => {
1012
1101
  ),
1013
1102
  "Grow while closed"
1014
1103
  ] }),
1015
- canCarryCulture && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1 border-t border-slate-800 pt-1.5", children: [
1016
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between", children: [
1017
- /* @__PURE__ */ jsx8("span", { className: "text-[11px] text-slate-400", children: "Brush spores" }),
1018
- /* @__PURE__ */ jsx8(
1104
+ canCarryCulture && /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1 border-t border-slate-800 pt-1.5", children: [
1105
+ /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
1106
+ /* @__PURE__ */ jsx9("span", { className: "text-[11px] text-slate-400", children: "Brush spores" }),
1107
+ /* @__PURE__ */ jsx9(
1019
1108
  "button",
1020
1109
  {
1021
1110
  type: "button",
@@ -1028,35 +1117,33 @@ var CulturePanel = ({ controller, className }) => {
1028
1117
  ] }),
1029
1118
  brush.culture && CULTURE_SLIDERS.map((c) => {
1030
1119
  const key = c.path.replace(/^culture\./, "");
1031
- return /* @__PURE__ */ jsx8(
1120
+ return /* @__PURE__ */ jsx9(
1032
1121
  PaintSlider,
1033
1122
  {
1034
1123
  control: c,
1035
- value: readPath3(brush.culture, key),
1124
+ value: readPath4(brush.culture, key),
1036
1125
  onCommit: (v) => attempt(() => controller.setBrush({ culture: { [key]: v } }))
1037
1126
  },
1038
1127
  c.path
1039
1128
  );
1040
1129
  })
1041
1130
  ] }),
1042
- /* @__PURE__ */ jsx8(ErrorLine, { error })
1131
+ /* @__PURE__ */ jsx9(ErrorLine, { error })
1043
1132
  ] });
1044
1133
  };
1045
1134
 
1046
1135
  // src/paint-editor/PaperPanel.tsx
1047
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1136
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1048
1137
  var SWATCH = { x: 0, y: 0, width: 64, height: 40 };
1049
1138
  var PaperPanel = ({ controller, className }) => {
1050
1139
  const state = usePaintEditorState(controller);
1051
1140
  const [error, attempt] = useAttempt();
1052
- const [tiltFollow, setTiltFollow] = useState5(false);
1053
- useEffect4(() => tiltFollow ? startDeviceTilt2(controller) : void 0, [controller, tiltFollow]);
1054
1141
  const paper = state.document.paper;
1055
1142
  const previews = useMemo5(() => new Map(PAPER_LIBRARY.map((p) => [p.preset, { ...SWATCH, data: renderPaper({ ...p, shading: Math.max(0.8, p.shading) }, SWATCH) }])), []);
1056
- return /* @__PURE__ */ jsxs8("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paper-panel", children: [
1057
- PAPER_FAMILIES.map((family) => /* @__PURE__ */ jsxs8("div", { children: [
1058
- /* @__PURE__ */ jsx9("div", { className: "mb-0.5 text-[10px] uppercase tracking-wide text-slate-500", children: family }),
1059
- /* @__PURE__ */ jsx9("div", { className: "flex flex-wrap gap-1", role: "listbox", "aria-label": `${family} papers`, children: PAPER_LIBRARY.filter((p) => p.family === family).map((p) => /* @__PURE__ */ jsx9(
1143
+ return /* @__PURE__ */ jsxs9("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paper-panel", children: [
1144
+ PAPER_FAMILIES.map((family) => /* @__PURE__ */ jsxs9("div", { children: [
1145
+ /* @__PURE__ */ jsx10("div", { className: "mb-0.5 text-[10px] uppercase tracking-wide text-slate-500", children: family }),
1146
+ /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap gap-1", role: "listbox", "aria-label": `${family} papers`, children: PAPER_LIBRARY.filter((p) => p.family === family).map((p) => /* @__PURE__ */ jsx10(
1060
1147
  "button",
1061
1148
  {
1062
1149
  type: "button",
@@ -1065,67 +1152,34 @@ var PaperPanel = ({ controller, className }) => {
1065
1152
  title: p.name,
1066
1153
  className: `rounded p-0.5 ${paper.preset === p.preset ? "ring-2 ring-indigo-500" : "ring-1 ring-slate-700 hover:ring-slate-500"}`,
1067
1154
  onClick: () => attempt(() => controller.setPaper({ preset: p.preset })),
1068
- children: /* @__PURE__ */ jsx9(PixelCanvas, { pixels: previews.get(p.preset) ?? null, label: p.name, style: { width: 48, height: 30 } })
1155
+ children: /* @__PURE__ */ jsx10(PixelCanvas, { pixels: previews.get(p.preset) ?? null, label: p.name, style: { width: 48, height: 30 } })
1069
1156
  },
1070
1157
  p.preset
1071
1158
  )) })
1072
1159
  ] }, family)),
1073
- /* @__PURE__ */ jsx9("div", { className: "text-slate-300", children: paper.name }),
1074
- /* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between", children: [
1075
- /* @__PURE__ */ jsx9("span", { className: "text-slate-400", children: "Colour" }),
1076
- /* @__PURE__ */ jsx9(CommitColorInput, { label: "Paper colour", value: paper.color, onCommit: (v) => attempt(() => controller.setPaper({ color: v })), className: "h-6 w-10 rounded bg-transparent" })
1160
+ /* @__PURE__ */ jsx10("div", { className: "text-slate-300", children: paper.name }),
1161
+ /* @__PURE__ */ jsxs9("label", { className: "flex items-center justify-between", children: [
1162
+ /* @__PURE__ */ jsx10("span", { className: "text-slate-400", children: "Colour" }),
1163
+ /* @__PURE__ */ jsx10(CommitColorInput, { label: "Paper colour", value: paper.color, onCommit: (v) => attempt(() => controller.setPaper({ color: v })), className: "h-6 w-10 rounded bg-transparent" })
1077
1164
  ] }),
1078
- PAPER_SLIDERS.map((c) => /* @__PURE__ */ jsx9(PaintSlider, { control: c, value: readPath4(paper, c.path), onCommit: (v) => attempt(() => controller.setPaper(patchPath(paper, c.path, v))) }, c.path)),
1079
- /* @__PURE__ */ jsxs8("label", { className: "flex items-center justify-between", children: [
1080
- /* @__PURE__ */ jsx9("span", { className: "text-slate-400", children: "Backlight colour" }),
1081
- /* @__PURE__ */ jsx9(CommitColorInput, { label: "Backlight colour", value: paper.backlightColor ?? DEFAULT_BACKLIGHT_COLOR, onCommit: (v) => attempt(() => controller.setPaper({ backlightColor: v })), className: "h-6 w-10 rounded bg-transparent" })
1165
+ PAPER_SLIDERS.map((c) => /* @__PURE__ */ jsx10(PaintSlider, { control: c, value: readPath5(paper, c.path), onCommit: (v) => attempt(() => controller.setPaper(patchPath(paper, c.path, v))) }, c.path)),
1166
+ /* @__PURE__ */ jsxs9("label", { className: "flex items-center justify-between", children: [
1167
+ /* @__PURE__ */ jsx10("span", { className: "text-slate-400", children: "Backlight colour" }),
1168
+ /* @__PURE__ */ jsx10(CommitColorInput, { label: "Backlight colour", value: paper.backlightColor ?? DEFAULT_BACKLIGHT_COLOR, onCommit: (v) => attempt(() => controller.setPaper({ backlightColor: v })), className: "h-6 w-10 rounded bg-transparent" })
1082
1169
  ] }),
1083
- /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-2", children: [
1084
- /* @__PURE__ */ jsx9("input", { type: "checkbox", checked: paper.tiling === "mirror", onChange: (e) => attempt(() => controller.setPaper({ tiling: e.target.checked ? "mirror" : "repeat" })) }),
1170
+ /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2", children: [
1171
+ /* @__PURE__ */ jsx10("input", { type: "checkbox", checked: paper.tiling === "mirror", onChange: (e) => attempt(() => controller.setPaper({ tiling: e.target.checked ? "mirror" : "repeat" })) }),
1085
1172
  " Mirror tiling"
1086
1173
  ] }),
1087
- /* @__PURE__ */ jsx9("button", { type: "button", className: "self-start px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.setPaper({ seed: paper.seed + 1 })), children: "New sheet" }),
1088
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", "data-testid": "light-panel", children: [
1089
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-slate-300", children: "Light (thick paint, iridescence, metallic paper)" }),
1090
- LIGHT_SLIDERS.map((c) => /* @__PURE__ */ jsx9(PaintSlider, { control: c, value: readPath4(controller.getLighting(), c.path), onChange: (v) => attempt(() => controller.setLighting({ [c.path]: v })) }, c.path)),
1091
- VIEW_TILT_SLIDERS.map((c) => /* @__PURE__ */ jsx9(PaintSlider, { control: c, value: readPath4(state.viewTilt, c.path), onChange: (v) => attempt(() => controller.setViewTilt({ [c.path]: v })) }, c.path)),
1092
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-1", children: [
1093
- /* @__PURE__ */ jsx9(
1094
- "button",
1095
- {
1096
- type: "button",
1097
- "aria-pressed": tiltFollow,
1098
- className: chip(tiltFollow),
1099
- onClick: () => attempt(async () => {
1100
- if (!tiltFollow && !await requestDeviceTiltPermission()) return;
1101
- setTiltFollow((v) => !v);
1102
- }),
1103
- children: "Device tilt"
1104
- }
1105
- ),
1106
- /* @__PURE__ */ jsx9("button", { type: "button", className: "self-start px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.flattenRelief()), children: "Flatten relief" })
1107
- ] })
1108
- ] }),
1109
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5", "data-testid": "uv-heat-panel", children: [
1110
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-slate-300", children: "UV blacklight & heat" }),
1111
- /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-2", children: [
1112
- /* @__PURE__ */ jsx9("input", { type: "checkbox", checked: state.uvLight.on, onChange: (e) => attempt(() => controller.setUvLight({ on: e.target.checked })) }),
1113
- " UV blacklight"
1114
- ] }),
1115
- UV_LIGHT_SLIDERS.map((c) => /* @__PURE__ */ jsx9(PaintSlider, { control: c, value: readPath4(state.uvLight, c.path), onChange: (v) => attempt(() => controller.setUvLight({ [c.path]: v })) }, c.path)),
1116
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-1.5", children: [
1117
- /* @__PURE__ */ jsx9("button", { type: "button", className: "px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.advanceHeat(10)), children: "Step heat" }),
1118
- /* @__PURE__ */ jsx9("button", { type: "button", className: "px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.clearHeat()), children: "Cool canvas" }),
1119
- state.heat.hotCells > 0 && /* @__PURE__ */ jsxs8("span", { className: "text-[11px] text-amber-400", children: [
1120
- Math.round(state.heat.max * 100),
1121
- "% warm"
1122
- ] })
1123
- ] })
1174
+ /* @__PURE__ */ jsx10("button", { type: "button", className: "self-start px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.setPaper({ seed: paper.seed + 1 })), children: "New sheet" }),
1175
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1.5", "data-testid": "light-panel", children: [
1176
+ /* @__PURE__ */ jsx10("span", { className: "font-medium text-slate-300", children: "Light (thick paint, iridescence, metallic paper)" }),
1177
+ LIGHT_SLIDERS.map((c) => /* @__PURE__ */ jsx10(PaintSlider, { control: c, value: readPath5(controller.getLighting(), c.path), onChange: (v) => attempt(() => controller.setLighting({ [c.path]: v })) }, c.path)),
1178
+ /* @__PURE__ */ jsx10("button", { type: "button", className: "self-start px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-200 hover:bg-slate-700", onClick: () => attempt(() => controller.flattenRelief()), children: "Flatten relief" })
1124
1179
  ] }),
1125
- /* @__PURE__ */ jsx9(FerroPanel, { controller }),
1126
- /* @__PURE__ */ jsx9(TimeMachinePanel, { controller }),
1127
- /* @__PURE__ */ jsx9(CulturePanel, { controller }),
1128
- /* @__PURE__ */ jsx9(ErrorLine, { error })
1180
+ /* @__PURE__ */ jsx10(TimeMachinePanel, { controller }),
1181
+ /* @__PURE__ */ jsx10(CulturePanel, { controller }),
1182
+ /* @__PURE__ */ jsx10(ErrorLine, { error })
1129
1183
  ] });
1130
1184
  };
1131
1185
 
@@ -1147,7 +1201,7 @@ import {
1147
1201
  wheelPoint
1148
1202
  } from "@pixerate/editor/paint-editor";
1149
1203
  import { DEFAULT_PAINT_GRADIENT as DEFAULT_PAINT_GRADIENT2, paintSourceCss } from "@pixerate/editor/paint-editor";
1150
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1204
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1151
1205
  var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className }) => {
1152
1206
  const state = usePaintEditorState(controller);
1153
1207
  const [error, attempt] = useAttempt();
@@ -1176,9 +1230,9 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1176
1230
  const y = Math.min(MIXING_PAD_HEIGHT, Math.max(0, (e.clientY - rect.top) * ky));
1177
1231
  return e.pointerType === "pen" && e.pressure > 0 ? { x, y, pressure: e.pressure } : { x, y };
1178
1232
  };
1179
- return /* @__PURE__ */ jsxs9("div", { className: `${panel} ${className ?? ""}`, "data-testid": "color-panel", children: [
1180
- /* @__PURE__ */ jsxs9("div", { className: "relative self-center", style: { width: wheelSize, height: wheelSize }, children: [
1181
- /* @__PURE__ */ jsx10(
1233
+ return /* @__PURE__ */ jsxs10("div", { className: `${panel} ${className ?? ""}`, "data-testid": "color-panel", children: [
1234
+ /* @__PURE__ */ jsxs10("div", { className: "relative self-center", style: { width: wheelSize, height: wheelSize }, children: [
1235
+ /* @__PURE__ */ jsx11(
1182
1236
  "div",
1183
1237
  {
1184
1238
  role: "slider",
@@ -1192,20 +1246,20 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1192
1246
  const rect = e.currentTarget.getBoundingClientRect();
1193
1247
  controller.setColor(wheelPick(e.clientX - rect.left - R, e.clientY - rect.top - R, wheel, color));
1194
1248
  },
1195
- children: /* @__PURE__ */ jsx10(PixelCanvas, { pixels: ring, label: "Colour wheel", style: { width: wheelSize, height: wheelSize } })
1249
+ children: /* @__PURE__ */ jsx11(PixelCanvas, { pixels: ring, label: "Colour wheel", style: { width: wheelSize, height: wheelSize } })
1196
1250
  }
1197
1251
  ),
1198
- /* @__PURE__ */ jsx10("svg", { className: "pointer-events-none absolute inset-0", width: wheelSize, height: wheelSize, "aria-hidden": "true", children: harmony.map((h, i) => {
1252
+ /* @__PURE__ */ jsx11("svg", { className: "pointer-events-none absolute inset-0", width: wheelSize, height: wheelSize, "aria-hidden": "true", children: harmony.map((h, i) => {
1199
1253
  const p = wheelPoint(h.angle, mid);
1200
- return /* @__PURE__ */ jsx10("circle", { cx: R + p.x, cy: R + p.y, r: i === 0 ? 7 : 5, fill: h.color, stroke: "#fff", strokeWidth: i === 0 ? 2 : 1 }, i);
1254
+ return /* @__PURE__ */ jsx11("circle", { cx: R + p.x, cy: R + p.y, r: i === 0 ? 7 : 5, fill: h.color, stroke: "#fff", strokeWidth: i === 0 ? 2 : 1 }, i);
1201
1255
  }) }),
1202
- /* @__PURE__ */ jsx10("div", { className: "absolute rounded-full border border-slate-700", style: { left: R - R * 0.45, top: R - R * 0.45, width: R * 0.9, height: R * 0.9, background: color } })
1256
+ /* @__PURE__ */ jsx11("div", { className: "absolute rounded-full border border-slate-700", style: { left: R - R * 0.45, top: R - R * 0.45, width: R * 0.9, height: R * 0.9, background: color } })
1203
1257
  ] }),
1204
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
1205
- /* @__PURE__ */ jsx10("input", { type: "color", "aria-label": "Paint colour", value: color, onChange: (e) => controller.setColor(e.target.value), className: "h-7 w-9 rounded bg-transparent" }),
1206
- /* @__PURE__ */ jsx10("input", { type: "color", "aria-label": "Second colour", value: state.secondaryColor, onChange: (e) => controller.setSecondaryColor(e.target.value), className: "h-5 w-7 rounded bg-transparent" }),
1207
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, title: "Swap colours (X)", onClick: () => controller.swapColors(), children: "Swap" }),
1208
- /* @__PURE__ */ jsx10(
1258
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", children: [
1259
+ /* @__PURE__ */ jsx11("input", { type: "color", "aria-label": "Paint colour", value: color, onChange: (e) => controller.setColor(e.target.value), className: "h-7 w-9 rounded bg-transparent" }),
1260
+ /* @__PURE__ */ jsx11("input", { type: "color", "aria-label": "Second colour", value: state.secondaryColor, onChange: (e) => controller.setSecondaryColor(e.target.value), className: "h-5 w-7 rounded bg-transparent" }),
1261
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, title: "Swap colours (X)", onClick: () => controller.swapColors(), children: "Swap" }),
1262
+ /* @__PURE__ */ jsx11(
1209
1263
  "input",
1210
1264
  {
1211
1265
  "aria-label": "Hex colour",
@@ -1216,8 +1270,8 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1216
1270
  color
1217
1271
  )
1218
1272
  ] }),
1219
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", "data-testid": "paint-source", children: [
1220
- /* @__PURE__ */ jsx10(
1273
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-2", "data-testid": "paint-source", children: [
1274
+ /* @__PURE__ */ jsx11(
1221
1275
  "span",
1222
1276
  {
1223
1277
  className: "h-5 flex-1 rounded ring-1 ring-slate-700",
@@ -1227,7 +1281,7 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1227
1281
  style: { background: effectWell ? `center / cover no-repeat url("${effectWell}")` : paintSourceCss(state.paint, { paint: color, secondary: state.secondaryColor }) }
1228
1282
  }
1229
1283
  ),
1230
- /* @__PURE__ */ jsx10(
1284
+ /* @__PURE__ */ jsx11(
1231
1285
  "button",
1232
1286
  {
1233
1287
  type: "button",
@@ -1239,26 +1293,26 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1239
1293
  }
1240
1294
  )
1241
1295
  ] }),
1242
- state.paint.type === "gradient" && /* @__PURE__ */ jsx10(PaintGradientEditor, { value: state.paint, colors: { paint: color, secondary: state.secondaryColor }, onChange: (g2) => attempt(() => controller.setPaint(g2)) }),
1243
- /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2", children: [
1244
- /* @__PURE__ */ jsx10("span", { className: "w-16 text-slate-400", children: "Saturation" }),
1245
- /* @__PURE__ */ jsx10("input", { type: "range", "aria-label": "Saturation", min: 0, max: 1, step: 0.01, value: hsv.s, onChange: (e) => setHsv(Number(e.target.value), hsv.v), className: "flex-1 accent-indigo-500" })
1296
+ state.paint.type === "gradient" && /* @__PURE__ */ jsx11(PaintGradientEditor, { value: state.paint, colors: { paint: color, secondary: state.secondaryColor }, onChange: (g2) => attempt(() => controller.setPaint(g2)) }),
1297
+ /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", children: [
1298
+ /* @__PURE__ */ jsx11("span", { className: "w-16 text-slate-400", children: "Saturation" }),
1299
+ /* @__PURE__ */ jsx11("input", { type: "range", "aria-label": "Saturation", min: 0, max: 1, step: 0.01, value: hsv.s, onChange: (e) => setHsv(Number(e.target.value), hsv.v), className: "flex-1 accent-indigo-500" })
1246
1300
  ] }),
1247
- /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2", children: [
1248
- /* @__PURE__ */ jsx10("span", { className: "w-16 text-slate-400", children: "Value" }),
1249
- /* @__PURE__ */ jsx10("input", { type: "range", "aria-label": "Value", min: 0, max: 1, step: 0.01, value: hsv.v, onChange: (e) => setHsv(hsv.s, Number(e.target.value)), className: "flex-1 accent-indigo-500" })
1301
+ /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", children: [
1302
+ /* @__PURE__ */ jsx11("span", { className: "w-16 text-slate-400", children: "Value" }),
1303
+ /* @__PURE__ */ jsx11("input", { type: "range", "aria-label": "Value", min: 0, max: 1, step: 0.01, value: hsv.v, onChange: (e) => setHsv(hsv.s, Number(e.target.value)), className: "flex-1 accent-indigo-500" })
1250
1304
  ] }),
1251
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1", children: [
1252
- /* @__PURE__ */ jsx10("select", { "aria-label": "Harmony", value: kind, onChange: (e) => setKind(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: HARMONY_KINDS.map((k) => /* @__PURE__ */ jsx10("option", { value: k, children: k }, k)) }),
1253
- /* @__PURE__ */ jsx10("button", { type: "button", className: chip(wheel === "ryb"), "aria-pressed": wheel === "ryb", onClick: () => setWheel("ryb"), children: "RYB" }),
1254
- /* @__PURE__ */ jsx10("button", { type: "button", className: chip(wheel === "rgb"), "aria-pressed": wheel === "rgb", onClick: () => setWheel("rgb"), children: "RGB" })
1305
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
1306
+ /* @__PURE__ */ jsx11("select", { "aria-label": "Harmony", value: kind, onChange: (e) => setKind(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: HARMONY_KINDS.map((k) => /* @__PURE__ */ jsx11("option", { value: k, children: k }, k)) }),
1307
+ /* @__PURE__ */ jsx11("button", { type: "button", className: chip(wheel === "ryb"), "aria-pressed": wheel === "ryb", onClick: () => setWheel("ryb"), children: "RYB" }),
1308
+ /* @__PURE__ */ jsx11("button", { type: "button", className: chip(wheel === "rgb"), "aria-pressed": wheel === "rgb", onClick: () => setWheel("rgb"), children: "RGB" })
1255
1309
  ] }),
1256
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap gap-1", "aria-label": "Harmony colours", children: [
1257
- harmony.map((h, i) => /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": `Use ${h.color}`, title: h.color, className: "h-6 w-6 rounded ring-1 ring-slate-700", style: { background: h.color }, onClick: () => controller.setColor(h.color) }, i)),
1258
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, onClick: () => harmony.forEach((h) => controller.addSwatch(h.color)), children: "+ swatches" })
1310
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap gap-1", "aria-label": "Harmony colours", children: [
1311
+ harmony.map((h, i) => /* @__PURE__ */ jsx11("button", { type: "button", "aria-label": `Use ${h.color}`, title: h.color, className: "h-6 w-6 rounded ring-1 ring-slate-700", style: { background: h.color }, onClick: () => controller.setColor(h.color) }, i)),
1312
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => harmony.forEach((h) => controller.addSwatch(h.color)), children: "+ swatches" })
1259
1313
  ] }),
1260
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap gap-1", role: "listbox", "aria-label": "Swatches", children: [
1261
- state.swatches.map((s, i) => /* @__PURE__ */ jsx10(
1314
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap gap-1", role: "listbox", "aria-label": "Swatches", children: [
1315
+ state.swatches.map((s, i) => /* @__PURE__ */ jsx11(
1262
1316
  "button",
1263
1317
  {
1264
1318
  type: "button",
@@ -1276,15 +1330,15 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1276
1330
  },
1277
1331
  i
1278
1332
  )),
1279
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, "aria-label": "Add swatch", onClick: () => attempt(() => controller.addSwatch(state.paint)), children: "+" })
1333
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, "aria-label": "Add swatch", onClick: () => attempt(() => controller.addSwatch(state.paint)), children: "+" })
1280
1334
  ] }),
1281
- mixingPad && /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1", "data-testid": "mixing-pad", children: [
1282
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1", children: [
1283
- /* @__PURE__ */ jsx10("span", { className: "text-slate-400", children: "Mixing pad" }),
1284
- ["paint", "knife", "pick"].map((t) => /* @__PURE__ */ jsx10("button", { type: "button", "aria-pressed": padTool === t, className: chip(padTool === t), onClick: () => setPadTool(t), children: t === "paint" ? "Paint" : t === "knife" ? "Knife" : "Pick" }, t)),
1285
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, onClick: () => controller.clearMixingPad(), children: "Clear" })
1335
+ mixingPad && /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1", "data-testid": "mixing-pad", children: [
1336
+ /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
1337
+ /* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: "Mixing pad" }),
1338
+ ["paint", "knife", "pick"].map((t) => /* @__PURE__ */ jsx11("button", { type: "button", "aria-pressed": padTool === t, className: chip(padTool === t), onClick: () => setPadTool(t), children: t === "paint" ? "Paint" : t === "knife" ? "Knife" : "Pick" }, t)),
1339
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => controller.clearMixingPad(), children: "Clear" })
1286
1340
  ] }),
1287
- /* @__PURE__ */ jsx10(
1341
+ /* @__PURE__ */ jsx11(
1288
1342
  "div",
1289
1343
  {
1290
1344
  role: "application",
@@ -1305,20 +1359,20 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1305
1359
  padPoints.current = null;
1306
1360
  if (pts?.length) attempt(() => controller.mixingPadStroke(pts, { tool: padTool === "knife" ? "knife" : "paint" }));
1307
1361
  },
1308
- children: /* @__PURE__ */ jsx10(PixelCanvas, { pixels: pad, label: "Mixing pad pixels", className: "w-full rounded", style: { aspectRatio: `${MIXING_PAD_WIDTH} / ${MIXING_PAD_HEIGHT}` } })
1362
+ children: /* @__PURE__ */ jsx11(PixelCanvas, { pixels: pad, label: "Mixing pad pixels", className: "w-full rounded", style: { aspectRatio: `${MIXING_PAD_WIDTH} / ${MIXING_PAD_HEIGHT}` } })
1309
1363
  }
1310
1364
  ),
1311
- /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap items-center gap-1", children: /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1", children: [
1312
- /* @__PURE__ */ jsx10("span", { className: "text-slate-400", children: "Sample" }),
1313
- /* @__PURE__ */ jsx10("select", { "aria-label": "Pick sample size", value: sample, onChange: (e) => setSample(Number(e.target.value)), className: "rounded bg-slate-800 px-1 py-0.5", children: PAD_SAMPLE_SIZES.map((n) => /* @__PURE__ */ jsx10("option", { value: n, children: n === 1 ? "1 px" : `${n}\xD7${n}` }, n)) })
1365
+ /* @__PURE__ */ jsx11("div", { className: "flex flex-wrap items-center gap-1", children: /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1", children: [
1366
+ /* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: "Sample" }),
1367
+ /* @__PURE__ */ jsx11("select", { "aria-label": "Pick sample size", value: sample, onChange: (e) => setSample(Number(e.target.value)), className: "rounded bg-slate-800 px-1 py-0.5", children: PAD_SAMPLE_SIZES.map((n) => /* @__PURE__ */ jsx11("option", { value: n, children: n === 1 ? "1 px" : `${n}\xD7${n}` }, n)) })
1314
1368
  ] }) }),
1315
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-1", children: [
1316
- /* @__PURE__ */ jsx10("span", { className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: color } }),
1317
- /* @__PURE__ */ jsx10("input", { type: "number", "aria-label": "Paint colour parts", min: 0, max: 20, value: parts[0], onChange: (e) => setParts([Number(e.target.value), parts[1]]), className: "w-10 rounded bg-slate-800 px-1 py-0.5" }),
1318
- /* @__PURE__ */ jsx10("span", { className: "text-slate-500", children: ":" }),
1319
- /* @__PURE__ */ jsx10("input", { type: "number", "aria-label": "Second colour parts", min: 0, max: 20, value: parts[1], onChange: (e) => setParts([parts[0], Number(e.target.value)]), className: "w-10 rounded bg-slate-800 px-1 py-0.5" }),
1320
- /* @__PURE__ */ jsx10("span", { className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: state.secondaryColor } }),
1321
- /* @__PURE__ */ jsx10(
1369
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap items-center gap-1", children: [
1370
+ /* @__PURE__ */ jsx11("span", { className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: color } }),
1371
+ /* @__PURE__ */ jsx11("input", { type: "number", "aria-label": "Paint colour parts", min: 0, max: 20, value: parts[0], onChange: (e) => setParts([Number(e.target.value), parts[1]]), className: "w-10 rounded bg-slate-800 px-1 py-0.5" }),
1372
+ /* @__PURE__ */ jsx11("span", { className: "text-slate-500", children: ":" }),
1373
+ /* @__PURE__ */ jsx11("input", { type: "number", "aria-label": "Second colour parts", min: 0, max: 20, value: parts[1], onChange: (e) => setParts([parts[0], Number(e.target.value)]), className: "w-10 rounded bg-slate-800 px-1 py-0.5" }),
1374
+ /* @__PURE__ */ jsx11("span", { className: "h-4 w-4 rounded ring-1 ring-slate-700", style: { background: state.secondaryColor } }),
1375
+ /* @__PURE__ */ jsx11(
1322
1376
  "button",
1323
1377
  {
1324
1378
  type: "button",
@@ -1337,23 +1391,23 @@ var ColorPanel = ({ controller, wheelSize = 168, mixingPad = true, className })
1337
1391
  }
1338
1392
  )
1339
1393
  ] }),
1340
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-1", children: [
1341
- /* @__PURE__ */ jsx10("input", { value: padName, placeholder: "Pad name", "aria-label": "Pad name", onChange: (e) => setPadName(e.target.value), className: "w-24 rounded bg-slate-800 px-1.5 py-0.5" }),
1342
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, onClick: () => attempt(() => (controller.saveMixingPad(padName || void 0), setPadName(""))), children: "Keep pad" })
1394
+ /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap items-center gap-1", children: [
1395
+ /* @__PURE__ */ jsx11("input", { value: padName, placeholder: "Pad name", "aria-label": "Pad name", onChange: (e) => setPadName(e.target.value), className: "w-24 rounded bg-slate-800 px-1.5 py-0.5" }),
1396
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => attempt(() => (controller.saveMixingPad(padName || void 0), setPadName(""))), children: "Keep pad" })
1343
1397
  ] }),
1344
- state.savedMixingPads.length > 0 && /* @__PURE__ */ jsx10("ul", { className: "flex flex-col gap-0.5", "aria-label": "Kept pads", children: state.savedMixingPads.map((p) => /* @__PURE__ */ jsxs9("li", { className: "flex items-center gap-1", children: [
1345
- /* @__PURE__ */ jsx10("button", { type: "button", className: `${button} flex-1 text-left`, onClick: () => attempt(() => controller.loadMixingPad(p.id)), children: p.name }),
1346
- /* @__PURE__ */ jsx10("button", { type: "button", className: button, "aria-label": `Remove ${p.name}`, onClick: () => attempt(() => controller.removeMixingPad(p.id)), children: "\xD7" })
1398
+ state.savedMixingPads.length > 0 && /* @__PURE__ */ jsx11("ul", { className: "flex flex-col gap-0.5", "aria-label": "Kept pads", children: state.savedMixingPads.map((p) => /* @__PURE__ */ jsxs10("li", { className: "flex items-center gap-1", children: [
1399
+ /* @__PURE__ */ jsx11("button", { type: "button", className: `${button} flex-1 text-left`, onClick: () => attempt(() => controller.loadMixingPad(p.id)), children: p.name }),
1400
+ /* @__PURE__ */ jsx11("button", { type: "button", className: button, "aria-label": `Remove ${p.name}`, onClick: () => attempt(() => controller.removeMixingPad(p.id)), children: "\xD7" })
1347
1401
  ] }, p.id)) })
1348
1402
  ] }),
1349
- /* @__PURE__ */ jsx10(ErrorLine, { error })
1403
+ /* @__PURE__ */ jsx11(ErrorLine, { error })
1350
1404
  ] });
1351
1405
  };
1352
1406
 
1353
1407
  // src/paint-editor/PaintLayersPanel.tsx
1354
1408
  import { useState as useState7 } from "react";
1355
1409
  import { BLEND_MENU_GROUPS } from "@pixerate/editor/paint-editor";
1356
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1410
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1357
1411
  function siblingIndex(layers, l) {
1358
1412
  const sibs = layers.filter((x) => x.parentId === l.parentId).reverse();
1359
1413
  return { index: sibs.findIndex((x) => x.id === l.id), count: sibs.length };
@@ -1371,18 +1425,18 @@ var PaintLayersPanel = ({ controller, className }) => {
1371
1425
  const to = Math.min(count - 1, Math.max(0, index + delta));
1372
1426
  if (to !== index) attempt(() => controller.moveLayer(active.id, to));
1373
1427
  };
1374
- return /* @__PURE__ */ jsxs10("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paint-layers-panel", children: [
1375
- /* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap gap-1", children: [
1376
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => attempt(() => controller.addLayer()), children: "New layer" }),
1377
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => attempt(() => controller.addLayer({ type: "group" })), children: "New group" }),
1378
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, title: "A layer whose strokes stay editable", onClick: () => attempt(() => controller.addLayer({ type: "strokes" })), children: "New stroke layer" }),
1379
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, disabled: !active, onClick: () => active && attempt(() => controller.duplicateLayer(active.id)), children: "Duplicate" }),
1380
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, disabled: !active, "aria-label": "Move layer up", onClick: () => move(1), children: "\u2191" }),
1381
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, disabled: !active, "aria-label": "Move layer down", onClick: () => move(-1), children: "\u2193" }),
1382
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, disabled: !active, onClick: () => active && attempt(() => controller.mergeDown(active.id)), children: "Merge down" }),
1383
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, disabled: !active || layers.length < 2, onClick: () => active && attempt(() => controller.removeLayer(active.id)), children: "Delete" })
1428
+ return /* @__PURE__ */ jsxs11("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paint-layers-panel", children: [
1429
+ /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-1", children: [
1430
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, onClick: () => attempt(() => controller.addLayer()), children: "New layer" }),
1431
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, onClick: () => attempt(() => controller.addLayer({ type: "group" })), children: "New group" }),
1432
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, title: "A layer whose strokes stay editable", onClick: () => attempt(() => controller.addLayer({ type: "strokes" })), children: "New stroke layer" }),
1433
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !active, onClick: () => active && attempt(() => controller.duplicateLayer(active.id)), children: "Duplicate" }),
1434
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !active, "aria-label": "Move layer up", onClick: () => move(1), children: "\u2191" }),
1435
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !active, "aria-label": "Move layer down", onClick: () => move(-1), children: "\u2193" }),
1436
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !active, onClick: () => active && attempt(() => controller.mergeDown(active.id)), children: "Merge down" }),
1437
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !active || layers.length < 2, onClick: () => active && attempt(() => controller.removeLayer(active.id)), children: "Delete" })
1384
1438
  ] }),
1385
- /* @__PURE__ */ jsx11("ul", { role: "tree", "aria-label": "Layers", className: "flex flex-col gap-0.5", children: layers.map((l) => /* @__PURE__ */ jsxs10(
1439
+ /* @__PURE__ */ jsx12("ul", { role: "tree", "aria-label": "Layers", className: "flex flex-col gap-0.5", children: layers.map((l) => /* @__PURE__ */ jsxs11(
1386
1440
  "li",
1387
1441
  {
1388
1442
  role: "treeitem",
@@ -1391,7 +1445,7 @@ var PaintLayersPanel = ({ controller, className }) => {
1391
1445
  style: { paddingLeft: 6 + l.depth * 12 },
1392
1446
  onClick: () => controller.setActiveLayer(l.id),
1393
1447
  children: [
1394
- /* @__PURE__ */ jsx11(
1448
+ /* @__PURE__ */ jsx12(
1395
1449
  "button",
1396
1450
  {
1397
1451
  type: "button",
@@ -1404,7 +1458,7 @@ var PaintLayersPanel = ({ controller, className }) => {
1404
1458
  children: l.visible ? "\u25CF" : "\u25CB"
1405
1459
  }
1406
1460
  ),
1407
- renaming === l.id ? /* @__PURE__ */ jsx11(
1461
+ renaming === l.id ? /* @__PURE__ */ jsx12(
1408
1462
  "input",
1409
1463
  {
1410
1464
  autoFocus: true,
@@ -1421,23 +1475,23 @@ var PaintLayersPanel = ({ controller, className }) => {
1421
1475
  if (e.key === "Escape") setRenaming(null);
1422
1476
  }
1423
1477
  }
1424
- ) : /* @__PURE__ */ jsxs10("span", { className: "flex-1 truncate", onDoubleClick: () => setRenaming(l.id), children: [
1478
+ ) : /* @__PURE__ */ jsxs11("span", { className: "flex-1 truncate", onDoubleClick: () => setRenaming(l.id), children: [
1425
1479
  l.type === "group" ? "\u25B8 " : "",
1426
- l.liveStrokes !== void 0 && /* @__PURE__ */ jsxs10("span", { "aria-label": "Stroke layer", title: `Stroke layer: ${l.liveStrokes} editable strokes`, children: [
1480
+ l.liveStrokes !== void 0 && /* @__PURE__ */ jsxs11("span", { "aria-label": "Stroke layer", title: `Stroke layer: ${l.liveStrokes} editable strokes`, children: [
1427
1481
  "\u270E",
1428
1482
  " "
1429
1483
  ] }),
1430
1484
  l.name
1431
1485
  ] }),
1432
- l.locks.pixels || l.locks.all ? /* @__PURE__ */ jsx11("span", { title: "Locked", children: "\u{1F512}" }) : null
1486
+ l.locks.pixels || l.locks.all ? /* @__PURE__ */ jsx12("span", { title: "Locked", children: "\u{1F512}" }) : null
1433
1487
  ]
1434
1488
  },
1435
1489
  l.id
1436
1490
  )) }),
1437
- active && /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5", children: [
1438
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", children: [
1439
- /* @__PURE__ */ jsx11("span", { className: "w-14 text-slate-400", children: "Opacity" }),
1440
- /* @__PURE__ */ jsx11(
1491
+ active && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1.5", children: [
1492
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-2", children: [
1493
+ /* @__PURE__ */ jsx12("span", { className: "w-14 text-slate-400", children: "Opacity" }),
1494
+ /* @__PURE__ */ jsx12(
1441
1495
  "input",
1442
1496
  {
1443
1497
  type: "range",
@@ -1451,40 +1505,40 @@ var PaintLayersPanel = ({ controller, className }) => {
1451
1505
  }
1452
1506
  )
1453
1507
  ] }),
1454
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", children: [
1455
- /* @__PURE__ */ jsx11("span", { className: "w-14 text-slate-400", children: "Blend" }),
1456
- /* @__PURE__ */ jsxs10("select", { "aria-label": "Layer blend", value: active.blend, onChange: (e) => attempt(() => controller.updateLayer(active.id, { blend: e.target.value })), className: "flex-1 rounded bg-slate-800 px-1 py-0.5", children: [
1457
- active.type === "group" && /* @__PURE__ */ jsx11("option", { value: "pass-through", children: "Pass through" }),
1458
- BLEND_MENU_GROUPS.map((g) => /* @__PURE__ */ jsx11("optgroup", { label: g.label, children: g.modes.map((m) => /* @__PURE__ */ jsx11("option", { value: m.id, title: m.description, children: m.label }, m.id)) }, g.label))
1508
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-2", children: [
1509
+ /* @__PURE__ */ jsx12("span", { className: "w-14 text-slate-400", children: "Blend" }),
1510
+ /* @__PURE__ */ jsxs11("select", { "aria-label": "Layer blend", value: active.blend, onChange: (e) => attempt(() => controller.updateLayer(active.id, { blend: e.target.value })), className: "flex-1 rounded bg-slate-800 px-1 py-0.5", children: [
1511
+ active.type === "group" && /* @__PURE__ */ jsx12("option", { value: "pass-through", children: "Pass through" }),
1512
+ BLEND_MENU_GROUPS.map((g) => /* @__PURE__ */ jsx12("optgroup", { label: g.label, children: g.modes.map((m) => /* @__PURE__ */ jsx12("option", { value: m.id, title: m.description, children: m.label }, m.id)) }, g.label))
1459
1513
  ] })
1460
1514
  ] }),
1461
- /* @__PURE__ */ jsxs10("div", { className: "flex gap-1", children: [
1462
- ["pixels", "transparency"].map((k) => /* @__PURE__ */ jsx11("button", { type: "button", "aria-pressed": Boolean(active.locks[k]), className: chip(Boolean(active.locks[k])), onClick: () => attempt(() => controller.updateLayer(active.id, { locks: { [k]: !active.locks[k] } })), children: k === "pixels" ? "Lock pixels" : "Lock transparency" }, k)),
1463
- /* @__PURE__ */ jsx11("button", { type: "button", "aria-pressed": active.clipped, className: chip(active.clipped), onClick: () => attempt(() => controller.updateLayer(active.id, { clipped: !active.clipped })), children: "Clip" })
1515
+ /* @__PURE__ */ jsxs11("div", { className: "flex gap-1", children: [
1516
+ ["pixels", "transparency"].map((k) => /* @__PURE__ */ jsx12("button", { type: "button", "aria-pressed": Boolean(active.locks[k]), className: chip(Boolean(active.locks[k])), onClick: () => attempt(() => controller.updateLayer(active.id, { locks: { [k]: !active.locks[k] } })), children: k === "pixels" ? "Lock pixels" : "Lock transparency" }, k)),
1517
+ /* @__PURE__ */ jsx12("button", { type: "button", "aria-pressed": active.clipped, className: chip(active.clipped), onClick: () => attempt(() => controller.updateLayer(active.id, { clipped: !active.clipped })), children: "Clip" })
1464
1518
  ] }),
1465
- light?.hasLight && /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-1.5 border-t border-slate-800 pt-1.5", "data-testid": "layer-light", children: [
1466
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between", children: [
1467
- /* @__PURE__ */ jsx11("span", { className: "font-medium text-slate-300", title: "This layer's paint gives off light", children: "Light" }),
1468
- /* @__PURE__ */ jsx11("button", { type: "button", className: button, onClick: () => attempt(() => controller.clearLight(active.id)), children: "Clear light" })
1519
+ light?.hasLight && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1.5 border-t border-slate-800 pt-1.5", "data-testid": "layer-light", children: [
1520
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
1521
+ /* @__PURE__ */ jsx12("span", { className: "font-medium text-slate-300", title: "This layer's paint gives off light", children: "Light" }),
1522
+ /* @__PURE__ */ jsx12("button", { type: "button", className: button, onClick: () => attempt(() => controller.clearLight(active.id)), children: "Clear light" })
1469
1523
  ] }),
1470
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", title: "How far the light spills onto the paint and paper around it (0 turns it off)", children: [
1471
- /* @__PURE__ */ jsx11("span", { className: "w-14 text-slate-400", children: "Spill" }),
1472
- /* @__PURE__ */ jsx11("input", { type: "range", "aria-label": "Light spill radius", min: 0, max: 120, step: 1, value: light.spill.radius, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { radius: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
1524
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-2", title: "How far the light spills onto the paint and paper around it (0 turns it off)", children: [
1525
+ /* @__PURE__ */ jsx12("span", { className: "w-14 text-slate-400", children: "Spill" }),
1526
+ /* @__PURE__ */ jsx12("input", { type: "range", "aria-label": "Light spill radius", min: 0, max: 120, step: 1, value: light.spill.radius, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { radius: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
1473
1527
  ] }),
1474
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2", children: [
1475
- /* @__PURE__ */ jsx11("span", { className: "w-14 text-slate-400", children: "Strength" }),
1476
- /* @__PURE__ */ jsx11("input", { type: "range", "aria-label": "Light spill strength", min: 0, max: 2, step: 0.05, value: light.spill.strength, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { strength: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
1528
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-2", children: [
1529
+ /* @__PURE__ */ jsx12("span", { className: "w-14 text-slate-400", children: "Strength" }),
1530
+ /* @__PURE__ */ jsx12("input", { type: "range", "aria-label": "Light spill strength", min: 0, max: 2, step: 0.05, value: light.spill.strength, onChange: (e) => attempt(() => controller.setLightSpill(active.id, { strength: Number(e.target.value) })), className: "flex-1 accent-indigo-500" })
1477
1531
  ] })
1478
1532
  ] }),
1479
- /* @__PURE__ */ jsx11("div", { className: "border-t border-slate-800 pt-1.5", "data-testid": "paint-layer-effects", title: "Live layer styles drawn from this layer's paint: glows, shadows, strokes", children: /* @__PURE__ */ jsx11(LayerEffectsPanel, { controller, layerId: active.id }) })
1533
+ /* @__PURE__ */ jsx12("div", { className: "border-t border-slate-800 pt-1.5", "data-testid": "paint-layer-effects", title: "Live layer styles drawn from this layer's paint: glows, shadows, strokes", children: /* @__PURE__ */ jsx12(LayerEffectsPanel, { controller, layerId: active.id }) })
1480
1534
  ] }),
1481
- /* @__PURE__ */ jsx11(ErrorLine, { error })
1535
+ /* @__PURE__ */ jsx12(ErrorLine, { error })
1482
1536
  ] });
1483
1537
  };
1484
1538
 
1485
1539
  // src/paint-editor/WetPanel.tsx
1486
- import { LIVE_PATTERN_KINDS, LIVE_PATTERN_LABELS, LIVE_PATTERN_SLIDERS, WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath as readPath5, wetEngineSummary } from "@pixerate/editor/paint-editor";
1487
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1540
+ import { LIVE_PATTERN_KINDS, LIVE_PATTERN_LABELS, LIVE_PATTERN_SLIDERS, WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath as readPath6, wetEngineSummary } from "@pixerate/editor/paint-editor";
1541
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1488
1542
  var FLOW_LABELS = { none: "None", linear: "One way", swirl: "Swirl", radial: "Outwards", turbulent: "Eddies" };
1489
1543
  var WetPanel = ({ controller, className }) => {
1490
1544
  const state = usePaintEditorState(controller);
@@ -1494,31 +1548,31 @@ var WetPanel = ({ controller, className }) => {
1494
1548
  const info = layerId ? controller.wetLayerInfo(layerId) : null;
1495
1549
  const livePattern = layerId ? controller.getLivePatterns(layerId).layers[0] ?? null : null;
1496
1550
  const backend = controller.wetState();
1497
- return /* @__PURE__ */ jsxs11("div", { className: `${panel} ${className ?? ""}`, "data-testid": "wet-panel", children: [
1498
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
1499
- /* @__PURE__ */ jsx12("span", { className: wet.wet ? "text-sky-300" : "text-slate-400", "data-testid": "wet-status", children: wet.wet ? wet.paused ? "Wet (paused)" : "Wet" : "Dry" }),
1500
- /* @__PURE__ */ jsxs11("span", { className: "text-[10px] text-slate-500", children: [
1551
+ return /* @__PURE__ */ jsxs12("div", { className: `${panel} ${className ?? ""}`, "data-testid": "wet-panel", children: [
1552
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1553
+ /* @__PURE__ */ jsx13("span", { className: wet.wet ? "text-sky-300" : "text-slate-400", "data-testid": "wet-status", children: wet.wet ? wet.paused ? "Wet (paused)" : "Wet" : "Dry" }),
1554
+ /* @__PURE__ */ jsxs12("span", { className: "text-[10px] text-slate-500", children: [
1501
1555
  "step ",
1502
1556
  wet.clock
1503
1557
  ] })
1504
1558
  ] }),
1505
- /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-1", children: [
1506
- /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !wet.layerIds.length, onClick: () => attempt(async () => (await controller.wetIdle(), controller.dryPaint())), children: "Dry now" }),
1507
- /* @__PURE__ */ jsx12("button", { type: "button", className: chip(wet.paused), "aria-pressed": wet.paused, onClick: () => controller.setWetPaused(!wet.paused), children: wet.paused ? "Resume" : "Pause" }),
1508
- /* @__PURE__ */ jsx12("button", { type: "button", className: chip(wet.overlay), "aria-pressed": wet.overlay, onClick: () => controller.setWaterOverlay(!wet.overlay), children: "Water" }),
1509
- /* @__PURE__ */ jsx12("button", { type: "button", className: chip(wet.instantDry), "aria-pressed": wet.instantDry, title: "Each wet stroke dries as soon as it ends", onClick: () => controller.setInstantDry(!wet.instantDry), children: "Instant dry" }),
1510
- /* @__PURE__ */ jsx12("button", { type: "button", className: button, disabled: !layerId, onClick: () => attempt(async () => (await controller.wetIdle(), controller.wetPaper({}))), children: "Wet paper" })
1559
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-1", children: [
1560
+ /* @__PURE__ */ jsx13("button", { type: "button", className: button, disabled: !wet.layerIds.length, onClick: () => attempt(async () => (await controller.wetIdle(), controller.dryPaint())), children: "Dry now" }),
1561
+ /* @__PURE__ */ jsx13("button", { type: "button", className: chip(wet.paused), "aria-pressed": wet.paused, onClick: () => controller.setWetPaused(!wet.paused), children: wet.paused ? "Resume" : "Pause" }),
1562
+ /* @__PURE__ */ jsx13("button", { type: "button", className: chip(wet.overlay), "aria-pressed": wet.overlay, onClick: () => controller.setWaterOverlay(!wet.overlay), children: "Water" }),
1563
+ /* @__PURE__ */ jsx13("button", { type: "button", className: chip(wet.instantDry), "aria-pressed": wet.instantDry, title: "Each wet stroke dries as soon as it ends", onClick: () => controller.setInstantDry(!wet.instantDry), children: "Instant dry" }),
1564
+ /* @__PURE__ */ jsx13("button", { type: "button", className: button, disabled: !layerId, onClick: () => attempt(async () => (await controller.wetIdle(), controller.wetPaper({}))), children: "Wet paper" })
1511
1565
  ] }),
1512
- /* @__PURE__ */ jsx12(PaintSlider, { control: WET_SPEED_SLIDER, value: wet.speed, onChange: (v) => controller.setWetSpeed(v) }),
1513
- WET_TILT_SLIDERS.map((c) => /* @__PURE__ */ jsx12(PaintSlider, { control: c, value: readPath5(wet.tilt, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setCanvasTilt({ [c.path]: v }))) }, c.path)),
1514
- info && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-layer", children: [
1515
- /* @__PURE__ */ jsx12("span", { className: "font-medium text-slate-300", children: "This layer" }),
1516
- WET_PARAM_SLIDERS.map((c) => /* @__PURE__ */ jsx12(PaintSlider, { control: c, value: readPath5(info.params, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setWetParams(layerId, { [c.path]: v }))) }, c.path)),
1517
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center justify-between gap-2", children: [
1518
- /* @__PURE__ */ jsx12("span", { className: "text-slate-400", children: "Flow map" }),
1519
- /* @__PURE__ */ jsx12("select", { "aria-label": "Flow map", value: info.flow.kind, onChange: (e) => attempt(async () => (await controller.wetIdle(), controller.setFlowMap(layerId, { kind: e.target.value }))), className: "rounded bg-slate-800 px-1 py-0.5", children: WET_FLOW_KINDS.map((k) => /* @__PURE__ */ jsx12("option", { value: k, children: FLOW_LABELS[k] }, k)) })
1566
+ /* @__PURE__ */ jsx13(PaintSlider, { control: WET_SPEED_SLIDER, value: wet.speed, onChange: (v) => controller.setWetSpeed(v) }),
1567
+ WET_TILT_SLIDERS.map((c) => /* @__PURE__ */ jsx13(PaintSlider, { control: c, value: readPath6(wet.tilt, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setCanvasTilt({ [c.path]: v }))) }, c.path)),
1568
+ info && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-layer", children: [
1569
+ /* @__PURE__ */ jsx13("span", { className: "font-medium text-slate-300", children: "This layer" }),
1570
+ WET_PARAM_SLIDERS.map((c) => /* @__PURE__ */ jsx13(PaintSlider, { control: c, value: readPath6(info.params, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setWetParams(layerId, { [c.path]: v }))) }, c.path)),
1571
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center justify-between gap-2", children: [
1572
+ /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Flow map" }),
1573
+ /* @__PURE__ */ jsx13("select", { "aria-label": "Flow map", value: info.flow.kind, onChange: (e) => attempt(async () => (await controller.wetIdle(), controller.setFlowMap(layerId, { kind: e.target.value }))), className: "rounded bg-slate-800 px-1 py-0.5", children: WET_FLOW_KINDS.map((k) => /* @__PURE__ */ jsx13("option", { value: k, children: FLOW_LABELS[k] }, k)) })
1520
1574
  ] }),
1521
- info.flow.kind !== "none" && /* @__PURE__ */ jsx12(
1575
+ info.flow.kind !== "none" && /* @__PURE__ */ jsx13(
1522
1576
  PaintSlider,
1523
1577
  {
1524
1578
  control: { path: "strength", label: "Flow strength", min: 0, max: 1, step: 0.01 },
@@ -1527,10 +1581,10 @@ var WetPanel = ({ controller, className }) => {
1527
1581
  }
1528
1582
  )
1529
1583
  ] }),
1530
- livePattern && layerId && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-live-patterns", children: [
1531
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
1532
- /* @__PURE__ */ jsx12("span", { className: "font-medium text-slate-300", children: "Live patterns" }),
1533
- /* @__PURE__ */ jsx12(
1584
+ livePattern && layerId && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1.5", "data-testid": "wet-live-patterns", children: [
1585
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between", children: [
1586
+ /* @__PURE__ */ jsx13("span", { className: "font-medium text-slate-300", children: "Live patterns" }),
1587
+ /* @__PURE__ */ jsx13(
1534
1588
  "button",
1535
1589
  {
1536
1590
  type: "button",
@@ -1545,35 +1599,35 @@ var WetPanel = ({ controller, className }) => {
1545
1599
  }
1546
1600
  )
1547
1601
  ] }),
1548
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center justify-between gap-2", children: [
1549
- /* @__PURE__ */ jsx12("span", { className: "text-slate-400", children: "Pattern" }),
1550
- /* @__PURE__ */ jsx12(
1602
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center justify-between gap-2", children: [
1603
+ /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Pattern" }),
1604
+ /* @__PURE__ */ jsx13(
1551
1605
  "select",
1552
1606
  {
1553
1607
  "aria-label": "Live pattern",
1554
1608
  value: livePattern.settings.pattern,
1555
1609
  onChange: (e) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { pattern: e.target.value }))),
1556
1610
  className: "rounded bg-slate-800 px-1 py-0.5",
1557
- children: LIVE_PATTERN_KINDS.map((k) => /* @__PURE__ */ jsx12("option", { value: k, children: LIVE_PATTERN_LABELS[k] }, k))
1611
+ children: LIVE_PATTERN_KINDS.map((k) => /* @__PURE__ */ jsx13("option", { value: k, children: LIVE_PATTERN_LABELS[k] }, k))
1558
1612
  }
1559
1613
  )
1560
1614
  ] }),
1561
- LIVE_PATTERN_SLIDERS.map((c) => /* @__PURE__ */ jsx12(PaintSlider, { control: c, value: readPath5(livePattern.settings, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { [c.path]: v }))) }, c.path))
1615
+ LIVE_PATTERN_SLIDERS.map((c) => /* @__PURE__ */ jsx13(PaintSlider, { control: c, value: readPath6(livePattern.settings, c.path), onCommit: (v) => attempt(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { [c.path]: v }))) }, c.path))
1562
1616
  ] }),
1563
- backend.message && /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-amber-300", "data-testid": "wet-message", children: backend.message }),
1564
- backend.backend && /* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-500", children: backend.backend.kind === "wasm-threads" ? `WebAssembly, ${backend.backend.threads} threads` : backend.backend.kind === "wasm" ? "WebAssembly, one thread" : "JavaScript" }),
1565
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center justify-between gap-2", children: [
1566
- /* @__PURE__ */ jsx12("span", { className: "text-slate-400", children: "Engine" }),
1567
- /* @__PURE__ */ jsx12("select", { "aria-label": "Wet engine", value: wet.gpu, onChange: (e) => attempt(() => controller.setWetEngine({ gpu: e.target.value })), className: "rounded bg-slate-800 px-1 py-0.5", children: WET_GPU_OPTIONS.map((o) => /* @__PURE__ */ jsx12("option", { value: o.value, children: o.label }, o.value)) })
1617
+ backend.message && /* @__PURE__ */ jsx13("p", { className: "text-[10px] text-amber-300", "data-testid": "wet-message", children: backend.message }),
1618
+ backend.backend && /* @__PURE__ */ jsx13("p", { className: "text-[10px] text-slate-500", children: backend.backend.kind === "wasm-threads" ? `WebAssembly, ${backend.backend.threads} threads` : backend.backend.kind === "wasm" ? "WebAssembly, one thread" : "JavaScript" }),
1619
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center justify-between gap-2", children: [
1620
+ /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Engine" }),
1621
+ /* @__PURE__ */ jsx13("select", { "aria-label": "Wet engine", value: wet.gpu, onChange: (e) => attempt(() => controller.setWetEngine({ gpu: e.target.value })), className: "rounded bg-slate-800 px-1 py-0.5", children: WET_GPU_OPTIONS.map((o) => /* @__PURE__ */ jsx13("option", { value: o.value, children: o.label }, o.value)) })
1568
1622
  ] }),
1569
- /* @__PURE__ */ jsx12("p", { className: `text-[10px] ${backend.engine.state === "active" ? "text-emerald-300" : "text-slate-500"}`, "data-testid": "wet-engine", children: wetEngineSummary(backend.engine) }),
1570
- /* @__PURE__ */ jsx12(ErrorLine, { error })
1623
+ /* @__PURE__ */ jsx13("p", { className: `text-[10px] ${backend.engine.state === "active" ? "text-emerald-300" : "text-slate-500"}`, "data-testid": "wet-engine", children: wetEngineSummary(backend.engine) }),
1624
+ /* @__PURE__ */ jsx13(ErrorLine, { error })
1571
1625
  ] });
1572
1626
  };
1573
1627
 
1574
1628
  // src/paint-editor/StickerPanel.tsx
1575
- import { STICKER_SLIDERS, readPath as readPath6, stickerRefLabel } from "@pixerate/editor/paint-editor";
1576
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1629
+ import { STICKER_SLIDERS, readPath as readPath7, stickerRefLabel } from "@pixerate/editor/paint-editor";
1630
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1577
1631
  var StickerPanel = ({ controller, className }) => {
1578
1632
  const state = usePaintEditorState(controller);
1579
1633
  const [error, attempt] = useAttempt();
@@ -1583,16 +1637,16 @@ var StickerPanel = ({ controller, className }) => {
1583
1637
  const stickers = layerId ? state.document.stickers?.[layerId] ?? [] : [];
1584
1638
  if (!stickers.length) return null;
1585
1639
  const sel = stickers.find((s) => s.id === picked) ?? null;
1586
- return /* @__PURE__ */ jsxs12("div", { className: `${panel} ${className ?? ""}`, "data-testid": "sticker-panel", children: [
1587
- /* @__PURE__ */ jsxs12("span", { className: "font-medium text-slate-300", children: [
1640
+ return /* @__PURE__ */ jsxs13("div", { className: `${panel} ${className ?? ""}`, "data-testid": "sticker-panel", children: [
1641
+ /* @__PURE__ */ jsxs13("span", { className: "font-medium text-slate-300", children: [
1588
1642
  "Stickers (",
1589
1643
  stickers.length,
1590
1644
  ")"
1591
1645
  ] }),
1592
- /* @__PURE__ */ jsx13("div", { className: "flex max-h-24 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Stickers", children: stickers.map((s) => /* @__PURE__ */ jsx13("button", { type: "button", role: "option", "aria-selected": s.id === picked, title: `${stickerRefLabel(s.ref)} ${s.id}`, className: `h-5 w-5 rounded ring-1 ${s.id === picked ? "ring-indigo-400" : "ring-slate-700"}`, style: { background: s.color }, onClick: () => setPicked(s.id) }, s.id)) }),
1593
- sel && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1.5", "data-testid": "sticker-edit", children: [
1594
- /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Sticker" }),
1595
- /* @__PURE__ */ jsx13(
1646
+ /* @__PURE__ */ jsx14("div", { className: "flex max-h-24 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Stickers", children: stickers.map((s) => /* @__PURE__ */ jsx14("button", { type: "button", role: "option", "aria-selected": s.id === picked, title: `${stickerRefLabel(s.ref)} ${s.id}`, className: `h-5 w-5 rounded ring-1 ${s.id === picked ? "ring-indigo-400" : "ring-slate-700"}`, style: { background: s.color }, onClick: () => setPicked(s.id) }, s.id)) }),
1647
+ sel && /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-1.5", "data-testid": "sticker-edit", children: [
1648
+ /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "Sticker" }),
1649
+ /* @__PURE__ */ jsx14(
1596
1650
  StickerPicker,
1597
1651
  {
1598
1652
  controller,
@@ -1606,9 +1660,9 @@ var StickerPanel = ({ controller, className }) => {
1606
1660
  )
1607
1661
  }
1608
1662
  ),
1609
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between gap-2", children: [
1610
- /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Position" }),
1611
- /* @__PURE__ */ jsx13("span", { className: "flex gap-1", children: ["x", "y"].map((k) => /* @__PURE__ */ jsx13(
1663
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between gap-2", children: [
1664
+ /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "Position" }),
1665
+ /* @__PURE__ */ jsx14("span", { className: "flex gap-1", children: ["x", "y"].map((k) => /* @__PURE__ */ jsx14(
1612
1666
  "input",
1613
1667
  {
1614
1668
  type: "number",
@@ -1622,24 +1676,24 @@ var StickerPanel = ({ controller, className }) => {
1622
1676
  `${sel.id}-${k}-${sel[k]}`
1623
1677
  )) })
1624
1678
  ] }),
1625
- STICKER_SLIDERS.map((c) => /* @__PURE__ */ jsx13(PaintSlider, { control: c, value: readPath6(sel, c.path), onCommit: (v) => attempt(() => controller.updateSticker(layerId, sel.id, { [c.path]: v })) }, c.path)),
1626
- /* @__PURE__ */ jsxs12("label", { className: "flex items-center justify-between", children: [
1627
- /* @__PURE__ */ jsx13("span", { className: "text-slate-400", children: "Colour" }),
1628
- /* @__PURE__ */ jsx13(CommitColorInput, { label: "Sticker colour", value: sel.color, onCommit: (v) => attempt(() => controller.updateSticker(layerId, sel.id, { color: v })), className: "h-6 w-10 rounded bg-transparent" })
1679
+ STICKER_SLIDERS.map((c) => /* @__PURE__ */ jsx14(PaintSlider, { control: c, value: readPath7(sel, c.path), onCommit: (v) => attempt(() => controller.updateSticker(layerId, sel.id, { [c.path]: v })) }, c.path)),
1680
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center justify-between", children: [
1681
+ /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "Colour" }),
1682
+ /* @__PURE__ */ jsx14(CommitColorInput, { label: "Sticker colour", value: sel.color, onCommit: (v) => attempt(() => controller.updateSticker(layerId, sel.id, { color: v })), className: "h-6 w-10 rounded bg-transparent" })
1629
1683
  ] }),
1630
- /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-1", children: [
1631
- /* @__PURE__ */ jsx13("button", { type: "button", className: button, onClick: () => attempt(() => controller.arrangeStickers(layerId, [sel.id], "front")), children: "To front" }),
1632
- /* @__PURE__ */ jsx13("button", { type: "button", className: button, onClick: () => attempt(() => controller.arrangeStickers(layerId, [sel.id], "back")), children: "To back" }),
1633
- /* @__PURE__ */ jsx13("button", { type: "button", className: button, onClick: () => attempt(() => (controller.removeStickers(layerId, [sel.id]), setPicked(null))), children: "Delete" })
1684
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap gap-1", children: [
1685
+ /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => controller.arrangeStickers(layerId, [sel.id], "front")), children: "To front" }),
1686
+ /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => controller.arrangeStickers(layerId, [sel.id], "back")), children: "To back" }),
1687
+ /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => (controller.removeStickers(layerId, [sel.id]), setPicked(null))), children: "Delete" })
1634
1688
  ] })
1635
1689
  ] }),
1636
- /* @__PURE__ */ jsx13(ErrorLine, { error })
1690
+ /* @__PURE__ */ jsx14(ErrorLine, { error })
1637
1691
  ] });
1638
1692
  };
1639
1693
 
1640
1694
  // src/paint-editor/StrokePanel.tsx
1641
- import { STROKE_SLIDERS, liveStrokeRefusal, readPath as readPath7 } from "@pixerate/editor/paint-editor";
1642
- import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1695
+ import { STROKE_SLIDERS, liveStrokeRefusal, readPath as readPath8 } from "@pixerate/editor/paint-editor";
1696
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1643
1697
  var StrokePanel = ({ controller, className }) => {
1644
1698
  const state = usePaintEditorState(controller);
1645
1699
  const [error, attempt] = useAttempt();
@@ -1649,16 +1703,16 @@ var StrokePanel = ({ controller, className }) => {
1649
1703
  const index = strokes.findIndex((s) => s.id === state.selectedStroke);
1650
1704
  const sel = index >= 0 ? strokes[index] : null;
1651
1705
  const brushes = state.brushes.filter((b) => !liveStrokeRefusal(b));
1652
- return /* @__PURE__ */ jsxs13("div", { className: `${panel} ${className ?? ""}`, "data-testid": "stroke-panel", children: [
1653
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
1654
- /* @__PURE__ */ jsxs13("span", { className: "font-medium text-slate-300", children: [
1706
+ return /* @__PURE__ */ jsxs14("div", { className: `${panel} ${className ?? ""}`, "data-testid": "stroke-panel", children: [
1707
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
1708
+ /* @__PURE__ */ jsxs14("span", { className: "font-medium text-slate-300", children: [
1655
1709
  "Strokes (",
1656
1710
  strokes.length,
1657
1711
  ")"
1658
1712
  ] }),
1659
- /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => controller.rasterizeLiveStrokes(layerId)), children: "Rasterize" })
1713
+ /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => attempt(() => controller.rasterizeLiveStrokes(layerId)), children: "Rasterize" })
1660
1714
  ] }),
1661
- /* @__PURE__ */ jsx14("div", { className: "flex max-h-24 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Strokes", children: strokes.map((s, i) => /* @__PURE__ */ jsx14(
1715
+ /* @__PURE__ */ jsx15("div", { className: "flex max-h-24 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Strokes", children: strokes.map((s, i) => /* @__PURE__ */ jsx15(
1662
1716
  "button",
1663
1717
  {
1664
1718
  type: "button",
@@ -1671,10 +1725,10 @@ var StrokePanel = ({ controller, className }) => {
1671
1725
  },
1672
1726
  s.id
1673
1727
  )) }),
1674
- sel && /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-1.5", "data-testid": "stroke-edit", children: [
1675
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center justify-between gap-2", children: [
1676
- /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "Brush" }),
1677
- /* @__PURE__ */ jsxs13(
1728
+ sel && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1.5", "data-testid": "stroke-edit", children: [
1729
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center justify-between gap-2", children: [
1730
+ /* @__PURE__ */ jsx15("span", { className: "text-slate-400", children: "Brush" }),
1731
+ /* @__PURE__ */ jsxs14(
1678
1732
  "select",
1679
1733
  {
1680
1734
  "aria-label": "Stroke brush",
@@ -1682,41 +1736,41 @@ var StrokePanel = ({ controller, className }) => {
1682
1736
  onChange: (e) => e.target.value && attempt(() => controller.updateStroke(sel.id, { brushId: e.target.value })),
1683
1737
  className: "max-w-[10rem] rounded bg-slate-800 px-1 py-0.5",
1684
1738
  children: [
1685
- !brushes.some((b) => b.id === sel.brush.id) && /* @__PURE__ */ jsx14("option", { value: "", children: sel.brush.name }),
1686
- brushes.map((b) => /* @__PURE__ */ jsx14("option", { value: b.id, children: b.name }, b.id))
1739
+ !brushes.some((b) => b.id === sel.brush.id) && /* @__PURE__ */ jsx15("option", { value: "", children: sel.brush.name }),
1740
+ brushes.map((b) => /* @__PURE__ */ jsx15("option", { value: b.id, children: b.name }, b.id))
1687
1741
  ]
1688
1742
  }
1689
1743
  )
1690
1744
  ] }),
1691
- STROKE_SLIDERS.map((c) => /* @__PURE__ */ jsx14(PaintSlider, { control: c, value: readPath7(sel.brush, c.path), onCommit: (v) => attempt(() => controller.updateStroke(sel.id, { brush: { tip: { [c.path.split(".")[1]]: v } } })) }, c.path)),
1692
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center justify-between", children: [
1693
- /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "Colour" }),
1694
- /* @__PURE__ */ jsx14(CommitColorInput, { label: "Stroke colour", value: sel.color, onCommit: (v) => attempt(() => controller.updateStroke(sel.id, { color: v })), className: "h-6 w-10 rounded bg-transparent" })
1745
+ STROKE_SLIDERS.map((c) => /* @__PURE__ */ jsx15(PaintSlider, { control: c, value: readPath8(sel.brush, c.path), onCommit: (v) => attempt(() => controller.updateStroke(sel.id, { brush: { tip: { [c.path.split(".")[1]]: v } } })) }, c.path)),
1746
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center justify-between", children: [
1747
+ /* @__PURE__ */ jsx15("span", { className: "text-slate-400", children: "Colour" }),
1748
+ /* @__PURE__ */ jsx15(CommitColorInput, { label: "Stroke colour", value: sel.color, onCommit: (v) => attempt(() => controller.updateStroke(sel.id, { color: v })), className: "h-6 w-10 rounded bg-transparent" })
1695
1749
  ] }),
1696
- /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap gap-1", children: [
1697
- /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => controller.updateStroke(sel.id, { seed: (sel.seed + 1) % 2147483647 })), children: "New seed" }),
1698
- /* @__PURE__ */ jsx14("button", { type: "button", className: button, disabled: index === strokes.length - 1, "aria-label": "Move stroke up", onClick: () => attempt(() => controller.reorderStroke(sel.id, index + 1)), children: "\u2191" }),
1699
- /* @__PURE__ */ jsx14("button", { type: "button", className: button, disabled: index === 0, "aria-label": "Move stroke down", onClick: () => attempt(() => controller.reorderStroke(sel.id, index - 1)), children: "\u2193" }),
1700
- /* @__PURE__ */ jsx14("button", { type: "button", className: button, onClick: () => attempt(() => (controller.removeStrokes([sel.id]), controller.selectStroke(null))), children: "Delete" })
1750
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap gap-1", children: [
1751
+ /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => attempt(() => controller.updateStroke(sel.id, { seed: (sel.seed + 1) % 2147483647 })), children: "New seed" }),
1752
+ /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: index === strokes.length - 1, "aria-label": "Move stroke up", onClick: () => attempt(() => controller.reorderStroke(sel.id, index + 1)), children: "\u2191" }),
1753
+ /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: index === 0, "aria-label": "Move stroke down", onClick: () => attempt(() => controller.reorderStroke(sel.id, index - 1)), children: "\u2193" }),
1754
+ /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => attempt(() => (controller.removeStrokes([sel.id]), controller.selectStroke(null))), children: "Delete" })
1701
1755
  ] })
1702
1756
  ] }),
1703
- /* @__PURE__ */ jsx14(ErrorLine, { error })
1757
+ /* @__PURE__ */ jsx15(ErrorLine, { error })
1704
1758
  ] });
1705
1759
  };
1706
1760
 
1707
1761
  // src/paint-editor/PathStrokePanel.tsx
1708
1762
  import { useState as useState8 } from "react";
1709
1763
  import { PATH_STROKE_TAPERS } from "@pixerate/editor/paint-editor";
1710
- import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1764
+ import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1711
1765
  var PathStrokePanel = ({ controller, className }) => {
1712
1766
  const state = usePaintEditorState(controller);
1713
1767
  const [error, attempt] = useAttempt();
1714
1768
  const [path, setPath] = useState8("");
1715
1769
  const [taper, setTaper] = useState8(PATH_STROKE_TAPERS[0].id);
1716
1770
  const pressure = PATH_STROKE_TAPERS.find((t) => t.id === taper)?.pressure;
1717
- return /* @__PURE__ */ jsxs14("div", { className: `${panel} ${className ?? ""}`, "data-testid": "path-stroke-panel", children: [
1718
- /* @__PURE__ */ jsx15("span", { className: "font-medium text-slate-300", children: "Brush a path" }),
1719
- /* @__PURE__ */ jsx15(
1771
+ return /* @__PURE__ */ jsxs15("div", { className: `${panel} ${className ?? ""}`, "data-testid": "path-stroke-panel", children: [
1772
+ /* @__PURE__ */ jsx16("span", { className: "font-medium text-slate-300", children: "Brush a path" }),
1773
+ /* @__PURE__ */ jsx16(
1720
1774
  "textarea",
1721
1775
  {
1722
1776
  "aria-label": "SVG path data",
@@ -1727,11 +1781,11 @@ var PathStrokePanel = ({ controller, className }) => {
1727
1781
  className: "w-full resize-y rounded bg-slate-800 px-1 py-0.5 font-mono text-[11px]"
1728
1782
  }
1729
1783
  ),
1730
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
1731
- /* @__PURE__ */ jsx15("select", { "aria-label": "Pressure along the path", value: taper, onChange: (e) => setTaper(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: PATH_STROKE_TAPERS.map((t) => /* @__PURE__ */ jsx15("option", { value: t.id, children: t.label }, t.id)) }),
1732
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !path.trim() || state.stroking, onClick: () => attempt(() => controller.strokePath({ path, ...pressure ? { pressure } : {} })), children: "Brush path" })
1784
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
1785
+ /* @__PURE__ */ jsx16("select", { "aria-label": "Pressure along the path", value: taper, onChange: (e) => setTaper(e.target.value), className: "rounded bg-slate-800 px-1 py-0.5", children: PATH_STROKE_TAPERS.map((t) => /* @__PURE__ */ jsx16("option", { value: t.id, children: t.label }, t.id)) }),
1786
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !path.trim() || state.stroking, onClick: () => attempt(() => controller.strokePath({ path, ...pressure ? { pressure } : {} })), children: "Brush path" })
1733
1787
  ] }),
1734
- /* @__PURE__ */ jsx15(ErrorLine, { error })
1788
+ /* @__PURE__ */ jsx16(ErrorLine, { error })
1735
1789
  ] });
1736
1790
  };
1737
1791
 
@@ -1745,7 +1799,7 @@ import {
1745
1799
  paintProposalGhost as paintProposalGhost2,
1746
1800
  proposalGenomeStrokes
1747
1801
  } from "@pixerate/editor/paint-editor";
1748
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
1802
+ import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
1749
1803
  var EvolutionPanel = ({ controller, proposals, className }) => {
1750
1804
  const state = usePaintEditorState(controller);
1751
1805
  const store = proposals ?? controller.proposals;
@@ -1768,16 +1822,16 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1768
1822
  const toggleProposal = (id) => {
1769
1823
  setSelectedProposals((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev.slice(-1), id]);
1770
1824
  };
1771
- return /* @__PURE__ */ jsxs15("div", { className: `${panel} ${className ?? ""}`, "data-testid": "evolution-panel", children: [
1772
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
1773
- /* @__PURE__ */ jsxs15("span", { className: "font-medium text-slate-300", children: [
1825
+ return /* @__PURE__ */ jsxs16("div", { className: `${panel} ${className ?? ""}`, "data-testid": "evolution-panel", children: [
1826
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
1827
+ /* @__PURE__ */ jsxs16("span", { className: "font-medium text-slate-300", children: [
1774
1828
  "Evolution (",
1775
1829
  eligibleStrokes.length,
1776
1830
  ")"
1777
1831
  ] }),
1778
- /* @__PURE__ */ jsx16("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-[11px] text-slate-400", children: [
1779
- /* @__PURE__ */ jsx16("span", { children: "Count" }),
1780
- /* @__PURE__ */ jsx16(
1832
+ /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-[11px] text-slate-400", children: [
1833
+ /* @__PURE__ */ jsx17("span", { children: "Count" }),
1834
+ /* @__PURE__ */ jsx17(
1781
1835
  "input",
1782
1836
  {
1783
1837
  type: "number",
@@ -1791,9 +1845,9 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1791
1845
  )
1792
1846
  ] }) })
1793
1847
  ] }),
1794
- eligibleStrokes.length > 0 && /* @__PURE__ */ jsx16("div", { className: "flex max-h-20 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Parent strokes", children: eligibleStrokes.map((s, i) => {
1848
+ eligibleStrokes.length > 0 && /* @__PURE__ */ jsx17("div", { className: "flex max-h-20 flex-wrap gap-1 overflow-y-auto", role: "listbox", "aria-label": "Parent strokes", children: eligibleStrokes.map((s, i) => {
1795
1849
  const on = effectiveStrokeIds.includes(s.id);
1796
- return /* @__PURE__ */ jsx16(
1850
+ return /* @__PURE__ */ jsx17(
1797
1851
  "button",
1798
1852
  {
1799
1853
  type: "button",
@@ -1809,7 +1863,7 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1809
1863
  }) }),
1810
1864
  EVOLUTION_SLIDERS.map((c) => {
1811
1865
  const key = c.path;
1812
- return /* @__PURE__ */ jsx16(
1866
+ return /* @__PURE__ */ jsx17(
1813
1867
  PaintSlider,
1814
1868
  {
1815
1869
  control: c,
@@ -1819,8 +1873,8 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1819
1873
  c.path
1820
1874
  );
1821
1875
  }),
1822
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1", children: [
1823
- /* @__PURE__ */ jsx16(
1876
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1", children: [
1877
+ /* @__PURE__ */ jsx17(
1824
1878
  "button",
1825
1879
  {
1826
1880
  type: "button",
@@ -1833,7 +1887,7 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1833
1887
  children: "Breed strokes"
1834
1888
  }
1835
1889
  ),
1836
- activeProposalIds.length === 2 && /* @__PURE__ */ jsx16(
1890
+ activeProposalIds.length === 2 && /* @__PURE__ */ jsx17(
1837
1891
  "button",
1838
1892
  {
1839
1893
  type: "button",
@@ -1846,7 +1900,7 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1846
1900
  children: "Cross over (2)"
1847
1901
  }
1848
1902
  ),
1849
- variants.length > 0 && /* @__PURE__ */ jsx16(
1903
+ variants.length > 0 && /* @__PURE__ */ jsx17(
1850
1904
  "button",
1851
1905
  {
1852
1906
  type: "button",
@@ -1859,16 +1913,16 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1859
1913
  }
1860
1914
  )
1861
1915
  ] }),
1862
- variants.length > 0 && /* @__PURE__ */ jsx16("div", { className: "grid grid-cols-2 gap-1.5", "data-testid": "evolution-grid", children: variants.map((p) => {
1916
+ variants.length > 0 && /* @__PURE__ */ jsx17("div", { className: "grid grid-cols-2 gap-1.5", "data-testid": "evolution-grid", children: variants.map((p) => {
1863
1917
  const g = paintProposalGhost2(p);
1864
1918
  const picked = activeProposalIds.includes(p.id);
1865
- return /* @__PURE__ */ jsxs15(
1919
+ return /* @__PURE__ */ jsxs16(
1866
1920
  "div",
1867
1921
  {
1868
1922
  "data-testid": `evolution-variant-${p.id}`,
1869
1923
  className: `flex flex-col gap-1 rounded border p-1.5 ${picked ? "border-indigo-500 bg-slate-800/90" : "border-slate-800 bg-slate-950/60"}`,
1870
1924
  children: [
1871
- /* @__PURE__ */ jsx16("div", { className: "flex items-center justify-between gap-1", children: /* @__PURE__ */ jsx16(
1925
+ /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between gap-1", children: /* @__PURE__ */ jsx17(
1872
1926
  "button",
1873
1927
  {
1874
1928
  type: "button",
@@ -1878,10 +1932,10 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1878
1932
  children: p.title
1879
1933
  }
1880
1934
  ) }),
1881
- g && /* @__PURE__ */ jsx16("div", { className: "flex h-16 items-center justify-center overflow-hidden rounded bg-slate-900/80 p-1", children: /* @__PURE__ */ jsx16(PixelCanvas, { pixels: g, label: p.title, className: "max-h-full max-w-full object-contain" }) }),
1882
- p.rationale && /* @__PURE__ */ jsx16("span", { className: "line-clamp-2 text-[10px] text-slate-400", title: p.rationale, children: p.rationale }),
1883
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1", children: [
1884
- /* @__PURE__ */ jsx16(
1935
+ g && /* @__PURE__ */ jsx17("div", { className: "flex h-16 items-center justify-center overflow-hidden rounded bg-slate-900/80 p-1", children: /* @__PURE__ */ jsx17(PixelCanvas, { pixels: g, label: p.title, className: "max-h-full max-w-full object-contain" }) }),
1936
+ p.rationale && /* @__PURE__ */ jsx17("span", { className: "line-clamp-2 text-[10px] text-slate-400", title: p.rationale, children: p.rationale }),
1937
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1", children: [
1938
+ /* @__PURE__ */ jsx17(
1885
1939
  "button",
1886
1940
  {
1887
1941
  type: "button",
@@ -1894,28 +1948,28 @@ var EvolutionPanel = ({ controller, proposals, className }) => {
1894
1948
  children: "Breed from"
1895
1949
  }
1896
1950
  ),
1897
- /* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => attempt(() => store.accept(p.id)), children: "Accept" }),
1898
- /* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => attempt(() => store.reject(p.id)), children: "Dismiss" })
1951
+ /* @__PURE__ */ jsx17("button", { type: "button", className: button, onClick: () => attempt(() => store.accept(p.id)), children: "Accept" }),
1952
+ /* @__PURE__ */ jsx17("button", { type: "button", className: button, onClick: () => attempt(() => store.reject(p.id)), children: "Dismiss" })
1899
1953
  ] })
1900
1954
  ]
1901
1955
  },
1902
1956
  p.id
1903
1957
  );
1904
1958
  }) }),
1905
- contactSheetUrl && /* @__PURE__ */ jsx16("img", { src: contactSheetUrl, alt: "Variant contact sheet", className: "w-full rounded border border-slate-800", "data-testid": "evolution-contact-sheet" }),
1906
- /* @__PURE__ */ jsx16(ErrorLine, { error })
1959
+ contactSheetUrl && /* @__PURE__ */ jsx17("img", { src: contactSheetUrl, alt: "Variant contact sheet", className: "w-full rounded border border-slate-800", "data-testid": "evolution-contact-sheet" }),
1960
+ /* @__PURE__ */ jsx17(ErrorLine, { error })
1907
1961
  ] });
1908
1962
  };
1909
1963
 
1910
1964
  // src/paint-editor/PaintEditor.tsx
1911
- import { useRef as useRef7, useState as useState11 } from "react";
1912
- import { PaintPresence as PaintPresence2, documentToScreen as documentToScreen2, screenToDocument as screenToDocument2 } from "@pixerate/editor/paint-editor";
1965
+ import { useRef as useRef7, useState as useState11, useSyncExternalStore as useSyncExternalStore4 } from "react";
1966
+ import { PaintPresence as PaintPresence2, documentToScreen as documentToScreen2, screenToDocument as screenToDocument2, specialtyInPlay } from "@pixerate/editor/paint-editor";
1913
1967
 
1914
1968
  // src/paint-editor/PaintEffectsPanel.tsx
1915
1969
  import { useEffect as useEffect5, useMemo as useMemo7, useRef as useRef6, useState as useState10 } from "react";
1916
1970
  import { createPaintEffectAuthoringToolProvider, createPaintEffectsToolProvider, paintEffectOffered, PAPER_EFFECT_BLENDS } from "@pixerate/editor/paint-editor";
1917
1971
  import { pathControlsOf } from "@pixerate/editor/effects";
1918
- import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
1972
+ import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
1919
1973
  function usePaintEffectsProvider(controller) {
1920
1974
  const [provider, setProvider] = useState10(controller.effectsCatalog);
1921
1975
  useEffect5(() => {
@@ -1945,19 +1999,19 @@ function usePaintEffectsTools(registry, controller, options = {}) {
1945
1999
  function Controls({ provider, effect, name, values, apply }) {
1946
2000
  const { description, error } = useEffectDescription(provider, effect);
1947
2001
  const drags = useRef6(/* @__PURE__ */ new Set());
1948
- if (!provider) return /* @__PURE__ */ jsxs16("p", { className: "text-[11px] text-slate-400", children: [
2002
+ if (!provider) return /* @__PURE__ */ jsxs17("p", { className: "text-[11px] text-slate-400", children: [
1949
2003
  'No effects provider: "',
1950
2004
  name ?? effect,
1951
2005
  '" is kept as it was drawn.'
1952
2006
  ] });
1953
- if (error) return /* @__PURE__ */ jsx17("p", { className: "text-[11px] text-amber-400", children: error });
1954
- if (!description) return /* @__PURE__ */ jsx17("p", { className: "text-[11px] text-slate-400", children: "Loading\u2026" });
2007
+ if (error) return /* @__PURE__ */ jsx18("p", { className: "text-[11px] text-amber-400", children: error });
2008
+ if (!description) return /* @__PURE__ */ jsx18("p", { className: "text-[11px] text-slate-400", children: "Loading\u2026" });
1955
2009
  const commit = (gesture) => {
1956
2010
  if (!gesture || drags.current.has(gesture)) return !gesture;
1957
2011
  drags.current.add(gesture);
1958
2012
  return true;
1959
2013
  };
1960
- return /* @__PURE__ */ jsx17(
2014
+ return /* @__PURE__ */ jsx18(
1961
2015
  EffectParameters,
1962
2016
  {
1963
2017
  description,
@@ -2011,28 +2065,28 @@ var PaintEffectsPanel = ({ controller, className }) => {
2011
2065
  const toggle = (b) => setBrowse(browse === b ? null : b);
2012
2066
  const offered = useMemo7(() => browse ? (e) => paintEffectOffered(e, browse, provider?.capabilities) : void 0, [browse, provider]);
2013
2067
  const pixel = active?.type === "pixel";
2014
- return /* @__PURE__ */ jsxs16("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paint-effects-panel", "aria-busy": busy, children: [
2015
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-1", children: [
2016
- /* @__PURE__ */ jsx17("span", { className: "flex-1 font-medium text-slate-300", children: "Effects" }),
2017
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "paper", onClick: () => toggle("paper"), children: "Paper\u2026" }),
2018
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "layer", onClick: () => toggle("layer"), children: "Layer\u2026" }),
2019
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, disabled: !provider || !pixel, "aria-pressed": browse === "fill", onClick: () => toggle("fill"), children: "Fill\u2026" }),
2020
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, disabled: !provider || !pixel, "aria-pressed": browse === "light", onClick: () => toggle("light"), title: "Bake a light, glow or grade into the active layer's dried paint", children: "Light\u2026" }),
2021
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "paint", onClick: () => toggle("paint"), title: "Paint with an effect: brushes take each pixel's colour from it", children: "Paint\u2026" })
2068
+ return /* @__PURE__ */ jsxs17("div", { className: `${panel} ${className ?? ""}`, "data-testid": "paint-effects-panel", "aria-busy": busy, children: [
2069
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-1", children: [
2070
+ /* @__PURE__ */ jsx18("span", { className: "flex-1 font-medium text-slate-300", children: "Effects" }),
2071
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "paper", onClick: () => toggle("paper"), children: "Paper\u2026" }),
2072
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "layer", onClick: () => toggle("layer"), children: "Layer\u2026" }),
2073
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, disabled: !provider || !pixel, "aria-pressed": browse === "fill", onClick: () => toggle("fill"), children: "Fill\u2026" }),
2074
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, disabled: !provider || !pixel, "aria-pressed": browse === "light", onClick: () => toggle("light"), title: "Bake a light, glow or grade into the active layer's dried paint", children: "Light\u2026" }),
2075
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, disabled: !provider, "aria-pressed": browse === "paint", onClick: () => toggle("paint"), title: "Paint with an effect: brushes take each pixel's colour from it", children: "Paint\u2026" })
2022
2076
  ] }),
2023
- !provider && /* @__PURE__ */ jsx17("p", { className: "text-[11px] text-slate-400", children: "No effects provider is registered. Effects in the painting are kept." }),
2024
- browse && /* @__PURE__ */ jsx17(EffectsBrowser, { provider, uses: BROWSERS[browse].uses, filter: offered, title: BROWSERS[browse].title, onPick: (e) => pick(e.id) }),
2025
- paper && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "paper", children: [
2026
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
2027
- /* @__PURE__ */ jsxs16("span", { className: "flex-1 truncate", children: [
2077
+ !provider && /* @__PURE__ */ jsx18("p", { className: "text-[11px] text-slate-400", children: "No effects provider is registered. Effects in the painting are kept." }),
2078
+ browse && /* @__PURE__ */ jsx18(EffectsBrowser, { provider, uses: BROWSERS[browse].uses, filter: offered, title: BROWSERS[browse].title, onPick: (e) => pick(e.id) }),
2079
+ paper && /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "paper", children: [
2080
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1", children: [
2081
+ /* @__PURE__ */ jsxs17("span", { className: "flex-1 truncate", children: [
2028
2082
  "Paper: ",
2029
2083
  paper.name ?? paper.effect
2030
2084
  ] }),
2031
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, "aria-label": "Remove the effect paper", onClick: () => run(() => controller.setPaperEffect(null)), children: "\u2715" })
2085
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, "aria-label": "Remove the effect paper", onClick: () => run(() => controller.setPaperEffect(null)), children: "\u2715" })
2032
2086
  ] }),
2033
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2034
- /* @__PURE__ */ jsx17("span", { className: "w-14 text-[11px] text-slate-400", children: "Opacity" }),
2035
- /* @__PURE__ */ jsx17(
2087
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
2088
+ /* @__PURE__ */ jsx18("span", { className: "w-14 text-[11px] text-slate-400", children: "Opacity" }),
2089
+ /* @__PURE__ */ jsx18(
2036
2090
  "input",
2037
2091
  {
2038
2092
  type: "range",
@@ -2054,43 +2108,43 @@ var PaintEffectsPanel = ({ controller, className }) => {
2054
2108
  `o${paper.opacity}`
2055
2109
  )
2056
2110
  ] }),
2057
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2058
- /* @__PURE__ */ jsx17("span", { className: "w-14 text-[11px] text-slate-400", children: "Blend" }),
2059
- /* @__PURE__ */ jsx17("select", { className: "flex-1 rounded bg-slate-800 px-1 py-0.5 text-[11px]", "aria-label": "Effect paper blend", value: paper.blend, onChange: (e) => {
2111
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
2112
+ /* @__PURE__ */ jsx18("span", { className: "w-14 text-[11px] text-slate-400", children: "Blend" }),
2113
+ /* @__PURE__ */ jsx18("select", { className: "flex-1 rounded bg-slate-800 px-1 py-0.5 text-[11px]", "aria-label": "Effect paper blend", value: paper.blend, onChange: (e) => {
2060
2114
  const blend = e.currentTarget.value;
2061
2115
  run(() => controller.updatePaperEffect({ blend }));
2062
- }, children: PAPER_EFFECT_BLENDS.map((b) => /* @__PURE__ */ jsx17("option", { value: b, children: b }, b)) })
2116
+ }, children: PAPER_EFFECT_BLENDS.map((b) => /* @__PURE__ */ jsx18("option", { value: b, children: b }, b)) })
2063
2117
  ] }),
2064
- /* @__PURE__ */ jsx17(Controls, { provider, effect: paper.effect, name: paper.name, values: paper.values, apply: (values, commit) => run(() => controller.updatePaperEffect({ values }, commit)) })
2118
+ /* @__PURE__ */ jsx18(Controls, { provider, effect: paper.effect, name: paper.name, values: paper.values, apply: (values, commit) => run(() => controller.updatePaperEffect({ values }, commit)) })
2065
2119
  ] }),
2066
- effectPaint && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "paint", children: [
2067
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
2068
- thumbnail ? /* @__PURE__ */ jsx17("img", { src: thumbnail, alt: "", className: "h-5 w-8 rounded object-cover ring-1 ring-slate-700", "data-testid": "effect-paint-thumbnail" }) : null,
2069
- /* @__PURE__ */ jsxs16("span", { className: "flex-1 truncate", children: [
2120
+ effectPaint && /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "paint", children: [
2121
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1", children: [
2122
+ thumbnail ? /* @__PURE__ */ jsx18("img", { src: thumbnail, alt: "", className: "h-5 w-8 rounded object-cover ring-1 ring-slate-700", "data-testid": "effect-paint-thumbnail" }) : null,
2123
+ /* @__PURE__ */ jsxs17("span", { className: "flex-1 truncate", children: [
2070
2124
  "Paint: ",
2071
2125
  effectPaint.effect,
2072
2126
  state.effectPaintRendering ? " (rendering\u2026)" : ""
2073
2127
  ] }),
2074
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, "aria-label": "Stop painting with the effect", onClick: () => attempt(() => controller.setColor(state.color)), children: "\u2715" })
2128
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, "aria-label": "Stop painting with the effect", onClick: () => attempt(() => controller.setColor(state.color)), children: "\u2715" })
2075
2129
  ] }),
2076
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2", "data-testid": "effect-paint-placement", children: [
2077
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", title: "Lay the effect along each stroke instead of fixing it to the canvas", children: [
2078
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: effectPaint.map?.by === "stroke", onChange: (e) => repaint({ map: e.target.checked ? { by: "stroke", length: 300, repeat: "repeat" } : { by: "canvas" } }) }),
2130
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2", "data-testid": "effect-paint-placement", children: [
2131
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", title: "Lay the effect along each stroke instead of fixing it to the canvas", children: [
2132
+ /* @__PURE__ */ jsx18("input", { type: "checkbox", checked: effectPaint.map?.by === "stroke", onChange: (e) => repaint({ map: e.target.checked ? { by: "stroke", length: 300, repeat: "repeat" } : { by: "canvas" } }) }),
2079
2133
  "Along the stroke"
2080
2134
  ] }),
2081
- hasPathControl && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", title: "Pass each stroke's centreline to the effect's own path control", children: [
2082
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: effectPaint.map?.by === "path", onChange: (e) => repaint({ map: e.target.checked ? { by: "path" } : { by: "canvas" } }) }),
2135
+ hasPathControl && /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", title: "Pass each stroke's centreline to the effect's own path control", children: [
2136
+ /* @__PURE__ */ jsx18("input", { type: "checkbox", checked: effectPaint.map?.by === "path", onChange: (e) => repaint({ map: e.target.checked ? { by: "path" } : { by: "canvas" } }) }),
2083
2137
  "Along the stroke (native)"
2084
2138
  ] }),
2085
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", title: "Strokes on a stroke layer keep playing the effect", children: [
2086
- /* @__PURE__ */ jsx17("input", { type: "checkbox", checked: Boolean(effectPaint.live), onChange: (e) => repaint({ live: e.target.checked }) }),
2139
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", title: "Strokes on a stroke layer keep playing the effect", children: [
2140
+ /* @__PURE__ */ jsx18("input", { type: "checkbox", checked: Boolean(effectPaint.live), onChange: (e) => repaint({ live: e.target.checked }) }),
2087
2141
  "Live"
2088
2142
  ] })
2089
2143
  ] }),
2090
- effectPaint.map?.by === "stroke" && /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2", children: [
2091
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2092
- /* @__PURE__ */ jsx17("span", { className: "text-slate-400", children: "Length" }),
2093
- /* @__PURE__ */ jsx17(
2144
+ effectPaint.map?.by === "stroke" && /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2", children: [
2145
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
2146
+ /* @__PURE__ */ jsx18("span", { className: "text-slate-400", children: "Length" }),
2147
+ /* @__PURE__ */ jsx18(
2094
2148
  "input",
2095
2149
  {
2096
2150
  type: "number",
@@ -2104,48 +2158,49 @@ var PaintEffectsPanel = ({ controller, className }) => {
2104
2158
  effectPaint.map.length
2105
2159
  )
2106
2160
  ] }),
2107
- /* @__PURE__ */ jsxs16("select", { "aria-label": "Effect repeat", value: effectPaint.map.repeat, onChange: (e) => repaint({ map: { ...effectPaint.map, repeat: e.target.value } }), className: "rounded bg-slate-800 px-1 py-0.5", children: [
2108
- /* @__PURE__ */ jsx17("option", { value: "repeat", children: "Repeat" }),
2109
- /* @__PURE__ */ jsx17("option", { value: "mirror", children: "Mirror" }),
2110
- /* @__PURE__ */ jsx17("option", { value: "clamp", children: "Clamp" })
2161
+ /* @__PURE__ */ jsxs17("select", { "aria-label": "Effect repeat", value: effectPaint.map.repeat, onChange: (e) => repaint({ map: { ...effectPaint.map, repeat: e.target.value } }), className: "rounded bg-slate-800 px-1 py-0.5", children: [
2162
+ /* @__PURE__ */ jsx18("option", { value: "repeat", children: "Repeat" }),
2163
+ /* @__PURE__ */ jsx18("option", { value: "mirror", children: "Mirror" }),
2164
+ /* @__PURE__ */ jsx18("option", { value: "clamp", children: "Clamp" })
2111
2165
  ] })
2112
2166
  ] }),
2113
- /* @__PURE__ */ jsx17(Controls, { provider, effect: effectPaint.effect, values: effectPaint.values, apply: (values) => repaint({ values: { ...effectPaint.values, ...values } }) })
2167
+ /* @__PURE__ */ jsx18(Controls, { provider, effect: effectPaint.effect, values: effectPaint.values, apply: (values) => repaint({ values: { ...effectPaint.values, ...values } }) })
2114
2168
  ] }),
2115
- animation && /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 rounded border border-slate-700 p-1", "data-effect-part": "playback", children: [
2116
- /* @__PURE__ */ jsxs16("span", { className: "flex-1 truncate", children: [
2169
+ animation && /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 rounded border border-slate-700 p-1", "data-effect-part": "playback", children: [
2170
+ /* @__PURE__ */ jsxs17("span", { className: "flex-1 truncate", children: [
2117
2171
  "Live paint: ",
2118
2172
  animation.strokes,
2119
2173
  " ",
2120
2174
  animation.strokes === 1 ? "stroke" : "strokes"
2121
2175
  ] }),
2122
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, "aria-pressed": playback.playing, onClick: () => attempt(() => controller.setEffectPlayback({ playing: !playback.playing })), children: playback.playing ? "Pause" : "Play" }),
2123
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
2124
- /* @__PURE__ */ jsx17("span", { className: "text-slate-400", children: "fps" }),
2125
- /* @__PURE__ */ jsx17("input", { type: "number", "aria-label": "Live paint frame rate", min: 1, max: 60, value: playback.fps, onChange: (e) => attempt(() => controller.setEffectPlayback({ fps: Math.round(Number(e.target.value)) })), className: "w-12 rounded bg-slate-800 px-1 py-0.5" })
2176
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, "aria-pressed": playback.playing, onClick: () => attempt(() => controller.setEffectPlayback({ playing: !playback.playing })), children: playback.playing ? "Pause" : "Play" }),
2177
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
2178
+ /* @__PURE__ */ jsx18("span", { className: "text-slate-400", children: "fps" }),
2179
+ /* @__PURE__ */ jsx18("input", { type: "number", "aria-label": "Live paint frame rate", min: 1, max: 60, value: playback.fps, onChange: (e) => attempt(() => controller.setEffectPlayback({ fps: Math.round(Number(e.target.value)) })), className: "w-12 rounded bg-slate-800 px-1 py-0.5" })
2126
2180
  ] })
2127
2181
  ] }),
2128
- layerEffect && activeId && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "layer", children: [
2129
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
2130
- /* @__PURE__ */ jsxs16("span", { className: "flex-1 truncate", children: [
2182
+ layerEffect && activeId && /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1 rounded border border-slate-700 p-1", "data-effect-part": "layer", children: [
2183
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-1", children: [
2184
+ /* @__PURE__ */ jsxs17("span", { className: "flex-1 truncate", children: [
2131
2185
  "Layer: ",
2132
2186
  layerEffect.name ?? layerEffect.effect
2133
2187
  ] }),
2134
- /* @__PURE__ */ jsx17("button", { type: "button", className: button, title: "Keep the pixels as a plain layer", onClick: () => attempt(() => controller.rasterizeEffectLayer(activeId)), children: "Rasterize" })
2188
+ /* @__PURE__ */ jsx18("button", { type: "button", className: button, title: "Keep the pixels as a plain layer", onClick: () => attempt(() => controller.rasterizeEffectLayer(activeId)), children: "Rasterize" })
2135
2189
  ] }),
2136
- /* @__PURE__ */ jsx17(Controls, { provider, effect: layerEffect.effect, name: layerEffect.name, values: layerEffect.values, apply: (values, commit) => run(() => controller.updateEffectLayer(activeId, { values }, commit)) })
2190
+ /* @__PURE__ */ jsx18(Controls, { provider, effect: layerEffect.effect, name: layerEffect.name, values: layerEffect.values, apply: (values, commit) => run(() => controller.updateEffectLayer(activeId, { values }, commit)) })
2137
2191
  ] }),
2138
- /* @__PURE__ */ jsx17(ErrorLine, { error })
2192
+ /* @__PURE__ */ jsx18(ErrorLine, { error })
2139
2193
  ] });
2140
2194
  };
2141
2195
 
2142
2196
  // src/paint-editor/PaintEditor.tsx
2143
- import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2197
+ import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2144
2198
  var PAINT_CONTROLS = {
2145
2199
  "mixing-pad": '[data-testid="mixing-pad"]',
2146
2200
  lighting: '[data-testid="light-panel"]',
2147
2201
  symmetry: '[aria-label="Symmetry"]'
2148
2202
  };
2203
+ var TAB_LABELS = { color: "Colour", wet: "Wet", paper: "Paper", specialty: "Specialty", layers: "Layers", effects: "Effects" };
2149
2204
  var PaintEditor = ({ controller, fileName, height = 720, presence, proposals, agentStrokes, deviceTilt, className, playback, playbackId = "paint", onPlaybackReveal }) => {
2150
2205
  const [tool, setTool] = useState11("brush");
2151
2206
  const [fillOptions, setFillOptions] = useState11({ reference: "all", tolerance: 32, closeGap: 4, expand: 1, antialias: true });
@@ -2211,28 +2266,37 @@ var PaintEditor = ({ controller, fileName, height = 720, presence, proposals, ag
2211
2266
  };
2212
2267
  const [error, setError] = useState11(null);
2213
2268
  const effects = usePaintEffectsProvider(controller);
2214
- const tabs = effects ? ["color", "wet", "paper", "layers", "effects"] : ["color", "wet", "paper", "layers"];
2215
- return /* @__PURE__ */ jsxs17("div", { ref: rootRef, className: `relative flex flex-col gap-2 rounded-xl border border-slate-800 bg-slate-900 p-2 ${className ?? ""}`, style: { height }, "data-testid": "paint-editor", children: [
2216
- playing && /* @__PURE__ */ jsx18(PresenceLayer, { presence: agentPresence, viewport: docToRoot }),
2217
- /* @__PURE__ */ jsx18(PaintToolbar, { controller, tool, onToolChange: setTool, fillOptions, onFillOptionsChange: setFillOptions, fileName }),
2218
- /* @__PURE__ */ jsxs17("div", { className: "flex min-h-0 flex-1 gap-2", children: [
2219
- /* @__PURE__ */ jsx18(BrushPanel, { controller, className: "w-60 shrink-0 overflow-y-auto pr-1" }),
2220
- /* @__PURE__ */ jsxs17("div", { className: "flex min-w-0 flex-1 flex-col", children: [
2221
- /* @__PURE__ */ jsx18(PaintCanvas, { controller, tool, fillOptions, onError: setError, presence: playing ? void 0 : presence, proposals, agentStrokes, deviceTilt, className: "flex-1 rounded-lg" }),
2222
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "mt-1 text-[11px] text-rose-400", children: error })
2269
+ const tabs = effects ? ["color", "wet", "paper", "specialty", "layers", "effects"] : ["color", "wet", "paper", "specialty", "layers"];
2270
+ const specialty = useSyncExternalStore4(
2271
+ (notify) => controller.subscribe(notify),
2272
+ () => specialtyInPlay(controller.getState()),
2273
+ () => specialtyInPlay(controller.getState())
2274
+ );
2275
+ return /* @__PURE__ */ jsxs18("div", { ref: rootRef, className: `relative flex flex-col gap-2 rounded-xl border border-slate-800 bg-slate-900 p-2 ${className ?? ""}`, style: { height }, "data-testid": "paint-editor", children: [
2276
+ playing && /* @__PURE__ */ jsx19(PresenceLayer, { presence: agentPresence, viewport: docToRoot }),
2277
+ /* @__PURE__ */ jsx19(PaintToolbar, { controller, tool, onToolChange: setTool, fillOptions, onFillOptionsChange: setFillOptions, fileName }),
2278
+ /* @__PURE__ */ jsxs18("div", { className: "flex min-h-0 flex-1 gap-2", children: [
2279
+ /* @__PURE__ */ jsx19(BrushPanel, { controller, onOpenSpecialtyPanel: () => setTab("specialty"), className: "w-60 shrink-0 overflow-y-auto pr-1" }),
2280
+ /* @__PURE__ */ jsxs18("div", { className: "flex min-w-0 flex-1 flex-col", children: [
2281
+ /* @__PURE__ */ jsx19(PaintCanvas, { controller, tool, fillOptions, onError: setError, presence: playing ? void 0 : presence, proposals, agentStrokes, deviceTilt, className: "flex-1 rounded-lg" }),
2282
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "mt-1 text-[11px] text-rose-400", children: error })
2223
2283
  ] }),
2224
- /* @__PURE__ */ jsxs17("div", { className: "flex w-64 shrink-0 flex-col gap-2 overflow-y-auto pr-1", children: [
2225
- /* @__PURE__ */ jsx18("div", { className: "flex gap-1", role: "tablist", "aria-label": "Paint panels", children: tabs.map((t) => /* @__PURE__ */ jsx18("button", { type: "button", role: "tab", "aria-selected": tab === t, "data-paint-tab": t, className: chip(tab === t), onClick: () => setTab(t), children: t === "color" ? "Colour" : t === "wet" ? "Wet" : t === "paper" ? "Paper" : t === "layers" ? "Layers" : "Effects" }, t)) }),
2226
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-2", "data-paint-panel": tab, children: [
2227
- tab === "color" && /* @__PURE__ */ jsx18(ColorPanel, { controller }),
2228
- tab === "wet" && /* @__PURE__ */ jsx18(WetPanel, { controller }),
2229
- tab === "paper" && /* @__PURE__ */ jsx18(PaperPanel, { controller }),
2230
- tab === "layers" && /* @__PURE__ */ jsx18(PaintLayersPanel, { controller }),
2231
- tab === "layers" && /* @__PURE__ */ jsx18(StrokePanel, { controller }),
2232
- tab === "layers" && /* @__PURE__ */ jsx18(PathStrokePanel, { controller }),
2233
- tab === "layers" && /* @__PURE__ */ jsx18(EvolutionPanel, { controller, proposals }),
2234
- tab === "layers" && /* @__PURE__ */ jsx18(StickerPanel, { controller }),
2235
- tab === "effects" && effects && /* @__PURE__ */ jsx18(PaintEffectsPanel, { controller })
2284
+ /* @__PURE__ */ jsxs18("div", { className: "flex w-64 shrink-0 flex-col gap-2 overflow-y-auto pr-1", children: [
2285
+ /* @__PURE__ */ jsx19("div", { className: "flex gap-1", role: "tablist", "aria-label": "Paint panels", children: tabs.map((t) => /* @__PURE__ */ jsxs18("button", { type: "button", role: "tab", "aria-selected": tab === t, "data-paint-tab": t, className: chip(tab === t), onClick: () => setTab(t), ...t === "specialty" && specialty ? { "data-active": "", title: "Specialty paint is in play" } : {}, children: [
2286
+ TAB_LABELS[t],
2287
+ t === "specialty" && specialty && /* @__PURE__ */ jsx19("span", { "aria-hidden": "true", className: "ml-1 text-indigo-300", children: "\u2022" })
2288
+ ] }, t)) }),
2289
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2", "data-paint-panel": tab, children: [
2290
+ tab === "color" && /* @__PURE__ */ jsx19(ColorPanel, { controller }),
2291
+ tab === "wet" && /* @__PURE__ */ jsx19(WetPanel, { controller }),
2292
+ tab === "paper" && /* @__PURE__ */ jsx19(PaperPanel, { controller }),
2293
+ tab === "specialty" && /* @__PURE__ */ jsx19(SpecialtyPanel, { controller }),
2294
+ tab === "layers" && /* @__PURE__ */ jsx19(PaintLayersPanel, { controller }),
2295
+ tab === "layers" && /* @__PURE__ */ jsx19(StrokePanel, { controller }),
2296
+ tab === "layers" && /* @__PURE__ */ jsx19(PathStrokePanel, { controller }),
2297
+ tab === "layers" && /* @__PURE__ */ jsx19(EvolutionPanel, { controller, proposals }),
2298
+ tab === "layers" && /* @__PURE__ */ jsx19(StickerPanel, { controller }),
2299
+ tab === "effects" && effects && /* @__PURE__ */ jsx19(PaintEffectsPanel, { controller })
2236
2300
  ] })
2237
2301
  ] })
2238
2302
  ] })
@@ -2257,6 +2321,8 @@ export {
2257
2321
  PaintToolbar,
2258
2322
  PaperPanel,
2259
2323
  PathStrokePanel,
2324
+ SpecialtyGuideCard,
2325
+ SpecialtyPanel,
2260
2326
  StickerPanel,
2261
2327
  StickerPicker,
2262
2328
  StrokePanel,