@pixerate/editor-svelte 0.205.1 → 0.206.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath, wetEngineSummary, type PaintEditorController, type WetFlowKind, type WetGpuMode } from '@pixerate/editor/paint-editor';
|
|
2
|
+
import { LIVE_PATTERN_KINDS, LIVE_PATTERN_LABELS, LIVE_PATTERN_SLIDERS, WET_FLOW_KINDS, WET_GPU_OPTIONS, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, readPath, wetEngineSummary, type LivePatternKind, type PaintEditorController, type WetFlowKind, type WetGpuMode } from '@pixerate/editor/paint-editor';
|
|
3
3
|
import PaintSlider from './PaintSlider.svelte';
|
|
4
4
|
import { attempt, button, chip, paintEditorState, panel } from './paintEditorRune.svelte.js';
|
|
5
5
|
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
void editor.current;
|
|
16
16
|
return layerId ? controller.wetLayerInfo(layerId) : null;
|
|
17
17
|
});
|
|
18
|
+
const livePattern = $derived.by(() => {
|
|
19
|
+
void editor.current;
|
|
20
|
+
return layerId ? controller.getLivePatterns(layerId).layers[0] ?? null : null;
|
|
21
|
+
});
|
|
18
22
|
const backend = $derived.by(() => {
|
|
19
23
|
void editor.current;
|
|
20
24
|
return controller.wetState();
|
|
@@ -58,6 +62,23 @@
|
|
|
58
62
|
{/if}
|
|
59
63
|
</div>
|
|
60
64
|
{/if}
|
|
65
|
+
{#if livePattern && layerId}
|
|
66
|
+
<div class="flex flex-col gap-1.5" data-testid="wet-live-patterns">
|
|
67
|
+
<div class="flex items-center justify-between">
|
|
68
|
+
<span class="font-medium text-slate-300">Live patterns</span>
|
|
69
|
+
<button type="button" class={button} onclick={() => run(async () => { await controller.wetIdle(); const cx = Math.round(editor.current.document.canvas.width / 2); const cy = Math.round(editor.current.document.canvas.height / 2); controller.seedLivePatterns({ layerId, points: [{ x: cx, y: cy }] }); })}>Seed pattern</button>
|
|
70
|
+
</div>
|
|
71
|
+
<label class="flex items-center justify-between gap-2">
|
|
72
|
+
<span class="text-slate-400">Pattern</span>
|
|
73
|
+
<select aria-label="Live pattern" value={livePattern.settings.pattern} onchange={(e) => { const pattern = e.currentTarget.value as LivePatternKind; run(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { pattern }))); }} class="rounded bg-slate-800 px-1 py-0.5">
|
|
74
|
+
{#each LIVE_PATTERN_KINDS as k (k)}<option value={k}>{LIVE_PATTERN_LABELS[k]}</option>{/each}
|
|
75
|
+
</select>
|
|
76
|
+
</label>
|
|
77
|
+
{#each LIVE_PATTERN_SLIDERS as c (c.path)}
|
|
78
|
+
<PaintSlider control={c} value={readPath(livePattern.settings, c.path)} oncommit={(v) => run(async () => (await controller.wetIdle(), controller.setLivePatterns(layerId, { [c.path]: v })))} />
|
|
79
|
+
{/each}
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
61
82
|
{#if backend.message}<p class="text-[10px] text-amber-300" data-testid="wet-message">{backend.message}</p>{/if}
|
|
62
83
|
{#if backend.backend}
|
|
63
84
|
<p class="text-[10px] text-slate-500">{backend.backend.kind === 'wasm-threads' ? `WebAssembly, ${backend.backend.threads} threads` : backend.backend.kind === 'wasm' ? 'WebAssembly, one thread' : 'JavaScript'}</p>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.206.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"**/*.css"
|
|
185
185
|
],
|
|
186
186
|
"dependencies": {
|
|
187
|
-
"@pixerate/editor": "0.
|
|
187
|
+
"@pixerate/editor": "0.276.0"
|
|
188
188
|
},
|
|
189
189
|
"peerDependencies": {
|
|
190
190
|
"@dagrejs/dagre": "^1.1.4",
|