@kitschpatrol/tldraw-cli 4.6.28 → 4.6.30
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 +118 -152
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +108 -148
- package/dist/lib/inline/get-image.d.ts +1 -1
- package/dist/lib/local-tldraw-server.d.ts +1 -1
- package/dist/lib/tldraw-controller.d.ts +9 -11
- package/dist/lib/tldraw-open.d.ts +3 -0
- package/dist/lib/tldraw-to-image.d.ts +4 -1
- package/dist/lib/validation.d.ts +3 -0
- package/dist/tldraw/assets/index-BkIYKf7d.css +1 -0
- package/dist/tldraw/assets/index-CLFDDK9V.js +423 -0
- package/dist/tldraw/index.html +2 -2
- package/dist/tldraw/translations/ar.json +91 -10
- package/dist/tldraw/translations/bn.json +376 -0
- package/dist/tldraw/translations/ca.json +91 -10
- package/dist/tldraw/translations/cs.json +65 -41
- package/dist/tldraw/translations/da.json +15 -36
- package/dist/tldraw/translations/de.json +80 -14
- package/dist/tldraw/translations/el.json +376 -0
- package/dist/tldraw/translations/es.json +87 -10
- package/dist/tldraw/translations/fa.json +13 -21
- package/dist/tldraw/translations/fi.json +84 -20
- package/dist/tldraw/translations/fr.json +25 -21
- package/dist/tldraw/translations/gl.json +45 -18
- package/dist/tldraw/translations/gu-in.json +376 -0
- package/dist/tldraw/translations/he.json +348 -58
- package/dist/tldraw/translations/hi-in.json +96 -10
- package/dist/tldraw/translations/hr.json +36 -18
- package/dist/tldraw/translations/hu.json +31 -20
- package/dist/tldraw/translations/id.json +117 -114
- package/dist/tldraw/translations/it.json +56 -10
- package/dist/tldraw/translations/ja.json +43 -18
- package/dist/tldraw/translations/km-kh.json +376 -0
- package/dist/tldraw/translations/kn.json +376 -0
- package/dist/tldraw/translations/ko-kr.json +3 -24
- package/dist/tldraw/translations/languages.json +56 -12
- package/dist/tldraw/translations/main.json +13 -34
- package/dist/tldraw/translations/ml.json +376 -0
- package/dist/tldraw/translations/mr.json +376 -0
- package/dist/tldraw/translations/ms.json +376 -0
- package/dist/tldraw/translations/ne.json +91 -10
- package/dist/tldraw/translations/nl.json +376 -0
- package/dist/tldraw/translations/no.json +334 -20
- package/dist/tldraw/translations/pa.json +376 -0
- package/dist/tldraw/translations/pl.json +36 -57
- package/dist/tldraw/translations/pt-br.json +279 -236
- package/dist/tldraw/translations/pt-pt.json +320 -30
- package/dist/tldraw/translations/ro.json +26 -21
- package/dist/tldraw/translations/ru.json +27 -26
- package/dist/tldraw/translations/sl.json +24 -21
- package/dist/tldraw/translations/so.json +14 -35
- package/dist/tldraw/translations/sv.json +330 -50
- package/dist/tldraw/translations/ta.json +376 -0
- package/dist/tldraw/translations/te.json +302 -38
- package/dist/tldraw/translations/th.json +95 -14
- package/dist/tldraw/translations/tl.json +376 -0
- package/dist/tldraw/translations/tr.json +44 -23
- package/dist/tldraw/translations/uk.json +25 -24
- package/dist/tldraw/translations/ur.json +376 -0
- package/dist/tldraw/translations/vi.json +101 -20
- package/dist/tldraw/translations/zh-cn.json +13 -23
- package/dist/tldraw/translations/zh-tw.json +53 -17
- package/license.txt +1 -1
- package/package.json +47 -37
- package/readme.md +36 -42
- package/dist/lib/tldraw-to-share-url.d.ts +0 -1
- package/dist/tldraw/assets/index-Cg19E2b-.js +0 -425
- package/dist/tldraw/assets/index-DZaxLi12.css +0 -1
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
"action.convert-to-bookmark": "轉換為書籤",
|
|
14
14
|
"action.convert-to-embed": "轉換為嵌入",
|
|
15
15
|
"action.copy": "複製",
|
|
16
|
-
"action.copy-as-json": "複製為 JSON",
|
|
17
|
-
"action.copy-as-json.short": "JSON",
|
|
18
16
|
"action.copy-as-png": "複製為 PNG",
|
|
19
17
|
"action.copy-as-png.short": "PNG",
|
|
20
18
|
"action.copy-as-svg": "複製為 SVG",
|
|
@@ -28,31 +26,35 @@
|
|
|
28
26
|
"action.duplicate": "複製",
|
|
29
27
|
"action.edit-link": "編輯連結",
|
|
30
28
|
"action.exit-pen-mode": "退出畫筆模式",
|
|
31
|
-
"action.export-all-as-json": "全部匯出成 JSON",
|
|
32
|
-
"action.export-all-as-json.short": "JSON",
|
|
33
29
|
"action.export-all-as-png": "全部匯出成 PNG",
|
|
34
30
|
"action.export-all-as-png.short": "PNG",
|
|
35
31
|
"action.export-all-as-svg": "全部匯出成 SVG",
|
|
36
32
|
"action.export-all-as-svg.short": "SVG",
|
|
37
|
-
"action.export-as-json": "匯出成 JSON",
|
|
38
|
-
"action.export-as-json.short": "JSON",
|
|
39
33
|
"action.export-as-png": "匯出成 PNG",
|
|
40
34
|
"action.export-as-png.short": "PNG",
|
|
41
35
|
"action.export-as-svg": "匯出成 SVG",
|
|
42
36
|
"action.export-as-svg.short": "SVG",
|
|
43
37
|
"action.fit-frame-to-content": "貼合內容大小",
|
|
38
|
+
"action.flatten-to-image": "平鋪",
|
|
44
39
|
"action.flip-horizontal": "水平翻轉",
|
|
45
40
|
"action.flip-horizontal.short": "水平翻轉",
|
|
46
41
|
"action.flip-vertical": "垂直翻轉",
|
|
47
42
|
"action.flip-vertical.short": "垂直翻轉",
|
|
43
|
+
"action.fork-project": "分叉此專案",
|
|
44
|
+
"action.fork-project-on-tldraw": "在 tldraw 上分叉專案",
|
|
48
45
|
"action.group": "群組",
|
|
46
|
+
"action.insert-embed": "插入嵌入",
|
|
49
47
|
"action.insert-media": "上傳媒體檔",
|
|
48
|
+
"action.leave-shared-project": "離開共享專案",
|
|
50
49
|
"action.new-project": "新建專案",
|
|
51
50
|
"action.new-shared-project": "新建共享專案",
|
|
51
|
+
"action.open-cursor-chat": "Cursor chat",
|
|
52
52
|
"action.open-embed-link": "開啟連結",
|
|
53
53
|
"action.open-file": "開啟檔案",
|
|
54
54
|
"action.pack": "打包",
|
|
55
55
|
"action.paste": "貼上",
|
|
56
|
+
"action.paste-error-description": "由於沒有剪貼簿權限而無法貼上。請啟用權限並重試。",
|
|
57
|
+
"action.paste-error-title": "貼上失敗",
|
|
56
58
|
"action.print": "列印",
|
|
57
59
|
"action.redo": "取消復原",
|
|
58
60
|
"action.remove-frame": "移除框架",
|
|
@@ -79,10 +81,19 @@
|
|
|
79
81
|
"action.toggle-dark-mode.menu": "深色模式",
|
|
80
82
|
"action.toggle-debug-mode": "切換除錯模式",
|
|
81
83
|
"action.toggle-debug-mode.menu": "除錯模式",
|
|
84
|
+
"action.toggle-dynamic-size-mode": "切換動態大小",
|
|
85
|
+
"action.toggle-dynamic-size-mode.menu": "動態大小",
|
|
86
|
+
"action.toggle-edge-scrolling": "切換邊緣滾動",
|
|
87
|
+
"action.toggle-edge-scrolling.menu": "邊緣滾動",
|
|
82
88
|
"action.toggle-focus-mode": "切換專注模式",
|
|
83
89
|
"action.toggle-focus-mode.menu": "專注模式",
|
|
84
90
|
"action.toggle-grid": "切換網格",
|
|
85
91
|
"action.toggle-grid.menu": "顯示網格",
|
|
92
|
+
"action.toggle-lock": "鎖定\/解鎖",
|
|
93
|
+
"action.toggle-paste-at-cursor": "在游標位置切換貼上",
|
|
94
|
+
"action.toggle-paste-at-cursor.menu": "在游標位置貼上",
|
|
95
|
+
"action.toggle-reduce-motion": "切換減少活動",
|
|
96
|
+
"action.toggle-reduce-motion.menu": "減少活動",
|
|
86
97
|
"action.toggle-snap-mode": "切換始終貼齊",
|
|
87
98
|
"action.toggle-snap-mode.menu": "始終貼齊",
|
|
88
99
|
"action.toggle-tool-lock": "切換工具鎖定",
|
|
@@ -90,6 +101,8 @@
|
|
|
90
101
|
"action.toggle-transparent": "切換透明背景",
|
|
91
102
|
"action.toggle-transparent.context-menu": "透明",
|
|
92
103
|
"action.toggle-transparent.menu": "透明",
|
|
104
|
+
"action.toggle-wrap-mode": "在 wrap 切換選擇",
|
|
105
|
+
"action.toggle-wrap-mode.menu": "在 wrap 選擇",
|
|
93
106
|
"action.undo": "復原",
|
|
94
107
|
"action.ungroup": "取消群組",
|
|
95
108
|
"action.unlock-all": "全部解鎖",
|
|
@@ -121,7 +134,10 @@
|
|
|
121
134
|
"arrowheadStart-style.pipe": "管狀",
|
|
122
135
|
"arrowheadStart-style.square": "正方形",
|
|
123
136
|
"arrowheadStart-style.triangle": "三角形",
|
|
137
|
+
"assets.files.size-too-big": "檔案大小太大",
|
|
138
|
+
"assets.files.type-not-allowed": "檔案類型不允許",
|
|
124
139
|
"assets.files.upload-failed": "上傳失敗",
|
|
140
|
+
"assets.url.failed": "無法加載 URL 預覽",
|
|
125
141
|
"color-style.black": "黑色",
|
|
126
142
|
"color-style.blue": "藍色",
|
|
127
143
|
"color-style.green": "綠色",
|
|
@@ -133,19 +149,22 @@
|
|
|
133
149
|
"color-style.orange": "橘色",
|
|
134
150
|
"color-style.red": "紅色",
|
|
135
151
|
"color-style.violet": "紫色",
|
|
152
|
+
"color-style.white": "白色",
|
|
136
153
|
"color-style.yellow": "黃色",
|
|
137
154
|
"context-menu.arrange": "佈局",
|
|
138
155
|
"context-menu.copy-as": "複製成",
|
|
139
156
|
"context-menu.edit": "編輯",
|
|
157
|
+
"context-menu.export-all-as": "全部匯出為",
|
|
140
158
|
"context-menu.export-as": "匯出成",
|
|
141
159
|
"context-menu.move-to-page": "移至頁面",
|
|
142
160
|
"context-menu.reorder": "重新排序",
|
|
143
161
|
"context.pages.new-page": "新頁面",
|
|
162
|
+
"cursor-chat.type-to-chat": "輸入聊天內容...",
|
|
144
163
|
"dash-style.dashed": "虛線",
|
|
145
164
|
"dash-style.dotted": "虛點",
|
|
146
165
|
"dash-style.draw": "手繪",
|
|
147
166
|
"dash-style.solid": "實線",
|
|
148
|
-
"
|
|
167
|
+
"document-name-menu.copy-link": "複製連結",
|
|
149
168
|
"document.default-name": "無標題",
|
|
150
169
|
"edit-link-dialog.cancel": "取消",
|
|
151
170
|
"edit-link-dialog.clear": "清除",
|
|
@@ -154,8 +173,6 @@
|
|
|
154
173
|
"edit-link-dialog.save": "繼續",
|
|
155
174
|
"edit-link-dialog.title": "編輯連結",
|
|
156
175
|
"edit-link-dialog.url": "網址",
|
|
157
|
-
"edit-pages-dialog.move-down": "下移",
|
|
158
|
-
"edit-pages-dialog.move-up": "上移",
|
|
159
176
|
"embed-dialog.back": "返回",
|
|
160
177
|
"embed-dialog.cancel": "取消",
|
|
161
178
|
"embed-dialog.create": "建立",
|
|
@@ -179,6 +196,7 @@
|
|
|
179
196
|
"file-system.file-open-error.title": "無法開啟檔案",
|
|
180
197
|
"file-system.shared-document-file-open-error.description": "不支援從共享專案開啟檔案。",
|
|
181
198
|
"file-system.shared-document-file-open-error.title": "無法開啟檔案",
|
|
199
|
+
"fill-style.fill": "充滿",
|
|
182
200
|
"fill-style.none": "無",
|
|
183
201
|
"fill-style.pattern": "圖案",
|
|
184
202
|
"fill-style.semi": "半填滿",
|
|
@@ -192,6 +210,8 @@
|
|
|
192
210
|
"geo-style.arrow-left": "向左箭頭",
|
|
193
211
|
"geo-style.arrow-right": "向右箭頭",
|
|
194
212
|
"geo-style.arrow-up": "向上箭頭",
|
|
213
|
+
"geo-style.check-box": "勾選框",
|
|
214
|
+
"geo-style.cloud": "雲端",
|
|
195
215
|
"geo-style.diamond": "菱形 2",
|
|
196
216
|
"geo-style.ellipse": "橢圓形",
|
|
197
217
|
"geo-style.hexagon": "六邊形",
|
|
@@ -208,16 +228,19 @@
|
|
|
208
228
|
"help-menu.about": "關於",
|
|
209
229
|
"help-menu.discord": "Discord",
|
|
210
230
|
"help-menu.github": "GitHub",
|
|
231
|
+
"help-menu.import-tldr-file": "匯入檔案...",
|
|
211
232
|
"help-menu.keyboard-shortcuts": "鍵盤快捷鍵",
|
|
233
|
+
"help-menu.privacy": "隱私權政策",
|
|
234
|
+
"help-menu.terms": "服務條款",
|
|
212
235
|
"help-menu.title": "幫助和資源",
|
|
213
236
|
"help-menu.twitter": "Twitter",
|
|
214
|
-
"home-project-dialog.ok": "好的",
|
|
215
237
|
"menu.copy-as": "複製成",
|
|
216
238
|
"menu.edit": "編輯",
|
|
217
239
|
"menu.export-as": "匯出成",
|
|
218
240
|
"menu.file": "檔案",
|
|
219
241
|
"menu.language": "語言",
|
|
220
242
|
"menu.preferences": "選項",
|
|
243
|
+
"menu.theme": "主題",
|
|
221
244
|
"menu.title": "選單",
|
|
222
245
|
"menu.view": "檢視",
|
|
223
246
|
"navigation-zone.toggle-minimap": "切換小地圖",
|
|
@@ -243,12 +266,11 @@
|
|
|
243
266
|
"people-menu.change-color": "更改顏色",
|
|
244
267
|
"people-menu.change-name": "更改名稱",
|
|
245
268
|
"people-menu.follow": "追蹤",
|
|
269
|
+
"people-menu.following": "關注",
|
|
246
270
|
"people-menu.invite": "邀請其他人",
|
|
271
|
+
"people-menu.leading": "關注你",
|
|
247
272
|
"people-menu.title": "人員",
|
|
248
273
|
"people-menu.user": "(您)",
|
|
249
|
-
"rename-project-dialog.cancel": "取消",
|
|
250
|
-
"rename-project-dialog.rename": "重新命名",
|
|
251
|
-
"rename-project-dialog.title": "重新命名專案",
|
|
252
274
|
"share-menu.copied": "已複製連結!",
|
|
253
275
|
"share-menu.copy-link": "複製連結",
|
|
254
276
|
"share-menu.copy-link-note": "任何人透過連結都能檢視和編輯此專案。",
|
|
@@ -259,10 +281,17 @@
|
|
|
259
281
|
"share-menu.fork-note": "基於此快照建立新的共享專案。",
|
|
260
282
|
"share-menu.offline-note": "共享此專案將建立即時副本,並產生新網址。您可以分享網址,與其他至多三十人一起檢視和編輯副本。",
|
|
261
283
|
"share-menu.project-too-large": "抱歉,無法共享此專案,因為檔案過大。我們已在調整這件事!",
|
|
262
|
-
"share-menu.readonly-link": "唯讀",
|
|
263
284
|
"share-menu.save-note": "將此專案作為 .tldr 檔下載到您的電腦。",
|
|
264
285
|
"share-menu.share-project": "共享此專案",
|
|
286
|
+
"share-menu.snapshot-link-note": "將此專案作為唯讀快照連結進行擷取並共享。",
|
|
265
287
|
"share-menu.title": "共享",
|
|
288
|
+
"share-menu.upload-failed": "抱歉,我們目前無法上傳您的專案。請重試或讓我們知道問題是否持續存在。",
|
|
289
|
+
"sharing.confirm-leave.cancel": "取消",
|
|
290
|
+
"sharing.confirm-leave.description": "您確定要離開此共享專案嗎?您可以導覽到其 URL 返回。",
|
|
291
|
+
"sharing.confirm-leave.dont-show-again": "不再詢問",
|
|
292
|
+
"sharing.confirm-leave.leave": "離開",
|
|
293
|
+
"sharing.confirm-leave.title": "離開當前專案?",
|
|
294
|
+
"shortcuts-dialog.collaboration": "合作",
|
|
266
295
|
"shortcuts-dialog.edit": "編輯",
|
|
267
296
|
"shortcuts-dialog.file": "檔案",
|
|
268
297
|
"shortcuts-dialog.preferences": "選項",
|
|
@@ -277,7 +306,6 @@
|
|
|
277
306
|
"spline-style.cubic": "立方體",
|
|
278
307
|
"spline-style.line": "直線",
|
|
279
308
|
"status.offline": "斷線",
|
|
280
|
-
"status.online": "已連線",
|
|
281
309
|
"style-panel.align": "對齊",
|
|
282
310
|
"style-panel.arrowhead-end": "末端",
|
|
283
311
|
"style-panel.arrowhead-start": "前端",
|
|
@@ -287,26 +315,31 @@
|
|
|
287
315
|
"style-panel.fill": "填充",
|
|
288
316
|
"style-panel.font": "字型",
|
|
289
317
|
"style-panel.geo": "形狀",
|
|
318
|
+
"style-panel.label-align": "標籤對齊",
|
|
290
319
|
"style-panel.mixed": "混合",
|
|
291
320
|
"style-panel.opacity": "不透明度",
|
|
292
321
|
"style-panel.position": "位置",
|
|
293
322
|
"style-panel.size": "大小",
|
|
294
323
|
"style-panel.spline": "曲線",
|
|
295
324
|
"style-panel.title": "樣式",
|
|
325
|
+
"style-panel.vertical-align": "垂直對齊",
|
|
326
|
+
"theme.dark": "黑暗",
|
|
327
|
+
"theme.light": "明亮",
|
|
328
|
+
"theme.system": "系統",
|
|
296
329
|
"toast.close": "關閉",
|
|
297
330
|
"toast.error.copy-fail.desc": "圖片複製失敗",
|
|
298
331
|
"toast.error.copy-fail.title": "複製失敗",
|
|
299
332
|
"toast.error.export-fail.desc": "圖片匯出失敗",
|
|
300
333
|
"toast.error.export-fail.title": "匯出失敗",
|
|
301
|
-
"tool-panel.drawing": "繪圖",
|
|
302
334
|
"tool-panel.more": "更多",
|
|
303
|
-
"tool-panel.shapes": "形狀",
|
|
304
335
|
"tool.arrow": "箭頭",
|
|
305
336
|
"tool.arrow-down": "向下箭頭",
|
|
306
337
|
"tool.arrow-left": "向左箭頭",
|
|
307
338
|
"tool.arrow-right": "向右箭頭",
|
|
308
339
|
"tool.arrow-up": "向上箭頭",
|
|
309
340
|
"tool.asset": "資源",
|
|
341
|
+
"tool.check-box": "勾選框",
|
|
342
|
+
"tool.cloud": "雲端",
|
|
310
343
|
"tool.diamond": "菱形 2",
|
|
311
344
|
"tool.draw": "手繪",
|
|
312
345
|
"tool.ellipse": "橢圓形",
|
|
@@ -315,11 +348,14 @@
|
|
|
315
348
|
"tool.frame": "框架",
|
|
316
349
|
"tool.hand": "抓取",
|
|
317
350
|
"tool.hexagon": "六邊形",
|
|
351
|
+
"tool.highlight": "醒目提醒",
|
|
352
|
+
"tool.laser": "雷射",
|
|
318
353
|
"tool.line": "直線",
|
|
319
354
|
"tool.note": "便利貼",
|
|
320
355
|
"tool.octagon": "八邊形",
|
|
321
356
|
"tool.oval": "卵形",
|
|
322
357
|
"tool.pentagon": "五邊形",
|
|
358
|
+
"tool.pointer-down": "指針向下",
|
|
323
359
|
"tool.rectangle": "矩形",
|
|
324
360
|
"tool.rhombus": "菱形",
|
|
325
361
|
"tool.select": "選取",
|
package/license.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,65 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitschpatrol/tldraw-cli",
|
|
3
|
-
"version": "4.6.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "4.6.30",
|
|
4
|
+
"description": "A CLI tool and TypeScript library for exporting tldraw sketches to PNG or SVG images.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tldraw",
|
|
7
|
+
"tldr",
|
|
8
|
+
"cli",
|
|
9
|
+
"diagram",
|
|
10
|
+
"drawing",
|
|
11
|
+
"sketch",
|
|
12
|
+
"export",
|
|
13
|
+
"npm-package"
|
|
14
|
+
],
|
|
7
15
|
"homepage": "https://github.com/kitschpatrol/tldraw-cli",
|
|
8
16
|
"bugs": "https://github.com/kitschpatrol/tldraw-cli/issues",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/github:kitschpatrol/tldraw-cli"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
9
22
|
"author": {
|
|
10
23
|
"name": "Eric Mika",
|
|
11
24
|
"email": "eric@ericmika.com",
|
|
12
25
|
"url": "https://ericmika.com"
|
|
13
26
|
},
|
|
14
|
-
"
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=18.0.0",
|
|
17
|
-
"pnpm": ">=9.0.0"
|
|
18
|
-
},
|
|
19
|
-
"bin": {
|
|
20
|
-
"tldraw-cli": "bin/cli.js",
|
|
21
|
-
"tldraw": "bin/cli.js"
|
|
22
|
-
},
|
|
27
|
+
"type": "module",
|
|
23
28
|
"main": "./dist/lib/index.js",
|
|
24
29
|
"module": "./dist/lib/index.js",
|
|
25
30
|
"types": "./dist/lib/index.d.ts",
|
|
31
|
+
"bin": {
|
|
32
|
+
"tldraw": "bin/cli.js",
|
|
33
|
+
"tldraw-cli": "bin/cli.js"
|
|
34
|
+
},
|
|
26
35
|
"files": [
|
|
27
36
|
"bin/*",
|
|
28
37
|
"dist/*"
|
|
29
38
|
],
|
|
30
|
-
"keywords": [
|
|
31
|
-
"tldraw",
|
|
32
|
-
"tldr",
|
|
33
|
-
"cli",
|
|
34
|
-
"diagram",
|
|
35
|
-
"drawing",
|
|
36
|
-
"sketch",
|
|
37
|
-
"export",
|
|
38
|
-
"npm-package"
|
|
39
|
-
],
|
|
40
39
|
"dependencies": {
|
|
41
40
|
"@fontsource/inter": "^5.1.1",
|
|
42
41
|
"express": "^4.21.2",
|
|
43
|
-
"puppeteer": "^
|
|
42
|
+
"puppeteer": "^24.2.0",
|
|
44
43
|
"uint8array-extras": "^1.4.0",
|
|
45
44
|
"yargs": "^17.7.2"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@kitschpatrol/shared-config": "^
|
|
47
|
+
"@kitschpatrol/shared-config": "^5.0.5",
|
|
49
48
|
"@sindresorhus/slugify": "^2.2.1",
|
|
50
|
-
"@tldraw/assets": "3.
|
|
49
|
+
"@tldraw/assets": "3.8.0-canary.3f23e0d4c913",
|
|
51
50
|
"@types/express": "^4.17.21",
|
|
52
51
|
"@types/node": "18.0.0",
|
|
53
52
|
"@types/react": "^18.3.18",
|
|
54
53
|
"@types/react-dom": "^18.3.5",
|
|
55
54
|
"@types/yargs": "^17.0.33",
|
|
56
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
57
|
-
"bumpp": "^
|
|
55
|
+
"@vitejs/plugin-react-swc": "^3.8.0",
|
|
56
|
+
"bumpp": "^10.0.2",
|
|
58
57
|
"chalk": "^5.4.1",
|
|
59
58
|
"cheerio": "^1.0.0",
|
|
60
|
-
"esbuild": "^0.
|
|
61
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
62
|
-
"eslint-plugin-react-refresh": "^0.4.18",
|
|
59
|
+
"esbuild": "^0.25.0",
|
|
63
60
|
"get-port": "^7.1.0",
|
|
64
61
|
"nanoid": "^5.0.9",
|
|
65
62
|
"open": "^10.1.0",
|
|
@@ -72,26 +69,39 @@
|
|
|
72
69
|
"sharp": "^0.33.5",
|
|
73
70
|
"sharp-phash": "^2.2.0",
|
|
74
71
|
"strip-ansi": "^7.1.0",
|
|
75
|
-
"tldraw": "3.
|
|
72
|
+
"tldraw": "3.8.0-canary.3f23e0d4c913",
|
|
76
73
|
"tsx": "^4.19.2",
|
|
77
74
|
"typescript": "^5.7.3",
|
|
78
75
|
"untildify": "^5.0.0",
|
|
79
|
-
"vite": "^
|
|
80
|
-
"vitest": "^
|
|
76
|
+
"vite": "^6.1.0",
|
|
77
|
+
"vitest": "^3.0.5"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=18.0.0",
|
|
81
|
+
"pnpm": ">=10.0.0"
|
|
81
82
|
},
|
|
82
83
|
"publishConfig": {
|
|
83
84
|
"access": "public"
|
|
84
85
|
},
|
|
86
|
+
"mdat": {
|
|
87
|
+
"$import": "node_modules/@kitschpatrol/mdat-config/dist/index.js"
|
|
88
|
+
},
|
|
89
|
+
"prettier": "@kitschpatrol/prettier-config",
|
|
90
|
+
"remarkConfig": {
|
|
91
|
+
"plugins": [
|
|
92
|
+
"@kitschpatrol/remark-config"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
85
95
|
"scripts": {
|
|
86
96
|
"build": "pnpm run build:tldraw && pnpm run build:lib && pnpm run build:cli",
|
|
87
|
-
"build:cli": "tsx ./scripts/build-cli.ts",
|
|
97
|
+
"build:cli": "tsx ./scripts/build-cli.ts && tsc -p tsconfig.build.json",
|
|
88
98
|
"build:lib": "tsx ./scripts/build-lib.ts && tsc -p tsconfig.lib.json",
|
|
89
99
|
"build:tldraw": "pnpm run tldraw:copy-assets && vite build",
|
|
90
100
|
"clean": "git rm -f pnpm-lock.yaml ; git clean -fdX",
|
|
91
101
|
"dev": "pnpm run dev:tldraw",
|
|
92
102
|
"dev:tldraw": "pnpm run tldraw:copy-assets && vite",
|
|
93
|
-
"fix": "
|
|
94
|
-
"lint": "
|
|
103
|
+
"fix": "kpi fix",
|
|
104
|
+
"lint": "kpi lint",
|
|
95
105
|
"preview": "pnpm run preview:tldraw",
|
|
96
106
|
"preview:tldraw": "vite preview",
|
|
97
107
|
"release": "bumpp --commit 'Release: %s' && pnpm run build && pnpm publish --otp $(op read 'op://Personal/Npmjs/one-time password?attribute=otp')",
|
package/readme.md
CHANGED
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
<!-- description -->
|
|
17
17
|
|
|
18
|
-
**A CLI tool for exporting tldraw
|
|
18
|
+
**A CLI tool and TypeScript library for exporting tldraw sketches to PNG or SVG images.**
|
|
19
19
|
|
|
20
20
|
<!-- /description -->
|
|
21
21
|
|
|
22
|
+
> [!IMPORTANT]
|
|
23
|
+
>
|
|
24
|
+
> The tldraw project and website are rapidly evolving, and time is not always available to keep `tldraw-cli`'s abstractions up to date, particularly for commands that interface directly with sketch URLs. Working with local `.tldr` files should be relatively stable, but caveat emptor.
|
|
25
|
+
|
|
22
26
|
<!-- table-of-contents { maxDepth: 2 } -->
|
|
23
27
|
|
|
24
28
|
## Table of contents
|
|
@@ -115,22 +119,22 @@ tldraw export <files-or-urls..>
|
|
|
115
119
|
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
116
120
|
| `files-or-urls` | The tldraw sketch to export. May be one or more paths to local `.tldr` files, or tldraw\.com sketch URLs. Accepts a mix of both file paths and URLs, and supports glob matching via your shell. Prints the absolute path(s) to the exported image(s) to `stdout`. _(Required.)_ | `array` |
|
|
117
121
|
|
|
118
|
-
| Option | Description | Type
|
|
119
|
-
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
-
| `--format`<br>`-f` | Output image format. | `"png"` `"svg"` `"
|
|
121
|
-
| `--output`<br>`-o` | Output image directory. | `string`
|
|
122
|
-
| `--name`<br>`-n` | Output image name (without extension). | `string`
|
|
123
|
-
| `--frames` | Export each sketch "frame" as a separate image. Pass one or more frame names or IDs to export specific frames, or pass the flag without the arguments to export all frames. By default, the entire first page is exported with all frames. | `array`
|
|
124
|
-
| `--pages` | Export each sketch "page" as a separate image. Pass one or more page names or IDs to export specific page, or pass one or more page index numbers (from 0), or pass the flag without the arguments to export all pages. By default, only the first page is exported. | `array`
|
|
125
|
-
| `--transparent`<br>`-t` | Export an image with a transparent background. | `boolean`
|
|
126
|
-
| `--dark`<br>`-d` | Export a dark theme version of the image. | `boolean`
|
|
127
|
-
| `--padding` | Set a specific padding amount around the exported image. | `number`
|
|
128
|
-
| `--scale` | Set a sampling factor for raster image exports. | `number`
|
|
129
|
-
| `--strip-style` | Remove `<style>` elements from SVG output, useful to lighten the load of embedded fonts if you intend to provide your own stylesheets. Applies to SVG output only. | `boolean`
|
|
130
|
-
| `--print`<br>`-p` | Print the exported image(s) to stdout instead of saving to a file. Incompatible with `--output`, and disregards `--name`. PNGs are printed as base64-encoded strings. | `boolean`
|
|
131
|
-
| `--verbose` | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to `stderr` for ease of redirection. | `boolean`
|
|
132
|
-
| `--help`<br>`-h` | Show help | `boolean`
|
|
133
|
-
| `--version`<br>`-v` | Show version number | `boolean`
|
|
122
|
+
| Option | Description | Type | Default |
|
|
123
|
+
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | ----------------------------------------- |
|
|
124
|
+
| `--format`<br>`-f` | Output image format. | `"png"` `"svg"` `"tldr"` | `"svg"` |
|
|
125
|
+
| `--output`<br>`-o` | Output image directory. | `string` | `"./"` |
|
|
126
|
+
| `--name`<br>`-n` | Output image name (without extension). | `string` | The original file name or URL id is used. |
|
|
127
|
+
| `--frames` | Export each sketch "frame" as a separate image. Pass one or more frame names or IDs to export specific frames, or pass the flag without the arguments to export all frames. By default, the entire first page is exported with all frames. | `array` | `false` |
|
|
128
|
+
| `--pages` | Export each sketch "page" as a separate image. Pass one or more page names or IDs to export specific page, or pass one or more page index numbers (from 0), or pass the flag without the arguments to export all pages. By default, only the first page is exported. | `array` | `false` |
|
|
129
|
+
| `--transparent`<br>`-t` | Export an image with a transparent background. | `boolean` | `false` |
|
|
130
|
+
| `--dark`<br>`-d` | Export a dark theme version of the image. | `boolean` | `false` |
|
|
131
|
+
| `--padding` | Set a specific padding amount around the exported image. | `number` | `32` |
|
|
132
|
+
| `--scale` | Set a sampling factor for raster image exports. | `number` | `1` |
|
|
133
|
+
| `--strip-style` | Remove `<style>` elements from SVG output, useful to lighten the load of embedded fonts if you intend to provide your own stylesheets. Applies to SVG output only. | `boolean` | `false` |
|
|
134
|
+
| `--print`<br>`-p` | Print the exported image(s) to stdout instead of saving to a file. Incompatible with `--output`, and disregards `--name`. PNGs are printed as base64-encoded strings. | `boolean` | `false` |
|
|
135
|
+
| `--verbose` | Enable verbose logging. All verbose logs and prefixed with their log level and are printed to `stderr` for ease of redirection. | `boolean` | `false` |
|
|
136
|
+
| `--help`<br>`-h` | Show help | `boolean` | |
|
|
137
|
+
| `--version`<br>`-v` | Show version number | `boolean` | |
|
|
134
138
|
|
|
135
139
|
#### Subcommand: `tldraw open`
|
|
136
140
|
|
|
@@ -299,24 +303,25 @@ The library exports two async function, `tldrawToImage`, and `tldrawOpen`.
|
|
|
299
303
|
|
|
300
304
|
This mirrors the `tldraw export` CLI command.
|
|
301
305
|
|
|
302
|
-
It takes an options argument mirroring the arguments available via the command line. The same default values apply:
|
|
306
|
+
It takes an options argument mirroring the arguments available via the command line. Here's the full type signature of the function. The same default values from the CLI apply:
|
|
303
307
|
|
|
304
308
|
```ts
|
|
305
|
-
|
|
309
|
+
type TldrawToImageFn = (
|
|
306
310
|
tldrPathOrUrl: string,
|
|
307
|
-
{
|
|
311
|
+
options: {
|
|
308
312
|
dark?: boolean
|
|
309
|
-
format?: '
|
|
313
|
+
format?: 'png' | 'svg' | 'tldr'
|
|
310
314
|
frames?: boolean | string[]
|
|
311
315
|
name?: string
|
|
312
316
|
output?: string
|
|
313
317
|
padding?: number
|
|
314
|
-
pages?: boolean |
|
|
318
|
+
pages?: boolean | number[] | string[]
|
|
315
319
|
print?: boolean
|
|
316
320
|
scale?: number
|
|
317
321
|
stripStyle?: boolean
|
|
318
322
|
transparent?: boolean
|
|
319
|
-
|
|
323
|
+
},
|
|
324
|
+
) => Promise<string[]>
|
|
320
325
|
```
|
|
321
326
|
|
|
322
327
|
The function exports the image in the requested format and returns an array of the output image(s) or file(s).
|
|
@@ -326,7 +331,7 @@ Generally, a single file is returned — but the `string[]` return type also acc
|
|
|
326
331
|
Assuming you've installed `@kitschpatrol/tldraw-cli` locally in your project, it may be used as follows:
|
|
327
332
|
|
|
328
333
|
```ts
|
|
329
|
-
//
|
|
334
|
+
// Tldraw-cli-api-test.ts
|
|
330
335
|
|
|
331
336
|
import { tldrawToImage } from '@kitschpatrol/tldraw-cli'
|
|
332
337
|
|
|
@@ -347,8 +352,8 @@ console.log(`Wrote frames to: "${framePathsArray}"`)
|
|
|
347
352
|
|
|
348
353
|
// Convert a specific frame from a tldraw.com URL to a PNG
|
|
349
354
|
await tldrawToImage('https://www.tldraw.com/s/v2_c_FI5RYWbdpAtjsy4OIKrKw', {
|
|
350
|
-
frames: ['Frame 3'],
|
|
351
355
|
format: 'png',
|
|
356
|
+
frames: ['Frame 3'],
|
|
352
357
|
})
|
|
353
358
|
|
|
354
359
|
// You can also use the frame id instead of the frame name, if you're into that sort of thing
|
|
@@ -361,15 +366,15 @@ await tldrawToImage('https://www.tldraw.com/s/v2_c_FI5RYWbdpAtjsy4OIKrKw', {
|
|
|
361
366
|
By default, the Node API only logs warnings and errors. If you want to log the equivalent of the `--verbose` flag from the command line version, then you can set a flag on a logging object exported from the library:
|
|
362
367
|
|
|
363
368
|
```ts
|
|
364
|
-
//
|
|
369
|
+
// Tldraw-cli-api-verbose-test.ts
|
|
365
370
|
|
|
366
|
-
import {
|
|
371
|
+
import { log, tldrawToImage } from '@kitschpatrol/tldraw-cli'
|
|
367
372
|
|
|
368
|
-
//
|
|
373
|
+
// This will log extra info
|
|
369
374
|
log.verbose = true
|
|
370
375
|
await tldrawToImage('https://www.tldraw.com/s/v2_c_JsxJk8dag6QsrqExukis4')
|
|
371
376
|
|
|
372
|
-
//
|
|
377
|
+
// Now we'll only log errors and warnings
|
|
373
378
|
log.verbose = false
|
|
374
379
|
await tldrawToImage('https://www.tldraw.com/s/v2_c_JsxJk8dag6QsrqExukis4')
|
|
375
380
|
```
|
|
@@ -378,8 +383,8 @@ await tldrawToImage('https://www.tldraw.com/s/v2_c_JsxJk8dag6QsrqExukis4')
|
|
|
378
383
|
|
|
379
384
|
Mirrors the `tldraw open` CLI command.
|
|
380
385
|
|
|
381
|
-
> [!
|
|
382
|
-
>
|
|
386
|
+
> [!IMPORTANT]
|
|
387
|
+
> 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.
|
|
383
388
|
|
|
384
389
|
```tsx
|
|
385
390
|
async function tldrawOpen(
|
|
@@ -421,17 +426,6 @@ await tldrawOpen('./sketch.tldr', {
|
|
|
421
426
|
})
|
|
422
427
|
```
|
|
423
428
|
|
|
424
|
-
#### `tldrawToShareUrl`
|
|
425
|
-
|
|
426
|
-
```ts
|
|
427
|
-
async function tldrawToShareUrl(tldrPathOrUrl: string): Promise<string>
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
Returns a live "share" url for a given local or remote tldraw sketch URL.
|
|
431
|
-
|
|
432
|
-
> [!CAUTION]
|
|
433
|
-
> Passing a local .tldr file to this function will upload and share your local file to tldraw\.com.
|
|
434
|
-
|
|
435
429
|
### Common workflows
|
|
436
430
|
|
|
437
431
|
If you're working with .tldr files and `tldraw-cli` locally, it's often convenient to automatically export image files from your sketches whenever they've changed.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function tldrawToShareUrl(tldrPathOrUrl: string): Promise<string>;
|