@pixerate/editor-svelte 0.165.11 → 0.166.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.
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
return untrack(() => c.subscribe(() => tick++));
|
|
24
24
|
});
|
|
25
25
|
/** The open effect browser: filters to apply, or effects to change an effect layer to. */
|
|
26
|
-
let browse = $state<null | 'filter' | 'change'>(null);
|
|
26
|
+
let browse = $state<null | 'filter' | 'change' | 'layer'>(null);
|
|
27
|
+
/** Clip the next effect layer to the layer below it. */
|
|
28
|
+
let clip = $state(false);
|
|
27
29
|
let message = $state<string | null>(null);
|
|
28
30
|
let open = $state<string | null>(null);
|
|
29
31
|
const snapshot = $derived.by(() => {
|
|
@@ -84,9 +86,10 @@
|
|
|
84
86
|
Provider effects for the active layer. An effect layer first: its effect (change it or
|
|
85
87
|
rasterize it), a still frame or an animation for an effect that moves, and its controls. Then
|
|
86
88
|
the provider filters applied to the layer (smart filters; applying one converts a pixel layer to
|
|
87
|
-
a smart object in the same undo step)
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
a smart object in the same undo step), each keeping the layer's transparency unless "Keep
|
|
90
|
+
transparency" is cleared. Then adding an effect layer, above the active layer and optionally
|
|
91
|
+
clipped to it. Layer styles (drop shadow, stroke…) are not here: they are part of the layer's
|
|
92
|
+
properties (LayerEffectsPanel). Without a provider it says why nothing can be added.
|
|
90
93
|
-->
|
|
91
94
|
<section class="flex flex-col gap-2 text-xs {className}" aria-label="Effects" data-image-provider-effects="">
|
|
92
95
|
{#if !provider}<p class="text-[11px] text-muted-foreground">No effects provider is registered. Effects in the document are kept.</p>{/if}
|
|
@@ -162,7 +165,7 @@
|
|
|
162
165
|
</div>
|
|
163
166
|
{#if browse === 'filter'}
|
|
164
167
|
{@const id = layer.id}
|
|
165
|
-
<EffectsBrowser {provider} uses={['filter']} title="Filters" onpick={(e) => ((browse = null), run(() => controller.applyEffectFilter(id, e.id, { useSelection: true })))} />
|
|
168
|
+
<EffectsBrowser {provider} uses={['filter']} title="Filters" onpick={(e) => ((browse = null), run(() => controller.applyEffectFilter(id, e.id, { useSelection: true, preserveTransparency: true })))} />
|
|
166
169
|
{/if}
|
|
167
170
|
{/if}
|
|
168
171
|
{#if layer && all.some((f) => f.kind === 'effect')}
|
|
@@ -181,6 +184,12 @@
|
|
|
181
184
|
<button type="button" class={imageOutlineButtonClass} disabled={index === 0} aria-label="Move down" onclick={() => run(() => controller.updateEffectFilter(id, f.id, { index: index - 1 }))}>↓</button>
|
|
182
185
|
<button type="button" class={imageOutlineButtonClass} aria-label="Remove {label}" onclick={() => run(() => controller.removeSmartFilter(id, f.id))}>✕</button>
|
|
183
186
|
</div>
|
|
187
|
+
<label class="mt-0.5 flex items-center gap-1 pl-0.5 text-[11px] text-muted-foreground" title="Draw the filter only over the layer's own pixels; clear it to let the effect fill transparent areas">
|
|
188
|
+
<ImageCheckbox checked={f.preserveTransparency === true} label="{label}: keep transparency" onchange={(preserveTransparency) => {
|
|
189
|
+
run(() => controller.updateEffectFilter(id, f.id, { preserveTransparency }));
|
|
190
|
+
}} />
|
|
191
|
+
Keep transparency
|
|
192
|
+
</label>
|
|
184
193
|
{#if open === f.id}
|
|
185
194
|
<div class="mt-1 space-y-2">
|
|
186
195
|
<label class="flex items-center gap-1">
|
|
@@ -206,7 +215,22 @@
|
|
|
206
215
|
</ol>
|
|
207
216
|
{/if}
|
|
208
217
|
{#if layer && canFilter && !generator && !all.some((f) => f.kind === 'effect')}
|
|
209
|
-
<p class="text-[11px] text-muted-foreground">No filters yet. A filter changes the layer's pixels and stays editable. Layer styles such as a drop shadow are in the layer's properties
|
|
218
|
+
<p class="text-[11px] text-muted-foreground">No filters yet. A filter changes the layer's pixels and stays editable. Layer styles such as a drop shadow are in the layer's properties.</p>
|
|
219
|
+
{/if}
|
|
220
|
+
{#if provider}
|
|
221
|
+
<div class="space-y-1" data-effect-part="add-layer">
|
|
222
|
+
<div class="flex items-center gap-1">
|
|
223
|
+
<span class="flex-1 text-[11px] font-semibold uppercase tracking-wider text-foreground">Effect layers</span>
|
|
224
|
+
<button type="button" class={imageOutlineButtonClass} aria-pressed={browse === 'layer'} onclick={() => (browse = browse === 'layer' ? null : 'layer')}>Add effect layer…</button>
|
|
225
|
+
</div>
|
|
226
|
+
<label class="flex items-center gap-1 text-[11px] text-muted-foreground" title="Show the new effect layer only over the pixels of the layer below it (a clipping mask)">
|
|
227
|
+
<ImageCheckbox checked={clip} label="Clip to layer below" onchange={(v) => (clip = v)} />
|
|
228
|
+
Clip to layer below
|
|
229
|
+
</label>
|
|
230
|
+
{#if browse === 'layer'}
|
|
231
|
+
<EffectsBrowser {provider} uses={EFFECT_LAYER_USES} title="Add an effect layer" onpick={(e) => ((browse = null), run(() => controller.addEffectLayer(e.id, { clipped: clip })))} />
|
|
232
|
+
{/if}
|
|
233
|
+
</div>
|
|
210
234
|
{/if}
|
|
211
235
|
{#if !layer}<p class="text-[11px] text-muted-foreground">Select a layer to apply effects to it.</p>{/if}
|
|
212
236
|
{#if message}<p role="alert" class="text-[11px] text-destructive">{message}</p>{/if}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.166.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.226.0"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@dagrejs/dagre": "^1.1.4",
|