textmode.export.js 1.9.0-beta.1 → 1.9.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.
@@ -3,53 +3,42 @@ import type { TXTExportOptions } from './exporters/txt';
3
3
  import type { SVGExportOptions } from './exporters/svg';
4
4
  import type { GIFExportOptions } from './exporters/gif';
5
5
  import type { VideoExportOptions } from './exporters/video';
6
- import type { JSONExportOptions, TextmodeDocumentJSON } from './exporters/json';
6
+ import type { JSONExportOptions } from './exporters/json';
7
+ import type { TextmodeDocumentJSON } from '@textmode/document';
7
8
  import type { ZIPExportOptions } from './exporters/zip';
8
9
  /**
9
10
  * Default TXT export fields controlled by the export overlay.
10
11
  *
11
- * @category Overlay
12
- *
13
12
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/TXTOverlayDefaults | TXTOverlayDefaults API reference}
14
13
  */
15
14
  export type TXTOverlayDefaults = Pick<TXTExportOptions, 'preserveTrailingSpaces' | 'emptyCharacter'>;
16
15
  /**
17
16
  * Default JSON export fields controlled by the export overlay.
18
17
  *
19
- * @category Overlay
20
- *
21
18
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/JSONOverlayDefaults | JSONOverlayDefaults API reference}
22
19
  */
23
20
  export type JSONOverlayDefaults = Pick<JSONExportOptions, 'target' | 'pretty' | 'includeMetadata' | 'colorMode'>;
24
21
  /**
25
22
  * Default image export fields controlled by the export overlay.
26
23
  *
27
- * @category Overlay
28
- *
29
24
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/ImageOverlayDefaults | ImageOverlayDefaults API reference}
30
25
  */
31
26
  export type ImageOverlayDefaults = Pick<ImageExportOptions, 'format' | 'scale'>;
32
27
  /**
33
28
  * Default SVG export fields controlled by the export overlay.
34
29
  *
35
- * @category Overlay
36
- *
37
30
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/SVGOverlayDefaults | SVGOverlayDefaults API reference}
38
31
  */
39
32
  export type SVGOverlayDefaults = Pick<SVGExportOptions, 'includeBackgroundRectangles' | 'drawMode' | 'strokeWidth'>;
40
33
  /**
41
34
  * Default GIF export fields controlled by the export overlay.
42
35
  *
43
- * @category Overlay
44
- *
45
36
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/GIFOverlayDefaults | GIFOverlayDefaults API reference}
46
37
  */
47
38
  export type GIFOverlayDefaults = Pick<GIFExportOptions, 'frameCount' | 'frameRate' | 'scale' | 'repeat'>;
48
39
  /**
49
40
  * Default video export fields controlled by the export overlay.
50
41
  *
51
- * @category Overlay
52
- *
53
42
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/VideoOverlayDefaults | VideoOverlayDefaults API reference}
54
43
  */
55
44
  export type VideoOverlayDefaults = Pick<VideoExportOptions, 'format' | 'frameCount' | 'frameRate' | 'quality' | 'hardwareAcceleration' | 'keyFrameInterval' | 'transparent'>;
@@ -63,8 +52,6 @@ export type VideoOverlayDefaults = Pick<VideoExportOptions, 'format' | 'frameCou
63
52
  * {@link ExportOverlayController.getDefaults} and
64
53
  * {@link ExportOverlayController.setDefaults}.
65
54
  *
66
- * @category Overlay
67
- *
68
55
  * @see {@link https://code.textmode.art/api/textmode.export.js/type-aliases/ExportDefaults | ExportDefaults API reference}
69
56
  */
70
57
  export type ExportDefaults = {
@@ -88,8 +75,6 @@ export type ExportDefaults = {
88
75
  * format's curated defaults. Top-level `format` changes the overlay's selected
89
76
  * format. Omitted keys keep their current value.
90
77
  *
91
- * @category Overlay
92
- *
93
78
  * @example
94
79
  * ```ts
95
80
  * t.exportOverlay.setDefaults({ format: 'image', image: { scale: 2 }, gif: { frameRate: 30 } });
@@ -108,8 +93,6 @@ export type ExportDefaultsPatch = {
108
93
  * `auto` means the overlay is using the library default offset from the
109
94
  * textmode canvas. `custom` means the user or runtime API has moved it.
110
95
  *
111
- * @category Overlay
112
- *
113
96
  * @see {@link https://code.textmode.art/api/textmode.export.js/interfaces/ExportOverlayPosition | ExportOverlayPosition API reference}
114
97
  */
115
98
  export interface ExportOverlayPosition {
@@ -120,8 +103,6 @@ export interface ExportOverlayPosition {
120
103
  /**
121
104
  * Canvas-relative placement coordinates for the export overlay UI.
122
105
  *
123
- * @category Overlay
124
- *
125
106
  * @see {@link https://code.textmode.art/api/textmode.export.js/interfaces/ExportOverlayPositionInput | ExportOverlayPositionInput API reference}
126
107
  */
127
108
  export interface ExportOverlayPositionInput {
@@ -131,8 +112,6 @@ export interface ExportOverlayPositionInput {
131
112
  /**
132
113
  * Controller for managing the export overlay UI visibility at runtime.
133
114
  *
134
- * @category Overlay
135
- *
136
115
  * @see {@link https://code.textmode.art/api/textmode.export.js/interfaces/ExportOverlayController | ExportOverlayController API reference}
137
116
  */
138
117
  export interface ExportOverlayController {
@@ -282,8 +261,6 @@ export interface ExportOverlayController {
282
261
  /**
283
262
  * Runtime export helpers that `ExportPlugin` attaches to the `Textmodifier` instance.
284
263
  *
285
- * @category Workflow
286
- *
287
264
  * @example
288
265
  * {@includeCode ../examples/ExportPlugin/layerTargets/sketch.js}
289
266
  *
@@ -388,7 +365,8 @@ export interface TextmodeExportAPI {
388
365
  */
389
366
  toString(options?: TXTExportOptions): string;
390
367
  /**
391
- * Produces the selected layer or layer stack as structured JSON data.
368
+ * Produces a v3 document with a nonempty layers array.
369
+ * Selected layers retain their visibility, opacity, blending, and transforms.
392
370
  *
393
371
  * @param options Export options.
394
372
  * @returns The JSON document representing the selected layer or layer stack.
@@ -397,13 +375,14 @@ export interface TextmodeExportAPI {
397
375
  * ```ts
398
376
  * const layer = t.toJSON({ layer: t.layers.base, colorMode: 'hex', includeMetadata: true });
399
377
  * const stack = t.toJSON({ target: 'all' });
378
+ * console.log(layer.layers[0].grid, stack.formatVersion); // 3.0.0
400
379
  * ```
401
380
  *
402
381
  * @see {@link https://code.textmode.art/api/textmode.export.js/interfaces/TextmodeExportAPI#tojson | TextmodeExportAPI.toJSON API reference}
403
382
  */
404
383
  toJSON(options?: JSONExportOptions): TextmodeDocumentJSON;
405
384
  /**
406
- * Produces the selected layer or layer stack as a JSON string.
385
+ * Produces the selected layer or layer stack as a v3 JSON document string.
407
386
  *
408
387
  * @param options Export options.
409
388
  * @returns Serialized JSON string for the selected layer or layer stack.
@@ -418,7 +397,7 @@ export interface TextmodeExportAPI {
418
397
  */
419
398
  toJSONString(options?: JSONExportOptions): string;
420
399
  /**
421
- * Downloads the selected layer or layer stack as a JSON file.
400
+ * Downloads the selected layer or layer stack as a v3 JSON document file.
422
401
  *
423
402
  * @param options Export options.
424
403
  *
@@ -514,8 +493,6 @@ export interface TextmodeExportAPI {
514
493
  * @returns A promise that resolves after the archive download is initiated.
515
494
  * @throws {Error} When validation, capture, serialization, archive writing, or download fails.
516
495
  *
517
- * @category ZIP frame-sequence export
518
- *
519
496
  * @example
520
497
  * ```ts
521
498
  * await t.saveZip({
@@ -540,8 +517,6 @@ export interface TextmodeExportAPI {
540
517
  * @returns The completed `application/zip` blob.
541
518
  * @throws {Error} When validation, capture, serialization, archive writing, or cancellation fails.
542
519
  *
543
- * @category ZIP frame-sequence export
544
- *
545
520
  * @example
546
521
  * ```ts
547
522
  * const archive = await t.toZipBlob({ format: 'svg', frameCount: 60, frameRate: 24 });
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "textmode.export.js",
3
- "version": "1.9.0-beta.1",
3
+ "version": "1.9.0",
4
4
  "description": "Export plugin for textmode.js - Save images, GIFs, videos, SVG, JSON, text, and ZIP frame sequences.",
5
5
  "type": "module",
6
6
  "devEngines": {
7
7
  "runtime": {
8
8
  "name": "node",
9
- "version": "^24.0.0",
9
+ "version": ">=24.0.0",
10
10
  "onFail": "error"
11
11
  },
12
12
  "packageManager": {
@@ -63,21 +63,24 @@
63
63
  "textmode.js": "^0.18.0"
64
64
  },
65
65
  "dependencies": {
66
+ "@textmode/document": "1.1.0",
66
67
  "fflate": "0.8.3",
67
68
  "gifenc": "^1.0.1",
68
- "mediabunny": "1.55.2"
69
+ "mediabunny": "1.62.1"
69
70
  },
70
71
  "devDependencies": {
71
- "@textmode/build": "^0.1.0",
72
+ "@textmode/build": "^0.1.1",
72
73
  "@textmode/docs": "^0.3.0",
73
- "@textmode/lint": "^0.1.0",
74
+ "@textmode/lint": "^0.1.2",
74
75
  "@textmode/release": "^0.2.0",
75
- "@textmode/tsconfig": "^0.2.1",
76
- "@types/node": "^24.0.0",
76
+ "@textmode/tsconfig": "^0.2.2",
77
+ "@types/node": "^26.4.1",
78
+ "ajv": "^8.20.0",
79
+ "ajv-formats": "^3.0.1",
77
80
  "textmode.js": "^0.18.0",
78
81
  "typescript": "^6.0.3",
79
82
  "vite-plugin-css-injected-by-js": "^5.0.2",
80
- "vitest": "^4.1.10"
83
+ "vitest": "^5.0.0"
81
84
  },
82
85
  "keywords": [
83
86
  "textmode",