tsquare 0.11.0 → 0.12.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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.0
4
+
5
+ The language and the renderer haven't changed: every wireframe renders exactly as in 0.11.0, and render URLs give the same images.
6
+
7
+ - **`tsquare/editor`:** the playground's code editor for your own page (highlighting, autocomplete from `languageData()`, problems underlined by line), with CodeMirror bundled in so it imports nothing. `createEditor(element, { doc, data, onChange, lineNumbers, ariaLabel })` returns `getText`, `setText`, `setIssues`, `goToLine`, `focus`, `dom` and `destroy`. Its colors are `--tsquare-editor-*` and `--tsquare-syntax-*` CSS variables, light or dark by the page's color scheme; the playground maps its own colors onto them and looks exactly as before. See the README.
8
+ - **`tsquare/viewer` has `destroy()`:** it removes the viewer's listeners, stops watching the stage's size and releases the board image, for pages that remove a viewer (a React component unmounting).
9
+
3
10
  ## 0.11.0
4
11
 
5
12
  The language and the renderer haven't changed: every wireframe renders exactly as in 0.10.1, and render URLs give the same images.
package/README.md CHANGED
@@ -128,7 +128,33 @@ const { issues } = compileWireframe(source); // problems by line, empt
128
128
  const png = await renderWireframe(source, { format: "png", scale: 2 });
129
129
  ```
130
130
 
131
- `tsquare/playground` exports the playground's request handler, for hosting it inside your own Node server. `tsquare/viewer` is the playground's zoomable board (zoom, pan, pinch, a chip per screen) for your own page: pass it the elements, then `show()` the SVG from `renderWireframeSvg` with the size and screens from `boardLayout`. It sets the styles its zoom math needs itself; give the stage a size, and optionally style the classes it toggles on the stage: `panning` (while dragging), `animate` (while fitting or zooming to a screen, e.g. `.animate > * { transition: transform .25s }`) and `stale` (from `setStale`, e.g. `.stale img { opacity: .35 }`). `languageData()` lists every component, prop, option word, icon and accent, for editor highlighting and autocomplete. In a browser bundle (esbuild, Vite, webpack) the same imports render SVG with no setup; PNG and share links need Node. On a page without a build step, `<script src="https://cdn.jsdelivr.net/npm/tsquare@0.11/dist/tsquare.min.js"></script>` draws every ```` ```tsquare ```` code block on the page (see [Embedding](docs/embedding.md#pages-written-in-markdown)). See [Using it with AI](docs/ai.md) for the prompt and the repair loop.
131
+ `tsquare/playground` exports the playground's request handler, for hosting it inside your own Node server. `tsquare/viewer` is the playground's zoomable board (zoom, pan, pinch, a chip per screen) for your own page: pass it the elements, then `show()` the SVG from `renderWireframeSvg` with the size and screens from `boardLayout`. It sets the styles its zoom math needs itself; give the stage a size, and optionally style the classes it toggles on the stage: `panning` (while dragging), `animate` (while fitting or zooming to a screen, e.g. `.animate > * { transition: transform .25s }`) and `stale` (from `setStale`, e.g. `.stale img { opacity: .35 }`). Call `destroy()` when you remove it. `languageData()` lists every component, prop, option word, icon and accent, for editor highlighting and autocomplete. In a browser bundle (esbuild, Vite, webpack) the same imports render SVG with no setup; PNG and share links need Node. On a page without a build step, `<script src="https://cdn.jsdelivr.net/npm/tsquare@0.11/dist/tsquare.min.js"></script>` draws every ```` ```tsquare ```` code block on the page (see [Embedding](docs/embedding.md#pages-written-in-markdown)). See [Using it with AI](docs/ai.md) for the prompt and the repair loop.
132
+
133
+ ### The editor: `tsquare/editor`
134
+
135
+ The playground's code editor for your own page: highlighting, autocomplete for components, props, option words, icons and accents, problems underlined on their lines, Enter keeping the indentation, and pasting a whole model reply keeps just its code block. CodeMirror is bundled inside (about 125 KB compressed once your bundler minifies it), so it imports nothing and can't clash with a CodeMirror your page already has.
136
+
137
+ ```ts
138
+ import { createEditor } from "tsquare/editor";
139
+ import { compileWireframe, languageData } from "tsquare";
140
+
141
+ const editor = createEditor(document.getElementById("code")!, {
142
+ doc: "board\n screen phone",
143
+ data: languageData(), // autocomplete; leave it out for none
144
+ onChange: (text) => editor.setIssues(compileWireframe(text).issues),
145
+ });
146
+ ```
147
+
148
+ Give the element a height; the editor fills it. Options: `doc`, `data`, `onChange`, `lineNumbers` (default `true`) and `ariaLabel` (default "Wireframe text"). The editor has `getText()`, `setText(text)` (one undoable step), `setIssues(issues)`, `goToLine(n)`, `focus()`, `dom` and `destroy()`.
149
+
150
+ Its colors are CSS variables, light or dark by the page's `color-scheme`, defaulting to the playground's:
151
+
152
+ | Variables | |
153
+ |---|---|
154
+ | `--tsquare-editor-bg`, `--tsquare-editor-fg`, `--tsquare-editor-gutter`, `--tsquare-editor-active-line`, `--tsquare-editor-selection`, `--tsquare-editor-error` | the editor |
155
+ | `--tsquare-editor-popup-bg`, `--tsquare-editor-popup-border`, `--tsquare-editor-popup-selected` | autocomplete and problem popups |
156
+ | `--tsquare-editor-font`, `--tsquare-editor-font-size`, `--tsquare-editor-ui-font` | code font and size (13px), popup text font |
157
+ | `--tsquare-syntax-component`, `--tsquare-syntax-string`, `--tsquare-syntax-prop`, `--tsquare-syntax-number`, `--tsquare-syntax-word`, `--tsquare-syntax-color`, `--tsquare-syntax-comment`, `--tsquare-syntax-punct` | highlighting |
132
158
 
133
159
  ## Using it with Claude (skill)
134
160
 
@@ -0,0 +1,332 @@
1
+ dist/editor.js (tsquare/editor) bundles the packages below.
2
+
3
+ @codemirror/autocomplete 6.20.3 (MIT)
4
+ Source: https://code.haverbeke.berlin/codemirror/autocomplete (npm: @codemirror/autocomplete@6.20.3)
5
+ ------------------------------------------------------------------------
6
+ MIT License
7
+
8
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+
28
+
29
+ @codemirror/commands 6.11.1 (MIT)
30
+ Source: https://code.haverbeke.berlin/codemirror/commands (npm: @codemirror/commands@6.11.1)
31
+ ------------------------------------------------------------------------
32
+ MIT License
33
+
34
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ of this software and associated documentation files (the "Software"), to deal
38
+ in the Software without restriction, including without limitation the rights
39
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in
44
+ all copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52
+ THE SOFTWARE.
53
+
54
+
55
+ @codemirror/language 6.12.4 (MIT)
56
+ Source: https://code.haverbeke.berlin/codemirror/language (npm: @codemirror/language@6.12.4)
57
+ ------------------------------------------------------------------------
58
+ MIT License
59
+
60
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
61
+
62
+ Permission is hereby granted, free of charge, to any person obtaining a copy
63
+ of this software and associated documentation files (the "Software"), to deal
64
+ in the Software without restriction, including without limitation the rights
65
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
+ copies of the Software, and to permit persons to whom the Software is
67
+ furnished to do so, subject to the following conditions:
68
+
69
+ The above copyright notice and this permission notice shall be included in
70
+ all copies or substantial portions of the Software.
71
+
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78
+ THE SOFTWARE.
79
+
80
+
81
+ @codemirror/lint 6.9.7 (MIT)
82
+ Source: https://code.haverbeke.berlin/codemirror/lint (npm: @codemirror/lint@6.9.7)
83
+ ------------------------------------------------------------------------
84
+ MIT License
85
+
86
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
87
+
88
+ Permission is hereby granted, free of charge, to any person obtaining a copy
89
+ of this software and associated documentation files (the "Software"), to deal
90
+ in the Software without restriction, including without limitation the rights
91
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
92
+ copies of the Software, and to permit persons to whom the Software is
93
+ furnished to do so, subject to the following conditions:
94
+
95
+ The above copyright notice and this permission notice shall be included in
96
+ all copies or substantial portions of the Software.
97
+
98
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
101
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
102
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
103
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
104
+ THE SOFTWARE.
105
+
106
+
107
+ @codemirror/search 6.7.2 (MIT)
108
+ Source: https://code.haverbeke.berlin/codemirror/search (npm: @codemirror/search@6.7.2)
109
+ ------------------------------------------------------------------------
110
+ MIT License
111
+
112
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining a copy
115
+ of this software and associated documentation files (the "Software"), to deal
116
+ in the Software without restriction, including without limitation the rights
117
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
118
+ copies of the Software, and to permit persons to whom the Software is
119
+ furnished to do so, subject to the following conditions:
120
+
121
+ The above copyright notice and this permission notice shall be included in
122
+ all copies or substantial portions of the Software.
123
+
124
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
125
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
126
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
127
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
128
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
129
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
130
+ THE SOFTWARE.
131
+
132
+
133
+ @codemirror/state 6.7.6 (MIT)
134
+ Source: https://code.haverbeke.berlin/codemirror/state (npm: @codemirror/state@6.7.6)
135
+ ------------------------------------------------------------------------
136
+ MIT License
137
+
138
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
139
+
140
+ Permission is hereby granted, free of charge, to any person obtaining a copy
141
+ of this software and associated documentation files (the "Software"), to deal
142
+ in the Software without restriction, including without limitation the rights
143
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
144
+ copies of the Software, and to permit persons to whom the Software is
145
+ furnished to do so, subject to the following conditions:
146
+
147
+ The above copyright notice and this permission notice shall be included in
148
+ all copies or substantial portions of the Software.
149
+
150
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
151
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
152
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
153
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
154
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
155
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
156
+ THE SOFTWARE.
157
+
158
+
159
+ @codemirror/view 6.43.13 (MIT)
160
+ Source: https://code.haverbeke.berlin/codemirror/view (npm: @codemirror/view@6.43.13)
161
+ ------------------------------------------------------------------------
162
+ MIT License
163
+
164
+ Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
165
+
166
+ Permission is hereby granted, free of charge, to any person obtaining a copy
167
+ of this software and associated documentation files (the "Software"), to deal
168
+ in the Software without restriction, including without limitation the rights
169
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
170
+ copies of the Software, and to permit persons to whom the Software is
171
+ furnished to do so, subject to the following conditions:
172
+
173
+ The above copyright notice and this permission notice shall be included in
174
+ all copies or substantial portions of the Software.
175
+
176
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
182
+ THE SOFTWARE.
183
+
184
+
185
+ @lezer/common 1.5.3 (MIT)
186
+ Source: https://code.haverbeke.berlin/lezer/common (npm: @lezer/common@1.5.3)
187
+ ------------------------------------------------------------------------
188
+ MIT License
189
+
190
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
191
+
192
+ Permission is hereby granted, free of charge, to any person obtaining a copy
193
+ of this software and associated documentation files (the "Software"), to deal
194
+ in the Software without restriction, including without limitation the rights
195
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
196
+ copies of the Software, and to permit persons to whom the Software is
197
+ furnished to do so, subject to the following conditions:
198
+
199
+ The above copyright notice and this permission notice shall be included in
200
+ all copies or substantial portions of the Software.
201
+
202
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
203
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
204
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
205
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
206
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
207
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
208
+ THE SOFTWARE.
209
+
210
+
211
+ @lezer/highlight 1.2.5 (MIT)
212
+ Source: https://code.haverbeke.berlin/lezer/highlight (npm: @lezer/highlight@1.2.5)
213
+ ------------------------------------------------------------------------
214
+ MIT License
215
+
216
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
217
+
218
+ Permission is hereby granted, free of charge, to any person obtaining a copy
219
+ of this software and associated documentation files (the "Software"), to deal
220
+ in the Software without restriction, including without limitation the rights
221
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
222
+ copies of the Software, and to permit persons to whom the Software is
223
+ furnished to do so, subject to the following conditions:
224
+
225
+ The above copyright notice and this permission notice shall be included in
226
+ all copies or substantial portions of the Software.
227
+
228
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
229
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
230
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
231
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
232
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
233
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
234
+ THE SOFTWARE.
235
+
236
+
237
+ @marijn/find-cluster-break 1.0.4 (MIT)
238
+ Source: https://code.haverbeke.berlin/marijn/find-cluster-break (npm: @marijn/find-cluster-break@1.0.4)
239
+ ------------------------------------------------------------------------
240
+ MIT License
241
+
242
+ Copyright (C) 2024 by Marijn Haverbeke <marijn@haverbeke.berlin>
243
+
244
+ Permission is hereby granted, free of charge, to any person obtaining a copy
245
+ of this software and associated documentation files (the "Software"), to deal
246
+ in the Software without restriction, including without limitation the rights
247
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
248
+ copies of the Software, and to permit persons to whom the Software is
249
+ furnished to do so, subject to the following conditions:
250
+
251
+ The above copyright notice and this permission notice shall be included in
252
+ all copies or substantial portions of the Software.
253
+
254
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
255
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
256
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
257
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
258
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
259
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
260
+ THE SOFTWARE.
261
+
262
+
263
+ crelt 1.0.7 (MIT)
264
+ Source: https://code.haverbeke.berlin/marijn/crelt (npm: crelt@1.0.7)
265
+ ------------------------------------------------------------------------
266
+ Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
267
+
268
+ Permission is hereby granted, free of charge, to any person obtaining a copy
269
+ of this software and associated documentation files (the "Software"), to deal
270
+ in the Software without restriction, including without limitation the rights
271
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
272
+ copies of the Software, and to permit persons to whom the Software is
273
+ furnished to do so, subject to the following conditions:
274
+
275
+ The above copyright notice and this permission notice shall be included in
276
+ all copies or substantial portions of the Software.
277
+
278
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
279
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
280
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
281
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
282
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
283
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
284
+ THE SOFTWARE.
285
+
286
+
287
+ style-mod 4.1.4 (MIT)
288
+ Source: https://code.haverbeke.berlin/marijn/style-mod (npm: style-mod@4.1.4)
289
+ ------------------------------------------------------------------------
290
+ Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
291
+
292
+ Permission is hereby granted, free of charge, to any person obtaining a copy
293
+ of this software and associated documentation files (the "Software"), to deal
294
+ in the Software without restriction, including without limitation the rights
295
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
296
+ copies of the Software, and to permit persons to whom the Software is
297
+ furnished to do so, subject to the following conditions:
298
+
299
+ The above copyright notice and this permission notice shall be included in
300
+ all copies or substantial portions of the Software.
301
+
302
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
303
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
304
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
305
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
306
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
307
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
308
+ THE SOFTWARE.
309
+
310
+
311
+ w3c-keyname 2.2.8 (MIT)
312
+ Source: https://github.com/marijnh/w3c-keyname (npm: w3c-keyname@2.2.8)
313
+ ------------------------------------------------------------------------
314
+ Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
315
+
316
+ Permission is hereby granted, free of charge, to any person obtaining a copy
317
+ of this software and associated documentation files (the "Software"), to deal
318
+ in the Software without restriction, including without limitation the rights
319
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
320
+ copies of the Software, and to permit persons to whom the Software is
321
+ furnished to do so, subject to the following conditions:
322
+
323
+ The above copyright notice and this permission notice shall be included in
324
+ all copies or substantial portions of the Software.
325
+
326
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
327
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
328
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
329
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
330
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
331
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
332
+ THE SOFTWARE.
@@ -0,0 +1,20 @@
1
+ import type { EditorOptions } from "./playground/editor-options.js";
2
+ export type { EditorOptions };
3
+ export interface WireframeEditor {
4
+ /** The editor's root element (CodeMirror's), inside the element you gave. */
5
+ readonly dom: HTMLElement;
6
+ getText(): string;
7
+ /** Replace the whole text, as one step that undo reverts. */
8
+ setText(text: string): void;
9
+ /** Underline problems by line ({ line, message }, as compileWireframe returns them); [] clears them. */
10
+ setIssues(issues: {
11
+ line: number;
12
+ message: string;
13
+ }[]): void;
14
+ /** Select a line, scroll to it and focus the editor. */
15
+ goToLine(line: number): void;
16
+ focus(): void;
17
+ /** Remove the editor and its listeners. */
18
+ destroy(): void;
19
+ }
20
+ export declare function createEditor(parent: HTMLElement, options?: EditorOptions): WireframeEditor;