@pixerate/editor-svelte 0.182.0 → 0.184.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.
@@ -4,8 +4,9 @@
4
4
  import ImageRange from './controls/ImageRange.svelte';
5
5
  import ImageSelect from './controls/ImageSelect.svelte';
6
6
  import { imageIconButtonClass } from './styles.js';
7
- import type { EffectControl, ImageEditorController, LayerEffectKind } from '@pixerate/editor/image-editor';
8
- import { LAYER_EFFECT_MENU, effectControlChange, layerEffectControls, layerEffectsPanel } from '@pixerate/editor/image-editor';
7
+ // From the raster entry, not the image editor's: the paint editor shows this panel too.
8
+ import type { EffectControl, LayerEffectKind, LayerEffectsController } from '@pixerate/editor/raster';
9
+ import { LAYER_EFFECT_MENU, effectControlChange, layerEffectControls, layerEffectsPanel } from '@pixerate/editor/raster';
9
10
  import { untrack } from 'svelte';
10
11
 
11
12
  /**
@@ -14,7 +15,8 @@
14
15
  * settings. Every change is one undo step (a slider drag is one step too).
15
16
  */
16
17
  interface Props {
17
- controller: ImageEditorController;
18
+ /** The image editor's controller, the paint editor's, or anything else with layer effects. */
19
+ controller: LayerEffectsController;
18
20
  /** The layer whose effects to show (default: the active layer). */
19
21
  layerId?: string | null;
20
22
  /**
@@ -1,11 +1,12 @@
1
- import type { ImageEditorController } from '@pixerate/editor/image-editor';
1
+ import type { LayerEffectsController } from '@pixerate/editor/raster';
2
2
  /**
3
3
  * A layer's effects (Photoshop's layer styles): the master switch, Scale Effects, an "Add
4
4
  * style" menu, and each effect with its enabled toggle, remove button and, when expanded, its
5
5
  * settings. Every change is one undo step (a slider drag is one step too).
6
6
  */
7
7
  interface Props {
8
- controller: ImageEditorController;
8
+ /** The image editor's controller, the paint editor's, or anything else with layer effects. */
9
+ controller: LayerEffectsController;
9
10
  /** The layer whose effects to show (default: the active layer). */
10
11
  layerId?: string | null;
11
12
  /**
@@ -20,11 +20,21 @@
20
20
  PARTICLE_KIND_LABELS,
21
21
  PARTICLE_RENDERS,
22
22
  PARTICLE_RENDER_LABELS,
23
+ RIBBON_PAIRS,
24
+ RIBBON_PAIR_LABELS,
25
+ DOT_TEXTURE_ORDERS,
26
+ DOT_TEXTURE_ORDER_LABELS,
27
+ DOT_ROTATIONS,
28
+ DOT_ROTATION_LABELS,
29
+ toggleDotTexture,
23
30
  STAMP_KINDS,
24
31
  STAMP_LABELS,
25
32
  toggleStamp,
26
33
  type ParticleKind,
27
34
  type ParticleRender,
35
+ type RibbonPairs,
36
+ type DotTextureOrder,
37
+ type DotRotation,
28
38
  type ImpastoTool,
29
39
  type WetMediumKind,
30
40
  type BlendMode,
@@ -150,6 +160,42 @@
150
160
  {#each PARTICLE_RENDERS as k (k)}<option value={k}>{PARTICLE_RENDER_LABELS[k]}</option>{/each}
151
161
  </select>
152
162
  </label>
163
+ {#if brush.particle.render === 'ribbon'}
164
+ <label class="flex items-center justify-between gap-2">
165
+ <span class="text-slate-400">Ribbon joins</span>
166
+ <select aria-label="Ribbon pairs" value={brush.particle.ribbonPairs} onchange={(e) => controller.setBrush({ particle: { ribbonPairs: e.currentTarget.value as RibbonPairs } })} class="rounded bg-slate-800 px-1 py-0.5">
167
+ {#each RIBBON_PAIRS as k (k)}<option value={k}>{RIBBON_PAIR_LABELS[k]}</option>{/each}
168
+ </select>
169
+ </label>
170
+ {/if}
171
+ {#if brush.particle.render === 'dot' || brush.particle.render === 'sequence'}
172
+ <div class="flex flex-wrap gap-1" role="group" aria-label="Dot textures" title="Stamps drawn instead of round dots (up to 4; none: round)">
173
+ {#each STAMP_KINDS as k (k)}
174
+ <button
175
+ type="button"
176
+ aria-pressed={brush.particle.dotTextures.includes(k)}
177
+ class={`px-1.5 py-0.5 rounded text-[10px] ${brush.particle.dotTextures.includes(k) ? 'bg-indigo-600 text-white' : 'bg-slate-800 text-slate-300'}`}
178
+ onclick={() => controller.setBrush({ particle: { dotTextures: toggleDotTexture(brush.particle.dotTextures, k) } })}
179
+ >
180
+ {STAMP_LABELS[k]}
181
+ </button>
182
+ {/each}
183
+ </div>
184
+ {#if brush.particle.dotTextures.length > 0}
185
+ <label class="flex items-center justify-between gap-2">
186
+ <span class="text-slate-400">Texture order</span>
187
+ <select aria-label="Dot texture order" value={brush.particle.dotTextureOrder} onchange={(e) => controller.setBrush({ particle: { dotTextureOrder: e.currentTarget.value as DotTextureOrder } })} class="rounded bg-slate-800 px-1 py-0.5">
188
+ {#each DOT_TEXTURE_ORDERS as k (k)}<option value={k}>{DOT_TEXTURE_ORDER_LABELS[k]}</option>{/each}
189
+ </select>
190
+ </label>
191
+ <label class="flex items-center justify-between gap-2">
192
+ <span class="text-slate-400">Texture turn</span>
193
+ <select aria-label="Dot rotation" value={brush.particle.dotRotation} onchange={(e) => controller.setBrush({ particle: { dotRotation: e.currentTarget.value as DotRotation } })} class="rounded bg-slate-800 px-1 py-0.5">
194
+ {#each DOT_ROTATIONS as k (k)}<option value={k}>{DOT_ROTATION_LABELS[k]}</option>{/each}
195
+ </select>
196
+ </label>
197
+ {/if}
198
+ {/if}
153
199
  {/if}
154
200
  {#if engine.stickerStamps}
155
201
  <div class="flex flex-wrap gap-1" role="group" aria-label="Sticker stamps">
@@ -2,6 +2,7 @@
2
2
  import { BLEND_MENU_GROUPS, type BlendMode, type PaintEditorController, type PaintLayerInfo } from '@pixerate/editor/paint-editor';
3
3
  import { untrack } from 'svelte';
4
4
  import { attempt, button, chip, paintEditorState, panel } from './paintEditorRune.svelte.js';
5
+ import LayerEffectsPanel from '../image-editor/LayerEffectsPanel.svelte';
5
6
 
6
7
  interface Props {
7
8
  controller: PaintEditorController;
@@ -128,6 +129,9 @@
128
129
  </label>
129
130
  </div>
130
131
  {/if}
132
+ <div class="border-t border-slate-800 pt-1.5" data-testid="paint-layer-effects" title="Live layer styles drawn from this layer's paint: glows, shadows, strokes">
133
+ <LayerEffectsPanel {controller} layerId={active.id} />
134
+ </div>
131
135
  </div>
132
136
  {/if}
133
137
  {#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.182.0",
3
+ "version": "0.184.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.245.0"
168
+ "@pixerate/editor": "0.248.0"
169
169
  },
170
170
  "peerDependencies": {
171
171
  "@dagrejs/dagre": "^1.1.4",