@pixerate/editor 0.249.0 → 0.250.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.
- package/dist/animation-editor/index.cjs +114 -113
- package/dist/animation-editor/index.js +7 -6
- package/dist/{brushstrokeRender-T3JZST44.js → brushstrokeRender-2FHFLSEG.js} +4 -3
- package/dist/{brushstrokeRender-GCKK7V2I.cjs → brushstrokeRender-QGRXOKDA.cjs} +7 -6
- package/dist/canvas/index.cjs +71 -15
- package/dist/canvas/index.d.cts +1 -0
- package/dist/canvas/index.d.ts +1 -0
- package/dist/canvas/index.js +58 -2
- package/dist/canvas/stickers.d.cts +35 -0
- package/dist/canvas/stickers.d.ts +35 -0
- package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
- package/dist/{chunk-UBRJOIR5.js → chunk-3TWOCSCY.js} +1 -1
- package/dist/{chunk-ZEYMKDYS.cjs → chunk-4JNWA3VT.cjs} +53 -20
- package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
- package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
- package/dist/{chunk-LJRCU3BJ.cjs → chunk-ATK6ABN3.cjs} +15 -13
- package/dist/{chunk-H4AOUUBE.cjs → chunk-GT77U7QG.cjs} +18 -16
- package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
- package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
- package/dist/{chunk-PZP2SZIZ.js → chunk-KDLBJ6QR.js} +1 -1
- package/dist/{chunk-LP2MCSBE.cjs → chunk-M2VKFE5L.cjs} +86 -86
- package/dist/{chunk-DOIU7VJG.js → chunk-NOHJP5TK.js} +1 -1
- package/dist/{chunk-O75V4ZS3.js → chunk-NTRAVM2I.js} +1 -1
- package/dist/{chunk-J7T5QZ45.js → chunk-OTEPAQJX.js} +4 -2
- package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
- package/dist/{chunk-6BIDVPED.js → chunk-SMSGP2HQ.js} +1 -1
- package/dist/chunk-SZTI6EER.js +13 -0
- package/dist/{chunk-EJLRBS5Q.js → chunk-U4NUOKBT.js} +4 -2
- package/dist/chunk-U67EN7GG.cjs +13 -0
- package/dist/{chunk-5RH3VXAK.js → chunk-WKH5ZAUA.js} +45 -12
- package/dist/{chunk-IOFVM3L3.cjs → chunk-WPUXGDH4.cjs} +2 -2
- package/dist/{chunk-2SMMZDMG.cjs → chunk-X7WRL5ZZ.cjs} +35 -35
- package/dist/{chunk-WLJZZHUZ.cjs → chunk-YM6ZBTXG.cjs} +23 -23
- package/dist/{chunk-KYX7NZ5V.cjs → chunk-YW43M56C.cjs} +1 -1
- package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
- package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
- package/dist/effects/helpers.d.cts +6 -0
- package/dist/effects/helpers.d.ts +6 -0
- package/dist/effects/index.cjs +62 -60
- package/dist/effects/index.js +5 -3
- package/dist/effects/tools.d.cts +6 -0
- package/dist/effects/tools.d.ts +6 -0
- package/dist/image-editor/effects.d.cts +1 -1
- package/dist/image-editor/effects.d.ts +1 -1
- package/dist/image-editor/index.cjs +814 -791
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +35 -12
- package/dist/image-editor/stickers.d.cts +9 -0
- package/dist/image-editor/stickers.d.ts +9 -0
- package/dist/paint-editor/index.cjs +165 -164
- package/dist/paint-editor/index.js +8 -7
- package/dist/stickers/index.cjs +22 -16
- package/dist/stickers/index.d.cts +1 -1
- package/dist/stickers/index.d.ts +1 -1
- package/dist/stickers/index.js +9 -3
- package/dist/stickers/tools.d.cts +57 -1
- package/dist/stickers/tools.d.ts +57 -1
- package/dist/vector/index.cjs +1003 -969
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +40 -6
- package/dist/vector/stickers.d.cts +11 -0
- package/dist/vector/stickers.d.ts +11 -0
- package/dist/video-editor/index.cjs +344 -344
- package/dist/video-editor/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-stickers/SKILL.md +13 -1
package/dist/vector/index.d.cts
CHANGED
package/dist/vector/index.d.ts
CHANGED
package/dist/vector/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
traceField,
|
|
27
27
|
traceVectorImage,
|
|
28
28
|
vectorTraceContours
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-NOHJP5TK.js";
|
|
30
30
|
import {
|
|
31
31
|
applyHomography,
|
|
32
32
|
homographyFromPoints,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
reverseMorphContour,
|
|
54
54
|
subpathToMorphContour,
|
|
55
55
|
turnMorphContour
|
|
56
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-NTRAVM2I.js";
|
|
57
57
|
import {
|
|
58
58
|
DEFAULT_VECTOR_FONT,
|
|
59
59
|
IDENTITY_MATRIX,
|
|
@@ -526,9 +526,9 @@ import {
|
|
|
526
526
|
withVectorStrokes,
|
|
527
527
|
withVectorTargetPaint,
|
|
528
528
|
zigzagPaths
|
|
529
|
-
} from "../chunk-
|
|
530
|
-
import "../chunk-
|
|
531
|
-
import "../chunk-
|
|
529
|
+
} from "../chunk-KDLBJ6QR.js";
|
|
530
|
+
import "../chunk-OTEPAQJX.js";
|
|
531
|
+
import "../chunk-WKH5ZAUA.js";
|
|
532
532
|
import {
|
|
533
533
|
createProvenance
|
|
534
534
|
} from "../chunk-M6DNZNVY.js";
|
|
@@ -554,12 +554,15 @@ import {
|
|
|
554
554
|
fitCubics,
|
|
555
555
|
parseSvgPath
|
|
556
556
|
} from "../chunk-PWBZH3FK.js";
|
|
557
|
+
import {
|
|
558
|
+
StickerError
|
|
559
|
+
} from "../chunk-SZTI6EER.js";
|
|
557
560
|
import {
|
|
558
561
|
EffectUnsupportedError,
|
|
559
562
|
EffectsSlot,
|
|
560
563
|
createEffectToolProvider,
|
|
561
564
|
resolveEffectValues
|
|
562
|
-
} from "../chunk-
|
|
565
|
+
} from "../chunk-JA57JIT5.js";
|
|
563
566
|
import "../chunk-V2ZCJRDM.js";
|
|
564
567
|
import {
|
|
565
568
|
GRAIN_PATTERNS
|
|
@@ -18317,6 +18320,35 @@ function vectorLayerRows(nodes, expanded = () => false) {
|
|
|
18317
18320
|
visit(nodes, 0, null);
|
|
18318
18321
|
return rows;
|
|
18319
18322
|
}
|
|
18323
|
+
|
|
18324
|
+
// src/vector/stickers.ts
|
|
18325
|
+
function stickerVectorGroup(placement, id = "sticker") {
|
|
18326
|
+
const { asset, description } = placement;
|
|
18327
|
+
if (asset.kind !== "svg") throw new StickerError("unsupported_format", `"${placement.ref}" has only raster art; the vector editor takes stickers with SVG art (find_stickers lists formats).`);
|
|
18328
|
+
let n2 = 0;
|
|
18329
|
+
const parsed = parseVectorSvg(asset.svg, { createId: () => `${id}-${++n2}` });
|
|
18330
|
+
if (!parsed.nodes.length) throw new StickerError("load_failed", `"${placement.ref}" has no shapes the vector editor can read.`);
|
|
18331
|
+
const group = { type: "group", id, name: description.name, children: parsed.nodes };
|
|
18332
|
+
const b = vectorNodeBounds(group);
|
|
18333
|
+
if (!b || !(b.width > 0) || !(b.height > 0)) throw new StickerError("load_failed", `"${placement.ref}" has no visible shapes.`);
|
|
18334
|
+
const box = { width: parsed.width || b.width, height: parsed.height || b.height };
|
|
18335
|
+
const s = placement.width / box.width;
|
|
18336
|
+
return transformVectorNode(group, [s, 0, 0, s, placement.x - box.width * s / 2, placement.y - box.height * s / 2]);
|
|
18337
|
+
}
|
|
18338
|
+
function createVectorStickerHost(controller) {
|
|
18339
|
+
return {
|
|
18340
|
+
noun: "group of editable paths",
|
|
18341
|
+
format: "svg",
|
|
18342
|
+
defaultCentre: () => {
|
|
18343
|
+
const d = controller.getDocument();
|
|
18344
|
+
return { x: d.width / 2, y: d.height / 2 };
|
|
18345
|
+
},
|
|
18346
|
+
insert(placement) {
|
|
18347
|
+
const id = controller.addNode(stickerVectorGroup(placement), { label: `Insert ${placement.description.name}` });
|
|
18348
|
+
return { id };
|
|
18349
|
+
}
|
|
18350
|
+
};
|
|
18351
|
+
}
|
|
18320
18352
|
export {
|
|
18321
18353
|
DEFAULT_VECTOR_BLEND_DISTANCE,
|
|
18322
18354
|
DEFAULT_VECTOR_BLEND_STEPS,
|
|
@@ -18496,6 +18528,7 @@ export {
|
|
|
18496
18528
|
createVectorMeshGradient,
|
|
18497
18529
|
createVectorMorph,
|
|
18498
18530
|
createVectorPlaybackLocator,
|
|
18531
|
+
createVectorStickerHost,
|
|
18499
18532
|
cssFontFamily,
|
|
18500
18533
|
curvatureMoveAnchor,
|
|
18501
18534
|
cutSubpathAt,
|
|
@@ -18756,6 +18789,7 @@ export {
|
|
|
18756
18789
|
splitWarpMeshU as splitVectorMeshU,
|
|
18757
18790
|
splitWarpMeshV as splitVectorMeshV,
|
|
18758
18791
|
starSubpath,
|
|
18792
|
+
stickerVectorGroup,
|
|
18759
18793
|
stripVectorLensViews,
|
|
18760
18794
|
stripVectorMasterArt,
|
|
18761
18795
|
stripVectorSymbolArt,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stickers in the vector editor: `insert_sticker` (see `@pixerate/editor/stickers`) puts a
|
|
3
|
+
* sticker's SVG in as a group of editable paths, scaled to its width and centred where asked.
|
|
4
|
+
*/
|
|
5
|
+
import type { StickerInsertHost, StickerPlacement } from '../stickers/tools.cjs';
|
|
6
|
+
import type { VectorEditorController } from './controller.cjs';
|
|
7
|
+
import type { VectorGroupNode } from './types.cjs';
|
|
8
|
+
/** A group of the sticker's paths, `placement.width` wide and centred on (`x`, `y`). */
|
|
9
|
+
export declare function stickerVectorGroup(placement: StickerPlacement, id?: string): VectorGroupNode;
|
|
10
|
+
/** `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. */
|
|
11
|
+
export declare function createVectorStickerHost(controller: VectorEditorController): StickerInsertHost;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stickers in the vector editor: `insert_sticker` (see `@pixerate/editor/stickers`) puts a
|
|
3
|
+
* sticker's SVG in as a group of editable paths, scaled to its width and centred where asked.
|
|
4
|
+
*/
|
|
5
|
+
import type { StickerInsertHost, StickerPlacement } from '../stickers/tools.js';
|
|
6
|
+
import type { VectorEditorController } from './controller.js';
|
|
7
|
+
import type { VectorGroupNode } from './types.js';
|
|
8
|
+
/** A group of the sticker's paths, `placement.width` wide and centred on (`x`, `y`). */
|
|
9
|
+
export declare function stickerVectorGroup(placement: StickerPlacement, id?: string): VectorGroupNode;
|
|
10
|
+
/** `insert_sticker` for a vector editor: a group of editable paths, one undo step, selected. */
|
|
11
|
+
export declare function createVectorStickerHost(controller: VectorEditorController): StickerInsertHost;
|