@pixerate/editor-react 0.121.0 → 0.122.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-CQXZVIV7.js → chunk-VR3JON4V.js} +417 -295
- package/dist/image-editor/ChannelsPanel.d.cts +15 -0
- package/dist/image-editor/ChannelsPanel.d.ts +15 -0
- package/dist/image-editor/index.cjs +425 -303
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +3 -1
- package/dist/index.cjs +945 -823
- package/dist/index.js +3 -1
- package/package.json +3 -3
|
@@ -190,7 +190,7 @@ function useImageEffectsTools(registry, controller, options = {}) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// src/image-editor/ImageEditor.tsx
|
|
193
|
-
import
|
|
193
|
+
import React16, { useRef as useRef8, useEffect as useEffect14, useState as useState17 } from "react";
|
|
194
194
|
import {
|
|
195
195
|
normalizeProcessVersion,
|
|
196
196
|
LATEST_PROCESS_VERSION,
|
|
@@ -224,6 +224,7 @@ import {
|
|
|
224
224
|
watchCanvasViewport,
|
|
225
225
|
startMarchingAnts,
|
|
226
226
|
handleSelectionShortcut,
|
|
227
|
+
handleQuickMaskKey,
|
|
227
228
|
ShapeDrawGesture,
|
|
228
229
|
TypeToolGesture,
|
|
229
230
|
DEFAULT_SHAPE_TOOL_OPTIONS,
|
|
@@ -601,6 +602,10 @@ var ImageEditorCanvas = ({
|
|
|
601
602
|
if (target?.closest?.('input, textarea, select, [contenteditable="true"]')) return;
|
|
602
603
|
if (window.getSelection?.()?.toString()) return;
|
|
603
604
|
const gesture = selectionGestureRef.current;
|
|
605
|
+
if (handleQuickMaskKey(controller, e)) {
|
|
606
|
+
e.preventDefault();
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
604
609
|
if (handleSelectionShortcut(controller, e, (message) => report("select", message))) {
|
|
605
610
|
e.preventDefault();
|
|
606
611
|
return;
|
|
@@ -3107,14 +3112,129 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3107
3112
|
] });
|
|
3108
3113
|
};
|
|
3109
3114
|
|
|
3115
|
+
// src/image-editor/ChannelsPanel.tsx
|
|
3116
|
+
import { useEffect as useEffect10, useRef as useRef7, useState as useState13 } from "react";
|
|
3117
|
+
import { channelThumbnail, selectionModeFromModifiers } from "@pixerate/editor/image-editor";
|
|
3118
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3119
|
+
var btn2 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
|
|
3120
|
+
var ChannelThumb = ({ channel, size }) => {
|
|
3121
|
+
const ref = useRef7(null);
|
|
3122
|
+
useEffect10(() => {
|
|
3123
|
+
const canvas = ref.current;
|
|
3124
|
+
const ctx = canvas?.getContext("2d");
|
|
3125
|
+
if (!canvas || !ctx || typeof ctx.createImageData !== "function") return;
|
|
3126
|
+
const px = channelThumbnail(channel, 64);
|
|
3127
|
+
canvas.width = px.width;
|
|
3128
|
+
canvas.height = px.height;
|
|
3129
|
+
const img = ctx.createImageData(px.width, px.height);
|
|
3130
|
+
img.data.set(px.data);
|
|
3131
|
+
ctx.putImageData(img, 0, 0);
|
|
3132
|
+
}, [channel.mask]);
|
|
3133
|
+
return /* @__PURE__ */ jsx17("canvas", { ref, "aria-hidden": "true", style: { width: size, height: size }, className: "shrink-0 rounded object-contain ring-1 ring-border bg-black" });
|
|
3134
|
+
};
|
|
3135
|
+
var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
3136
|
+
const [, setTick] = useState13(0);
|
|
3137
|
+
useEffect10(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
3138
|
+
const [activeId, setActiveId] = useState13(null);
|
|
3139
|
+
const [renaming, setRenaming] = useState13(null);
|
|
3140
|
+
const [error, setError] = useState13(null);
|
|
3141
|
+
const channels = controller.getChannels();
|
|
3142
|
+
const active = channels.find((c) => c.id === activeId) ?? null;
|
|
3143
|
+
const hasSelection = Boolean(controller.getSelection());
|
|
3144
|
+
const quickMask = controller.quickMaskEditing;
|
|
3145
|
+
const attempt = (fn) => {
|
|
3146
|
+
setError(null);
|
|
3147
|
+
try {
|
|
3148
|
+
fn();
|
|
3149
|
+
} catch (err) {
|
|
3150
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
3151
|
+
}
|
|
3152
|
+
};
|
|
3153
|
+
return /* @__PURE__ */ jsxs15("div", { "data-testid": "channels-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
|
|
3154
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
3155
|
+
/* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Channels" }),
|
|
3156
|
+
/* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": quickMask, className: btn2(quickMask), title: "Paint the selection: white selects, black deselects (Q)", onClick: () => controller.setQuickMaskMode(!quickMask), children: "Quick Mask" })
|
|
3157
|
+
] }),
|
|
3158
|
+
channels.length === 0 && /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "No channels. Save a selection to keep it." }),
|
|
3159
|
+
/* @__PURE__ */ jsx17("ul", { role: "list", className: "flex flex-col gap-0.5", children: channels.map((c) => /* @__PURE__ */ jsxs15(
|
|
3160
|
+
"li",
|
|
3161
|
+
{
|
|
3162
|
+
"data-testid": "channel-row",
|
|
3163
|
+
"aria-current": c.id === activeId ? "true" : void 0,
|
|
3164
|
+
className: `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${c.id === activeId ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`,
|
|
3165
|
+
onClick: (e) => {
|
|
3166
|
+
setActiveId(c.id);
|
|
3167
|
+
attempt(() => controller.loadSelectionFromChannel(c.id, { mode: selectionModeFromModifiers(e, "replace") }));
|
|
3168
|
+
},
|
|
3169
|
+
onDoubleClick: () => setRenaming(c.id),
|
|
3170
|
+
children: [
|
|
3171
|
+
/* @__PURE__ */ jsx17(
|
|
3172
|
+
"button",
|
|
3173
|
+
{
|
|
3174
|
+
type: "button",
|
|
3175
|
+
"aria-label": `${c.visible ? "Hide" : "Show"} ${c.name}`,
|
|
3176
|
+
"aria-pressed": c.visible,
|
|
3177
|
+
className: "w-4 text-muted-foreground",
|
|
3178
|
+
onClick: (e) => {
|
|
3179
|
+
e.stopPropagation();
|
|
3180
|
+
attempt(() => controller.setChannelProperties(c.id, { visible: !c.visible }));
|
|
3181
|
+
},
|
|
3182
|
+
children: c.visible ? "\u25CF" : "\u25CB"
|
|
3183
|
+
}
|
|
3184
|
+
),
|
|
3185
|
+
/* @__PURE__ */ jsx17(ChannelThumb, { channel: c, size: thumbnailSize }),
|
|
3186
|
+
renaming === c.id ? /* @__PURE__ */ jsx17(
|
|
3187
|
+
"input",
|
|
3188
|
+
{
|
|
3189
|
+
autoFocus: true,
|
|
3190
|
+
"aria-label": "Channel name",
|
|
3191
|
+
defaultValue: c.name,
|
|
3192
|
+
className: "min-w-0 flex-1 bg-background border border-border rounded px-1 py-0.5 text-foreground",
|
|
3193
|
+
onClick: (e) => e.stopPropagation(),
|
|
3194
|
+
onBlur: (e) => {
|
|
3195
|
+
setRenaming(null);
|
|
3196
|
+
if (e.currentTarget.value.trim() && e.currentTarget.value !== c.name) attempt(() => controller.setChannelProperties(c.id, { name: e.currentTarget.value }));
|
|
3197
|
+
},
|
|
3198
|
+
onKeyDown: (e) => {
|
|
3199
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
3200
|
+
if (e.key === "Escape") setRenaming(null);
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
) : /* @__PURE__ */ jsx17("span", { className: "min-w-0 flex-1 truncate", children: c.name })
|
|
3204
|
+
]
|
|
3205
|
+
},
|
|
3206
|
+
c.id
|
|
3207
|
+
)) }),
|
|
3208
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1", children: [
|
|
3209
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: btn2(), disabled: !hasSelection, onClick: () => attempt(() => setActiveId(controller.saveSelection().id)), children: "Save Selection" }),
|
|
3210
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: btn2(), disabled: !active || !hasSelection, title: "Add the selection to the channel", onClick: () => attempt(() => controller.saveSelection({ channelId: active.id, mode: "add" })), children: "Add to Channel" }),
|
|
3211
|
+
/* @__PURE__ */ jsx17("button", { type: "button", className: btn2(), disabled: !active, onClick: () => attempt(() => setActiveId(controller.duplicateChannel(active.id).id)), children: "Duplicate" }),
|
|
3212
|
+
/* @__PURE__ */ jsx17(
|
|
3213
|
+
"button",
|
|
3214
|
+
{
|
|
3215
|
+
type: "button",
|
|
3216
|
+
className: btn2(),
|
|
3217
|
+
disabled: !active,
|
|
3218
|
+
onClick: () => attempt(() => {
|
|
3219
|
+
controller.deleteChannel(active.id);
|
|
3220
|
+
setActiveId(null);
|
|
3221
|
+
}),
|
|
3222
|
+
children: "Delete"
|
|
3223
|
+
}
|
|
3224
|
+
)
|
|
3225
|
+
] }),
|
|
3226
|
+
error && /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-destructive", children: error })
|
|
3227
|
+
] });
|
|
3228
|
+
};
|
|
3229
|
+
|
|
3110
3230
|
// src/image-editor/FreeTransformOptionsBar.tsx
|
|
3111
|
-
import { useEffect as
|
|
3231
|
+
import { useEffect as useEffect11, useState as useState14 } from "react";
|
|
3112
3232
|
import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
|
|
3113
|
-
import { jsx as
|
|
3233
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3114
3234
|
var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
|
|
3115
3235
|
var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
3116
|
-
const [, setTick] =
|
|
3117
|
-
|
|
3236
|
+
const [, setTick] = useState14(0);
|
|
3237
|
+
useEffect11(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
|
|
3118
3238
|
const bar = tool.bar();
|
|
3119
3239
|
if (!tool.active || !bar) return null;
|
|
3120
3240
|
const warp = tool.warpBar();
|
|
@@ -3126,17 +3246,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3126
3246
|
const v = Number(raw);
|
|
3127
3247
|
if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
|
|
3128
3248
|
};
|
|
3129
|
-
return /* @__PURE__ */
|
|
3130
|
-
/* @__PURE__ */
|
|
3131
|
-
/* @__PURE__ */
|
|
3132
|
-
tool.mode === "warp" && /* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */
|
|
3134
|
-
/* @__PURE__ */
|
|
3135
|
-
/* @__PURE__ */
|
|
3249
|
+
return /* @__PURE__ */ jsxs16("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
|
|
3250
|
+
/* @__PURE__ */ jsx18("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx18("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
|
|
3251
|
+
/* @__PURE__ */ jsx18("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
|
|
3252
|
+
tool.mode === "warp" && /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
|
|
3253
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
|
|
3254
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Warp" }),
|
|
3255
|
+
/* @__PURE__ */ jsx18("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx18("option", { value: o.id, children: o.label }, o.id)) })
|
|
3136
3256
|
] }),
|
|
3137
|
-
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */
|
|
3138
|
-
/* @__PURE__ */
|
|
3139
|
-
/* @__PURE__ */
|
|
3257
|
+
["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
|
|
3258
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
|
|
3259
|
+
/* @__PURE__ */ jsx18(
|
|
3140
3260
|
"input",
|
|
3141
3261
|
{
|
|
3142
3262
|
type: "number",
|
|
@@ -3157,9 +3277,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3157
3277
|
},
|
|
3158
3278
|
`${k}:${warp[k]}`
|
|
3159
3279
|
),
|
|
3160
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "%" })
|
|
3161
3281
|
] }, k)),
|
|
3162
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ jsx18(
|
|
3163
3283
|
"button",
|
|
3164
3284
|
{
|
|
3165
3285
|
type: "button",
|
|
@@ -3171,9 +3291,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3171
3291
|
children: "Vertical"
|
|
3172
3292
|
}
|
|
3173
3293
|
),
|
|
3174
|
-
/* @__PURE__ */
|
|
3175
|
-
/* @__PURE__ */
|
|
3176
|
-
/* @__PURE__ */
|
|
3294
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
|
|
3295
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Grid" }),
|
|
3296
|
+
/* @__PURE__ */ jsx18(
|
|
3177
3297
|
"select",
|
|
3178
3298
|
{
|
|
3179
3299
|
"aria-label": "Warp grid",
|
|
@@ -3183,14 +3303,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3183
3303
|
tool.setWarp({ columns: g.columns, rows: g.rows });
|
|
3184
3304
|
},
|
|
3185
3305
|
className: imageFieldClass,
|
|
3186
|
-
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */
|
|
3306
|
+
children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx18("option", { value: g.id, children: g.label }, g.id))
|
|
3187
3307
|
}
|
|
3188
3308
|
)
|
|
3189
3309
|
] })
|
|
3190
3310
|
] }),
|
|
3191
|
-
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3311
|
+
tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", title: f.title, children: [
|
|
3312
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: f.label }),
|
|
3313
|
+
/* @__PURE__ */ jsx18(
|
|
3194
3314
|
"input",
|
|
3195
3315
|
{
|
|
3196
3316
|
type: "number",
|
|
@@ -3210,8 +3330,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3210
3330
|
},
|
|
3211
3331
|
`${f.id}:${round(bar[f.id], f.unit)}`
|
|
3212
3332
|
),
|
|
3213
|
-
/* @__PURE__ */
|
|
3214
|
-
f.id === "scaleX" && /* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: f.unit }),
|
|
3334
|
+
f.id === "scaleX" && /* @__PURE__ */ jsx18(
|
|
3215
3335
|
"button",
|
|
3216
3336
|
{
|
|
3217
3337
|
type: "button",
|
|
@@ -3226,33 +3346,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
|
|
|
3226
3346
|
}
|
|
3227
3347
|
)
|
|
3228
3348
|
] }, f.id)),
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3231
|
-
/* @__PURE__ */
|
|
3349
|
+
/* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
|
|
3350
|
+
/* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Interpolation" }),
|
|
3351
|
+
/* @__PURE__ */ jsx18(
|
|
3232
3352
|
"select",
|
|
3233
3353
|
{
|
|
3234
3354
|
"aria-label": "Interpolation",
|
|
3235
3355
|
value: tool.interpolation,
|
|
3236
3356
|
onChange: (e) => tool.setInterpolation(e.target.value),
|
|
3237
3357
|
className: imageFieldClass,
|
|
3238
|
-
children: INTERPOLATIONS.map((i) => /* @__PURE__ */
|
|
3358
|
+
children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx18("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
|
|
3239
3359
|
}
|
|
3240
3360
|
)
|
|
3241
3361
|
] }),
|
|
3242
|
-
/* @__PURE__ */
|
|
3243
|
-
/* @__PURE__ */
|
|
3244
|
-
tool.error && /* @__PURE__ */
|
|
3362
|
+
/* @__PURE__ */ jsx18("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
|
|
3363
|
+
/* @__PURE__ */ jsx18("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
|
|
3364
|
+
tool.error && /* @__PURE__ */ jsx18("span", { role: "alert", className: "text-destructive", children: tool.error })
|
|
3245
3365
|
] });
|
|
3246
3366
|
};
|
|
3247
3367
|
|
|
3248
3368
|
// src/image-editor/ShapeOptionsBar.tsx
|
|
3249
|
-
import { useEffect as
|
|
3369
|
+
import { useEffect as useEffect12, useState as useState15 } from "react";
|
|
3250
3370
|
import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
|
|
3251
|
-
import { Fragment as Fragment4, jsx as
|
|
3371
|
+
import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3252
3372
|
var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
3253
|
-
const [, setTick] =
|
|
3254
|
-
|
|
3255
|
-
const [error, setError] =
|
|
3373
|
+
const [, setTick] = useState15(0);
|
|
3374
|
+
useEffect12(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
3375
|
+
const [error, setError] = useState15(null);
|
|
3256
3376
|
const active = controller.getActiveLayer();
|
|
3257
3377
|
const shapeId = active?.type === "shape" ? active.id : null;
|
|
3258
3378
|
const set = (change) => {
|
|
@@ -3266,22 +3386,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
3266
3386
|
}
|
|
3267
3387
|
};
|
|
3268
3388
|
const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
|
|
3269
|
-
return /* @__PURE__ */
|
|
3270
|
-
/* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ jsxs17("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
|
|
3390
|
+
/* @__PURE__ */ jsx19("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
|
|
3391
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
3392
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3393
|
+
/* @__PURE__ */ jsx19(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
|
|
3274
3394
|
"Fill",
|
|
3275
|
-
/* @__PURE__ */
|
|
3395
|
+
/* @__PURE__ */ jsx19(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
|
|
3276
3396
|
] }),
|
|
3277
|
-
/* @__PURE__ */
|
|
3278
|
-
/* @__PURE__ */
|
|
3397
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3398
|
+
/* @__PURE__ */ jsx19(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
|
|
3279
3399
|
"Stroke",
|
|
3280
|
-
/* @__PURE__ */
|
|
3400
|
+
/* @__PURE__ */ jsx19(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
|
|
3281
3401
|
] }),
|
|
3282
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3283
3403
|
"Width",
|
|
3284
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsx19(
|
|
3285
3405
|
"input",
|
|
3286
3406
|
{
|
|
3287
3407
|
type: "number",
|
|
@@ -3295,51 +3415,51 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
|
|
|
3295
3415
|
)
|
|
3296
3416
|
] })
|
|
3297
3417
|
] }),
|
|
3298
|
-
/* @__PURE__ */
|
|
3299
|
-
options.kind === "rect" && /* @__PURE__ */
|
|
3418
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
3419
|
+
options.kind === "rect" && /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3300
3420
|
"Radius",
|
|
3301
|
-
/* @__PURE__ */
|
|
3421
|
+
/* @__PURE__ */ jsx19("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
|
|
3302
3422
|
] }),
|
|
3303
|
-
options.kind === "polygon" && /* @__PURE__ */
|
|
3423
|
+
options.kind === "polygon" && /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3304
3424
|
"Sides",
|
|
3305
|
-
/* @__PURE__ */
|
|
3425
|
+
/* @__PURE__ */ jsx19("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
|
|
3306
3426
|
] }),
|
|
3307
|
-
options.kind === "star" && /* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */
|
|
3427
|
+
options.kind === "star" && /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
3428
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3309
3429
|
"Points",
|
|
3310
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ jsx19("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
|
|
3311
3431
|
] }),
|
|
3312
|
-
/* @__PURE__ */
|
|
3432
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3313
3433
|
"Inner",
|
|
3314
|
-
/* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ jsx19(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
|
|
3315
3435
|
] })
|
|
3316
3436
|
] }),
|
|
3317
|
-
options.kind === "line" && /* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3437
|
+
options.kind === "line" && /* @__PURE__ */ jsxs17(Fragment4, { children: [
|
|
3438
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3319
3439
|
"Weight",
|
|
3320
|
-
/* @__PURE__ */
|
|
3440
|
+
/* @__PURE__ */ jsx19("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
|
|
3321
3441
|
] }),
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3442
|
+
/* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
|
|
3443
|
+
/* @__PURE__ */ jsx19(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
|
|
3324
3444
|
"Arrowhead"
|
|
3325
3445
|
] })
|
|
3326
3446
|
] })
|
|
3327
3447
|
] }),
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
error && /* @__PURE__ */
|
|
3448
|
+
/* @__PURE__ */ jsx19("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
|
|
3449
|
+
error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
|
|
3330
3450
|
] });
|
|
3331
3451
|
};
|
|
3332
3452
|
|
|
3333
3453
|
// src/image-editor/TypeOptionsBar.tsx
|
|
3334
|
-
import { useEffect as
|
|
3454
|
+
import { useEffect as useEffect13, useState as useState16 } from "react";
|
|
3335
3455
|
import { TEXT_ALIGNS } from "@pixerate/editor/image-editor";
|
|
3336
|
-
import { jsx as
|
|
3456
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3337
3457
|
var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
|
|
3338
3458
|
var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
|
|
3339
|
-
const [, setTick] =
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
const [error, setError] =
|
|
3459
|
+
const [, setTick] = useState16(0);
|
|
3460
|
+
useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
|
|
3461
|
+
useEffect13(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
|
|
3462
|
+
const [error, setError] = useState16(null);
|
|
3343
3463
|
const active = controller.getActiveLayer();
|
|
3344
3464
|
const typeId = !session && active?.type === "type" ? active.id : null;
|
|
3345
3465
|
const here = session?.alive ? session.styleHere() : {};
|
|
@@ -3371,11 +3491,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
3371
3491
|
setError(e instanceof Error ? e.message : String(e));
|
|
3372
3492
|
}
|
|
3373
3493
|
};
|
|
3374
|
-
return /* @__PURE__ */
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
/* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ jsxs18("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
|
|
3495
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
3496
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
|
|
3377
3497
|
"Font",
|
|
3378
|
-
/* @__PURE__ */
|
|
3498
|
+
/* @__PURE__ */ jsx20(
|
|
3379
3499
|
"input",
|
|
3380
3500
|
{
|
|
3381
3501
|
list: "pixerate-type-fonts",
|
|
@@ -3385,11 +3505,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
3385
3505
|
className: "w-32 rounded border border-border bg-background px-1 py-0.5"
|
|
3386
3506
|
}
|
|
3387
3507
|
),
|
|
3388
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx20("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx20("option", { value: f }, f)) })
|
|
3389
3509
|
] }),
|
|
3390
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
|
|
3391
3511
|
"Size",
|
|
3392
|
-
/* @__PURE__ */
|
|
3512
|
+
/* @__PURE__ */ jsx20(
|
|
3393
3513
|
"input",
|
|
3394
3514
|
{
|
|
3395
3515
|
type: "number",
|
|
@@ -3402,24 +3522,24 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
|
|
|
3402
3522
|
}
|
|
3403
3523
|
)
|
|
3404
3524
|
] }),
|
|
3405
|
-
/* @__PURE__ */
|
|
3406
|
-
/* @__PURE__ */
|
|
3407
|
-
/* @__PURE__ */
|
|
3525
|
+
/* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
|
|
3526
|
+
/* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
|
|
3527
|
+
/* @__PURE__ */ jsx20(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
|
|
3408
3528
|
] }),
|
|
3409
|
-
/* @__PURE__ */
|
|
3410
|
-
/* @__PURE__ */
|
|
3411
|
-
missing.length > 0 && /* @__PURE__ */
|
|
3529
|
+
/* @__PURE__ */ jsx20("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
|
|
3530
|
+
/* @__PURE__ */ jsx20("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
|
|
3531
|
+
missing.length > 0 && /* @__PURE__ */ jsxs18("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
|
|
3412
3532
|
"Missing ",
|
|
3413
3533
|
missing.length === 1 ? "font" : "fonts",
|
|
3414
3534
|
": ",
|
|
3415
3535
|
missing.join(", ")
|
|
3416
3536
|
] }),
|
|
3417
|
-
error && /* @__PURE__ */
|
|
3537
|
+
error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error })
|
|
3418
3538
|
] });
|
|
3419
3539
|
};
|
|
3420
3540
|
|
|
3421
3541
|
// src/image-editor/ImageEditor.tsx
|
|
3422
|
-
import { Fragment as Fragment5, jsx as
|
|
3542
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3423
3543
|
var ImageEditor = ({
|
|
3424
3544
|
editor: externalEditor,
|
|
3425
3545
|
src,
|
|
@@ -3444,32 +3564,32 @@ var ImageEditor = ({
|
|
|
3444
3564
|
return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
|
|
3445
3565
|
});
|
|
3446
3566
|
const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
|
|
3447
|
-
const [activeTab, setActiveTab] =
|
|
3448
|
-
const rootRef =
|
|
3567
|
+
const [activeTab, setActiveTab] = useState17("crop");
|
|
3568
|
+
const rootRef = useRef8(null);
|
|
3449
3569
|
const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
|
|
3450
|
-
const activeTabRef =
|
|
3570
|
+
const activeTabRef = useRef8(activeTab);
|
|
3451
3571
|
activeTabRef.current = activeTab;
|
|
3452
3572
|
const openPanel = async (ref) => {
|
|
3453
3573
|
if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
|
|
3454
3574
|
rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
|
|
3455
3575
|
await new Promise((resolve) => setTimeout(resolve, 60));
|
|
3456
3576
|
};
|
|
3457
|
-
const [activeCropRatio, setActiveCropRatio] =
|
|
3458
|
-
const [selectionOptions, setSelectionOptions] =
|
|
3459
|
-
const [shapeOptions, setShapeOptions] =
|
|
3460
|
-
const [typeOptions, setTypeOptions] =
|
|
3461
|
-
const [typeSession, setTypeSession] =
|
|
3462
|
-
const [selectionError, setSelectionError] =
|
|
3463
|
-
const [paintError, setPaintError] =
|
|
3464
|
-
const [shapeTypeError, setShapeTypeError] =
|
|
3577
|
+
const [activeCropRatio, setActiveCropRatio] = useState17(null);
|
|
3578
|
+
const [selectionOptions, setSelectionOptions] = useState17(DEFAULT_SELECTION_TOOL_OPTIONS2);
|
|
3579
|
+
const [shapeOptions, setShapeOptions] = useState17(DEFAULT_SHAPE_TOOL_OPTIONS2);
|
|
3580
|
+
const [typeOptions, setTypeOptions] = useState17(DEFAULT_TYPE_TOOL_OPTIONS2);
|
|
3581
|
+
const [typeSession, setTypeSession] = useState17(null);
|
|
3582
|
+
const [selectionError, setSelectionError] = useState17(null);
|
|
3583
|
+
const [paintError, setPaintError] = useState17(null);
|
|
3584
|
+
const [shapeTypeError, setShapeTypeError] = useState17(null);
|
|
3465
3585
|
const handleCanvasError = (source, message) => {
|
|
3466
3586
|
if (source === "paint") setPaintError(message);
|
|
3467
3587
|
else if (source === "select") setSelectionError(message);
|
|
3468
3588
|
else setShapeTypeError(message);
|
|
3469
3589
|
};
|
|
3470
3590
|
const finishTyping = () => setTypeSession(null);
|
|
3471
|
-
const transformToolRef =
|
|
3472
|
-
const transformControllerRef =
|
|
3591
|
+
const transformToolRef = useRef8(null);
|
|
3592
|
+
const transformControllerRef = useRef8(controller);
|
|
3473
3593
|
if (!transformToolRef.current || transformControllerRef.current !== controller) {
|
|
3474
3594
|
transformToolRef.current?.cancel();
|
|
3475
3595
|
transformToolRef.current = new FreeTransformTool2(controller, {
|
|
@@ -3478,16 +3598,16 @@ var ImageEditor = ({
|
|
|
3478
3598
|
transformControllerRef.current = controller;
|
|
3479
3599
|
}
|
|
3480
3600
|
const transformTool = transformToolRef.current;
|
|
3481
|
-
const [, setTransformTick] =
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
const [inpaintPrompt, setInpaintPrompt] =
|
|
3485
|
-
const [inpaintMaskMode, setInpaintMaskMode] =
|
|
3486
|
-
const [isRemovingBg, setIsRemovingBg] =
|
|
3487
|
-
const [isInpainting, setIsInpainting] =
|
|
3488
|
-
const [aiError, setAiError] =
|
|
3489
|
-
const [aiSuccess, setAiSuccess] =
|
|
3490
|
-
const [aiTarget, setAiTarget] =
|
|
3601
|
+
const [, setTransformTick] = useState17(0);
|
|
3602
|
+
useEffect14(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
|
|
3603
|
+
useEffect14(() => () => transformToolRef.current?.cancel(), []);
|
|
3604
|
+
const [inpaintPrompt, setInpaintPrompt] = useState17("");
|
|
3605
|
+
const [inpaintMaskMode, setInpaintMaskMode] = useState17("annotations");
|
|
3606
|
+
const [isRemovingBg, setIsRemovingBg] = useState17(false);
|
|
3607
|
+
const [isInpainting, setIsInpainting] = useState17(false);
|
|
3608
|
+
const [aiError, setAiError] = useState17(null);
|
|
3609
|
+
const [aiSuccess, setAiSuccess] = useState17(null);
|
|
3610
|
+
const [aiTarget, setAiTarget] = useState17("auto");
|
|
3491
3611
|
const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
|
|
3492
3612
|
const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
|
|
3493
3613
|
const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
|
|
@@ -3550,11 +3670,11 @@ var ImageEditor = ({
|
|
|
3550
3670
|
setIsInpainting(false);
|
|
3551
3671
|
}
|
|
3552
3672
|
};
|
|
3553
|
-
const [activeColor, setActiveColor] =
|
|
3554
|
-
const [strokeWidth, setStrokeWidth] =
|
|
3555
|
-
const [fontSize, setFontSize] =
|
|
3556
|
-
const [textInput, setTextInput] =
|
|
3557
|
-
|
|
3673
|
+
const [activeColor, setActiveColor] = useState17("#ef4444");
|
|
3674
|
+
const [strokeWidth, setStrokeWidth] = useState17(3);
|
|
3675
|
+
const [fontSize, setFontSize] = useState17(24);
|
|
3676
|
+
const [textInput, setTextInput] = useState17("");
|
|
3677
|
+
useEffect14(() => {
|
|
3558
3678
|
if (activeTab === "crop" && editor.state.activeTool !== "crop") {
|
|
3559
3679
|
editor.setTool("crop");
|
|
3560
3680
|
}
|
|
@@ -3582,16 +3702,16 @@ var ImageEditor = ({
|
|
|
3582
3702
|
link.click();
|
|
3583
3703
|
}
|
|
3584
3704
|
};
|
|
3585
|
-
return /* @__PURE__ */
|
|
3705
|
+
return /* @__PURE__ */ jsxs19(
|
|
3586
3706
|
"div",
|
|
3587
3707
|
{
|
|
3588
3708
|
ref: rootRef,
|
|
3589
3709
|
className: `${imageEditorFrameClass} ${className}`,
|
|
3590
3710
|
style,
|
|
3591
3711
|
children: [
|
|
3592
|
-
/* @__PURE__ */
|
|
3593
|
-
/* @__PURE__ */
|
|
3594
|
-
/* @__PURE__ */
|
|
3712
|
+
/* @__PURE__ */ jsxs19("div", { className: imageEditorHeaderClass, children: [
|
|
3713
|
+
/* @__PURE__ */ jsxs19("div", { role: "tablist", className: imageTabListClass, children: [
|
|
3714
|
+
/* @__PURE__ */ jsx21(
|
|
3595
3715
|
"button",
|
|
3596
3716
|
{
|
|
3597
3717
|
type: "button",
|
|
@@ -3606,7 +3726,7 @@ var ImageEditor = ({
|
|
|
3606
3726
|
children: "Transform & Crop"
|
|
3607
3727
|
}
|
|
3608
3728
|
),
|
|
3609
|
-
/* @__PURE__ */
|
|
3729
|
+
/* @__PURE__ */ jsx21(
|
|
3610
3730
|
"button",
|
|
3611
3731
|
{
|
|
3612
3732
|
type: "button",
|
|
@@ -3621,7 +3741,7 @@ var ImageEditor = ({
|
|
|
3621
3741
|
children: "Adjustments"
|
|
3622
3742
|
}
|
|
3623
3743
|
),
|
|
3624
|
-
/* @__PURE__ */
|
|
3744
|
+
/* @__PURE__ */ jsx21(
|
|
3625
3745
|
"button",
|
|
3626
3746
|
{
|
|
3627
3747
|
type: "button",
|
|
@@ -3636,7 +3756,7 @@ var ImageEditor = ({
|
|
|
3636
3756
|
children: "Layers"
|
|
3637
3757
|
}
|
|
3638
3758
|
),
|
|
3639
|
-
/* @__PURE__ */
|
|
3759
|
+
/* @__PURE__ */ jsx21(
|
|
3640
3760
|
"button",
|
|
3641
3761
|
{
|
|
3642
3762
|
type: "button",
|
|
@@ -3651,7 +3771,7 @@ var ImageEditor = ({
|
|
|
3651
3771
|
children: "Paint"
|
|
3652
3772
|
}
|
|
3653
3773
|
),
|
|
3654
|
-
/* @__PURE__ */
|
|
3774
|
+
/* @__PURE__ */ jsx21(
|
|
3655
3775
|
"button",
|
|
3656
3776
|
{
|
|
3657
3777
|
type: "button",
|
|
@@ -3666,7 +3786,7 @@ var ImageEditor = ({
|
|
|
3666
3786
|
children: "Select & Mask"
|
|
3667
3787
|
}
|
|
3668
3788
|
),
|
|
3669
|
-
/* @__PURE__ */
|
|
3789
|
+
/* @__PURE__ */ jsx21(
|
|
3670
3790
|
"button",
|
|
3671
3791
|
{
|
|
3672
3792
|
type: "button",
|
|
@@ -3681,7 +3801,7 @@ var ImageEditor = ({
|
|
|
3681
3801
|
children: "Annotations"
|
|
3682
3802
|
}
|
|
3683
3803
|
),
|
|
3684
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsx21(
|
|
3685
3805
|
"button",
|
|
3686
3806
|
{
|
|
3687
3807
|
type: "button",
|
|
@@ -3696,7 +3816,7 @@ var ImageEditor = ({
|
|
|
3696
3816
|
children: "Depth Mask"
|
|
3697
3817
|
}
|
|
3698
3818
|
),
|
|
3699
|
-
/* @__PURE__ */
|
|
3819
|
+
/* @__PURE__ */ jsxs19(
|
|
3700
3820
|
"button",
|
|
3701
3821
|
{
|
|
3702
3822
|
type: "button",
|
|
@@ -3709,14 +3829,14 @@ var ImageEditor = ({
|
|
|
3709
3829
|
"aria-selected": activeTab === "ai",
|
|
3710
3830
|
className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
|
|
3711
3831
|
children: [
|
|
3712
|
-
/* @__PURE__ */
|
|
3832
|
+
/* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
|
|
3713
3833
|
"AI Tools"
|
|
3714
3834
|
]
|
|
3715
3835
|
}
|
|
3716
3836
|
)
|
|
3717
3837
|
] }),
|
|
3718
|
-
/* @__PURE__ */
|
|
3719
|
-
/* @__PURE__ */
|
|
3838
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
3839
|
+
/* @__PURE__ */ jsx21(
|
|
3720
3840
|
"button",
|
|
3721
3841
|
{
|
|
3722
3842
|
type: "button",
|
|
@@ -3727,7 +3847,7 @@ var ImageEditor = ({
|
|
|
3727
3847
|
children: "\u21A9"
|
|
3728
3848
|
}
|
|
3729
3849
|
),
|
|
3730
|
-
/* @__PURE__ */
|
|
3850
|
+
/* @__PURE__ */ jsx21(
|
|
3731
3851
|
"button",
|
|
3732
3852
|
{
|
|
3733
3853
|
type: "button",
|
|
@@ -3738,7 +3858,7 @@ var ImageEditor = ({
|
|
|
3738
3858
|
children: "\u21AA"
|
|
3739
3859
|
}
|
|
3740
3860
|
),
|
|
3741
|
-
/* @__PURE__ */
|
|
3861
|
+
/* @__PURE__ */ jsx21(
|
|
3742
3862
|
"button",
|
|
3743
3863
|
{
|
|
3744
3864
|
type: "button",
|
|
@@ -3747,8 +3867,8 @@ var ImageEditor = ({
|
|
|
3747
3867
|
children: "Reset"
|
|
3748
3868
|
}
|
|
3749
3869
|
),
|
|
3750
|
-
/* @__PURE__ */
|
|
3751
|
-
/* @__PURE__ */
|
|
3870
|
+
/* @__PURE__ */ jsx21("div", { className: "h-4 w-px bg-muted mx-1" }),
|
|
3871
|
+
/* @__PURE__ */ jsx21(
|
|
3752
3872
|
"button",
|
|
3753
3873
|
{
|
|
3754
3874
|
type: "button",
|
|
@@ -3758,11 +3878,11 @@ var ImageEditor = ({
|
|
|
3758
3878
|
children: "-"
|
|
3759
3879
|
}
|
|
3760
3880
|
),
|
|
3761
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsxs19("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
|
|
3762
3882
|
Math.round(state.zoom * 100),
|
|
3763
3883
|
"%"
|
|
3764
3884
|
] }),
|
|
3765
|
-
/* @__PURE__ */
|
|
3885
|
+
/* @__PURE__ */ jsx21(
|
|
3766
3886
|
"button",
|
|
3767
3887
|
{
|
|
3768
3888
|
type: "button",
|
|
@@ -3772,8 +3892,8 @@ var ImageEditor = ({
|
|
|
3772
3892
|
children: "+"
|
|
3773
3893
|
}
|
|
3774
3894
|
),
|
|
3775
|
-
/* @__PURE__ */
|
|
3776
|
-
/* @__PURE__ */
|
|
3895
|
+
/* @__PURE__ */ jsx21("div", { className: "h-4 w-px bg-muted mx-1" }),
|
|
3896
|
+
/* @__PURE__ */ jsx21(
|
|
3777
3897
|
"button",
|
|
3778
3898
|
{
|
|
3779
3899
|
type: "button",
|
|
@@ -3784,7 +3904,7 @@ var ImageEditor = ({
|
|
|
3784
3904
|
children: "Hold Compare"
|
|
3785
3905
|
}
|
|
3786
3906
|
),
|
|
3787
|
-
/* @__PURE__ */
|
|
3907
|
+
/* @__PURE__ */ jsx21(
|
|
3788
3908
|
"button",
|
|
3789
3909
|
{
|
|
3790
3910
|
type: "button",
|
|
@@ -3795,10 +3915,10 @@ var ImageEditor = ({
|
|
|
3795
3915
|
)
|
|
3796
3916
|
] })
|
|
3797
3917
|
] }),
|
|
3798
|
-
transformTool.active && /* @__PURE__ */
|
|
3799
|
-
!transformTool.active && transformTool.error && /* @__PURE__ */
|
|
3800
|
-
/* @__PURE__ */
|
|
3801
|
-
/* @__PURE__ */
|
|
3918
|
+
transformTool.active && /* @__PURE__ */ jsx21(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
|
|
3919
|
+
!transformTool.active && transformTool.error && /* @__PURE__ */ jsx21("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
|
|
3920
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
|
|
3921
|
+
/* @__PURE__ */ jsx21(
|
|
3802
3922
|
ImageEditorCanvas,
|
|
3803
3923
|
{
|
|
3804
3924
|
editor,
|
|
@@ -3822,11 +3942,11 @@ var ImageEditor = ({
|
|
|
3822
3942
|
className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
|
|
3823
3943
|
}
|
|
3824
3944
|
),
|
|
3825
|
-
/* @__PURE__ */
|
|
3826
|
-
activeTab === "crop" && /* @__PURE__ */
|
|
3827
|
-
/* @__PURE__ */
|
|
3828
|
-
/* @__PURE__ */
|
|
3829
|
-
/* @__PURE__ */
|
|
3945
|
+
/* @__PURE__ */ jsxs19("div", { className: imageSidebarClass, children: [
|
|
3946
|
+
activeTab === "crop" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
3947
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
|
|
3948
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-3 gap-2", children: [
|
|
3949
|
+
/* @__PURE__ */ jsx21(
|
|
3830
3950
|
"button",
|
|
3831
3951
|
{
|
|
3832
3952
|
type: "button",
|
|
@@ -3838,7 +3958,7 @@ var ImageEditor = ({
|
|
|
3838
3958
|
children: "Freeform"
|
|
3839
3959
|
}
|
|
3840
3960
|
),
|
|
3841
|
-
/* @__PURE__ */
|
|
3961
|
+
/* @__PURE__ */ jsx21(
|
|
3842
3962
|
"button",
|
|
3843
3963
|
{
|
|
3844
3964
|
type: "button",
|
|
@@ -3850,7 +3970,7 @@ var ImageEditor = ({
|
|
|
3850
3970
|
children: "1:1 Square"
|
|
3851
3971
|
}
|
|
3852
3972
|
),
|
|
3853
|
-
/* @__PURE__ */
|
|
3973
|
+
/* @__PURE__ */ jsx21(
|
|
3854
3974
|
"button",
|
|
3855
3975
|
{
|
|
3856
3976
|
type: "button",
|
|
@@ -3862,7 +3982,7 @@ var ImageEditor = ({
|
|
|
3862
3982
|
children: "4:3 Standard"
|
|
3863
3983
|
}
|
|
3864
3984
|
),
|
|
3865
|
-
/* @__PURE__ */
|
|
3985
|
+
/* @__PURE__ */ jsx21(
|
|
3866
3986
|
"button",
|
|
3867
3987
|
{
|
|
3868
3988
|
type: "button",
|
|
@@ -3874,7 +3994,7 @@ var ImageEditor = ({
|
|
|
3874
3994
|
children: "16:9 Wide"
|
|
3875
3995
|
}
|
|
3876
3996
|
),
|
|
3877
|
-
/* @__PURE__ */
|
|
3997
|
+
/* @__PURE__ */ jsx21(
|
|
3878
3998
|
"button",
|
|
3879
3999
|
{
|
|
3880
4000
|
type: "button",
|
|
@@ -3886,7 +4006,7 @@ var ImageEditor = ({
|
|
|
3886
4006
|
children: "3:2 Photo"
|
|
3887
4007
|
}
|
|
3888
4008
|
),
|
|
3889
|
-
/* @__PURE__ */
|
|
4009
|
+
/* @__PURE__ */ jsx21(
|
|
3890
4010
|
"button",
|
|
3891
4011
|
{
|
|
3892
4012
|
type: "button",
|
|
@@ -3899,10 +4019,10 @@ var ImageEditor = ({
|
|
|
3899
4019
|
}
|
|
3900
4020
|
)
|
|
3901
4021
|
] }),
|
|
3902
|
-
/* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3905
|
-
/* @__PURE__ */
|
|
4022
|
+
/* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
|
|
4023
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
|
|
4024
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
4025
|
+
/* @__PURE__ */ jsx21(
|
|
3906
4026
|
"button",
|
|
3907
4027
|
{
|
|
3908
4028
|
type: "button",
|
|
@@ -3911,7 +4031,7 @@ var ImageEditor = ({
|
|
|
3911
4031
|
children: "Rotate -90\xB0"
|
|
3912
4032
|
}
|
|
3913
4033
|
),
|
|
3914
|
-
/* @__PURE__ */
|
|
4034
|
+
/* @__PURE__ */ jsx21(
|
|
3915
4035
|
"button",
|
|
3916
4036
|
{
|
|
3917
4037
|
type: "button",
|
|
@@ -3920,7 +4040,7 @@ var ImageEditor = ({
|
|
|
3920
4040
|
children: "Rotate +90\xB0"
|
|
3921
4041
|
}
|
|
3922
4042
|
),
|
|
3923
|
-
/* @__PURE__ */
|
|
4043
|
+
/* @__PURE__ */ jsx21(
|
|
3924
4044
|
"button",
|
|
3925
4045
|
{
|
|
3926
4046
|
type: "button",
|
|
@@ -3929,7 +4049,7 @@ var ImageEditor = ({
|
|
|
3929
4049
|
children: "Flip Horizontal"
|
|
3930
4050
|
}
|
|
3931
4051
|
),
|
|
3932
|
-
/* @__PURE__ */
|
|
4052
|
+
/* @__PURE__ */ jsx21(
|
|
3933
4053
|
"button",
|
|
3934
4054
|
{
|
|
3935
4055
|
type: "button",
|
|
@@ -3940,10 +4060,10 @@ var ImageEditor = ({
|
|
|
3940
4060
|
)
|
|
3941
4061
|
] })
|
|
3942
4062
|
] }),
|
|
3943
|
-
activeTab === "adjust" && /* @__PURE__ */
|
|
3944
|
-
/* @__PURE__ */
|
|
3945
|
-
/* @__PURE__ */
|
|
3946
|
-
/* @__PURE__ */
|
|
4063
|
+
activeTab === "adjust" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
4064
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4065
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
|
|
4066
|
+
/* @__PURE__ */ jsx21(
|
|
3947
4067
|
"button",
|
|
3948
4068
|
{
|
|
3949
4069
|
type: "button",
|
|
@@ -3953,9 +4073,9 @@ var ImageEditor = ({
|
|
|
3953
4073
|
}
|
|
3954
4074
|
)
|
|
3955
4075
|
] }),
|
|
3956
|
-
/* @__PURE__ */
|
|
3957
|
-
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */
|
|
3958
|
-
/* @__PURE__ */
|
|
4076
|
+
/* @__PURE__ */ jsx21(Histogram, { histogram: editor.histogram }),
|
|
4077
|
+
IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs19(React16.Fragment, { children: [
|
|
4078
|
+
/* @__PURE__ */ jsx21(
|
|
3959
4079
|
ControlSlider,
|
|
3960
4080
|
{
|
|
3961
4081
|
spec,
|
|
@@ -3964,14 +4084,14 @@ var ImageEditor = ({
|
|
|
3964
4084
|
onChange: (v) => editor.setAdjustments({ [spec.id]: v })
|
|
3965
4085
|
}
|
|
3966
4086
|
),
|
|
3967
|
-
spec.id === "tint" && legacyProcess && /* @__PURE__ */
|
|
4087
|
+
spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs19(
|
|
3968
4088
|
"div",
|
|
3969
4089
|
{
|
|
3970
4090
|
className: "flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-600",
|
|
3971
4091
|
"data-testid": "image-editor-process-notice",
|
|
3972
4092
|
children: [
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
4093
|
+
/* @__PURE__ */ jsx21("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
|
|
4094
|
+
/* @__PURE__ */ jsx21(
|
|
3975
4095
|
"button",
|
|
3976
4096
|
{
|
|
3977
4097
|
type: "button",
|
|
@@ -3984,7 +4104,7 @@ var ImageEditor = ({
|
|
|
3984
4104
|
}
|
|
3985
4105
|
)
|
|
3986
4106
|
] }, spec.id)),
|
|
3987
|
-
/* @__PURE__ */
|
|
4107
|
+
/* @__PURE__ */ jsx21("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx21(
|
|
3988
4108
|
AdjustmentLayersPanel,
|
|
3989
4109
|
{
|
|
3990
4110
|
controller,
|
|
@@ -3993,9 +4113,9 @@ var ImageEditor = ({
|
|
|
3993
4113
|
}
|
|
3994
4114
|
) })
|
|
3995
4115
|
] }),
|
|
3996
|
-
activeTab === "layers" && /* @__PURE__ */
|
|
3997
|
-
/* @__PURE__ */
|
|
3998
|
-
/* @__PURE__ */
|
|
4116
|
+
activeTab === "layers" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
4117
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Layers" }),
|
|
4118
|
+
/* @__PURE__ */ jsx21(
|
|
3999
4119
|
"button",
|
|
4000
4120
|
{
|
|
4001
4121
|
type: "button",
|
|
@@ -4006,15 +4126,15 @@ var ImageEditor = ({
|
|
|
4006
4126
|
children: "Free Transform"
|
|
4007
4127
|
}
|
|
4008
4128
|
),
|
|
4009
|
-
/* @__PURE__ */
|
|
4010
|
-
effectsShown && /* @__PURE__ */
|
|
4011
|
-
/* @__PURE__ */
|
|
4012
|
-
/* @__PURE__ */
|
|
4129
|
+
/* @__PURE__ */ jsx21(LayersPanel, { controller }),
|
|
4130
|
+
effectsShown && /* @__PURE__ */ jsx21(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
|
|
4131
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Colour" }),
|
|
4132
|
+
/* @__PURE__ */ jsx21(ColorProfilePanel, { controller })
|
|
4013
4133
|
] }),
|
|
4014
|
-
activeTab === "paint" && /* @__PURE__ */
|
|
4015
|
-
/* @__PURE__ */
|
|
4016
|
-
/* @__PURE__ */
|
|
4017
|
-
/* @__PURE__ */
|
|
4134
|
+
activeTab === "paint" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
4135
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Paint" }),
|
|
4136
|
+
/* @__PURE__ */ jsx21(BrushOptionsBar, { controller }),
|
|
4137
|
+
/* @__PURE__ */ jsx21(
|
|
4018
4138
|
"button",
|
|
4019
4139
|
{
|
|
4020
4140
|
type: "button",
|
|
@@ -4025,12 +4145,12 @@ var ImageEditor = ({
|
|
|
4025
4145
|
children: "Free Transform"
|
|
4026
4146
|
}
|
|
4027
4147
|
),
|
|
4028
|
-
paintError && /* @__PURE__ */
|
|
4029
|
-
/* @__PURE__ */
|
|
4148
|
+
paintError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
|
|
4149
|
+
/* @__PURE__ */ jsx21("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx21(LayersPanel, { controller }) })
|
|
4030
4150
|
] }),
|
|
4031
|
-
activeTab === "annotate" && /* @__PURE__ */
|
|
4032
|
-
/* @__PURE__ */
|
|
4033
|
-
/* @__PURE__ */
|
|
4151
|
+
activeTab === "annotate" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
4152
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
|
|
4153
|
+
/* @__PURE__ */ jsx21("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx21(
|
|
4034
4154
|
"button",
|
|
4035
4155
|
{
|
|
4036
4156
|
type: "button",
|
|
@@ -4041,13 +4161,13 @@ var ImageEditor = ({
|
|
|
4041
4161
|
},
|
|
4042
4162
|
t
|
|
4043
4163
|
)) }),
|
|
4044
|
-
state.activeTool === "shape" && /* @__PURE__ */
|
|
4045
|
-
state.activeTool === "type" && /* @__PURE__ */
|
|
4046
|
-
state.activeTool === "type" && typeSession && /* @__PURE__ */
|
|
4047
|
-
shapeTypeError && /* @__PURE__ */
|
|
4048
|
-
/* @__PURE__ */
|
|
4049
|
-
/* @__PURE__ */
|
|
4050
|
-
/* @__PURE__ */
|
|
4164
|
+
state.activeTool === "shape" && /* @__PURE__ */ jsx21(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
|
|
4165
|
+
state.activeTool === "type" && /* @__PURE__ */ jsx21(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
|
|
4166
|
+
state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx21("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
|
|
4167
|
+
shapeTypeError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
|
|
4168
|
+
/* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
|
|
4169
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
|
|
4170
|
+
/* @__PURE__ */ jsx21("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx21(
|
|
4051
4171
|
"button",
|
|
4052
4172
|
{
|
|
4053
4173
|
type: "button",
|
|
@@ -4057,18 +4177,18 @@ var ImageEditor = ({
|
|
|
4057
4177
|
},
|
|
4058
4178
|
t
|
|
4059
4179
|
)) }),
|
|
4060
|
-
/* @__PURE__ */
|
|
4061
|
-
/* @__PURE__ */
|
|
4062
|
-
/* @__PURE__ */
|
|
4063
|
-
/* @__PURE__ */
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 mt-2", children: [
|
|
4181
|
+
/* @__PURE__ */ jsx21("label", { className: "text-muted-foreground", children: "Color:" }),
|
|
4182
|
+
/* @__PURE__ */ jsx21(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
|
|
4183
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-1 ml-2", children: [
|
|
4184
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
|
|
4185
|
+
/* @__PURE__ */ jsx21("span", { children: "Width:" }),
|
|
4186
|
+
/* @__PURE__ */ jsxs19("span", { className: "font-mono", children: [
|
|
4067
4187
|
strokeWidth,
|
|
4068
4188
|
"px"
|
|
4069
4189
|
] })
|
|
4070
4190
|
] }),
|
|
4071
|
-
/* @__PURE__ */
|
|
4191
|
+
/* @__PURE__ */ jsx21(
|
|
4072
4192
|
"input",
|
|
4073
4193
|
{
|
|
4074
4194
|
type: "range",
|
|
@@ -4081,10 +4201,10 @@ var ImageEditor = ({
|
|
|
4081
4201
|
)
|
|
4082
4202
|
] })
|
|
4083
4203
|
] }),
|
|
4084
|
-
/* @__PURE__ */
|
|
4085
|
-
/* @__PURE__ */
|
|
4086
|
-
/* @__PURE__ */
|
|
4087
|
-
/* @__PURE__ */
|
|
4204
|
+
/* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
|
|
4205
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Add Text" }),
|
|
4206
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
|
|
4207
|
+
/* @__PURE__ */ jsx21(
|
|
4088
4208
|
"input",
|
|
4089
4209
|
{
|
|
4090
4210
|
type: "text",
|
|
@@ -4095,7 +4215,7 @@ var ImageEditor = ({
|
|
|
4095
4215
|
className: "flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary"
|
|
4096
4216
|
}
|
|
4097
4217
|
),
|
|
4098
|
-
/* @__PURE__ */
|
|
4218
|
+
/* @__PURE__ */ jsx21(
|
|
4099
4219
|
"button",
|
|
4100
4220
|
{
|
|
4101
4221
|
type: "button",
|
|
@@ -4105,14 +4225,14 @@ var ImageEditor = ({
|
|
|
4105
4225
|
}
|
|
4106
4226
|
)
|
|
4107
4227
|
] }),
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between text-muted-foreground", children: [
|
|
4229
|
+
/* @__PURE__ */ jsx21("span", { children: "Font Size:" }),
|
|
4230
|
+
/* @__PURE__ */ jsxs19("span", { className: "font-mono", children: [
|
|
4111
4231
|
fontSize,
|
|
4112
4232
|
"px"
|
|
4113
4233
|
] })
|
|
4114
4234
|
] }),
|
|
4115
|
-
/* @__PURE__ */
|
|
4235
|
+
/* @__PURE__ */ jsx21(
|
|
4116
4236
|
"input",
|
|
4117
4237
|
{
|
|
4118
4238
|
type: "range",
|
|
@@ -4123,14 +4243,14 @@ var ImageEditor = ({
|
|
|
4123
4243
|
className: imageRangeClass
|
|
4124
4244
|
}
|
|
4125
4245
|
),
|
|
4126
|
-
/* @__PURE__ */
|
|
4127
|
-
/* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
|
|
4247
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4248
|
+
/* @__PURE__ */ jsxs19("span", { className: "text-muted-foreground", children: [
|
|
4129
4249
|
"Layers (",
|
|
4130
4250
|
state.annotations.length,
|
|
4131
4251
|
")"
|
|
4132
4252
|
] }),
|
|
4133
|
-
state.selectedAnnotationId && /* @__PURE__ */
|
|
4253
|
+
state.selectedAnnotationId && /* @__PURE__ */ jsx21(
|
|
4134
4254
|
"button",
|
|
4135
4255
|
{
|
|
4136
4256
|
type: "button",
|
|
@@ -4139,7 +4259,7 @@ var ImageEditor = ({
|
|
|
4139
4259
|
children: "Delete Selected"
|
|
4140
4260
|
}
|
|
4141
4261
|
),
|
|
4142
|
-
state.annotations.length > 0 && /* @__PURE__ */
|
|
4262
|
+
state.annotations.length > 0 && /* @__PURE__ */ jsx21(
|
|
4143
4263
|
"button",
|
|
4144
4264
|
{
|
|
4145
4265
|
type: "button",
|
|
@@ -4150,10 +4270,10 @@ var ImageEditor = ({
|
|
|
4150
4270
|
)
|
|
4151
4271
|
] })
|
|
4152
4272
|
] }),
|
|
4153
|
-
activeTab === "depth" && /* @__PURE__ */
|
|
4154
|
-
/* @__PURE__ */
|
|
4155
|
-
/* @__PURE__ */
|
|
4156
|
-
/* @__PURE__ */
|
|
4273
|
+
activeTab === "depth" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
|
|
4274
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4275
|
+
/* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
|
|
4276
|
+
/* @__PURE__ */ jsx21(
|
|
4157
4277
|
"button",
|
|
4158
4278
|
{
|
|
4159
4279
|
type: "button",
|
|
@@ -4163,8 +4283,8 @@ var ImageEditor = ({
|
|
|
4163
4283
|
}
|
|
4164
4284
|
)
|
|
4165
4285
|
] }),
|
|
4166
|
-
/* @__PURE__ */
|
|
4167
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
|
|
4287
|
+
/* @__PURE__ */ jsx21(
|
|
4168
4288
|
"input",
|
|
4169
4289
|
{
|
|
4170
4290
|
type: "checkbox",
|
|
@@ -4173,12 +4293,12 @@ var ImageEditor = ({
|
|
|
4173
4293
|
className: "rounded accent-primary"
|
|
4174
4294
|
}
|
|
4175
4295
|
),
|
|
4176
|
-
/* @__PURE__ */
|
|
4296
|
+
/* @__PURE__ */ jsx21("span", { children: "Enable Depth / Alpha Mask" })
|
|
4177
4297
|
] }),
|
|
4178
|
-
state.depthMask.enabled && /* @__PURE__ */
|
|
4179
|
-
/* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4298
|
+
state.depthMask.enabled && /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4299
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
4300
|
+
/* @__PURE__ */ jsx21("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
|
|
4301
|
+
/* @__PURE__ */ jsx21(
|
|
4182
4302
|
"input",
|
|
4183
4303
|
{
|
|
4184
4304
|
type: "text",
|
|
@@ -4189,8 +4309,8 @@ var ImageEditor = ({
|
|
|
4189
4309
|
}
|
|
4190
4310
|
)
|
|
4191
4311
|
] }),
|
|
4192
|
-
/* @__PURE__ */
|
|
4193
|
-
/* @__PURE__ */
|
|
4312
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
|
|
4313
|
+
/* @__PURE__ */ jsx21(
|
|
4194
4314
|
"button",
|
|
4195
4315
|
{
|
|
4196
4316
|
type: "button",
|
|
@@ -4199,7 +4319,7 @@ var ImageEditor = ({
|
|
|
4199
4319
|
children: "Threshold Mode"
|
|
4200
4320
|
}
|
|
4201
4321
|
),
|
|
4202
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ jsx21(
|
|
4203
4323
|
"button",
|
|
4204
4324
|
{
|
|
4205
4325
|
type: "button",
|
|
@@ -4209,12 +4329,12 @@ var ImageEditor = ({
|
|
|
4209
4329
|
}
|
|
4210
4330
|
)
|
|
4211
4331
|
] }),
|
|
4212
|
-
/* @__PURE__ */
|
|
4213
|
-
/* @__PURE__ */
|
|
4214
|
-
/* @__PURE__ */
|
|
4215
|
-
/* @__PURE__ */
|
|
4332
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
4333
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
4334
|
+
/* @__PURE__ */ jsx21("span", { children: "Depth Start (Lower):" }),
|
|
4335
|
+
/* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
|
|
4216
4336
|
] }),
|
|
4217
|
-
/* @__PURE__ */
|
|
4337
|
+
/* @__PURE__ */ jsx21(
|
|
4218
4338
|
"input",
|
|
4219
4339
|
{
|
|
4220
4340
|
type: "range",
|
|
@@ -4228,12 +4348,12 @@ var ImageEditor = ({
|
|
|
4228
4348
|
}
|
|
4229
4349
|
)
|
|
4230
4350
|
] }),
|
|
4231
|
-
/* @__PURE__ */
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
/* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4351
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
4352
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
4353
|
+
/* @__PURE__ */ jsx21("span", { children: "Depth Stop (Upper):" }),
|
|
4354
|
+
/* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
|
|
4235
4355
|
] }),
|
|
4236
|
-
/* @__PURE__ */
|
|
4356
|
+
/* @__PURE__ */ jsx21(
|
|
4237
4357
|
"input",
|
|
4238
4358
|
{
|
|
4239
4359
|
type: "range",
|
|
@@ -4247,12 +4367,12 @@ var ImageEditor = ({
|
|
|
4247
4367
|
}
|
|
4248
4368
|
)
|
|
4249
4369
|
] }),
|
|
4250
|
-
/* @__PURE__ */
|
|
4251
|
-
/* @__PURE__ */
|
|
4252
|
-
/* @__PURE__ */
|
|
4253
|
-
/* @__PURE__ */
|
|
4370
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
4371
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
|
|
4372
|
+
/* @__PURE__ */ jsx21("span", { children: "Softness:" }),
|
|
4373
|
+
/* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.softness })
|
|
4254
4374
|
] }),
|
|
4255
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsx21(
|
|
4256
4376
|
"input",
|
|
4257
4377
|
{
|
|
4258
4378
|
type: "range",
|
|
@@ -4264,8 +4384,8 @@ var ImageEditor = ({
|
|
|
4264
4384
|
}
|
|
4265
4385
|
)
|
|
4266
4386
|
] }),
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4387
|
+
/* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
|
|
4388
|
+
/* @__PURE__ */ jsx21(
|
|
4269
4389
|
"input",
|
|
4270
4390
|
{
|
|
4271
4391
|
type: "checkbox",
|
|
@@ -4274,12 +4394,12 @@ var ImageEditor = ({
|
|
|
4274
4394
|
className: "rounded accent-primary"
|
|
4275
4395
|
}
|
|
4276
4396
|
),
|
|
4277
|
-
/* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ jsx21("span", { children: "Invert Mask" })
|
|
4278
4398
|
] })
|
|
4279
4399
|
] })
|
|
4280
4400
|
] }),
|
|
4281
|
-
activeTab === "select" && /* @__PURE__ */
|
|
4282
|
-
/* @__PURE__ */
|
|
4401
|
+
activeTab === "select" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
4402
|
+
/* @__PURE__ */ jsx21(
|
|
4283
4403
|
SelectionOptionsBar,
|
|
4284
4404
|
{
|
|
4285
4405
|
controller,
|
|
@@ -4290,9 +4410,9 @@ var ImageEditor = ({
|
|
|
4290
4410
|
selectionDisplay: state.selectionDisplay
|
|
4291
4411
|
}
|
|
4292
4412
|
),
|
|
4293
|
-
selectionError && /* @__PURE__ */
|
|
4294
|
-
/* @__PURE__ */
|
|
4295
|
-
/* @__PURE__ */
|
|
4413
|
+
selectionError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: selectionError }),
|
|
4414
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-1", children: [
|
|
4415
|
+
/* @__PURE__ */ jsx21(
|
|
4296
4416
|
"button",
|
|
4297
4417
|
{
|
|
4298
4418
|
type: "button",
|
|
@@ -4303,7 +4423,7 @@ var ImageEditor = ({
|
|
|
4303
4423
|
children: "Transform Selection"
|
|
4304
4424
|
}
|
|
4305
4425
|
),
|
|
4306
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ jsx21(
|
|
4307
4427
|
"button",
|
|
4308
4428
|
{
|
|
4309
4429
|
type: "button",
|
|
@@ -4315,12 +4435,13 @@ var ImageEditor = ({
|
|
|
4315
4435
|
}
|
|
4316
4436
|
)
|
|
4317
4437
|
] }),
|
|
4318
|
-
/* @__PURE__ */
|
|
4438
|
+
/* @__PURE__ */ jsx21(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
|
|
4439
|
+
/* @__PURE__ */ jsx21(ChannelsPanel, { controller })
|
|
4319
4440
|
] }),
|
|
4320
|
-
activeTab === "ai" && /* @__PURE__ */
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4323
|
-
/* @__PURE__ */
|
|
4441
|
+
activeTab === "ai" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
|
|
4442
|
+
/* @__PURE__ */ jsxs19("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
|
|
4443
|
+
/* @__PURE__ */ jsx21("span", { children: "Results go to" }),
|
|
4444
|
+
/* @__PURE__ */ jsxs19(
|
|
4324
4445
|
"select",
|
|
4325
4446
|
{
|
|
4326
4447
|
"aria-label": "AI result target",
|
|
@@ -4328,54 +4449,54 @@ var ImageEditor = ({
|
|
|
4328
4449
|
onChange: (e) => setAiTarget(e.target.value),
|
|
4329
4450
|
className: imageSelectClass,
|
|
4330
4451
|
children: [
|
|
4331
|
-
/* @__PURE__ */
|
|
4332
|
-
/* @__PURE__ */
|
|
4333
|
-
/* @__PURE__ */
|
|
4452
|
+
/* @__PURE__ */ jsx21("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
|
|
4453
|
+
/* @__PURE__ */ jsx21("option", { value: "new-layer", children: "New layer / mask" }),
|
|
4454
|
+
/* @__PURE__ */ jsx21("option", { value: "replace", children: "Replace image" })
|
|
4334
4455
|
]
|
|
4335
4456
|
}
|
|
4336
4457
|
)
|
|
4337
4458
|
] }),
|
|
4338
|
-
/* @__PURE__ */
|
|
4339
|
-
/* @__PURE__ */
|
|
4340
|
-
/* @__PURE__ */
|
|
4341
|
-
/* @__PURE__ */
|
|
4459
|
+
/* @__PURE__ */ jsxs19("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
|
|
4460
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4461
|
+
/* @__PURE__ */ jsxs19("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
4462
|
+
/* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
|
|
4342
4463
|
"Background Removal"
|
|
4343
4464
|
] }),
|
|
4344
|
-
isRemovingBg && /* @__PURE__ */
|
|
4465
|
+
isRemovingBg && /* @__PURE__ */ jsx21("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
|
|
4345
4466
|
] }),
|
|
4346
|
-
/* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4467
|
+
/* @__PURE__ */ jsx21("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
|
|
4468
|
+
/* @__PURE__ */ jsx21(
|
|
4348
4469
|
"button",
|
|
4349
4470
|
{
|
|
4350
4471
|
type: "button",
|
|
4351
4472
|
onClick: handleRemoveBackground,
|
|
4352
4473
|
disabled: isRemovingBg || isInpainting,
|
|
4353
4474
|
className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
4354
|
-
children: isRemovingBg ? /* @__PURE__ */
|
|
4355
|
-
/* @__PURE__ */
|
|
4475
|
+
children: isRemovingBg ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4476
|
+
/* @__PURE__ */ jsx21("div", { className: imageSpinnerClass }),
|
|
4356
4477
|
"Removing Background..."
|
|
4357
|
-
] }) : /* @__PURE__ */
|
|
4358
|
-
/* @__PURE__ */
|
|
4478
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4479
|
+
/* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
|
|
4359
4480
|
"Remove Background"
|
|
4360
4481
|
] })
|
|
4361
4482
|
}
|
|
4362
4483
|
)
|
|
4363
4484
|
] }),
|
|
4364
|
-
/* @__PURE__ */
|
|
4365
|
-
/* @__PURE__ */
|
|
4366
|
-
/* @__PURE__ */
|
|
4367
|
-
/* @__PURE__ */
|
|
4368
|
-
/* @__PURE__ */
|
|
4369
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ jsxs19("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
|
|
4486
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
|
|
4487
|
+
/* @__PURE__ */ jsxs19("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
|
|
4488
|
+
/* @__PURE__ */ jsxs19("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
4489
|
+
/* @__PURE__ */ jsx21("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" }),
|
|
4490
|
+
/* @__PURE__ */ jsx21("path", { d: "m14 7 3 3" })
|
|
4370
4491
|
] }),
|
|
4371
4492
|
"Generative Inpainting"
|
|
4372
4493
|
] }),
|
|
4373
|
-
isInpainting && /* @__PURE__ */
|
|
4494
|
+
isInpainting && /* @__PURE__ */ jsx21("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
|
|
4374
4495
|
] }),
|
|
4375
|
-
/* @__PURE__ */
|
|
4376
|
-
/* @__PURE__ */
|
|
4377
|
-
/* @__PURE__ */
|
|
4378
|
-
/* @__PURE__ */
|
|
4496
|
+
/* @__PURE__ */ jsx21("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
|
|
4497
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1", children: [
|
|
4498
|
+
/* @__PURE__ */ jsx21("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
|
|
4499
|
+
/* @__PURE__ */ jsx21(
|
|
4379
4500
|
"textarea",
|
|
4380
4501
|
{
|
|
4381
4502
|
id: "ai-inpaint-prompt-react",
|
|
@@ -4387,10 +4508,10 @@ var ImageEditor = ({
|
|
|
4387
4508
|
}
|
|
4388
4509
|
)
|
|
4389
4510
|
] }),
|
|
4390
|
-
/* @__PURE__ */
|
|
4391
|
-
/* @__PURE__ */
|
|
4392
|
-
/* @__PURE__ */
|
|
4393
|
-
/* @__PURE__ */
|
|
4511
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1", children: [
|
|
4512
|
+
/* @__PURE__ */ jsx21("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
|
|
4513
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-2 gap-1.5", children: [
|
|
4514
|
+
/* @__PURE__ */ jsxs19(
|
|
4394
4515
|
"button",
|
|
4395
4516
|
{
|
|
4396
4517
|
type: "button",
|
|
@@ -4403,7 +4524,7 @@ var ImageEditor = ({
|
|
|
4403
4524
|
]
|
|
4404
4525
|
}
|
|
4405
4526
|
),
|
|
4406
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsxs19(
|
|
4407
4528
|
"button",
|
|
4408
4529
|
{
|
|
4409
4530
|
type: "button",
|
|
@@ -4418,25 +4539,25 @@ var ImageEditor = ({
|
|
|
4418
4539
|
)
|
|
4419
4540
|
] })
|
|
4420
4541
|
] }),
|
|
4421
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx21(
|
|
4422
4543
|
"button",
|
|
4423
4544
|
{
|
|
4424
4545
|
type: "button",
|
|
4425
4546
|
onClick: handleInpaint,
|
|
4426
4547
|
disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
|
|
4427
4548
|
className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
|
|
4428
|
-
children: isInpainting ? /* @__PURE__ */
|
|
4429
|
-
/* @__PURE__ */
|
|
4549
|
+
children: isInpainting ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4550
|
+
/* @__PURE__ */ jsx21("div", { className: imageSpinnerClass }),
|
|
4430
4551
|
"Generating Inpaint..."
|
|
4431
|
-
] }) : /* @__PURE__ */
|
|
4432
|
-
/* @__PURE__ */
|
|
4552
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4553
|
+
/* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
|
|
4433
4554
|
"Apply Inpainting"
|
|
4434
4555
|
] })
|
|
4435
4556
|
}
|
|
4436
4557
|
)
|
|
4437
4558
|
] }),
|
|
4438
|
-
aiError && /* @__PURE__ */
|
|
4439
|
-
aiSuccess && /* @__PURE__ */
|
|
4559
|
+
aiError && /* @__PURE__ */ jsx21("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
|
|
4560
|
+
aiSuccess && /* @__PURE__ */ jsx21("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
|
|
4440
4561
|
] })
|
|
4441
4562
|
] })
|
|
4442
4563
|
] })
|
|
@@ -4469,6 +4590,7 @@ export {
|
|
|
4469
4590
|
ColorProfilePanel,
|
|
4470
4591
|
SelectionOptionsBar,
|
|
4471
4592
|
RefineEdgePanel,
|
|
4593
|
+
ChannelsPanel,
|
|
4472
4594
|
FreeTransformOptionsBar,
|
|
4473
4595
|
ShapeOptionsBar,
|
|
4474
4596
|
TypeOptionsBar,
|