@pixerate/editor-svelte 0.138.0 → 0.139.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.
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
dropPlacement,
|
|
10
10
|
dropZone,
|
|
11
11
|
maskThumbnailClick,
|
|
12
|
+
vectorMaskThumbnail,
|
|
13
|
+
vectorMaskThumbnailClick,
|
|
12
14
|
layerThumbnailClick,
|
|
13
15
|
layerBadge,
|
|
14
16
|
layerEffectsBadge,
|
|
@@ -145,6 +147,11 @@
|
|
|
145
147
|
void tick;
|
|
146
148
|
return layerHasThumbnail(layer) ? controller.getLayerThumbnail(layer.id, { maxSide: 64 }) : null;
|
|
147
149
|
}
|
|
150
|
+
function vectorThumb(layer: ImageLayer): PixelBuffer | null {
|
|
151
|
+
void tick;
|
|
152
|
+
const { width, height } = controller.getState().imageDimensions;
|
|
153
|
+
return layer.vectorMask ? vectorMaskThumbnail(layer.vectorMask, width, height, 64) : null;
|
|
154
|
+
}
|
|
148
155
|
function maskThumb(layer: ImageLayer): PixelBuffer | null {
|
|
149
156
|
void tick;
|
|
150
157
|
return layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
|
|
@@ -386,6 +393,22 @@
|
|
|
386
393
|
}}
|
|
387
394
|
></canvas>
|
|
388
395
|
{/if}
|
|
396
|
+
{#if layer.vectorMask}
|
|
397
|
+
<canvas
|
|
398
|
+
use:paint={vectorThumb(layer)}
|
|
399
|
+
role="button"
|
|
400
|
+
tabindex="0"
|
|
401
|
+
aria-label={`${row.label} vector mask${layer.vectorMask.enabled === false ? ' (disabled)' : ''}`}
|
|
402
|
+
title="Ctrl/⌘-click: load the path as the selection · Shift-click: turn it off or on"
|
|
403
|
+
data-testid="layer-vector-mask-thumbnail"
|
|
404
|
+
style="width: {thumbnailSize}px; height: {thumbnailSize}px"
|
|
405
|
+
class={thumbClass(false)}
|
|
406
|
+
onclick={(e) => {
|
|
407
|
+
e.stopPropagation();
|
|
408
|
+
attempt(() => vectorMaskThumbnailClick(controller, layer, e));
|
|
409
|
+
}}
|
|
410
|
+
></canvas>
|
|
411
|
+
{/if}
|
|
389
412
|
{#if renaming === layer.id}
|
|
390
413
|
<!-- svelte-ignore a11y_autofocus -->
|
|
391
414
|
<input
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pixerate/editor-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.139.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.190.0"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@dagrejs/dagre": "^1.1.4",
|