@pixerate/editor-svelte 0.126.0 → 0.127.1
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.
|
@@ -208,7 +208,9 @@
|
|
|
208
208
|
let isPanning = $state(false);
|
|
209
209
|
// A primary drag pans: Space held, or the host's pan mode.
|
|
210
210
|
const panning = $derived(viewportGestures && (isSpacePressed || panMode));
|
|
211
|
-
|
|
211
|
+
// Where a pan drag started, in view pixels: a scaled host (an expanded studio in a zoomed-out
|
|
212
|
+
// canvas) makes screen pixels larger or smaller than the pan's.
|
|
213
|
+
let panStartPoint: ImagePoint | null = null;
|
|
212
214
|
let panStartOffset: { x: number; y: number } = { x: 0, y: 0 };
|
|
213
215
|
|
|
214
216
|
function handleWheel(e: WheelEvent) {
|
|
@@ -629,7 +631,7 @@
|
|
|
629
631
|
if (viewportGestures && (e.button === 1 || (e.button === 0 && panning))) {
|
|
630
632
|
e.preventDefault();
|
|
631
633
|
isPanning = true;
|
|
632
|
-
panStartPoint =
|
|
634
|
+
panStartPoint = getCanvasEventPoint(e);
|
|
633
635
|
const curPan = editor.controller.getState().pan || { x: 0, y: 0 };
|
|
634
636
|
panStartOffset = { ...curPan };
|
|
635
637
|
return;
|
|
@@ -732,8 +734,9 @@
|
|
|
732
734
|
if (!canvasEl) return;
|
|
733
735
|
|
|
734
736
|
if (isPanning && panStartPoint) {
|
|
735
|
-
const
|
|
736
|
-
const
|
|
737
|
+
const pt = getCanvasEventPoint(e);
|
|
738
|
+
const dx = pt.x - panStartPoint.x;
|
|
739
|
+
const dy = pt.y - panStartPoint.y;
|
|
737
740
|
editor.controller.setPan({
|
|
738
741
|
x: Math.round(panStartOffset.x + dx),
|
|
739
742
|
y: Math.round(panStartOffset.y + dy),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { imageOutlineButtonClass } from './styles.js';
|
|
3
|
-
import { findLayer, type ImageEditorController, type ImageLayer, type SmartObjectLayer } from '@pixerate/editor/image-editor';
|
|
3
|
+
import { EFFECT_LAYER_USES, findLayer, type ImageEditorController, type ImageLayer, type SmartObjectLayer } from '@pixerate/editor/image-editor';
|
|
4
4
|
import { untrack } from 'svelte';
|
|
5
5
|
import EffectsBrowser from '../effects/EffectsBrowser.svelte';
|
|
6
6
|
import ImageEffectControls from './ImageEffectControls.svelte';
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
<EffectsBrowser {provider} uses={['filter']} title="Filters" onpick={(e) => ((browse = null), run(() => controller.applyEffectFilter(id, e.id)))} />
|
|
65
65
|
{/if}
|
|
66
66
|
{#if browse === 'layer'}
|
|
67
|
-
<EffectsBrowser {provider} uses={
|
|
67
|
+
<EffectsBrowser {provider} uses={EFFECT_LAYER_USES} title="Generators and overlays" onpick={(e) => ((browse = null), run(() => controller.addEffectLayer(e.id)))} />
|
|
68
68
|
{/if}
|
|
69
69
|
{#if generator && layer}
|
|
70
70
|
{@const id = layer.id}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import TypeOptionsBar from './TypeOptionsBar.svelte';
|
|
16
16
|
import AdjustmentLayersPanel from './AdjustmentLayersPanel.svelte';
|
|
17
17
|
import SelectionOptionsBar from './SelectionOptionsBar.svelte';
|
|
18
|
+
import ImageProviderEffectsPanel from './ImageProviderEffectsPanel.svelte';
|
|
18
19
|
|
|
19
20
|
interface Props {
|
|
20
21
|
controller: ImageEditorController;
|
|
@@ -98,6 +99,8 @@
|
|
|
98
99
|
<div class="font-medium text-sm text-foreground">Smart Filters</div>
|
|
99
100
|
<LayerEffectsPanel {controller} />
|
|
100
101
|
</div>
|
|
102
|
+
{:else if panelId === 'provider-effects'}
|
|
103
|
+
<ImageProviderEffectsPanel {controller} />
|
|
101
104
|
{:else if panelId === 'selection'}
|
|
102
105
|
<div class="flex flex-col gap-3">
|
|
103
106
|
<div class="font-medium text-sm text-foreground">Selection</div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.127.1",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"@tiptap/extension-bubble-menu": "^2.27.3",
|
|
169
169
|
"@tiptap/extension-placeholder": "^2.27.3",
|
|
170
170
|
"@tiptap/starter-kit": "^2.27.3",
|
|
171
|
-
"@pixerate/editor": "0.
|
|
171
|
+
"@pixerate/editor": "0.171.0"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
174
|
"@dagrejs/dagre": "^1.1.4",
|