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