@pixerate/editor-svelte 0.71.1 → 0.72.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,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ImageEditorController } from '@pixerate/editor/image-editor';
|
|
3
|
-
import { BRUSH_OPTION_CONTROLS, PAINT_TOOLS } from '@pixerate/editor/image-editor';
|
|
3
|
+
import { BRUSH_OPTION_CONTROLS, MIXER_MIXING_OPTIONS, MIXER_OPTION_CONTROLS, PAINT_TOOLS, rgbUnitToHex } from '@pixerate/editor/image-editor';
|
|
4
4
|
import { untrack } from 'svelte';
|
|
5
5
|
import ControlSlider from './ControlSlider.svelte';
|
|
6
6
|
|
|
@@ -77,6 +77,57 @@
|
|
|
77
77
|
<ControlSlider {spec} value={view.brush[spec.id]} onchange={(v) => controller.setPaintOptions({ brush: { [spec.id]: v } })} />
|
|
78
78
|
{/each}
|
|
79
79
|
|
|
80
|
+
{#if view.tool === 'mixer'}
|
|
81
|
+
{@const load = view.mixerLoad}
|
|
82
|
+
<div class="flex flex-col gap-2 border-t border-slate-800 pt-2" role="group" aria-label="Mixer Brush" data-testid="mixer-options">
|
|
83
|
+
<div class="flex items-center gap-2">
|
|
84
|
+
<span
|
|
85
|
+
aria-label="Brush load"
|
|
86
|
+
title={load.reservoir ? `Loaded ${rgbUnitToHex(load.reservoir)}, ${Math.round(load.amount * 100)}% left` : 'Unloaded'}
|
|
87
|
+
class="h-6 w-6 rounded border border-slate-700"
|
|
88
|
+
style:background={load.reservoir ? rgbUnitToHex(load.reservoir) : 'transparent'}
|
|
89
|
+
></span>
|
|
90
|
+
<button type="button" title="Fill the reservoir with the foreground colour" class={chip(false)} onclick={() => controller.loadMixerBrush()}>Load brush</button>
|
|
91
|
+
<button type="button" title="Empty the picked-up colour" class={chip(false)} onclick={() => controller.cleanMixerBrush()}>Clean brush</button>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="flex gap-1" role="group" aria-label="Mixing">
|
|
94
|
+
{#each MIXER_MIXING_OPTIONS as m (m.id)}
|
|
95
|
+
<button
|
|
96
|
+
type="button"
|
|
97
|
+
aria-pressed={view.mixer.mixing === m.id}
|
|
98
|
+
title={m.title}
|
|
99
|
+
class={chip(view.mixer.mixing === m.id)}
|
|
100
|
+
onclick={() => controller.setPaintOptions({ mixer: { mixing: m.id } })}>{m.label}</button>
|
|
101
|
+
{/each}
|
|
102
|
+
</div>
|
|
103
|
+
{#each MIXER_OPTION_CONTROLS as spec (spec.id)}
|
|
104
|
+
<ControlSlider {spec} value={view.mixer[spec.id]} onchange={(v) => controller.setPaintOptions({ mixer: { [spec.id]: v } })} />
|
|
105
|
+
{/each}
|
|
106
|
+
<div class="flex flex-wrap gap-3 text-slate-300">
|
|
107
|
+
<label class="flex items-center gap-1.5">
|
|
108
|
+
<input
|
|
109
|
+
type="checkbox"
|
|
110
|
+
aria-label="Load the brush after each stroke"
|
|
111
|
+
checked={view.mixer.loadEachStroke}
|
|
112
|
+
onchange={(e) => controller.setPaintOptions({ mixer: { loadEachStroke: (e.target as HTMLInputElement).checked } })}
|
|
113
|
+
class="accent-indigo-500"
|
|
114
|
+
/>
|
|
115
|
+
Load each stroke
|
|
116
|
+
</label>
|
|
117
|
+
<label class="flex items-center gap-1.5">
|
|
118
|
+
<input
|
|
119
|
+
type="checkbox"
|
|
120
|
+
aria-label="Clean the brush after each stroke"
|
|
121
|
+
checked={view.mixer.cleanEachStroke}
|
|
122
|
+
onchange={(e) => controller.setPaintOptions({ mixer: { cleanEachStroke: (e.target as HTMLInputElement).checked } })}
|
|
123
|
+
class="accent-indigo-500"
|
|
124
|
+
/>
|
|
125
|
+
Clean each stroke
|
|
126
|
+
</label>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
{/if}
|
|
130
|
+
|
|
80
131
|
<div class="flex flex-wrap gap-3 text-slate-300" role="group" aria-label="Pressure">
|
|
81
132
|
<label class="flex items-center gap-1.5">
|
|
82
133
|
<input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrushOptionsBar.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/BrushOptionsBar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"BrushOptionsBar.svelte.d.ts","sourceRoot":"","sources":["../../src/image-editor/BrushOptionsBar.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAMzE,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8GH,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.72.0",
|
|
4
4
|
"description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
|
|
5
5
|
"author": "Pixerate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"@tiptap/extension-bubble-menu": "^2.11.5",
|
|
132
132
|
"@tiptap/extension-placeholder": "^2.11.5",
|
|
133
133
|
"@tiptap/starter-kit": "^2.11.5",
|
|
134
|
-
"@pixerate/editor": "0.
|
|
134
|
+
"@pixerate/editor": "0.95.0"
|
|
135
135
|
},
|
|
136
136
|
"peerDependencies": {
|
|
137
137
|
"@dagrejs/dagre": "^1.1.4",
|