@kitschpatrol/tldraw-cli 5.0.11 → 5.0.13
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/dist/.DS_Store +0 -0
- package/dist/bin/cli.js +2 -2
- package/dist/lib/index.d.ts +49 -3
- package/dist/lib/index.js +2 -2
- package/dist/tldraw/assets/index-Dur5mwK7.js +501 -0
- package/dist/tldraw/index.html +1 -1
- package/dist/tldraw/translations/fr.json +22 -20
- package/package.json +15 -14
- package/readme.md +5 -2
- package/dist/lib/inline/get-image.d.ts +0 -13
- package/dist/lib/inline/get-tldr.d.ts +0 -7
- package/dist/lib/local-tldraw-server.d.ts +0 -10
- package/dist/lib/tldraw-controller.d.ts +0 -22
- package/dist/lib/tldraw-open.d.ts +0 -12
- package/dist/lib/tldraw-to-image.d.ts +0 -18
- package/dist/lib/utilities/log.d.ts +0 -12
- package/dist/lib/validation.d.ts +0 -8
- package/dist/tldraw/assets/index-BxcvT1ks.js +0 -499
package/dist/tldraw/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>tldraw via tldraw-cli</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-Dur5mwK7.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DWlTSBfy.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"action.enhanced-a11y-mode": "Activer le mode Accessibilité améliorée",
|
|
52
52
|
"action.enhanced-a11y-mode.menu": "Mode Accessibilité améliorée",
|
|
53
53
|
"action.exit-pen-mode": "Quitter le mode stylet",
|
|
54
|
-
"action.export-all-as-png": "Exporter
|
|
54
|
+
"action.export-all-as-png": "Exporter en tant que PNG",
|
|
55
55
|
"action.export-all-as-png.short": "PNG",
|
|
56
|
-
"action.export-all-as-svg": "Exporter
|
|
56
|
+
"action.export-all-as-svg": "Exporter en tant que SVG",
|
|
57
57
|
"action.export-all-as-svg.short": "SVG",
|
|
58
58
|
"action.export-as-png": "Exporter en tant que PNG",
|
|
59
59
|
"action.export-as-png.short": "PNG",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"action.export-as-svg.short": "SVG",
|
|
62
62
|
"action.fit-frame-to-content": "Ajuster au contenu",
|
|
63
63
|
"action.flatten-to-image": "Aplatir",
|
|
64
|
-
"action.flip-horizontal": "
|
|
65
|
-
"action.flip-horizontal.short": "
|
|
66
|
-
"action.flip-vertical": "
|
|
67
|
-
"action.flip-vertical.short": "
|
|
64
|
+
"action.flip-horizontal": "Symétrie axe horizontal",
|
|
65
|
+
"action.flip-horizontal.short": "Symétrie axe H",
|
|
66
|
+
"action.flip-vertical": "Symétrie axe vertical",
|
|
67
|
+
"action.flip-vertical.short": "Symétrie axe V",
|
|
68
68
|
"action.fork-project": "Dupliquer ce projet",
|
|
69
69
|
"action.fork-project-on-tldraw": "Dupliquer ce projet sur tldraw",
|
|
70
70
|
"action.group": "Grouper",
|
|
@@ -119,6 +119,7 @@
|
|
|
119
119
|
"action.toggle-focus-mode.menu": "Mode Focus",
|
|
120
120
|
"action.toggle-grid": "Activer la grille",
|
|
121
121
|
"action.toggle-grid.menu": "Afficher la grille",
|
|
122
|
+
"action.toggle-invert-zoom.menu": "Inverser le zoom de la souris",
|
|
122
123
|
"action.toggle-keyboard-shortcuts": "Activer/désactiver les raccourcis clavier",
|
|
123
124
|
"action.toggle-keyboard-shortcuts.menu": "Raccourcis clavier",
|
|
124
125
|
"action.toggle-lock": "Verrouiller / Déverrouiller",
|
|
@@ -142,6 +143,7 @@
|
|
|
142
143
|
"action.unlock-all": "Tout déverrouiller",
|
|
143
144
|
"action.zoom-in": "Zoomer",
|
|
144
145
|
"action.zoom-out": "Dézoomer",
|
|
146
|
+
"action.zoom-quick": "Zoom rapide",
|
|
145
147
|
"action.zoom-to-100": "Zoomer à 100%",
|
|
146
148
|
"action.zoom-to-fit": "Zoomer pour ajuster",
|
|
147
149
|
"action.zoom-to-selection": "Zoomer sur la sélection",
|
|
@@ -155,7 +157,7 @@
|
|
|
155
157
|
"arrow-kind-style.elbow": "Coude",
|
|
156
158
|
"arrowheadEnd-style.arrow": "Flèche",
|
|
157
159
|
"arrowheadEnd-style.bar": "Barre",
|
|
158
|
-
"arrowheadEnd-style.diamond": "
|
|
160
|
+
"arrowheadEnd-style.diamond": "Losange",
|
|
159
161
|
"arrowheadEnd-style.dot": "Point",
|
|
160
162
|
"arrowheadEnd-style.inverted": "Inversé",
|
|
161
163
|
"arrowheadEnd-style.none": "Aucun",
|
|
@@ -164,7 +166,7 @@
|
|
|
164
166
|
"arrowheadEnd-style.triangle": "Triangle",
|
|
165
167
|
"arrowheadStart-style.arrow": "Flèche",
|
|
166
168
|
"arrowheadStart-style.bar": "Barre",
|
|
167
|
-
"arrowheadStart-style.diamond": "
|
|
169
|
+
"arrowheadStart-style.diamond": "Losange",
|
|
168
170
|
"arrowheadStart-style.dot": "Point",
|
|
169
171
|
"arrowheadStart-style.inverted": "Inversé",
|
|
170
172
|
"arrowheadStart-style.none": "Aucun",
|
|
@@ -193,7 +195,7 @@
|
|
|
193
195
|
"context-menu.arrange": "Organiser",
|
|
194
196
|
"context-menu.copy-as": "Copier en tant que",
|
|
195
197
|
"context-menu.edit": "Modifier",
|
|
196
|
-
"context-menu.export-all-as": "Exporter
|
|
198
|
+
"context-menu.export-all-as": "Exporter",
|
|
197
199
|
"context-menu.export-as": "Exporter en tant que",
|
|
198
200
|
"context-menu.move-to-page": "Déplacer vers la page",
|
|
199
201
|
"context-menu.reorder": "Réorganiser",
|
|
@@ -253,7 +255,7 @@
|
|
|
253
255
|
"geo-style.arrow-up": "Flèche vers le haut",
|
|
254
256
|
"geo-style.check-box": "Case à cocher",
|
|
255
257
|
"geo-style.cloud": "Nuage",
|
|
256
|
-
"geo-style.diamond": "
|
|
258
|
+
"geo-style.diamond": "Losange",
|
|
257
259
|
"geo-style.ellipse": "Ellipse",
|
|
258
260
|
"geo-style.heart": "Cœur",
|
|
259
261
|
"geo-style.hexagon": "Hexagone",
|
|
@@ -261,8 +263,8 @@
|
|
|
261
263
|
"geo-style.oval": "Ovale",
|
|
262
264
|
"geo-style.pentagon": "Pentagone",
|
|
263
265
|
"geo-style.rectangle": "Rectangle",
|
|
264
|
-
"geo-style.rhombus": "
|
|
265
|
-
"geo-style.rhombus-2": "
|
|
266
|
+
"geo-style.rhombus": "Parallélogramme",
|
|
267
|
+
"geo-style.rhombus-2": "Parallélogramme inversé",
|
|
266
268
|
"geo-style.star": "Étoile",
|
|
267
269
|
"geo-style.trapezoid": "Trapèze",
|
|
268
270
|
"geo-style.triangle": "Triangle",
|
|
@@ -311,11 +313,11 @@
|
|
|
311
313
|
"navigation-zone.title": "Navigation",
|
|
312
314
|
"navigation-zone.toggle-minimap": "Basculer la mini-carte",
|
|
313
315
|
"navigation-zone.zoom": "Zoomer",
|
|
314
|
-
"opacity-style.0.1": "10
|
|
315
|
-
"opacity-style.0.25": "25%",
|
|
316
|
-
"opacity-style.0.5": "50%",
|
|
317
|
-
"opacity-style.0.75": "75%",
|
|
318
|
-
"opacity-style.1": "100%",
|
|
316
|
+
"opacity-style.0.1": "10 %",
|
|
317
|
+
"opacity-style.0.25": "25 %",
|
|
318
|
+
"opacity-style.0.5": "50 %",
|
|
319
|
+
"opacity-style.0.75": "75 %",
|
|
320
|
+
"opacity-style.1": "100 %",
|
|
319
321
|
"page-menu.create-new-page": "Créer une nouvelle page",
|
|
320
322
|
"page-menu.edit-done": "Terminé",
|
|
321
323
|
"page-menu.edit-start": "Modifier",
|
|
@@ -339,7 +341,7 @@
|
|
|
339
341
|
"people-menu.leading": "Vous suivant",
|
|
340
342
|
"people-menu.title": "Personnes",
|
|
341
343
|
"people-menu.user": "(Vous)",
|
|
342
|
-
"share-menu.copied": "Lien copié
|
|
344
|
+
"share-menu.copied": "Lien copié !",
|
|
343
345
|
"share-menu.copy-link": "Copier le lien",
|
|
344
346
|
"share-menu.copy-link-note": "Toute personne disposant du lien peut lire et modifier ce projet.",
|
|
345
347
|
"share-menu.copy-readonly-link": "Copier le lien en lecture seule",
|
|
@@ -424,7 +426,7 @@
|
|
|
424
426
|
"tool.bookmark": "Signet",
|
|
425
427
|
"tool.check-box": "Case à cocher",
|
|
426
428
|
"tool.cloud": "Nuage",
|
|
427
|
-
"tool.diamond": "
|
|
429
|
+
"tool.diamond": "Losange",
|
|
428
430
|
"tool.draw": "Dessiner",
|
|
429
431
|
"tool.ellipse": "Ellipse",
|
|
430
432
|
"tool.embed": "Intégration",
|
|
@@ -453,7 +455,7 @@
|
|
|
453
455
|
"tool.pointer-down": "Pointeur vers le bas",
|
|
454
456
|
"tool.rectangle": "Rectangle",
|
|
455
457
|
"tool.replace-media": "Remplacer le média",
|
|
456
|
-
"tool.rhombus": "
|
|
458
|
+
"tool.rhombus": "Parallélogramme",
|
|
457
459
|
"tool.rich-text-bold": "Gras",
|
|
458
460
|
"tool.rich-text-bulletList": "Liste à puces",
|
|
459
461
|
"tool.rich-text-code": "Code",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/tldraw-cli",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.13",
|
|
4
4
|
"description": "A CLI tool and TypeScript library for exporting tldraw sketches to PNG or SVG images.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tldraw",
|
|
@@ -48,44 +48,45 @@
|
|
|
48
48
|
"@types/node": "^20.19.37",
|
|
49
49
|
"cheerio": "^1.2.0",
|
|
50
50
|
"get-port": "^7.1.0",
|
|
51
|
-
"hono": "^4.12.
|
|
52
|
-
"nanoid": "^5.1.
|
|
51
|
+
"hono": "^4.12.8",
|
|
52
|
+
"nanoid": "^5.1.7",
|
|
53
53
|
"natural-orderby": "^5.0.0",
|
|
54
54
|
"open": "^11.0.0",
|
|
55
55
|
"path-type": "^6.0.0",
|
|
56
56
|
"picocolors": "^1.1.1",
|
|
57
57
|
"plur": "^6.0.0",
|
|
58
58
|
"pretty-ms": "^9.3.0",
|
|
59
|
-
"puppeteer": "^24.
|
|
59
|
+
"puppeteer": "^24.40.0",
|
|
60
60
|
"uint8array-extras": "^1.5.0",
|
|
61
61
|
"untildify": "^6.0.0",
|
|
62
62
|
"yargs": "^18.0.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
+
"@arethetypeswrong/core": "^0.18.2",
|
|
66
|
+
"@blazediff/vitest": "^1.1.11",
|
|
65
67
|
"@fontsource/inter": "^5.2.8",
|
|
66
68
|
"@kitschpatrol/shared-config": "^6.0.3",
|
|
67
|
-
"@tldraw/assets": "^4.
|
|
69
|
+
"@tldraw/assets": "^4.5.3",
|
|
68
70
|
"@types/react": "^19.2.14",
|
|
69
71
|
"@types/react-dom": "^19.2.3",
|
|
70
72
|
"@types/yargs": "^17.0.35",
|
|
71
|
-
"@vitejs/plugin-react": "^6.0.
|
|
72
|
-
"bumpp": "^
|
|
73
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
74
|
+
"bumpp": "^11.0.1",
|
|
73
75
|
"esbuild": "^0.27.4",
|
|
74
76
|
"mdat-plugin-cli-help": "^1.0.7",
|
|
75
77
|
"node-addon-api": "^8.6.0",
|
|
76
78
|
"node-gyp": "^12.2.0",
|
|
79
|
+
"publint": "^0.3.18",
|
|
77
80
|
"react": "^19.2.4",
|
|
78
81
|
"react-dom": "^19.2.4",
|
|
79
|
-
"rolldown": "1.0.0-rc.
|
|
82
|
+
"rolldown": "1.0.0-rc.10",
|
|
80
83
|
"safe-stable-stringify": "^2.5.0",
|
|
81
|
-
"sharp": "^0.34.5",
|
|
82
|
-
"sharp-phash": "^2.2.0",
|
|
83
84
|
"strip-ansi": "^7.2.0",
|
|
84
|
-
"tldraw": "^4.
|
|
85
|
-
"tsdown": "^0.21.
|
|
85
|
+
"tldraw": "^4.5.3",
|
|
86
|
+
"tsdown": "^0.21.4",
|
|
86
87
|
"tsx": "^4.21.0",
|
|
87
88
|
"typescript": "~5.9.3",
|
|
88
|
-
"vite": "^8.0.
|
|
89
|
+
"vite": "^8.0.1",
|
|
89
90
|
"vitest": "^4.1.0"
|
|
90
91
|
},
|
|
91
92
|
"engines": {
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
},
|
|
97
98
|
"scripts": {
|
|
98
99
|
"build": "pnpm run build:tldraw && pnpm run build:src",
|
|
99
|
-
"build:src": "tsdown
|
|
100
|
+
"build:src": "tsdown",
|
|
100
101
|
"build:tldraw": "pnpm run tldraw:copy-assets && vite build",
|
|
101
102
|
"clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
|
|
102
103
|
"dev": "pnpm run dev:tldraw",
|
package/readme.md
CHANGED
|
@@ -48,6 +48,8 @@ A CLI app to automate conversion and export of [tldraw](https://tldraw.dev) URLs
|
|
|
48
48
|
|
|
49
49
|
This could be useful in the context of a content publishing pipeline where you want to use a `.tldr` file (perhaps under version control) as the "source of truth" for assets to be embedded elsewhere, and you don't want to manage the export of that diagram manually.
|
|
50
50
|
|
|
51
|
+
_Please note that this tool, which is all about image export, should not be confused with the official [tldraw project scaffolding CLI](https://www.npmjs.com/package/create-tldraw) which is all about creating new tldraw-powered projects._
|
|
52
|
+
|
|
51
53
|
_For `.tldr` file import support in Vite projects, please see [@kitschpatrol/vite-plugin-tldraw](https://github.com/kitschpatrol/vite-plugin-tldraw)._
|
|
52
54
|
|
|
53
55
|
## Installation
|
|
@@ -374,7 +376,7 @@ await tldrawToImage('https://www.tldraw.com/s/v2_c_JsxJk8dag6QsrqExukis4')
|
|
|
374
376
|
Mirrors the `tldraw open` CLI command.
|
|
375
377
|
|
|
376
378
|
> [!IMPORTANT]
|
|
377
|
-
> Due to recent tldraw
|
|
379
|
+
> 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.
|
|
378
380
|
|
|
379
381
|
```tsx
|
|
380
382
|
async function tldrawOpen(
|
|
@@ -486,6 +488,7 @@ On GitHub:
|
|
|
486
488
|
- [AWS Lambda-based approach](https://gist.github.com/steveruizok/c30fc99b9b3d95a14c82c59bdcc69201)
|
|
487
489
|
- [Added exporting of shapes and pages as images](https://github.com/tldraw/tldraw/pull/468)
|
|
488
490
|
- [\[feature\] Copy/Share as PNG](https://github.com/tldraw/tldraw-v1/issues/361)
|
|
491
|
+
- [Create tldraw CLI tools](https://github.com/tldraw/tldraw/issues/7539)
|
|
489
492
|
|
|
490
493
|
On Discord:
|
|
491
494
|
|
|
@@ -494,7 +497,7 @@ On Discord:
|
|
|
494
497
|
|
|
495
498
|
## Implementation notes
|
|
496
499
|
|
|
497
|
-
This tool is
|
|
500
|
+
This tool is _not_ a part of the official tldraw project.
|
|
498
501
|
|
|
499
502
|
Due to the architecture of tldraw, export depends on functionality provided by a web browser. So, behind the scenes, this app serves a local instance of tldraw, then loads a `.tldr` and invokes the export download via the [Puppeteer](https://pptr.dev) headless browser automation tool.
|
|
500
503
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Editor } from 'tldraw';
|
|
2
|
-
declare global {
|
|
3
|
-
interface Window {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
getImage: (options: {
|
|
6
|
-
background?: boolean;
|
|
7
|
-
darkMode?: boolean;
|
|
8
|
-
format: 'png' | 'svg';
|
|
9
|
-
padding?: number;
|
|
10
|
-
scale?: number;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { TldrawToImageOptions } from './tldraw-to-image.js';
|
|
2
|
-
export default class TldrawController {
|
|
3
|
-
private readonly href;
|
|
4
|
-
private browser?;
|
|
5
|
-
private isEmpty?;
|
|
6
|
-
private page?;
|
|
7
|
-
private get isLocal();
|
|
8
|
-
constructor(href: string);
|
|
9
|
-
close(): Promise<void>;
|
|
10
|
-
download(options: TldrawToImageOptions): Promise<string[]>;
|
|
11
|
-
start(): Promise<void>;
|
|
12
|
-
private getCurrentPage;
|
|
13
|
-
private getDownloadPlans;
|
|
14
|
-
private getPageFrames;
|
|
15
|
-
private getPages;
|
|
16
|
-
private getSketchStructure;
|
|
17
|
-
private setCurrentPage;
|
|
18
|
-
private stripStyleElement;
|
|
19
|
-
private stripUndefined;
|
|
20
|
-
private validateFrames;
|
|
21
|
-
private validatePages;
|
|
22
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ChildProcess } from 'node:child_process';
|
|
2
|
-
export type TldrawOpenOptions = {
|
|
3
|
-
location: 'local' | 'remote';
|
|
4
|
-
};
|
|
5
|
-
export type TldrawOpenResult = {
|
|
6
|
-
browserExitPromise: Promise<ChildProcess>;
|
|
7
|
-
openedSketchUrl: string;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Opens a tldraw file or URL in a browser.
|
|
11
|
-
*/
|
|
12
|
-
export declare function tldrawOpen(tldrPathOrUrl?: string, options?: Partial<TldrawOpenOptions>): Promise<TldrawOpenResult>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type TldrawFormat = 'png' | 'svg' | 'tldr';
|
|
2
|
-
export type TldrawToImageOptions = {
|
|
3
|
-
dark?: boolean;
|
|
4
|
-
format?: TldrawFormat;
|
|
5
|
-
frames?: boolean | string[];
|
|
6
|
-
name?: string;
|
|
7
|
-
output?: string;
|
|
8
|
-
padding?: number;
|
|
9
|
-
pages?: boolean | number[] | string[];
|
|
10
|
-
print?: boolean;
|
|
11
|
-
scale?: number;
|
|
12
|
-
stripStyle?: boolean;
|
|
13
|
-
transparent?: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Downloads a tldraw file or URL as an image.
|
|
17
|
-
*/
|
|
18
|
-
export declare function tldrawToImage(tldrPathOrUrl: string, options?: TldrawToImageOptions): Promise<string[]>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const log: {
|
|
2
|
-
verbose: boolean;
|
|
3
|
-
log(...data: unknown[]): void;
|
|
4
|
-
logPrefixed(prefix: string, ...data: unknown[]): void;
|
|
5
|
-
info(...data: unknown[]): void;
|
|
6
|
-
infoPrefixed(prefix: string, ...data: unknown[]): void;
|
|
7
|
-
warn(...data: unknown[]): void;
|
|
8
|
-
warnPrefixed(prefix: string, ...data: unknown[]): void;
|
|
9
|
-
error(...data: unknown[]): void;
|
|
10
|
-
errorPrefixed(prefix: string, ...data: unknown[]): void;
|
|
11
|
-
};
|
|
12
|
-
export default log;
|
package/dist/lib/validation.d.ts
DELETED