@pixerate/editor-react 0.131.0 → 0.133.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.
@@ -2742,18 +2742,39 @@ var SelectionOptionsBar = ({
2742
2742
  const [subjectStatus, setSubjectStatus] = useState11(null);
2743
2743
  const selectSubject = async () => {
2744
2744
  const target = subject.trim();
2745
- if (!target || segmenting) return;
2745
+ const canSegment = Boolean(controller.segmentationProvider);
2746
+ if (canSegment && !target || segmenting) return;
2746
2747
  setSegmenting(true);
2747
2748
  setSubjectStatus(null);
2748
2749
  try {
2749
- const { segments } = await controller.selectSubject(target, { mode: options.mode });
2750
- setSubjectStatus(segments.length ? null : `Nothing matching \u201C${target}\u201D was found.`);
2750
+ const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
2751
+ setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
2751
2752
  } catch (err) {
2752
2753
  setSubjectStatus(err instanceof Error ? err.message : String(err));
2753
2754
  } finally {
2754
2755
  setSegmenting(false);
2755
2756
  }
2756
2757
  };
2758
+ const [focusing, setFocusing] = useState11(false);
2759
+ const [focusStatus, setFocusStatus] = useState11(null);
2760
+ const selectFocusArea = async () => {
2761
+ if (focusing) return;
2762
+ setFocusing(true);
2763
+ setFocusStatus(null);
2764
+ try {
2765
+ const { selection: selection2 } = await controller.selectFocusArea({
2766
+ range: options.focusRange ?? 50,
2767
+ noise: options.focusNoise ?? 0,
2768
+ softness: options.focusSoftness ?? 4,
2769
+ mode: options.mode
2770
+ });
2771
+ setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
2772
+ } catch (err) {
2773
+ setFocusStatus(err instanceof Error ? err.message : String(err));
2774
+ } finally {
2775
+ setFocusing(false);
2776
+ }
2777
+ };
2757
2778
  return /* @__PURE__ */ jsxs13("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
2758
2779
  /* @__PURE__ */ jsx15("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
2759
2780
  /* @__PURE__ */ jsx15("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
@@ -2975,7 +2996,7 @@ var SelectionOptionsBar = ({
2975
2996
  ),
2976
2997
  "px"
2977
2998
  ] }),
2978
- controller.segmentationProvider && /* @__PURE__ */ jsxs13(
2999
+ /* @__PURE__ */ jsxs13(
2979
3000
  "form",
2980
3001
  {
2981
3002
  "data-testid": "select-subject",
@@ -2986,7 +3007,7 @@ var SelectionOptionsBar = ({
2986
3007
  },
2987
3008
  children: [
2988
3009
  /* @__PURE__ */ jsxs13("div", { className: "flex gap-1", children: [
2989
- /* @__PURE__ */ jsx15(
3010
+ controller.segmentationProvider && /* @__PURE__ */ jsx15(
2990
3011
  "input",
2991
3012
  {
2992
3013
  type: "text",
@@ -2998,12 +3019,53 @@ var SelectionOptionsBar = ({
2998
3019
  className: "min-w-0 flex-1 bg-background border border-border rounded px-2 py-1 text-foreground"
2999
3020
  }
3000
3021
  ),
3001
- /* @__PURE__ */ jsx15("button", { type: "submit", className: btn(false), disabled: segmenting || !subject.trim(), "aria-busy": segmenting, children: segmenting ? "Selecting\u2026" : "Select Subject" })
3022
+ /* @__PURE__ */ jsx15(
3023
+ "button",
3024
+ {
3025
+ type: "submit",
3026
+ className: btn(false),
3027
+ disabled: segmenting || Boolean(controller.segmentationProvider) && !subject.trim(),
3028
+ "aria-busy": segmenting,
3029
+ title: controller.segmentationProvider ? void 0 : "Selects the subject that stands out most (no segmentation model is set)",
3030
+ children: segmenting ? "Selecting\u2026" : "Select Subject"
3031
+ }
3032
+ )
3002
3033
  ] }),
3003
3034
  subjectStatus && /* @__PURE__ */ jsx15("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
3004
3035
  ]
3005
3036
  }
3006
3037
  ),
3038
+ /* @__PURE__ */ jsxs13("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
3039
+ /* @__PURE__ */ jsx15("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
3040
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2 pt-2", children: [
3041
+ /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
3042
+ /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
3043
+ /* @__PURE__ */ jsx15("span", { children: "In-focus range" }),
3044
+ /* @__PURE__ */ jsx15("span", { className: "font-mono", children: options.focusRange ?? 50 })
3045
+ ] }),
3046
+ /* @__PURE__ */ jsx15(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
3047
+ ] }),
3048
+ /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
3049
+ /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
3050
+ /* @__PURE__ */ jsx15("span", { children: "Image noise level" }),
3051
+ /* @__PURE__ */ jsx15("span", { className: "font-mono", children: options.focusNoise ?? 0 })
3052
+ ] }),
3053
+ /* @__PURE__ */ jsx15(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
3054
+ ] }),
3055
+ /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
3056
+ /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
3057
+ /* @__PURE__ */ jsx15("span", { children: "Soften edge" }),
3058
+ /* @__PURE__ */ jsxs13("span", { className: "font-mono", children: [
3059
+ options.focusSoftness ?? 4,
3060
+ " px"
3061
+ ] })
3062
+ ] }),
3063
+ /* @__PURE__ */ jsx15(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
3064
+ ] }),
3065
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
3066
+ focusStatus && /* @__PURE__ */ jsx15("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
3067
+ ] })
3068
+ ] }),
3007
3069
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
3008
3070
  /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
3009
3071
  "Anti-alias"
@@ -4673,18 +4673,39 @@ var SelectionOptionsBar = ({
4673
4673
  const [subjectStatus, setSubjectStatus] = (0, import_react25.useState)(null);
4674
4674
  const selectSubject = async () => {
4675
4675
  const target = subject.trim();
4676
- if (!target || segmenting) return;
4676
+ const canSegment = Boolean(controller.segmentationProvider);
4677
+ if (canSegment && !target || segmenting) return;
4677
4678
  setSegmenting(true);
4678
4679
  setSubjectStatus(null);
4679
4680
  try {
4680
- const { segments } = await controller.selectSubject(target, { mode: options.mode });
4681
- setSubjectStatus(segments.length ? null : `Nothing matching \u201C${target}\u201D was found.`);
4681
+ const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
4682
+ setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
4682
4683
  } catch (err) {
4683
4684
  setSubjectStatus(err instanceof Error ? err.message : String(err));
4684
4685
  } finally {
4685
4686
  setSegmenting(false);
4686
4687
  }
4687
4688
  };
4689
+ const [focusing, setFocusing] = (0, import_react25.useState)(false);
4690
+ const [focusStatus, setFocusStatus] = (0, import_react25.useState)(null);
4691
+ const selectFocusArea = async () => {
4692
+ if (focusing) return;
4693
+ setFocusing(true);
4694
+ setFocusStatus(null);
4695
+ try {
4696
+ const { selection: selection2 } = await controller.selectFocusArea({
4697
+ range: options.focusRange ?? 50,
4698
+ noise: options.focusNoise ?? 0,
4699
+ softness: options.focusSoftness ?? 4,
4700
+ mode: options.mode
4701
+ });
4702
+ setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
4703
+ } catch (err) {
4704
+ setFocusStatus(err instanceof Error ? err.message : String(err));
4705
+ } finally {
4706
+ setFocusing(false);
4707
+ }
4708
+ };
4688
4709
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
4689
4710
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: import_image_editor14.SELECTION_TOOLS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
4690
4711
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: import_image_editor14.SELECTION_MODES.map((m) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: import_image_editor14.SELECTION_MODE_LABELS[m] }, m)) }),
@@ -4906,7 +4927,7 @@ var SelectionOptionsBar = ({
4906
4927
  ),
4907
4928
  "px"
4908
4929
  ] }),
4909
- controller.segmentationProvider && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4930
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4910
4931
  "form",
4911
4932
  {
4912
4933
  "data-testid": "select-subject",
@@ -4917,7 +4938,7 @@ var SelectionOptionsBar = ({
4917
4938
  },
4918
4939
  children: [
4919
4940
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex gap-1", children: [
4920
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4941
+ controller.segmentationProvider && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4921
4942
  "input",
4922
4943
  {
4923
4944
  type: "text",
@@ -4929,12 +4950,53 @@ var SelectionOptionsBar = ({
4929
4950
  className: "min-w-0 flex-1 bg-background border border-border rounded px-2 py-1 text-foreground"
4930
4951
  }
4931
4952
  ),
4932
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "submit", className: btn(false), disabled: segmenting || !subject.trim(), "aria-busy": segmenting, children: segmenting ? "Selecting\u2026" : "Select Subject" })
4953
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4954
+ "button",
4955
+ {
4956
+ type: "submit",
4957
+ className: btn(false),
4958
+ disabled: segmenting || Boolean(controller.segmentationProvider) && !subject.trim(),
4959
+ "aria-busy": segmenting,
4960
+ title: controller.segmentationProvider ? void 0 : "Selects the subject that stands out most (no segmentation model is set)",
4961
+ children: segmenting ? "Selecting\u2026" : "Select Subject"
4962
+ }
4963
+ )
4933
4964
  ] }),
4934
4965
  subjectStatus && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
4935
4966
  ]
4936
4967
  }
4937
4968
  ),
4969
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
4970
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
4971
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-2 pt-2", children: [
4972
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex flex-col gap-1", children: [
4973
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
4974
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "In-focus range" }),
4975
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-mono", children: options.focusRange ?? 50 })
4976
+ ] }),
4977
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
4978
+ ] }),
4979
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex flex-col gap-1", children: [
4980
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
4981
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Image noise level" }),
4982
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-mono", children: options.focusNoise ?? 0 })
4983
+ ] }),
4984
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
4985
+ ] }),
4986
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex flex-col gap-1", children: [
4987
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
4988
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Soften edge" }),
4989
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "font-mono", children: [
4990
+ options.focusSoftness ?? 4,
4991
+ " px"
4992
+ ] })
4993
+ ] }),
4994
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
4995
+ ] }),
4996
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
4997
+ focusStatus && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
4998
+ ] })
4999
+ ] }),
4938
5000
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("label", { className: "flex items-center gap-2 text-foreground", children: [
4939
5001
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
4940
5002
  "Anti-alias"
@@ -27,7 +27,7 @@ import {
27
27
  useImageEditorControls,
28
28
  useImageEffectsTools,
29
29
  useImageHistogram
30
- } from "../chunk-6TDQ5DIO.js";
30
+ } from "../chunk-PJKBVUYL.js";
31
31
  import "../chunk-AJCWF6SN.js";
32
32
  import "../chunk-6BWTJ3EE.js";
33
33
  import "../chunk-5RPB4WGT.js";
package/dist/index.cjs CHANGED
@@ -8387,18 +8387,39 @@ var SelectionOptionsBar = ({
8387
8387
  const [subjectStatus, setSubjectStatus] = (0, import_react61.useState)(null);
8388
8388
  const selectSubject = async () => {
8389
8389
  const target = subject.trim();
8390
- if (!target || segmenting) return;
8390
+ const canSegment = Boolean(controller.segmentationProvider);
8391
+ if (canSegment && !target || segmenting) return;
8391
8392
  setSegmenting(true);
8392
8393
  setSubjectStatus(null);
8393
8394
  try {
8394
- const { segments } = await controller.selectSubject(target, { mode: options.mode });
8395
- setSubjectStatus(segments.length ? null : `Nothing matching \u201C${target}\u201D was found.`);
8395
+ const { segments, method, note } = await controller.selectSubject(canSegment ? target : "", { mode: options.mode });
8396
+ setSubjectStatus(segments.length ? null : method === "saliency" ? note ?? "Nothing stands out from the background." : `Nothing matching \u201C${target}\u201D was found.`);
8396
8397
  } catch (err) {
8397
8398
  setSubjectStatus(err instanceof Error ? err.message : String(err));
8398
8399
  } finally {
8399
8400
  setSegmenting(false);
8400
8401
  }
8401
8402
  };
8403
+ const [focusing, setFocusing] = (0, import_react61.useState)(false);
8404
+ const [focusStatus, setFocusStatus] = (0, import_react61.useState)(null);
8405
+ const selectFocusArea = async () => {
8406
+ if (focusing) return;
8407
+ setFocusing(true);
8408
+ setFocusStatus(null);
8409
+ try {
8410
+ const { selection: selection2 } = await controller.selectFocusArea({
8411
+ range: options.focusRange ?? 50,
8412
+ noise: options.focusNoise ?? 0,
8413
+ softness: options.focusSoftness ?? 4,
8414
+ mode: options.mode
8415
+ });
8416
+ setFocusStatus(selection2 ? null : "No part of the image stands out as in focus.");
8417
+ } catch (err) {
8418
+ setFocusStatus(err instanceof Error ? err.message : String(err));
8419
+ } finally {
8420
+ setFocusing(false);
8421
+ }
8422
+ };
8402
8423
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
8403
8424
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: import_image_editor14.SELECTION_TOOLS.map((t) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
8404
8425
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: import_image_editor14.SELECTION_MODES.map((m) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: import_image_editor14.SELECTION_MODE_LABELS[m] }, m)) }),
@@ -8620,7 +8641,7 @@ var SelectionOptionsBar = ({
8620
8641
  ),
8621
8642
  "px"
8622
8643
  ] }),
8623
- controller.segmentationProvider && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
8644
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
8624
8645
  "form",
8625
8646
  {
8626
8647
  "data-testid": "select-subject",
@@ -8631,7 +8652,7 @@ var SelectionOptionsBar = ({
8631
8652
  },
8632
8653
  children: [
8633
8654
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex gap-1", children: [
8634
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8655
+ controller.segmentationProvider && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8635
8656
  "input",
8636
8657
  {
8637
8658
  type: "text",
@@ -8643,12 +8664,53 @@ var SelectionOptionsBar = ({
8643
8664
  className: "min-w-0 flex-1 bg-background border border-border rounded px-2 py-1 text-foreground"
8644
8665
  }
8645
8666
  ),
8646
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "submit", className: btn(false), disabled: segmenting || !subject.trim(), "aria-busy": segmenting, children: segmenting ? "Selecting\u2026" : "Select Subject" })
8667
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8668
+ "button",
8669
+ {
8670
+ type: "submit",
8671
+ className: btn(false),
8672
+ disabled: segmenting || Boolean(controller.segmentationProvider) && !subject.trim(),
8673
+ "aria-busy": segmenting,
8674
+ title: controller.segmentationProvider ? void 0 : "Selects the subject that stands out most (no segmentation model is set)",
8675
+ children: segmenting ? "Selecting\u2026" : "Select Subject"
8676
+ }
8677
+ )
8647
8678
  ] }),
8648
8679
  subjectStatus && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
8649
8680
  ]
8650
8681
  }
8651
8682
  ),
8683
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
8684
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
8685
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex flex-col gap-2 pt-2", children: [
8686
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "flex flex-col gap-1", children: [
8687
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
8688
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "In-focus range" }),
8689
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "font-mono", children: options.focusRange ?? 50 })
8690
+ ] }),
8691
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
8692
+ ] }),
8693
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "flex flex-col gap-1", children: [
8694
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
8695
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Image noise level" }),
8696
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: "font-mono", children: options.focusNoise ?? 0 })
8697
+ ] }),
8698
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
8699
+ ] }),
8700
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "flex flex-col gap-1", children: [
8701
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "flex justify-between text-muted-foreground", children: [
8702
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Soften edge" }),
8703
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("span", { className: "font-mono", children: [
8704
+ options.focusSoftness ?? 4,
8705
+ " px"
8706
+ ] })
8707
+ ] }),
8708
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
8709
+ ] }),
8710
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
8711
+ focusStatus && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
8712
+ ] })
8713
+ ] }),
8652
8714
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("label", { className: "flex items-center gap-2 text-foreground", children: [
8653
8715
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
8654
8716
  "Anti-alias"
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  useImageEditorControls,
52
52
  useImageEffectsTools,
53
53
  useImageHistogram
54
- } from "./chunk-6TDQ5DIO.js";
54
+ } from "./chunk-PJKBVUYL.js";
55
55
  import "./chunk-AJCWF6SN.js";
56
56
  import "./chunk-6BWTJ3EE.js";
57
57
  import "./chunk-5RPB4WGT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor-react",
3
- "version": "0.131.0",
3
+ "version": "0.133.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.198.0 <1.0.0-0",
257
+ "@pixerate/editor": ">=0.200.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.198.0"
308
+ "@pixerate/editor": "0.200.0"
309
309
  },
310
310
  "scripts": {
311
311
  "build": "tsup && tsc -p tsconfig.build.json && node ../../scripts/finalize-declarations.mjs dist",