@pixerate/editor 0.150.0 → 0.151.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 (87) hide show
  1. package/dist/agent/index.cjs +34 -34
  2. package/dist/agent/index.js +8 -8
  3. package/dist/animation-editor/editorDocument.d.cts +9 -0
  4. package/dist/animation-editor/editorDocument.d.ts +9 -0
  5. package/dist/animation-editor/index.cjs +33 -1
  6. package/dist/animation-editor/index.d.cts +1 -0
  7. package/dist/animation-editor/index.d.ts +1 -0
  8. package/dist/animation-editor/index.js +32 -0
  9. package/dist/bridge/cli.cjs +4 -4
  10. package/dist/bridge/cli.js +3 -3
  11. package/dist/bridge/index.cjs +4 -4
  12. package/dist/bridge/index.js +3 -3
  13. package/dist/chart/controller.d.cts +5 -0
  14. package/dist/chart/controller.d.ts +5 -0
  15. package/dist/chart/editorDocument.d.cts +10 -0
  16. package/dist/chart/editorDocument.d.ts +10 -0
  17. package/dist/chart/index.cjs +54 -18
  18. package/dist/chart/index.d.cts +1 -0
  19. package/dist/chart/index.d.ts +1 -0
  20. package/dist/chart/index.js +37 -1
  21. package/dist/{chunk-ENIZYNEF.cjs → chunk-24M7VD6M.cjs} +7 -7
  22. package/dist/{chunk-OET45HIR.js → chunk-4RF2H3N3.js} +10 -0
  23. package/dist/{chunk-KC7HB5GF.cjs → chunk-5H2C3QSF.cjs} +4 -3
  24. package/dist/{chunk-HRLT5BYO.js → chunk-GNV54DLO.js} +2 -1
  25. package/dist/{chunk-EAQ4BGNS.js → chunk-MKTDELCD.js} +1 -1
  26. package/dist/{chunk-X35BV5YT.cjs → chunk-ML2II3Y3.cjs} +10 -0
  27. package/dist/{chunk-QCEQIRJQ.cjs → chunk-PI45JMP7.cjs} +163 -136
  28. package/dist/{chunk-DVLMW3GB.cjs → chunk-R3PECGTQ.cjs} +44 -44
  29. package/dist/{chunk-2AQL4JHM.js → chunk-R6HNWN7B.js} +1 -1
  30. package/dist/{chunk-6QTON3VW.cjs → chunk-RZJCYJWO.cjs} +8 -8
  31. package/dist/{chunk-O5ML2I6O.js → chunk-SVINJIGK.js} +1 -1
  32. package/dist/{chunk-ZQUANEK4.js → chunk-Y64YPIFT.js} +28 -1
  33. package/dist/diagram/index.cjs +6 -6
  34. package/dist/diagram/index.js +5 -5
  35. package/dist/export/index.cjs +1 -1
  36. package/dist/export/index.js +1 -1
  37. package/dist/extensions/index.cjs +5 -5
  38. package/dist/extensions/index.js +4 -4
  39. package/dist/image-editor/canvas-viewport.d.cts +52 -0
  40. package/dist/image-editor/canvas-viewport.d.ts +52 -0
  41. package/dist/image-editor/index.cjs +666 -599
  42. package/dist/image-editor/index.d.cts +1 -0
  43. package/dist/image-editor/index.d.ts +1 -0
  44. package/dist/image-editor/index.js +100 -33
  45. package/dist/image-editor/layers/ops.d.cts +21 -3
  46. package/dist/image-editor/layers/ops.d.ts +21 -3
  47. package/dist/image-editor/renderer.d.cts +7 -0
  48. package/dist/image-editor/renderer.d.ts +7 -0
  49. package/dist/index.cjs +14 -14
  50. package/dist/index.js +8 -8
  51. package/dist/paint-editor/index.cjs +6 -6
  52. package/dist/paint-editor/index.js +1 -1
  53. package/dist/parameters/controller.d.cts +6 -0
  54. package/dist/parameters/controller.d.ts +6 -0
  55. package/dist/parameters/editorDocument.d.cts +9 -0
  56. package/dist/parameters/editorDocument.d.ts +9 -0
  57. package/dist/parameters/index.cjs +71 -1
  58. package/dist/parameters/index.d.cts +1 -0
  59. package/dist/parameters/index.d.ts +1 -0
  60. package/dist/parameters/index.js +70 -0
  61. package/dist/persistence/editorDocument.d.cts +6 -3
  62. package/dist/persistence/editorDocument.d.ts +6 -3
  63. package/dist/persistence/index.cjs +7 -7
  64. package/dist/persistence/index.js +1 -1
  65. package/dist/tools/index.cjs +5 -5
  66. package/dist/tools/index.js +6 -6
  67. package/dist/vector/editorDocument.d.cts +9 -0
  68. package/dist/vector/editorDocument.d.ts +9 -0
  69. package/dist/vector/index.cjs +45 -1
  70. package/dist/vector/index.d.cts +1 -0
  71. package/dist/vector/index.d.ts +1 -0
  72. package/dist/vector/index.js +44 -0
  73. package/dist/video-editor/editorDocument.d.cts +9 -0
  74. package/dist/video-editor/editorDocument.d.ts +9 -0
  75. package/dist/video-editor/index.cjs +33 -1
  76. package/dist/video-editor/index.d.cts +1 -0
  77. package/dist/video-editor/index.d.ts +1 -0
  78. package/dist/video-editor/index.js +32 -0
  79. package/package.json +2 -2
  80. package/skills/pixerate-animation-editor/SKILL.md +12 -0
  81. package/skills/pixerate-chart/SKILL.md +12 -0
  82. package/skills/pixerate-image-editor/SKILL.md +6 -6
  83. package/skills/pixerate-parameters/SKILL.md +12 -0
  84. package/skills/pixerate-vector/SKILL.md +14 -0
  85. package/skills/pixerate-video-editor/SKILL.md +12 -0
  86. package/dist/{chunk-Y4BWZB6J.cjs → chunk-462WGGXX.cjs} +2 -2
  87. package/dist/{chunk-RFBFTLVN.js → chunk-EVXQNQND.js} +3 -3
@@ -95,7 +95,7 @@ import {
95
95
  updateImageSrc,
96
96
  validateFindPattern,
97
97
  writeRichClipboard
98
- } from "../chunk-2AQL4JHM.js";
98
+ } from "../chunk-R6HNWN7B.js";
99
99
  import {
100
100
  DEFAULT_STYLES,
101
101
  NORMAL_STYLE_ID,
@@ -171,8 +171,8 @@ import {
171
171
  tableNestingPluginKey,
172
172
  typeAgentText,
173
173
  unnestTables
174
- } from "../chunk-O5ML2I6O.js";
175
- import "../chunk-OET45HIR.js";
174
+ } from "../chunk-SVINJIGK.js";
175
+ import "../chunk-4RF2H3N3.js";
176
176
  import "../chunk-DSZCDNTM.js";
177
177
  import "../chunk-SUVZJ2CP.js";
178
178
  import "../chunk-ZLZKGHSZ.js";
@@ -208,11 +208,11 @@ import {
208
208
  trackChangesPluginKey,
209
209
  trackedChangeLabel
210
210
  } from "../chunk-6IN474P4.js";
211
- import "../chunk-HF5QZS7Z.js";
212
211
  import "../chunk-II2WIF5Z.js";
213
212
  import "../chunk-WJSD3MAZ.js";
214
213
  import "../chunk-CIQIM2IP.js";
215
214
  import "../chunk-VDGBHYC7.js";
215
+ import "../chunk-HF5QZS7Z.js";
216
216
  import "../chunk-RNSANXPT.js";
217
217
  import "../chunk-AA34BA7G.js";
218
218
  import "../chunk-6ONMQ6WF.js";
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Sizing an on-screen editor canvas: its layout size in CSS pixels (what the projection, overlays
3
+ * and pointer mapping use) and how many backing-store pixels each CSS pixel needs to look sharp.
4
+ */
5
+ /** What `measureCanvasViewport` reads from the element that holds the canvas. */
6
+ export interface MeasurableElement {
7
+ readonly clientWidth: number;
8
+ readonly clientHeight: number;
9
+ /** Layout size including borders, compared with the on-screen box to find the CSS transform scale. */
10
+ readonly offsetWidth?: number;
11
+ readonly offsetHeight?: number;
12
+ getBoundingClientRect(): {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ }
17
+ export interface CanvasViewport {
18
+ /** Layout width in CSS pixels (pass as `RenderOptions.viewportWidth`). */
19
+ width: number;
20
+ /** Layout height in CSS pixels (pass as `RenderOptions.viewportHeight`). */
21
+ height: number;
22
+ /** Backing-store pixels per CSS pixel (pass as `RenderOptions.pixelRatio`). */
23
+ pixelRatio: number;
24
+ }
25
+ /** The size `measureCanvasViewport` gives an element without layout (e.g. before it is shown, or in jsdom). */
26
+ export declare const DEFAULT_CANVAS_VIEWPORT: Readonly<{
27
+ width: number;
28
+ height: number;
29
+ }>;
30
+ /** The longest side a viewport backing store may reach; the pixel ratio is lowered to fit. */
31
+ export declare const MAX_CANVAS_BACKING_SIDE = 8192;
32
+ /**
33
+ * Measures the element a viewport canvas fills. `clientWidth` / `clientHeight` give the layout size
34
+ * (they ignore CSS transforms); `getBoundingClientRect()` gives the size on screen. Their ratio is
35
+ * the scale of any transform on the element or its ancestors, so the pixel ratio is
36
+ * `devicePixelRatio × that scale`: a 220px node scaled to 500px on a 2× screen gets ~4.5 backing
37
+ * pixels per CSS pixel instead of being stretched. `fallback` is the size of an element without
38
+ * layout (default `DEFAULT_CANVAS_VIEWPORT`).
39
+ */
40
+ export declare function measureCanvasViewport(el: MeasurableElement, devicePixelRatio?: number, fallback?: {
41
+ width: number;
42
+ height: number;
43
+ }): CanvasViewport;
44
+ /** Whether two measurements need different backing stores. */
45
+ export declare function sameCanvasViewport(a: CanvasViewport, b: CanvasViewport): boolean;
46
+ /**
47
+ * Calls `onChange` when the element's viewport measurement changes: on resize (a
48
+ * `ResizeObserver`), on window resize (browser zoom, moving to another screen) and after any CSS
49
+ * transition or animation ends (a host scaling the element with a transform, which resizes nothing).
50
+ * Returns a function that stops watching.
51
+ */
52
+ export declare function watchCanvasViewport(el: MeasurableElement & Partial<Element>, onChange: (viewport: CanvasViewport) => void): () => void;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Sizing an on-screen editor canvas: its layout size in CSS pixels (what the projection, overlays
3
+ * and pointer mapping use) and how many backing-store pixels each CSS pixel needs to look sharp.
4
+ */
5
+ /** What `measureCanvasViewport` reads from the element that holds the canvas. */
6
+ export interface MeasurableElement {
7
+ readonly clientWidth: number;
8
+ readonly clientHeight: number;
9
+ /** Layout size including borders, compared with the on-screen box to find the CSS transform scale. */
10
+ readonly offsetWidth?: number;
11
+ readonly offsetHeight?: number;
12
+ getBoundingClientRect(): {
13
+ width: number;
14
+ height: number;
15
+ };
16
+ }
17
+ export interface CanvasViewport {
18
+ /** Layout width in CSS pixels (pass as `RenderOptions.viewportWidth`). */
19
+ width: number;
20
+ /** Layout height in CSS pixels (pass as `RenderOptions.viewportHeight`). */
21
+ height: number;
22
+ /** Backing-store pixels per CSS pixel (pass as `RenderOptions.pixelRatio`). */
23
+ pixelRatio: number;
24
+ }
25
+ /** The size `measureCanvasViewport` gives an element without layout (e.g. before it is shown, or in jsdom). */
26
+ export declare const DEFAULT_CANVAS_VIEWPORT: Readonly<{
27
+ width: number;
28
+ height: number;
29
+ }>;
30
+ /** The longest side a viewport backing store may reach; the pixel ratio is lowered to fit. */
31
+ export declare const MAX_CANVAS_BACKING_SIDE = 8192;
32
+ /**
33
+ * Measures the element a viewport canvas fills. `clientWidth` / `clientHeight` give the layout size
34
+ * (they ignore CSS transforms); `getBoundingClientRect()` gives the size on screen. Their ratio is
35
+ * the scale of any transform on the element or its ancestors, so the pixel ratio is
36
+ * `devicePixelRatio × that scale`: a 220px node scaled to 500px on a 2× screen gets ~4.5 backing
37
+ * pixels per CSS pixel instead of being stretched. `fallback` is the size of an element without
38
+ * layout (default `DEFAULT_CANVAS_VIEWPORT`).
39
+ */
40
+ export declare function measureCanvasViewport(el: MeasurableElement, devicePixelRatio?: number, fallback?: {
41
+ width: number;
42
+ height: number;
43
+ }): CanvasViewport;
44
+ /** Whether two measurements need different backing stores. */
45
+ export declare function sameCanvasViewport(a: CanvasViewport, b: CanvasViewport): boolean;
46
+ /**
47
+ * Calls `onChange` when the element's viewport measurement changes: on resize (a
48
+ * `ResizeObserver`), on window resize (browser zoom, moving to another screen) and after any CSS
49
+ * transition or animation ends (a host scaling the element with a transform, which resizes nothing).
50
+ * Returns a function that stops watching.
51
+ */
52
+ export declare function watchCanvasViewport(el: MeasurableElement & Partial<Element>, onChange: (viewport: CanvasViewport) => void): () => void;