@pixerate/editor-react 0.144.0 → 0.146.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.
- package/dist/{chunk-3CB4WG24.js → chunk-3E32BAYS.js} +1022 -926
- package/dist/image-editor/EdgeColorPanel.d.cts +14 -0
- package/dist/image-editor/EdgeColorPanel.d.ts +14 -0
- package/dist/image-editor/index.cjs +1286 -1189
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +3 -1
- package/dist/index.cjs +1806 -1709
- package/dist/index.js +3 -1
- package/package.json +3 -3
|
@@ -190,7 +190,7 @@ function useImageEffectsTools(registry, controller, options = {}) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// src/image-editor/ImageEditor.tsx
|
|
193
|
-
import
|
|
193
|
+
import React21, { useRef as useRef12, useEffect as useEffect17, useState as useState22 } from "react";
|
|
194
194
|
import {
|
|
195
195
|
normalizeProcessVersion,
|
|
196
196
|
LATEST_PROCESS_VERSION,
|
|
@@ -1538,7 +1538,7 @@ var AdjustmentLayersPanel = ({ controller, layers: layersProp, histogram, classN
|
|
|
1538
1538
|
};
|
|
1539
1539
|
|
|
1540
1540
|
// src/image-editor/LayersPanel.tsx
|
|
1541
|
-
import { useEffect as useEffect6, useRef as
|
|
1541
|
+
import { useEffect as useEffect6, useRef as useRef6, useState as useState8 } from "react";
|
|
1542
1542
|
|
|
1543
1543
|
// src/image-editor/LayerEffectsPanel.tsx
|
|
1544
1544
|
import { useEffect as useEffect5, useRef as useRef4, useState as useState6 } from "react";
|
|
@@ -1696,6 +1696,92 @@ var LayerEffectsPanel = ({ controller, layerId, heading = true, className }) =>
|
|
|
1696
1696
|
] });
|
|
1697
1697
|
};
|
|
1698
1698
|
|
|
1699
|
+
// src/image-editor/EdgeColorPanel.tsx
|
|
1700
|
+
import { useRef as useRef5, useState as useState7 } from "react";
|
|
1701
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1702
|
+
var SLIDERS = [
|
|
1703
|
+
{ key: "decontaminate", label: "Decontaminate", hint: "Unmix the old background from a soft-edged mask" },
|
|
1704
|
+
{ key: "despill", label: "Despill", hint: "Take out the old background's hue at the edge" },
|
|
1705
|
+
{ key: "ambient", label: "Cast", hint: "Tint the edge with what is behind the layer, live" }
|
|
1706
|
+
];
|
|
1707
|
+
var EdgeColorPanel = ({ controller, layer, className = "" }) => {
|
|
1708
|
+
const [error, setError] = useState7(null);
|
|
1709
|
+
const commitNext = useRef5(true);
|
|
1710
|
+
const info = controller.getEdgeColor(layer.id);
|
|
1711
|
+
const fixed = info.ambientSource !== "auto";
|
|
1712
|
+
const set = (change) => {
|
|
1713
|
+
setError(null);
|
|
1714
|
+
try {
|
|
1715
|
+
controller.setEdgeColor(layer.id, change, commitNext.current);
|
|
1716
|
+
commitNext.current = false;
|
|
1717
|
+
} catch (err) {
|
|
1718
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
1719
|
+
}
|
|
1720
|
+
};
|
|
1721
|
+
const sliderEvents = {
|
|
1722
|
+
onPointerDown: () => commitNext.current = true,
|
|
1723
|
+
onPointerUp: () => commitNext.current = true,
|
|
1724
|
+
onKeyDown: () => commitNext.current = true
|
|
1725
|
+
};
|
|
1726
|
+
return /* @__PURE__ */ jsxs8("details", { className: `text-xs ${className}`, "data-testid": "edge-color-panel", open: Boolean(info.decontaminate || info.despill || info.ambient) || void 0, children: [
|
|
1727
|
+
/* @__PURE__ */ jsx8("summary", { className: "cursor-pointer text-muted-foreground", children: "Edge Colour" }),
|
|
1728
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5 pt-1", children: [
|
|
1729
|
+
SLIDERS.map((s) => /* @__PURE__ */ jsxs8("label", { className: "flex flex-col gap-0.5", title: s.hint, children: [
|
|
1730
|
+
/* @__PURE__ */ jsxs8("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
1731
|
+
/* @__PURE__ */ jsx8("span", { children: s.label }),
|
|
1732
|
+
/* @__PURE__ */ jsxs8("span", { className: "font-mono", children: [
|
|
1733
|
+
info[s.key],
|
|
1734
|
+
"%"
|
|
1735
|
+
] })
|
|
1736
|
+
] }),
|
|
1737
|
+
/* @__PURE__ */ jsx8(
|
|
1738
|
+
"input",
|
|
1739
|
+
{
|
|
1740
|
+
type: "range",
|
|
1741
|
+
min: 0,
|
|
1742
|
+
max: 100,
|
|
1743
|
+
"aria-label": `Edge ${s.label.toLowerCase()}`,
|
|
1744
|
+
value: info[s.key],
|
|
1745
|
+
...sliderEvents,
|
|
1746
|
+
onChange: (e) => set({ [s.key]: Number(e.target.value) }),
|
|
1747
|
+
className: "accent-primary"
|
|
1748
|
+
}
|
|
1749
|
+
)
|
|
1750
|
+
] }, s.key)),
|
|
1751
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1.5 text-foreground", children: [
|
|
1752
|
+
/* @__PURE__ */ jsx8(
|
|
1753
|
+
"input",
|
|
1754
|
+
{
|
|
1755
|
+
type: "checkbox",
|
|
1756
|
+
"aria-label": "Fixed cast colour",
|
|
1757
|
+
checked: fixed,
|
|
1758
|
+
onChange: (e) => {
|
|
1759
|
+
commitNext.current = true;
|
|
1760
|
+
set({ ambientColor: e.target.checked ? "#808080" : "auto" });
|
|
1761
|
+
},
|
|
1762
|
+
className: "accent-primary"
|
|
1763
|
+
}
|
|
1764
|
+
),
|
|
1765
|
+
"Fixed cast colour",
|
|
1766
|
+
fixed && /* @__PURE__ */ jsx8(
|
|
1767
|
+
"input",
|
|
1768
|
+
{
|
|
1769
|
+
type: "color",
|
|
1770
|
+
"aria-label": "Cast colour",
|
|
1771
|
+
value: info.ambientSource,
|
|
1772
|
+
onChange: (e) => {
|
|
1773
|
+
commitNext.current = true;
|
|
1774
|
+
set({ ambientColor: e.target.value });
|
|
1775
|
+
},
|
|
1776
|
+
className: "h-5 w-8 bg-background border border-border rounded"
|
|
1777
|
+
}
|
|
1778
|
+
)
|
|
1779
|
+
] }),
|
|
1780
|
+
error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-destructive", children: error })
|
|
1781
|
+
] })
|
|
1782
|
+
] });
|
|
1783
|
+
};
|
|
1784
|
+
|
|
1699
1785
|
// src/image-editor/LayersPanel.tsx
|
|
1700
1786
|
import {
|
|
1701
1787
|
BIT_DEPTH_OPTIONS,
|
|
@@ -1717,7 +1803,7 @@ import {
|
|
|
1717
1803
|
layerPanelRows,
|
|
1718
1804
|
runLayerMenuAction
|
|
1719
1805
|
} from "@pixerate/editor/image-editor";
|
|
1720
|
-
import { Fragment, jsx as
|
|
1806
|
+
import { Fragment, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1721
1807
|
var rowClass = (active) => `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${active ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`;
|
|
1722
1808
|
var Thumbnail = ({
|
|
1723
1809
|
pixels,
|
|
@@ -1728,7 +1814,7 @@ var Thumbnail = ({
|
|
|
1728
1814
|
selected,
|
|
1729
1815
|
testId
|
|
1730
1816
|
}) => {
|
|
1731
|
-
const ref =
|
|
1817
|
+
const ref = useRef6(null);
|
|
1732
1818
|
useEffect6(() => {
|
|
1733
1819
|
const canvas = ref.current;
|
|
1734
1820
|
const ctx = canvas?.getContext("2d");
|
|
@@ -1739,7 +1825,7 @@ var Thumbnail = ({
|
|
|
1739
1825
|
img.data.set(pixels.data);
|
|
1740
1826
|
ctx.putImageData(img, 0, 0);
|
|
1741
1827
|
}, [pixels]);
|
|
1742
|
-
return /* @__PURE__ */
|
|
1828
|
+
return /* @__PURE__ */ jsx9(
|
|
1743
1829
|
"canvas",
|
|
1744
1830
|
{
|
|
1745
1831
|
ref,
|
|
@@ -1754,14 +1840,14 @@ var Thumbnail = ({
|
|
|
1754
1840
|
);
|
|
1755
1841
|
};
|
|
1756
1842
|
var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "image", effects = true, className }) => {
|
|
1757
|
-
const [, setTick] =
|
|
1843
|
+
const [, setTick] = useState8(0);
|
|
1758
1844
|
useEffect6(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
1759
|
-
const [error, setError] =
|
|
1760
|
-
const [renaming, setRenaming] =
|
|
1761
|
-
const [menu, setMenu] =
|
|
1762
|
-
const [drag, setDrag] =
|
|
1763
|
-
const [psdNotes, setPsdNotes] =
|
|
1764
|
-
const fileInput =
|
|
1845
|
+
const [error, setError] = useState8(null);
|
|
1846
|
+
const [renaming, setRenaming] = useState8(null);
|
|
1847
|
+
const [menu, setMenu] = useState8(null);
|
|
1848
|
+
const [drag, setDrag] = useState8(null);
|
|
1849
|
+
const [psdNotes, setPsdNotes] = useState8([]);
|
|
1850
|
+
const fileInput = useRef6(null);
|
|
1765
1851
|
const psdTask = async (fn) => {
|
|
1766
1852
|
try {
|
|
1767
1853
|
setError(null);
|
|
@@ -1770,7 +1856,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1770
1856
|
setError(err instanceof Error ? err.message : String(err));
|
|
1771
1857
|
}
|
|
1772
1858
|
};
|
|
1773
|
-
const commitNext =
|
|
1859
|
+
const commitNext = useRef6(true);
|
|
1774
1860
|
const state = controller.getState();
|
|
1775
1861
|
const maskView = controller.getMaskView();
|
|
1776
1862
|
const rows = layerPanelRows(state.layers, state.activeLayerId);
|
|
@@ -1810,14 +1896,14 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1810
1896
|
const maskThumb = (layer) => layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
|
|
1811
1897
|
const vectorThumb = (layer) => layer.vectorMask ? vectorMaskThumbnail(layer.vectorMask, state.imageDimensions.width, state.imageDimensions.height, 64) : null;
|
|
1812
1898
|
const locked = (layer) => Boolean(layer.locks?.all || layer.locks?.pixels || layer.locks?.position || layer.locks?.transparency);
|
|
1813
|
-
return /* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsxs9("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
|
|
1900
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
|
|
1901
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-layer"), children: "New Layer" }),
|
|
1902
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-group"), children: "New Group" }),
|
|
1903
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("duplicate"), children: "Duplicate" }),
|
|
1904
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("add-mask"), children: "Add Mask" }),
|
|
1905
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("delete"), children: "Delete" }),
|
|
1906
|
+
/* @__PURE__ */ jsx9(
|
|
1821
1907
|
"button",
|
|
1822
1908
|
{
|
|
1823
1909
|
type: "button",
|
|
@@ -1832,7 +1918,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1832
1918
|
children: "\u22EF"
|
|
1833
1919
|
}
|
|
1834
1920
|
),
|
|
1835
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ jsx9(
|
|
1836
1922
|
"select",
|
|
1837
1923
|
{
|
|
1838
1924
|
"aria-label": "Bits per channel",
|
|
@@ -1840,13 +1926,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1840
1926
|
className: "rounded bg-muted px-1 py-0.5 text-[11px] text-foreground",
|
|
1841
1927
|
value: controller.bitDepth,
|
|
1842
1928
|
onChange: (e) => attempt(() => controller.setBitDepth(Number(e.target.value))),
|
|
1843
|
-
children: BIT_DEPTH_OPTIONS.map((o) => /* @__PURE__ */
|
|
1929
|
+
children: BIT_DEPTH_OPTIONS.map((o) => /* @__PURE__ */ jsx9("option", { value: o.depth, title: o.title, children: o.label }, o.depth))
|
|
1844
1930
|
}
|
|
1845
1931
|
),
|
|
1846
|
-
psd && /* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1932
|
+
psd && /* @__PURE__ */ jsxs9(Fragment, { children: [
|
|
1933
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => fileInput.current?.click(), children: "Open PSD\u2026" }),
|
|
1934
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => psdTask(async () => (await downloadPsd(controller, psdFileName)).warnings), children: "Export PSD" }),
|
|
1935
|
+
/* @__PURE__ */ jsx9(
|
|
1850
1936
|
"input",
|
|
1851
1937
|
{
|
|
1852
1938
|
ref: fileInput,
|
|
@@ -1864,18 +1950,18 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1864
1950
|
)
|
|
1865
1951
|
] })
|
|
1866
1952
|
] }),
|
|
1867
|
-
psdNotes.length > 0 && /* @__PURE__ */
|
|
1868
|
-
psdNotes.map((n) => /* @__PURE__ */
|
|
1869
|
-
/* @__PURE__ */
|
|
1953
|
+
psdNotes.length > 0 && /* @__PURE__ */ jsxs9("ul", { className: "rounded bg-amber-500/10 text-amber-600 px-2 py-1 space-y-0.5", "data-testid": "psd-warnings", "aria-label": "PSD warnings", children: [
|
|
1954
|
+
psdNotes.map((n) => /* @__PURE__ */ jsx9("li", { children: n }, n)),
|
|
1955
|
+
/* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9("button", { type: "button", className: "underline", onClick: () => setPsdNotes([]), children: "Dismiss" }) })
|
|
1870
1956
|
] }),
|
|
1871
|
-
active && /* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */
|
|
1957
|
+
active && /* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-2 gap-x-2 gap-y-1 items-center", "data-testid": "layer-properties", children: [
|
|
1958
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex flex-col gap-0.5", children: [
|
|
1959
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground", children: [
|
|
1874
1960
|
"Opacity ",
|
|
1875
1961
|
Math.round(active.opacity * 100),
|
|
1876
1962
|
"%"
|
|
1877
1963
|
] }),
|
|
1878
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx9(
|
|
1879
1965
|
"input",
|
|
1880
1966
|
{
|
|
1881
1967
|
type: "range",
|
|
@@ -1889,13 +1975,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1889
1975
|
}
|
|
1890
1976
|
)
|
|
1891
1977
|
] }),
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1978
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex flex-col gap-0.5", children: [
|
|
1979
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground", children: [
|
|
1894
1980
|
"Fill ",
|
|
1895
1981
|
Math.round(((active.type === "pixel" ? active.fillOpacity : void 0) ?? 1) * 100),
|
|
1896
1982
|
"%"
|
|
1897
1983
|
] }),
|
|
1898
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ jsx9(
|
|
1899
1985
|
"input",
|
|
1900
1986
|
{
|
|
1901
1987
|
type: "range",
|
|
@@ -1910,7 +1996,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1910
1996
|
}
|
|
1911
1997
|
)
|
|
1912
1998
|
] }),
|
|
1913
|
-
/* @__PURE__ */
|
|
1999
|
+
/* @__PURE__ */ jsxs9(
|
|
1914
2000
|
"select",
|
|
1915
2001
|
{
|
|
1916
2002
|
"aria-label": "Layer blend mode",
|
|
@@ -1918,13 +2004,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1918
2004
|
value: active.blend,
|
|
1919
2005
|
onChange: (e) => attempt(() => controller.setLayerProperties(active.id, { blend: e.target.value })),
|
|
1920
2006
|
children: [
|
|
1921
|
-
active.type === "group" && /* @__PURE__ */
|
|
1922
|
-
BLEND_MODES2.map((m) => /* @__PURE__ */
|
|
2007
|
+
active.type === "group" && /* @__PURE__ */ jsx9("option", { value: "pass-through", children: "Pass Through" }),
|
|
2008
|
+
BLEND_MODES2.map((m) => /* @__PURE__ */ jsx9("option", { value: m.id, children: m.label }, m.id))
|
|
1923
2009
|
]
|
|
1924
2010
|
}
|
|
1925
2011
|
),
|
|
1926
|
-
/* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1.5 text-foreground", children: [
|
|
2013
|
+
/* @__PURE__ */ jsx9(
|
|
1928
2014
|
"input",
|
|
1929
2015
|
{
|
|
1930
2016
|
type: "checkbox",
|
|
@@ -1936,8 +2022,8 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1936
2022
|
),
|
|
1937
2023
|
"Clip to below"
|
|
1938
2024
|
] }),
|
|
1939
|
-
/* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsx9("div", { className: "col-span-2 flex flex-wrap gap-2 text-muted-foreground", role: "group", "aria-label": "Layer locks", children: ["pixels", "transparency", "position", "all"].map((k) => /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1", children: [
|
|
2026
|
+
/* @__PURE__ */ jsx9(
|
|
1941
2027
|
"input",
|
|
1942
2028
|
{
|
|
1943
2029
|
type: "checkbox",
|
|
@@ -1950,10 +2036,11 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1950
2036
|
k
|
|
1951
2037
|
] }, k)) })
|
|
1952
2038
|
] }),
|
|
1953
|
-
|
|
1954
|
-
/* @__PURE__ */
|
|
2039
|
+
active && (active.type === "pixel" || active.type === "shape" || active.type === "type" || active.type === "smart") && /* @__PURE__ */ jsx9(EdgeColorPanel, { controller, layer: active, className: "border-t border-border pt-1.5" }, active.id),
|
|
2040
|
+
effects && active && active.type !== "adjustment" && /* @__PURE__ */ jsx9(LayerEffectsPanel, { controller, className: "border-t border-border pt-1.5" }),
|
|
2041
|
+
/* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-0.5", role: "tree", "aria-label": "Layers", children: rows.map((row) => {
|
|
1955
2042
|
const { layer } = row;
|
|
1956
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ jsxs9(
|
|
1957
2044
|
"li",
|
|
1958
2045
|
{
|
|
1959
2046
|
role: "treeitem",
|
|
@@ -1983,7 +2070,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1983
2070
|
className: rowClass(row.active),
|
|
1984
2071
|
style: { paddingLeft: 6 + row.depth * 14 },
|
|
1985
2072
|
children: [
|
|
1986
|
-
/* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ jsx9(
|
|
1987
2074
|
"button",
|
|
1988
2075
|
{
|
|
1989
2076
|
type: "button",
|
|
@@ -1997,7 +2084,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
1997
2084
|
children: layer.visible ? "\u25CF" : "\u25CB"
|
|
1998
2085
|
}
|
|
1999
2086
|
),
|
|
2000
|
-
layer.type === "group" && /* @__PURE__ */
|
|
2087
|
+
layer.type === "group" && /* @__PURE__ */ jsx9(
|
|
2001
2088
|
"button",
|
|
2002
2089
|
{
|
|
2003
2090
|
type: "button",
|
|
@@ -2010,9 +2097,9 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2010
2097
|
children: layer.collapsed ? "\u25B8" : "\u25BE"
|
|
2011
2098
|
}
|
|
2012
2099
|
),
|
|
2013
|
-
row.clipped && /* @__PURE__ */
|
|
2014
|
-
layerHasThumbnail(layer) ? /* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2100
|
+
row.clipped && /* @__PURE__ */ jsx9("span", { className: "text-muted-foreground", "aria-label": "Clipped", children: "\u21B3" }),
|
|
2101
|
+
layerHasThumbnail(layer) ? /* @__PURE__ */ jsxs9("span", { className: "relative shrink-0", children: [
|
|
2102
|
+
/* @__PURE__ */ jsx9(
|
|
2016
2103
|
Thumbnail,
|
|
2017
2104
|
{
|
|
2018
2105
|
pixels: thumb(layer),
|
|
@@ -2028,7 +2115,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2028
2115
|
}
|
|
2029
2116
|
}
|
|
2030
2117
|
),
|
|
2031
|
-
layer.type !== "pixel" && /* @__PURE__ */
|
|
2118
|
+
layer.type !== "pixel" && /* @__PURE__ */ jsx9(
|
|
2032
2119
|
"span",
|
|
2033
2120
|
{
|
|
2034
2121
|
"data-testid": "layer-kind-badge",
|
|
@@ -2036,7 +2123,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2036
2123
|
children: layerBadge(layer)
|
|
2037
2124
|
}
|
|
2038
2125
|
)
|
|
2039
|
-
] }) : /* @__PURE__ */
|
|
2126
|
+
] }) : /* @__PURE__ */ jsx9(
|
|
2040
2127
|
"span",
|
|
2041
2128
|
{
|
|
2042
2129
|
className: "shrink-0 grid place-items-center rounded bg-muted text-[9px] text-muted-foreground ring-1 ring-border",
|
|
@@ -2044,7 +2131,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2044
2131
|
children: layerBadge(layer)
|
|
2045
2132
|
}
|
|
2046
2133
|
),
|
|
2047
|
-
layer.mask && !layer.mask.source && layer.type === "pixel" && /* @__PURE__ */
|
|
2134
|
+
layer.mask && !layer.mask.source && layer.type === "pixel" && /* @__PURE__ */ jsx9(
|
|
2048
2135
|
"button",
|
|
2049
2136
|
{
|
|
2050
2137
|
type: "button",
|
|
@@ -2060,7 +2147,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2060
2147
|
children: layer.mask.linked === false ? "\u26D3\uFE0E\u0338" : "\u26D3\uFE0E"
|
|
2061
2148
|
}
|
|
2062
2149
|
),
|
|
2063
|
-
layer.mask && /* @__PURE__ */
|
|
2150
|
+
layer.mask && /* @__PURE__ */ jsx9(
|
|
2064
2151
|
Thumbnail,
|
|
2065
2152
|
{
|
|
2066
2153
|
pixels: maskThumb(layer),
|
|
@@ -2075,7 +2162,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2075
2162
|
}
|
|
2076
2163
|
}
|
|
2077
2164
|
),
|
|
2078
|
-
layer.vectorMask && /* @__PURE__ */
|
|
2165
|
+
layer.vectorMask && /* @__PURE__ */ jsx9(
|
|
2079
2166
|
Thumbnail,
|
|
2080
2167
|
{
|
|
2081
2168
|
pixels: vectorThumb(layer),
|
|
@@ -2089,7 +2176,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2089
2176
|
}
|
|
2090
2177
|
}
|
|
2091
2178
|
),
|
|
2092
|
-
renaming === layer.id ? /* @__PURE__ */
|
|
2179
|
+
renaming === layer.id ? /* @__PURE__ */ jsx9(
|
|
2093
2180
|
"input",
|
|
2094
2181
|
{
|
|
2095
2182
|
autoFocus: true,
|
|
@@ -2106,7 +2193,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2106
2193
|
if (e.key === "Escape") setRenaming(null);
|
|
2107
2194
|
}
|
|
2108
2195
|
}
|
|
2109
|
-
) : /* @__PURE__ */
|
|
2196
|
+
) : /* @__PURE__ */ jsx9(
|
|
2110
2197
|
"span",
|
|
2111
2198
|
{
|
|
2112
2199
|
className: `flex-1 min-w-0 truncate ${layer.visible ? "" : "text-muted-foreground"}`,
|
|
@@ -2117,8 +2204,8 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2117
2204
|
children: row.label
|
|
2118
2205
|
}
|
|
2119
2206
|
),
|
|
2120
|
-
layerWarning(layer) && /* @__PURE__ */
|
|
2121
|
-
layerEffectsBadge(layer) && /* @__PURE__ */
|
|
2207
|
+
layerWarning(layer) && /* @__PURE__ */ jsx9("span", { role: "img", "data-testid": "layer-warning", "aria-label": layerWarning(layer), title: layerWarning(layer), className: "text-[10px] text-amber-600", children: "\u26A0" }),
|
|
2208
|
+
layerEffectsBadge(layer) && /* @__PURE__ */ jsx9(
|
|
2122
2209
|
"button",
|
|
2123
2210
|
{
|
|
2124
2211
|
type: "button",
|
|
@@ -2133,15 +2220,15 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2133
2220
|
children: "fx"
|
|
2134
2221
|
}
|
|
2135
2222
|
),
|
|
2136
|
-
locked(layer) && /* @__PURE__ */
|
|
2137
|
-
layer.blend !== "normal" && layer.blend !== "pass-through" && /* @__PURE__ */
|
|
2223
|
+
locked(layer) && /* @__PURE__ */ jsx9("span", { "aria-label": "Locked", className: "text-muted-foreground", children: "\u{1F512}" }),
|
|
2224
|
+
layer.blend !== "normal" && layer.blend !== "pass-through" && /* @__PURE__ */ jsx9("span", { className: "text-[9px] text-muted-foreground", children: layer.blend })
|
|
2138
2225
|
]
|
|
2139
2226
|
},
|
|
2140
2227
|
layer.id
|
|
2141
2228
|
);
|
|
2142
2229
|
}) }),
|
|
2143
|
-
error && /* @__PURE__ */
|
|
2144
|
-
menu && /* @__PURE__ */
|
|
2230
|
+
error && /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-destructive", children: error }),
|
|
2231
|
+
menu && /* @__PURE__ */ jsx9(
|
|
2145
2232
|
"div",
|
|
2146
2233
|
{
|
|
2147
2234
|
role: "menu",
|
|
@@ -2150,7 +2237,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2150
2237
|
style: { left: menu.x, top: menu.y },
|
|
2151
2238
|
onClick: (e) => e.stopPropagation(),
|
|
2152
2239
|
onKeyDown: (e) => e.key === "Escape" && setMenu(null),
|
|
2153
|
-
children: layerMenu(controller).map((item) => /* @__PURE__ */
|
|
2240
|
+
children: layerMenu(controller).map((item) => /* @__PURE__ */ jsx9(
|
|
2154
2241
|
"button",
|
|
2155
2242
|
{
|
|
2156
2243
|
type: "button",
|
|
@@ -2168,14 +2255,14 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
2168
2255
|
};
|
|
2169
2256
|
|
|
2170
2257
|
// src/image-editor/ImageProviderEffectsPanel.tsx
|
|
2171
|
-
import { useEffect as useEffect7, useRef as
|
|
2258
|
+
import { useEffect as useEffect7, useRef as useRef7, useState as useState9 } from "react";
|
|
2172
2259
|
import { EFFECT_LAYER_USES, effectLayerTiming, findLayer } from "@pixerate/editor/image-editor";
|
|
2173
2260
|
|
|
2174
2261
|
// src/image-editor/controls/parameterControls.tsx
|
|
2175
2262
|
import { matchParameterOptionValue } from "@pixerate/editor/parameters";
|
|
2176
|
-
import { jsx as
|
|
2263
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
2177
2264
|
function ImageParameterSlider({ value, min, max, step, label, disabled, className, onChange, onGestureStart, onGestureEnd }) {
|
|
2178
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsx10(
|
|
2179
2266
|
ImageRange,
|
|
2180
2267
|
{
|
|
2181
2268
|
value,
|
|
@@ -2192,7 +2279,7 @@ function ImageParameterSlider({ value, min, max, step, label, disabled, classNam
|
|
|
2192
2279
|
);
|
|
2193
2280
|
}
|
|
2194
2281
|
function ImageParameterSelect({ value, options, label, disabled, className, onChange }) {
|
|
2195
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ jsx10(
|
|
2196
2283
|
ImageSelect,
|
|
2197
2284
|
{
|
|
2198
2285
|
value: String(value),
|
|
@@ -2205,7 +2292,7 @@ function ImageParameterSelect({ value, options, label, disabled, className, onCh
|
|
|
2205
2292
|
);
|
|
2206
2293
|
}
|
|
2207
2294
|
function ImageParameterColor({ value, alpha, label, disabled, className, onChange, onGestureStart, onGestureEnd }) {
|
|
2208
|
-
return /* @__PURE__ */
|
|
2295
|
+
return /* @__PURE__ */ jsx10(
|
|
2209
2296
|
ImageColor,
|
|
2210
2297
|
{
|
|
2211
2298
|
value,
|
|
@@ -2228,33 +2315,33 @@ function imageEditorParameterComponents(controls) {
|
|
|
2228
2315
|
}
|
|
2229
2316
|
|
|
2230
2317
|
// src/image-editor/ImageEffectControls.tsx
|
|
2231
|
-
import { jsx as
|
|
2318
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2232
2319
|
function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className, components }) {
|
|
2233
2320
|
const { description, error } = useEffectDescription(provider, effect);
|
|
2234
2321
|
const fallback = resolveParameterComponents(useParameterComponents(), imageEditorParameterComponents(useImageEditorControls()));
|
|
2235
2322
|
const effectiveComponents = resolveParameterComponents(components, fallback);
|
|
2236
2323
|
let body;
|
|
2237
|
-
if (!provider) body = /* @__PURE__ */
|
|
2324
|
+
if (!provider) body = /* @__PURE__ */ jsxs10("p", { className: "text-[11px] text-muted-foreground", children: [
|
|
2238
2325
|
'No effects provider: "',
|
|
2239
2326
|
name ?? effect,
|
|
2240
2327
|
'" is kept but not drawn.'
|
|
2241
2328
|
] });
|
|
2242
|
-
else if (error) body = /* @__PURE__ */
|
|
2243
|
-
else if (!description) body = /* @__PURE__ */
|
|
2244
|
-
else body = /* @__PURE__ */
|
|
2245
|
-
return /* @__PURE__ */
|
|
2329
|
+
else if (error) body = /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-amber-600", children: error });
|
|
2330
|
+
else if (!description) body = /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "Loading\u2026" });
|
|
2331
|
+
else body = /* @__PURE__ */ jsx11(EffectParameters, { description, values, onChange, onReset: (k) => onChange(k, description.defaults[k], null), onPreset, components: effectiveComponents });
|
|
2332
|
+
return /* @__PURE__ */ jsx11("div", { className, "data-testid": "image-effect-controls", children: body });
|
|
2246
2333
|
}
|
|
2247
2334
|
|
|
2248
2335
|
// src/image-editor/ImageProviderEffectsPanel.tsx
|
|
2249
|
-
import { jsx as
|
|
2336
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2250
2337
|
var fmt = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 2 : 1)} s`;
|
|
2251
2338
|
function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
2252
|
-
const [, setTick] =
|
|
2339
|
+
const [, setTick] = useState9(0);
|
|
2253
2340
|
useEffect7(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
2254
|
-
const [browse, setBrowse] =
|
|
2255
|
-
const [message, setMessage] =
|
|
2256
|
-
const [open, setOpen] =
|
|
2257
|
-
const [scrubbed, setScrubbed] =
|
|
2341
|
+
const [browse, setBrowse] = useState9(null);
|
|
2342
|
+
const [message, setMessage] = useState9(null);
|
|
2343
|
+
const [open, setOpen] = useState9(null);
|
|
2344
|
+
const [scrubbed, setScrubbed] = useState9(null);
|
|
2258
2345
|
const provider = controller.effectsProvider;
|
|
2259
2346
|
const state = controller.getState();
|
|
2260
2347
|
const layer = state.activeLayerId ? findLayer(state.layers, state.activeLayerId)?.layer ?? null : null;
|
|
@@ -2262,7 +2349,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2262
2349
|
setMessage(null);
|
|
2263
2350
|
Promise.resolve().then(work).catch((e) => setMessage(e instanceof Error ? e.message : String(e)));
|
|
2264
2351
|
};
|
|
2265
|
-
const drags =
|
|
2352
|
+
const drags = useRef7(/* @__PURE__ */ new Set());
|
|
2266
2353
|
const commit = (gesture) => {
|
|
2267
2354
|
if (gesture) {
|
|
2268
2355
|
if (!drags.current.has(gesture)) {
|
|
@@ -2278,7 +2365,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2278
2365
|
const canFilter = !!provider && !!layer && layer.type !== "adjustment" && layer.type !== "annotation";
|
|
2279
2366
|
const { description } = useEffectDescription(provider, generator?.effect);
|
|
2280
2367
|
const timing = generator ? effectLayerTiming(generator, description) : null;
|
|
2281
|
-
const scrub =
|
|
2368
|
+
const scrub = useRef7({ next: null, busy: false, gesture: null });
|
|
2282
2369
|
const scrubTo = (layerId, time) => {
|
|
2283
2370
|
const s = scrub.current;
|
|
2284
2371
|
setScrubbed(time);
|
|
@@ -2297,18 +2384,18 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2297
2384
|
});
|
|
2298
2385
|
};
|
|
2299
2386
|
const shown = scrubbed ?? timing?.time ?? 0;
|
|
2300
|
-
return /* @__PURE__ */
|
|
2301
|
-
!provider && /* @__PURE__ */
|
|
2302
|
-
generator && layer && /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
/* @__PURE__ */
|
|
2306
|
-
/* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ jsxs11("section", { className: `flex flex-col gap-2 text-xs ${className}`, "aria-label": "Effects", "data-image-provider-effects": "", children: [
|
|
2388
|
+
!provider && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "No effects provider is registered. Effects in the document are kept." }),
|
|
2389
|
+
generator && layer && /* @__PURE__ */ jsxs11("div", { className: "space-y-2", "data-effect-part": "generator", children: [
|
|
2390
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
|
|
2391
|
+
/* @__PURE__ */ jsx12("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", title: generator.name ?? generator.effect, children: generator.name ?? generator.effect }),
|
|
2392
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider, "aria-pressed": browse === "change", onClick: () => setBrowse(browse === "change" ? null : "change"), children: "Change\u2026" }),
|
|
2393
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, title: "Keep the pixels as a plain layer", onClick: () => run(() => controller.rasterizeEffectLayer(layer.id)), children: "Rasterize" })
|
|
2307
2394
|
] }),
|
|
2308
|
-
browse === "change" && /* @__PURE__ */
|
|
2309
|
-
timing && /* @__PURE__ */
|
|
2310
|
-
/* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2395
|
+
browse === "change" && /* @__PURE__ */ jsx12(EffectsBrowser, { provider, uses: EFFECT_LAYER_USES, title: "Change the effect to", onPick: (e) => (setBrowse(null), run(() => controller.updateEffectLayer(layer.id, { effect: e.id }))) }),
|
|
2396
|
+
timing && /* @__PURE__ */ jsxs11("div", { className: "space-y-1.5 rounded border border-border p-1.5", "data-effect-part": "timing", role: "group", "aria-label": "Frames", children: [
|
|
2397
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex gap-1", role: "radiogroup", "aria-label": "Output", children: [
|
|
2398
|
+
/* @__PURE__ */ jsx12(
|
|
2312
2399
|
"button",
|
|
2313
2400
|
{
|
|
2314
2401
|
type: "button",
|
|
@@ -2319,7 +2406,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2319
2406
|
children: "Still frame"
|
|
2320
2407
|
}
|
|
2321
2408
|
),
|
|
2322
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ jsx12(
|
|
2323
2410
|
"button",
|
|
2324
2411
|
{
|
|
2325
2412
|
type: "button",
|
|
@@ -2331,9 +2418,9 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2331
2418
|
}
|
|
2332
2419
|
)
|
|
2333
2420
|
] }),
|
|
2334
|
-
/* @__PURE__ */
|
|
2335
|
-
/* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2421
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
|
|
2422
|
+
/* @__PURE__ */ jsx12("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: timing.mode === "still" ? "Frame" : "Starts at" }),
|
|
2423
|
+
/* @__PURE__ */ jsx12(
|
|
2337
2424
|
ImageRange,
|
|
2338
2425
|
{
|
|
2339
2426
|
min: 0,
|
|
@@ -2347,11 +2434,11 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2347
2434
|
onChange: (t) => scrubTo(layer.id, t)
|
|
2348
2435
|
}
|
|
2349
2436
|
),
|
|
2350
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ jsx12("span", { className: "w-12 shrink-0 text-right tabular-nums text-muted-foreground", children: fmt(shown) })
|
|
2351
2438
|
] }),
|
|
2352
|
-
timing.mode === "animate" && /* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
2354
|
-
/* @__PURE__ */
|
|
2439
|
+
timing.mode === "animate" && /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
|
|
2440
|
+
/* @__PURE__ */ jsx12("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: "Length" }),
|
|
2441
|
+
/* @__PURE__ */ jsx12(
|
|
2355
2442
|
"input",
|
|
2356
2443
|
{
|
|
2357
2444
|
type: "number",
|
|
@@ -2368,13 +2455,13 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2368
2455
|
},
|
|
2369
2456
|
timing.duration
|
|
2370
2457
|
),
|
|
2371
|
-
/* @__PURE__ */
|
|
2458
|
+
/* @__PURE__ */ jsxs11("span", { className: "text-muted-foreground", children: [
|
|
2372
2459
|
"s",
|
|
2373
2460
|
timing.loops ? ` \xB7 loops every ${fmt(timing.range)}` : ""
|
|
2374
2461
|
] })
|
|
2375
2462
|
] })
|
|
2376
2463
|
] }),
|
|
2377
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsx12(
|
|
2378
2465
|
ImageEffectControls,
|
|
2379
2466
|
{
|
|
2380
2467
|
provider,
|
|
@@ -2387,19 +2474,19 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2387
2474
|
}
|
|
2388
2475
|
)
|
|
2389
2476
|
] }),
|
|
2390
|
-
layer && canFilter && /* @__PURE__ */
|
|
2391
|
-
/* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2477
|
+
layer && canFilter && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", "data-effect-part": "applied", children: [
|
|
2478
|
+
/* @__PURE__ */ jsx12("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Filters" }),
|
|
2479
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Add filter\u2026" })
|
|
2393
2480
|
] }),
|
|
2394
|
-
browse === "filter" && layer && /* @__PURE__ */
|
|
2395
|
-
filters.length > 0 && layer && /* @__PURE__ */
|
|
2481
|
+
browse === "filter" && layer && /* @__PURE__ */ jsx12(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id, { useSelection: true }))) }),
|
|
2482
|
+
filters.length > 0 && layer && /* @__PURE__ */ jsx12("ol", { className: "space-y-1", "data-effect-part": "filters", "aria-label": "Filters", children: filters.map((f) => {
|
|
2396
2483
|
const label = f.kind === "effect" ? f.name ?? f.effect : f.kind;
|
|
2397
2484
|
const all = layer.smartFilters.filters;
|
|
2398
2485
|
const index = all.indexOf(f);
|
|
2399
2486
|
if (f.kind !== "effect") return null;
|
|
2400
|
-
return /* @__PURE__ */
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2487
|
+
return /* @__PURE__ */ jsxs11("li", { className: "rounded border border-border p-1", "data-smart-effect": f.id, children: [
|
|
2488
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
|
|
2489
|
+
/* @__PURE__ */ jsx12(
|
|
2403
2490
|
ImageCheckbox,
|
|
2404
2491
|
{
|
|
2405
2492
|
checked: f.enabled,
|
|
@@ -2407,15 +2494,15 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2407
2494
|
onChange: (enabled) => run(() => controller.updateEffectFilter(layer.id, f.id, { enabled }))
|
|
2408
2495
|
}
|
|
2409
2496
|
),
|
|
2410
|
-
/* @__PURE__ */
|
|
2411
|
-
/* @__PURE__ */
|
|
2412
|
-
/* @__PURE__ */
|
|
2413
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: "min-w-0 flex-1 truncate text-left text-foreground", "aria-expanded": open === f.id, onClick: () => setOpen(open === f.id ? null : f.id), children: label }),
|
|
2498
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: index === all.length - 1, "aria-label": "Move up", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index + 1 })), children: "\u2191" }),
|
|
2499
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: index === 0, "aria-label": "Move down", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index - 1 })), children: "\u2193" }),
|
|
2500
|
+
/* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, "aria-label": `Remove ${label}`, onClick: () => run(() => controller.removeSmartFilter(layer.id, f.id)), children: "\u2715" })
|
|
2414
2501
|
] }),
|
|
2415
|
-
open === f.id && /* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2418
|
-
/* @__PURE__ */
|
|
2502
|
+
open === f.id && /* @__PURE__ */ jsxs11("div", { className: "mt-1 space-y-2", children: [
|
|
2503
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
|
|
2504
|
+
/* @__PURE__ */ jsx12("span", { className: "w-14 text-[11px] text-foreground", children: "Opacity" }),
|
|
2505
|
+
/* @__PURE__ */ jsx12(
|
|
2419
2506
|
ImageRange,
|
|
2420
2507
|
{
|
|
2421
2508
|
min: 0,
|
|
@@ -2428,7 +2515,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2428
2515
|
}
|
|
2429
2516
|
)
|
|
2430
2517
|
] }),
|
|
2431
|
-
/* @__PURE__ */
|
|
2518
|
+
/* @__PURE__ */ jsx12(
|
|
2432
2519
|
ImageEffectControls,
|
|
2433
2520
|
{
|
|
2434
2521
|
provider,
|
|
@@ -2443,14 +2530,14 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
|
|
|
2443
2530
|
] })
|
|
2444
2531
|
] }, f.id);
|
|
2445
2532
|
}) }),
|
|
2446
|
-
layer && canFilter && !generator && filters.length === 0 && /* @__PURE__ */
|
|
2447
|
-
!layer && /* @__PURE__ */
|
|
2448
|
-
message && /* @__PURE__ */
|
|
2533
|
+
layer && canFilter && !generator && filters.length === 0 && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "No filters yet. A filter changes the layer's pixels and stays editable. Layer styles such as a drop shadow are in the layer's properties; new effect layers are added from the layers panel." }),
|
|
2534
|
+
!layer && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "Select a layer to apply effects to it." }),
|
|
2535
|
+
message && /* @__PURE__ */ jsx12("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
|
|
2449
2536
|
] });
|
|
2450
2537
|
}
|
|
2451
2538
|
|
|
2452
2539
|
// src/image-editor/BrushOptionsBar.tsx
|
|
2453
|
-
import { useEffect as useEffect8, useState as
|
|
2540
|
+
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
2454
2541
|
import {
|
|
2455
2542
|
BRUSH_OPTION_CONTROLS,
|
|
2456
2543
|
MIXER_MIXING_OPTIONS,
|
|
@@ -2471,15 +2558,15 @@ import { DEFAULT_PAINT_GRADIENT, userErrorMessage } from "@pixerate/editor/image
|
|
|
2471
2558
|
|
|
2472
2559
|
// src/image-editor/PaintGradientEditor.tsx
|
|
2473
2560
|
import { PAINT_GRADIENT_KIT } from "@pixerate/editor/image-editor";
|
|
2474
|
-
import { jsx as
|
|
2475
|
-
var PaintGradientEditor = (props) => /* @__PURE__ */
|
|
2561
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
2562
|
+
var PaintGradientEditor = (props) => /* @__PURE__ */ jsx13(PaintGradientEditorView, { ...props, kit: PAINT_GRADIENT_KIT });
|
|
2476
2563
|
|
|
2477
2564
|
// src/image-editor/BrushOptionsBar.tsx
|
|
2478
|
-
import { jsx as
|
|
2565
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2479
2566
|
var BrushOptionsBar = ({ controller, className }) => {
|
|
2480
|
-
const [, setTick] =
|
|
2567
|
+
const [, setTick] = useState10(0);
|
|
2481
2568
|
useEffect8(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
2482
|
-
const [error, setError] =
|
|
2569
|
+
const [error, setError] = useState10(null);
|
|
2483
2570
|
const state = controller.getState();
|
|
2484
2571
|
const { brush, foreground, background, mixer, mixerLoad, retouch, cloneSource, paint } = state.paint;
|
|
2485
2572
|
const tool = state.activeTool;
|
|
@@ -2491,8 +2578,8 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2491
2578
|
setError(userErrorMessage(err));
|
|
2492
2579
|
}
|
|
2493
2580
|
};
|
|
2494
|
-
return /* @__PURE__ */
|
|
2495
|
-
/* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ jsxs12("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "brush-options", children: [
|
|
2582
|
+
/* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Paint tools", children: PAINT_TOOLS.map((t) => /* @__PURE__ */ jsx14(
|
|
2496
2583
|
"button",
|
|
2497
2584
|
{
|
|
2498
2585
|
type: "button",
|
|
@@ -2504,18 +2591,18 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2504
2591
|
},
|
|
2505
2592
|
t.id
|
|
2506
2593
|
)) }),
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
/* @__PURE__ */
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
/* @__PURE__ */
|
|
2594
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", role: "group", "aria-label": "Colours", children: [
|
|
2595
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
2596
|
+
/* @__PURE__ */ jsx14(ImageColor, { label: "Foreground colour", value: foreground, onChange: (fg) => controller.setPaintOptions({ foreground: fg }) }),
|
|
2597
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "FG" })
|
|
2511
2598
|
] }),
|
|
2512
|
-
/* @__PURE__ */
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2599
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
2600
|
+
/* @__PURE__ */ jsx14(ImageColor, { label: "Background colour", value: background, onChange: (bg) => controller.setPaintOptions({ background: bg }) }),
|
|
2601
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "BG" })
|
|
2515
2602
|
] }),
|
|
2516
|
-
/* @__PURE__ */
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
state.activeTool === "brush" && /* @__PURE__ */
|
|
2603
|
+
/* @__PURE__ */ jsx14("button", { type: "button", title: "Swap colours (X)", className: imageChipClass(false), onClick: () => controller.swapPaintColors(), children: "Swap" }),
|
|
2604
|
+
/* @__PURE__ */ jsx14("button", { type: "button", title: "Default colours (D)", className: imageChipClass(false), onClick: () => controller.resetPaintColors(), children: "Default" }),
|
|
2605
|
+
state.activeTool === "brush" && /* @__PURE__ */ jsx14(
|
|
2519
2606
|
"button",
|
|
2520
2607
|
{
|
|
2521
2608
|
type: "button",
|
|
@@ -2527,8 +2614,8 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2527
2614
|
}
|
|
2528
2615
|
)
|
|
2529
2616
|
] }),
|
|
2530
|
-
state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */
|
|
2531
|
-
BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */
|
|
2617
|
+
state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */ jsx14(PaintGradientEditor, { value: paint, colors: { paint: foreground, secondary: background }, onChange: (g) => attempt(() => controller.setPaintOptions({ paint: g })) }),
|
|
2618
|
+
BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(
|
|
2532
2619
|
ControlSlider,
|
|
2533
2620
|
{
|
|
2534
2621
|
spec,
|
|
@@ -2537,9 +2624,9 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2537
2624
|
},
|
|
2538
2625
|
spec.id
|
|
2539
2626
|
)),
|
|
2540
|
-
state.activeTool === "mixer" && /* @__PURE__ */
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2627
|
+
state.activeTool === "mixer" && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Mixer Brush", "data-testid": "mixer-options", children: [
|
|
2628
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
|
|
2629
|
+
/* @__PURE__ */ jsx14(
|
|
2543
2630
|
"span",
|
|
2544
2631
|
{
|
|
2545
2632
|
"aria-label": "Brush load",
|
|
@@ -2548,10 +2635,10 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2548
2635
|
style: { background: mixerLoad.reservoir ? rgbUnitToHex(mixerLoad.reservoir) : "transparent" }
|
|
2549
2636
|
}
|
|
2550
2637
|
),
|
|
2551
|
-
/* @__PURE__ */
|
|
2552
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ jsx14("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: imageChipClass(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
|
|
2639
|
+
/* @__PURE__ */ jsx14("button", { type: "button", title: "Empty the picked-up colour", className: imageChipClass(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
|
|
2553
2640
|
] }),
|
|
2554
|
-
/* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ jsx14("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx14(
|
|
2555
2642
|
"button",
|
|
2556
2643
|
{
|
|
2557
2644
|
type: "button",
|
|
@@ -2563,34 +2650,34 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2563
2650
|
},
|
|
2564
2651
|
m.id
|
|
2565
2652
|
)) }),
|
|
2566
|
-
MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2569
|
-
/* @__PURE__ */
|
|
2653
|
+
MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
|
|
2654
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-3 text-foreground", children: [
|
|
2655
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
|
|
2656
|
+
/* @__PURE__ */ jsx14(ImageCheckbox, { label: "Load the brush after each stroke", checked: mixer.loadEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { loadEachStroke: on } }) }),
|
|
2570
2657
|
"Load each stroke"
|
|
2571
2658
|
] }),
|
|
2572
|
-
/* @__PURE__ */
|
|
2573
|
-
/* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
|
|
2660
|
+
/* @__PURE__ */ jsx14(ImageCheckbox, { label: "Clean the brush after each stroke", checked: mixer.cleanEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { cleanEachStroke: on } }) }),
|
|
2574
2661
|
"Clean each stroke"
|
|
2575
2662
|
] })
|
|
2576
2663
|
] })
|
|
2577
2664
|
] }),
|
|
2578
|
-
isRetouchPaintTool(tool) && /* @__PURE__ */
|
|
2579
|
-
(tool === "clone" || tool === "heal") && /* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2581
|
-
cloneSource && /* @__PURE__ */
|
|
2665
|
+
isRetouchPaintTool(tool) && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Retouch options", "data-testid": "retouch-options", children: [
|
|
2666
|
+
(tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
|
|
2667
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", "data-testid": "clone-source", children: cloneSourceLabel(controller) }),
|
|
2668
|
+
cloneSource && /* @__PURE__ */ jsx14("button", { type: "button", title: "Forget the source point", className: imageChipClass(false), onClick: () => controller.setCloneSource(null), children: "Clear source" })
|
|
2582
2669
|
] }),
|
|
2583
|
-
(tool === "clone" || tool === "heal") && /* @__PURE__ */
|
|
2584
|
-
CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */
|
|
2585
|
-
/* @__PURE__ */
|
|
2586
|
-
/* @__PURE__ */
|
|
2587
|
-
/* @__PURE__ */
|
|
2588
|
-
!cloneTransformView(controller).identity && /* @__PURE__ */
|
|
2670
|
+
(tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Clone source transform", "data-testid": "clone-transform", children: [
|
|
2671
|
+
CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: cloneTransformView(controller)[spec.id], onChange: (v) => setCloneTransformValue(controller, spec.id, v) }, spec.id)),
|
|
2672
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1", children: [
|
|
2673
|
+
/* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipH, title: "Mirror the source left to right", className: imageChipClass(cloneTransformView(controller).flipH), onClick: () => setCloneTransformValue(controller, "flipH"), children: "Flip H" }),
|
|
2674
|
+
/* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipV, title: "Mirror the source top to bottom", className: imageChipClass(cloneTransformView(controller).flipV), onClick: () => setCloneTransformValue(controller, "flipV"), children: "Flip V" }),
|
|
2675
|
+
!cloneTransformView(controller).identity && /* @__PURE__ */ jsx14("button", { type: "button", title: "Back to 100 %, no flip, 0\xB0", className: imageChipClass(false), onClick: () => controller.setCloneTransform(null), children: "Reset transform" })
|
|
2589
2676
|
] })
|
|
2590
2677
|
] }),
|
|
2591
|
-
RETOUCH_CHOICES.filter((c) => c.tools.includes(tool)).map((choice) => /* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2593
|
-
choice.options.map((o) => /* @__PURE__ */
|
|
2678
|
+
RETOUCH_CHOICES.filter((c) => c.tools.includes(tool)).map((choice) => /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": choice.label, children: [
|
|
2679
|
+
/* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: choice.label }),
|
|
2680
|
+
choice.options.map((o) => /* @__PURE__ */ jsx14(
|
|
2594
2681
|
"button",
|
|
2595
2682
|
{
|
|
2596
2683
|
type: "button",
|
|
@@ -2603,43 +2690,43 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
2603
2690
|
o.id
|
|
2604
2691
|
))
|
|
2605
2692
|
] }, choice.id)),
|
|
2606
|
-
RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */
|
|
2607
|
-
/* @__PURE__ */
|
|
2608
|
-
/* @__PURE__ */
|
|
2693
|
+
RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: retouch[spec.id], onChange: (v) => controller.setPaintOptions({ retouch: { [spec.id]: v } }) }, spec.id)),
|
|
2694
|
+
/* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-3 text-foreground", children: RETOUCH_TOGGLES.filter((t) => t.tools.includes(tool)).map((t) => /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
|
|
2695
|
+
/* @__PURE__ */ jsx14(ImageCheckbox, { label: t.label, checked: retouch[t.id], onChange: (on) => controller.setPaintOptions({ retouch: { [t.id]: on } }) }),
|
|
2609
2696
|
t.label
|
|
2610
2697
|
] }, t.id)) })
|
|
2611
2698
|
] }),
|
|
2612
|
-
/* @__PURE__ */
|
|
2613
|
-
/* @__PURE__ */
|
|
2614
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-3 text-foreground", role: "group", "aria-label": "Pressure", children: [
|
|
2700
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
|
|
2701
|
+
/* @__PURE__ */ jsx14(ImageCheckbox, { label: "Pressure controls size", checked: brush.pressureSize, onChange: (on) => controller.setPaintOptions({ brush: { pressureSize: on } }) }),
|
|
2615
2702
|
"Pressure size"
|
|
2616
2703
|
] }),
|
|
2617
|
-
/* @__PURE__ */
|
|
2618
|
-
/* @__PURE__ */
|
|
2704
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
|
|
2705
|
+
/* @__PURE__ */ jsx14(ImageCheckbox, { label: "Pressure controls opacity", checked: brush.pressureOpacity, onChange: (on) => controller.setPaintOptions({ brush: { pressureOpacity: on } }) }),
|
|
2619
2706
|
"Pressure opacity"
|
|
2620
2707
|
] })
|
|
2621
2708
|
] }),
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex gap-1", children: [
|
|
2710
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.fillPixels()), children: "Fill" }),
|
|
2711
|
+
/* @__PURE__ */ jsx14("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.clearPixels()), children: "Clear" })
|
|
2625
2712
|
] }),
|
|
2626
|
-
error && /* @__PURE__ */
|
|
2713
|
+
error && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-destructive", children: error })
|
|
2627
2714
|
] });
|
|
2628
2715
|
};
|
|
2629
2716
|
|
|
2630
2717
|
// src/image-editor/ColorProfilePanel.tsx
|
|
2631
|
-
import { useEffect as useEffect9, useState as
|
|
2718
|
+
import { useEffect as useEffect9, useState as useState11 } from "react";
|
|
2632
2719
|
import { COLOR_MODE_OPTIONS, INTENT_OPTIONS, PROOF_PROFILE_OPTIONS, WORKING_SPACE_OPTIONS, colorPanelView } from "@pixerate/editor/image-editor";
|
|
2633
|
-
import { Fragment as Fragment2, jsx as
|
|
2720
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2634
2721
|
var chip = imageChipClass(false);
|
|
2635
2722
|
var select = "rounded bg-muted px-1 py-0.5 text-[11px] text-foreground";
|
|
2636
2723
|
var ColorProfilePanel = ({ controller, className }) => {
|
|
2637
|
-
const [, setTick] =
|
|
2724
|
+
const [, setTick] = useState11(0);
|
|
2638
2725
|
useEffect9(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
2639
|
-
const [target, setTarget] =
|
|
2640
|
-
const [intent, setIntent] =
|
|
2641
|
-
const [bpc, setBpc] =
|
|
2642
|
-
const [error, setError] =
|
|
2726
|
+
const [target, setTarget] = useState11("display-p3");
|
|
2727
|
+
const [intent, setIntent] = useState11("relative");
|
|
2728
|
+
const [bpc, setBpc] = useState11(true);
|
|
2729
|
+
const [error, setError] = useState11(null);
|
|
2643
2730
|
const view = colorPanelView(controller);
|
|
2644
2731
|
const attempt = (fn) => {
|
|
2645
2732
|
try {
|
|
@@ -2661,29 +2748,29 @@ var ColorProfilePanel = ({ controller, className }) => {
|
|
|
2661
2748
|
})
|
|
2662
2749
|
);
|
|
2663
2750
|
};
|
|
2664
|
-
return /* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2666
|
-
/* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2751
|
+
return /* @__PURE__ */ jsxs13("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "color-profile-panel", children: [
|
|
2752
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
2753
|
+
/* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Profile" }),
|
|
2754
|
+
/* @__PURE__ */ jsx15("span", { "data-testid": "color-profile-name", children: view.profileName })
|
|
2668
2755
|
] }),
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
view.cmykProfileName && /* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Colour mode", children: [
|
|
2757
|
+
/* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Mode" }),
|
|
2758
|
+
/* @__PURE__ */ jsx15("select", { "aria-label": "Colour mode", className: select, value: view.mode, onChange: (e) => attempt(() => controller.setColorMode(e.target.value)), children: COLOR_MODE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
|
|
2759
|
+
view.cmykProfileName && /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: view.cmykProfileName })
|
|
2673
2760
|
] }),
|
|
2674
|
-
/* @__PURE__ */
|
|
2675
|
-
/* @__PURE__ */
|
|
2676
|
-
/* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Assign or convert", children: [
|
|
2762
|
+
/* @__PURE__ */ jsx15("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id)) }),
|
|
2763
|
+
/* @__PURE__ */ jsx15("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
|
|
2764
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
|
|
2765
|
+
/* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-primary" }),
|
|
2679
2766
|
"BPC"
|
|
2680
2767
|
] }),
|
|
2681
|
-
/* @__PURE__ */
|
|
2682
|
-
/* @__PURE__ */
|
|
2768
|
+
/* @__PURE__ */ jsx15("button", { type: "button", className: chip, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
|
|
2769
|
+
/* @__PURE__ */ jsx15("button", { type: "button", className: chip, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
|
|
2683
2770
|
] }),
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Proof setup", children: [
|
|
2772
|
+
/* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Proof" }),
|
|
2773
|
+
/* @__PURE__ */ jsxs13(
|
|
2687
2774
|
"select",
|
|
2688
2775
|
{
|
|
2689
2776
|
"aria-label": "Proof profile",
|
|
@@ -2691,29 +2778,29 @@ var ColorProfilePanel = ({ controller, className }) => {
|
|
|
2691
2778
|
value: view.proof?.id ?? "",
|
|
2692
2779
|
onChange: (e) => e.target.value ? proofWith({ id: e.target.value }) : attempt(() => controller.setProofSetup(null)),
|
|
2693
2780
|
children: [
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */
|
|
2781
|
+
/* @__PURE__ */ jsx15("option", { value: "", children: "Off" }),
|
|
2782
|
+
PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id))
|
|
2696
2783
|
]
|
|
2697
2784
|
}
|
|
2698
2785
|
),
|
|
2699
|
-
view.proof && /* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2786
|
+
view.proof && /* @__PURE__ */ jsxs13(Fragment2, { children: [
|
|
2787
|
+
/* @__PURE__ */ jsx15("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id)) }),
|
|
2788
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
|
|
2789
|
+
/* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-primary" }),
|
|
2703
2790
|
"Paper"
|
|
2704
2791
|
] }),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
|
|
2793
|
+
/* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-primary" }),
|
|
2707
2794
|
"Gamut warning"
|
|
2708
2795
|
] })
|
|
2709
2796
|
] })
|
|
2710
2797
|
] }),
|
|
2711
|
-
error && /* @__PURE__ */
|
|
2798
|
+
error && /* @__PURE__ */ jsx15("p", { role: "alert", className: "text-destructive", children: error })
|
|
2712
2799
|
] });
|
|
2713
2800
|
};
|
|
2714
2801
|
|
|
2715
2802
|
// src/image-editor/SelectionOptionsBar.tsx
|
|
2716
|
-
import { useRef as
|
|
2803
|
+
import { useRef as useRef10, useState as useState14 } from "react";
|
|
2717
2804
|
import {
|
|
2718
2805
|
COLOR_RANGE_PRESETS,
|
|
2719
2806
|
COLOR_RANGE_PRESET_LABELS,
|
|
@@ -2724,20 +2811,20 @@ import {
|
|
|
2724
2811
|
} from "@pixerate/editor/image-editor";
|
|
2725
2812
|
|
|
2726
2813
|
// src/image-editor/SelectAndMaskWorkspace.tsx
|
|
2727
|
-
import { useEffect as useEffect10, useMemo as useMemo4, useRef as
|
|
2814
|
+
import { useEffect as useEffect10, useMemo as useMemo4, useRef as useRef8, useState as useState12 } from "react";
|
|
2728
2815
|
import { REFINE_EDGE_CONTROLS, REFINE_OUTPUTS, SELECT_AND_MASK_TOOLS, SELECT_AND_MASK_VIEWS, SelectAndMaskSession } from "@pixerate/editor/image-editor";
|
|
2729
|
-
import { jsx as
|
|
2816
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2730
2817
|
var button = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
|
|
2731
2818
|
var toggle = (on) => `${button} ${on ? "bg-primary text-primary-foreground border-primary" : ""}`;
|
|
2732
2819
|
var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
2733
2820
|
const session = useMemo4(() => new SelectAndMaskSession(controller), [controller]);
|
|
2734
|
-
const [, setRevision] =
|
|
2735
|
-
const [zoom, setZoom] =
|
|
2736
|
-
const [pan, setPan] =
|
|
2737
|
-
const [busy, setBusy] =
|
|
2738
|
-
const [error, setError] =
|
|
2739
|
-
const canvasRef =
|
|
2740
|
-
const panFrom =
|
|
2821
|
+
const [, setRevision] = useState12(0);
|
|
2822
|
+
const [zoom, setZoom] = useState12(1);
|
|
2823
|
+
const [pan, setPan] = useState12({ x: 0, y: 0 });
|
|
2824
|
+
const [busy, setBusy] = useState12(false);
|
|
2825
|
+
const [error, setError] = useState12(null);
|
|
2826
|
+
const canvasRef = useRef8(null);
|
|
2827
|
+
const panFrom = useRef8(null);
|
|
2741
2828
|
const settings = session.settings;
|
|
2742
2829
|
const size = session.previewSize;
|
|
2743
2830
|
useEffect10(() => {
|
|
@@ -2811,7 +2898,7 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2811
2898
|
};
|
|
2812
2899
|
const toLayer = settings.output !== "selection" && settings.output !== "layer-mask";
|
|
2813
2900
|
const brushTool = settings.tool === "quick-select" || settings.tool === "brush" || settings.tool === "refine-brush";
|
|
2814
|
-
return /* @__PURE__ */
|
|
2901
|
+
return /* @__PURE__ */ jsxs14(
|
|
2815
2902
|
"div",
|
|
2816
2903
|
{
|
|
2817
2904
|
"data-testid": "select-and-mask-workspace",
|
|
@@ -2819,12 +2906,12 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2819
2906
|
"aria-label": "Select and Mask",
|
|
2820
2907
|
className: `fixed inset-0 z-50 flex bg-background text-xs text-foreground ${className}`,
|
|
2821
2908
|
children: [
|
|
2822
|
-
/* @__PURE__ */
|
|
2823
|
-
/* @__PURE__ */
|
|
2824
|
-
/* @__PURE__ */
|
|
2825
|
-
brushTool && /* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ jsx16("div", { role: "group", "aria-label": "Select and Mask tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: SELECT_AND_MASK_TOOLS.map((t) => /* @__PURE__ */ jsx16("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
|
|
2910
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
2911
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
|
|
2912
|
+
brushTool && /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
2826
2913
|
"Size",
|
|
2827
|
-
/* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ jsx16(
|
|
2828
2915
|
"input",
|
|
2829
2916
|
{
|
|
2830
2917
|
type: "number",
|
|
@@ -2837,22 +2924,22 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2837
2924
|
),
|
|
2838
2925
|
"px"
|
|
2839
2926
|
] }),
|
|
2840
|
-
settings.tool !== "refine-brush" && settings.tool !== "hand" && settings.tool !== "zoom" && /* @__PURE__ */
|
|
2841
|
-
/* @__PURE__ */
|
|
2842
|
-
/* @__PURE__ */
|
|
2927
|
+
settings.tool !== "refine-brush" && settings.tool !== "hand" && settings.tool !== "zoom" && /* @__PURE__ */ jsxs14("div", { role: "group", "aria-label": "Stroke mode", className: "flex gap-1", children: [
|
|
2928
|
+
/* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
|
|
2929
|
+
/* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
|
|
2843
2930
|
] }),
|
|
2844
|
-
/* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground", children: [
|
|
2845
2932
|
session.edits.length,
|
|
2846
2933
|
" strokes"
|
|
2847
2934
|
] }),
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2935
|
+
/* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !session.edits.length, onClick: () => session.undoEdit(), children: "Undo Stroke" }),
|
|
2936
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono text-muted-foreground", children: [
|
|
2850
2937
|
Math.round(zoom * 100),
|
|
2851
2938
|
"%"
|
|
2852
2939
|
] }),
|
|
2853
|
-
session.computing && /* @__PURE__ */
|
|
2940
|
+
session.computing && /* @__PURE__ */ jsx16("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
|
|
2854
2941
|
] }),
|
|
2855
|
-
/* @__PURE__ */
|
|
2942
|
+
/* @__PURE__ */ jsx16("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx16(
|
|
2856
2943
|
"canvas",
|
|
2857
2944
|
{
|
|
2858
2945
|
ref: canvasRef,
|
|
@@ -2871,11 +2958,11 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2871
2958
|
}
|
|
2872
2959
|
) })
|
|
2873
2960
|
] }),
|
|
2874
|
-
/* @__PURE__ */
|
|
2875
|
-
/* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
2961
|
+
/* @__PURE__ */ jsxs14("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
|
|
2962
|
+
/* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "View Mode" }),
|
|
2963
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2877
2964
|
"View",
|
|
2878
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ jsx16(
|
|
2879
2966
|
ImageSelect,
|
|
2880
2967
|
{
|
|
2881
2968
|
label: "View",
|
|
@@ -2885,36 +2972,36 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2885
2972
|
}
|
|
2886
2973
|
)
|
|
2887
2974
|
] }),
|
|
2888
|
-
/* @__PURE__ */
|
|
2889
|
-
/* @__PURE__ */
|
|
2890
|
-
/* @__PURE__ */
|
|
2891
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
|
|
2976
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
2977
|
+
/* @__PURE__ */ jsx16("span", { children: "Opacity" }),
|
|
2978
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
|
|
2892
2979
|
Math.round(settings.opacity * 100),
|
|
2893
2980
|
"%"
|
|
2894
2981
|
] })
|
|
2895
2982
|
] }),
|
|
2896
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ jsx16(ImageRange, { label: "View opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
|
|
2897
2984
|
] }),
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2986
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "Show Edge", checked: settings.showEdge, onChange: (on) => set({ showEdge: on }) }),
|
|
2900
2987
|
"Show Edge (J)"
|
|
2901
2988
|
] }),
|
|
2902
|
-
/* @__PURE__ */
|
|
2903
|
-
/* @__PURE__ */
|
|
2989
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2990
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "Show Original", checked: settings.showOriginal, onChange: (on) => set({ showOriginal: on }) }),
|
|
2904
2991
|
"Show Original (P)"
|
|
2905
2992
|
] }),
|
|
2906
|
-
/* @__PURE__ */
|
|
2907
|
-
/* @__PURE__ */
|
|
2993
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2994
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "Real-Time Refinement", checked: settings.realTime, onChange: (on) => set({ realTime: on }) }),
|
|
2908
2995
|
"Real-Time Refinement"
|
|
2909
2996
|
] }),
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2997
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2998
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "High Quality Preview", checked: settings.highQuality, onChange: (on) => set({ highQuality: on }) }),
|
|
2912
2999
|
"High Quality Preview"
|
|
2913
3000
|
] }),
|
|
2914
|
-
/* @__PURE__ */
|
|
2915
|
-
controller.segmentationProvider && /* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Edge Detection and Refinement" }),
|
|
3002
|
+
controller.segmentationProvider && /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2916
3003
|
"Mode",
|
|
2917
|
-
/* @__PURE__ */
|
|
3004
|
+
/* @__PURE__ */ jsx16(
|
|
2918
3005
|
ImageSelect,
|
|
2919
3006
|
{
|
|
2920
3007
|
label: "Refine mode",
|
|
@@ -2927,37 +3014,37 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2927
3014
|
}
|
|
2928
3015
|
)
|
|
2929
3016
|
] }),
|
|
2930
|
-
REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
2932
|
-
/* @__PURE__ */
|
|
2933
|
-
/* @__PURE__ */
|
|
3017
|
+
REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
|
|
3018
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3019
|
+
/* @__PURE__ */ jsx16("span", { children: c.label }),
|
|
3020
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
|
|
2934
3021
|
settings.params[c.id],
|
|
2935
3022
|
c.unit
|
|
2936
3023
|
] })
|
|
2937
3024
|
] }),
|
|
2938
|
-
/* @__PURE__ */
|
|
3025
|
+
/* @__PURE__ */ jsx16(ImageRange, { label: `Workspace ${c.label}`, min: c.min, max: c.max, step: c.step, value: settings.params[c.id], onChange: (v) => set({ params: { ...settings.params, [c.id]: v } }) })
|
|
2939
3026
|
] }, c.id)),
|
|
2940
|
-
/* @__PURE__ */
|
|
2941
|
-
/* @__PURE__ */
|
|
3027
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
3028
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "Workspace Smart Radius", checked: settings.params.smartRadius, onChange: (on) => set({ params: { ...settings.params, smartRadius: on } }) }),
|
|
2942
3029
|
"Smart Radius"
|
|
2943
3030
|
] }),
|
|
2944
|
-
/* @__PURE__ */
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Output Settings" }),
|
|
3032
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
|
|
3033
|
+
/* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3034
|
+
/* @__PURE__ */ jsxs14("span", { children: [
|
|
2948
3035
|
"Decontaminate Colors",
|
|
2949
3036
|
toLayer ? "" : " (new layer or document outputs)"
|
|
2950
3037
|
] }),
|
|
2951
|
-
/* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
|
|
2952
3039
|
settings.decontaminate,
|
|
2953
3040
|
"%"
|
|
2954
3041
|
] })
|
|
2955
3042
|
] }),
|
|
2956
|
-
/* @__PURE__ */
|
|
3043
|
+
/* @__PURE__ */ jsx16(ImageRange, { label: "Workspace decontaminate amount", min: 0, max: 100, step: 1, value: settings.decontaminate, disabled: !toLayer, onChange: (v) => set({ decontaminate: v }) })
|
|
2957
3044
|
] }),
|
|
2958
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
2959
3046
|
"Output To",
|
|
2960
|
-
/* @__PURE__ */
|
|
3047
|
+
/* @__PURE__ */ jsx16(
|
|
2961
3048
|
ImageSelect,
|
|
2962
3049
|
{
|
|
2963
3050
|
label: "Output to",
|
|
@@ -2967,16 +3054,16 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2967
3054
|
}
|
|
2968
3055
|
)
|
|
2969
3056
|
] }),
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
3057
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx16(ImageCheckbox, { label: "Remember Settings", checked: settings.remember, onChange: (on) => set({ remember: on }) }),
|
|
2972
3059
|
"Remember Settings"
|
|
2973
3060
|
] }),
|
|
2974
|
-
(error ?? session.error) && /* @__PURE__ */
|
|
2975
|
-
session.note && /* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
2979
|
-
/* @__PURE__ */
|
|
3061
|
+
(error ?? session.error) && /* @__PURE__ */ jsx16("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
|
|
3062
|
+
session.note && /* @__PURE__ */ jsx16("p", { className: "text-muted-foreground", children: session.note }),
|
|
3063
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex gap-1 mt-auto", children: [
|
|
3064
|
+
/* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => session.reset(), children: "Reset" }),
|
|
3065
|
+
/* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => onClose(null), children: "Cancel" }),
|
|
3066
|
+
/* @__PURE__ */ jsx16("button", { type: "button", className: toggle(true), disabled: busy, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
|
|
2980
3067
|
] })
|
|
2981
3068
|
] })
|
|
2982
3069
|
]
|
|
@@ -2985,21 +3072,21 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2985
3072
|
};
|
|
2986
3073
|
|
|
2987
3074
|
// src/image-editor/ContentAwareFillWorkspace.tsx
|
|
2988
|
-
import { useEffect as useEffect11, useMemo as useMemo5, useRef as
|
|
3075
|
+
import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef9, useState as useState13 } from "react";
|
|
2989
3076
|
import { CONTENT_AWARE_FILL_SAMPLING, CONTENT_AWARE_FILL_TOOLS, ContentAwareFillSession } from "@pixerate/editor/image-editor";
|
|
2990
|
-
import { Fragment as Fragment3, jsx as
|
|
3077
|
+
import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2991
3078
|
var button2 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
|
|
2992
3079
|
var toggle2 = (on) => `${button2} ${on ? "bg-primary text-primary-foreground border-primary" : ""}`;
|
|
2993
3080
|
var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
2994
3081
|
const session = useMemo5(() => new ContentAwareFillSession(controller), [controller]);
|
|
2995
|
-
const [, setRevision] =
|
|
2996
|
-
const [zoom, setZoom] =
|
|
2997
|
-
const [pan, setPan] =
|
|
2998
|
-
const [busy, setBusy] =
|
|
2999
|
-
const [error, setError] =
|
|
3000
|
-
const sourceRef =
|
|
3001
|
-
const previewRef =
|
|
3002
|
-
const panFrom =
|
|
3082
|
+
const [, setRevision] = useState13(0);
|
|
3083
|
+
const [zoom, setZoom] = useState13(1);
|
|
3084
|
+
const [pan, setPan] = useState13({ x: 0, y: 0 });
|
|
3085
|
+
const [busy, setBusy] = useState13(false);
|
|
3086
|
+
const [error, setError] = useState13(null);
|
|
3087
|
+
const sourceRef = useRef9(null);
|
|
3088
|
+
const previewRef = useRef9(null);
|
|
3089
|
+
const panFrom = useRef9(null);
|
|
3003
3090
|
const settings = session.settings;
|
|
3004
3091
|
const win = session.window;
|
|
3005
3092
|
useEffect11(() => {
|
|
@@ -3075,14 +3162,14 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
3075
3162
|
session.end();
|
|
3076
3163
|
};
|
|
3077
3164
|
const view = { maxWidth: "100%", maxHeight: "100%", transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`, imageRendering: zoom > 2 ? "pixelated" : void 0 };
|
|
3078
|
-
return /* @__PURE__ */
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
/* @__PURE__ */
|
|
3082
|
-
settings.tool === "sampling-brush" && /* @__PURE__ */
|
|
3083
|
-
/* @__PURE__ */
|
|
3165
|
+
return /* @__PURE__ */ jsxs15("div", { "data-testid": "content-aware-fill-workspace", role: "dialog", "aria-label": "Content-Aware Fill", className: `fixed inset-0 z-50 flex bg-background text-xs text-foreground ${className}`, children: [
|
|
3166
|
+
/* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Content-Aware Fill tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: CONTENT_AWARE_FILL_TOOLS.map((t) => /* @__PURE__ */ jsx17("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle2(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
|
|
3167
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
3168
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
|
|
3169
|
+
settings.tool === "sampling-brush" && /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
3170
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3084
3171
|
"Size",
|
|
3085
|
-
/* @__PURE__ */
|
|
3172
|
+
/* @__PURE__ */ jsx17(
|
|
3086
3173
|
"input",
|
|
3087
3174
|
{
|
|
3088
3175
|
type: "number",
|
|
@@ -3095,22 +3182,22 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
3095
3182
|
),
|
|
3096
3183
|
"px"
|
|
3097
3184
|
] }),
|
|
3098
|
-
/* @__PURE__ */
|
|
3099
|
-
/* @__PURE__ */
|
|
3100
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsxs15("div", { role: "group", "aria-label": "Sampling brush mode", className: "flex gap-1", children: [
|
|
3186
|
+
/* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle2(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
|
|
3187
|
+
/* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle2(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
|
|
3101
3188
|
] })
|
|
3102
3189
|
] }),
|
|
3103
|
-
/* @__PURE__ */
|
|
3190
|
+
/* @__PURE__ */ jsxs15("span", { className: "font-mono text-muted-foreground", children: [
|
|
3104
3191
|
Math.round(zoom * 100),
|
|
3105
3192
|
"%"
|
|
3106
3193
|
] }),
|
|
3107
|
-
!session.showsWholeImage && /* @__PURE__ */
|
|
3108
|
-
session.computing && /* @__PURE__ */
|
|
3194
|
+
!session.showsWholeImage && /* @__PURE__ */ jsx17("button", { type: "button", className: button2, title: "Show (and sample from) more of the image around the selection", onClick: () => session.expandView(), children: "Expand View" }),
|
|
3195
|
+
session.computing && /* @__PURE__ */ jsx17("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
|
|
3109
3196
|
] }),
|
|
3110
|
-
/* @__PURE__ */
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
/* @__PURE__ */
|
|
3113
|
-
/* @__PURE__ */
|
|
3197
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex-1 grid grid-cols-2 gap-2 p-2 min-h-0", children: [
|
|
3198
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col min-h-0", children: [
|
|
3199
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Source (green: sampling area)" }),
|
|
3200
|
+
/* @__PURE__ */ jsx17("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx17(
|
|
3114
3201
|
"canvas",
|
|
3115
3202
|
{
|
|
3116
3203
|
ref: sourceRef,
|
|
@@ -3122,33 +3209,33 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
3122
3209
|
}
|
|
3123
3210
|
) })
|
|
3124
3211
|
] }),
|
|
3125
|
-
/* @__PURE__ */
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
/* @__PURE__ */
|
|
3212
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-col min-h-0", children: [
|
|
3213
|
+
/* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Preview" }),
|
|
3214
|
+
/* @__PURE__ */ jsx17("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx17("canvas", { ref: previewRef, "data-testid": "content-aware-fill-preview", style: view }) })
|
|
3128
3215
|
] })
|
|
3129
3216
|
] })
|
|
3130
3217
|
] }),
|
|
3131
|
-
/* @__PURE__ */
|
|
3132
|
-
/* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3218
|
+
/* @__PURE__ */ jsxs15("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
|
|
3219
|
+
/* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Sampling Area Options" }),
|
|
3220
|
+
/* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Sampling area", className: "flex gap-1", children: CONTENT_AWARE_FILL_SAMPLING.map((m) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.sampling === m.id, className: toggle2(settings.sampling === m.id), onClick: () => set({ sampling: m.id }), children: m.label }, m.id)) }),
|
|
3221
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
|
|
3222
|
+
/* @__PURE__ */ jsx17(ImageCheckbox, { label: "Show Sampling Area", checked: settings.showSampling, onChange: (on) => set({ showSampling: on }) }),
|
|
3136
3223
|
"Show Sampling Area"
|
|
3137
3224
|
] }),
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3140
|
-
/* @__PURE__ */
|
|
3141
|
-
/* @__PURE__ */
|
|
3225
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
|
|
3226
|
+
/* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3227
|
+
/* @__PURE__ */ jsx17("span", { children: "Opacity" }),
|
|
3228
|
+
/* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
|
|
3142
3229
|
Math.round(settings.opacity * 100),
|
|
3143
3230
|
"%"
|
|
3144
3231
|
] })
|
|
3145
3232
|
] }),
|
|
3146
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx17(ImageRange, { label: "Sampling overlay opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
|
|
3147
3234
|
] }),
|
|
3148
|
-
/* @__PURE__ */
|
|
3149
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Fill Settings" }),
|
|
3236
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
|
|
3150
3237
|
"Seed",
|
|
3151
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx17(
|
|
3152
3239
|
"input",
|
|
3153
3240
|
{
|
|
3154
3241
|
type: "number",
|
|
@@ -3159,17 +3246,17 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
3159
3246
|
className: "w-16 bg-background border border-border rounded px-1 py-0.5 text-foreground"
|
|
3160
3247
|
}
|
|
3161
3248
|
),
|
|
3162
|
-
/* @__PURE__ */
|
|
3249
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => set({ seed: settings.seed + 1 }), children: "Try Another" })
|
|
3163
3250
|
] }),
|
|
3164
|
-
/* @__PURE__ */
|
|
3165
|
-
/* @__PURE__ */
|
|
3251
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
|
|
3252
|
+
/* @__PURE__ */ jsx17(ImageCheckbox, { label: "Live Preview", checked: settings.livePreview, onChange: (on) => set({ livePreview: on }) }),
|
|
3166
3253
|
"Live Preview"
|
|
3167
3254
|
] }),
|
|
3168
|
-
!settings.livePreview && /* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
/* @__PURE__ */
|
|
3255
|
+
!settings.livePreview && /* @__PURE__ */ jsx17("button", { type: "button", className: button2, disabled: session.computing, onClick: () => void session.refresh(), children: "Preview" }),
|
|
3256
|
+
/* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Output Settings" }),
|
|
3257
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
|
|
3171
3258
|
"Output To",
|
|
3172
|
-
/* @__PURE__ */
|
|
3259
|
+
/* @__PURE__ */ jsx17(
|
|
3173
3260
|
ImageSelect,
|
|
3174
3261
|
{
|
|
3175
3262
|
label: "Fill output",
|
|
@@ -3183,18 +3270,18 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
3183
3270
|
}
|
|
3184
3271
|
)
|
|
3185
3272
|
] }),
|
|
3186
|
-
(error ?? session.error) && /* @__PURE__ */
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3273
|
+
(error ?? session.error) && /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
|
|
3274
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex gap-1 mt-auto", children: [
|
|
3275
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => session.reset(), children: "Reset" }),
|
|
3276
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => onClose(null), children: "Cancel" }),
|
|
3277
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: toggle2(true), disabled: busy || !win, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
|
|
3191
3278
|
] })
|
|
3192
3279
|
] })
|
|
3193
3280
|
] });
|
|
3194
3281
|
};
|
|
3195
3282
|
|
|
3196
3283
|
// src/image-editor/SelectionOptionsBar.tsx
|
|
3197
|
-
import { jsx as
|
|
3284
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3198
3285
|
var MODIFY_OPS = [
|
|
3199
3286
|
{ op: "expand", label: "Expand" },
|
|
3200
3287
|
{ op: "contract", label: "Contract" },
|
|
@@ -3218,15 +3305,15 @@ var SelectionOptionsBar = ({
|
|
|
3218
3305
|
selectionDisplay,
|
|
3219
3306
|
className = ""
|
|
3220
3307
|
}) => {
|
|
3221
|
-
const [radius, setRadius] =
|
|
3308
|
+
const [radius, setRadius] = useState14(2);
|
|
3222
3309
|
const set = (patch) => onOptionsChange({ ...options, ...patch });
|
|
3223
3310
|
const sel = selection === void 0 ? controller.getSelection() : selection;
|
|
3224
3311
|
const display = selectionDisplay ?? (quickMask === void 0 ? controller.getSelectionDisplay() : quickMask ? "quickMask" : "ants");
|
|
3225
|
-
const [preset, setPreset] =
|
|
3226
|
-
const [rangeStatus, setRangeStatus] =
|
|
3227
|
-
const [colorStatus, setColorStatus] =
|
|
3228
|
-
const [strokeWidth, setStrokeWidth] =
|
|
3229
|
-
const [strokeLocation, setStrokeLocation] =
|
|
3312
|
+
const [preset, setPreset] = useState14("reds");
|
|
3313
|
+
const [rangeStatus, setRangeStatus] = useState14(null);
|
|
3314
|
+
const [colorStatus, setColorStatus] = useState14(null);
|
|
3315
|
+
const [strokeWidth, setStrokeWidth] = useState14(4);
|
|
3316
|
+
const [strokeLocation, setStrokeLocation] = useState14("outside");
|
|
3230
3317
|
const edit = (fn) => {
|
|
3231
3318
|
setColorStatus(null);
|
|
3232
3319
|
try {
|
|
@@ -3259,8 +3346,8 @@ var SelectionOptionsBar = ({
|
|
|
3259
3346
|
setRangeStatus(err instanceof Error ? err.message : String(err));
|
|
3260
3347
|
}
|
|
3261
3348
|
};
|
|
3262
|
-
const [task, setTask] =
|
|
3263
|
-
const taskAbort =
|
|
3349
|
+
const [task, setTask] = useState14(null);
|
|
3350
|
+
const taskAbort = useRef10(null);
|
|
3264
3351
|
const tracked = () => {
|
|
3265
3352
|
const abort = new AbortController();
|
|
3266
3353
|
taskAbort.current = abort;
|
|
@@ -3272,9 +3359,9 @@ var SelectionOptionsBar = ({
|
|
|
3272
3359
|
setTask(null);
|
|
3273
3360
|
};
|
|
3274
3361
|
const failure = (err) => err?.name === "AbortError" ? "Cancelled." : err instanceof Error ? err.message : String(err);
|
|
3275
|
-
const [subject, setSubject] =
|
|
3276
|
-
const [segmenting, setSegmenting] =
|
|
3277
|
-
const [subjectStatus, setSubjectStatus] =
|
|
3362
|
+
const [subject, setSubject] = useState14("");
|
|
3363
|
+
const [segmenting, setSegmenting] = useState14(false);
|
|
3364
|
+
const [subjectStatus, setSubjectStatus] = useState14(null);
|
|
3278
3365
|
const selectSubject = async () => {
|
|
3279
3366
|
const target = subject.trim();
|
|
3280
3367
|
const canSegment = Boolean(controller.segmentationProvider);
|
|
@@ -3291,10 +3378,10 @@ var SelectionOptionsBar = ({
|
|
|
3291
3378
|
setSegmenting(false);
|
|
3292
3379
|
}
|
|
3293
3380
|
};
|
|
3294
|
-
const [workspace, setWorkspace] =
|
|
3295
|
-
const [fillWorkspace, setFillWorkspace] =
|
|
3296
|
-
const [skying, setSkying] =
|
|
3297
|
-
const [skyStatus, setSkyStatus] =
|
|
3381
|
+
const [workspace, setWorkspace] = useState14(false);
|
|
3382
|
+
const [fillWorkspace, setFillWorkspace] = useState14(false);
|
|
3383
|
+
const [skying, setSkying] = useState14(false);
|
|
3384
|
+
const [skyStatus, setSkyStatus] = useState14(null);
|
|
3298
3385
|
const selectSky = async () => {
|
|
3299
3386
|
if (skying) return;
|
|
3300
3387
|
setSkying(true);
|
|
@@ -3309,8 +3396,8 @@ var SelectionOptionsBar = ({
|
|
|
3309
3396
|
setSkying(false);
|
|
3310
3397
|
}
|
|
3311
3398
|
};
|
|
3312
|
-
const [focusing, setFocusing] =
|
|
3313
|
-
const [focusStatus, setFocusStatus] =
|
|
3399
|
+
const [focusing, setFocusing] = useState14(false);
|
|
3400
|
+
const [focusStatus, setFocusStatus] = useState14(null);
|
|
3314
3401
|
const selectFocusArea = async () => {
|
|
3315
3402
|
if (focusing) return;
|
|
3316
3403
|
setFocusing(true);
|
|
@@ -3331,24 +3418,24 @@ var SelectionOptionsBar = ({
|
|
|
3331
3418
|
setFocusing(false);
|
|
3332
3419
|
}
|
|
3333
3420
|
};
|
|
3334
|
-
return /* @__PURE__ */
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
options.tool === "wand" && /* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3340
|
-
/* @__PURE__ */
|
|
3341
|
-
/* @__PURE__ */
|
|
3421
|
+
return /* @__PURE__ */ jsxs16("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
|
|
3422
|
+
/* @__PURE__ */ jsx18("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
|
|
3423
|
+
/* @__PURE__ */ jsx18("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
|
|
3424
|
+
options.tool === "wand" && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
|
|
3425
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3426
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3427
|
+
/* @__PURE__ */ jsx18("span", { children: "Tolerance" }),
|
|
3428
|
+
/* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.tolerance })
|
|
3342
3429
|
] }),
|
|
3343
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Tolerance", min: 0, max: 255, step: 1, value: options.tolerance, onChange: (v) => set({ tolerance: v }) })
|
|
3344
3431
|
] }),
|
|
3345
|
-
/* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3432
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3433
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
|
|
3347
3434
|
"Contiguous"
|
|
3348
3435
|
] }),
|
|
3349
|
-
/* @__PURE__ */
|
|
3436
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3350
3437
|
"Distance",
|
|
3351
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ jsx18(
|
|
3352
3439
|
ImageSelect,
|
|
3353
3440
|
{
|
|
3354
3441
|
label: "Colour distance",
|
|
@@ -3361,13 +3448,13 @@ var SelectionOptionsBar = ({
|
|
|
3361
3448
|
}
|
|
3362
3449
|
)
|
|
3363
3450
|
] }),
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3451
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3452
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
|
|
3366
3453
|
"Sample adjusted image"
|
|
3367
3454
|
] }),
|
|
3368
|
-
/* @__PURE__ */
|
|
3455
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3369
3456
|
"Sample",
|
|
3370
|
-
/* @__PURE__ */
|
|
3457
|
+
/* @__PURE__ */ jsx18(
|
|
3371
3458
|
ImageSelect,
|
|
3372
3459
|
{
|
|
3373
3460
|
label: "Sample from",
|
|
@@ -3381,77 +3468,77 @@ var SelectionOptionsBar = ({
|
|
|
3381
3468
|
)
|
|
3382
3469
|
] })
|
|
3383
3470
|
] }),
|
|
3384
|
-
options.tool === "polygon" && /* @__PURE__ */
|
|
3385
|
-
options.tool === "magnetic" && /* @__PURE__ */
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */
|
|
3388
|
-
/* @__PURE__ */
|
|
3389
|
-
/* @__PURE__ */
|
|
3390
|
-
/* @__PURE__ */
|
|
3471
|
+
options.tool === "polygon" && /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click to add corners (Shift for 45\xB0), drag for a free-hand stretch; double-click, Enter or a click on the first corner closes it, Backspace removes a corner, Escape cancels." }),
|
|
3472
|
+
options.tool === "magnetic" && /* @__PURE__ */ jsxs16("div", { "data-testid": "magnetic-lasso-options", className: "flex flex-col gap-2", children: [
|
|
3473
|
+
/* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click on an edge, then move along it: the outline snaps to the edge and adds points as it goes. Click to add a point; double-click, Enter or a click on the start closes it, Backspace removes the last point, Escape cancels." }),
|
|
3474
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3475
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3476
|
+
/* @__PURE__ */ jsx18("span", { children: "Width" }),
|
|
3477
|
+
/* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
|
|
3391
3478
|
options.magneticWidth ?? 10,
|
|
3392
3479
|
" px"
|
|
3393
3480
|
] })
|
|
3394
3481
|
] }),
|
|
3395
|
-
/* @__PURE__ */
|
|
3482
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso width", min: 1, max: 256, step: 1, value: options.magneticWidth ?? 10, onChange: (v) => set({ magneticWidth: v }) })
|
|
3396
3483
|
] }),
|
|
3397
|
-
/* @__PURE__ */
|
|
3398
|
-
/* @__PURE__ */
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3484
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3485
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3486
|
+
/* @__PURE__ */ jsx18("span", { children: "Contrast" }),
|
|
3487
|
+
/* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
|
|
3401
3488
|
options.magneticContrast ?? 10,
|
|
3402
3489
|
"%"
|
|
3403
3490
|
] })
|
|
3404
3491
|
] }),
|
|
3405
|
-
/* @__PURE__ */
|
|
3492
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso contrast", min: 1, max: 100, step: 1, value: options.magneticContrast ?? 10, onChange: (v) => set({ magneticContrast: v }) })
|
|
3406
3493
|
] }),
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3410
|
-
/* @__PURE__ */
|
|
3494
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3495
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3496
|
+
/* @__PURE__ */ jsx18("span", { children: "Frequency" }),
|
|
3497
|
+
/* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.magneticFrequency ?? 57 })
|
|
3411
3498
|
] }),
|
|
3412
|
-
/* @__PURE__ */
|
|
3499
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso frequency", min: 0, max: 100, step: 1, value: options.magneticFrequency ?? 57, onChange: (v) => set({ magneticFrequency: v }) })
|
|
3413
3500
|
] })
|
|
3414
3501
|
] }),
|
|
3415
|
-
options.tool === "quick" && /* @__PURE__ */
|
|
3416
|
-
/* @__PURE__ */
|
|
3417
|
-
/* @__PURE__ */
|
|
3418
|
-
/* @__PURE__ */
|
|
3419
|
-
/* @__PURE__ */
|
|
3420
|
-
/* @__PURE__ */
|
|
3502
|
+
options.tool === "quick" && /* @__PURE__ */ jsxs16("div", { "data-testid": "quick-selection-options", className: "flex flex-col gap-2", children: [
|
|
3503
|
+
/* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Paint inside the area: the selection grows out to its edges. Each stroke adds (Alt-drag subtracts)." }),
|
|
3504
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3505
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3506
|
+
/* @__PURE__ */ jsx18("span", { children: "Size" }),
|
|
3507
|
+
/* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
|
|
3421
3508
|
options.quickSize ?? 30,
|
|
3422
3509
|
" px"
|
|
3423
3510
|
] })
|
|
3424
3511
|
] }),
|
|
3425
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Quick selection size", min: 1, max: 500, step: 1, value: options.quickSize ?? 30, onChange: (v) => set({ quickSize: v }) })
|
|
3426
3513
|
] }),
|
|
3427
|
-
/* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3515
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Sample all layers", checked: options.quickSampleAll ?? true, onChange: (on) => set({ quickSampleAll: on }) }),
|
|
3429
3516
|
"Sample all layers"
|
|
3430
3517
|
] }),
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3519
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Auto-enhance edges", checked: options.quickEnhance ?? false, onChange: (on) => set({ quickEnhance: on }) }),
|
|
3433
3520
|
"Auto-enhance edges"
|
|
3434
3521
|
] })
|
|
3435
3522
|
] }),
|
|
3436
|
-
options.tool === "object" && /* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3523
|
+
options.tool === "object" && /* @__PURE__ */ jsxs16("div", { "data-testid": "object-selection-options", className: "flex flex-col gap-2", children: [
|
|
3524
|
+
/* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Drag a box loosely around an object, or click on it. Shift adds, Alt subtracts." }),
|
|
3525
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3526
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Object sample all layers", checked: options.objectSampleAll ?? true, onChange: (on) => set({ objectSampleAll: on }) }),
|
|
3440
3527
|
"Sample all layers"
|
|
3441
3528
|
] }),
|
|
3442
|
-
/* @__PURE__ */
|
|
3443
|
-
/* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3530
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Object auto-enhance edges", checked: options.objectEnhance ?? false, onChange: (on) => set({ objectEnhance: on }) }),
|
|
3444
3531
|
"Auto-enhance edges"
|
|
3445
3532
|
] })
|
|
3446
3533
|
] }),
|
|
3447
|
-
(options.tool === "type" || options.tool === "type-vertical") && /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
3534
|
+
(options.tool === "type" || options.tool === "type-vertical") && /* @__PURE__ */ jsxs16("div", { "data-testid": "type-mask-options", className: "flex flex-col gap-2", children: [
|
|
3535
|
+
/* @__PURE__ */ jsxs16("p", { className: "text-muted-foreground", children: [
|
|
3449
3536
|
options.tool === "type-vertical" ? "Click where the column starts: the letters are stacked down from there, centred on the click." : "Click where the text starts (its baseline).",
|
|
3450
3537
|
" Shift-click adds, Alt-click subtracts."
|
|
3451
3538
|
] }),
|
|
3452
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3453
3540
|
"Text",
|
|
3454
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ jsx18(
|
|
3455
3542
|
"input",
|
|
3456
3543
|
{
|
|
3457
3544
|
type: "text",
|
|
@@ -3462,9 +3549,9 @@ var SelectionOptionsBar = ({
|
|
|
3462
3549
|
}
|
|
3463
3550
|
)
|
|
3464
3551
|
] }),
|
|
3465
|
-
/* @__PURE__ */
|
|
3552
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3466
3553
|
"Size",
|
|
3467
|
-
/* @__PURE__ */
|
|
3554
|
+
/* @__PURE__ */ jsx18(
|
|
3468
3555
|
"input",
|
|
3469
3556
|
{
|
|
3470
3557
|
type: "number",
|
|
@@ -3478,9 +3565,9 @@ var SelectionOptionsBar = ({
|
|
|
3478
3565
|
),
|
|
3479
3566
|
"px"
|
|
3480
3567
|
] }),
|
|
3481
|
-
/* @__PURE__ */
|
|
3568
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3482
3569
|
"Font",
|
|
3483
|
-
/* @__PURE__ */
|
|
3570
|
+
/* @__PURE__ */ jsx18(
|
|
3484
3571
|
"input",
|
|
3485
3572
|
{
|
|
3486
3573
|
type: "text",
|
|
@@ -3492,18 +3579,18 @@ var SelectionOptionsBar = ({
|
|
|
3492
3579
|
)
|
|
3493
3580
|
] })
|
|
3494
3581
|
] }),
|
|
3495
|
-
options.tool === "range" && /* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3497
|
-
/* @__PURE__ */
|
|
3498
|
-
/* @__PURE__ */
|
|
3499
|
-
/* @__PURE__ */
|
|
3500
|
-
/* @__PURE__ */
|
|
3582
|
+
options.tool === "range" && /* @__PURE__ */ jsxs16("div", { "data-testid": "color-range-options", className: "flex flex-col gap-2", children: [
|
|
3583
|
+
/* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click a colour to select it; Shift-click adds a colour, Alt-click removes one." }),
|
|
3584
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3585
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3586
|
+
/* @__PURE__ */ jsx18("span", { children: "Fuzziness" }),
|
|
3587
|
+
/* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.fuzziness ?? 40 })
|
|
3501
3588
|
] }),
|
|
3502
|
-
/* @__PURE__ */
|
|
3589
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Fuzziness", min: 0, max: 200, step: 1, value: options.fuzziness ?? 40, onChange: (v) => set({ fuzziness: v }) })
|
|
3503
3590
|
] }),
|
|
3504
|
-
/* @__PURE__ */
|
|
3591
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3505
3592
|
"Localized radius",
|
|
3506
|
-
/* @__PURE__ */
|
|
3593
|
+
/* @__PURE__ */ jsx18(
|
|
3507
3594
|
"input",
|
|
3508
3595
|
{
|
|
3509
3596
|
type: "number",
|
|
@@ -3517,12 +3604,12 @@ var SelectionOptionsBar = ({
|
|
|
3517
3604
|
),
|
|
3518
3605
|
"px"
|
|
3519
3606
|
] }),
|
|
3520
|
-
/* @__PURE__ */
|
|
3521
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3608
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Invert", checked: options.rangeInvert ?? false, onChange: (on) => set({ rangeInvert: on }) }),
|
|
3522
3609
|
"Invert"
|
|
3523
3610
|
] }),
|
|
3524
|
-
/* @__PURE__ */
|
|
3525
|
-
/* @__PURE__ */
|
|
3611
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
|
|
3612
|
+
/* @__PURE__ */ jsx18(
|
|
3526
3613
|
ImageSelect,
|
|
3527
3614
|
{
|
|
3528
3615
|
label: "Color Range preset",
|
|
@@ -3531,13 +3618,13 @@ var SelectionOptionsBar = ({
|
|
|
3531
3618
|
onChange: (v) => setPreset(v)
|
|
3532
3619
|
}
|
|
3533
3620
|
),
|
|
3534
|
-
/* @__PURE__ */
|
|
3621
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => void applyPreset(), children: "Select" })
|
|
3535
3622
|
] }),
|
|
3536
|
-
rangeStatus && /* @__PURE__ */
|
|
3623
|
+
rangeStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: rangeStatus })
|
|
3537
3624
|
] }),
|
|
3538
|
-
/* @__PURE__ */
|
|
3625
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3539
3626
|
"Feather",
|
|
3540
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx18(
|
|
3541
3628
|
"input",
|
|
3542
3629
|
{
|
|
3543
3630
|
type: "number",
|
|
@@ -3552,7 +3639,7 @@ var SelectionOptionsBar = ({
|
|
|
3552
3639
|
),
|
|
3553
3640
|
"px"
|
|
3554
3641
|
] }),
|
|
3555
|
-
/* @__PURE__ */
|
|
3642
|
+
/* @__PURE__ */ jsxs16(
|
|
3556
3643
|
"form",
|
|
3557
3644
|
{
|
|
3558
3645
|
"data-testid": "select-subject",
|
|
@@ -3562,8 +3649,8 @@ var SelectionOptionsBar = ({
|
|
|
3562
3649
|
void selectSubject();
|
|
3563
3650
|
},
|
|
3564
3651
|
children: [
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
controller.segmentationProvider && /* @__PURE__ */
|
|
3652
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex gap-1", children: [
|
|
3653
|
+
controller.segmentationProvider && /* @__PURE__ */ jsx18(
|
|
3567
3654
|
"input",
|
|
3568
3655
|
{
|
|
3569
3656
|
type: "text",
|
|
@@ -3575,7 +3662,7 @@ var SelectionOptionsBar = ({
|
|
|
3575
3662
|
className: "min-w-0 flex-1 bg-background border border-border rounded px-2 py-1 text-foreground"
|
|
3576
3663
|
}
|
|
3577
3664
|
),
|
|
3578
|
-
/* @__PURE__ */
|
|
3665
|
+
/* @__PURE__ */ jsx18(
|
|
3579
3666
|
"button",
|
|
3580
3667
|
{
|
|
3581
3668
|
type: "submit",
|
|
@@ -3587,12 +3674,12 @@ var SelectionOptionsBar = ({
|
|
|
3587
3674
|
}
|
|
3588
3675
|
)
|
|
3589
3676
|
] }),
|
|
3590
|
-
subjectStatus && /* @__PURE__ */
|
|
3677
|
+
subjectStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
|
|
3591
3678
|
]
|
|
3592
3679
|
}
|
|
3593
3680
|
),
|
|
3594
|
-
task && /* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3681
|
+
task && /* @__PURE__ */ jsxs16("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
|
|
3682
|
+
/* @__PURE__ */ jsx18(
|
|
3596
3683
|
"div",
|
|
3597
3684
|
{
|
|
3598
3685
|
role: "progressbar",
|
|
@@ -3601,69 +3688,69 @@ var SelectionOptionsBar = ({
|
|
|
3601
3688
|
"aria-valuemax": 100,
|
|
3602
3689
|
"aria-valuenow": Math.round(task.fraction * 100),
|
|
3603
3690
|
className: "flex-1 h-1.5 rounded bg-muted overflow-hidden",
|
|
3604
|
-
children: /* @__PURE__ */
|
|
3691
|
+
children: /* @__PURE__ */ jsx18("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
|
|
3605
3692
|
}
|
|
3606
3693
|
),
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
/* @__PURE__ */
|
|
3694
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: task.stage }),
|
|
3695
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
|
|
3609
3696
|
] }),
|
|
3610
|
-
/* @__PURE__ */
|
|
3611
|
-
workspace && /* @__PURE__ */
|
|
3612
|
-
/* @__PURE__ */
|
|
3613
|
-
/* @__PURE__ */
|
|
3614
|
-
skyStatus && /* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
|
|
3698
|
+
workspace && /* @__PURE__ */ jsx18(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
|
|
3699
|
+
/* @__PURE__ */ jsxs16("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
|
|
3700
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: skying, "aria-busy": skying, onClick: () => void selectSky(), children: skying ? "Selecting\u2026" : "Select Sky" }),
|
|
3701
|
+
skyStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: skyStatus })
|
|
3615
3702
|
] }),
|
|
3616
|
-
/* @__PURE__ */
|
|
3617
|
-
/* @__PURE__ */
|
|
3618
|
-
/* @__PURE__ */
|
|
3619
|
-
/* @__PURE__ */
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3703
|
+
/* @__PURE__ */ jsxs16("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
|
|
3704
|
+
/* @__PURE__ */ jsx18("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
|
|
3705
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 pt-2", children: [
|
|
3706
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3707
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3708
|
+
/* @__PURE__ */ jsx18("span", { children: "In-focus range" }),
|
|
3709
|
+
/* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.focusRange ?? 50 })
|
|
3623
3710
|
] }),
|
|
3624
|
-
/* @__PURE__ */
|
|
3711
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
|
|
3625
3712
|
] }),
|
|
3626
|
-
/* @__PURE__ */
|
|
3627
|
-
/* @__PURE__ */
|
|
3628
|
-
/* @__PURE__ */
|
|
3629
|
-
/* @__PURE__ */
|
|
3713
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3714
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3715
|
+
/* @__PURE__ */ jsx18("span", { children: "Image noise level" }),
|
|
3716
|
+
/* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.focusNoise ?? 0 })
|
|
3630
3717
|
] }),
|
|
3631
|
-
/* @__PURE__ */
|
|
3718
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
|
|
3632
3719
|
] }),
|
|
3633
|
-
/* @__PURE__ */
|
|
3634
|
-
/* @__PURE__ */
|
|
3635
|
-
/* @__PURE__ */
|
|
3636
|
-
/* @__PURE__ */
|
|
3720
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
|
|
3721
|
+
/* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3722
|
+
/* @__PURE__ */ jsx18("span", { children: "Soften edge" }),
|
|
3723
|
+
/* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
|
|
3637
3724
|
options.focusSoftness ?? 4,
|
|
3638
3725
|
" px"
|
|
3639
3726
|
] })
|
|
3640
3727
|
] }),
|
|
3641
|
-
/* @__PURE__ */
|
|
3728
|
+
/* @__PURE__ */ jsx18(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
|
|
3642
3729
|
] }),
|
|
3643
|
-
/* @__PURE__ */
|
|
3644
|
-
focusStatus && /* @__PURE__ */
|
|
3730
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
|
|
3731
|
+
focusStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
|
|
3645
3732
|
] })
|
|
3646
3733
|
] }),
|
|
3647
|
-
/* @__PURE__ */
|
|
3648
|
-
/* @__PURE__ */
|
|
3734
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3735
|
+
/* @__PURE__ */ jsx18(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
|
|
3649
3736
|
"Anti-alias"
|
|
3650
3737
|
] }),
|
|
3651
|
-
/* @__PURE__ */
|
|
3652
|
-
/* @__PURE__ */
|
|
3653
|
-
/* @__PURE__ */
|
|
3654
|
-
/* @__PURE__ */
|
|
3655
|
-
/* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3657
|
-
/* @__PURE__ */
|
|
3738
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1", children: [
|
|
3739
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
|
|
3740
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
|
|
3741
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
|
|
3742
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !controller.canReselect(), onClick: () => controller.reselect(), children: "Reselect" }),
|
|
3743
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, title: "Add connected pixels of a selected colour (wand tolerance)", onClick: () => void runColor("grow"), children: "Grow" }),
|
|
3744
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, title: "Add every pixel of a selected colour (wand tolerance)", onClick: () => void runColor("similar"), children: "Similar" })
|
|
3658
3745
|
] }),
|
|
3659
|
-
/* @__PURE__ */
|
|
3660
|
-
/* @__PURE__ */
|
|
3661
|
-
DISPLAYS.map((d) => /* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Show selection", className: "flex flex-wrap items-center gap-1", children: [
|
|
3747
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Show" }),
|
|
3748
|
+
DISPLAYS.map((d) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": display === d.id, className: btn(display === d.id), onClick: () => controller.setSelectionDisplay(d.id), children: d.label }, d.id))
|
|
3662
3749
|
] }),
|
|
3663
|
-
/* @__PURE__ */
|
|
3664
|
-
/* @__PURE__ */
|
|
3750
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
3751
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3665
3752
|
"Radius",
|
|
3666
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ jsx18(
|
|
3667
3754
|
"input",
|
|
3668
3755
|
{
|
|
3669
3756
|
type: "number",
|
|
@@ -3677,12 +3764,12 @@ var SelectionOptionsBar = ({
|
|
|
3677
3764
|
}
|
|
3678
3765
|
)
|
|
3679
3766
|
] }),
|
|
3680
|
-
MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */
|
|
3767
|
+
MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
|
|
3681
3768
|
] }),
|
|
3682
|
-
/* @__PURE__ */
|
|
3683
|
-
/* @__PURE__ */
|
|
3769
|
+
/* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Edit selection", className: "flex flex-wrap items-center gap-1", children: [
|
|
3770
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
3684
3771
|
"Stroke",
|
|
3685
|
-
/* @__PURE__ */
|
|
3772
|
+
/* @__PURE__ */ jsx18(
|
|
3686
3773
|
"input",
|
|
3687
3774
|
{
|
|
3688
3775
|
type: "number",
|
|
@@ -3697,7 +3784,7 @@ var SelectionOptionsBar = ({
|
|
|
3697
3784
|
),
|
|
3698
3785
|
"px"
|
|
3699
3786
|
] }),
|
|
3700
|
-
/* @__PURE__ */
|
|
3787
|
+
/* @__PURE__ */ jsx18(
|
|
3701
3788
|
ImageSelect,
|
|
3702
3789
|
{
|
|
3703
3790
|
label: "Stroke location",
|
|
@@ -3710,28 +3797,28 @@ var SelectionOptionsBar = ({
|
|
|
3710
3797
|
onChange: (v) => setStrokeLocation(v)
|
|
3711
3798
|
}
|
|
3712
3799
|
),
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
/* @__PURE__ */
|
|
3715
|
-
/* @__PURE__ */
|
|
3716
|
-
/* @__PURE__ */
|
|
3717
|
-
fillWorkspace && /* @__PURE__ */
|
|
3800
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.strokeSelection({ width: strokeWidth, location: strokeLocation })), children: "Stroke" }),
|
|
3801
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cropToSelection()), children: "Crop to Selection" }),
|
|
3802
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.contentAwareFill({ output: "new-layer" })), children: "Content-Aware Fill" }),
|
|
3803
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => setFillWorkspace(true), children: "Content-Aware Fill\u2026" }),
|
|
3804
|
+
fillWorkspace && /* @__PURE__ */ jsx18(ContentAwareFillWorkspace, { controller, onClose: () => setFillWorkspace(false) })
|
|
3718
3805
|
] }),
|
|
3719
|
-
/* @__PURE__ */
|
|
3720
|
-
/* @__PURE__ */
|
|
3721
|
-
/* @__PURE__ */
|
|
3722
|
-
/* @__PURE__ */
|
|
3723
|
-
/* @__PURE__ */
|
|
3724
|
-
/* @__PURE__ */
|
|
3725
|
-
/* @__PURE__ */
|
|
3726
|
-
/* @__PURE__ */
|
|
3806
|
+
/* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Clipboard", className: "flex flex-wrap gap-1", children: [
|
|
3807
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels()), children: "Copy" }),
|
|
3808
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels({ merged: true })), children: "Copy Merged" }),
|
|
3809
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cutPixels()), children: "Cut" }),
|
|
3810
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("new-layer")), children: "Paste" }),
|
|
3811
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("in-place")), children: "Paste in Place" }),
|
|
3812
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("into")), children: "Paste Into" }),
|
|
3813
|
+
/* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("outside")), children: "Paste Outside" })
|
|
3727
3814
|
] }),
|
|
3728
|
-
colorStatus && /* @__PURE__ */
|
|
3729
|
-
/* @__PURE__ */
|
|
3815
|
+
colorStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: colorStatus }),
|
|
3816
|
+
/* @__PURE__ */ jsx18("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
|
|
3730
3817
|
] });
|
|
3731
3818
|
};
|
|
3732
3819
|
|
|
3733
3820
|
// src/image-editor/RefineEdgePanel.tsx
|
|
3734
|
-
import { useState as
|
|
3821
|
+
import { useState as useState16 } from "react";
|
|
3735
3822
|
import {
|
|
3736
3823
|
ADJUSTMENT_KINDS as ADJUSTMENT_KINDS2,
|
|
3737
3824
|
REFINE_EDGE_CONTROLS as REFINE_EDGE_CONTROLS2,
|
|
@@ -3741,14 +3828,14 @@ import {
|
|
|
3741
3828
|
} from "@pixerate/editor/image-editor";
|
|
3742
3829
|
|
|
3743
3830
|
// src/image-editor/MaskEdgeCheck.tsx
|
|
3744
|
-
import
|
|
3831
|
+
import React14, { useState as useState15 } from "react";
|
|
3745
3832
|
import { MASK_EDGE_THRESHOLDS } from "@pixerate/editor/image-editor";
|
|
3746
|
-
import { Fragment as Fragment4, jsx as
|
|
3833
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3747
3834
|
var button3 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
|
|
3748
3835
|
var MaskEdgeCheck = ({ controller, selection, target = "selection", layerId, className = "" }) => {
|
|
3749
3836
|
const sel = selection === void 0 ? controller.getSelection() : selection;
|
|
3750
|
-
const [result, setResult] =
|
|
3751
|
-
const [error, setError] =
|
|
3837
|
+
const [result, setResult] = useState15(null);
|
|
3838
|
+
const [error, setError] = useState15(null);
|
|
3752
3839
|
const report = result && (target !== "selection" || result.for === sel) ? result.report : null;
|
|
3753
3840
|
const check = () => {
|
|
3754
3841
|
setError(null);
|
|
@@ -3766,40 +3853,41 @@ var MaskEdgeCheck = ({ controller, selection, target = "selection", layerId, cla
|
|
|
3766
3853
|
{ label: "Jaggedness", value: report.jaggedness, bad: report.jaggedness >= T.jaggedness },
|
|
3767
3854
|
{ label: "Soft edge", value: report.softFraction, bad: report.softFraction >= T.soft }
|
|
3768
3855
|
] : [];
|
|
3769
|
-
return /* @__PURE__ */
|
|
3770
|
-
/* @__PURE__ */
|
|
3771
|
-
report && /* @__PURE__ */
|
|
3772
|
-
/* @__PURE__ */
|
|
3773
|
-
rows.map((r) => /* @__PURE__ */
|
|
3774
|
-
/* @__PURE__ */
|
|
3775
|
-
/* @__PURE__ */
|
|
3856
|
+
return /* @__PURE__ */ jsxs17("div", { "data-testid": "mask-edge-check", className: `flex flex-col gap-1.5 text-xs ${className}`, children: [
|
|
3857
|
+
/* @__PURE__ */ jsx19("button", { type: "button", className: `${button3} self-start`, disabled: target === "selection" && !sel, onClick: check, children: "Check Edge" }),
|
|
3858
|
+
report && /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
3859
|
+
/* @__PURE__ */ jsxs17("dl", { className: "grid grid-cols-[1fr_auto] gap-x-2 gap-y-0.5", children: [
|
|
3860
|
+
rows.map((r) => /* @__PURE__ */ jsxs17(React14.Fragment, { children: [
|
|
3861
|
+
/* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: r.label }),
|
|
3862
|
+
/* @__PURE__ */ jsx19("dd", { className: `font-mono text-right ${r.bad ? "text-destructive" : "text-foreground"}`, children: r.value })
|
|
3776
3863
|
] }, r.label)),
|
|
3777
|
-
/* @__PURE__ */
|
|
3778
|
-
/* @__PURE__ */
|
|
3864
|
+
/* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: "Holes / islands" }),
|
|
3865
|
+
/* @__PURE__ */ jsxs17("dd", { className: `font-mono text-right ${report.holes.count || report.islands.count ? "text-destructive" : "text-foreground"}`, children: [
|
|
3779
3866
|
report.holes.count,
|
|
3780
3867
|
" / ",
|
|
3781
3868
|
report.islands.count
|
|
3782
3869
|
] })
|
|
3783
3870
|
] }),
|
|
3784
|
-
report.issues.length ? /* @__PURE__ */
|
|
3871
|
+
report.issues.length ? /* @__PURE__ */ jsx19("ul", { "data-testid": "mask-edge-issues", className: "list-disc pl-4 flex flex-col gap-1 text-foreground", children: report.issues.map((s) => /* @__PURE__ */ jsx19("li", { children: s }, s)) }) : /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground", children: "The edge looks clean." })
|
|
3785
3872
|
] }),
|
|
3786
|
-
error && /* @__PURE__ */
|
|
3873
|
+
error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
|
|
3787
3874
|
] });
|
|
3788
3875
|
};
|
|
3789
3876
|
|
|
3790
3877
|
// src/image-editor/RefineEdgePanel.tsx
|
|
3791
|
-
import { Fragment as Fragment5, jsx as
|
|
3878
|
+
import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3792
3879
|
var DEFAULT_PARAMS = { radius: 8, smartRadius: false, smooth: 0, feather: 0, contrast: 0, shiftEdge: 0 };
|
|
3793
3880
|
var button4 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
|
|
3794
3881
|
var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
3795
|
-
const [params, setParams] =
|
|
3796
|
-
const [busy, setBusy] =
|
|
3797
|
-
const [error, setError] =
|
|
3798
|
-
const [layerId, setLayerId] =
|
|
3799
|
-
const [newKind, setNewKind] =
|
|
3800
|
-
const [output, setOutput] =
|
|
3801
|
-
const [decontaminate, setDecontaminate] =
|
|
3802
|
-
const [objectAware, setObjectAware] =
|
|
3882
|
+
const [params, setParams] = useState16(DEFAULT_PARAMS);
|
|
3883
|
+
const [busy, setBusy] = useState16(false);
|
|
3884
|
+
const [error, setError] = useState16(null);
|
|
3885
|
+
const [layerId, setLayerId] = useState16("");
|
|
3886
|
+
const [newKind, setNewKind] = useState16("hueSaturation");
|
|
3887
|
+
const [output, setOutput] = useState16("selection");
|
|
3888
|
+
const [decontaminate, setDecontaminate] = useState16(0);
|
|
3889
|
+
const [objectAware, setObjectAware] = useState16(false);
|
|
3890
|
+
const [onlyUncertain, setOnlyUncertain] = useState16(false);
|
|
3803
3891
|
const canObject = Boolean(controller.segmentationProvider);
|
|
3804
3892
|
const toLayer = output !== "selection" && output !== "layer-mask";
|
|
3805
3893
|
const sel = selection === void 0 ? controller.getSelection() : selection;
|
|
@@ -3809,9 +3897,12 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3809
3897
|
setBusy(true);
|
|
3810
3898
|
setError(null);
|
|
3811
3899
|
try {
|
|
3900
|
+
const regions = onlyUncertain ? controller.selectionUncertainty().regions.map((r) => r.bounds) : void 0;
|
|
3901
|
+
if (regions && !regions.length) throw new Error("No uncertain areas: the selection's edge already follows edges in the image. Untick Only uncertain areas to refine everywhere.");
|
|
3812
3902
|
await controller.refineSelectionTo(params, output, {
|
|
3813
3903
|
decontaminate: toLayer ? decontaminate : 0,
|
|
3814
|
-
refineMode: canObject && objectAware ? "object" : "color"
|
|
3904
|
+
refineMode: canObject && objectAware ? "object" : "color",
|
|
3905
|
+
...regions ? { regions } : {}
|
|
3815
3906
|
});
|
|
3816
3907
|
} catch (err) {
|
|
3817
3908
|
setError(err instanceof Error ? err.message : String(err));
|
|
@@ -3819,17 +3910,17 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3819
3910
|
setBusy(false);
|
|
3820
3911
|
}
|
|
3821
3912
|
};
|
|
3822
|
-
return /* @__PURE__ */
|
|
3823
|
-
/* @__PURE__ */
|
|
3824
|
-
REFINE_EDGE_CONTROLS2.map((c) => /* @__PURE__ */
|
|
3825
|
-
/* @__PURE__ */
|
|
3826
|
-
/* @__PURE__ */
|
|
3827
|
-
/* @__PURE__ */
|
|
3913
|
+
return /* @__PURE__ */ jsxs18("div", { "data-testid": "refine-edge-panel", className: `flex flex-col gap-3 text-xs ${className}`, children: [
|
|
3914
|
+
/* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Refine Edge" }),
|
|
3915
|
+
REFINE_EDGE_CONTROLS2.map((c) => /* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
|
|
3916
|
+
/* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3917
|
+
/* @__PURE__ */ jsx20("span", { children: c.label }),
|
|
3918
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
|
|
3828
3919
|
params[c.id],
|
|
3829
3920
|
c.unit
|
|
3830
3921
|
] })
|
|
3831
3922
|
] }),
|
|
3832
|
-
/* @__PURE__ */
|
|
3923
|
+
/* @__PURE__ */ jsx20(
|
|
3833
3924
|
"input",
|
|
3834
3925
|
{
|
|
3835
3926
|
type: "range",
|
|
@@ -3843,39 +3934,43 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3843
3934
|
}
|
|
3844
3935
|
)
|
|
3845
3936
|
] }, c.id)),
|
|
3846
|
-
/* @__PURE__ */
|
|
3847
|
-
/* @__PURE__ */
|
|
3937
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3938
|
+
/* @__PURE__ */ jsx20("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
|
|
3848
3939
|
"Smart Radius"
|
|
3849
3940
|
] }),
|
|
3850
|
-
|
|
3851
|
-
/* @__PURE__ */
|
|
3941
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-foreground", title: "Refine only where the edge has no image edge under it", children: [
|
|
3942
|
+
/* @__PURE__ */ jsx20("input", { type: "checkbox", "aria-label": "Only uncertain areas", checked: onlyUncertain, onChange: (e) => setOnlyUncertain(e.target.checked) }),
|
|
3943
|
+
"Only uncertain areas"
|
|
3944
|
+
] }),
|
|
3945
|
+
canObject && /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-foreground", children: [
|
|
3946
|
+
/* @__PURE__ */ jsx20("input", { type: "checkbox", "aria-label": "Object aware", checked: objectAware, onChange: (e) => setObjectAware(e.target.checked) }),
|
|
3852
3947
|
"Object aware (segmentation model)"
|
|
3853
3948
|
] }),
|
|
3854
|
-
/* @__PURE__ */
|
|
3949
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
|
|
3855
3950
|
"Output to",
|
|
3856
|
-
/* @__PURE__ */
|
|
3951
|
+
/* @__PURE__ */ jsx20(
|
|
3857
3952
|
"select",
|
|
3858
3953
|
{
|
|
3859
3954
|
"aria-label": "Refine output",
|
|
3860
3955
|
value: output,
|
|
3861
3956
|
onChange: (e) => setOutput(e.target.value),
|
|
3862
3957
|
className: "flex-1 bg-background border border-border rounded px-1 py-1 text-foreground",
|
|
3863
|
-
children: REFINE_OUTPUTS2.filter((o) => !o.needsDocuments || controller.canOpenDocuments).map((o) => /* @__PURE__ */
|
|
3958
|
+
children: REFINE_OUTPUTS2.filter((o) => !o.needsDocuments || controller.canOpenDocuments).map((o) => /* @__PURE__ */ jsx20("option", { value: o.id, children: o.label }, o.id))
|
|
3864
3959
|
}
|
|
3865
3960
|
)
|
|
3866
3961
|
] }),
|
|
3867
|
-
/* @__PURE__ */
|
|
3868
|
-
/* @__PURE__ */
|
|
3869
|
-
/* @__PURE__ */
|
|
3962
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
|
|
3963
|
+
/* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
3964
|
+
/* @__PURE__ */ jsxs18("span", { children: [
|
|
3870
3965
|
"Decontaminate colors",
|
|
3871
3966
|
toLayer ? "" : " (new layer or document outputs)"
|
|
3872
3967
|
] }),
|
|
3873
|
-
/* @__PURE__ */
|
|
3968
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
|
|
3874
3969
|
decontaminate,
|
|
3875
3970
|
"%"
|
|
3876
3971
|
] })
|
|
3877
3972
|
] }),
|
|
3878
|
-
/* @__PURE__ */
|
|
3973
|
+
/* @__PURE__ */ jsx20(
|
|
3879
3974
|
"input",
|
|
3880
3975
|
{
|
|
3881
3976
|
type: "range",
|
|
@@ -3890,25 +3985,25 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3890
3985
|
}
|
|
3891
3986
|
)
|
|
3892
3987
|
] }),
|
|
3893
|
-
/* @__PURE__ */
|
|
3894
|
-
/* @__PURE__ */
|
|
3895
|
-
/* @__PURE__ */
|
|
3988
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
|
|
3989
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
|
|
3990
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: button4, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
|
|
3896
3991
|
] }),
|
|
3897
|
-
error && /* @__PURE__ */
|
|
3898
|
-
/* @__PURE__ */
|
|
3899
|
-
/* @__PURE__ */
|
|
3900
|
-
/* @__PURE__ */
|
|
3901
|
-
/* @__PURE__ */
|
|
3992
|
+
error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error }),
|
|
3993
|
+
/* @__PURE__ */ jsx20(MaskEdgeCheck, { controller, selection: sel }),
|
|
3994
|
+
/* @__PURE__ */ jsx20("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
|
|
3995
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-1 items-center", children: [
|
|
3996
|
+
/* @__PURE__ */ jsx20(
|
|
3902
3997
|
"select",
|
|
3903
3998
|
{
|
|
3904
3999
|
"aria-label": "New masked layer kind",
|
|
3905
4000
|
value: newKind,
|
|
3906
4001
|
onChange: (e) => setNewKind(e.target.value),
|
|
3907
4002
|
className: "flex-1 bg-background border border-border rounded px-1 py-1 text-foreground",
|
|
3908
|
-
children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */
|
|
4003
|
+
children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx20("option", { value: k.kind, children: k.label }, k.kind))
|
|
3909
4004
|
}
|
|
3910
4005
|
),
|
|
3911
|
-
/* @__PURE__ */
|
|
4006
|
+
/* @__PURE__ */ jsx20(
|
|
3912
4007
|
"button",
|
|
3913
4008
|
{
|
|
3914
4009
|
type: "button",
|
|
@@ -3919,35 +4014,35 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3919
4014
|
}
|
|
3920
4015
|
)
|
|
3921
4016
|
] }),
|
|
3922
|
-
list.length > 0 && target && /* @__PURE__ */
|
|
3923
|
-
/* @__PURE__ */
|
|
4017
|
+
list.length > 0 && target && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2", children: [
|
|
4018
|
+
/* @__PURE__ */ jsx20(
|
|
3924
4019
|
"select",
|
|
3925
4020
|
{
|
|
3926
4021
|
"aria-label": "Mask layer",
|
|
3927
4022
|
value: target.id,
|
|
3928
4023
|
onChange: (e) => setLayerId(e.target.value),
|
|
3929
4024
|
className: "bg-background border border-border rounded px-1 py-1 text-foreground",
|
|
3930
|
-
children: list.map((l) => /* @__PURE__ */
|
|
4025
|
+
children: list.map((l) => /* @__PURE__ */ jsxs18("option", { value: l.id, children: [
|
|
3931
4026
|
l.name || adjustmentKindLabel2(l.kind),
|
|
3932
4027
|
l.mask ? " (masked)" : ""
|
|
3933
4028
|
] }, l.id))
|
|
3934
4029
|
}
|
|
3935
4030
|
),
|
|
3936
|
-
/* @__PURE__ */
|
|
3937
|
-
/* @__PURE__ */
|
|
3938
|
-
/* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
4031
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
|
|
4032
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
|
|
4033
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
|
|
4034
|
+
/* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
|
|
3940
4035
|
] }),
|
|
3941
|
-
target.mask && /* @__PURE__ */
|
|
3942
|
-
/* @__PURE__ */
|
|
3943
|
-
/* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
3945
|
-
/* @__PURE__ */
|
|
4036
|
+
target.mask && /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
4037
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
|
|
4038
|
+
/* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
4039
|
+
/* @__PURE__ */ jsx20("span", { children: "Density" }),
|
|
4040
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
|
|
3946
4041
|
Math.round((target.mask.density ?? 1) * 100),
|
|
3947
4042
|
"%"
|
|
3948
4043
|
] })
|
|
3949
4044
|
] }),
|
|
3950
|
-
/* @__PURE__ */
|
|
4045
|
+
/* @__PURE__ */ jsx20(
|
|
3951
4046
|
"input",
|
|
3952
4047
|
{
|
|
3953
4048
|
type: "range",
|
|
@@ -3961,15 +4056,15 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3961
4056
|
}
|
|
3962
4057
|
)
|
|
3963
4058
|
] }),
|
|
3964
|
-
/* @__PURE__ */
|
|
3965
|
-
/* @__PURE__ */
|
|
3966
|
-
/* @__PURE__ */
|
|
3967
|
-
/* @__PURE__ */
|
|
4059
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
|
|
4060
|
+
/* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
|
|
4061
|
+
/* @__PURE__ */ jsx20("span", { children: "Mask Feather" }),
|
|
4062
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
|
|
3968
4063
|
target.mask.feather ?? 0,
|
|
3969
4064
|
"px"
|
|
3970
4065
|
] })
|
|
3971
4066
|
] }),
|
|
3972
|
-
/* @__PURE__ */
|
|
4067
|
+
/* @__PURE__ */ jsx20(
|
|
3973
4068
|
"input",
|
|
3974
4069
|
{
|
|
3975
4070
|
type: "range",
|
|
@@ -3989,12 +4084,12 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3989
4084
|
};
|
|
3990
4085
|
|
|
3991
4086
|
// src/image-editor/ChannelsPanel.tsx
|
|
3992
|
-
import { useEffect as useEffect12, useRef as
|
|
4087
|
+
import { useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
|
|
3993
4088
|
import { MASK_FILE_ACCEPT, channelThumbnail, downloadMaskImage, openMaskFile, selectionModeFromModifiers } from "@pixerate/editor/image-editor";
|
|
3994
|
-
import { jsx as
|
|
4089
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3995
4090
|
var btn2 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
|
|
3996
4091
|
var ChannelThumb = ({ channel, size }) => {
|
|
3997
|
-
const ref =
|
|
4092
|
+
const ref = useRef11(null);
|
|
3998
4093
|
useEffect12(() => {
|
|
3999
4094
|
const canvas = ref.current;
|
|
4000
4095
|
const ctx = canvas?.getContext("2d");
|
|
@@ -4006,15 +4101,15 @@ var ChannelThumb = ({ channel, size }) => {
|
|
|
4006
4101
|
img.data.set(px.data);
|
|
4007
4102
|
ctx.putImageData(img, 0, 0);
|
|
4008
4103
|
}, [channel.mask]);
|
|
4009
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx21("canvas", { ref, "aria-hidden": "true", style: { width: size, height: size }, className: "shrink-0 rounded object-contain ring-1 ring-border bg-black" });
|
|
4010
4105
|
};
|
|
4011
4106
|
var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
4012
|
-
const [, setTick] =
|
|
4107
|
+
const [, setTick] = useState17(0);
|
|
4013
4108
|
useEffect12(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
4014
|
-
const [activeId, setActiveId] =
|
|
4015
|
-
const [renaming, setRenaming] =
|
|
4016
|
-
const [error, setError] =
|
|
4017
|
-
const fileInput =
|
|
4109
|
+
const [activeId, setActiveId] = useState17(null);
|
|
4110
|
+
const [renaming, setRenaming] = useState17(null);
|
|
4111
|
+
const [error, setError] = useState17(null);
|
|
4112
|
+
const fileInput = useRef11(null);
|
|
4018
4113
|
const channels = controller.getChannels();
|
|
4019
4114
|
const active = channels.find((c) => c.id === activeId) ?? null;
|
|
4020
4115
|
const hasSelection = Boolean(controller.getSelection());
|
|
@@ -4036,13 +4131,13 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4036
4131
|
setError(err instanceof Error ? err.message : String(err));
|
|
4037
4132
|
}
|
|
4038
4133
|
};
|
|
4039
|
-
return /* @__PURE__ */
|
|
4040
|
-
/* @__PURE__ */
|
|
4041
|
-
/* @__PURE__ */
|
|
4042
|
-
/* @__PURE__ */
|
|
4134
|
+
return /* @__PURE__ */ jsxs19("div", { "data-testid": "channels-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
|
|
4135
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4136
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Channels" }),
|
|
4137
|
+
/* @__PURE__ */ jsx21("button", { type: "button", "aria-pressed": quickMask, className: btn2(quickMask), title: "Paint the selection: white selects, black deselects (Q)", onClick: () => controller.setQuickMaskMode(!quickMask), children: "Quick Mask" })
|
|
4043
4138
|
] }),
|
|
4044
|
-
channels.length === 0 && /* @__PURE__ */
|
|
4045
|
-
/* @__PURE__ */
|
|
4139
|
+
channels.length === 0 && /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground", children: "No channels. Save a selection to keep it." }),
|
|
4140
|
+
/* @__PURE__ */ jsx21("ul", { role: "list", className: "flex flex-col gap-0.5", children: channels.map((c) => /* @__PURE__ */ jsxs19(
|
|
4046
4141
|
"li",
|
|
4047
4142
|
{
|
|
4048
4143
|
"data-testid": "channel-row",
|
|
@@ -4054,7 +4149,7 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4054
4149
|
},
|
|
4055
4150
|
onDoubleClick: () => setRenaming(c.id),
|
|
4056
4151
|
children: [
|
|
4057
|
-
/* @__PURE__ */
|
|
4152
|
+
/* @__PURE__ */ jsx21(
|
|
4058
4153
|
"button",
|
|
4059
4154
|
{
|
|
4060
4155
|
type: "button",
|
|
@@ -4068,8 +4163,8 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4068
4163
|
children: c.visible ? "\u25CF" : "\u25CB"
|
|
4069
4164
|
}
|
|
4070
4165
|
),
|
|
4071
|
-
/* @__PURE__ */
|
|
4072
|
-
renaming === c.id ? /* @__PURE__ */
|
|
4166
|
+
/* @__PURE__ */ jsx21(ChannelThumb, { channel: c, size: thumbnailSize }),
|
|
4167
|
+
renaming === c.id ? /* @__PURE__ */ jsx21(
|
|
4073
4168
|
"input",
|
|
4074
4169
|
{
|
|
4075
4170
|
autoFocus: true,
|
|
@@ -4086,16 +4181,16 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4086
4181
|
if (e.key === "Escape") setRenaming(null);
|
|
4087
4182
|
}
|
|
4088
4183
|
}
|
|
4089
|
-
) : /* @__PURE__ */
|
|
4184
|
+
) : /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 truncate", children: c.name })
|
|
4090
4185
|
]
|
|
4091
4186
|
},
|
|
4092
4187
|
c.id
|
|
4093
4188
|
)) }),
|
|
4094
|
-
/* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4097
|
-
/* @__PURE__ */
|
|
4098
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-1", children: [
|
|
4190
|
+
/* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !hasSelection, onClick: () => attempt(() => setActiveId(controller.saveSelection().id)), children: "Save Selection" }),
|
|
4191
|
+
/* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !active || !hasSelection, title: "Add the selection to the channel", onClick: () => attempt(() => controller.saveSelection({ channelId: active.id, mode: "add" })), children: "Add to Channel" }),
|
|
4192
|
+
/* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !active, onClick: () => attempt(() => setActiveId(controller.duplicateChannel(active.id).id)), children: "Duplicate" }),
|
|
4193
|
+
/* @__PURE__ */ jsx21(
|
|
4099
4194
|
"button",
|
|
4100
4195
|
{
|
|
4101
4196
|
type: "button",
|
|
@@ -4108,8 +4203,8 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4108
4203
|
children: "Delete"
|
|
4109
4204
|
}
|
|
4110
4205
|
),
|
|
4111
|
-
/* @__PURE__ */
|
|
4112
|
-
/* @__PURE__ */
|
|
4206
|
+
/* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), title: "Load a mask image (white = selected) into a new channel", onClick: () => fileInput.current?.click(), children: "Import\u2026" }),
|
|
4207
|
+
/* @__PURE__ */ jsx21(
|
|
4113
4208
|
"button",
|
|
4114
4209
|
{
|
|
4115
4210
|
type: "button",
|
|
@@ -4120,7 +4215,7 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4120
4215
|
children: "Export PNG"
|
|
4121
4216
|
}
|
|
4122
4217
|
),
|
|
4123
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ jsx21(
|
|
4124
4219
|
"input",
|
|
4125
4220
|
{
|
|
4126
4221
|
ref: fileInput,
|
|
@@ -4135,22 +4230,22 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4135
4230
|
}
|
|
4136
4231
|
)
|
|
4137
4232
|
] }),
|
|
4138
|
-
error && /* @__PURE__ */
|
|
4233
|
+
error && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: error })
|
|
4139
4234
|
] });
|
|
4140
4235
|
};
|
|
4141
4236
|
|
|
4142
4237
|
// src/image-editor/PathsPanel.tsx
|
|
4143
|
-
import { useEffect as useEffect13, useState as
|
|
4238
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
4144
4239
|
import { pathSvgData, selectionModeFromModifiers as selectionModeFromModifiers2 } from "@pixerate/editor/image-editor";
|
|
4145
|
-
import { jsx as
|
|
4240
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4146
4241
|
var btn3 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
|
|
4147
4242
|
var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
4148
|
-
const [, setTick] =
|
|
4243
|
+
const [, setTick] = useState18(0);
|
|
4149
4244
|
useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
4150
|
-
const [renaming, setRenaming] =
|
|
4151
|
-
const [color, setColor] =
|
|
4152
|
-
const [width, setWidth] =
|
|
4153
|
-
const [error, setError] =
|
|
4245
|
+
const [renaming, setRenaming] = useState18(null);
|
|
4246
|
+
const [color, setColor] = useState18("#000000");
|
|
4247
|
+
const [width, setWidth] = useState18(2);
|
|
4248
|
+
const [error, setError] = useState18(null);
|
|
4154
4249
|
const paths = controller.getPaths();
|
|
4155
4250
|
const activeId = controller.getState().activePathId ?? null;
|
|
4156
4251
|
const active = paths.find((p) => p.id === activeId) ?? null;
|
|
@@ -4166,10 +4261,10 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4166
4261
|
};
|
|
4167
4262
|
return (
|
|
4168
4263
|
// Clicking the panel's empty space deselects the path (the path tools then edit the active layer).
|
|
4169
|
-
/* @__PURE__ */
|
|
4170
|
-
/* @__PURE__ */
|
|
4171
|
-
paths.length === 0 && /* @__PURE__ */
|
|
4172
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ jsxs20("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: [
|
|
4265
|
+
/* @__PURE__ */ jsx22("span", { className: imageSectionTitleClass, children: "Paths" }),
|
|
4266
|
+
paths.length === 0 && /* @__PURE__ */ jsx22("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
|
|
4267
|
+
/* @__PURE__ */ jsx22("ul", { role: "list", className: "flex flex-col gap-0.5 min-h-4", onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: paths.map((p) => /* @__PURE__ */ jsxs20(
|
|
4173
4268
|
"li",
|
|
4174
4269
|
{
|
|
4175
4270
|
"data-testid": "path-row",
|
|
@@ -4178,8 +4273,8 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4178
4273
|
onClick: () => attempt(() => controller.setActivePath(p.id)),
|
|
4179
4274
|
onDoubleClick: () => setRenaming(p.id),
|
|
4180
4275
|
children: [
|
|
4181
|
-
/* @__PURE__ */
|
|
4182
|
-
renaming === p.id ? /* @__PURE__ */
|
|
4276
|
+
/* @__PURE__ */ jsx22("svg", { "aria-hidden": "true", viewBox: `0 0 ${w || 1} ${h || 1}`, style: { width: thumbnailSize, height: thumbnailSize }, className: "shrink-0 rounded ring-1 ring-border bg-background", children: /* @__PURE__ */ jsx22("path", { d: pathSvgData(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
|
|
4277
|
+
renaming === p.id ? /* @__PURE__ */ jsx22(
|
|
4183
4278
|
"input",
|
|
4184
4279
|
{
|
|
4185
4280
|
autoFocus: true,
|
|
@@ -4198,13 +4293,13 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4198
4293
|
if (e.key === "Escape") setRenaming(null);
|
|
4199
4294
|
}
|
|
4200
4295
|
}
|
|
4201
|
-
) : /* @__PURE__ */
|
|
4296
|
+
) : /* @__PURE__ */ jsx22("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
|
|
4202
4297
|
]
|
|
4203
4298
|
},
|
|
4204
4299
|
p.id
|
|
4205
4300
|
)) }),
|
|
4206
|
-
/* @__PURE__ */
|
|
4207
|
-
/* @__PURE__ */
|
|
4301
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap gap-1", children: [
|
|
4302
|
+
/* @__PURE__ */ jsx22(
|
|
4208
4303
|
"button",
|
|
4209
4304
|
{
|
|
4210
4305
|
type: "button",
|
|
@@ -4215,15 +4310,15 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4215
4310
|
children: "Load as Selection"
|
|
4216
4311
|
}
|
|
4217
4312
|
),
|
|
4218
|
-
/* @__PURE__ */
|
|
4219
|
-
active?.work && /* @__PURE__ */
|
|
4220
|
-
/* @__PURE__ */
|
|
4313
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
|
|
4314
|
+
active?.work && /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
|
|
4315
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
|
|
4221
4316
|
] }),
|
|
4222
|
-
/* @__PURE__ */
|
|
4223
|
-
/* @__PURE__ */
|
|
4224
|
-
/* @__PURE__ */
|
|
4225
|
-
/* @__PURE__ */
|
|
4226
|
-
/* @__PURE__ */
|
|
4317
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
4318
|
+
/* @__PURE__ */ jsx22("input", { type: "color", "aria-label": "Path paint colour", value: color, onChange: (e) => setColor(e.target.value), className: "h-6 w-8 bg-background border border-border rounded" }),
|
|
4319
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
|
|
4320
|
+
/* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
|
|
4321
|
+
/* @__PURE__ */ jsx22(
|
|
4227
4322
|
"input",
|
|
4228
4323
|
{
|
|
4229
4324
|
type: "number",
|
|
@@ -4238,24 +4333,24 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
4238
4333
|
),
|
|
4239
4334
|
"px"
|
|
4240
4335
|
] }),
|
|
4241
|
-
/* @__PURE__ */
|
|
4336
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
|
|
4242
4337
|
] }),
|
|
4243
|
-
/* @__PURE__ */
|
|
4244
|
-
/* @__PURE__ */
|
|
4245
|
-
/* @__PURE__ */
|
|
4338
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap gap-1", children: [
|
|
4339
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
|
|
4340
|
+
/* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
|
|
4246
4341
|
] }),
|
|
4247
|
-
error && /* @__PURE__ */
|
|
4342
|
+
error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
|
|
4248
4343
|
] })
|
|
4249
4344
|
);
|
|
4250
4345
|
};
|
|
4251
4346
|
|
|
4252
4347
|
// src/image-editor/FreeTransformOptionsBar.tsx
|
|
4253
|
-
import { useEffect as useEffect14, useState as
|
|
4348
|
+
import { useEffect as useEffect14, useState as useState19 } from "react";
|
|
4254
4349
|
import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
|
|
4255
|
-
import { jsx as
|
|
4350
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4256
4351
|
var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
|
|
4257
4352
|
var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
4258
|
-
const [, setTick] =
|
|
4353
|
+
const [, setTick] = useState19(0);
|
|
4259
4354
|
useEffect14(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
|
|
4260
4355
|
const bar = tool.bar();
|
|
4261
4356
|
if (!tool.active || !bar) return null;
|
|
@@ -4268,17 +4363,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4268
4363
|
const v = Number(raw);
|
|
4269
4364
|
if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
|
|
4270
4365
|
};
|
|
4271
|
-
return /* @__PURE__ */
|
|
4272
|
-
/* @__PURE__ */
|
|
4273
|
-
/* @__PURE__ */
|
|
4274
|
-
tool.mode === "warp" && /* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4276
|
-
/* @__PURE__ */
|
|
4277
|
-
/* @__PURE__ */
|
|
4366
|
+
return /* @__PURE__ */ jsxs21("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
|
|
4367
|
+
/* @__PURE__ */ jsx23("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx23("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
|
|
4368
|
+
/* @__PURE__ */ jsx23("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
|
|
4369
|
+
tool.mode === "warp" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
|
|
4370
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
|
|
4371
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Warp" }),
|
|
4372
|
+
/* @__PURE__ */ jsx23("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx23("option", { value: o.id, children: o.label }, o.id)) })
|
|
4278
4373
|
] }),
|
|
4279
|
-
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4374
|
+
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
|
|
4375
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
|
|
4376
|
+
/* @__PURE__ */ jsx23(
|
|
4282
4377
|
"input",
|
|
4283
4378
|
{
|
|
4284
4379
|
type: "number",
|
|
@@ -4299,9 +4394,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4299
4394
|
},
|
|
4300
4395
|
`${k}:${warp[k]}`
|
|
4301
4396
|
),
|
|
4302
|
-
/* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "%" })
|
|
4303
4398
|
] }, k)),
|
|
4304
|
-
/* @__PURE__ */
|
|
4399
|
+
/* @__PURE__ */ jsx23(
|
|
4305
4400
|
"button",
|
|
4306
4401
|
{
|
|
4307
4402
|
type: "button",
|
|
@@ -4313,9 +4408,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4313
4408
|
children: "Vertical"
|
|
4314
4409
|
}
|
|
4315
4410
|
),
|
|
4316
|
-
/* @__PURE__ */
|
|
4317
|
-
/* @__PURE__ */
|
|
4318
|
-
/* @__PURE__ */
|
|
4411
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
|
|
4412
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Grid" }),
|
|
4413
|
+
/* @__PURE__ */ jsx23(
|
|
4319
4414
|
"select",
|
|
4320
4415
|
{
|
|
4321
4416
|
"aria-label": "Warp grid",
|
|
@@ -4325,14 +4420,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4325
4420
|
tool.setWarp({ columns: g.columns, rows: g.rows });
|
|
4326
4421
|
},
|
|
4327
4422
|
className: imageFieldClass,
|
|
4328
|
-
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */
|
|
4423
|
+
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx23("option", { value: g.id, children: g.label }, g.id))
|
|
4329
4424
|
}
|
|
4330
4425
|
)
|
|
4331
4426
|
] })
|
|
4332
4427
|
] }),
|
|
4333
|
-
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */
|
|
4334
|
-
/* @__PURE__ */
|
|
4335
|
-
/* @__PURE__ */
|
|
4428
|
+
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", title: f.title, children: [
|
|
4429
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: f.label }),
|
|
4430
|
+
/* @__PURE__ */ jsx23(
|
|
4336
4431
|
"input",
|
|
4337
4432
|
{
|
|
4338
4433
|
type: "number",
|
|
@@ -4352,8 +4447,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4352
4447
|
},
|
|
4353
4448
|
`${f.id}:${round(bar[f.id], f.unit)}`
|
|
4354
4449
|
),
|
|
4355
|
-
/* @__PURE__ */
|
|
4356
|
-
f.id === "scaleX" && /* @__PURE__ */
|
|
4450
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: f.unit }),
|
|
4451
|
+
f.id === "scaleX" && /* @__PURE__ */ jsx23(
|
|
4357
4452
|
"button",
|
|
4358
4453
|
{
|
|
4359
4454
|
type: "button",
|
|
@@ -4368,33 +4463,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
4368
4463
|
}
|
|
4369
4464
|
)
|
|
4370
4465
|
] }, f.id)),
|
|
4371
|
-
/* @__PURE__ */
|
|
4372
|
-
/* @__PURE__ */
|
|
4373
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
|
|
4467
|
+
/* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Interpolation" }),
|
|
4468
|
+
/* @__PURE__ */ jsx23(
|
|
4374
4469
|
"select",
|
|
4375
4470
|
{
|
|
4376
4471
|
"aria-label": "Interpolation",
|
|
4377
4472
|
value: tool.interpolation,
|
|
4378
4473
|
onChange: (e) => tool.setInterpolation(e.target.value),
|
|
4379
4474
|
className: imageFieldClass,
|
|
4380
|
-
children: INTERPOLATIONS.map((i) => /* @__PURE__ */
|
|
4475
|
+
children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx23("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
|
|
4381
4476
|
}
|
|
4382
4477
|
)
|
|
4383
4478
|
] }),
|
|
4384
|
-
/* @__PURE__ */
|
|
4385
|
-
/* @__PURE__ */
|
|
4386
|
-
tool.error && /* @__PURE__ */
|
|
4479
|
+
/* @__PURE__ */ jsx23("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
|
|
4480
|
+
/* @__PURE__ */ jsx23("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
|
|
4481
|
+
tool.error && /* @__PURE__ */ jsx23("span", { role: "alert", className: "text-destructive", children: tool.error })
|
|
4387
4482
|
] });
|
|
4388
4483
|
};
|
|
4389
4484
|
|
|
4390
4485
|
// src/image-editor/ShapeOptionsBar.tsx
|
|
4391
|
-
import { useEffect as useEffect15, useState as
|
|
4486
|
+
import { useEffect as useEffect15, useState as useState20 } from "react";
|
|
4392
4487
|
import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
|
|
4393
|
-
import { Fragment as Fragment6, jsx as
|
|
4488
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4394
4489
|
var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
4395
|
-
const [, setTick] =
|
|
4490
|
+
const [, setTick] = useState20(0);
|
|
4396
4491
|
useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
4397
|
-
const [error, setError] =
|
|
4492
|
+
const [error, setError] = useState20(null);
|
|
4398
4493
|
const active = controller.getActiveLayer();
|
|
4399
4494
|
const shapeId = active?.type === "shape" ? active.id : null;
|
|
4400
4495
|
const set = (change) => {
|
|
@@ -4408,22 +4503,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
4408
4503
|
}
|
|
4409
4504
|
};
|
|
4410
4505
|
const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
|
|
4411
|
-
return /* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4414
|
-
/* @__PURE__ */
|
|
4415
|
-
/* @__PURE__ */
|
|
4506
|
+
return /* @__PURE__ */ jsxs22("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
|
|
4507
|
+
/* @__PURE__ */ jsx24("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx24("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
|
|
4508
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
4509
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4510
|
+
/* @__PURE__ */ jsx24(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
|
|
4416
4511
|
"Fill",
|
|
4417
|
-
/* @__PURE__ */
|
|
4512
|
+
/* @__PURE__ */ jsx24(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
|
|
4418
4513
|
] }),
|
|
4419
|
-
/* @__PURE__ */
|
|
4420
|
-
/* @__PURE__ */
|
|
4514
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4515
|
+
/* @__PURE__ */ jsx24(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
|
|
4421
4516
|
"Stroke",
|
|
4422
|
-
/* @__PURE__ */
|
|
4517
|
+
/* @__PURE__ */ jsx24(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
|
|
4423
4518
|
] }),
|
|
4424
|
-
/* @__PURE__ */
|
|
4519
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4425
4520
|
"Width",
|
|
4426
|
-
/* @__PURE__ */
|
|
4521
|
+
/* @__PURE__ */ jsx24(
|
|
4427
4522
|
"input",
|
|
4428
4523
|
{
|
|
4429
4524
|
type: "number",
|
|
@@ -4437,52 +4532,52 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
4437
4532
|
)
|
|
4438
4533
|
] })
|
|
4439
4534
|
] }),
|
|
4440
|
-
/* @__PURE__ */
|
|
4441
|
-
options.kind === "rect" && /* @__PURE__ */
|
|
4535
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
4536
|
+
options.kind === "rect" && /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4442
4537
|
"Radius",
|
|
4443
|
-
/* @__PURE__ */
|
|
4538
|
+
/* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
|
|
4444
4539
|
] }),
|
|
4445
|
-
options.kind === "polygon" && /* @__PURE__ */
|
|
4540
|
+
options.kind === "polygon" && /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4446
4541
|
"Sides",
|
|
4447
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
|
|
4448
4543
|
] }),
|
|
4449
|
-
options.kind === "star" && /* @__PURE__ */
|
|
4450
|
-
/* @__PURE__ */
|
|
4544
|
+
options.kind === "star" && /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4545
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4451
4546
|
"Points",
|
|
4452
|
-
/* @__PURE__ */
|
|
4547
|
+
/* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
|
|
4453
4548
|
] }),
|
|
4454
|
-
/* @__PURE__ */
|
|
4549
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4455
4550
|
"Inner",
|
|
4456
|
-
/* @__PURE__ */
|
|
4551
|
+
/* @__PURE__ */ jsx24(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
|
|
4457
4552
|
] })
|
|
4458
4553
|
] }),
|
|
4459
|
-
options.kind === "line" && /* @__PURE__ */
|
|
4460
|
-
/* @__PURE__ */
|
|
4554
|
+
options.kind === "line" && /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4555
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4461
4556
|
"Weight",
|
|
4462
|
-
/* @__PURE__ */
|
|
4557
|
+
/* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
|
|
4463
4558
|
] }),
|
|
4464
|
-
/* @__PURE__ */
|
|
4465
|
-
/* @__PURE__ */
|
|
4559
|
+
/* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
|
|
4560
|
+
/* @__PURE__ */ jsx24(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
|
|
4466
4561
|
"Arrowhead"
|
|
4467
4562
|
] })
|
|
4468
4563
|
] })
|
|
4469
4564
|
] }),
|
|
4470
|
-
/* @__PURE__ */
|
|
4471
|
-
error && /* @__PURE__ */
|
|
4565
|
+
/* @__PURE__ */ jsx24("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
|
|
4566
|
+
error && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: error })
|
|
4472
4567
|
] });
|
|
4473
4568
|
};
|
|
4474
4569
|
|
|
4475
4570
|
// src/image-editor/TypeOptionsBar.tsx
|
|
4476
|
-
import { useEffect as useEffect16, useState as
|
|
4571
|
+
import { useEffect as useEffect16, useState as useState21 } from "react";
|
|
4477
4572
|
import { TEXT_ALIGNS, TEXT_ORIENTATIONS } from "@pixerate/editor/image-editor";
|
|
4478
|
-
import { jsx as
|
|
4573
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4479
4574
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
4480
4575
|
var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
|
|
4481
4576
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
4482
|
-
const [, setTick] =
|
|
4577
|
+
const [, setTick] = useState21(0);
|
|
4483
4578
|
useEffect16(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
4484
4579
|
useEffect16(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
|
|
4485
|
-
const [error, setError] =
|
|
4580
|
+
const [error, setError] = useState21(null);
|
|
4486
4581
|
const active = controller.getActiveLayer();
|
|
4487
4582
|
const typeId = !session && active?.type === "type" ? active.id : null;
|
|
4488
4583
|
const here = session?.alive ? session.styleHere() : {};
|
|
@@ -4535,11 +4630,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
4535
4630
|
setError(e instanceof Error ? e.message : String(e));
|
|
4536
4631
|
}
|
|
4537
4632
|
};
|
|
4538
|
-
return /* @__PURE__ */
|
|
4539
|
-
/* @__PURE__ */
|
|
4540
|
-
/* @__PURE__ */
|
|
4633
|
+
return /* @__PURE__ */ jsxs23("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
|
|
4634
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4635
|
+
/* @__PURE__ */ jsxs23("label", { className: "flex items-center gap-1", children: [
|
|
4541
4636
|
"Font",
|
|
4542
|
-
/* @__PURE__ */
|
|
4637
|
+
/* @__PURE__ */ jsx25(
|
|
4543
4638
|
"input",
|
|
4544
4639
|
{
|
|
4545
4640
|
list: "pixerate-type-fonts",
|
|
@@ -4549,11 +4644,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
4549
4644
|
className: "w-32 rounded border border-border bg-background px-1 py-0.5"
|
|
4550
4645
|
}
|
|
4551
4646
|
),
|
|
4552
|
-
/* @__PURE__ */
|
|
4647
|
+
/* @__PURE__ */ jsx25("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx25("option", { value: f }, f)) })
|
|
4553
4648
|
] }),
|
|
4554
|
-
/* @__PURE__ */
|
|
4649
|
+
/* @__PURE__ */ jsxs23("label", { className: "flex items-center gap-1", children: [
|
|
4555
4650
|
"Size",
|
|
4556
|
-
/* @__PURE__ */
|
|
4651
|
+
/* @__PURE__ */ jsx25(
|
|
4557
4652
|
"input",
|
|
4558
4653
|
{
|
|
4559
4654
|
type: "number",
|
|
@@ -4566,14 +4661,14 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
4566
4661
|
}
|
|
4567
4662
|
)
|
|
4568
4663
|
] }),
|
|
4569
|
-
/* @__PURE__ */
|
|
4570
|
-
/* @__PURE__ */
|
|
4571
|
-
/* @__PURE__ */
|
|
4664
|
+
/* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
|
|
4665
|
+
/* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
|
|
4666
|
+
/* @__PURE__ */ jsx25(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
|
|
4572
4667
|
] }),
|
|
4573
|
-
/* @__PURE__ */
|
|
4574
|
-
/* @__PURE__ */
|
|
4575
|
-
TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */
|
|
4576
|
-
orientation === "vertical" && editedId && /* @__PURE__ */
|
|
4668
|
+
/* @__PURE__ */ jsx25("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
4669
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
|
|
4670
|
+
TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
|
|
4671
|
+
orientation === "vertical" && editedId && /* @__PURE__ */ jsx25(
|
|
4577
4672
|
"button",
|
|
4578
4673
|
{
|
|
4579
4674
|
type: "button",
|
|
@@ -4585,19 +4680,19 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
4585
4680
|
}
|
|
4586
4681
|
)
|
|
4587
4682
|
] }),
|
|
4588
|
-
/* @__PURE__ */
|
|
4589
|
-
missing.length > 0 && /* @__PURE__ */
|
|
4683
|
+
/* @__PURE__ */ jsx25("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
4684
|
+
missing.length > 0 && /* @__PURE__ */ jsxs23("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
|
|
4590
4685
|
"Missing ",
|
|
4591
4686
|
missing.length === 1 ? "font" : "fonts",
|
|
4592
4687
|
": ",
|
|
4593
4688
|
missing.join(", ")
|
|
4594
4689
|
] }),
|
|
4595
|
-
error && /* @__PURE__ */
|
|
4690
|
+
error && /* @__PURE__ */ jsx25("p", { role: "alert", className: "text-destructive", children: error })
|
|
4596
4691
|
] });
|
|
4597
4692
|
};
|
|
4598
4693
|
|
|
4599
4694
|
// src/image-editor/ImageEditor.tsx
|
|
4600
|
-
import { Fragment as Fragment7, jsx as
|
|
4695
|
+
import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4601
4696
|
var ImageEditor = ({
|
|
4602
4697
|
editor: externalEditor,
|
|
4603
4698
|
src,
|
|
@@ -4622,32 +4717,32 @@ var ImageEditor = ({
|
|
|
4622
4717
|
return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
|
|
4623
4718
|
});
|
|
4624
4719
|
const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
|
|
4625
|
-
const [activeTab, setActiveTab] =
|
|
4626
|
-
const rootRef =
|
|
4720
|
+
const [activeTab, setActiveTab] = useState22("crop");
|
|
4721
|
+
const rootRef = useRef12(null);
|
|
4627
4722
|
const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
|
|
4628
|
-
const activeTabRef =
|
|
4723
|
+
const activeTabRef = useRef12(activeTab);
|
|
4629
4724
|
activeTabRef.current = activeTab;
|
|
4630
4725
|
const openPanel = async (ref) => {
|
|
4631
4726
|
if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
|
|
4632
4727
|
rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
|
|
4633
4728
|
await new Promise((resolve) => setTimeout(resolve, 60));
|
|
4634
4729
|
};
|
|
4635
|
-
const [activeCropRatio, setActiveCropRatio] =
|
|
4636
|
-
const [selectionOptions, setSelectionOptions] =
|
|
4637
|
-
const [shapeOptions, setShapeOptions] =
|
|
4638
|
-
const [typeOptions, setTypeOptions] =
|
|
4639
|
-
const [typeSession, setTypeSession] =
|
|
4640
|
-
const [selectionError, setSelectionError] =
|
|
4641
|
-
const [paintError, setPaintError] =
|
|
4642
|
-
const [shapeTypeError, setShapeTypeError] =
|
|
4730
|
+
const [activeCropRatio, setActiveCropRatio] = useState22(null);
|
|
4731
|
+
const [selectionOptions, setSelectionOptions] = useState22(DEFAULT_SELECTION_TOOL_OPTIONS2);
|
|
4732
|
+
const [shapeOptions, setShapeOptions] = useState22(DEFAULT_SHAPE_TOOL_OPTIONS2);
|
|
4733
|
+
const [typeOptions, setTypeOptions] = useState22(DEFAULT_TYPE_TOOL_OPTIONS2);
|
|
4734
|
+
const [typeSession, setTypeSession] = useState22(null);
|
|
4735
|
+
const [selectionError, setSelectionError] = useState22(null);
|
|
4736
|
+
const [paintError, setPaintError] = useState22(null);
|
|
4737
|
+
const [shapeTypeError, setShapeTypeError] = useState22(null);
|
|
4643
4738
|
const handleCanvasError = (source, message) => {
|
|
4644
4739
|
if (source === "paint") setPaintError(message);
|
|
4645
4740
|
else if (source === "select") setSelectionError(message);
|
|
4646
4741
|
else setShapeTypeError(message);
|
|
4647
4742
|
};
|
|
4648
4743
|
const finishTyping = () => setTypeSession(null);
|
|
4649
|
-
const transformToolRef =
|
|
4650
|
-
const transformControllerRef =
|
|
4744
|
+
const transformToolRef = useRef12(null);
|
|
4745
|
+
const transformControllerRef = useRef12(controller);
|
|
4651
4746
|
if (!transformToolRef.current || transformControllerRef.current !== controller) {
|
|
4652
4747
|
transformToolRef.current?.cancel();
|
|
4653
4748
|
transformToolRef.current = new FreeTransformTool2(controller, {
|
|
@@ -4656,16 +4751,16 @@ var ImageEditor = ({
|
|
|
4656
4751
|
transformControllerRef.current = controller;
|
|
4657
4752
|
}
|
|
4658
4753
|
const transformTool = transformToolRef.current;
|
|
4659
|
-
const [, setTransformTick] =
|
|
4754
|
+
const [, setTransformTick] = useState22(0);
|
|
4660
4755
|
useEffect17(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
|
|
4661
4756
|
useEffect17(() => () => transformToolRef.current?.cancel(), []);
|
|
4662
|
-
const [inpaintPrompt, setInpaintPrompt] =
|
|
4663
|
-
const [inpaintMaskMode, setInpaintMaskMode] =
|
|
4664
|
-
const [isRemovingBg, setIsRemovingBg] =
|
|
4665
|
-
const [isInpainting, setIsInpainting] =
|
|
4666
|
-
const [aiError, setAiError] =
|
|
4667
|
-
const [aiSuccess, setAiSuccess] =
|
|
4668
|
-
const [aiTarget, setAiTarget] =
|
|
4757
|
+
const [inpaintPrompt, setInpaintPrompt] = useState22("");
|
|
4758
|
+
const [inpaintMaskMode, setInpaintMaskMode] = useState22("annotations");
|
|
4759
|
+
const [isRemovingBg, setIsRemovingBg] = useState22(false);
|
|
4760
|
+
const [isInpainting, setIsInpainting] = useState22(false);
|
|
4761
|
+
const [aiError, setAiError] = useState22(null);
|
|
4762
|
+
const [aiSuccess, setAiSuccess] = useState22(null);
|
|
4763
|
+
const [aiTarget, setAiTarget] = useState22("auto");
|
|
4669
4764
|
const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
|
|
4670
4765
|
const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
|
|
4671
4766
|
const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
|
|
@@ -4728,10 +4823,10 @@ var ImageEditor = ({
|
|
|
4728
4823
|
setIsInpainting(false);
|
|
4729
4824
|
}
|
|
4730
4825
|
};
|
|
4731
|
-
const [activeColor, setActiveColor] =
|
|
4732
|
-
const [strokeWidth, setStrokeWidth] =
|
|
4733
|
-
const [fontSize, setFontSize] =
|
|
4734
|
-
const [textInput, setTextInput] =
|
|
4826
|
+
const [activeColor, setActiveColor] = useState22("#ef4444");
|
|
4827
|
+
const [strokeWidth, setStrokeWidth] = useState22(3);
|
|
4828
|
+
const [fontSize, setFontSize] = useState22(24);
|
|
4829
|
+
const [textInput, setTextInput] = useState22("");
|
|
4735
4830
|
useEffect17(() => {
|
|
4736
4831
|
if (activeTab === "crop" && editor.state.activeTool !== "crop") {
|
|
4737
4832
|
editor.setTool("crop");
|
|
@@ -4760,16 +4855,16 @@ var ImageEditor = ({
|
|
|
4760
4855
|
link.click();
|
|
4761
4856
|
}
|
|
4762
4857
|
};
|
|
4763
|
-
return /* @__PURE__ */
|
|
4858
|
+
return /* @__PURE__ */ jsxs24(
|
|
4764
4859
|
"div",
|
|
4765
4860
|
{
|
|
4766
4861
|
ref: rootRef,
|
|
4767
4862
|
className: `${imageEditorFrameClass} ${className}`,
|
|
4768
4863
|
style,
|
|
4769
4864
|
children: [
|
|
4770
|
-
/* @__PURE__ */
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4865
|
+
/* @__PURE__ */ jsxs24("div", { className: imageEditorHeaderClass, children: [
|
|
4866
|
+
/* @__PURE__ */ jsxs24("div", { role: "tablist", className: imageTabListClass, children: [
|
|
4867
|
+
/* @__PURE__ */ jsx26(
|
|
4773
4868
|
"button",
|
|
4774
4869
|
{
|
|
4775
4870
|
type: "button",
|
|
@@ -4784,7 +4879,7 @@ var ImageEditor = ({
|
|
|
4784
4879
|
children: "Transform & Crop"
|
|
4785
4880
|
}
|
|
4786
4881
|
),
|
|
4787
|
-
/* @__PURE__ */
|
|
4882
|
+
/* @__PURE__ */ jsx26(
|
|
4788
4883
|
"button",
|
|
4789
4884
|
{
|
|
4790
4885
|
type: "button",
|
|
@@ -4799,7 +4894,7 @@ var ImageEditor = ({
|
|
|
4799
4894
|
children: "Adjustments"
|
|
4800
4895
|
}
|
|
4801
4896
|
),
|
|
4802
|
-
/* @__PURE__ */
|
|
4897
|
+
/* @__PURE__ */ jsx26(
|
|
4803
4898
|
"button",
|
|
4804
4899
|
{
|
|
4805
4900
|
type: "button",
|
|
@@ -4814,7 +4909,7 @@ var ImageEditor = ({
|
|
|
4814
4909
|
children: "Layers"
|
|
4815
4910
|
}
|
|
4816
4911
|
),
|
|
4817
|
-
/* @__PURE__ */
|
|
4912
|
+
/* @__PURE__ */ jsx26(
|
|
4818
4913
|
"button",
|
|
4819
4914
|
{
|
|
4820
4915
|
type: "button",
|
|
@@ -4829,7 +4924,7 @@ var ImageEditor = ({
|
|
|
4829
4924
|
children: "Paint"
|
|
4830
4925
|
}
|
|
4831
4926
|
),
|
|
4832
|
-
/* @__PURE__ */
|
|
4927
|
+
/* @__PURE__ */ jsx26(
|
|
4833
4928
|
"button",
|
|
4834
4929
|
{
|
|
4835
4930
|
type: "button",
|
|
@@ -4844,7 +4939,7 @@ var ImageEditor = ({
|
|
|
4844
4939
|
children: "Select & Mask"
|
|
4845
4940
|
}
|
|
4846
4941
|
),
|
|
4847
|
-
/* @__PURE__ */
|
|
4942
|
+
/* @__PURE__ */ jsx26(
|
|
4848
4943
|
"button",
|
|
4849
4944
|
{
|
|
4850
4945
|
type: "button",
|
|
@@ -4859,7 +4954,7 @@ var ImageEditor = ({
|
|
|
4859
4954
|
children: "Annotations"
|
|
4860
4955
|
}
|
|
4861
4956
|
),
|
|
4862
|
-
/* @__PURE__ */
|
|
4957
|
+
/* @__PURE__ */ jsx26(
|
|
4863
4958
|
"button",
|
|
4864
4959
|
{
|
|
4865
4960
|
type: "button",
|
|
@@ -4874,7 +4969,7 @@ var ImageEditor = ({
|
|
|
4874
4969
|
children: "Depth Mask"
|
|
4875
4970
|
}
|
|
4876
4971
|
),
|
|
4877
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsxs24(
|
|
4878
4973
|
"button",
|
|
4879
4974
|
{
|
|
4880
4975
|
type: "button",
|
|
@@ -4887,14 +4982,14 @@ var ImageEditor = ({
|
|
|
4887
4982
|
"aria-selected": activeTab === "ai",
|
|
4888
4983
|
className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
|
|
4889
4984
|
children: [
|
|
4890
|
-
/* @__PURE__ */
|
|
4985
|
+
/* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
|
|
4891
4986
|
"AI Tools"
|
|
4892
4987
|
]
|
|
4893
4988
|
}
|
|
4894
4989
|
)
|
|
4895
4990
|
] }),
|
|
4896
|
-
/* @__PURE__ */
|
|
4897
|
-
/* @__PURE__ */
|
|
4991
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
4992
|
+
/* @__PURE__ */ jsx26(
|
|
4898
4993
|
"button",
|
|
4899
4994
|
{
|
|
4900
4995
|
type: "button",
|
|
@@ -4905,7 +5000,7 @@ var ImageEditor = ({
|
|
|
4905
5000
|
children: "\u21A9"
|
|
4906
5001
|
}
|
|
4907
5002
|
),
|
|
4908
|
-
/* @__PURE__ */
|
|
5003
|
+
/* @__PURE__ */ jsx26(
|
|
4909
5004
|
"button",
|
|
4910
5005
|
{
|
|
4911
5006
|
type: "button",
|
|
@@ -4916,7 +5011,7 @@ var ImageEditor = ({
|
|
|
4916
5011
|
children: "\u21AA"
|
|
4917
5012
|
}
|
|
4918
5013
|
),
|
|
4919
|
-
/* @__PURE__ */
|
|
5014
|
+
/* @__PURE__ */ jsx26(
|
|
4920
5015
|
"button",
|
|
4921
5016
|
{
|
|
4922
5017
|
type: "button",
|
|
@@ -4925,8 +5020,8 @@ var ImageEditor = ({
|
|
|
4925
5020
|
children: "Reset"
|
|
4926
5021
|
}
|
|
4927
5022
|
),
|
|
4928
|
-
/* @__PURE__ */
|
|
4929
|
-
/* @__PURE__ */
|
|
5023
|
+
/* @__PURE__ */ jsx26("div", { className: "h-4 w-px bg-muted mx-1" }),
|
|
5024
|
+
/* @__PURE__ */ jsx26(
|
|
4930
5025
|
"button",
|
|
4931
5026
|
{
|
|
4932
5027
|
type: "button",
|
|
@@ -4936,11 +5031,11 @@ var ImageEditor = ({
|
|
|
4936
5031
|
children: "-"
|
|
4937
5032
|
}
|
|
4938
5033
|
),
|
|
4939
|
-
/* @__PURE__ */
|
|
5034
|
+
/* @__PURE__ */ jsxs24("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
|
|
4940
5035
|
Math.round(state.zoom * 100),
|
|
4941
5036
|
"%"
|
|
4942
5037
|
] }),
|
|
4943
|
-
/* @__PURE__ */
|
|
5038
|
+
/* @__PURE__ */ jsx26(
|
|
4944
5039
|
"button",
|
|
4945
5040
|
{
|
|
4946
5041
|
type: "button",
|
|
@@ -4950,8 +5045,8 @@ var ImageEditor = ({
|
|
|
4950
5045
|
children: "+"
|
|
4951
5046
|
}
|
|
4952
5047
|
),
|
|
4953
|
-
/* @__PURE__ */
|
|
4954
|
-
/* @__PURE__ */
|
|
5048
|
+
/* @__PURE__ */ jsx26("div", { className: "h-4 w-px bg-muted mx-1" }),
|
|
5049
|
+
/* @__PURE__ */ jsx26(
|
|
4955
5050
|
"button",
|
|
4956
5051
|
{
|
|
4957
5052
|
type: "button",
|
|
@@ -4962,7 +5057,7 @@ var ImageEditor = ({
|
|
|
4962
5057
|
children: "Hold Compare"
|
|
4963
5058
|
}
|
|
4964
5059
|
),
|
|
4965
|
-
/* @__PURE__ */
|
|
5060
|
+
/* @__PURE__ */ jsx26(
|
|
4966
5061
|
"button",
|
|
4967
5062
|
{
|
|
4968
5063
|
type: "button",
|
|
@@ -4973,10 +5068,10 @@ var ImageEditor = ({
|
|
|
4973
5068
|
)
|
|
4974
5069
|
] })
|
|
4975
5070
|
] }),
|
|
4976
|
-
transformTool.active && /* @__PURE__ */
|
|
4977
|
-
!transformTool.active && transformTool.error && /* @__PURE__ */
|
|
4978
|
-
/* @__PURE__ */
|
|
4979
|
-
/* @__PURE__ */
|
|
5071
|
+
transformTool.active && /* @__PURE__ */ jsx26(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
|
|
5072
|
+
!transformTool.active && transformTool.error && /* @__PURE__ */ jsx26("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
|
|
5073
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
|
|
5074
|
+
/* @__PURE__ */ jsx26(
|
|
4980
5075
|
ImageEditorCanvas,
|
|
4981
5076
|
{
|
|
4982
5077
|
editor,
|
|
@@ -5000,11 +5095,11 @@ var ImageEditor = ({
|
|
|
5000
5095
|
className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
|
|
5001
5096
|
}
|
|
5002
5097
|
),
|
|
5003
|
-
/* @__PURE__ */
|
|
5004
|
-
activeTab === "crop" && /* @__PURE__ */
|
|
5005
|
-
/* @__PURE__ */
|
|
5006
|
-
/* @__PURE__ */
|
|
5007
|
-
/* @__PURE__ */
|
|
5098
|
+
/* @__PURE__ */ jsxs24("div", { className: imageSidebarClass, children: [
|
|
5099
|
+
activeTab === "crop" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
5100
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
|
|
5101
|
+
/* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
5102
|
+
/* @__PURE__ */ jsx26(
|
|
5008
5103
|
"button",
|
|
5009
5104
|
{
|
|
5010
5105
|
type: "button",
|
|
@@ -5016,7 +5111,7 @@ var ImageEditor = ({
|
|
|
5016
5111
|
children: "Freeform"
|
|
5017
5112
|
}
|
|
5018
5113
|
),
|
|
5019
|
-
/* @__PURE__ */
|
|
5114
|
+
/* @__PURE__ */ jsx26(
|
|
5020
5115
|
"button",
|
|
5021
5116
|
{
|
|
5022
5117
|
type: "button",
|
|
@@ -5028,7 +5123,7 @@ var ImageEditor = ({
|
|
|
5028
5123
|
children: "1:1 Square"
|
|
5029
5124
|
}
|
|
5030
5125
|
),
|
|
5031
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ jsx26(
|
|
5032
5127
|
"button",
|
|
5033
5128
|
{
|
|
5034
5129
|
type: "button",
|
|
@@ -5040,7 +5135,7 @@ var ImageEditor = ({
|
|
|
5040
5135
|
children: "4:3 Standard"
|
|
5041
5136
|
}
|
|
5042
5137
|
),
|
|
5043
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx26(
|
|
5044
5139
|
"button",
|
|
5045
5140
|
{
|
|
5046
5141
|
type: "button",
|
|
@@ -5052,7 +5147,7 @@ var ImageEditor = ({
|
|
|
5052
5147
|
children: "16:9 Wide"
|
|
5053
5148
|
}
|
|
5054
5149
|
),
|
|
5055
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ jsx26(
|
|
5056
5151
|
"button",
|
|
5057
5152
|
{
|
|
5058
5153
|
type: "button",
|
|
@@ -5064,7 +5159,7 @@ var ImageEditor = ({
|
|
|
5064
5159
|
children: "3:2 Photo"
|
|
5065
5160
|
}
|
|
5066
5161
|
),
|
|
5067
|
-
/* @__PURE__ */
|
|
5162
|
+
/* @__PURE__ */ jsx26(
|
|
5068
5163
|
"button",
|
|
5069
5164
|
{
|
|
5070
5165
|
type: "button",
|
|
@@ -5077,10 +5172,10 @@ var ImageEditor = ({
|
|
|
5077
5172
|
}
|
|
5078
5173
|
)
|
|
5079
5174
|
] }),
|
|
5080
|
-
/* @__PURE__ */
|
|
5081
|
-
/* @__PURE__ */
|
|
5082
|
-
/* @__PURE__ */
|
|
5083
|
-
/* @__PURE__ */
|
|
5175
|
+
/* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
|
|
5176
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
|
|
5177
|
+
/* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
5178
|
+
/* @__PURE__ */ jsx26(
|
|
5084
5179
|
"button",
|
|
5085
5180
|
{
|
|
5086
5181
|
type: "button",
|
|
@@ -5089,7 +5184,7 @@ var ImageEditor = ({
|
|
|
5089
5184
|
children: "Rotate -90\xB0"
|
|
5090
5185
|
}
|
|
5091
5186
|
),
|
|
5092
|
-
/* @__PURE__ */
|
|
5187
|
+
/* @__PURE__ */ jsx26(
|
|
5093
5188
|
"button",
|
|
5094
5189
|
{
|
|
5095
5190
|
type: "button",
|
|
@@ -5098,7 +5193,7 @@ var ImageEditor = ({
|
|
|
5098
5193
|
children: "Rotate +90\xB0"
|
|
5099
5194
|
}
|
|
5100
5195
|
),
|
|
5101
|
-
/* @__PURE__ */
|
|
5196
|
+
/* @__PURE__ */ jsx26(
|
|
5102
5197
|
"button",
|
|
5103
5198
|
{
|
|
5104
5199
|
type: "button",
|
|
@@ -5107,7 +5202,7 @@ var ImageEditor = ({
|
|
|
5107
5202
|
children: "Flip Horizontal"
|
|
5108
5203
|
}
|
|
5109
5204
|
),
|
|
5110
|
-
/* @__PURE__ */
|
|
5205
|
+
/* @__PURE__ */ jsx26(
|
|
5111
5206
|
"button",
|
|
5112
5207
|
{
|
|
5113
5208
|
type: "button",
|
|
@@ -5118,10 +5213,10 @@ var ImageEditor = ({
|
|
|
5118
5213
|
)
|
|
5119
5214
|
] })
|
|
5120
5215
|
] }),
|
|
5121
|
-
activeTab === "adjust" && /* @__PURE__ */
|
|
5122
|
-
/* @__PURE__ */
|
|
5123
|
-
/* @__PURE__ */
|
|
5124
|
-
/* @__PURE__ */
|
|
5216
|
+
activeTab === "adjust" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
5217
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5218
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
|
|
5219
|
+
/* @__PURE__ */ jsx26(
|
|
5125
5220
|
"button",
|
|
5126
5221
|
{
|
|
5127
5222
|
type: "button",
|
|
@@ -5131,9 +5226,9 @@ var ImageEditor = ({
|
|
|
5131
5226
|
}
|
|
5132
5227
|
)
|
|
5133
5228
|
] }),
|
|
5134
|
-
/* @__PURE__ */
|
|
5135
|
-
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */
|
|
5136
|
-
/* @__PURE__ */
|
|
5229
|
+
/* @__PURE__ */ jsx26(Histogram, { histogram: editor.histogram }),
|
|
5230
|
+
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs24(React21.Fragment, { children: [
|
|
5231
|
+
/* @__PURE__ */ jsx26(
|
|
5137
5232
|
ControlSlider,
|
|
5138
5233
|
{
|
|
5139
5234
|
spec,
|
|
@@ -5142,14 +5237,14 @@ var ImageEditor = ({
|
|
|
5142
5237
|
onChange: (v) => editor.setAdjustments({ [spec.id]: v })
|
|
5143
5238
|
}
|
|
5144
5239
|
),
|
|
5145
|
-
spec.id === "tint" && legacyProcess && /* @__PURE__ */
|
|
5240
|
+
spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs24(
|
|
5146
5241
|
"div",
|
|
5147
5242
|
{
|
|
5148
5243
|
className: "flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-600",
|
|
5149
5244
|
"data-testid": "image-editor-process-notice",
|
|
5150
5245
|
children: [
|
|
5151
|
-
/* @__PURE__ */
|
|
5152
|
-
/* @__PURE__ */
|
|
5246
|
+
/* @__PURE__ */ jsx26("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
|
|
5247
|
+
/* @__PURE__ */ jsx26(
|
|
5153
5248
|
"button",
|
|
5154
5249
|
{
|
|
5155
5250
|
type: "button",
|
|
@@ -5162,7 +5257,7 @@ var ImageEditor = ({
|
|
|
5162
5257
|
}
|
|
5163
5258
|
)
|
|
5164
5259
|
] }, spec.id)),
|
|
5165
|
-
/* @__PURE__ */
|
|
5260
|
+
/* @__PURE__ */ jsx26("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx26(
|
|
5166
5261
|
AdjustmentLayersPanel,
|
|
5167
5262
|
{
|
|
5168
5263
|
controller,
|
|
@@ -5171,9 +5266,9 @@ var ImageEditor = ({
|
|
|
5171
5266
|
}
|
|
5172
5267
|
) })
|
|
5173
5268
|
] }),
|
|
5174
|
-
activeTab === "layers" && /* @__PURE__ */
|
|
5175
|
-
/* @__PURE__ */
|
|
5176
|
-
/* @__PURE__ */
|
|
5269
|
+
activeTab === "layers" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
5270
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Layers" }),
|
|
5271
|
+
/* @__PURE__ */ jsx26(
|
|
5177
5272
|
"button",
|
|
5178
5273
|
{
|
|
5179
5274
|
type: "button",
|
|
@@ -5184,15 +5279,15 @@ var ImageEditor = ({
|
|
|
5184
5279
|
children: "Free Transform"
|
|
5185
5280
|
}
|
|
5186
5281
|
),
|
|
5187
|
-
/* @__PURE__ */
|
|
5188
|
-
effectsShown && /* @__PURE__ */
|
|
5189
|
-
/* @__PURE__ */
|
|
5190
|
-
/* @__PURE__ */
|
|
5282
|
+
/* @__PURE__ */ jsx26(LayersPanel, { controller }),
|
|
5283
|
+
effectsShown && /* @__PURE__ */ jsx26(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
|
|
5284
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Colour" }),
|
|
5285
|
+
/* @__PURE__ */ jsx26(ColorProfilePanel, { controller })
|
|
5191
5286
|
] }),
|
|
5192
|
-
activeTab === "paint" && /* @__PURE__ */
|
|
5193
|
-
/* @__PURE__ */
|
|
5194
|
-
/* @__PURE__ */
|
|
5195
|
-
/* @__PURE__ */
|
|
5287
|
+
activeTab === "paint" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
5288
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Paint" }),
|
|
5289
|
+
/* @__PURE__ */ jsx26(BrushOptionsBar, { controller }),
|
|
5290
|
+
/* @__PURE__ */ jsx26(
|
|
5196
5291
|
"button",
|
|
5197
5292
|
{
|
|
5198
5293
|
type: "button",
|
|
@@ -5203,12 +5298,12 @@ var ImageEditor = ({
|
|
|
5203
5298
|
children: "Free Transform"
|
|
5204
5299
|
}
|
|
5205
5300
|
),
|
|
5206
|
-
paintError && /* @__PURE__ */
|
|
5207
|
-
/* @__PURE__ */
|
|
5301
|
+
paintError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
|
|
5302
|
+
/* @__PURE__ */ jsx26("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx26(LayersPanel, { controller }) })
|
|
5208
5303
|
] }),
|
|
5209
|
-
activeTab === "annotate" && /* @__PURE__ */
|
|
5210
|
-
/* @__PURE__ */
|
|
5211
|
-
/* @__PURE__ */
|
|
5304
|
+
activeTab === "annotate" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
5305
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Shape & Type Layers, Paths" }),
|
|
5306
|
+
/* @__PURE__ */ jsx26("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type", "path-pen", "path-select", "direct-select"].map((t) => /* @__PURE__ */ jsx26(
|
|
5212
5307
|
"button",
|
|
5213
5308
|
{
|
|
5214
5309
|
type: "button",
|
|
@@ -5219,13 +5314,13 @@ var ImageEditor = ({
|
|
|
5219
5314
|
},
|
|
5220
5315
|
t
|
|
5221
5316
|
)) }),
|
|
5222
|
-
state.activeTool === "shape" && /* @__PURE__ */
|
|
5223
|
-
state.activeTool === "type" && /* @__PURE__ */
|
|
5224
|
-
state.activeTool === "type" && typeSession && /* @__PURE__ */
|
|
5225
|
-
shapeTypeError && /* @__PURE__ */
|
|
5226
|
-
/* @__PURE__ */
|
|
5227
|
-
/* @__PURE__ */
|
|
5228
|
-
/* @__PURE__ */
|
|
5317
|
+
state.activeTool === "shape" && /* @__PURE__ */ jsx26(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
|
|
5318
|
+
state.activeTool === "type" && /* @__PURE__ */ jsx26(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
|
|
5319
|
+
state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx26("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
|
|
5320
|
+
shapeTypeError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
|
|
5321
|
+
/* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
|
|
5322
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
|
|
5323
|
+
/* @__PURE__ */ jsx26("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx26(
|
|
5229
5324
|
"button",
|
|
5230
5325
|
{
|
|
5231
5326
|
type: "button",
|
|
@@ -5235,18 +5330,18 @@ var ImageEditor = ({
|
|
|
5235
5330
|
},
|
|
5236
5331
|
t
|
|
5237
5332
|
)) }),
|
|
5238
|
-
/* @__PURE__ */
|
|
5239
|
-
/* @__PURE__ */
|
|
5240
|
-
/* @__PURE__ */
|
|
5241
|
-
/* @__PURE__ */
|
|
5242
|
-
/* @__PURE__ */
|
|
5243
|
-
/* @__PURE__ */
|
|
5244
|
-
/* @__PURE__ */
|
|
5333
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
5334
|
+
/* @__PURE__ */ jsx26("label", { className: "text-muted-foreground", children: "Color:" }),
|
|
5335
|
+
/* @__PURE__ */ jsx26(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
|
|
5336
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex-1 ml-2", children: [
|
|
5337
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
|
|
5338
|
+
/* @__PURE__ */ jsx26("span", { children: "Width:" }),
|
|
5339
|
+
/* @__PURE__ */ jsxs24("span", { className: "font-mono", children: [
|
|
5245
5340
|
strokeWidth,
|
|
5246
5341
|
"px"
|
|
5247
5342
|
] })
|
|
5248
5343
|
] }),
|
|
5249
|
-
/* @__PURE__ */
|
|
5344
|
+
/* @__PURE__ */ jsx26(
|
|
5250
5345
|
"input",
|
|
5251
5346
|
{
|
|
5252
5347
|
type: "range",
|
|
@@ -5259,10 +5354,10 @@ var ImageEditor = ({
|
|
|
5259
5354
|
)
|
|
5260
5355
|
] })
|
|
5261
5356
|
] }),
|
|
5262
|
-
/* @__PURE__ */
|
|
5263
|
-
/* @__PURE__ */
|
|
5264
|
-
/* @__PURE__ */
|
|
5265
|
-
/* @__PURE__ */
|
|
5357
|
+
/* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
|
|
5358
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Add Text" }),
|
|
5359
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
|
|
5360
|
+
/* @__PURE__ */ jsx26(
|
|
5266
5361
|
"input",
|
|
5267
5362
|
{
|
|
5268
5363
|
type: "text",
|
|
@@ -5273,7 +5368,7 @@ var ImageEditor = ({
|
|
|
5273
5368
|
className: "flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary"
|
|
5274
5369
|
}
|
|
5275
5370
|
),
|
|
5276
|
-
/* @__PURE__ */
|
|
5371
|
+
/* @__PURE__ */ jsx26(
|
|
5277
5372
|
"button",
|
|
5278
5373
|
{
|
|
5279
5374
|
type: "button",
|
|
@@ -5283,14 +5378,14 @@ var ImageEditor = ({
|
|
|
5283
5378
|
}
|
|
5284
5379
|
)
|
|
5285
5380
|
] }),
|
|
5286
|
-
/* @__PURE__ */
|
|
5287
|
-
/* @__PURE__ */
|
|
5288
|
-
/* @__PURE__ */
|
|
5381
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between text-muted-foreground", children: [
|
|
5382
|
+
/* @__PURE__ */ jsx26("span", { children: "Font Size:" }),
|
|
5383
|
+
/* @__PURE__ */ jsxs24("span", { className: "font-mono", children: [
|
|
5289
5384
|
fontSize,
|
|
5290
5385
|
"px"
|
|
5291
5386
|
] })
|
|
5292
5387
|
] }),
|
|
5293
|
-
/* @__PURE__ */
|
|
5388
|
+
/* @__PURE__ */ jsx26(
|
|
5294
5389
|
"input",
|
|
5295
5390
|
{
|
|
5296
5391
|
type: "range",
|
|
@@ -5301,14 +5396,14 @@ var ImageEditor = ({
|
|
|
5301
5396
|
className: imageRangeClass
|
|
5302
5397
|
}
|
|
5303
5398
|
),
|
|
5304
|
-
/* @__PURE__ */
|
|
5305
|
-
/* @__PURE__ */
|
|
5306
|
-
/* @__PURE__ */
|
|
5399
|
+
/* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
|
|
5400
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5401
|
+
/* @__PURE__ */ jsxs24("span", { className: "text-muted-foreground", children: [
|
|
5307
5402
|
"Layers (",
|
|
5308
5403
|
state.annotations.length,
|
|
5309
5404
|
")"
|
|
5310
5405
|
] }),
|
|
5311
|
-
state.selectedAnnotationId && /* @__PURE__ */
|
|
5406
|
+
state.selectedAnnotationId && /* @__PURE__ */ jsx26(
|
|
5312
5407
|
"button",
|
|
5313
5408
|
{
|
|
5314
5409
|
type: "button",
|
|
@@ -5317,7 +5412,7 @@ var ImageEditor = ({
|
|
|
5317
5412
|
children: "Delete Selected"
|
|
5318
5413
|
}
|
|
5319
5414
|
),
|
|
5320
|
-
state.annotations.length > 0 && /* @__PURE__ */
|
|
5415
|
+
state.annotations.length > 0 && /* @__PURE__ */ jsx26(
|
|
5321
5416
|
"button",
|
|
5322
5417
|
{
|
|
5323
5418
|
type: "button",
|
|
@@ -5328,10 +5423,10 @@ var ImageEditor = ({
|
|
|
5328
5423
|
)
|
|
5329
5424
|
] })
|
|
5330
5425
|
] }),
|
|
5331
|
-
activeTab === "depth" && /* @__PURE__ */
|
|
5332
|
-
/* @__PURE__ */
|
|
5333
|
-
/* @__PURE__ */
|
|
5334
|
-
/* @__PURE__ */
|
|
5426
|
+
activeTab === "depth" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
5427
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5428
|
+
/* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
|
|
5429
|
+
/* @__PURE__ */ jsx26(
|
|
5335
5430
|
"button",
|
|
5336
5431
|
{
|
|
5337
5432
|
type: "button",
|
|
@@ -5341,8 +5436,8 @@ var ImageEditor = ({
|
|
|
5341
5436
|
}
|
|
5342
5437
|
)
|
|
5343
5438
|
] }),
|
|
5344
|
-
/* @__PURE__ */
|
|
5345
|
-
/* @__PURE__ */
|
|
5439
|
+
/* @__PURE__ */ jsxs24("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
|
|
5440
|
+
/* @__PURE__ */ jsx26(
|
|
5346
5441
|
"input",
|
|
5347
5442
|
{
|
|
5348
5443
|
type: "checkbox",
|
|
@@ -5351,12 +5446,12 @@ var ImageEditor = ({
|
|
|
5351
5446
|
className: "rounded accent-primary"
|
|
5352
5447
|
}
|
|
5353
5448
|
),
|
|
5354
|
-
/* @__PURE__ */
|
|
5449
|
+
/* @__PURE__ */ jsx26("span", { children: "Enable Depth / Alpha Mask" })
|
|
5355
5450
|
] }),
|
|
5356
|
-
state.depthMask.enabled && /* @__PURE__ */
|
|
5357
|
-
/* @__PURE__ */
|
|
5358
|
-
/* @__PURE__ */
|
|
5359
|
-
/* @__PURE__ */
|
|
5451
|
+
state.depthMask.enabled && /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5452
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
5453
|
+
/* @__PURE__ */ jsx26("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
|
|
5454
|
+
/* @__PURE__ */ jsx26(
|
|
5360
5455
|
"input",
|
|
5361
5456
|
{
|
|
5362
5457
|
type: "text",
|
|
@@ -5367,8 +5462,8 @@ var ImageEditor = ({
|
|
|
5367
5462
|
}
|
|
5368
5463
|
)
|
|
5369
5464
|
] }),
|
|
5370
|
-
/* @__PURE__ */
|
|
5371
|
-
/* @__PURE__ */
|
|
5465
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
|
|
5466
|
+
/* @__PURE__ */ jsx26(
|
|
5372
5467
|
"button",
|
|
5373
5468
|
{
|
|
5374
5469
|
type: "button",
|
|
@@ -5377,7 +5472,7 @@ var ImageEditor = ({
|
|
|
5377
5472
|
children: "Threshold Mode"
|
|
5378
5473
|
}
|
|
5379
5474
|
),
|
|
5380
|
-
/* @__PURE__ */
|
|
5475
|
+
/* @__PURE__ */ jsx26(
|
|
5381
5476
|
"button",
|
|
5382
5477
|
{
|
|
5383
5478
|
type: "button",
|
|
@@ -5387,12 +5482,12 @@ var ImageEditor = ({
|
|
|
5387
5482
|
}
|
|
5388
5483
|
)
|
|
5389
5484
|
] }),
|
|
5390
|
-
/* @__PURE__ */
|
|
5391
|
-
/* @__PURE__ */
|
|
5392
|
-
/* @__PURE__ */
|
|
5393
|
-
/* @__PURE__ */
|
|
5485
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
5486
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
5487
|
+
/* @__PURE__ */ jsx26("span", { children: "Depth Start (Lower):" }),
|
|
5488
|
+
/* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
|
|
5394
5489
|
] }),
|
|
5395
|
-
/* @__PURE__ */
|
|
5490
|
+
/* @__PURE__ */ jsx26(
|
|
5396
5491
|
"input",
|
|
5397
5492
|
{
|
|
5398
5493
|
type: "range",
|
|
@@ -5406,12 +5501,12 @@ var ImageEditor = ({
|
|
|
5406
5501
|
}
|
|
5407
5502
|
)
|
|
5408
5503
|
] }),
|
|
5409
|
-
/* @__PURE__ */
|
|
5410
|
-
/* @__PURE__ */
|
|
5411
|
-
/* @__PURE__ */
|
|
5412
|
-
/* @__PURE__ */
|
|
5504
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
5505
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
5506
|
+
/* @__PURE__ */ jsx26("span", { children: "Depth Stop (Upper):" }),
|
|
5507
|
+
/* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
|
|
5413
5508
|
] }),
|
|
5414
|
-
/* @__PURE__ */
|
|
5509
|
+
/* @__PURE__ */ jsx26(
|
|
5415
5510
|
"input",
|
|
5416
5511
|
{
|
|
5417
5512
|
type: "range",
|
|
@@ -5425,12 +5520,12 @@ var ImageEditor = ({
|
|
|
5425
5520
|
}
|
|
5426
5521
|
)
|
|
5427
5522
|
] }),
|
|
5428
|
-
/* @__PURE__ */
|
|
5429
|
-
/* @__PURE__ */
|
|
5430
|
-
/* @__PURE__ */
|
|
5431
|
-
/* @__PURE__ */
|
|
5523
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
5524
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
5525
|
+
/* @__PURE__ */ jsx26("span", { children: "Softness:" }),
|
|
5526
|
+
/* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.softness })
|
|
5432
5527
|
] }),
|
|
5433
|
-
/* @__PURE__ */
|
|
5528
|
+
/* @__PURE__ */ jsx26(
|
|
5434
5529
|
"input",
|
|
5435
5530
|
{
|
|
5436
5531
|
type: "range",
|
|
@@ -5442,8 +5537,8 @@ var ImageEditor = ({
|
|
|
5442
5537
|
}
|
|
5443
5538
|
)
|
|
5444
5539
|
] }),
|
|
5445
|
-
/* @__PURE__ */
|
|
5446
|
-
/* @__PURE__ */
|
|
5540
|
+
/* @__PURE__ */ jsxs24("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
|
|
5541
|
+
/* @__PURE__ */ jsx26(
|
|
5447
5542
|
"input",
|
|
5448
5543
|
{
|
|
5449
5544
|
type: "checkbox",
|
|
@@ -5452,12 +5547,12 @@ var ImageEditor = ({
|
|
|
5452
5547
|
className: "rounded accent-primary"
|
|
5453
5548
|
}
|
|
5454
5549
|
),
|
|
5455
|
-
/* @__PURE__ */
|
|
5550
|
+
/* @__PURE__ */ jsx26("span", { children: "Invert Mask" })
|
|
5456
5551
|
] })
|
|
5457
5552
|
] })
|
|
5458
5553
|
] }),
|
|
5459
|
-
activeTab === "select" && /* @__PURE__ */
|
|
5460
|
-
/* @__PURE__ */
|
|
5554
|
+
activeTab === "select" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
5555
|
+
/* @__PURE__ */ jsx26(
|
|
5461
5556
|
SelectionOptionsBar,
|
|
5462
5557
|
{
|
|
5463
5558
|
controller,
|
|
@@ -5468,9 +5563,9 @@ var ImageEditor = ({
|
|
|
5468
5563
|
selectionDisplay: state.selectionDisplay
|
|
5469
5564
|
}
|
|
5470
5565
|
),
|
|
5471
|
-
selectionError && /* @__PURE__ */
|
|
5472
|
-
/* @__PURE__ */
|
|
5473
|
-
/* @__PURE__ */
|
|
5566
|
+
selectionError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", children: selectionError }),
|
|
5567
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex gap-1", children: [
|
|
5568
|
+
/* @__PURE__ */ jsx26(
|
|
5474
5569
|
"button",
|
|
5475
5570
|
{
|
|
5476
5571
|
type: "button",
|
|
@@ -5481,7 +5576,7 @@ var ImageEditor = ({
|
|
|
5481
5576
|
children: "Transform Selection"
|
|
5482
5577
|
}
|
|
5483
5578
|
),
|
|
5484
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ jsx26(
|
|
5485
5580
|
"button",
|
|
5486
5581
|
{
|
|
5487
5582
|
type: "button",
|
|
@@ -5493,14 +5588,14 @@ var ImageEditor = ({
|
|
|
5493
5588
|
}
|
|
5494
5589
|
)
|
|
5495
5590
|
] }),
|
|
5496
|
-
/* @__PURE__ */
|
|
5497
|
-
/* @__PURE__ */
|
|
5498
|
-
/* @__PURE__ */
|
|
5591
|
+
/* @__PURE__ */ jsx26(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
|
|
5592
|
+
/* @__PURE__ */ jsx26(ChannelsPanel, { controller }),
|
|
5593
|
+
/* @__PURE__ */ jsx26(PathsPanel, { controller })
|
|
5499
5594
|
] }),
|
|
5500
|
-
activeTab === "ai" && /* @__PURE__ */
|
|
5501
|
-
/* @__PURE__ */
|
|
5502
|
-
/* @__PURE__ */
|
|
5503
|
-
/* @__PURE__ */
|
|
5595
|
+
activeTab === "ai" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
5596
|
+
/* @__PURE__ */ jsxs24("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
|
|
5597
|
+
/* @__PURE__ */ jsx26("span", { children: "Results go to" }),
|
|
5598
|
+
/* @__PURE__ */ jsxs24(
|
|
5504
5599
|
"select",
|
|
5505
5600
|
{
|
|
5506
5601
|
"aria-label": "AI result target",
|
|
@@ -5508,54 +5603,54 @@ var ImageEditor = ({
|
|
|
5508
5603
|
onChange: (e) => setAiTarget(e.target.value),
|
|
5509
5604
|
className: imageSelectClass,
|
|
5510
5605
|
children: [
|
|
5511
|
-
/* @__PURE__ */
|
|
5512
|
-
/* @__PURE__ */
|
|
5513
|
-
/* @__PURE__ */
|
|
5606
|
+
/* @__PURE__ */ jsx26("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
|
|
5607
|
+
/* @__PURE__ */ jsx26("option", { value: "new-layer", children: "New layer / mask" }),
|
|
5608
|
+
/* @__PURE__ */ jsx26("option", { value: "replace", children: "Replace image" })
|
|
5514
5609
|
]
|
|
5515
5610
|
}
|
|
5516
5611
|
)
|
|
5517
5612
|
] }),
|
|
5518
|
-
/* @__PURE__ */
|
|
5519
|
-
/* @__PURE__ */
|
|
5520
|
-
/* @__PURE__ */
|
|
5521
|
-
/* @__PURE__ */
|
|
5613
|
+
/* @__PURE__ */ jsxs24("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
|
|
5614
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5615
|
+
/* @__PURE__ */ jsxs24("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
5616
|
+
/* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
|
|
5522
5617
|
"Background Removal"
|
|
5523
5618
|
] }),
|
|
5524
|
-
isRemovingBg && /* @__PURE__ */
|
|
5619
|
+
isRemovingBg && /* @__PURE__ */ jsx26("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
|
|
5525
5620
|
] }),
|
|
5526
|
-
/* @__PURE__ */
|
|
5527
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx26("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
|
|
5622
|
+
/* @__PURE__ */ jsx26(
|
|
5528
5623
|
"button",
|
|
5529
5624
|
{
|
|
5530
5625
|
type: "button",
|
|
5531
5626
|
onClick: handleRemoveBackground,
|
|
5532
5627
|
disabled: isRemovingBg || isInpainting,
|
|
5533
5628
|
className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
5534
|
-
children: isRemovingBg ? /* @__PURE__ */
|
|
5535
|
-
/* @__PURE__ */
|
|
5629
|
+
children: isRemovingBg ? /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5630
|
+
/* @__PURE__ */ jsx26("div", { className: imageSpinnerClass }),
|
|
5536
5631
|
"Removing Background..."
|
|
5537
|
-
] }) : /* @__PURE__ */
|
|
5538
|
-
/* @__PURE__ */
|
|
5632
|
+
] }) : /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5633
|
+
/* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
|
|
5539
5634
|
"Remove Background"
|
|
5540
5635
|
] })
|
|
5541
5636
|
}
|
|
5542
5637
|
)
|
|
5543
5638
|
] }),
|
|
5544
|
-
/* @__PURE__ */
|
|
5545
|
-
/* @__PURE__ */
|
|
5546
|
-
/* @__PURE__ */
|
|
5547
|
-
/* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5549
|
-
/* @__PURE__ */
|
|
5639
|
+
/* @__PURE__ */ jsxs24("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
|
|
5640
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
|
|
5641
|
+
/* @__PURE__ */ jsxs24("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
5642
|
+
/* @__PURE__ */ jsxs24("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
5643
|
+
/* @__PURE__ */ jsx26("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
|
|
5644
|
+
/* @__PURE__ */ jsx26("path", { d: "m14 7 3 3" })
|
|
5550
5645
|
] }),
|
|
5551
5646
|
"Generative Inpainting"
|
|
5552
5647
|
] }),
|
|
5553
|
-
isInpainting && /* @__PURE__ */
|
|
5648
|
+
isInpainting && /* @__PURE__ */ jsx26("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
|
|
5554
5649
|
] }),
|
|
5555
|
-
/* @__PURE__ */
|
|
5556
|
-
/* @__PURE__ */
|
|
5557
|
-
/* @__PURE__ */
|
|
5558
|
-
/* @__PURE__ */
|
|
5650
|
+
/* @__PURE__ */ jsx26("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
|
|
5651
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
|
|
5652
|
+
/* @__PURE__ */ jsx26("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
|
|
5653
|
+
/* @__PURE__ */ jsx26(
|
|
5559
5654
|
"textarea",
|
|
5560
5655
|
{
|
|
5561
5656
|
id: "ai-inpaint-prompt-react",
|
|
@@ -5567,10 +5662,10 @@ var ImageEditor = ({
|
|
|
5567
5662
|
}
|
|
5568
5663
|
)
|
|
5569
5664
|
] }),
|
|
5570
|
-
/* @__PURE__ */
|
|
5571
|
-
/* @__PURE__ */
|
|
5572
|
-
/* @__PURE__ */
|
|
5573
|
-
/* @__PURE__ */
|
|
5665
|
+
/* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
|
|
5666
|
+
/* @__PURE__ */ jsx26("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
|
|
5667
|
+
/* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-2 gap-1.5", children: [
|
|
5668
|
+
/* @__PURE__ */ jsxs24(
|
|
5574
5669
|
"button",
|
|
5575
5670
|
{
|
|
5576
5671
|
type: "button",
|
|
@@ -5583,7 +5678,7 @@ var ImageEditor = ({
|
|
|
5583
5678
|
]
|
|
5584
5679
|
}
|
|
5585
5680
|
),
|
|
5586
|
-
/* @__PURE__ */
|
|
5681
|
+
/* @__PURE__ */ jsxs24(
|
|
5587
5682
|
"button",
|
|
5588
5683
|
{
|
|
5589
5684
|
type: "button",
|
|
@@ -5598,25 +5693,25 @@ var ImageEditor = ({
|
|
|
5598
5693
|
)
|
|
5599
5694
|
] })
|
|
5600
5695
|
] }),
|
|
5601
|
-
/* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsx26(
|
|
5602
5697
|
"button",
|
|
5603
5698
|
{
|
|
5604
5699
|
type: "button",
|
|
5605
5700
|
onClick: handleInpaint,
|
|
5606
5701
|
disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
|
|
5607
5702
|
className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
5608
|
-
children: isInpainting ? /* @__PURE__ */
|
|
5609
|
-
/* @__PURE__ */
|
|
5703
|
+
children: isInpainting ? /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5704
|
+
/* @__PURE__ */ jsx26("div", { className: imageSpinnerClass }),
|
|
5610
5705
|
"Generating Inpaint..."
|
|
5611
|
-
] }) : /* @__PURE__ */
|
|
5612
|
-
/* @__PURE__ */
|
|
5706
|
+
] }) : /* @__PURE__ */ jsxs24(Fragment7, { children: [
|
|
5707
|
+
/* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
|
|
5613
5708
|
"Apply Inpainting"
|
|
5614
5709
|
] })
|
|
5615
5710
|
}
|
|
5616
5711
|
)
|
|
5617
5712
|
] }),
|
|
5618
|
-
aiError && /* @__PURE__ */
|
|
5619
|
-
aiSuccess && /* @__PURE__ */
|
|
5713
|
+
aiError && /* @__PURE__ */ jsx26("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
|
|
5714
|
+
aiSuccess && /* @__PURE__ */ jsx26("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
|
|
5620
5715
|
] })
|
|
5621
5716
|
] })
|
|
5622
5717
|
] })
|
|
@@ -5641,6 +5736,7 @@ export {
|
|
|
5641
5736
|
CurvesEditor,
|
|
5642
5737
|
AdjustmentLayersPanel,
|
|
5643
5738
|
LayerEffectsPanel,
|
|
5739
|
+
EdgeColorPanel,
|
|
5644
5740
|
LayersPanel,
|
|
5645
5741
|
ImageEffectControls,
|
|
5646
5742
|
ImageProviderEffectsPanel,
|