textmode.export.js 1.5.2 → 1.6.0-beta.2

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 (170) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +97 -152
  3. package/dist/textmode.export.esm.js +1 -5890
  4. package/dist/textmode.export.umd.js +1 -68
  5. package/dist/types/augmentations/index.d.ts +0 -1
  6. package/dist/types/augmentations/textmode.d.ts +0 -1
  7. package/dist/types/exporters/base/CharacterResolver.d.ts +0 -1
  8. package/dist/types/exporters/base/DataExtractor.d.ts +0 -1
  9. package/dist/types/exporters/base/FileHandler.d.ts +0 -1
  10. package/dist/types/exporters/base/FramePreparation.d.ts +10 -0
  11. package/dist/types/exporters/base/LayerTarget.d.ts +4 -3
  12. package/dist/types/exporters/base/index.d.ts +1 -1
  13. package/dist/types/exporters/gif/GIFEncoderWorker.d.ts +1 -0
  14. package/dist/types/exporters/gif/GIFExporter.d.ts +7 -27
  15. package/dist/types/exporters/gif/GIFRecorder.d.ts +0 -1
  16. package/dist/types/exporters/gif/GIFWorkerClient.d.ts +15 -0
  17. package/dist/types/exporters/gif/index.d.ts +0 -1
  18. package/dist/types/exporters/gif/types.d.ts +19 -1
  19. package/dist/types/exporters/image/ImageExporter.d.ts +2 -1
  20. package/dist/types/exporters/image/index.d.ts +0 -1
  21. package/dist/types/exporters/image/types.d.ts +2 -1
  22. package/dist/types/exporters/json/JSONDataExtractor.d.ts +0 -1
  23. package/dist/types/exporters/json/JSONExporter.d.ts +0 -1
  24. package/dist/types/exporters/json/index.d.ts +0 -1
  25. package/dist/types/exporters/json/types.d.ts +8 -1
  26. package/dist/types/exporters/svg/SVGContentGenerator.d.ts +0 -1
  27. package/dist/types/exporters/svg/SVGDataExtractor.d.ts +0 -1
  28. package/dist/types/exporters/svg/SVGExporter.d.ts +0 -1
  29. package/dist/types/exporters/svg/SVGPathGenerator.d.ts +0 -1
  30. package/dist/types/exporters/svg/index.d.ts +0 -1
  31. package/dist/types/exporters/svg/types.d.ts +2 -1
  32. package/dist/types/exporters/txt/TXTExporter.d.ts +0 -1
  33. package/dist/types/exporters/txt/index.d.ts +0 -1
  34. package/dist/types/exporters/txt/types.d.ts +2 -1
  35. package/dist/types/exporters/video/VideoExporter.d.ts +2 -2
  36. package/dist/types/exporters/video/VideoFrameDriver.d.ts +0 -1
  37. package/dist/types/exporters/video/VideoRecorder.d.ts +0 -1
  38. package/dist/types/exporters/video/errors.d.ts +0 -1
  39. package/dist/types/exporters/video/index.d.ts +0 -1
  40. package/dist/types/exporters/video/types.d.ts +27 -1
  41. package/dist/types/exporters/video/withAbortableTimeout.d.ts +0 -1
  42. package/dist/types/index.d.ts +16 -56
  43. package/dist/types/overlay/blades/Blade.d.ts +9 -3
  44. package/dist/types/overlay/blades/GIFBlade.d.ts +1 -1
  45. package/dist/types/overlay/blades/ImageBlade.d.ts +1 -1
  46. package/dist/types/overlay/blades/JSONBlade.d.ts +1 -1
  47. package/dist/types/overlay/blades/RecordingBlade.d.ts +7 -0
  48. package/dist/types/overlay/blades/SVGBlade.d.ts +1 -1
  49. package/dist/types/overlay/blades/TextBlade.d.ts +1 -1
  50. package/dist/types/overlay/blades/VideoBlade.d.ts +1 -1
  51. package/dist/types/overlay/blades/index.d.ts +3 -1
  52. package/dist/types/overlay/components/actions/Button.d.ts +0 -1
  53. package/dist/types/overlay/components/base/Component.d.ts +0 -1
  54. package/dist/types/overlay/components/base/Container.d.ts +0 -1
  55. package/dist/types/overlay/components/base/Field.d.ts +0 -1
  56. package/dist/types/overlay/components/display/Header.d.ts +3 -1
  57. package/dist/types/overlay/components/display/StatusDisplay.d.ts +0 -1
  58. package/dist/types/overlay/components/inputs/CheckboxInput.d.ts +0 -1
  59. package/dist/types/overlay/components/inputs/LayerTargetSelect.d.ts +0 -1
  60. package/dist/types/overlay/components/inputs/NumberInput.d.ts +0 -1
  61. package/dist/types/overlay/components/inputs/RangeInput.d.ts +0 -1
  62. package/dist/types/overlay/components/inputs/SelectInput.d.ts +0 -1
  63. package/dist/types/overlay/components/inputs/TextInput.d.ts +0 -1
  64. package/dist/types/overlay/config/DefaultsStore.d.ts +11 -0
  65. package/dist/types/overlay/config/ExportDefaults.d.ts +3 -0
  66. package/dist/types/overlay/core/EventBus.d.ts +0 -1
  67. package/dist/types/overlay/core/OverlayController.d.ts +29 -6
  68. package/dist/types/overlay/core/StateManager.d.ts +0 -1
  69. package/dist/types/overlay/formatRegistry.d.ts +3 -2
  70. package/dist/types/overlay/index.d.ts +0 -2
  71. package/dist/types/overlay/models/FormatDefinition.d.ts +0 -1
  72. package/dist/types/overlay/models/OverlayEvents.d.ts +0 -1
  73. package/dist/types/overlay/models/OverlayState.d.ts +1 -2
  74. package/dist/types/overlay/services/ClipboardService.d.ts +1 -5
  75. package/dist/types/overlay/services/ExportService.d.ts +0 -2
  76. package/dist/types/overlay/services/OverlayPositionStorage.d.ts +12 -0
  77. package/dist/types/overlay/services/PositionService.d.ts +33 -3
  78. package/dist/types/overlay/types.d.ts +36 -2
  79. package/dist/types/overlay/utils/classes.d.ts +3 -1
  80. package/dist/types/types.d.ts +273 -34
  81. package/dist/types/utils/pixels.d.ts +0 -1
  82. package/dist/types/version.d.ts +0 -1
  83. package/package.json +87 -53
  84. package/dist/types/augmentations/index.d.ts.map +0 -1
  85. package/dist/types/augmentations/textmode.d.ts.map +0 -1
  86. package/dist/types/augmentations/textmode.test.d.ts +0 -2
  87. package/dist/types/augmentations/textmode.test.d.ts.map +0 -1
  88. package/dist/types/exporters/base/CharacterResolver.d.ts.map +0 -1
  89. package/dist/types/exporters/base/DataExtractor.d.ts.map +0 -1
  90. package/dist/types/exporters/base/FileHandler.d.ts.map +0 -1
  91. package/dist/types/exporters/base/LayerTarget.d.ts.map +0 -1
  92. package/dist/types/exporters/base/index.d.ts.map +0 -1
  93. package/dist/types/exporters/gif/GIFExporter.d.ts.map +0 -1
  94. package/dist/types/exporters/gif/GIFRecorder.d.ts.map +0 -1
  95. package/dist/types/exporters/gif/index.d.ts.map +0 -1
  96. package/dist/types/exporters/gif/types.d.ts.map +0 -1
  97. package/dist/types/exporters/image/ImageExporter.d.ts.map +0 -1
  98. package/dist/types/exporters/image/index.d.ts.map +0 -1
  99. package/dist/types/exporters/image/types.d.ts.map +0 -1
  100. package/dist/types/exporters/json/JSONDataExtractor.d.ts.map +0 -1
  101. package/dist/types/exporters/json/JSONExporter.d.ts.map +0 -1
  102. package/dist/types/exporters/json/JSONExporter.test.d.ts +0 -2
  103. package/dist/types/exporters/json/JSONExporter.test.d.ts.map +0 -1
  104. package/dist/types/exporters/json/index.d.ts.map +0 -1
  105. package/dist/types/exporters/json/types.d.ts.map +0 -1
  106. package/dist/types/exporters/svg/SVGContentGenerator.d.ts.map +0 -1
  107. package/dist/types/exporters/svg/SVGDataExtractor.d.ts.map +0 -1
  108. package/dist/types/exporters/svg/SVGExporter.d.ts.map +0 -1
  109. package/dist/types/exporters/svg/SVGExporter.test.d.ts +0 -2
  110. package/dist/types/exporters/svg/SVGExporter.test.d.ts.map +0 -1
  111. package/dist/types/exporters/svg/SVGPathGenerator.d.ts.map +0 -1
  112. package/dist/types/exporters/svg/index.d.ts.map +0 -1
  113. package/dist/types/exporters/svg/types.d.ts.map +0 -1
  114. package/dist/types/exporters/txt/TXTExporter.d.ts.map +0 -1
  115. package/dist/types/exporters/txt/TXTExporter.test.d.ts +0 -2
  116. package/dist/types/exporters/txt/TXTExporter.test.d.ts.map +0 -1
  117. package/dist/types/exporters/txt/index.d.ts.map +0 -1
  118. package/dist/types/exporters/txt/types.d.ts.map +0 -1
  119. package/dist/types/exporters/video/VideoExporter.d.ts.map +0 -1
  120. package/dist/types/exporters/video/VideoExporter.test.d.ts +0 -2
  121. package/dist/types/exporters/video/VideoExporter.test.d.ts.map +0 -1
  122. package/dist/types/exporters/video/VideoFrameDriver.d.ts.map +0 -1
  123. package/dist/types/exporters/video/VideoFrameDriver.test.d.ts +0 -2
  124. package/dist/types/exporters/video/VideoFrameDriver.test.d.ts.map +0 -1
  125. package/dist/types/exporters/video/VideoRecorder.d.ts.map +0 -1
  126. package/dist/types/exporters/video/VideoRecorder.test.d.ts +0 -2
  127. package/dist/types/exporters/video/VideoRecorder.test.d.ts.map +0 -1
  128. package/dist/types/exporters/video/errors.d.ts.map +0 -1
  129. package/dist/types/exporters/video/index.d.ts.map +0 -1
  130. package/dist/types/exporters/video/types.d.ts.map +0 -1
  131. package/dist/types/exporters/video/withAbortableTimeout.d.ts.map +0 -1
  132. package/dist/types/index.d.ts.map +0 -1
  133. package/dist/types/overlay/blades/Blade.d.ts.map +0 -1
  134. package/dist/types/overlay/blades/GIFBlade.d.ts.map +0 -1
  135. package/dist/types/overlay/blades/ImageBlade.d.ts.map +0 -1
  136. package/dist/types/overlay/blades/JSONBlade.d.ts.map +0 -1
  137. package/dist/types/overlay/blades/SVGBlade.d.ts.map +0 -1
  138. package/dist/types/overlay/blades/TextBlade.d.ts.map +0 -1
  139. package/dist/types/overlay/blades/VideoBlade.d.ts.map +0 -1
  140. package/dist/types/overlay/blades/index.d.ts.map +0 -1
  141. package/dist/types/overlay/components/actions/Button.d.ts.map +0 -1
  142. package/dist/types/overlay/components/base/Component.d.ts.map +0 -1
  143. package/dist/types/overlay/components/base/Container.d.ts.map +0 -1
  144. package/dist/types/overlay/components/base/Field.d.ts.map +0 -1
  145. package/dist/types/overlay/components/display/Header.d.ts.map +0 -1
  146. package/dist/types/overlay/components/display/StatusDisplay.d.ts.map +0 -1
  147. package/dist/types/overlay/components/inputs/CheckboxInput.d.ts.map +0 -1
  148. package/dist/types/overlay/components/inputs/LayerTargetSelect.d.ts.map +0 -1
  149. package/dist/types/overlay/components/inputs/NumberInput.d.ts.map +0 -1
  150. package/dist/types/overlay/components/inputs/RangeInput.d.ts.map +0 -1
  151. package/dist/types/overlay/components/inputs/SelectInput.d.ts.map +0 -1
  152. package/dist/types/overlay/components/inputs/TextInput.d.ts.map +0 -1
  153. package/dist/types/overlay/core/EventBus.d.ts.map +0 -1
  154. package/dist/types/overlay/core/OverlayController.d.ts.map +0 -1
  155. package/dist/types/overlay/core/StateManager.d.ts.map +0 -1
  156. package/dist/types/overlay/formatRegistry.d.ts.map +0 -1
  157. package/dist/types/overlay/formatRegistry.test.d.ts +0 -2
  158. package/dist/types/overlay/formatRegistry.test.d.ts.map +0 -1
  159. package/dist/types/overlay/index.d.ts.map +0 -1
  160. package/dist/types/overlay/models/FormatDefinition.d.ts.map +0 -1
  161. package/dist/types/overlay/models/OverlayEvents.d.ts.map +0 -1
  162. package/dist/types/overlay/models/OverlayState.d.ts.map +0 -1
  163. package/dist/types/overlay/services/ClipboardService.d.ts.map +0 -1
  164. package/dist/types/overlay/services/ExportService.d.ts.map +0 -1
  165. package/dist/types/overlay/services/PositionService.d.ts.map +0 -1
  166. package/dist/types/overlay/types.d.ts.map +0 -1
  167. package/dist/types/overlay/utils/classes.d.ts.map +0 -1
  168. package/dist/types/types.d.ts.map +0 -1
  169. package/dist/types/utils/pixels.d.ts.map +0 -1
  170. package/dist/types/version.d.ts.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 humanbydefinition
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,171 +1,116 @@
1
- # textmode.export.js (✿◕‿◕)ノ
1
+ # textmode.export.js
2
2
 
3
3
  <div align="center">
4
4
 
5
- | [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![Vite](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=white)](https://vitejs.dev/) | [![API](https://img.shields.io/badge/API-typedoc-3178c6?logo=typescript&logoColor=white)](docs/README.md) [![docs](https://img.shields.io/badge/docs-vitepress-646cff?logo=vitepress&logoColor=white)](https://code.textmode.art/docs/exporting.html) [![Discord](https://img.shields.io/discord/1357070706181017691?color=5865F2&label=Discord&logo=discord&logoColor=white)](https://discord.gg/sjrw8QXNks) | [![ko-fi](https://shields.io/badge/ko--fi-donate-ff5f5f?logo=ko-fi)](https://ko-fi.com/V7V8JG2FY) [![GitHub-sponsors](https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/humanbydefinition) |
6
- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5
+ <img alt="textmode.export.js — save textmode in every format" src=".github/assets/readme-og.png" />
6
+
7
+ | [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/) [![Vite](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=white)](https://vitejs.dev/) | [![API](https://img.shields.io/badge/API-typedoc-3178c6?logo=typescript&logoColor=white)](https://code.textmode.art/api/textmode.export.js/) [![docs](https://img.shields.io/badge/docs-vitepress-646cff?logo=vitepress&logoColor=white)](https://code.textmode.art/docs/exporting.html) [![Discord](https://img.shields.io/discord/1357070706181017691?color=5865F2&label=Discord&logo=discord&logoColor=white)](https://discord.gg/sjrw8QXNks) | [![ko-fi](https://shields.io/badge/ko--fi-donate-ff5f5f?logo=ko-fi)](https://ko-fi.com/V7V8JG2FY) [![GitHub-sponsors](https://img.shields.io/badge/sponsor-30363D?logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/humanbydefinition) |
8
+ |:---|:---|:---|
7
9
 
8
10
  </div>
9
11
 
10
- `textmode.export.js` is an add-on library for [`textmode.js`](https://github.com/humanbydefinition/textmode.js) that adds various export options to your `Textmodifier` instance, including:
12
+ `textmode.export.js` is an export add-on for [`textmode.js`](https://github.com/humanbydefinition/textmode.js) that turns a sketch into shareable files and data. Through one consistent browser-based API, it produces plain text and JSON, raster images, animated GIFs, WebM and MP4 video, and scalable vector graphics.
13
+
14
+ Choose a compact still, structured document data, or a complete animation to suit the way your work will be used. `textmode.export.js` offers programmatic controls for automated workflows and an optional overlay UI for people saving and sharing directly from a sketch.
15
+
16
+ ## Features
17
+
18
+ - **Six output families** - TXT, structured JSON, SVG, PNG/JPEG/WebP, animated GIF, and MP4/WebM video
19
+ - **Exact canvas capture** - Preserve the final presented result, including compositing, shaders, filters, and post-processing
20
+ - **Layer-aware documents** - Export selected layers to TXT/SVG/JSON or preserve the complete descriptive layer stack in JSON
21
+ - **Programmatic exports** - Return text, SVG, and JSON in memory or save them directly as files
22
+ - **Interactive overlay** - Built-in format controls, live layer selectors, runtime defaults, visibility controls, and remembered placement
23
+ - **Clipboard workflows** - Copy text, JSON, SVG, and raster output without downloading files
24
+ - **Controlled animation capture** - Configure frames, frame rate, scale, GIF repetition, video encoding, transparency, progress, and more
25
+
26
+ ## Try it online first
27
+
28
+ Open [editor.textmode.art](https://editor.textmode.art/), a browser-based live-coding environment for the
29
+ complete official `textmode.js` ecosystem. Sketches run as you edit, with no local toolchain required.
30
+
31
+ The editor includes `textmode.js` and all four official add-ons: `textmode.export.js`, `textmode.filters.js`,
32
+ `textmode.figlet.js`, and `textmode.synth.js`.
11
33
 
12
- - Plain text (`.txt`)
13
- - JSON document data (`.json`)
14
- - Image files (`.png`, `.jpg`, `.webp`)
15
- - Animated image files (`.gif`)
16
- - Video files (`.webm`, `.mp4`)
17
- - Scalable vector graphics (`.svg`)
34
+ - Write with Monaco-powered completions, hover documentation, and diagnostics.
35
+ - Start with a blank sketch, an included example, or a community gallery sketch.
36
+ - Keep code and preferences saved in the browser, then share sketches through URL-based links.
37
+ - Use microphone or line-input analysis for audio-reactive work, and create on desktop or mobile.
18
38
 
19
- Besides exporting programatically, `textmode.export.js` also provides an overlay UI for users to easily export their creations.
39
+ Use it to experiment with export functionality while your sketch is running.
20
40
 
21
41
  ## Installation
22
42
 
23
- ### Prerequisites
24
-
25
- - The latest `textmode.export.js` version requires `textmode.js` v0.7.0 or later.
26
-
27
- ### UMD
28
-
29
- To use `textmode.export.js` in a UMD environment, download the latest `umd` build from the [**GitHub releases page**](https://github.com/humanbydefinition/textmode.export.js/releases/) or import it directly from a CDN like [**jsDelivr**](https://www.jsdelivr.com/package/npm/textmode.export.js). The library is distributed as a single JavaScript file, which you can include in your project by adding the following script tag to your HTML file:
30
-
31
- ```html
32
- <!-- index.html -->
33
- <!DOCTYPE html>
34
- <html>
35
- <head>
36
- <title>textmode.js sketch</title>
37
-
38
- <!-- Import textmode.js from jsDelivr CDN -->
39
- <script src="https://cdn.jsdelivr.net/npm/textmode.js@latest/dist/textmode.umd.js"></script>
40
-
41
- <!-- Import textmode.export.js from jsDelivr CDN -->
42
- <script src="https://cdn.jsdelivr.net/npm/textmode.export.js@latest/dist/textmode.export.umd.js"></script>
43
- </head>
44
- <body>
45
- <script src="sketch.js"></script>
46
- </body>
47
- </html>
48
- ```
49
-
50
- ```javascript
51
- // sketch.js
52
- const t = textmode.create({
53
- width: window.innerWidth,
54
- height: window.innerHeight,
55
- fontSize: 16,
56
- frameRate: 60,
57
- plugins: [ExportPlugin],
58
- });
59
-
60
- t.setup(() => {
61
- // Optional setup code here (e.g., load fonts/shaders, initialize variables that access 't')
62
- });
63
-
64
- t.draw(() => {
65
- t.background(32); // Dark gray background
66
-
67
- t.char('A');
68
- t.charColor(255, 0, 0); // Cover the top-left quarter of the grid with a rectangle of red 'A's
69
- t.rect(0, 0, t.grid.cols / 2, t.grid.rows / 2);
70
-
71
- // ...add your drawing code here!
72
-
73
- if (t.frameCount === 60) {
74
- t.saveCanvas({
75
- format: 'png',
76
- filename: 'my-sketch',
77
- });
78
- }
79
- });
80
-
81
- // Control the export overlay UI at runtime
82
- // t.exportOverlay.hide(); // Hide the overlay
83
- // t.exportOverlay.show(); // Show the overlay
84
- // t.exportOverlay.toggle(); // Toggle visibility
85
-
86
- t.windowResized(() => {
87
- t.resizeCanvas(window.innerWidth, window.innerHeight);
88
- });
89
- ```
90
-
91
- #### ESM
92
-
93
- To use `textmode.export.js` in an ESM environment, you can install it via `npm`:
94
-
95
- ```bash
96
- npm install textmode.export.js
97
- ```
98
-
99
- Then, you can import it in your JavaScript or TypeScript files:
100
-
101
- ```html
102
- <!-- index.html -->
103
- <!DOCTYPE html>
104
- <html lang="en">
105
- <head>
106
- <meta charset="utf-8" />
107
- <title>textmode.js sketch</title>
108
- </head>
109
- <body>
110
- <script type="module" src="./sketch.js"></script>
111
- </body>
112
- </html>
113
- ```
114
-
115
- ```javascript
116
- // sketch.js
117
- import { textmode } from 'textmode.js';
118
- import { ExportPlugin } from 'textmode.export.js';
119
-
120
- const t = textmode.create({
121
- width: window.innerWidth,
122
- height: window.innerHeight,
123
- fontSize: 16,
124
- frameRate: 60,
125
- plugins: [ExportPlugin],
126
- });
127
-
128
- t.setup(() => {
129
- // Optional setup code here (e.g., load fonts/shaders, initialize variables that access 't')
130
- });
131
-
132
- t.draw(() => {
133
- t.background(32); // Dark gray background
134
-
135
- t.char('A');
136
- t.charColor(255, 0, 0); // Cover the top-left quarter of the grid with a rectangle of red 'A's
137
- t.rect(0, 0, t.grid.cols / 2, t.grid.rows / 2);
138
-
139
- // ...add your drawing code here!
140
-
141
- if (t.frameCount === 60) {
142
- t.saveCanvas({
143
- format: 'png',
144
- filename: 'my-sketch',
145
- });
146
- }
147
- });
148
-
149
- // Control the export overlay UI at runtime
150
- // t.exportOverlay.hide(); // Hide the overlay
151
- // t.exportOverlay.show(); // Show the overlay
152
- // t.exportOverlay.toggle(); // Toggle visibility
153
-
154
- t.windowResized(() => {
155
- t.resizeCanvas(window.innerWidth, window.innerHeight);
156
- });
157
- ```
43
+ Follow the [official installation guide](https://code.textmode.art/docs/installation) to install
44
+ `textmode.export.js` alongside `textmode.js` with npm or browser-ready UMD bundles.
158
45
 
159
46
  ## Next steps
160
47
 
161
- Now that you have `textmode.export.js` set up, you can explore the following resources to learn more about its features and capabilities:
48
+ - **[Read the exporting documentation](https://code.textmode.art/docs/exporting.html)** for supported formats and workflows.
49
+ - **[Browse the API reference](https://code.textmode.art/api/textmode.export.js/)** for the complete typed API.
50
+ - **[Explore the examples](./examples/)** to see export plugins and options in action.
51
+ - **[Try the live editor](https://editor.textmode.art/)** to experiment with exports in the browser.
52
+
53
+ ## Contributing
54
+
55
+ Thank you for considering contributing to this project! (✿◠‿◠)
56
+
57
+ Please read the [Contributing Guide](./CONTRIBUTING.md) to get started.
58
+
59
+ <!-- TEXTMODE-CONTRIBUTORS:START -->
60
+ <!-- prettier-ignore-start -->
61
+ <!-- Generated from https://github.com/humanbydefinition/code.textmode.art/blob/main/.vitepress/data/contributors.json and https://github.com/humanbydefinition/code.textmode.art/blob/main/.vitepress/data/contribution-types.json. Do not edit this section directly. -->
62
+ ## Contributors
63
+
64
+ Thanks to the people who contribute code, documentation, design, examples, ideas, infrastructure, and care
65
+ across the textmode.js ecosystem.
66
+
67
+ <!-- markdownlint-disable MD033 -->
68
+ <table>
69
+ <tbody>
70
+ <tr>
71
+ <td align="center" valign="top" width="14.28%">
72
+ <a href="https://github.com/humanbydefinition">
73
+ <img src="https://github.com/humanbydefinition.png?s=100" width="100px" alt="humanbydefinition avatar" />
74
+ <br /><sub><b>humanbydefinition</b></sub>
75
+ </a>
76
+ <br /><span title="Code: Commits and pull requests" aria-label="Code: Commits and pull requests">💻</span> <span title="Documentation: README, guides, and API documentation" aria-label="Documentation: README, guides, and API documentation">📖</span> <span title="Design: User experience, branding, and visual design" aria-label="Design: User experience, branding, and visual design">🎨</span> <span title="Examples: Usage examples and creative sketches" aria-label="Examples: Usage examples and creative sketches">💡</span> <span title="Ideas and planning: Feature proposals, planning, and feedback" aria-label="Ideas and planning: Feature proposals, planning, and feedback">🤔</span> <span title="Maintenance: Refactoring and project upkeep" aria-label="Maintenance: Refactoring and project upkeep">🚧</span> <span title="Infrastructure: Continuous integration, hosting, and build systems" aria-label="Infrastructure: Continuous integration, hosting, and build systems">🚇</span> <span title="Tools: Developer and community tooling" aria-label="Tools: Developer and community tooling">🔧</span> <span title="Plugins and libraries: Plugin and utility library development" aria-label="Plugins and libraries: Plugin and utility library development">🔌</span> <span title="Code review: Reviewing pull requests" aria-label="Code review: Reviewing pull requests">👀</span>
77
+ </td>
78
+ <td align="center" valign="top" width="14.28%">
79
+ <a href="https://github.com/trintlermint">
80
+ <img src="https://github.com/trintlermint.png?s=100" width="100px" alt="trintlermint avatar" />
81
+ <br /><sub><b>trintlermint</b></sub>
82
+ </a>
83
+ <br /><span title="Design: User experience, branding, and visual design" aria-label="Design: User experience, branding, and visual design">🎨</span> <span title="Examples: Usage examples and creative sketches" aria-label="Examples: Usage examples and creative sketches">💡</span>
84
+ </td>
85
+ </tr>
86
+ </tbody>
87
+ </table>
88
+ <!-- markdownlint-enable MD033 -->
89
+
90
+ Contribution details and profile links are maintained on the [textmode.js contributors page](https://code.textmode.art/docs/contributors).
91
+ <!-- prettier-ignore-end -->
92
+ <!-- TEXTMODE-CONTRIBUTORS:END -->
93
+
94
+ ## License
95
+
96
+ `textmode.export.js` is licensed under the [MIT License](./LICENSE).
162
97
 
163
- 📚 **[Visit the Official Documentation](https://code.textmode.art/docs/exporting.html)** for a detailed guide on how to use the `textmode.export.js` and all its features.
98
+ ## Acknowledgements
164
99
 
165
- 🔍 **[Browse the TypeDoc API reference](docs/README.md)** hosted right here in the repository for in-depth API details.
100
+ - **[mediabunny](https://github.com/Vanilagy/mediabunny)**
101
+ - WebM and MP4 video export support via WebCodecs, by [Vanilagy](https://github.com/Vanilagy).
102
+ - License: [MPL-2.0](https://github.com/Vanilagy/mediabunny/blob/main/LICENSE).
166
103
 
167
- ## Acknowledgements
104
+ - **[gifenc](https://github.com/mattdesl/gifenc)**
105
+ - Animated GIF encoding by [Matt DesLauriers](https://github.com/mattdesl).
106
+ - License: [MIT License](https://github.com/mattdesl/gifenc/blob/main/LICENSE.md).
168
107
 
169
- `textmode.export.js` packages [`mediabunny`](https://github.com/Vanilagy/mediabunny) by [**Vanilagy**](https://github.com/Vanilagy) to provide WebM and MP4 video export support via WebCodecs. `mediabunny` is distributed under the [**MPL-2.0**](https://www.mozilla.org/en-US/MPL/2.0/) license.
108
+ ---
109
+
110
+ <div align="center">
170
111
 
171
- Animated GIF export relies on [`gifenc`](https://github.com/mattdesl/gifenc) by [**Matt DesLauriers**](https://github.com/mattdesl), available under the [**MIT License**](https://opensource.org/licenses/MIT).
112
+ <br />
113
+
114
+ **[↑ back to top](#textmodeexportjs)**
115
+
116
+ </div>