@pixerate/editor-svelte 0.159.0 → 0.160.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.
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
let output = $state<RefineOutput>('selection');
|
|
53
53
|
let decontaminate = $state(0);
|
|
54
54
|
let objectAware = $state(false);
|
|
55
|
+
let onlyUncertain = $state(false);
|
|
55
56
|
const canObject = $derived.by(() => {
|
|
56
57
|
void tick;
|
|
57
58
|
return Boolean(controller.segmentationProvider);
|
|
@@ -67,9 +68,13 @@
|
|
|
67
68
|
busy = true;
|
|
68
69
|
error = null;
|
|
69
70
|
try {
|
|
71
|
+
// Only where the edge has no image edge under it (the selection's uncertain regions).
|
|
72
|
+
const regions = onlyUncertain ? controller.selectionUncertainty().regions.map((r) => r.bounds) : undefined;
|
|
73
|
+
if (regions && !regions.length) throw new Error("No uncertain areas: the selection's edge already follows edges in the image. Untick Only uncertain areas to refine everywhere.");
|
|
70
74
|
await controller.refineSelectionTo({ ...params }, output, {
|
|
71
75
|
decontaminate: toLayer ? decontaminate : 0,
|
|
72
76
|
refineMode: canObject && objectAware ? 'object' : 'color',
|
|
77
|
+
...(regions ? { regions } : {}),
|
|
73
78
|
});
|
|
74
79
|
} catch (err) {
|
|
75
80
|
error = err instanceof Error ? err.message : String(err);
|
|
@@ -115,6 +120,10 @@
|
|
|
115
120
|
/>
|
|
116
121
|
Smart Radius
|
|
117
122
|
</label>
|
|
123
|
+
<label class="flex items-center gap-2 text-foreground" title="Refine only where the edge has no image edge under it">
|
|
124
|
+
<input type="checkbox" aria-label="Only uncertain areas" checked={onlyUncertain} onchange={(e) => (onlyUncertain = (e.currentTarget as HTMLInputElement).checked)} />
|
|
125
|
+
Only uncertain areas
|
|
126
|
+
</label>
|
|
118
127
|
{#if canObject}
|
|
119
128
|
<label class="flex items-center gap-2 text-foreground">
|
|
120
129
|
<input type="checkbox" aria-label="Object aware" checked={objectAware} onchange={(e) => (objectAware = (e.currentTarget as HTMLInputElement).checked)} />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.160.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"**/*.css"
|
|
166
166
|
],
|
|
167
167
|
"dependencies": {
|
|
168
|
-
"@pixerate/editor": "0.
|
|
168
|
+
"@pixerate/editor": "0.216.0"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@dagrejs/dagre": "^1.1.4",
|