@pixerate/editor-react 0.137.0 → 0.138.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.
|
@@ -190,7 +190,7 @@ function useImageEffectsTools(registry, controller, options = {}) {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
// src/image-editor/ImageEditor.tsx
|
|
193
|
-
import React17, { useRef as
|
|
193
|
+
import React17, { useRef as useRef10, useEffect as useEffect15, useState as useState18 } from "react";
|
|
194
194
|
import {
|
|
195
195
|
normalizeProcessVersion,
|
|
196
196
|
LATEST_PROCESS_VERSION,
|
|
@@ -2663,7 +2663,7 @@ var ColorProfilePanel = ({ controller, className }) => {
|
|
|
2663
2663
|
};
|
|
2664
2664
|
|
|
2665
2665
|
// src/image-editor/SelectionOptionsBar.tsx
|
|
2666
|
-
import { useState as useState12 } from "react";
|
|
2666
|
+
import { useRef as useRef8, useState as useState12 } from "react";
|
|
2667
2667
|
import {
|
|
2668
2668
|
COLOR_RANGE_PRESETS,
|
|
2669
2669
|
COLOR_RANGE_PRESET_LABELS,
|
|
@@ -2799,7 +2799,8 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
2799
2799
|
/* @__PURE__ */ jsxs13("span", { className: "font-mono text-muted-foreground", children: [
|
|
2800
2800
|
Math.round(zoom * 100),
|
|
2801
2801
|
"%"
|
|
2802
|
-
] })
|
|
2802
|
+
] }),
|
|
2803
|
+
session.computing && /* @__PURE__ */ jsx15("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
|
|
2803
2804
|
] }),
|
|
2804
2805
|
/* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx15(
|
|
2805
2806
|
"canvas",
|
|
@@ -2999,6 +3000,19 @@ var SelectionOptionsBar = ({
|
|
|
2999
3000
|
setRangeStatus(err instanceof Error ? err.message : String(err));
|
|
3000
3001
|
}
|
|
3001
3002
|
};
|
|
3003
|
+
const [task, setTask] = useState12(null);
|
|
3004
|
+
const taskAbort = useRef8(null);
|
|
3005
|
+
const tracked = () => {
|
|
3006
|
+
const abort = new AbortController();
|
|
3007
|
+
taskAbort.current = abort;
|
|
3008
|
+
setTask({ stage: "Starting", fraction: 0 });
|
|
3009
|
+
return { signal: abort.signal, onProgress: (fraction, stage) => setTask({ stage, fraction }) };
|
|
3010
|
+
};
|
|
3011
|
+
const untrack = () => {
|
|
3012
|
+
taskAbort.current = null;
|
|
3013
|
+
setTask(null);
|
|
3014
|
+
};
|
|
3015
|
+
const failure = (err) => err?.name === "AbortError" ? "Cancelled." : err instanceof Error ? err.message : String(err);
|
|
3002
3016
|
const [subject, setSubject] = useState12("");
|
|
3003
3017
|
const [segmenting, setSegmenting] = useState12(false);
|
|
3004
3018
|
const [subjectStatus, setSubjectStatus] = useState12(null);
|
|
@@ -3009,11 +3023,12 @@ var SelectionOptionsBar = ({
|
|
|
3009
3023
|
setSegmenting(true);
|
|
3010
3024
|
setSubjectStatus(null);
|
|
3011
3025
|
try {
|
|
3012
|
-
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
|
|
3026
|
+
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode, ...tracked() });
|
|
3013
3027
|
setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
|
|
3014
3028
|
} catch (err) {
|
|
3015
|
-
setSubjectStatus(
|
|
3029
|
+
setSubjectStatus(failure(err));
|
|
3016
3030
|
} finally {
|
|
3031
|
+
untrack();
|
|
3017
3032
|
setSegmenting(false);
|
|
3018
3033
|
}
|
|
3019
3034
|
};
|
|
@@ -3025,11 +3040,12 @@ var SelectionOptionsBar = ({
|
|
|
3025
3040
|
setSkying(true);
|
|
3026
3041
|
setSkyStatus(null);
|
|
3027
3042
|
try {
|
|
3028
|
-
const { note } = await controller.selectSky({ mode: options.mode });
|
|
3043
|
+
const { note } = await controller.selectSky({ mode: options.mode, ...tracked() });
|
|
3029
3044
|
setSkyStatus(note ?? null);
|
|
3030
3045
|
} catch (err) {
|
|
3031
|
-
setSkyStatus(
|
|
3046
|
+
setSkyStatus(failure(err));
|
|
3032
3047
|
} finally {
|
|
3048
|
+
untrack();
|
|
3033
3049
|
setSkying(false);
|
|
3034
3050
|
}
|
|
3035
3051
|
};
|
|
@@ -3044,12 +3060,14 @@ var SelectionOptionsBar = ({
|
|
|
3044
3060
|
range: options.focusRange ?? 50,
|
|
3045
3061
|
noise: options.focusNoise ?? 0,
|
|
3046
3062
|
softness: options.focusSoftness ?? 4,
|
|
3047
|
-
mode: options.mode
|
|
3063
|
+
mode: options.mode,
|
|
3064
|
+
...tracked()
|
|
3048
3065
|
});
|
|
3049
3066
|
setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
|
|
3050
3067
|
} catch (err) {
|
|
3051
|
-
setFocusStatus(
|
|
3068
|
+
setFocusStatus(failure(err));
|
|
3052
3069
|
} finally {
|
|
3070
|
+
untrack();
|
|
3053
3071
|
setFocusing(false);
|
|
3054
3072
|
}
|
|
3055
3073
|
};
|
|
@@ -3313,6 +3331,22 @@ var SelectionOptionsBar = ({
|
|
|
3313
3331
|
]
|
|
3314
3332
|
}
|
|
3315
3333
|
),
|
|
3334
|
+
task && /* @__PURE__ */ jsxs14("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
|
|
3335
|
+
/* @__PURE__ */ jsx16(
|
|
3336
|
+
"div",
|
|
3337
|
+
{
|
|
3338
|
+
role: "progressbar",
|
|
3339
|
+
"aria-label": task.stage,
|
|
3340
|
+
"aria-valuemin": 0,
|
|
3341
|
+
"aria-valuemax": 100,
|
|
3342
|
+
"aria-valuenow": Math.round(task.fraction * 100),
|
|
3343
|
+
className: "flex-1 h-1.5 rounded bg-muted overflow-hidden",
|
|
3344
|
+
children: /* @__PURE__ */ jsx16("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
|
|
3345
|
+
}
|
|
3346
|
+
),
|
|
3347
|
+
/* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: task.stage }),
|
|
3348
|
+
/* @__PURE__ */ jsx16("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
|
|
3349
|
+
] }),
|
|
3316
3350
|
/* @__PURE__ */ jsx16("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
|
|
3317
3351
|
workspace && /* @__PURE__ */ jsx16(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
|
|
3318
3352
|
/* @__PURE__ */ jsxs14("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
|
|
@@ -3643,12 +3677,12 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
|
|
|
3643
3677
|
};
|
|
3644
3678
|
|
|
3645
3679
|
// src/image-editor/ChannelsPanel.tsx
|
|
3646
|
-
import { useEffect as useEffect11, useRef as
|
|
3680
|
+
import { useEffect as useEffect11, useRef as useRef9, useState as useState14 } from "react";
|
|
3647
3681
|
import { MASK_FILE_ACCEPT, channelThumbnail, downloadMaskImage, openMaskFile, selectionModeFromModifiers } from "@pixerate/editor/image-editor";
|
|
3648
3682
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3649
3683
|
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"}`;
|
|
3650
3684
|
var ChannelThumb = ({ channel, size }) => {
|
|
3651
|
-
const ref =
|
|
3685
|
+
const ref = useRef9(null);
|
|
3652
3686
|
useEffect11(() => {
|
|
3653
3687
|
const canvas = ref.current;
|
|
3654
3688
|
const ctx = canvas?.getContext("2d");
|
|
@@ -3668,7 +3702,7 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
|
|
|
3668
3702
|
const [activeId, setActiveId] = useState14(null);
|
|
3669
3703
|
const [renaming, setRenaming] = useState14(null);
|
|
3670
3704
|
const [error, setError] = useState14(null);
|
|
3671
|
-
const fileInput =
|
|
3705
|
+
const fileInput = useRef9(null);
|
|
3672
3706
|
const channels = controller.getChannels();
|
|
3673
3707
|
const active = channels.find((c) => c.id === activeId) ?? null;
|
|
3674
3708
|
const hasSelection = Boolean(controller.getSelection());
|
|
@@ -4167,9 +4201,9 @@ var ImageEditor = ({
|
|
|
4167
4201
|
});
|
|
4168
4202
|
const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
|
|
4169
4203
|
const [activeTab, setActiveTab] = useState18("crop");
|
|
4170
|
-
const rootRef =
|
|
4204
|
+
const rootRef = useRef10(null);
|
|
4171
4205
|
const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
|
|
4172
|
-
const activeTabRef =
|
|
4206
|
+
const activeTabRef = useRef10(activeTab);
|
|
4173
4207
|
activeTabRef.current = activeTab;
|
|
4174
4208
|
const openPanel = async (ref) => {
|
|
4175
4209
|
if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
|
|
@@ -4190,8 +4224,8 @@ var ImageEditor = ({
|
|
|
4190
4224
|
else setShapeTypeError(message);
|
|
4191
4225
|
};
|
|
4192
4226
|
const finishTyping = () => setTypeSession(null);
|
|
4193
|
-
const transformToolRef =
|
|
4194
|
-
const transformControllerRef =
|
|
4227
|
+
const transformToolRef = useRef10(null);
|
|
4228
|
+
const transformControllerRef = useRef10(controller);
|
|
4195
4229
|
if (!transformToolRef.current || transformControllerRef.current !== controller) {
|
|
4196
4230
|
transformToolRef.current?.cancel();
|
|
4197
4231
|
transformToolRef.current = new FreeTransformTool2(controller, {
|
|
@@ -4731,7 +4731,8 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
4731
4731
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "font-mono text-muted-foreground", children: [
|
|
4732
4732
|
Math.round(zoom * 100),
|
|
4733
4733
|
"%"
|
|
4734
|
-
] })
|
|
4734
|
+
] }),
|
|
4735
|
+
session.computing && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
|
|
4735
4736
|
] }),
|
|
4736
4737
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4737
4738
|
"canvas",
|
|
@@ -4931,6 +4932,19 @@ var SelectionOptionsBar = ({
|
|
|
4931
4932
|
setRangeStatus(err instanceof Error ? err.message : String(err));
|
|
4932
4933
|
}
|
|
4933
4934
|
};
|
|
4935
|
+
const [task, setTask] = (0, import_react26.useState)(null);
|
|
4936
|
+
const taskAbort = (0, import_react26.useRef)(null);
|
|
4937
|
+
const tracked = () => {
|
|
4938
|
+
const abort = new AbortController();
|
|
4939
|
+
taskAbort.current = abort;
|
|
4940
|
+
setTask({ stage: "Starting", fraction: 0 });
|
|
4941
|
+
return { signal: abort.signal, onProgress: (fraction, stage) => setTask({ stage, fraction }) };
|
|
4942
|
+
};
|
|
4943
|
+
const untrack = () => {
|
|
4944
|
+
taskAbort.current = null;
|
|
4945
|
+
setTask(null);
|
|
4946
|
+
};
|
|
4947
|
+
const failure = (err) => err?.name === "AbortError" ? "Cancelled." : err instanceof Error ? err.message : String(err);
|
|
4934
4948
|
const [subject, setSubject] = (0, import_react26.useState)("");
|
|
4935
4949
|
const [segmenting, setSegmenting] = (0, import_react26.useState)(false);
|
|
4936
4950
|
const [subjectStatus, setSubjectStatus] = (0, import_react26.useState)(null);
|
|
@@ -4941,11 +4955,12 @@ var SelectionOptionsBar = ({
|
|
|
4941
4955
|
setSegmenting(true);
|
|
4942
4956
|
setSubjectStatus(null);
|
|
4943
4957
|
try {
|
|
4944
|
-
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
|
|
4958
|
+
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode, ...tracked() });
|
|
4945
4959
|
setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
|
|
4946
4960
|
} catch (err) {
|
|
4947
|
-
setSubjectStatus(
|
|
4961
|
+
setSubjectStatus(failure(err));
|
|
4948
4962
|
} finally {
|
|
4963
|
+
untrack();
|
|
4949
4964
|
setSegmenting(false);
|
|
4950
4965
|
}
|
|
4951
4966
|
};
|
|
@@ -4957,11 +4972,12 @@ var SelectionOptionsBar = ({
|
|
|
4957
4972
|
setSkying(true);
|
|
4958
4973
|
setSkyStatus(null);
|
|
4959
4974
|
try {
|
|
4960
|
-
const { note } = await controller.selectSky({ mode: options.mode });
|
|
4975
|
+
const { note } = await controller.selectSky({ mode: options.mode, ...tracked() });
|
|
4961
4976
|
setSkyStatus(note ?? null);
|
|
4962
4977
|
} catch (err) {
|
|
4963
|
-
setSkyStatus(
|
|
4978
|
+
setSkyStatus(failure(err));
|
|
4964
4979
|
} finally {
|
|
4980
|
+
untrack();
|
|
4965
4981
|
setSkying(false);
|
|
4966
4982
|
}
|
|
4967
4983
|
};
|
|
@@ -4976,12 +4992,14 @@ var SelectionOptionsBar = ({
|
|
|
4976
4992
|
range: options.focusRange ?? 50,
|
|
4977
4993
|
noise: options.focusNoise ?? 0,
|
|
4978
4994
|
softness: options.focusSoftness ?? 4,
|
|
4979
|
-
mode: options.mode
|
|
4995
|
+
mode: options.mode,
|
|
4996
|
+
...tracked()
|
|
4980
4997
|
});
|
|
4981
4998
|
setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
|
|
4982
4999
|
} catch (err) {
|
|
4983
|
-
setFocusStatus(
|
|
5000
|
+
setFocusStatus(failure(err));
|
|
4984
5001
|
} finally {
|
|
5002
|
+
untrack();
|
|
4985
5003
|
setFocusing(false);
|
|
4986
5004
|
}
|
|
4987
5005
|
};
|
|
@@ -5245,6 +5263,22 @@ var SelectionOptionsBar = ({
|
|
|
5245
5263
|
]
|
|
5246
5264
|
}
|
|
5247
5265
|
),
|
|
5266
|
+
task && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
|
|
5267
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
5268
|
+
"div",
|
|
5269
|
+
{
|
|
5270
|
+
role: "progressbar",
|
|
5271
|
+
"aria-label": task.stage,
|
|
5272
|
+
"aria-valuemin": 0,
|
|
5273
|
+
"aria-valuemax": 100,
|
|
5274
|
+
"aria-valuenow": Math.round(task.fraction * 100),
|
|
5275
|
+
className: "flex-1 h-1.5 rounded bg-muted overflow-hidden",
|
|
5276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
|
|
5277
|
+
}
|
|
5278
|
+
),
|
|
5279
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-muted-foreground", children: task.stage }),
|
|
5280
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
|
|
5281
|
+
] }),
|
|
5248
5282
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
|
|
5249
5283
|
workspace && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
|
|
5250
5284
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
|
package/dist/index.cjs
CHANGED
|
@@ -8445,7 +8445,8 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
|
|
|
8445
8445
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "font-mono text-muted-foreground", children: [
|
|
8446
8446
|
Math.round(zoom * 100),
|
|
8447
8447
|
"%"
|
|
8448
|
-
] })
|
|
8448
|
+
] }),
|
|
8449
|
+
session.computing && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
|
|
8449
8450
|
] }),
|
|
8450
8451
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
8451
8452
|
"canvas",
|
|
@@ -8645,6 +8646,19 @@ var SelectionOptionsBar = ({
|
|
|
8645
8646
|
setRangeStatus(err instanceof Error ? err.message : String(err));
|
|
8646
8647
|
}
|
|
8647
8648
|
};
|
|
8649
|
+
const [task, setTask] = (0, import_react62.useState)(null);
|
|
8650
|
+
const taskAbort = (0, import_react62.useRef)(null);
|
|
8651
|
+
const tracked = () => {
|
|
8652
|
+
const abort = new AbortController();
|
|
8653
|
+
taskAbort.current = abort;
|
|
8654
|
+
setTask({ stage: "Starting", fraction: 0 });
|
|
8655
|
+
return { signal: abort.signal, onProgress: (fraction, stage) => setTask({ stage, fraction }) };
|
|
8656
|
+
};
|
|
8657
|
+
const untrack = () => {
|
|
8658
|
+
taskAbort.current = null;
|
|
8659
|
+
setTask(null);
|
|
8660
|
+
};
|
|
8661
|
+
const failure = (err) => err?.name === "AbortError" ? "Cancelled." : err instanceof Error ? err.message : String(err);
|
|
8648
8662
|
const [subject, setSubject] = (0, import_react62.useState)("");
|
|
8649
8663
|
const [segmenting, setSegmenting] = (0, import_react62.useState)(false);
|
|
8650
8664
|
const [subjectStatus, setSubjectStatus] = (0, import_react62.useState)(null);
|
|
@@ -8655,11 +8669,12 @@ var SelectionOptionsBar = ({
|
|
|
8655
8669
|
setSegmenting(true);
|
|
8656
8670
|
setSubjectStatus(null);
|
|
8657
8671
|
try {
|
|
8658
|
-
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
|
|
8672
|
+
const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode, ...tracked() });
|
|
8659
8673
|
setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
|
|
8660
8674
|
} catch (err) {
|
|
8661
|
-
setSubjectStatus(
|
|
8675
|
+
setSubjectStatus(failure(err));
|
|
8662
8676
|
} finally {
|
|
8677
|
+
untrack();
|
|
8663
8678
|
setSegmenting(false);
|
|
8664
8679
|
}
|
|
8665
8680
|
};
|
|
@@ -8671,11 +8686,12 @@ var SelectionOptionsBar = ({
|
|
|
8671
8686
|
setSkying(true);
|
|
8672
8687
|
setSkyStatus(null);
|
|
8673
8688
|
try {
|
|
8674
|
-
const { note } = await controller.selectSky({ mode: options.mode });
|
|
8689
|
+
const { note } = await controller.selectSky({ mode: options.mode, ...tracked() });
|
|
8675
8690
|
setSkyStatus(note ?? null);
|
|
8676
8691
|
} catch (err) {
|
|
8677
|
-
setSkyStatus(
|
|
8692
|
+
setSkyStatus(failure(err));
|
|
8678
8693
|
} finally {
|
|
8694
|
+
untrack();
|
|
8679
8695
|
setSkying(false);
|
|
8680
8696
|
}
|
|
8681
8697
|
};
|
|
@@ -8690,12 +8706,14 @@ var SelectionOptionsBar = ({
|
|
|
8690
8706
|
range: options.focusRange ?? 50,
|
|
8691
8707
|
noise: options.focusNoise ?? 0,
|
|
8692
8708
|
softness: options.focusSoftness ?? 4,
|
|
8693
|
-
mode: options.mode
|
|
8709
|
+
mode: options.mode,
|
|
8710
|
+
...tracked()
|
|
8694
8711
|
});
|
|
8695
8712
|
setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
|
|
8696
8713
|
} catch (err) {
|
|
8697
|
-
setFocusStatus(
|
|
8714
|
+
setFocusStatus(failure(err));
|
|
8698
8715
|
} finally {
|
|
8716
|
+
untrack();
|
|
8699
8717
|
setFocusing(false);
|
|
8700
8718
|
}
|
|
8701
8719
|
};
|
|
@@ -8959,6 +8977,22 @@ var SelectionOptionsBar = ({
|
|
|
8959
8977
|
]
|
|
8960
8978
|
}
|
|
8961
8979
|
),
|
|
8980
|
+
task && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
|
|
8981
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
8982
|
+
"div",
|
|
8983
|
+
{
|
|
8984
|
+
role: "progressbar",
|
|
8985
|
+
"aria-label": task.stage,
|
|
8986
|
+
"aria-valuemin": 0,
|
|
8987
|
+
"aria-valuemax": 100,
|
|
8988
|
+
"aria-valuenow": Math.round(task.fraction * 100),
|
|
8989
|
+
className: "flex-1 h-1.5 rounded bg-muted overflow-hidden",
|
|
8990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
|
|
8991
|
+
}
|
|
8992
|
+
),
|
|
8993
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-muted-foreground", children: task.stage }),
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
|
|
8995
|
+
] }),
|
|
8962
8996
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
|
|
8963
8997
|
workspace && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
|
|
8964
8998
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.138.0",
|
|
4
4
|
"description": "React bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"dependencies": {},
|
|
255
255
|
"peerDependencies": {
|
|
256
256
|
"@dagrejs/dagre": "^1.1.8",
|
|
257
|
-
"@pixerate/editor": ">=0.
|
|
257
|
+
"@pixerate/editor": ">=0.208.0 <1.0.0-0",
|
|
258
258
|
"@tiptap/core": "^2.27.3",
|
|
259
259
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
260
260
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
@@ -305,7 +305,7 @@
|
|
|
305
305
|
"tsup": "^9.0.0",
|
|
306
306
|
"typescript": "^5.7.3",
|
|
307
307
|
"vitest": "^5.0.5",
|
|
308
|
-
"@pixerate/editor": "0.
|
|
308
|
+
"@pixerate/editor": "0.208.0"
|
|
309
309
|
},
|
|
310
310
|
"scripts": {
|
|
311
311
|
"build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",
|