@pixerate/editor-react 0.72.0 → 0.73.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-YAFNCBDA.js → chunk-VNZKHFEM.js} +472 -377
- package/dist/chunk-VNZKHFEM.js.map +1 -0
- package/dist/image-editor/index.cjs +535 -440
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +12 -1
- package/dist/image-editor/index.d.ts +12 -1
- package/dist/image-editor/index.js +3 -1
- package/dist/index.cjs +964 -869
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/vector/index.cjs +910 -175
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +67 -3
- package/dist/vector/index.d.ts +67 -3
- package/dist/vector/index.js +915 -164
- package/dist/vector/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-YAFNCBDA.js.map +0 -1
|
@@ -159,7 +159,7 @@ function useImageEditor(options = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// src/image-editor/ImageEditor.tsx
|
|
162
|
-
import
|
|
162
|
+
import React13, { useRef as useRef5, useEffect as useEffect11, useState as useState14, useCallback as useCallback2 } from "react";
|
|
163
163
|
import {
|
|
164
164
|
canvasToImagePoint,
|
|
165
165
|
hitTestCrop,
|
|
@@ -823,6 +823,7 @@ var LayerEffectsPanel = ({ controller, layerId, className }) => {
|
|
|
823
823
|
|
|
824
824
|
// src/image-editor/LayersPanel.tsx
|
|
825
825
|
import {
|
|
826
|
+
BIT_DEPTH_OPTIONS,
|
|
826
827
|
BLEND_MODES as BLEND_MODES2,
|
|
827
828
|
PSD_FILE_ACCEPT,
|
|
828
829
|
downloadPsd,
|
|
@@ -949,6 +950,17 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
|
|
|
949
950
|
children: "\u22EF"
|
|
950
951
|
}
|
|
951
952
|
),
|
|
953
|
+
/* @__PURE__ */ jsx6(
|
|
954
|
+
"select",
|
|
955
|
+
{
|
|
956
|
+
"aria-label": "Bits per channel",
|
|
957
|
+
title: "Image \u203A Mode: bits per channel",
|
|
958
|
+
className: "rounded bg-slate-800 px-1 py-0.5 text-[11px] text-slate-200",
|
|
959
|
+
value: controller.bitDepth,
|
|
960
|
+
onChange: (e) => attempt(() => controller.setBitDepth(Number(e.target.value))),
|
|
961
|
+
children: BIT_DEPTH_OPTIONS.map((o) => /* @__PURE__ */ jsx6("option", { value: o.depth, title: o.title, children: o.label }, o.depth))
|
|
962
|
+
}
|
|
963
|
+
),
|
|
952
964
|
psd && /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
953
965
|
/* @__PURE__ */ jsx6("button", { type: "button", className: iconButton, onClick: () => fileInput.current?.click(), children: "Open PSD\u2026" }),
|
|
954
966
|
/* @__PURE__ */ jsx6("button", { type: "button", className: iconButton, onClick: () => psdTask(async () => (await downloadPsd(controller, psdFileName)).warnings), children: "Export PSD" }),
|
|
@@ -1463,15 +1475,95 @@ var BrushOptionsBar = ({ controller, className }) => {
|
|
|
1463
1475
|
] });
|
|
1464
1476
|
};
|
|
1465
1477
|
|
|
1478
|
+
// src/image-editor/ColorProfilePanel.tsx
|
|
1479
|
+
import { useEffect as useEffect7, useState as useState8 } from "react";
|
|
1480
|
+
import { INTENT_OPTIONS, PROOF_PROFILE_OPTIONS, WORKING_SPACE_OPTIONS, colorPanelView } from "@pixerate/editor/image-editor";
|
|
1481
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1482
|
+
var chip2 = "px-2 py-1 rounded text-[11px] bg-slate-800 text-slate-300 hover:text-white";
|
|
1483
|
+
var select = "rounded bg-slate-800 px-1 py-0.5 text-[11px] text-slate-200";
|
|
1484
|
+
var ColorProfilePanel = ({ controller, className }) => {
|
|
1485
|
+
const [, setTick] = useState8(0);
|
|
1486
|
+
useEffect7(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
1487
|
+
const [target, setTarget] = useState8("display-p3");
|
|
1488
|
+
const [intent, setIntent] = useState8("relative");
|
|
1489
|
+
const [bpc, setBpc] = useState8(true);
|
|
1490
|
+
const [error, setError] = useState8(null);
|
|
1491
|
+
const view = colorPanelView(controller);
|
|
1492
|
+
const attempt = (fn) => {
|
|
1493
|
+
try {
|
|
1494
|
+
setError(null);
|
|
1495
|
+
fn();
|
|
1496
|
+
} catch (err) {
|
|
1497
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
const proofWith = (patch) => {
|
|
1501
|
+
const cur = view.proof;
|
|
1502
|
+
const id = patch.id ?? cur?.id ?? "coated-cmyk";
|
|
1503
|
+
attempt(
|
|
1504
|
+
() => controller.setProofSetup({
|
|
1505
|
+
profile: id,
|
|
1506
|
+
intent: patch.intent ?? cur?.intent ?? "relative",
|
|
1507
|
+
simulatePaper: patch.simulatePaper ?? cur?.simulatePaper ?? false,
|
|
1508
|
+
gamutWarning: patch.gamutWarning ?? cur?.gamutWarning ?? false
|
|
1509
|
+
})
|
|
1510
|
+
);
|
|
1511
|
+
};
|
|
1512
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col gap-2 text-xs text-slate-200 ${className ?? ""}`, "data-testid": "color-profile-panel", children: [
|
|
1513
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center gap-2", children: [
|
|
1514
|
+
/* @__PURE__ */ jsx8("span", { className: "text-slate-400", children: "Profile" }),
|
|
1515
|
+
/* @__PURE__ */ jsx8("span", { "data-testid": "color-profile-name", children: view.profileName })
|
|
1516
|
+
] }),
|
|
1517
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Assign or convert", children: [
|
|
1518
|
+
/* @__PURE__ */ jsx8("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx8("option", { value: o.id, children: o.label }, o.id)) }),
|
|
1519
|
+
/* @__PURE__ */ jsx8("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx8("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
|
|
1520
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1", children: [
|
|
1521
|
+
/* @__PURE__ */ jsx8("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-indigo-500" }),
|
|
1522
|
+
"BPC"
|
|
1523
|
+
] }),
|
|
1524
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: chip2, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
|
|
1525
|
+
/* @__PURE__ */ jsx8("button", { type: "button", className: chip2, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
|
|
1526
|
+
] }),
|
|
1527
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Proof setup", children: [
|
|
1528
|
+
/* @__PURE__ */ jsx8("span", { className: "text-slate-400", children: "Proof" }),
|
|
1529
|
+
/* @__PURE__ */ jsxs8(
|
|
1530
|
+
"select",
|
|
1531
|
+
{
|
|
1532
|
+
"aria-label": "Proof profile",
|
|
1533
|
+
className: select,
|
|
1534
|
+
value: view.proof?.id ?? "",
|
|
1535
|
+
onChange: (e) => e.target.value ? proofWith({ id: e.target.value }) : attempt(() => controller.setProofSetup(null)),
|
|
1536
|
+
children: [
|
|
1537
|
+
/* @__PURE__ */ jsx8("option", { value: "", children: "Off" }),
|
|
1538
|
+
PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx8("option", { value: o.id, children: o.label }, o.id))
|
|
1539
|
+
]
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
view.proof && /* @__PURE__ */ jsxs8(Fragment2, { children: [
|
|
1543
|
+
/* @__PURE__ */ jsx8("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx8("option", { value: o.id, children: o.label }, o.id)) }),
|
|
1544
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1", children: [
|
|
1545
|
+
/* @__PURE__ */ jsx8("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-indigo-500" }),
|
|
1546
|
+
"Paper"
|
|
1547
|
+
] }),
|
|
1548
|
+
/* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1", children: [
|
|
1549
|
+
/* @__PURE__ */ jsx8("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-indigo-500" }),
|
|
1550
|
+
"Gamut warning"
|
|
1551
|
+
] })
|
|
1552
|
+
] })
|
|
1553
|
+
] }),
|
|
1554
|
+
error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-rose-400", children: error })
|
|
1555
|
+
] });
|
|
1556
|
+
};
|
|
1557
|
+
|
|
1466
1558
|
// src/image-editor/SelectionOptionsBar.tsx
|
|
1467
|
-
import { useState as
|
|
1559
|
+
import { useState as useState9 } from "react";
|
|
1468
1560
|
import {
|
|
1469
1561
|
SELECTION_MODES,
|
|
1470
1562
|
SELECTION_MODE_LABELS,
|
|
1471
1563
|
SELECTION_TOOLS,
|
|
1472
1564
|
describeSelection
|
|
1473
1565
|
} from "@pixerate/editor/image-editor";
|
|
1474
|
-
import { jsx as
|
|
1566
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1475
1567
|
var MODIFY_OPS = [
|
|
1476
1568
|
{ op: "grow", label: "Grow" },
|
|
1477
1569
|
{ op: "shrink", label: "Shrink" },
|
|
@@ -1488,20 +1580,20 @@ var SelectionOptionsBar = ({
|
|
|
1488
1580
|
quickMask,
|
|
1489
1581
|
className = ""
|
|
1490
1582
|
}) => {
|
|
1491
|
-
const [radius, setRadius] =
|
|
1583
|
+
const [radius, setRadius] = useState9(2);
|
|
1492
1584
|
const set = (patch) => onOptionsChange({ ...options, ...patch });
|
|
1493
1585
|
const sel = selection === void 0 ? controller.getSelection() : selection;
|
|
1494
1586
|
const qm = quickMask ?? Boolean(controller.getState().quickMask);
|
|
1495
|
-
return /* @__PURE__ */
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
options.tool === "wand" && /* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ jsxs9("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
|
|
1588
|
+
/* @__PURE__ */ jsx9("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx9("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)) }),
|
|
1589
|
+
/* @__PURE__ */ jsx9("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx9("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
|
|
1590
|
+
options.tool === "wand" && /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-2", children: [
|
|
1591
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex flex-col gap-1", children: [
|
|
1592
|
+
/* @__PURE__ */ jsxs9("span", { className: "flex justify-between text-slate-400", children: [
|
|
1593
|
+
/* @__PURE__ */ jsx9("span", { children: "Tolerance" }),
|
|
1594
|
+
/* @__PURE__ */ jsx9("span", { className: "font-mono", children: options.tolerance })
|
|
1503
1595
|
] }),
|
|
1504
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ jsx9(
|
|
1505
1597
|
"input",
|
|
1506
1598
|
{
|
|
1507
1599
|
type: "range",
|
|
@@ -1515,17 +1607,17 @@ var SelectionOptionsBar = ({
|
|
|
1515
1607
|
}
|
|
1516
1608
|
)
|
|
1517
1609
|
] }),
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1610
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2 text-slate-300", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx9("input", { type: "checkbox", checked: options.contiguous, onChange: (e) => set({ contiguous: e.target.checked }) }),
|
|
1520
1612
|
"Contiguous"
|
|
1521
1613
|
] }),
|
|
1522
|
-
/* @__PURE__ */
|
|
1523
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2 text-slate-300", children: [
|
|
1615
|
+
/* @__PURE__ */ jsx9("input", { type: "checkbox", checked: options.sampleMerged, onChange: (e) => set({ sampleMerged: e.target.checked }) }),
|
|
1524
1616
|
"Sample adjusted image"
|
|
1525
1617
|
] }),
|
|
1526
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2 text-slate-300", children: [
|
|
1527
1619
|
"Sample",
|
|
1528
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ jsxs9(
|
|
1529
1621
|
"select",
|
|
1530
1622
|
{
|
|
1531
1623
|
"aria-label": "Sample from",
|
|
@@ -1533,27 +1625,27 @@ var SelectionOptionsBar = ({
|
|
|
1533
1625
|
onChange: (e) => set({ sample: e.target.value }),
|
|
1534
1626
|
className: "bg-slate-800 border border-slate-700 rounded px-1 py-0.5",
|
|
1535
1627
|
children: [
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ jsx9("option", { value: "composite", children: "All layers" }),
|
|
1629
|
+
/* @__PURE__ */ jsx9("option", { value: "active-layer", children: "Active layer" })
|
|
1538
1630
|
]
|
|
1539
1631
|
}
|
|
1540
1632
|
)
|
|
1541
1633
|
] })
|
|
1542
1634
|
] }),
|
|
1543
|
-
/* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1635
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-2 text-slate-300", children: [
|
|
1636
|
+
/* @__PURE__ */ jsx9("input", { type: "checkbox", checked: options.antiAlias, onChange: (e) => set({ antiAlias: e.target.checked }) }),
|
|
1545
1637
|
"Anti-alias"
|
|
1546
1638
|
] }),
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1550
|
-
/* @__PURE__ */
|
|
1551
|
-
/* @__PURE__ */
|
|
1639
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap gap-1", children: [
|
|
1640
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
|
|
1641
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
|
|
1642
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
|
|
1643
|
+
/* @__PURE__ */ jsx9("button", { type: "button", "aria-pressed": qm, className: btn(qm), onClick: () => controller.setQuickMask(!qm), children: "Quick Mask" })
|
|
1552
1644
|
] }),
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1645
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
1646
|
+
/* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1 text-slate-400", children: [
|
|
1555
1647
|
"Radius",
|
|
1556
|
-
/* @__PURE__ */
|
|
1648
|
+
/* @__PURE__ */ jsx9(
|
|
1557
1649
|
"input",
|
|
1558
1650
|
{
|
|
1559
1651
|
type: "number",
|
|
@@ -1567,29 +1659,29 @@ var SelectionOptionsBar = ({
|
|
|
1567
1659
|
}
|
|
1568
1660
|
)
|
|
1569
1661
|
] }),
|
|
1570
|
-
MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */
|
|
1662
|
+
MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx9("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
|
|
1571
1663
|
] }),
|
|
1572
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ jsx9("p", { "data-testid": "selection-status", className: "text-slate-400", children: describeSelection(sel) })
|
|
1573
1665
|
] });
|
|
1574
1666
|
};
|
|
1575
1667
|
|
|
1576
1668
|
// src/image-editor/RefineEdgePanel.tsx
|
|
1577
|
-
import { useState as
|
|
1669
|
+
import { useState as useState10 } from "react";
|
|
1578
1670
|
import {
|
|
1579
1671
|
ADJUSTMENT_KINDS as ADJUSTMENT_KINDS2,
|
|
1580
1672
|
REFINE_EDGE_CONTROLS,
|
|
1581
1673
|
adjustmentKindLabel as adjustmentKindLabel2,
|
|
1582
1674
|
layerMaskFromSelection
|
|
1583
1675
|
} from "@pixerate/editor/image-editor";
|
|
1584
|
-
import { Fragment as
|
|
1676
|
+
import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1585
1677
|
var DEFAULT_PARAMS = { radius: 8, smartRadius: false, smooth: 0, feather: 0, contrast: 0, shiftEdge: 0 };
|
|
1586
1678
|
var button2 = "px-2 py-1 rounded-md border border-slate-800 bg-slate-950 text-[11px] text-slate-200 hover:text-white disabled:opacity-40";
|
|
1587
1679
|
var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
1588
|
-
const [params, setParams] =
|
|
1589
|
-
const [busy, setBusy] =
|
|
1590
|
-
const [error, setError] =
|
|
1591
|
-
const [layerId, setLayerId] =
|
|
1592
|
-
const [newKind, setNewKind] =
|
|
1680
|
+
const [params, setParams] = useState10(DEFAULT_PARAMS);
|
|
1681
|
+
const [busy, setBusy] = useState10(false);
|
|
1682
|
+
const [error, setError] = useState10(null);
|
|
1683
|
+
const [layerId, setLayerId] = useState10("");
|
|
1684
|
+
const [newKind, setNewKind] = useState10("hueSaturation");
|
|
1593
1685
|
const sel = selection === void 0 ? controller.getSelection() : selection;
|
|
1594
1686
|
const list = layers ?? controller.getAdjustmentLayers();
|
|
1595
1687
|
const target = list.find((l) => l.id === layerId) ?? list[list.length - 1];
|
|
@@ -1604,17 +1696,17 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
1604
1696
|
setBusy(false);
|
|
1605
1697
|
}
|
|
1606
1698
|
};
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1611
|
-
/* @__PURE__ */
|
|
1612
|
-
/* @__PURE__ */
|
|
1699
|
+
return /* @__PURE__ */ jsxs10("div", { "data-testid": "refine-edge-panel", className: `flex flex-col gap-3 text-xs ${className}`, children: [
|
|
1700
|
+
/* @__PURE__ */ jsx10("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Refine Edge" }),
|
|
1701
|
+
REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */ jsxs10("label", { className: "flex flex-col gap-1", children: [
|
|
1702
|
+
/* @__PURE__ */ jsxs10("span", { className: "flex justify-between text-slate-400", children: [
|
|
1703
|
+
/* @__PURE__ */ jsx10("span", { children: c.label }),
|
|
1704
|
+
/* @__PURE__ */ jsxs10("span", { className: "font-mono", children: [
|
|
1613
1705
|
params[c.id],
|
|
1614
1706
|
c.unit
|
|
1615
1707
|
] })
|
|
1616
1708
|
] }),
|
|
1617
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ jsx10(
|
|
1618
1710
|
"input",
|
|
1619
1711
|
{
|
|
1620
1712
|
type: "range",
|
|
@@ -1628,28 +1720,28 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
1628
1720
|
}
|
|
1629
1721
|
)
|
|
1630
1722
|
] }, c.id)),
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-2 text-slate-300", children: [
|
|
1724
|
+
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
|
|
1633
1725
|
"Smart Radius"
|
|
1634
1726
|
] }),
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1727
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex gap-1", children: [
|
|
1728
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: button2, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
|
|
1729
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: button2, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
|
|
1638
1730
|
] }),
|
|
1639
|
-
error && /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1731
|
+
error && /* @__PURE__ */ jsx10("p", { role: "alert", className: "text-rose-400", children: error }),
|
|
1732
|
+
/* @__PURE__ */ jsx10("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
|
|
1733
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex gap-1 items-center", children: [
|
|
1734
|
+
/* @__PURE__ */ jsx10(
|
|
1643
1735
|
"select",
|
|
1644
1736
|
{
|
|
1645
1737
|
"aria-label": "New masked layer kind",
|
|
1646
1738
|
value: newKind,
|
|
1647
1739
|
onChange: (e) => setNewKind(e.target.value),
|
|
1648
1740
|
className: "flex-1 bg-slate-950 border border-slate-800 rounded px-1 py-1 text-slate-200",
|
|
1649
|
-
children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */
|
|
1741
|
+
children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx10("option", { value: k.kind, children: k.label }, k.kind))
|
|
1650
1742
|
}
|
|
1651
1743
|
),
|
|
1652
|
-
/* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ jsx10(
|
|
1653
1745
|
"button",
|
|
1654
1746
|
{
|
|
1655
1747
|
type: "button",
|
|
@@ -1660,35 +1752,35 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
1660
1752
|
}
|
|
1661
1753
|
)
|
|
1662
1754
|
] }),
|
|
1663
|
-
list.length > 0 && target && /* @__PURE__ */
|
|
1664
|
-
/* @__PURE__ */
|
|
1755
|
+
list.length > 0 && target && /* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-2", children: [
|
|
1756
|
+
/* @__PURE__ */ jsx10(
|
|
1665
1757
|
"select",
|
|
1666
1758
|
{
|
|
1667
1759
|
"aria-label": "Mask layer",
|
|
1668
1760
|
value: target.id,
|
|
1669
1761
|
onChange: (e) => setLayerId(e.target.value),
|
|
1670
1762
|
className: "bg-slate-950 border border-slate-800 rounded px-1 py-1 text-slate-200",
|
|
1671
|
-
children: list.map((l) => /* @__PURE__ */
|
|
1763
|
+
children: list.map((l) => /* @__PURE__ */ jsxs10("option", { value: l.id, children: [
|
|
1672
1764
|
l.name || adjustmentKindLabel2(l.kind),
|
|
1673
1765
|
l.mask ? " (masked)" : ""
|
|
1674
1766
|
] }, l.id))
|
|
1675
1767
|
}
|
|
1676
1768
|
),
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-wrap gap-1", children: [
|
|
1770
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: button2, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
|
|
1771
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: button2, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
|
|
1772
|
+
/* @__PURE__ */ jsx10("button", { type: "button", className: button2, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
|
|
1681
1773
|
] }),
|
|
1682
|
-
target.mask && /* @__PURE__ */
|
|
1683
|
-
/* @__PURE__ */
|
|
1684
|
-
/* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1774
|
+
target.mask && /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
1775
|
+
/* @__PURE__ */ jsxs10("label", { className: "flex flex-col gap-1", children: [
|
|
1776
|
+
/* @__PURE__ */ jsxs10("span", { className: "flex justify-between text-slate-400", children: [
|
|
1777
|
+
/* @__PURE__ */ jsx10("span", { children: "Density" }),
|
|
1778
|
+
/* @__PURE__ */ jsxs10("span", { className: "font-mono", children: [
|
|
1687
1779
|
Math.round((target.mask.density ?? 1) * 100),
|
|
1688
1780
|
"%"
|
|
1689
1781
|
] })
|
|
1690
1782
|
] }),
|
|
1691
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ jsx10(
|
|
1692
1784
|
"input",
|
|
1693
1785
|
{
|
|
1694
1786
|
type: "range",
|
|
@@ -1702,15 +1794,15 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
1702
1794
|
}
|
|
1703
1795
|
)
|
|
1704
1796
|
] }),
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
/* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
1797
|
+
/* @__PURE__ */ jsxs10("label", { className: "flex flex-col gap-1", children: [
|
|
1798
|
+
/* @__PURE__ */ jsxs10("span", { className: "flex justify-between text-slate-400", children: [
|
|
1799
|
+
/* @__PURE__ */ jsx10("span", { children: "Mask Feather" }),
|
|
1800
|
+
/* @__PURE__ */ jsxs10("span", { className: "font-mono", children: [
|
|
1709
1801
|
target.mask.feather ?? 0,
|
|
1710
1802
|
"px"
|
|
1711
1803
|
] })
|
|
1712
1804
|
] }),
|
|
1713
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ jsx10(
|
|
1714
1806
|
"input",
|
|
1715
1807
|
{
|
|
1716
1808
|
type: "range",
|
|
@@ -1730,14 +1822,14 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
1730
1822
|
};
|
|
1731
1823
|
|
|
1732
1824
|
// src/image-editor/FreeTransformOptionsBar.tsx
|
|
1733
|
-
import { useEffect as
|
|
1825
|
+
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
1734
1826
|
import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
|
|
1735
|
-
import { jsx as
|
|
1736
|
-
var
|
|
1827
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1828
|
+
var chip3 = (on) => `px-2 py-1 rounded text-[11px] ${on ? "bg-indigo-600 text-white" : "bg-slate-800 text-slate-300 hover:text-white"}`;
|
|
1737
1829
|
var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
|
|
1738
1830
|
var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
1739
|
-
const [, setTick] =
|
|
1740
|
-
|
|
1831
|
+
const [, setTick] = useState11(0);
|
|
1832
|
+
useEffect8(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
|
|
1741
1833
|
const bar = tool.bar();
|
|
1742
1834
|
if (!tool.active || !bar) return null;
|
|
1743
1835
|
const warp = tool.warpBar();
|
|
@@ -1749,17 +1841,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
1749
1841
|
const v = Number(raw);
|
|
1750
1842
|
if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
|
|
1751
1843
|
};
|
|
1752
|
-
return /* @__PURE__ */
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
tool.mode === "warp" && /* @__PURE__ */
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
1758
|
-
/* @__PURE__ */
|
|
1844
|
+
return /* @__PURE__ */ jsxs11("div", { className: `flex flex-wrap items-center gap-2 text-xs text-slate-200 ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
|
|
1845
|
+
/* @__PURE__ */ jsx11("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx11("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: chip3(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
|
|
1846
|
+
/* @__PURE__ */ jsx11("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx11("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-slate-700 hover:bg-indigo-500", onClick: () => tool.setReference(a) }, a)) }),
|
|
1847
|
+
tool.mode === "warp" && /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
|
|
1848
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
|
|
1849
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: "Warp" }),
|
|
1850
|
+
/* @__PURE__ */ jsx11("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: "rounded border border-slate-700 bg-slate-900 px-1 py-0.5", children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx11("option", { value: o.id, children: o.label }, o.id)) })
|
|
1759
1851
|
] }),
|
|
1760
|
-
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1852
|
+
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
|
|
1853
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
|
|
1854
|
+
/* @__PURE__ */ jsx11(
|
|
1763
1855
|
"input",
|
|
1764
1856
|
{
|
|
1765
1857
|
type: "number",
|
|
@@ -1780,23 +1872,23 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
1780
1872
|
},
|
|
1781
1873
|
`${k}:${warp[k]}`
|
|
1782
1874
|
),
|
|
1783
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-500", children: "%" })
|
|
1784
1876
|
] }, k)),
|
|
1785
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ jsx11(
|
|
1786
1878
|
"button",
|
|
1787
1879
|
{
|
|
1788
1880
|
type: "button",
|
|
1789
1881
|
title: "Bend along the vertical axis",
|
|
1790
1882
|
"aria-pressed": warp.orientation === "vertical",
|
|
1791
1883
|
disabled: warp.style === "custom",
|
|
1792
|
-
className:
|
|
1884
|
+
className: chip3(warp.orientation === "vertical"),
|
|
1793
1885
|
onClick: () => tool.setWarp({ orientation: warp.orientation === "vertical" ? "horizontal" : "vertical" }),
|
|
1794
1886
|
children: "Vertical"
|
|
1795
1887
|
}
|
|
1796
1888
|
),
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1889
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
|
|
1890
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: "Grid" }),
|
|
1891
|
+
/* @__PURE__ */ jsx11(
|
|
1800
1892
|
"select",
|
|
1801
1893
|
{
|
|
1802
1894
|
"aria-label": "Warp grid",
|
|
@@ -1806,14 +1898,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
1806
1898
|
tool.setWarp({ columns: g.columns, rows: g.rows });
|
|
1807
1899
|
},
|
|
1808
1900
|
className: "rounded border border-slate-700 bg-slate-900 px-1 py-0.5",
|
|
1809
|
-
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */
|
|
1901
|
+
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx11("option", { value: g.id, children: g.label }, g.id))
|
|
1810
1902
|
}
|
|
1811
1903
|
)
|
|
1812
1904
|
] })
|
|
1813
1905
|
] }),
|
|
1814
|
-
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1906
|
+
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", title: f.title, children: [
|
|
1907
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: f.label }),
|
|
1908
|
+
/* @__PURE__ */ jsx11(
|
|
1817
1909
|
"input",
|
|
1818
1910
|
{
|
|
1819
1911
|
type: "number",
|
|
@@ -1833,14 +1925,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
1833
1925
|
},
|
|
1834
1926
|
`${f.id}:${round(bar[f.id], f.unit)}`
|
|
1835
1927
|
),
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
f.id === "scaleX" && /* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-500", children: f.unit }),
|
|
1929
|
+
f.id === "scaleX" && /* @__PURE__ */ jsx11(
|
|
1838
1930
|
"button",
|
|
1839
1931
|
{
|
|
1840
1932
|
type: "button",
|
|
1841
1933
|
"aria-label": "Keep width and height proportional",
|
|
1842
1934
|
"aria-pressed": tool.proportional,
|
|
1843
|
-
className:
|
|
1935
|
+
className: chip3(tool.proportional),
|
|
1844
1936
|
onClick: () => {
|
|
1845
1937
|
tool.proportional = !tool.proportional;
|
|
1846
1938
|
setTick((n) => n + 1);
|
|
@@ -1849,34 +1941,34 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
1849
1941
|
}
|
|
1850
1942
|
)
|
|
1851
1943
|
] }, f.id)),
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
|
|
1945
|
+
/* @__PURE__ */ jsx11("span", { className: "text-slate-400", children: "Interpolation" }),
|
|
1946
|
+
/* @__PURE__ */ jsx11(
|
|
1855
1947
|
"select",
|
|
1856
1948
|
{
|
|
1857
1949
|
"aria-label": "Interpolation",
|
|
1858
1950
|
value: tool.interpolation,
|
|
1859
1951
|
onChange: (e) => tool.setInterpolation(e.target.value),
|
|
1860
1952
|
className: "rounded border border-slate-700 bg-slate-900 px-1 py-0.5",
|
|
1861
|
-
children: INTERPOLATIONS.map((i) => /* @__PURE__ */
|
|
1953
|
+
children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx11("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
|
|
1862
1954
|
}
|
|
1863
1955
|
)
|
|
1864
1956
|
] }),
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
tool.error && /* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsx11("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-emerald-600 text-white hover:bg-emerald-500", onClick: () => tool.commit(), children: "Commit" }),
|
|
1958
|
+
/* @__PURE__ */ jsx11("button", { type: "button", title: "Cancel (Esc)", className: chip3(false), onClick: () => tool.cancel(), children: "Cancel" }),
|
|
1959
|
+
tool.error && /* @__PURE__ */ jsx11("span", { role: "alert", className: "text-rose-400", children: tool.error })
|
|
1868
1960
|
] });
|
|
1869
1961
|
};
|
|
1870
1962
|
|
|
1871
1963
|
// src/image-editor/ShapeOptionsBar.tsx
|
|
1872
|
-
import { useEffect as
|
|
1964
|
+
import { useEffect as useEffect9, useState as useState12 } from "react";
|
|
1873
1965
|
import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
|
|
1874
|
-
import { Fragment as
|
|
1875
|
-
var
|
|
1966
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1967
|
+
var chip4 = (on) => `px-2 py-1 rounded text-[11px] ${on ? "bg-indigo-600 text-white" : "bg-slate-800 text-slate-300 hover:text-white"}`;
|
|
1876
1968
|
var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
1877
|
-
const [, setTick] =
|
|
1878
|
-
|
|
1879
|
-
const [error, setError] =
|
|
1969
|
+
const [, setTick] = useState12(0);
|
|
1970
|
+
useEffect9(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
1971
|
+
const [error, setError] = useState12(null);
|
|
1880
1972
|
const active = controller.getActiveLayer();
|
|
1881
1973
|
const shapeId = active?.type === "shape" ? active.id : null;
|
|
1882
1974
|
const set = (change) => {
|
|
@@ -1890,13 +1982,13 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
1890
1982
|
}
|
|
1891
1983
|
};
|
|
1892
1984
|
const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
|
|
1893
|
-
return /* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ jsxs12("div", { className: `flex flex-col gap-2 text-xs text-slate-200 ${className ?? ""}`, "data-testid": "shape-options", children: [
|
|
1986
|
+
/* @__PURE__ */ jsx12("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx12("button", { type: "button", "aria-pressed": options.kind === k, className: chip4(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
|
|
1987
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
1988
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1989
|
+
/* @__PURE__ */ jsx12("input", { type: "checkbox", "aria-label": "Fill", checked: options.fill !== null, onChange: (e) => set({ fill: e.target.checked ? "#4f46e5" : null }) }),
|
|
1898
1990
|
"Fill",
|
|
1899
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx12(
|
|
1900
1992
|
"input",
|
|
1901
1993
|
{
|
|
1902
1994
|
type: "color",
|
|
@@ -1908,10 +2000,10 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
1908
2000
|
}
|
|
1909
2001
|
)
|
|
1910
2002
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
1912
|
-
/* @__PURE__ */
|
|
2003
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
2004
|
+
/* @__PURE__ */ jsx12("input", { type: "checkbox", "aria-label": "Stroke", checked: options.stroke !== null, onChange: (e) => set({ stroke: e.target.checked ? "#000000" : null }) }),
|
|
1913
2005
|
"Stroke",
|
|
1914
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ jsx12(
|
|
1915
2007
|
"input",
|
|
1916
2008
|
{
|
|
1917
2009
|
type: "color",
|
|
@@ -1923,9 +2015,9 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
1923
2015
|
}
|
|
1924
2016
|
)
|
|
1925
2017
|
] }),
|
|
1926
|
-
/* @__PURE__ */
|
|
2018
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1927
2019
|
"Width",
|
|
1928
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ jsx12(
|
|
1929
2021
|
"input",
|
|
1930
2022
|
{
|
|
1931
2023
|
type: "number",
|
|
@@ -1939,23 +2031,23 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
1939
2031
|
)
|
|
1940
2032
|
] })
|
|
1941
2033
|
] }),
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
options.kind === "rect" && /* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
2035
|
+
options.kind === "rect" && /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1944
2036
|
"Radius",
|
|
1945
|
-
/* @__PURE__ */
|
|
2037
|
+
/* @__PURE__ */ jsx12("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 rounded border border-slate-700 bg-slate-950 px-1 py-0.5" })
|
|
1946
2038
|
] }),
|
|
1947
|
-
options.kind === "polygon" && /* @__PURE__ */
|
|
2039
|
+
options.kind === "polygon" && /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1948
2040
|
"Sides",
|
|
1949
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ jsx12("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 rounded border border-slate-700 bg-slate-950 px-1 py-0.5" })
|
|
1950
2042
|
] }),
|
|
1951
|
-
options.kind === "star" && /* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */
|
|
2043
|
+
options.kind === "star" && /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
2044
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1953
2045
|
"Points",
|
|
1954
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ jsx12("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 rounded border border-slate-700 bg-slate-950 px-1 py-0.5" })
|
|
1955
2047
|
] }),
|
|
1956
|
-
/* @__PURE__ */
|
|
2048
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1957
2049
|
"Inner",
|
|
1958
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsx12(
|
|
1959
2051
|
"input",
|
|
1960
2052
|
{
|
|
1961
2053
|
type: "range",
|
|
@@ -1970,33 +2062,33 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
1970
2062
|
)
|
|
1971
2063
|
] })
|
|
1972
2064
|
] }),
|
|
1973
|
-
options.kind === "line" && /* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
2065
|
+
options.kind === "line" && /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
2066
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
1975
2067
|
"Weight",
|
|
1976
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ jsx12("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 rounded border border-slate-700 bg-slate-950 px-1 py-0.5" })
|
|
1977
2069
|
] }),
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
2070
|
+
/* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
|
|
2071
|
+
/* @__PURE__ */ jsx12("input", { type: "checkbox", "aria-label": "Arrowhead", checked: options.arrow, onChange: (e) => set({ arrow: e.target.checked }) }),
|
|
1980
2072
|
"Arrowhead"
|
|
1981
2073
|
] })
|
|
1982
2074
|
] })
|
|
1983
2075
|
] }),
|
|
1984
|
-
/* @__PURE__ */
|
|
1985
|
-
error && /* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ jsx12("p", { className: "text-[10px] text-slate-500", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
|
|
2077
|
+
error && /* @__PURE__ */ jsx12("p", { role: "alert", className: "text-rose-400", children: error })
|
|
1986
2078
|
] });
|
|
1987
2079
|
};
|
|
1988
2080
|
|
|
1989
2081
|
// src/image-editor/TypeOptionsBar.tsx
|
|
1990
|
-
import { useEffect as
|
|
2082
|
+
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
1991
2083
|
import { TEXT_ALIGNS } from "@pixerate/editor/image-editor";
|
|
1992
|
-
import { jsx as
|
|
1993
|
-
var
|
|
2084
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2085
|
+
var chip5 = (on) => `px-2 py-1 rounded text-[11px] ${on ? "bg-indigo-600 text-white" : "bg-slate-800 text-slate-300 hover:text-white"}`;
|
|
1994
2086
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
1995
2087
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
1996
|
-
const [, setTick] =
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
const [error, setError] =
|
|
2088
|
+
const [, setTick] = useState13(0);
|
|
2089
|
+
useEffect10(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
2090
|
+
useEffect10(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
|
|
2091
|
+
const [error, setError] = useState13(null);
|
|
2000
2092
|
const active = controller.getActiveLayer();
|
|
2001
2093
|
const typeId = !session && active?.type === "type" ? active.id : null;
|
|
2002
2094
|
const here = session?.alive ? session.styleHere() : {};
|
|
@@ -2028,11 +2120,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
2028
2120
|
setError(e instanceof Error ? e.message : String(e));
|
|
2029
2121
|
}
|
|
2030
2122
|
};
|
|
2031
|
-
return /* @__PURE__ */
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ jsxs13("div", { className: `flex flex-col gap-2 text-xs text-slate-200 ${className ?? ""}`, "data-testid": "type-options", children: [
|
|
2124
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2125
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
|
|
2034
2126
|
"Font",
|
|
2035
|
-
/* @__PURE__ */
|
|
2127
|
+
/* @__PURE__ */ jsx13(
|
|
2036
2128
|
"input",
|
|
2037
2129
|
{
|
|
2038
2130
|
list: "pixerate-type-fonts",
|
|
@@ -2042,11 +2134,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
2042
2134
|
className: "w-32 rounded border border-slate-700 bg-slate-950 px-1 py-0.5"
|
|
2043
2135
|
}
|
|
2044
2136
|
),
|
|
2045
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ jsx13("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx13("option", { value: f }, f)) })
|
|
2046
2138
|
] }),
|
|
2047
|
-
/* @__PURE__ */
|
|
2139
|
+
/* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
|
|
2048
2140
|
"Size",
|
|
2049
|
-
/* @__PURE__ */
|
|
2141
|
+
/* @__PURE__ */ jsx13(
|
|
2050
2142
|
"input",
|
|
2051
2143
|
{
|
|
2052
2144
|
type: "number",
|
|
@@ -2059,24 +2151,24 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
2059
2151
|
}
|
|
2060
2152
|
)
|
|
2061
2153
|
] }),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2154
|
+
/* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${chip5(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
|
|
2155
|
+
/* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": shown.italic, className: `${chip5(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
|
|
2156
|
+
/* @__PURE__ */ jsx13("input", { type: "color", "aria-label": "Text colour", value: shown.color, onChange: (e) => style({ color: e.target.value }), className: "h-6 w-8 rounded border border-slate-700 bg-transparent" })
|
|
2065
2157
|
] }),
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
/* @__PURE__ */
|
|
2068
|
-
missing.length > 0 && /* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ jsx13("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": options.align === a, className: chip5(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
2159
|
+
/* @__PURE__ */ jsx13("p", { className: "text-[10px] text-slate-500", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
2160
|
+
missing.length > 0 && /* @__PURE__ */ jsxs13("p", { role: "status", className: "text-amber-400", "data-testid": "type-missing-fonts", children: [
|
|
2069
2161
|
"Missing ",
|
|
2070
2162
|
missing.length === 1 ? "font" : "fonts",
|
|
2071
2163
|
": ",
|
|
2072
2164
|
missing.join(", ")
|
|
2073
2165
|
] }),
|
|
2074
|
-
error && /* @__PURE__ */
|
|
2166
|
+
error && /* @__PURE__ */ jsx13("p", { role: "alert", className: "text-rose-400", children: error })
|
|
2075
2167
|
] });
|
|
2076
2168
|
};
|
|
2077
2169
|
|
|
2078
2170
|
// src/image-editor/ImageEditor.tsx
|
|
2079
|
-
import { Fragment as
|
|
2171
|
+
import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2080
2172
|
var ImageEditor = ({
|
|
2081
2173
|
editor: externalEditor,
|
|
2082
2174
|
src,
|
|
@@ -2094,9 +2186,9 @@ var ImageEditor = ({
|
|
|
2094
2186
|
const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
|
|
2095
2187
|
const canvasRef = useRef5(null);
|
|
2096
2188
|
const containerRef = useRef5(null);
|
|
2097
|
-
const [activeTab, setActiveTab] =
|
|
2098
|
-
const [activeCropRatio, setActiveCropRatio] =
|
|
2099
|
-
const [selectionOptions, setSelectionOptions] =
|
|
2189
|
+
const [activeTab, setActiveTab] = useState14("crop");
|
|
2190
|
+
const [activeCropRatio, setActiveCropRatio] = useState14(null);
|
|
2191
|
+
const [selectionOptions, setSelectionOptions] = useState14(DEFAULT_SELECTION_TOOL_OPTIONS);
|
|
2100
2192
|
const selectionOptionsRef = useRef5(selectionOptions);
|
|
2101
2193
|
selectionOptionsRef.current = selectionOptions;
|
|
2102
2194
|
const selectionGestureRef = useRef5(null);
|
|
@@ -2104,7 +2196,7 @@ var ImageEditor = ({
|
|
|
2104
2196
|
selectionGestureRef.current = new SelectionGesture(controller, () => selectionOptionsRef.current);
|
|
2105
2197
|
}
|
|
2106
2198
|
const selectionDraftRef = useRef5(null);
|
|
2107
|
-
const [selectionError, setSelectionError] =
|
|
2199
|
+
const [selectionError, setSelectionError] = useState14(null);
|
|
2108
2200
|
const paintGestureRef = useRef5(null);
|
|
2109
2201
|
const paintControllerRef = useRef5(controller);
|
|
2110
2202
|
if (!paintGestureRef.current || paintControllerRef.current !== controller) {
|
|
@@ -2112,7 +2204,7 @@ var ImageEditor = ({
|
|
|
2112
2204
|
paintControllerRef.current = controller;
|
|
2113
2205
|
}
|
|
2114
2206
|
const brushCursorRef = useRef5(null);
|
|
2115
|
-
const [paintError, setPaintError] =
|
|
2207
|
+
const [paintError, setPaintError] = useState14(null);
|
|
2116
2208
|
const transformToolRef = useRef5(null);
|
|
2117
2209
|
const transformControllerRef = useRef5(controller);
|
|
2118
2210
|
if (!transformToolRef.current || transformControllerRef.current !== controller) {
|
|
@@ -2123,12 +2215,12 @@ var ImageEditor = ({
|
|
|
2123
2215
|
transformControllerRef.current = controller;
|
|
2124
2216
|
}
|
|
2125
2217
|
const transformTool = transformToolRef.current;
|
|
2126
|
-
const [, setTransformTick] =
|
|
2127
|
-
const [transformCursor, setTransformCursor] =
|
|
2128
|
-
const [shapeOptions, setShapeOptions] =
|
|
2218
|
+
const [, setTransformTick] = useState14(0);
|
|
2219
|
+
const [transformCursor, setTransformCursor] = useState14("default");
|
|
2220
|
+
const [shapeOptions, setShapeOptions] = useState14(DEFAULT_SHAPE_TOOL_OPTIONS);
|
|
2129
2221
|
const shapeOptionsRef = useRef5(shapeOptions);
|
|
2130
2222
|
shapeOptionsRef.current = shapeOptions;
|
|
2131
|
-
const [typeOptions, setTypeOptions] =
|
|
2223
|
+
const [typeOptions, setTypeOptions] = useState14(DEFAULT_TYPE_TOOL_OPTIONS);
|
|
2132
2224
|
const typeOptionsRef = useRef5(typeOptions);
|
|
2133
2225
|
typeOptionsRef.current = typeOptions;
|
|
2134
2226
|
const shapeGestureRef = useRef5(null);
|
|
@@ -2141,15 +2233,15 @@ var ImageEditor = ({
|
|
|
2141
2233
|
shapeTypeControllerRef.current = controller;
|
|
2142
2234
|
}
|
|
2143
2235
|
const typeInputRef = useRef5(null);
|
|
2144
|
-
const [typeSession, setTypeSession] =
|
|
2145
|
-
const [shapeTypeError, setShapeTypeError] =
|
|
2146
|
-
const [inpaintPrompt, setInpaintPrompt] =
|
|
2147
|
-
const [inpaintMaskMode, setInpaintMaskMode] =
|
|
2148
|
-
const [isRemovingBg, setIsRemovingBg] =
|
|
2149
|
-
const [isInpainting, setIsInpainting] =
|
|
2150
|
-
const [aiError, setAiError] =
|
|
2151
|
-
const [aiSuccess, setAiSuccess] =
|
|
2152
|
-
const [aiTarget, setAiTarget] =
|
|
2236
|
+
const [typeSession, setTypeSession] = useState14(typeToolRef.current.session);
|
|
2237
|
+
const [shapeTypeError, setShapeTypeError] = useState14(null);
|
|
2238
|
+
const [inpaintPrompt, setInpaintPrompt] = useState14("");
|
|
2239
|
+
const [inpaintMaskMode, setInpaintMaskMode] = useState14("annotations");
|
|
2240
|
+
const [isRemovingBg, setIsRemovingBg] = useState14(false);
|
|
2241
|
+
const [isInpainting, setIsInpainting] = useState14(false);
|
|
2242
|
+
const [aiError, setAiError] = useState14(null);
|
|
2243
|
+
const [aiSuccess, setAiSuccess] = useState14(null);
|
|
2244
|
+
const [aiTarget, setAiTarget] = useState14("auto");
|
|
2153
2245
|
const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
|
|
2154
2246
|
const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
|
|
2155
2247
|
const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
|
|
@@ -2212,10 +2304,10 @@ var ImageEditor = ({
|
|
|
2212
2304
|
setIsInpainting(false);
|
|
2213
2305
|
}
|
|
2214
2306
|
};
|
|
2215
|
-
const [activeColor, setActiveColor] =
|
|
2216
|
-
const [strokeWidth, setStrokeWidth] =
|
|
2217
|
-
const [fontSize, setFontSize] =
|
|
2218
|
-
const [textInput, setTextInput] =
|
|
2307
|
+
const [activeColor, setActiveColor] = useState14("#ef4444");
|
|
2308
|
+
const [strokeWidth, setStrokeWidth] = useState14(3);
|
|
2309
|
+
const [fontSize, setFontSize] = useState14(24);
|
|
2310
|
+
const [textInput, setTextInput] = useState14("");
|
|
2219
2311
|
const draftAnnotationRef = useRef5(null);
|
|
2220
2312
|
const draftCropRef = useRef5(null);
|
|
2221
2313
|
const cropDragInfoRef = useRef5(null);
|
|
@@ -2246,8 +2338,8 @@ var ImageEditor = ({
|
|
|
2246
2338
|
},
|
|
2247
2339
|
[controller, activeTab, transformTool]
|
|
2248
2340
|
);
|
|
2249
|
-
|
|
2250
|
-
|
|
2341
|
+
useEffect11(() => typeSession?.subscribe(() => void renderCanvas()), [typeSession, renderCanvas]);
|
|
2342
|
+
useEffect11(() => {
|
|
2251
2343
|
if (activeTab === "annotate" && state.activeTool === "type") return;
|
|
2252
2344
|
if (typeToolRef.current?.session) {
|
|
2253
2345
|
typeToolRef.current.finish();
|
|
@@ -2282,7 +2374,7 @@ var ImageEditor = ({
|
|
|
2282
2374
|
el.value = "";
|
|
2283
2375
|
}
|
|
2284
2376
|
};
|
|
2285
|
-
|
|
2377
|
+
useEffect11(() => transformTool.subscribe(() => {
|
|
2286
2378
|
setTransformTick((n) => n + 1);
|
|
2287
2379
|
void renderCanvas();
|
|
2288
2380
|
}), [transformTool, renderCanvas]);
|
|
@@ -2325,7 +2417,7 @@ var ImageEditor = ({
|
|
|
2325
2417
|
transformTool.up();
|
|
2326
2418
|
return true;
|
|
2327
2419
|
};
|
|
2328
|
-
|
|
2420
|
+
useEffect11(() => {
|
|
2329
2421
|
if (typeof window === "undefined") return;
|
|
2330
2422
|
const onKey = (e) => {
|
|
2331
2423
|
if (transformTool.key(e)) e.preventDefault();
|
|
@@ -2333,7 +2425,7 @@ var ImageEditor = ({
|
|
|
2333
2425
|
window.addEventListener("keydown", onKey);
|
|
2334
2426
|
return () => window.removeEventListener("keydown", onKey);
|
|
2335
2427
|
}, [transformTool]);
|
|
2336
|
-
|
|
2428
|
+
useEffect11(() => {
|
|
2337
2429
|
const raf = typeof requestAnimationFrame !== "undefined" ? requestAnimationFrame : (cb) => setTimeout(cb, 0);
|
|
2338
2430
|
const caf = typeof cancelAnimationFrame !== "undefined" ? cancelAnimationFrame : (id) => clearTimeout(id);
|
|
2339
2431
|
const animId = raf(() => {
|
|
@@ -2341,12 +2433,12 @@ var ImageEditor = ({
|
|
|
2341
2433
|
});
|
|
2342
2434
|
return () => caf(animId);
|
|
2343
2435
|
}, [renderCanvas, state]);
|
|
2344
|
-
|
|
2436
|
+
useEffect11(() => {
|
|
2345
2437
|
if (activeTab === "crop" && editor.state.activeTool !== "crop") {
|
|
2346
2438
|
editor.setTool("crop");
|
|
2347
2439
|
}
|
|
2348
2440
|
}, [activeTab, editor]);
|
|
2349
|
-
|
|
2441
|
+
useEffect11(() => {
|
|
2350
2442
|
const container = containerRef.current;
|
|
2351
2443
|
if (!container) return;
|
|
2352
2444
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -2414,7 +2506,7 @@ var ImageEditor = ({
|
|
|
2414
2506
|
if (g.error) setPaintError(g.error);
|
|
2415
2507
|
}
|
|
2416
2508
|
};
|
|
2417
|
-
|
|
2509
|
+
useEffect11(() => {
|
|
2418
2510
|
if (activeTab !== "paint" || typeof window === "undefined") return;
|
|
2419
2511
|
const onKey = (e) => {
|
|
2420
2512
|
if (handlePaintShortcut(controller, e)) e.preventDefault();
|
|
@@ -2809,15 +2901,15 @@ var ImageEditor = ({
|
|
|
2809
2901
|
link.click();
|
|
2810
2902
|
}
|
|
2811
2903
|
};
|
|
2812
|
-
return /* @__PURE__ */
|
|
2904
|
+
return /* @__PURE__ */ jsxs14(
|
|
2813
2905
|
"div",
|
|
2814
2906
|
{
|
|
2815
2907
|
className: `flex flex-col bg-slate-900 border border-slate-800 rounded-xl overflow-hidden shadow-2xl text-slate-100 ${className}`,
|
|
2816
2908
|
style,
|
|
2817
2909
|
children: [
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
/* @__PURE__ */
|
|
2910
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center justify-between px-4 py-3 bg-slate-950/80 border-b border-slate-800 gap-3", children: [
|
|
2911
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1 bg-slate-900 p-1 rounded-lg border border-slate-800 text-xs", children: [
|
|
2912
|
+
/* @__PURE__ */ jsx14(
|
|
2821
2913
|
"button",
|
|
2822
2914
|
{
|
|
2823
2915
|
type: "button",
|
|
@@ -2829,7 +2921,7 @@ var ImageEditor = ({
|
|
|
2829
2921
|
children: "Transform & Crop"
|
|
2830
2922
|
}
|
|
2831
2923
|
),
|
|
2832
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ jsx14(
|
|
2833
2925
|
"button",
|
|
2834
2926
|
{
|
|
2835
2927
|
type: "button",
|
|
@@ -2841,7 +2933,7 @@ var ImageEditor = ({
|
|
|
2841
2933
|
children: "Adjustments"
|
|
2842
2934
|
}
|
|
2843
2935
|
),
|
|
2844
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ jsx14(
|
|
2845
2937
|
"button",
|
|
2846
2938
|
{
|
|
2847
2939
|
type: "button",
|
|
@@ -2853,7 +2945,7 @@ var ImageEditor = ({
|
|
|
2853
2945
|
children: "Layers"
|
|
2854
2946
|
}
|
|
2855
2947
|
),
|
|
2856
|
-
/* @__PURE__ */
|
|
2948
|
+
/* @__PURE__ */ jsx14(
|
|
2857
2949
|
"button",
|
|
2858
2950
|
{
|
|
2859
2951
|
type: "button",
|
|
@@ -2865,7 +2957,7 @@ var ImageEditor = ({
|
|
|
2865
2957
|
children: "Paint"
|
|
2866
2958
|
}
|
|
2867
2959
|
),
|
|
2868
|
-
/* @__PURE__ */
|
|
2960
|
+
/* @__PURE__ */ jsx14(
|
|
2869
2961
|
"button",
|
|
2870
2962
|
{
|
|
2871
2963
|
type: "button",
|
|
@@ -2877,7 +2969,7 @@ var ImageEditor = ({
|
|
|
2877
2969
|
children: "Select & Mask"
|
|
2878
2970
|
}
|
|
2879
2971
|
),
|
|
2880
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ jsx14(
|
|
2881
2973
|
"button",
|
|
2882
2974
|
{
|
|
2883
2975
|
type: "button",
|
|
@@ -2889,7 +2981,7 @@ var ImageEditor = ({
|
|
|
2889
2981
|
children: "Annotations"
|
|
2890
2982
|
}
|
|
2891
2983
|
),
|
|
2892
|
-
/* @__PURE__ */
|
|
2984
|
+
/* @__PURE__ */ jsx14(
|
|
2893
2985
|
"button",
|
|
2894
2986
|
{
|
|
2895
2987
|
type: "button",
|
|
@@ -2901,7 +2993,7 @@ var ImageEditor = ({
|
|
|
2901
2993
|
children: "Depth Mask"
|
|
2902
2994
|
}
|
|
2903
2995
|
),
|
|
2904
|
-
/* @__PURE__ */
|
|
2996
|
+
/* @__PURE__ */ jsxs14(
|
|
2905
2997
|
"button",
|
|
2906
2998
|
{
|
|
2907
2999
|
type: "button",
|
|
@@ -2911,14 +3003,14 @@ var ImageEditor = ({
|
|
|
2911
3003
|
},
|
|
2912
3004
|
className: `px-3 py-1.5 rounded-md font-medium transition-colors flex items-center gap-1.5 ${activeTab === "ai" ? "bg-indigo-600 text-white shadow" : "text-slate-400 hover:text-slate-200"}`,
|
|
2913
3005
|
children: [
|
|
2914
|
-
/* @__PURE__ */
|
|
3006
|
+
/* @__PURE__ */ jsx14("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx14("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" }) }),
|
|
2915
3007
|
"AI Tools"
|
|
2916
3008
|
]
|
|
2917
3009
|
}
|
|
2918
3010
|
)
|
|
2919
3011
|
] }),
|
|
2920
|
-
/* @__PURE__ */
|
|
2921
|
-
/* @__PURE__ */
|
|
3012
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
3013
|
+
/* @__PURE__ */ jsx14(
|
|
2922
3014
|
"button",
|
|
2923
3015
|
{
|
|
2924
3016
|
type: "button",
|
|
@@ -2929,7 +3021,7 @@ var ImageEditor = ({
|
|
|
2929
3021
|
children: "\u21A9"
|
|
2930
3022
|
}
|
|
2931
3023
|
),
|
|
2932
|
-
/* @__PURE__ */
|
|
3024
|
+
/* @__PURE__ */ jsx14(
|
|
2933
3025
|
"button",
|
|
2934
3026
|
{
|
|
2935
3027
|
type: "button",
|
|
@@ -2940,7 +3032,7 @@ var ImageEditor = ({
|
|
|
2940
3032
|
children: "\u21AA"
|
|
2941
3033
|
}
|
|
2942
3034
|
),
|
|
2943
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ jsx14(
|
|
2944
3036
|
"button",
|
|
2945
3037
|
{
|
|
2946
3038
|
type: "button",
|
|
@@ -2949,8 +3041,8 @@ var ImageEditor = ({
|
|
|
2949
3041
|
children: "Reset"
|
|
2950
3042
|
}
|
|
2951
3043
|
),
|
|
2952
|
-
/* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx14("div", { className: "h-4 w-px bg-slate-800 mx-1" }),
|
|
3045
|
+
/* @__PURE__ */ jsx14(
|
|
2954
3046
|
"button",
|
|
2955
3047
|
{
|
|
2956
3048
|
type: "button",
|
|
@@ -2960,11 +3052,11 @@ var ImageEditor = ({
|
|
|
2960
3052
|
children: "-"
|
|
2961
3053
|
}
|
|
2962
3054
|
),
|
|
2963
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono text-slate-400 w-10 text-center", children: [
|
|
2964
3056
|
Math.round(state.zoom * 100),
|
|
2965
3057
|
"%"
|
|
2966
3058
|
] }),
|
|
2967
|
-
/* @__PURE__ */
|
|
3059
|
+
/* @__PURE__ */ jsx14(
|
|
2968
3060
|
"button",
|
|
2969
3061
|
{
|
|
2970
3062
|
type: "button",
|
|
@@ -2974,8 +3066,8 @@ var ImageEditor = ({
|
|
|
2974
3066
|
children: "+"
|
|
2975
3067
|
}
|
|
2976
3068
|
),
|
|
2977
|
-
/* @__PURE__ */
|
|
2978
|
-
/* @__PURE__ */
|
|
3069
|
+
/* @__PURE__ */ jsx14("div", { className: "h-4 w-px bg-slate-800 mx-1" }),
|
|
3070
|
+
/* @__PURE__ */ jsx14(
|
|
2979
3071
|
"button",
|
|
2980
3072
|
{
|
|
2981
3073
|
type: "button",
|
|
@@ -2986,7 +3078,7 @@ var ImageEditor = ({
|
|
|
2986
3078
|
children: "Hold Compare"
|
|
2987
3079
|
}
|
|
2988
3080
|
),
|
|
2989
|
-
/* @__PURE__ */
|
|
3081
|
+
/* @__PURE__ */ jsx14(
|
|
2990
3082
|
"button",
|
|
2991
3083
|
{
|
|
2992
3084
|
type: "button",
|
|
@@ -2997,16 +3089,16 @@ var ImageEditor = ({
|
|
|
2997
3089
|
)
|
|
2998
3090
|
] })
|
|
2999
3091
|
] }),
|
|
3000
|
-
transformTool.active && /* @__PURE__ */
|
|
3001
|
-
!transformTool.active && transformTool.error && /* @__PURE__ */
|
|
3002
|
-
/* @__PURE__ */
|
|
3003
|
-
/* @__PURE__ */
|
|
3092
|
+
transformTool.active && /* @__PURE__ */ jsx14(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-slate-800 bg-slate-900/95 px-4 py-2" }),
|
|
3093
|
+
!transformTool.active && transformTool.error && /* @__PURE__ */ jsx14("div", { role: "alert", className: "border-b border-rose-900 bg-rose-950/80 px-4 py-1.5 text-xs text-rose-200", children: transformTool.error }),
|
|
3094
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
|
|
3095
|
+
/* @__PURE__ */ jsxs14(
|
|
3004
3096
|
"div",
|
|
3005
3097
|
{
|
|
3006
3098
|
ref: containerRef,
|
|
3007
3099
|
className: "relative flex-1 h-[360px] md:h-full min-h-[320px] bg-slate-950 overflow-hidden select-none",
|
|
3008
3100
|
children: [
|
|
3009
|
-
/* @__PURE__ */
|
|
3101
|
+
/* @__PURE__ */ jsx14(
|
|
3010
3102
|
"canvas",
|
|
3011
3103
|
{
|
|
3012
3104
|
ref: canvasRef,
|
|
@@ -3023,7 +3115,7 @@ var ImageEditor = ({
|
|
|
3023
3115
|
className: `absolute inset-0 w-full h-full block ${transformTool.active ? "touch-none" : activeTab === "paint" ? "touch-none cursor-crosshair" : activeTab === "annotate" && state.activeTool === "type" ? "cursor-text" : activeTab === "annotate" && state.activeTool === "shape" ? "cursor-crosshair" : ""}`
|
|
3024
3116
|
}
|
|
3025
3117
|
),
|
|
3026
|
-
typeSession && /* @__PURE__ */
|
|
3118
|
+
typeSession && /* @__PURE__ */ jsx14(
|
|
3027
3119
|
"textarea",
|
|
3028
3120
|
{
|
|
3029
3121
|
ref: typeInputRef,
|
|
@@ -3045,11 +3137,11 @@ var ImageEditor = ({
|
|
|
3045
3137
|
]
|
|
3046
3138
|
}
|
|
3047
3139
|
),
|
|
3048
|
-
/* @__PURE__ */
|
|
3049
|
-
activeTab === "crop" && /* @__PURE__ */
|
|
3050
|
-
/* @__PURE__ */
|
|
3051
|
-
/* @__PURE__ */
|
|
3052
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsxs14("div", { className: "w-full md:w-80 bg-slate-900/90 border-t md:border-t-0 md:border-l border-slate-800 p-4 overflow-y-auto h-auto md:h-full md:max-h-[560px]", children: [
|
|
3141
|
+
activeTab === "crop" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
3142
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Aspect Ratio Presets" }),
|
|
3143
|
+
/* @__PURE__ */ jsxs14("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
3144
|
+
/* @__PURE__ */ jsx14(
|
|
3053
3145
|
"button",
|
|
3054
3146
|
{
|
|
3055
3147
|
type: "button",
|
|
@@ -3061,7 +3153,7 @@ var ImageEditor = ({
|
|
|
3061
3153
|
children: "Freeform"
|
|
3062
3154
|
}
|
|
3063
3155
|
),
|
|
3064
|
-
/* @__PURE__ */
|
|
3156
|
+
/* @__PURE__ */ jsx14(
|
|
3065
3157
|
"button",
|
|
3066
3158
|
{
|
|
3067
3159
|
type: "button",
|
|
@@ -3073,7 +3165,7 @@ var ImageEditor = ({
|
|
|
3073
3165
|
children: "1:1 Square"
|
|
3074
3166
|
}
|
|
3075
3167
|
),
|
|
3076
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsx14(
|
|
3077
3169
|
"button",
|
|
3078
3170
|
{
|
|
3079
3171
|
type: "button",
|
|
@@ -3085,7 +3177,7 @@ var ImageEditor = ({
|
|
|
3085
3177
|
children: "4:3 Standard"
|
|
3086
3178
|
}
|
|
3087
3179
|
),
|
|
3088
|
-
/* @__PURE__ */
|
|
3180
|
+
/* @__PURE__ */ jsx14(
|
|
3089
3181
|
"button",
|
|
3090
3182
|
{
|
|
3091
3183
|
type: "button",
|
|
@@ -3097,7 +3189,7 @@ var ImageEditor = ({
|
|
|
3097
3189
|
children: "16:9 Wide"
|
|
3098
3190
|
}
|
|
3099
3191
|
),
|
|
3100
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ jsx14(
|
|
3101
3193
|
"button",
|
|
3102
3194
|
{
|
|
3103
3195
|
type: "button",
|
|
@@ -3109,7 +3201,7 @@ var ImageEditor = ({
|
|
|
3109
3201
|
children: "3:2 Photo"
|
|
3110
3202
|
}
|
|
3111
3203
|
),
|
|
3112
|
-
/* @__PURE__ */
|
|
3204
|
+
/* @__PURE__ */ jsx14(
|
|
3113
3205
|
"button",
|
|
3114
3206
|
{
|
|
3115
3207
|
type: "button",
|
|
@@ -3122,10 +3214,10 @@ var ImageEditor = ({
|
|
|
3122
3214
|
}
|
|
3123
3215
|
)
|
|
3124
3216
|
] }),
|
|
3125
|
-
/* @__PURE__ */
|
|
3126
|
-
/* @__PURE__ */
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ jsx14("div", { className: "h-px bg-slate-800 my-1" }),
|
|
3218
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Orientation & Flips" }),
|
|
3219
|
+
/* @__PURE__ */ jsxs14("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
3220
|
+
/* @__PURE__ */ jsx14(
|
|
3129
3221
|
"button",
|
|
3130
3222
|
{
|
|
3131
3223
|
type: "button",
|
|
@@ -3134,7 +3226,7 @@ var ImageEditor = ({
|
|
|
3134
3226
|
children: "Rotate -90\xB0"
|
|
3135
3227
|
}
|
|
3136
3228
|
),
|
|
3137
|
-
/* @__PURE__ */
|
|
3229
|
+
/* @__PURE__ */ jsx14(
|
|
3138
3230
|
"button",
|
|
3139
3231
|
{
|
|
3140
3232
|
type: "button",
|
|
@@ -3143,7 +3235,7 @@ var ImageEditor = ({
|
|
|
3143
3235
|
children: "Rotate +90\xB0"
|
|
3144
3236
|
}
|
|
3145
3237
|
),
|
|
3146
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx14(
|
|
3147
3239
|
"button",
|
|
3148
3240
|
{
|
|
3149
3241
|
type: "button",
|
|
@@ -3152,7 +3244,7 @@ var ImageEditor = ({
|
|
|
3152
3244
|
children: "Flip Horizontal"
|
|
3153
3245
|
}
|
|
3154
3246
|
),
|
|
3155
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsx14(
|
|
3156
3248
|
"button",
|
|
3157
3249
|
{
|
|
3158
3250
|
type: "button",
|
|
@@ -3163,10 +3255,10 @@ var ImageEditor = ({
|
|
|
3163
3255
|
)
|
|
3164
3256
|
] })
|
|
3165
3257
|
] }),
|
|
3166
|
-
activeTab === "adjust" && /* @__PURE__ */
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
/* @__PURE__ */
|
|
3169
|
-
/* @__PURE__ */
|
|
3258
|
+
activeTab === "adjust" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
3259
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
3260
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Color Adjustments" }),
|
|
3261
|
+
/* @__PURE__ */ jsx14(
|
|
3170
3262
|
"button",
|
|
3171
3263
|
{
|
|
3172
3264
|
type: "button",
|
|
@@ -3176,9 +3268,9 @@ var ImageEditor = ({
|
|
|
3176
3268
|
}
|
|
3177
3269
|
)
|
|
3178
3270
|
] }),
|
|
3179
|
-
/* @__PURE__ */
|
|
3180
|
-
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */
|
|
3181
|
-
/* @__PURE__ */
|
|
3271
|
+
/* @__PURE__ */ jsx14(Histogram, { histogram: editor.histogram }),
|
|
3272
|
+
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs14(React13.Fragment, { children: [
|
|
3273
|
+
/* @__PURE__ */ jsx14(
|
|
3182
3274
|
ControlSlider,
|
|
3183
3275
|
{
|
|
3184
3276
|
spec,
|
|
@@ -3187,14 +3279,14 @@ var ImageEditor = ({
|
|
|
3187
3279
|
onChange: (v) => editor.setAdjustments({ [spec.id]: v })
|
|
3188
3280
|
}
|
|
3189
3281
|
),
|
|
3190
|
-
spec.id === "tint" && legacyProcess && /* @__PURE__ */
|
|
3282
|
+
spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs14(
|
|
3191
3283
|
"div",
|
|
3192
3284
|
{
|
|
3193
3285
|
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-200",
|
|
3194
3286
|
"data-testid": "image-editor-process-notice",
|
|
3195
3287
|
children: [
|
|
3196
|
-
/* @__PURE__ */
|
|
3197
|
-
/* @__PURE__ */
|
|
3288
|
+
/* @__PURE__ */ jsx14("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
|
|
3289
|
+
/* @__PURE__ */ jsx14(
|
|
3198
3290
|
"button",
|
|
3199
3291
|
{
|
|
3200
3292
|
type: "button",
|
|
@@ -3207,7 +3299,7 @@ var ImageEditor = ({
|
|
|
3207
3299
|
}
|
|
3208
3300
|
)
|
|
3209
3301
|
] }, spec.id)),
|
|
3210
|
-
/* @__PURE__ */
|
|
3302
|
+
/* @__PURE__ */ jsx14("div", { className: "border-t border-slate-700/60 pt-3", children: /* @__PURE__ */ jsx14(
|
|
3211
3303
|
AdjustmentLayersPanel,
|
|
3212
3304
|
{
|
|
3213
3305
|
controller,
|
|
@@ -3216,9 +3308,9 @@ var ImageEditor = ({
|
|
|
3216
3308
|
}
|
|
3217
3309
|
) })
|
|
3218
3310
|
] }),
|
|
3219
|
-
activeTab === "layers" && /* @__PURE__ */
|
|
3220
|
-
/* @__PURE__ */
|
|
3221
|
-
/* @__PURE__ */
|
|
3311
|
+
activeTab === "layers" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
3312
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Layers" }),
|
|
3313
|
+
/* @__PURE__ */ jsx14(
|
|
3222
3314
|
"button",
|
|
3223
3315
|
{
|
|
3224
3316
|
type: "button",
|
|
@@ -3229,12 +3321,14 @@ var ImageEditor = ({
|
|
|
3229
3321
|
children: "Free Transform"
|
|
3230
3322
|
}
|
|
3231
3323
|
),
|
|
3232
|
-
/* @__PURE__ */
|
|
3324
|
+
/* @__PURE__ */ jsx14(LayersPanel, { controller }),
|
|
3325
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Colour" }),
|
|
3326
|
+
/* @__PURE__ */ jsx14(ColorProfilePanel, { controller })
|
|
3233
3327
|
] }),
|
|
3234
|
-
activeTab === "paint" && /* @__PURE__ */
|
|
3235
|
-
/* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3328
|
+
activeTab === "paint" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
3329
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Paint" }),
|
|
3330
|
+
/* @__PURE__ */ jsx14(BrushOptionsBar, { controller }),
|
|
3331
|
+
/* @__PURE__ */ jsx14(
|
|
3238
3332
|
"button",
|
|
3239
3333
|
{
|
|
3240
3334
|
type: "button",
|
|
@@ -3245,12 +3339,12 @@ var ImageEditor = ({
|
|
|
3245
3339
|
children: "Free Transform"
|
|
3246
3340
|
}
|
|
3247
3341
|
),
|
|
3248
|
-
paintError && /* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3342
|
+
paintError && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-rose-400", "data-testid": "paint-error", children: paintError }),
|
|
3343
|
+
/* @__PURE__ */ jsx14("div", { className: "border-t border-slate-700/60 pt-3", children: /* @__PURE__ */ jsx14(LayersPanel, { controller }) })
|
|
3250
3344
|
] }),
|
|
3251
|
-
activeTab === "annotate" && /* @__PURE__ */
|
|
3252
|
-
/* @__PURE__ */
|
|
3253
|
-
/* @__PURE__ */
|
|
3345
|
+
activeTab === "annotate" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
3346
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Shape & Type Layers" }),
|
|
3347
|
+
/* @__PURE__ */ jsx14("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx14(
|
|
3254
3348
|
"button",
|
|
3255
3349
|
{
|
|
3256
3350
|
type: "button",
|
|
@@ -3261,13 +3355,13 @@ var ImageEditor = ({
|
|
|
3261
3355
|
},
|
|
3262
3356
|
t
|
|
3263
3357
|
)) }),
|
|
3264
|
-
state.activeTool === "shape" && /* @__PURE__ */
|
|
3265
|
-
state.activeTool === "type" && /* @__PURE__ */
|
|
3266
|
-
state.activeTool === "type" && typeSession && /* @__PURE__ */
|
|
3267
|
-
shapeTypeError && /* @__PURE__ */
|
|
3268
|
-
/* @__PURE__ */
|
|
3269
|
-
/* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3358
|
+
state.activeTool === "shape" && /* @__PURE__ */ jsx14(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
|
|
3359
|
+
state.activeTool === "type" && /* @__PURE__ */ jsx14(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
|
|
3360
|
+
state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx14("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-slate-800 px-2 py-1 text-[11px] text-slate-200 hover:bg-slate-700", children: "Done editing text" }),
|
|
3361
|
+
shapeTypeError && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-rose-400", "data-testid": "shape-type-error", children: shapeTypeError }),
|
|
3362
|
+
/* @__PURE__ */ jsx14("div", { className: "h-px bg-slate-800 my-1" }),
|
|
3363
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Draw & Annotate" }),
|
|
3364
|
+
/* @__PURE__ */ jsx14("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx14(
|
|
3271
3365
|
"button",
|
|
3272
3366
|
{
|
|
3273
3367
|
type: "button",
|
|
@@ -3277,9 +3371,9 @@ var ImageEditor = ({
|
|
|
3277
3371
|
},
|
|
3278
3372
|
t
|
|
3279
3373
|
)) }),
|
|
3280
|
-
/* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3374
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
3375
|
+
/* @__PURE__ */ jsx14("label", { className: "text-slate-400", children: "Color:" }),
|
|
3376
|
+
/* @__PURE__ */ jsx14(
|
|
3283
3377
|
"input",
|
|
3284
3378
|
{
|
|
3285
3379
|
type: "color",
|
|
@@ -3288,15 +3382,15 @@ var ImageEditor = ({
|
|
|
3288
3382
|
className: "w-8 h-8 rounded border border-slate-700 cursor-pointer bg-transparent"
|
|
3289
3383
|
}
|
|
3290
3384
|
),
|
|
3291
|
-
/* @__PURE__ */
|
|
3292
|
-
/* @__PURE__ */
|
|
3293
|
-
/* @__PURE__ */
|
|
3294
|
-
/* @__PURE__ */
|
|
3385
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex-1 ml-2", children: [
|
|
3386
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between text-slate-400 mb-0.5", children: [
|
|
3387
|
+
/* @__PURE__ */ jsx14("span", { children: "Width:" }),
|
|
3388
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
|
|
3295
3389
|
strokeWidth,
|
|
3296
3390
|
"px"
|
|
3297
3391
|
] })
|
|
3298
3392
|
] }),
|
|
3299
|
-
/* @__PURE__ */
|
|
3393
|
+
/* @__PURE__ */ jsx14(
|
|
3300
3394
|
"input",
|
|
3301
3395
|
{
|
|
3302
3396
|
type: "range",
|
|
@@ -3309,10 +3403,10 @@ var ImageEditor = ({
|
|
|
3309
3403
|
)
|
|
3310
3404
|
] })
|
|
3311
3405
|
] }),
|
|
3312
|
-
/* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3314
|
-
/* @__PURE__ */
|
|
3315
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsx14("div", { className: "h-px bg-slate-800 my-1" }),
|
|
3407
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Add Text" }),
|
|
3408
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex gap-2", children: [
|
|
3409
|
+
/* @__PURE__ */ jsx14(
|
|
3316
3410
|
"input",
|
|
3317
3411
|
{
|
|
3318
3412
|
type: "text",
|
|
@@ -3323,7 +3417,7 @@ var ImageEditor = ({
|
|
|
3323
3417
|
className: "flex-1 bg-slate-950 border border-slate-700 rounded-lg px-2.5 py-1.5 text-xs text-slate-100 placeholder-slate-500 focus:outline-none focus:border-indigo-500"
|
|
3324
3418
|
}
|
|
3325
3419
|
),
|
|
3326
|
-
/* @__PURE__ */
|
|
3420
|
+
/* @__PURE__ */ jsx14(
|
|
3327
3421
|
"button",
|
|
3328
3422
|
{
|
|
3329
3423
|
type: "button",
|
|
@@ -3333,14 +3427,14 @@ var ImageEditor = ({
|
|
|
3333
3427
|
}
|
|
3334
3428
|
)
|
|
3335
3429
|
] }),
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between text-slate-400", children: [
|
|
3431
|
+
/* @__PURE__ */ jsx14("span", { children: "Font Size:" }),
|
|
3432
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
|
|
3339
3433
|
fontSize,
|
|
3340
3434
|
"px"
|
|
3341
3435
|
] })
|
|
3342
3436
|
] }),
|
|
3343
|
-
/* @__PURE__ */
|
|
3437
|
+
/* @__PURE__ */ jsx14(
|
|
3344
3438
|
"input",
|
|
3345
3439
|
{
|
|
3346
3440
|
type: "range",
|
|
@@ -3351,14 +3445,14 @@ var ImageEditor = ({
|
|
|
3351
3445
|
className: "w-full accent-indigo-500"
|
|
3352
3446
|
}
|
|
3353
3447
|
),
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
/* @__PURE__ */
|
|
3356
|
-
/* @__PURE__ */
|
|
3448
|
+
/* @__PURE__ */ jsx14("div", { className: "h-px bg-slate-800 my-1" }),
|
|
3449
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
3450
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-slate-400", children: [
|
|
3357
3451
|
"Layers (",
|
|
3358
3452
|
state.annotations.length,
|
|
3359
3453
|
")"
|
|
3360
3454
|
] }),
|
|
3361
|
-
state.selectedAnnotationId && /* @__PURE__ */
|
|
3455
|
+
state.selectedAnnotationId && /* @__PURE__ */ jsx14(
|
|
3362
3456
|
"button",
|
|
3363
3457
|
{
|
|
3364
3458
|
type: "button",
|
|
@@ -3367,7 +3461,7 @@ var ImageEditor = ({
|
|
|
3367
3461
|
children: "Delete Selected"
|
|
3368
3462
|
}
|
|
3369
3463
|
),
|
|
3370
|
-
state.annotations.length > 0 && /* @__PURE__ */
|
|
3464
|
+
state.annotations.length > 0 && /* @__PURE__ */ jsx14(
|
|
3371
3465
|
"button",
|
|
3372
3466
|
{
|
|
3373
3467
|
type: "button",
|
|
@@ -3378,10 +3472,10 @@ var ImageEditor = ({
|
|
|
3378
3472
|
)
|
|
3379
3473
|
] })
|
|
3380
3474
|
] }),
|
|
3381
|
-
activeTab === "depth" && /* @__PURE__ */
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3475
|
+
activeTab === "depth" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
3476
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
3477
|
+
/* @__PURE__ */ jsx14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px]", children: "Depth Masking" }),
|
|
3478
|
+
/* @__PURE__ */ jsx14(
|
|
3385
3479
|
"button",
|
|
3386
3480
|
{
|
|
3387
3481
|
type: "button",
|
|
@@ -3391,8 +3485,8 @@ var ImageEditor = ({
|
|
|
3391
3485
|
}
|
|
3392
3486
|
)
|
|
3393
3487
|
] }),
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2 cursor-pointer text-slate-300", children: [
|
|
3489
|
+
/* @__PURE__ */ jsx14(
|
|
3396
3490
|
"input",
|
|
3397
3491
|
{
|
|
3398
3492
|
type: "checkbox",
|
|
@@ -3401,12 +3495,12 @@ var ImageEditor = ({
|
|
|
3401
3495
|
className: "rounded accent-indigo-500"
|
|
3402
3496
|
}
|
|
3403
3497
|
),
|
|
3404
|
-
/* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ jsx14("span", { children: "Enable Depth / Alpha Mask" })
|
|
3405
3499
|
] }),
|
|
3406
|
-
state.depthMask.enabled && /* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3408
|
-
/* @__PURE__ */
|
|
3409
|
-
/* @__PURE__ */
|
|
3500
|
+
state.depthMask.enabled && /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3501
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
3502
|
+
/* @__PURE__ */ jsx14("label", { className: "text-slate-400 block mb-1", children: "Mask Image URL:" }),
|
|
3503
|
+
/* @__PURE__ */ jsx14(
|
|
3410
3504
|
"input",
|
|
3411
3505
|
{
|
|
3412
3506
|
type: "text",
|
|
@@ -3417,8 +3511,8 @@ var ImageEditor = ({
|
|
|
3417
3511
|
}
|
|
3418
3512
|
)
|
|
3419
3513
|
] }),
|
|
3420
|
-
/* @__PURE__ */
|
|
3421
|
-
/* @__PURE__ */
|
|
3514
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex gap-2", children: [
|
|
3515
|
+
/* @__PURE__ */ jsx14(
|
|
3422
3516
|
"button",
|
|
3423
3517
|
{
|
|
3424
3518
|
type: "button",
|
|
@@ -3427,7 +3521,7 @@ var ImageEditor = ({
|
|
|
3427
3521
|
children: "Threshold Mode"
|
|
3428
3522
|
}
|
|
3429
3523
|
),
|
|
3430
|
-
/* @__PURE__ */
|
|
3524
|
+
/* @__PURE__ */ jsx14(
|
|
3431
3525
|
"button",
|
|
3432
3526
|
{
|
|
3433
3527
|
type: "button",
|
|
@@ -3437,12 +3531,12 @@ var ImageEditor = ({
|
|
|
3437
3531
|
}
|
|
3438
3532
|
)
|
|
3439
3533
|
] }),
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
3443
|
-
/* @__PURE__ */
|
|
3534
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
3535
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between text-slate-400 mb-1", children: [
|
|
3536
|
+
/* @__PURE__ */ jsx14("span", { children: "Depth Start (Lower):" }),
|
|
3537
|
+
/* @__PURE__ */ jsx14("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
|
|
3444
3538
|
] }),
|
|
3445
|
-
/* @__PURE__ */
|
|
3539
|
+
/* @__PURE__ */ jsx14(
|
|
3446
3540
|
"input",
|
|
3447
3541
|
{
|
|
3448
3542
|
type: "range",
|
|
@@ -3456,12 +3550,12 @@ var ImageEditor = ({
|
|
|
3456
3550
|
}
|
|
3457
3551
|
)
|
|
3458
3552
|
] }),
|
|
3459
|
-
/* @__PURE__ */
|
|
3460
|
-
/* @__PURE__ */
|
|
3461
|
-
/* @__PURE__ */
|
|
3462
|
-
/* @__PURE__ */
|
|
3553
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
3554
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between text-slate-400 mb-1", children: [
|
|
3555
|
+
/* @__PURE__ */ jsx14("span", { children: "Depth Stop (Upper):" }),
|
|
3556
|
+
/* @__PURE__ */ jsx14("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
|
|
3463
3557
|
] }),
|
|
3464
|
-
/* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ jsx14(
|
|
3465
3559
|
"input",
|
|
3466
3560
|
{
|
|
3467
3561
|
type: "range",
|
|
@@ -3475,12 +3569,12 @@ var ImageEditor = ({
|
|
|
3475
3569
|
}
|
|
3476
3570
|
)
|
|
3477
3571
|
] }),
|
|
3478
|
-
/* @__PURE__ */
|
|
3479
|
-
/* @__PURE__ */
|
|
3480
|
-
/* @__PURE__ */
|
|
3481
|
-
/* @__PURE__ */
|
|
3572
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
3573
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between text-slate-400 mb-1", children: [
|
|
3574
|
+
/* @__PURE__ */ jsx14("span", { children: "Softness:" }),
|
|
3575
|
+
/* @__PURE__ */ jsx14("span", { className: "font-mono", children: state.depthMask.softness })
|
|
3482
3576
|
] }),
|
|
3483
|
-
/* @__PURE__ */
|
|
3577
|
+
/* @__PURE__ */ jsx14(
|
|
3484
3578
|
"input",
|
|
3485
3579
|
{
|
|
3486
3580
|
type: "range",
|
|
@@ -3492,8 +3586,8 @@ var ImageEditor = ({
|
|
|
3492
3586
|
}
|
|
3493
3587
|
)
|
|
3494
3588
|
] }),
|
|
3495
|
-
/* @__PURE__ */
|
|
3496
|
-
/* @__PURE__ */
|
|
3589
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2 cursor-pointer text-slate-300 mt-1", children: [
|
|
3590
|
+
/* @__PURE__ */ jsx14(
|
|
3497
3591
|
"input",
|
|
3498
3592
|
{
|
|
3499
3593
|
type: "checkbox",
|
|
@@ -3502,12 +3596,12 @@ var ImageEditor = ({
|
|
|
3502
3596
|
className: "rounded accent-indigo-500"
|
|
3503
3597
|
}
|
|
3504
3598
|
),
|
|
3505
|
-
/* @__PURE__ */
|
|
3599
|
+
/* @__PURE__ */ jsx14("span", { children: "Invert Mask" })
|
|
3506
3600
|
] })
|
|
3507
3601
|
] })
|
|
3508
3602
|
] }),
|
|
3509
|
-
activeTab === "select" && /* @__PURE__ */
|
|
3510
|
-
/* @__PURE__ */
|
|
3603
|
+
activeTab === "select" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
3604
|
+
/* @__PURE__ */ jsx14(
|
|
3511
3605
|
SelectionOptionsBar,
|
|
3512
3606
|
{
|
|
3513
3607
|
controller,
|
|
@@ -3517,9 +3611,9 @@ var ImageEditor = ({
|
|
|
3517
3611
|
quickMask: Boolean(state.quickMask)
|
|
3518
3612
|
}
|
|
3519
3613
|
),
|
|
3520
|
-
selectionError && /* @__PURE__ */
|
|
3521
|
-
/* @__PURE__ */
|
|
3522
|
-
/* @__PURE__ */
|
|
3614
|
+
selectionError && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-rose-400", children: selectionError }),
|
|
3615
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex gap-1", children: [
|
|
3616
|
+
/* @__PURE__ */ jsx14(
|
|
3523
3617
|
"button",
|
|
3524
3618
|
{
|
|
3525
3619
|
type: "button",
|
|
@@ -3530,7 +3624,7 @@ var ImageEditor = ({
|
|
|
3530
3624
|
children: "Transform Selection"
|
|
3531
3625
|
}
|
|
3532
3626
|
),
|
|
3533
|
-
/* @__PURE__ */
|
|
3627
|
+
/* @__PURE__ */ jsx14(
|
|
3534
3628
|
"button",
|
|
3535
3629
|
{
|
|
3536
3630
|
type: "button",
|
|
@@ -3542,12 +3636,12 @@ var ImageEditor = ({
|
|
|
3542
3636
|
}
|
|
3543
3637
|
)
|
|
3544
3638
|
] }),
|
|
3545
|
-
/* @__PURE__ */
|
|
3639
|
+
/* @__PURE__ */ jsx14(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers })
|
|
3546
3640
|
] }),
|
|
3547
|
-
activeTab === "ai" && /* @__PURE__ */
|
|
3548
|
-
/* @__PURE__ */
|
|
3549
|
-
/* @__PURE__ */
|
|
3550
|
-
/* @__PURE__ */
|
|
3641
|
+
activeTab === "ai" && /* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
3642
|
+
/* @__PURE__ */ jsxs14("label", { className: "flex items-center justify-between gap-2 text-slate-300", children: [
|
|
3643
|
+
/* @__PURE__ */ jsx14("span", { children: "Results go to" }),
|
|
3644
|
+
/* @__PURE__ */ jsxs14(
|
|
3551
3645
|
"select",
|
|
3552
3646
|
{
|
|
3553
3647
|
"aria-label": "AI result target",
|
|
@@ -3555,54 +3649,54 @@ var ImageEditor = ({
|
|
|
3555
3649
|
onChange: (e) => setAiTarget(e.target.value),
|
|
3556
3650
|
className: "bg-slate-800 border border-slate-700 rounded px-1.5 py-1",
|
|
3557
3651
|
children: [
|
|
3558
|
-
/* @__PURE__ */
|
|
3559
|
-
/* @__PURE__ */
|
|
3560
|
-
/* @__PURE__ */
|
|
3652
|
+
/* @__PURE__ */ jsx14("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
|
|
3653
|
+
/* @__PURE__ */ jsx14("option", { value: "new-layer", children: "New layer / mask" }),
|
|
3654
|
+
/* @__PURE__ */ jsx14("option", { value: "replace", children: "Replace image" })
|
|
3561
3655
|
]
|
|
3562
3656
|
}
|
|
3563
3657
|
)
|
|
3564
3658
|
] }),
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
/* @__PURE__ */
|
|
3567
|
-
/* @__PURE__ */
|
|
3568
|
-
/* @__PURE__ */
|
|
3659
|
+
/* @__PURE__ */ jsxs14("div", { className: "p-3 rounded-lg bg-slate-950/60 border border-slate-800 flex flex-col gap-2.5", children: [
|
|
3660
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
3661
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
3662
|
+
/* @__PURE__ */ jsx14("svg", { className: "w-3.5 h-3.5 text-indigo-400", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx14("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" }) }),
|
|
3569
3663
|
"Background Removal"
|
|
3570
3664
|
] }),
|
|
3571
|
-
isRemovingBg && /* @__PURE__ */
|
|
3665
|
+
isRemovingBg && /* @__PURE__ */ jsx14("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-indigo-900/60 text-indigo-300 animate-pulse", children: "Removing..." })
|
|
3572
3666
|
] }),
|
|
3573
|
-
/* @__PURE__ */
|
|
3574
|
-
/* @__PURE__ */
|
|
3667
|
+
/* @__PURE__ */ jsx14("p", { className: "text-slate-400 text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
|
|
3668
|
+
/* @__PURE__ */ jsx14(
|
|
3575
3669
|
"button",
|
|
3576
3670
|
{
|
|
3577
3671
|
type: "button",
|
|
3578
3672
|
onClick: handleRemoveBackground,
|
|
3579
3673
|
disabled: isRemovingBg || isInpainting,
|
|
3580
3674
|
className: "mt-1 px-3 py-2 rounded-lg bg-indigo-600 hover:bg-indigo-500 disabled:opacity-50 text-white font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
3581
|
-
children: isRemovingBg ? /* @__PURE__ */
|
|
3582
|
-
/* @__PURE__ */
|
|
3675
|
+
children: isRemovingBg ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3676
|
+
/* @__PURE__ */ jsx14("div", { className: "w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin" }),
|
|
3583
3677
|
"Removing Background..."
|
|
3584
|
-
] }) : /* @__PURE__ */
|
|
3585
|
-
/* @__PURE__ */
|
|
3678
|
+
] }) : /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3679
|
+
/* @__PURE__ */ jsx14("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx14("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" }) }),
|
|
3586
3680
|
"Remove Background"
|
|
3587
3681
|
] })
|
|
3588
3682
|
}
|
|
3589
3683
|
)
|
|
3590
3684
|
] }),
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
/* @__PURE__ */
|
|
3593
|
-
/* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
/* @__PURE__ */
|
|
3596
|
-
/* @__PURE__ */
|
|
3685
|
+
/* @__PURE__ */ jsxs14("div", { className: "p-3 rounded-lg bg-slate-950/60 border border-slate-800 flex flex-col gap-2.5", children: [
|
|
3686
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between", children: [
|
|
3687
|
+
/* @__PURE__ */ jsxs14("span", { className: "font-semibold text-slate-200 uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
3688
|
+
/* @__PURE__ */ jsxs14("svg", { className: "w-3.5 h-3.5 text-purple-400", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
3689
|
+
/* @__PURE__ */ jsx14("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" }),
|
|
3690
|
+
/* @__PURE__ */ jsx14("path", { d: "m14 7 3 3" })
|
|
3597
3691
|
] }),
|
|
3598
3692
|
"Generative Inpainting"
|
|
3599
3693
|
] }),
|
|
3600
|
-
isInpainting && /* @__PURE__ */
|
|
3694
|
+
isInpainting && /* @__PURE__ */ jsx14("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-purple-900/60 text-purple-300 animate-pulse", children: "Inpainting..." })
|
|
3601
3695
|
] }),
|
|
3602
|
-
/* @__PURE__ */
|
|
3603
|
-
/* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3605
|
-
/* @__PURE__ */
|
|
3696
|
+
/* @__PURE__ */ jsx14("p", { className: "text-slate-400 text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
|
|
3697
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1", children: [
|
|
3698
|
+
/* @__PURE__ */ jsx14("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-slate-300 text-[11px] font-medium", children: "Prompt" }),
|
|
3699
|
+
/* @__PURE__ */ jsx14(
|
|
3606
3700
|
"textarea",
|
|
3607
3701
|
{
|
|
3608
3702
|
id: "ai-inpaint-prompt-react",
|
|
@@ -3614,10 +3708,10 @@ var ImageEditor = ({
|
|
|
3614
3708
|
}
|
|
3615
3709
|
)
|
|
3616
3710
|
] }),
|
|
3617
|
-
/* @__PURE__ */
|
|
3618
|
-
/* @__PURE__ */
|
|
3619
|
-
/* @__PURE__ */
|
|
3620
|
-
/* @__PURE__ */
|
|
3711
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex flex-col gap-1", children: [
|
|
3712
|
+
/* @__PURE__ */ jsx14("span", { className: "text-slate-300 text-[11px] font-medium", children: "Target Mask Region" }),
|
|
3713
|
+
/* @__PURE__ */ jsxs14("div", { className: "grid grid-cols-2 gap-1.5", children: [
|
|
3714
|
+
/* @__PURE__ */ jsxs14(
|
|
3621
3715
|
"button",
|
|
3622
3716
|
{
|
|
3623
3717
|
type: "button",
|
|
@@ -3630,7 +3724,7 @@ var ImageEditor = ({
|
|
|
3630
3724
|
]
|
|
3631
3725
|
}
|
|
3632
3726
|
),
|
|
3633
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsxs14(
|
|
3634
3728
|
"button",
|
|
3635
3729
|
{
|
|
3636
3730
|
type: "button",
|
|
@@ -3645,25 +3739,25 @@ var ImageEditor = ({
|
|
|
3645
3739
|
)
|
|
3646
3740
|
] })
|
|
3647
3741
|
] }),
|
|
3648
|
-
/* @__PURE__ */
|
|
3742
|
+
/* @__PURE__ */ jsx14(
|
|
3649
3743
|
"button",
|
|
3650
3744
|
{
|
|
3651
3745
|
type: "button",
|
|
3652
3746
|
onClick: handleInpaint,
|
|
3653
3747
|
disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
|
|
3654
3748
|
className: "mt-1 px-3 py-2 rounded-lg bg-purple-600 hover:bg-purple-500 disabled:opacity-50 text-white font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
3655
|
-
children: isInpainting ? /* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3749
|
+
children: isInpainting ? /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3750
|
+
/* @__PURE__ */ jsx14("div", { className: "w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin" }),
|
|
3657
3751
|
"Generating Inpaint..."
|
|
3658
|
-
] }) : /* @__PURE__ */
|
|
3659
|
-
/* @__PURE__ */
|
|
3752
|
+
] }) : /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
3753
|
+
/* @__PURE__ */ jsx14("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx14("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" }) }),
|
|
3660
3754
|
"Apply Inpainting"
|
|
3661
3755
|
] })
|
|
3662
3756
|
}
|
|
3663
3757
|
)
|
|
3664
3758
|
] }),
|
|
3665
|
-
aiError && /* @__PURE__ */
|
|
3666
|
-
aiSuccess && /* @__PURE__ */
|
|
3759
|
+
aiError && /* @__PURE__ */ jsx14("div", { className: "p-2.5 rounded-lg bg-rose-950/60 border border-rose-800 text-rose-300 text-[11px]", children: aiError }),
|
|
3760
|
+
aiSuccess && /* @__PURE__ */ jsx14("div", { className: "p-2.5 rounded-lg bg-emerald-950/60 border border-emerald-800 text-emerald-300 text-[11px]", children: aiSuccess })
|
|
3667
3761
|
] })
|
|
3668
3762
|
] })
|
|
3669
3763
|
] })
|
|
@@ -3682,6 +3776,7 @@ export {
|
|
|
3682
3776
|
LayerEffectsPanel,
|
|
3683
3777
|
LayersPanel,
|
|
3684
3778
|
BrushOptionsBar,
|
|
3779
|
+
ColorProfilePanel,
|
|
3685
3780
|
SelectionOptionsBar,
|
|
3686
3781
|
RefineEdgePanel,
|
|
3687
3782
|
FreeTransformOptionsBar,
|
|
@@ -3689,4 +3784,4 @@ export {
|
|
|
3689
3784
|
TypeOptionsBar,
|
|
3690
3785
|
ImageEditor
|
|
3691
3786
|
};
|
|
3692
|
-
//# sourceMappingURL=chunk-
|
|
3787
|
+
//# sourceMappingURL=chunk-VNZKHFEM.js.map
|