@pixerate/editor-svelte 0.179.0 → 0.180.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.
|
@@ -182,6 +182,11 @@
|
|
|
182
182
|
</select>
|
|
183
183
|
</label>
|
|
184
184
|
{/if}
|
|
185
|
+
{#if engine.light && brush.light.amount > 0}
|
|
186
|
+
<label class="flex items-center gap-2" title="Pressure scales the light the brush lays">
|
|
187
|
+
<input type="checkbox" aria-label="Light follows pressure" checked={brush.light.pressure} onchange={(e) => controller.setBrush({ light: { pressure: e.currentTarget.checked } })} /> Light follows pressure
|
|
188
|
+
</label>
|
|
189
|
+
{/if}
|
|
185
190
|
{#if engine.dirty}
|
|
186
191
|
<label class="flex items-center gap-2" title="Keep the colour the brush picked up for the next stroke (needs Pick-up above 0)">
|
|
187
192
|
<input type="checkbox" aria-label="Dirty brush" checked={brush.behavior.dirty} onchange={(e) => controller.setBrush({ behavior: { dirty: e.currentTarget.checked } })} /> Dirty brush
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
return untrack(() => controller.listLayers());
|
|
15
15
|
});
|
|
16
16
|
const active = $derived(layers.find((l) => l.active) ?? null);
|
|
17
|
+
const light = $derived.by(() => {
|
|
18
|
+
void editor.current;
|
|
19
|
+
return active?.type === 'pixel' ? untrack(() => controller.lightOf(active.id)) : null;
|
|
20
|
+
});
|
|
17
21
|
let error = $state<string | null>(null);
|
|
18
22
|
let renaming = $state<string | null>(null);
|
|
19
23
|
const run = (fn: () => unknown) => attempt(fn, (m) => (error = m));
|
|
@@ -107,6 +111,23 @@
|
|
|
107
111
|
{/each}
|
|
108
112
|
<button type="button" aria-pressed={active.clipped} class={chip(active.clipped)} onclick={() => run(() => controller.updateLayer(active.id, { clipped: !active.clipped }))}>Clip</button>
|
|
109
113
|
</div>
|
|
114
|
+
{#if light?.hasLight}
|
|
115
|
+
{@const id = active.id}
|
|
116
|
+
<div class="flex flex-col gap-1.5 border-t border-slate-800 pt-1.5" data-testid="layer-light">
|
|
117
|
+
<div class="flex items-center justify-between">
|
|
118
|
+
<span class="font-medium text-slate-300" title="This layer's paint gives off light">Light</span>
|
|
119
|
+
<button type="button" class={button} onclick={() => run(() => controller.clearLight(id))}>Clear light</button>
|
|
120
|
+
</div>
|
|
121
|
+
<label class="flex items-center gap-2" title="How far the light spills onto the paint and paper around it (0 turns it off)">
|
|
122
|
+
<span class="w-14 text-slate-400">Spill</span>
|
|
123
|
+
<input type="range" aria-label="Light spill radius" min="0" max="120" step="1" value={light.spill.radius} onchange={(e) => run(() => controller.setLightSpill(id, { radius: Number(e.currentTarget.value) }))} class="flex-1 accent-indigo-500" />
|
|
124
|
+
</label>
|
|
125
|
+
<label class="flex items-center gap-2">
|
|
126
|
+
<span class="w-14 text-slate-400">Strength</span>
|
|
127
|
+
<input type="range" aria-label="Light spill strength" min="0" max="2" step="0.05" value={light.spill.strength} onchange={(e) => run(() => controller.setLightSpill(id, { strength: Number(e.currentTarget.value) }))} class="flex-1 accent-indigo-500" />
|
|
128
|
+
</label>
|
|
129
|
+
</div>
|
|
130
|
+
{/if}
|
|
110
131
|
</div>
|
|
111
132
|
{/if}
|
|
112
133
|
{#if error}<p role="alert" class="text-[11px] text-rose-400">{error}</p>{/if}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.180.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.243.0"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@dagrejs/dagre": "^1.1.4",
|