@pixerate/editor-svelte 0.95.0 → 0.96.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.
@@ -8,7 +8,10 @@
8
8
  RETOUCH_CHOICES,
9
9
  RETOUCH_OPTION_CONTROLS,
10
10
  RETOUCH_TOGGLES,
11
+ CLONE_TRANSFORM_CONTROLS,
11
12
  cloneSourceLabel,
13
+ cloneTransformView,
14
+ setCloneTransformValue,
12
15
  isRetouchPaintTool,
13
16
  rgbUnitToHex,
14
17
  setRetouchChoice,
@@ -34,7 +37,7 @@
34
37
  const view = $derived.by(() => {
35
38
  void tick;
36
39
  const s = controller.getState();
37
- return { tool: s.activeTool, sourceLabel: cloneSourceLabel(controller), ...s.paint };
40
+ return { tool: s.activeTool, sourceLabel: cloneSourceLabel(controller), cloneView: cloneTransformView(controller), ...s.paint };
38
41
  });
39
42
  let error = $state<string | null>(null);
40
43
 
@@ -163,6 +166,18 @@
163
166
  <button type="button" title="Forget the source point" class={chip(false)} onclick={() => controller.setCloneSource(null)}>Clear source</button>
164
167
  {/if}
165
168
  </div>
169
+ <div class="flex flex-col gap-1" role="group" aria-label="Clone source transform" data-testid="clone-transform">
170
+ {#each CLONE_TRANSFORM_CONTROLS as spec (spec.id)}
171
+ <ControlSlider {spec} value={view.cloneView[spec.id]} onchange={(v) => setCloneTransformValue(controller, spec.id, v)} />
172
+ {/each}
173
+ <div class="flex items-center gap-1">
174
+ <button type="button" aria-pressed={view.cloneView.flipH} title="Mirror the source left to right" class={chip(view.cloneView.flipH)} onclick={() => setCloneTransformValue(controller, 'flipH')}>Flip H</button>
175
+ <button type="button" aria-pressed={view.cloneView.flipV} title="Mirror the source top to bottom" class={chip(view.cloneView.flipV)} onclick={() => setCloneTransformValue(controller, 'flipV')}>Flip V</button>
176
+ {#if !view.cloneView.identity}
177
+ <button type="button" title="Back to 100 %, no flip, 0°" class={chip(false)} onclick={() => controller.setCloneTransform(null)}>Reset transform</button>
178
+ {/if}
179
+ </div>
180
+ </div>
166
181
  {/if}
167
182
  {#each RETOUCH_CHOICES.filter((c) => c.tools.includes(view.tool as never)) as choice (choice.id)}
168
183
  <div class="flex flex-wrap items-center gap-1" role="group" aria-label={choice.label}>
@@ -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;AAoBzE,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAsJH,QAAA,MAAM,eAAe,2CAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
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;AAuBzE,UAAU,KAAK;IACb,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkKH,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.95.0",
3
+ "version": "0.96.0",
4
4
  "description": "Svelte bindings and prompt/rich-text components for @pixerate/editor",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",
@@ -144,7 +144,7 @@
144
144
  "@tiptap/extension-bubble-menu": "^2.11.5",
145
145
  "@tiptap/extension-placeholder": "^2.11.5",
146
146
  "@tiptap/starter-kit": "^2.11.5",
147
- "@pixerate/editor": "0.134.0"
147
+ "@pixerate/editor": "0.135.0"
148
148
  },
149
149
  "peerDependencies": {
150
150
  "@dagrejs/dagre": "^1.1.4",