textmode.export.js 1.3.0 → 1.4.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 (58) hide show
  1. package/README.md +1 -1
  2. package/dist/textmode.export.esm.js +1001 -880
  3. package/dist/textmode.export.umd.js +2 -2
  4. package/dist/types/exporters/base/LayerTarget.d.ts +46 -0
  5. package/dist/types/exporters/base/LayerTarget.d.ts.map +1 -0
  6. package/dist/types/exporters/base/index.d.ts +2 -0
  7. package/dist/types/exporters/base/index.d.ts.map +1 -1
  8. package/dist/types/exporters/gif/GIFExporter.d.ts +1 -1
  9. package/dist/types/exporters/gif/GIFExporter.d.ts.map +1 -1
  10. package/dist/types/exporters/gif/GIFRecorder.d.ts +1 -1
  11. package/dist/types/exporters/gif/GIFRecorder.d.ts.map +1 -1
  12. package/dist/types/exporters/json/JSONDataExtractor.d.ts +3 -4
  13. package/dist/types/exporters/json/JSONDataExtractor.d.ts.map +1 -1
  14. package/dist/types/exporters/json/JSONExporter.d.ts +12 -7
  15. package/dist/types/exporters/json/JSONExporter.d.ts.map +1 -1
  16. package/dist/types/exporters/json/index.d.ts +1 -1
  17. package/dist/types/exporters/json/index.d.ts.map +1 -1
  18. package/dist/types/exporters/json/types.d.ts +78 -15
  19. package/dist/types/exporters/json/types.d.ts.map +1 -1
  20. package/dist/types/exporters/svg/SVGContentGenerator.d.ts +1 -1
  21. package/dist/types/exporters/svg/SVGContentGenerator.d.ts.map +1 -1
  22. package/dist/types/exporters/svg/SVGExporter.d.ts.map +1 -1
  23. package/dist/types/exporters/svg/SVGPathGenerator.d.ts +1 -1
  24. package/dist/types/exporters/svg/SVGPathGenerator.d.ts.map +1 -1
  25. package/dist/types/exporters/svg/types.d.ts +3 -1
  26. package/dist/types/exporters/svg/types.d.ts.map +1 -1
  27. package/dist/types/exporters/txt/TXTExporter.d.ts.map +1 -1
  28. package/dist/types/exporters/txt/TXTExporter.test.d.ts +2 -0
  29. package/dist/types/exporters/txt/TXTExporter.test.d.ts.map +1 -0
  30. package/dist/types/exporters/txt/types.d.ts +3 -1
  31. package/dist/types/exporters/txt/types.d.ts.map +1 -1
  32. package/dist/types/exporters/video/VideoExporter.d.ts +1 -1
  33. package/dist/types/exporters/video/VideoExporter.d.ts.map +1 -1
  34. package/dist/types/exporters/video/VideoRecorder.d.ts +1 -1
  35. package/dist/types/exporters/video/VideoRecorder.d.ts.map +1 -1
  36. package/dist/types/index.d.ts +4 -3
  37. package/dist/types/index.d.ts.map +1 -1
  38. package/dist/types/overlay/blades/Blade.d.ts +2 -0
  39. package/dist/types/overlay/blades/Blade.d.ts.map +1 -1
  40. package/dist/types/overlay/blades/JSONBlade.d.ts +5 -0
  41. package/dist/types/overlay/blades/JSONBlade.d.ts.map +1 -1
  42. package/dist/types/overlay/blades/SVGBlade.d.ts +2 -0
  43. package/dist/types/overlay/blades/SVGBlade.d.ts.map +1 -1
  44. package/dist/types/overlay/blades/TextBlade.d.ts +2 -0
  45. package/dist/types/overlay/blades/TextBlade.d.ts.map +1 -1
  46. package/dist/types/overlay/components/inputs/LayerTargetSelect.d.ts +20 -0
  47. package/dist/types/overlay/components/inputs/LayerTargetSelect.d.ts.map +1 -0
  48. package/dist/types/overlay/core/OverlayController.d.ts +1 -0
  49. package/dist/types/overlay/core/OverlayController.d.ts.map +1 -1
  50. package/dist/types/overlay/formatRegistry.d.ts +2 -1
  51. package/dist/types/overlay/formatRegistry.d.ts.map +1 -1
  52. package/dist/types/overlay/formatRegistry.test.d.ts +2 -0
  53. package/dist/types/overlay/formatRegistry.test.d.ts.map +1 -0
  54. package/dist/types/overlay/index.d.ts +3 -1
  55. package/dist/types/overlay/index.d.ts.map +1 -1
  56. package/dist/types/types.d.ts +21 -18
  57. package/dist/types/types.d.ts.map +1 -1
  58. package/package.json +4 -3
@@ -3,7 +3,7 @@ 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, TextmodeLayerJSON } from './exporters/json';
6
+ import type { JSONExportOptions, TextmodeDocumentJSON } from './exporters/json';
7
7
  /**
8
8
  * Controller for managing the export overlay UI visibility at runtime.
9
9
  */
@@ -76,83 +76,86 @@ export interface TextmodeExportAPI {
76
76
  */
77
77
  copyCanvas(options?: ImageExportOptions): Promise<void>;
78
78
  /**
79
- * Downloads the current frame as an SVG file.
79
+ * Downloads the selected layer as an SVG file.
80
80
  *
81
81
  * @param options Export options.
82
82
  *
83
83
  * @example
84
84
  * ```ts
85
- * t.saveSVG({ filename: 'poster', includeBackgroundRectangles: true });
85
+ * t.saveSVG({ filename: 'poster', layer: t.layers.base, includeBackgroundRectangles: true });
86
86
  * ```
87
87
  */
88
88
  saveSVG(options?: SVGExportOptions): void;
89
89
  /**
90
- * Downloads the current text content as a plain-text file.
90
+ * Downloads the selected layer's text content as a plain-text file.
91
91
  *
92
92
  * @param options Export options.
93
93
  *
94
94
  * @example
95
95
  * ```ts
96
- * t.saveStrings({ filename: 'frame', preserveTrailingSpaces: true });
96
+ * t.saveStrings({ filename: 'frame', layer: t.layers.base, preserveTrailingSpaces: true });
97
97
  * ```
98
98
  */
99
99
  saveStrings(options?: TXTExportOptions): void;
100
100
  /**
101
- * Generates the SVG markup for the current frame.
101
+ * Generates SVG markup for the selected layer.
102
102
  *
103
103
  * @param options Export options.
104
104
  * @returns The SVG content representing the artwork.
105
105
  *
106
106
  * @example
107
107
  * ```ts
108
- * const svg = t.toSVG({ drawMode: 'stroke', strokeWidth: 1.5 });
108
+ * const svg = t.toSVG({ layer: t.layers.base, drawMode: 'stroke', strokeWidth: 1.5 });
109
109
  * ```
110
110
  */
111
111
  toSVG(options?: SVGExportOptions): string;
112
112
  /**
113
- * Produces the current text content as a string.
113
+ * Produces the selected layer's text content as a string.
114
114
  *
115
115
  * @param options Export options.
116
116
  * @returns The textual representation of the artwork.
117
117
  *
118
118
  * @example
119
119
  * ```ts
120
- * const text = t.toString({ preserveTrailingSpaces: false });
120
+ * const text = t.toString({ layer: t.layers.base, preserveTrailingSpaces: false });
121
121
  * ```
122
122
  */
123
123
  toString(options?: TXTExportOptions): string;
124
124
  /**
125
- * Produces the current base layer as structured JSON data.
125
+ * Produces the selected layer or layer stack as structured JSON data.
126
126
  *
127
127
  * @param options Export options.
128
- * @returns The JSON document representing the current base layer.
128
+ * @returns The JSON document representing the selected layer or layer stack.
129
129
  *
130
130
  * @example
131
131
  * ```ts
132
- * const layer = t.toJSON({ colorMode: 'hex', includeMetadata: true });
132
+ * const layer = t.toJSON({ layer: t.layers.base, colorMode: 'hex', includeMetadata: true });
133
+ * const stack = t.toJSON({ target: 'all' });
133
134
  * ```
134
135
  */
135
- toJSON(options?: JSONExportOptions): TextmodeLayerJSON;
136
+ toJSON(options?: JSONExportOptions): TextmodeDocumentJSON;
136
137
  /**
137
- * Produces the current base layer as a JSON string.
138
+ * Produces the selected layer or layer stack as a JSON string.
138
139
  *
139
140
  * @param options Export options.
140
- * @returns Serialized JSON string for the current base layer.
141
+ * @returns Serialized JSON string for the selected layer or layer stack.
141
142
  *
142
143
  * @example
143
144
  * ```ts
144
- * const json = t.toJSONString({ pretty: false, colorMode: 'hex' });
145
+ * const json = t.toJSONString({ layer: t.layers.base, pretty: false, colorMode: 'hex' });
146
+ * const stackJson = t.toJSONString({ target: 'all' });
145
147
  * ```
146
148
  */
147
149
  toJSONString(options?: JSONExportOptions): string;
148
150
  /**
149
- * Downloads the current base layer as a JSON file.
151
+ * Downloads the selected layer or layer stack as a JSON file.
150
152
  *
151
153
  * @param options Export options.
152
154
  *
153
155
  * @example
154
156
  * ```ts
155
- * t.saveJSON({ filename: 'frame', pretty: true });
157
+ * t.saveJSON({ filename: 'frame', layer: t.layers.base, pretty: true });
158
+ * t.saveJSON({ filename: 'stack', target: 'all' });
156
159
  * ```
157
160
  */
158
161
  saveJSON(options?: JSONExportOptions): void;
@@ -1 +1 @@
1
- {"version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,EAAE,OAAO,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "textmode.export.js",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Export plugin for textmode.js - Save your creations as images, GIFs, videos, SVG, JSON, and plain text.",
5
5
  "type": "module",
6
6
  "main": "./dist/textmode.export.umd.js",
@@ -43,7 +43,7 @@
43
43
  "prepare": "husky"
44
44
  },
45
45
  "peerDependencies": {
46
- "textmode.js": ">=0.10.0"
46
+ "textmode.js": ">=0.13.0"
47
47
  },
48
48
  "dependencies": {
49
49
  "gifenc": "^1.0.1",
@@ -56,6 +56,7 @@
56
56
  "@rollup/plugin-terser": "^0.4.4",
57
57
  "@semantic-release/commit-analyzer": "^13.0.1",
58
58
  "@semantic-release/exec": "^7.1.0",
59
+ "@semantic-release/git": "^10.0.1",
59
60
  "@semantic-release/github": "^12.0.6",
60
61
  "@semantic-release/npm": "^13.1.5",
61
62
  "@semantic-release/release-notes-generator": "^14.1.0",
@@ -72,7 +73,7 @@
72
73
  "prettier": "^3.8.3",
73
74
  "semantic-release": "^25.0.3",
74
75
  "terser": "^5.44.0",
75
- "textmode.js": "^0.12.0",
76
+ "textmode.js": "^0.13.0",
76
77
  "typedoc": "^0.28.19",
77
78
  "typedoc-plugin-frontmatter": "^1.3.1",
78
79
  "typedoc-plugin-markdown": "^4.11.0",