@kitschpatrol/tldraw-cli 4.6.34 → 4.6.35
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/bin/cli.js +2 -2
- package/dist/.DS_Store +0 -0
- package/package.json +1 -1
- package/readme.md +5 -15
package/bin/cli.js
CHANGED
|
@@ -24173,7 +24173,7 @@ import yargs from "yargs";
|
|
|
24173
24173
|
import { hideBin } from "yargs/helpers";
|
|
24174
24174
|
|
|
24175
24175
|
// package.json
|
|
24176
|
-
var version = "4.6.
|
|
24176
|
+
var version = "4.6.35";
|
|
24177
24177
|
|
|
24178
24178
|
// node_modules/.pnpm/nanoid@5.1.5/node_modules/nanoid/index.js
|
|
24179
24179
|
import { webcrypto as crypto } from "node:crypto";
|
|
@@ -42008,7 +42008,7 @@ async function tldrawOpen(tldrPathOrUrl, options) {
|
|
|
42008
42008
|
var yargsInstance = yargs(hideBin(process.argv));
|
|
42009
42009
|
await yargsInstance.scriptName("tldraw").command("$0 <command>", "CLI tools for tldraw.").command(
|
|
42010
42010
|
"export <files-or-urls..>",
|
|
42011
|
-
'Export a local tldraw ".tldr" file or a tldraw.com URL to an svg, png,
|
|
42011
|
+
'Export a local tldraw ".tldr" file or a tldraw.com URL to an svg, png, or tldr file. Prints the absolute path(s) to the exported image(s) to stdout.',
|
|
42012
42012
|
(yargs2) => yargs2.positional("files-or-urls", {
|
|
42013
42013
|
array: true,
|
|
42014
42014
|
default: void 0,
|
package/dist/.DS_Store
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -95,7 +95,7 @@ tldraw <command>
|
|
|
95
95
|
|
|
96
96
|
| Command | Argument | Description |
|
|
97
97
|
| -------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
98
|
-
| `export` | `<files-or-urls..>` | Export a local tldraw ".tldr" file or a tldraw\.com URL to an svg, png,
|
|
98
|
+
| `export` | `<files-or-urls..>` | Export a local tldraw ".tldr" file or a tldraw\.com URL to an svg, png, or tldr file. Prints the absolute path(s) to the exported image(s) to stdout. |
|
|
99
99
|
| `open` | `[files-or-urls..]` | Open a tldraw `.tldr` file or tldraw\.com URL in your default browser with either the official tldraw\.com site or a locally-hosted instance of the editor. Call `open` without an argument to open a blank sketch. Sketches opened via URL with the `--local` flag will be temporarily copied to the local system, and will not be kept in sync with tldraw\.com. This process does not exit until the browser is closed. Warning: Passing a local .tldr file without the `--local` option will upload and share the sketch on tldraw\.com. |
|
|
100
100
|
|
|
101
101
|
| Option | Description | Type |
|
|
@@ -107,7 +107,7 @@ _See the sections below for more information on each subcommand._
|
|
|
107
107
|
|
|
108
108
|
#### Subcommand: `tldraw export`
|
|
109
109
|
|
|
110
|
-
Export a local tldraw ".tldr" file or a tldraw\.com URL to an svg, png,
|
|
110
|
+
Export a local tldraw ".tldr" file or a tldraw\.com URL to an svg, png, or tldr file. Prints the absolute path(s) to the exported image(s) to stdout.
|
|
111
111
|
|
|
112
112
|
Usage:
|
|
113
113
|
|
|
@@ -257,28 +257,18 @@ tldraw export https://www.tldraw.com/s/v2_c_FI5RYWbdpAtjsy4OIKrKw --frames "Fram
|
|
|
257
257
|
tldraw export https://www.tldraw.com/s/v2_c_L_RFQ3mJA_BWHejdH2hlD --pages "Page 3"
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
##### Export a specific
|
|
260
|
+
##### Export a specific page by index from a tldraw\.com URL
|
|
261
261
|
|
|
262
262
|
```sh
|
|
263
263
|
tldraw export https://www.tldraw.com/s/v2_c_L_RFQ3mJA_BWHejdH2hlD --pages 0 2
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
##### Export each
|
|
266
|
+
##### Export each page as its own SVG from a tldraw\.com URL
|
|
267
267
|
|
|
268
268
|
```sh
|
|
269
269
|
tldraw export https://www.tldraw.com/s/v2_c_L_RFQ3mJA_BWHejdH2hlD --pages
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
##### Export to JSON
|
|
273
|
-
|
|
274
|
-
```sh
|
|
275
|
-
tldraw export https://www.tldraw.com/s/v2_c_FI5RYWbdpAtjsy4OIKrKw --format "json"
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
The `.tldr` file format is also JSON under the covers, but the `--format json` flag will yield a slightly different format than `--format tldr`. `--format json` is equivalent to what's produced via the tldraw\.com "☰ → Edit → Export As → JSON" menu item.
|
|
279
|
-
|
|
280
|
-
I'm not completely clear on the use-case for this format, but since tldr.com supports it, so too shall `tldraw-cli`.
|
|
281
|
-
|
|
282
272
|
##### Write an SVG to stdout
|
|
283
273
|
|
|
284
274
|
```sh
|
|
@@ -384,7 +374,7 @@ await tldrawToImage('https://www.tldraw.com/s/v2_c_JsxJk8dag6QsrqExukis4')
|
|
|
384
374
|
Mirrors the `tldraw open` CLI command.
|
|
385
375
|
|
|
386
376
|
> [!IMPORTANT]
|
|
387
|
-
> Due to recent tldraw
|
|
377
|
+
> Due to recent tldraw\.com requirements to login before sharing a sketch, opening a _local_ .tldr file with the `location: 'remote'` option is no longer supported.
|
|
388
378
|
|
|
389
379
|
```tsx
|
|
390
380
|
async function tldrawOpen(
|