@pixerate/editor 0.248.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.
Files changed (122) hide show
  1. package/README.md +1 -0
  2. package/dist/animation-editor/index.cjs +118 -114
  3. package/dist/animation-editor/index.js +11 -7
  4. package/dist/{brushstrokeRender-QLCXROJK.js → brushstrokeRender-2FHFLSEG.js} +8 -4
  5. package/dist/{brushstrokeRender-DTDPFBLC.cjs → brushstrokeRender-QGRXOKDA.cjs} +15 -11
  6. package/dist/canvas/index.cjs +71 -15
  7. package/dist/canvas/index.d.cts +1 -0
  8. package/dist/canvas/index.d.ts +1 -0
  9. package/dist/canvas/index.js +58 -2
  10. package/dist/canvas/stickers.d.cts +35 -0
  11. package/dist/canvas/stickers.d.ts +35 -0
  12. package/dist/{chunk-RXZL4NG5.js → chunk-226QDRO3.js} +1 -1
  13. package/dist/{chunk-SC2RZ5EF.js → chunk-2VJAVXLI.js} +2 -2
  14. package/dist/{chunk-OLNIPTB3.cjs → chunk-2VX55NFM.cjs} +1 -320
  15. package/dist/chunk-3K6HWEXZ.cjs +92 -0
  16. package/dist/{chunk-UOOK7HTX.js → chunk-3PPJRMIG.js} +1 -1
  17. package/dist/{chunk-ZFSLEOSQ.js → chunk-3TWOCSCY.js} +11 -9
  18. package/dist/chunk-4D6KP5BV.js +92 -0
  19. package/dist/chunk-4JNWA3VT.cjs +302 -0
  20. package/dist/{chunk-L3JFOTBQ.js → chunk-5E2Q7ZHI.js} +1 -1
  21. package/dist/{chunk-2ONK3ERD.cjs → chunk-75K3W4D6.cjs} +20 -20
  22. package/dist/{chunk-AU6MWQKZ.js → chunk-ABL7IWFZ.js} +1 -1
  23. package/dist/chunk-ATK6ABN3.cjs +303 -0
  24. package/dist/{chunk-7T7JWTVE.cjs → chunk-BOHDJJ2O.cjs} +8 -8
  25. package/dist/{chunk-2PBZBRP5.js → chunk-D5KGAO4Z.js} +10 -92
  26. package/dist/{chunk-HB4ICNNA.cjs → chunk-DPYAO5U6.cjs} +42 -42
  27. package/dist/{chunk-6G6ZDDDB.cjs → chunk-GT77U7QG.cjs} +303 -149
  28. package/dist/{chunk-PQ3H2AAN.cjs → chunk-I7NJPHWV.cjs} +122 -204
  29. package/dist/{chunk-42TWUPNJ.js → chunk-IRSTHLQQ.js} +1 -320
  30. package/dist/{chunk-GHCSC2WP.cjs → chunk-ISIO63Q5.cjs} +21 -15
  31. package/dist/{chunk-OFH6Q67U.js → chunk-JA57JIT5.js} +9 -3
  32. package/dist/{chunk-VMROIWLL.cjs → chunk-KBYB7OWB.cjs} +3 -3
  33. package/dist/{chunk-Q2HA52V4.js → chunk-KDLBJ6QR.js} +2 -2
  34. package/dist/{chunk-WVS5KQDH.cjs → chunk-M2VKFE5L.cjs} +246 -244
  35. package/dist/{chunk-5GLYUSNT.js → chunk-NOHJP5TK.js} +1 -1
  36. package/dist/{chunk-XNRBMYNB.js → chunk-NTRAVM2I.js} +1 -1
  37. package/dist/{chunk-VNBUDVD4.js → chunk-OTEPAQJX.js} +228 -74
  38. package/dist/chunk-OTTT5N3K.js +322 -0
  39. package/dist/{chunk-QOBCBGGI.cjs → chunk-QKXO6JPP.cjs} +14 -14
  40. package/dist/{chunk-NZ3O3A5C.js → chunk-SMSGP2HQ.js} +1 -1
  41. package/dist/chunk-SZTI6EER.js +13 -0
  42. package/dist/chunk-U4NUOKBT.js +303 -0
  43. package/dist/chunk-U67EN7GG.cjs +13 -0
  44. package/dist/chunk-W5M3J7PV.cjs +322 -0
  45. package/dist/{chunk-4P6H35HU.js → chunk-WA44NKPF.js} +2 -2
  46. package/dist/chunk-WKH5ZAUA.js +302 -0
  47. package/dist/{chunk-L6REDLNB.cjs → chunk-WPUXGDH4.cjs} +7 -7
  48. package/dist/{chunk-P3NIPIKS.js → chunk-WQCNC4DK.js} +1 -1
  49. package/dist/{chunk-IBDU6EGZ.cjs → chunk-X7WRL5ZZ.cjs} +35 -35
  50. package/dist/{chunk-XWTRATIM.cjs → chunk-YM6ZBTXG.cjs} +23 -23
  51. package/dist/{chunk-TPWB4Y6L.cjs → chunk-YW43M56C.cjs} +1 -1
  52. package/dist/{chunk-K5DS2JTA.cjs → chunk-Z3BRH4JK.cjs} +6 -6
  53. package/dist/{chunk-XNZFVYC2.cjs → chunk-ZBCT5MEA.cjs} +7 -7
  54. package/dist/effects/helpers.d.cts +6 -0
  55. package/dist/effects/helpers.d.ts +6 -0
  56. package/dist/effects/index.cjs +62 -60
  57. package/dist/effects/index.js +5 -3
  58. package/dist/effects/tools.d.cts +6 -0
  59. package/dist/effects/tools.d.ts +6 -0
  60. package/dist/image-editor/effects.d.cts +1 -1
  61. package/dist/image-editor/effects.d.ts +1 -1
  62. package/dist/image-editor/index.cjs +1097 -1069
  63. package/dist/image-editor/index.d.cts +1 -0
  64. package/dist/image-editor/index.d.ts +1 -0
  65. package/dist/image-editor/index.js +58 -30
  66. package/dist/image-editor/stickers.d.cts +9 -0
  67. package/dist/image-editor/stickers.d.ts +9 -0
  68. package/dist/paint/index.cjs +8 -5
  69. package/dist/paint/index.js +13 -10
  70. package/dist/paint-editor/controller.d.cts +37 -1
  71. package/dist/paint-editor/controller.d.ts +37 -1
  72. package/dist/paint-editor/index.cjs +753 -609
  73. package/dist/paint-editor/index.d.cts +3 -0
  74. package/dist/paint-editor/index.d.ts +3 -0
  75. package/dist/paint-editor/index.js +187 -43
  76. package/dist/paint-editor/sticker-art.d.cts +55 -0
  77. package/dist/paint-editor/sticker-art.d.ts +55 -0
  78. package/dist/paint-editor/stickers.d.cts +30 -17
  79. package/dist/paint-editor/stickers.d.ts +30 -17
  80. package/dist/paint-editor/stroke.d.cts +4 -0
  81. package/dist/paint-editor/stroke.d.ts +4 -0
  82. package/dist/paint-editor/ui.d.cts +10 -2
  83. package/dist/paint-editor/ui.d.ts +10 -2
  84. package/dist/raster/index.cjs +6 -4
  85. package/dist/raster/index.js +12 -10
  86. package/dist/stickers/browser.d.cts +48 -0
  87. package/dist/stickers/browser.d.ts +48 -0
  88. package/dist/stickers/combine.d.cts +10 -0
  89. package/dist/stickers/combine.d.ts +10 -0
  90. package/dist/stickers/conformance.d.cts +18 -0
  91. package/dist/stickers/conformance.d.ts +18 -0
  92. package/dist/stickers/editor.d.cts +14 -0
  93. package/dist/stickers/editor.d.ts +14 -0
  94. package/dist/stickers/errors.d.cts +6 -0
  95. package/dist/stickers/errors.d.ts +6 -0
  96. package/dist/stickers/fake.d.cts +16 -0
  97. package/dist/stickers/fake.d.ts +16 -0
  98. package/dist/stickers/helpers.d.cts +51 -0
  99. package/dist/stickers/helpers.d.ts +51 -0
  100. package/dist/stickers/index.cjs +337 -0
  101. package/dist/stickers/index.d.cts +16 -0
  102. package/dist/stickers/index.d.ts +16 -0
  103. package/dist/stickers/index.js +337 -0
  104. package/dist/stickers/stamps.d.cts +13 -0
  105. package/dist/stickers/stamps.d.ts +13 -0
  106. package/dist/stickers/tools.d.cts +81 -0
  107. package/dist/stickers/tools.d.ts +81 -0
  108. package/dist/stickers/types.d.cts +123 -0
  109. package/dist/stickers/types.d.ts +123 -0
  110. package/dist/vector/index.cjs +1018 -981
  111. package/dist/vector/index.d.cts +1 -0
  112. package/dist/vector/index.d.ts +1 -0
  113. package/dist/vector/index.js +44 -7
  114. package/dist/vector/stickers.d.cts +11 -0
  115. package/dist/vector/stickers.d.ts +11 -0
  116. package/dist/video-editor/index.cjs +344 -344
  117. package/dist/video-editor/index.js +4 -4
  118. package/package.json +11 -1
  119. package/skills/README.md +1 -0
  120. package/skills/pixerate-image-editor/SKILL.md +1 -1
  121. package/skills/pixerate-paint-editor/SKILL.md +8 -5
  122. package/skills/pixerate-stickers/SKILL.md +57 -0
@@ -55,3 +55,4 @@ export * from './effect-tools.cjs';
55
55
  export * from './playback.cjs';
56
56
  export * from './editorDocument.cjs';
57
57
  export * from './layers.cjs';
58
+ export * from './stickers.cjs';
@@ -55,3 +55,4 @@ export * from './effect-tools.js';
55
55
  export * from './playback.js';
56
56
  export * from './editorDocument.js';
57
57
  export * from './layers.js';
58
+ export * from './stickers.js';
@@ -26,7 +26,7 @@ import {
26
26
  traceField,
27
27
  traceVectorImage,
28
28
  vectorTraceContours
29
- } from "../chunk-5GLYUSNT.js";
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-XNRBMYNB.js";
56
+ } from "../chunk-NTRAVM2I.js";
57
57
  import {
58
58
  DEFAULT_VECTOR_FONT,
59
59
  IDENTITY_MATRIX,
@@ -526,8 +526,9 @@ import {
526
526
  withVectorStrokes,
527
527
  withVectorTargetPaint,
528
528
  zigzagPaths
529
- } from "../chunk-Q2HA52V4.js";
530
- import "../chunk-VNBUDVD4.js";
529
+ } from "../chunk-KDLBJ6QR.js";
530
+ import "../chunk-OTEPAQJX.js";
531
+ import "../chunk-WKH5ZAUA.js";
531
532
  import {
532
533
  createProvenance
533
534
  } from "../chunk-M6DNZNVY.js";
@@ -553,23 +554,28 @@ import {
553
554
  fitCubics,
554
555
  parseSvgPath
555
556
  } from "../chunk-PWBZH3FK.js";
557
+ import {
558
+ StickerError
559
+ } from "../chunk-SZTI6EER.js";
556
560
  import {
557
561
  EffectUnsupportedError,
558
562
  EffectsSlot,
559
563
  createEffectToolProvider,
560
564
  resolveEffectValues
561
- } from "../chunk-OFH6Q67U.js";
565
+ } from "../chunk-JA57JIT5.js";
562
566
  import "../chunk-V2ZCJRDM.js";
563
567
  import {
564
568
  GRAIN_PATTERNS
565
- } from "../chunk-2PBZBRP5.js";
569
+ } from "../chunk-D5KGAO4Z.js";
570
+ import "../chunk-4D6KP5BV.js";
566
571
  import "../chunk-ODBT55Q7.js";
572
+ import "../chunk-IRSTHLQQ.js";
567
573
  import {
568
574
  bytesToBase64,
569
575
  decodePng,
570
576
  isPng,
571
577
  parseDataUrl
572
- } from "../chunk-42TWUPNJ.js";
578
+ } from "../chunk-OTTT5N3K.js";
573
579
  import "../chunk-HVVR5PZW.js";
574
580
  import {
575
581
  deflate
@@ -18314,6 +18320,35 @@ function vectorLayerRows(nodes, expanded = () => false) {
18314
18320
  visit(nodes, 0, null);
18315
18321
  return rows;
18316
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
+ }
18317
18352
  export {
18318
18353
  DEFAULT_VECTOR_BLEND_DISTANCE,
18319
18354
  DEFAULT_VECTOR_BLEND_STEPS,
@@ -18493,6 +18528,7 @@ export {
18493
18528
  createVectorMeshGradient,
18494
18529
  createVectorMorph,
18495
18530
  createVectorPlaybackLocator,
18531
+ createVectorStickerHost,
18496
18532
  cssFontFamily,
18497
18533
  curvatureMoveAnchor,
18498
18534
  cutSubpathAt,
@@ -18753,6 +18789,7 @@ export {
18753
18789
  splitWarpMeshU as splitVectorMeshU,
18754
18790
  splitWarpMeshV as splitVectorMeshV,
18755
18791
  starSubpath,
18792
+ stickerVectorGroup,
18756
18793
  stripVectorLensViews,
18757
18794
  stripVectorMasterArt,
18758
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;