@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.
- package/dist/agent/index.cjs +34 -34
- package/dist/agent/index.js +8 -8
- package/dist/animation-editor/editorDocument.d.cts +9 -0
- package/dist/animation-editor/editorDocument.d.ts +9 -0
- package/dist/animation-editor/index.cjs +33 -1
- package/dist/animation-editor/index.d.cts +1 -0
- package/dist/animation-editor/index.d.ts +1 -0
- package/dist/animation-editor/index.js +32 -0
- package/dist/bridge/cli.cjs +4 -4
- package/dist/bridge/cli.js +3 -3
- package/dist/bridge/index.cjs +4 -4
- package/dist/bridge/index.js +3 -3
- package/dist/chart/controller.d.cts +5 -0
- package/dist/chart/controller.d.ts +5 -0
- package/dist/chart/editorDocument.d.cts +10 -0
- package/dist/chart/editorDocument.d.ts +10 -0
- package/dist/chart/index.cjs +54 -18
- package/dist/chart/index.d.cts +1 -0
- package/dist/chart/index.d.ts +1 -0
- package/dist/chart/index.js +37 -1
- package/dist/{chunk-ENIZYNEF.cjs → chunk-24M7VD6M.cjs} +7 -7
- package/dist/{chunk-OET45HIR.js → chunk-4RF2H3N3.js} +10 -0
- package/dist/{chunk-KC7HB5GF.cjs → chunk-5H2C3QSF.cjs} +4 -3
- package/dist/{chunk-HRLT5BYO.js → chunk-GNV54DLO.js} +2 -1
- package/dist/{chunk-EAQ4BGNS.js → chunk-MKTDELCD.js} +1 -1
- package/dist/{chunk-X35BV5YT.cjs → chunk-ML2II3Y3.cjs} +10 -0
- package/dist/{chunk-QCEQIRJQ.cjs → chunk-PI45JMP7.cjs} +163 -136
- package/dist/{chunk-DVLMW3GB.cjs → chunk-R3PECGTQ.cjs} +44 -44
- package/dist/{chunk-2AQL4JHM.js → chunk-R6HNWN7B.js} +1 -1
- package/dist/{chunk-6QTON3VW.cjs → chunk-RZJCYJWO.cjs} +8 -8
- package/dist/{chunk-O5ML2I6O.js → chunk-SVINJIGK.js} +1 -1
- package/dist/{chunk-ZQUANEK4.js → chunk-Y64YPIFT.js} +28 -1
- package/dist/diagram/index.cjs +6 -6
- package/dist/diagram/index.js +5 -5
- package/dist/export/index.cjs +1 -1
- package/dist/export/index.js +1 -1
- package/dist/extensions/index.cjs +5 -5
- package/dist/extensions/index.js +4 -4
- package/dist/image-editor/canvas-viewport.d.cts +52 -0
- package/dist/image-editor/canvas-viewport.d.ts +52 -0
- package/dist/image-editor/index.cjs +666 -599
- package/dist/image-editor/index.d.cts +1 -0
- package/dist/image-editor/index.d.ts +1 -0
- package/dist/image-editor/index.js +100 -33
- package/dist/image-editor/layers/ops.d.cts +21 -3
- package/dist/image-editor/layers/ops.d.ts +21 -3
- package/dist/image-editor/renderer.d.cts +7 -0
- package/dist/image-editor/renderer.d.ts +7 -0
- package/dist/index.cjs +14 -14
- package/dist/index.js +8 -8
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/dist/parameters/controller.d.cts +6 -0
- package/dist/parameters/controller.d.ts +6 -0
- package/dist/parameters/editorDocument.d.cts +9 -0
- package/dist/parameters/editorDocument.d.ts +9 -0
- package/dist/parameters/index.cjs +71 -1
- package/dist/parameters/index.d.cts +1 -0
- package/dist/parameters/index.d.ts +1 -0
- package/dist/parameters/index.js +70 -0
- package/dist/persistence/editorDocument.d.cts +6 -3
- package/dist/persistence/editorDocument.d.ts +6 -3
- package/dist/persistence/index.cjs +7 -7
- package/dist/persistence/index.js +1 -1
- package/dist/tools/index.cjs +5 -5
- package/dist/tools/index.js +6 -6
- package/dist/vector/editorDocument.d.cts +9 -0
- package/dist/vector/editorDocument.d.ts +9 -0
- package/dist/vector/index.cjs +45 -1
- package/dist/vector/index.d.cts +1 -0
- package/dist/vector/index.d.ts +1 -0
- package/dist/vector/index.js +44 -0
- package/dist/video-editor/editorDocument.d.cts +9 -0
- package/dist/video-editor/editorDocument.d.ts +9 -0
- package/dist/video-editor/index.cjs +33 -1
- package/dist/video-editor/index.d.cts +1 -0
- package/dist/video-editor/index.d.ts +1 -0
- package/dist/video-editor/index.js +32 -0
- package/package.json +2 -2
- package/skills/pixerate-animation-editor/SKILL.md +12 -0
- package/skills/pixerate-chart/SKILL.md +12 -0
- package/skills/pixerate-image-editor/SKILL.md +6 -6
- package/skills/pixerate-parameters/SKILL.md +12 -0
- package/skills/pixerate-vector/SKILL.md +14 -0
- package/skills/pixerate-video-editor/SKILL.md +12 -0
- package/dist/{chunk-Y4BWZB6J.cjs → chunk-462WGGXX.cjs} +2 -2
- package/dist/{chunk-RFBFTLVN.js → chunk-EVXQNQND.js} +3 -3
package/dist/extensions/index.js
CHANGED
|
@@ -95,7 +95,7 @@ import {
|
|
|
95
95
|
updateImageSrc,
|
|
96
96
|
validateFindPattern,
|
|
97
97
|
writeRichClipboard
|
|
98
|
-
} from "../chunk-
|
|
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-
|
|
175
|
-
import "../chunk-
|
|
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;
|