tldraw 5.6.0 → 5.6.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.
- package/DOCS.md +21 -9
- package/RELEASE_NOTES.md +161 -3
- package/dist-cjs/index.d.ts +31 -1
- package/dist-cjs/index.js +4 -1
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js +11 -4
- package/dist-cjs/lib/shapes/bookmark/BookmarkShapeUtil.js.map +2 -2
- package/dist-cjs/lib/shapes/bookmark/bookmarks.js +25 -4
- package/dist-cjs/lib/shapes/bookmark/bookmarks.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js +4 -0
- package/dist-cjs/lib/shapes/shared/HyperlinkButton.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js +13 -1
- package/dist-cjs/lib/shapes/shared/RichTextLabel.js.map +2 -2
- package/dist-cjs/lib/shapes/shared/useOpenLinkHandler.js +38 -0
- package/dist-cjs/lib/shapes/shared/useOpenLinkHandler.js.map +7 -0
- package/dist-cjs/lib/ui/components/ConfirmOpenLinkDialog.js +57 -0
- package/dist-cjs/lib/ui/components/ConfirmOpenLinkDialog.js.map +7 -0
- package/dist-cjs/lib/ui/components/EditLinkDialog.js +15 -17
- package/dist-cjs/lib/ui/components/EditLinkDialog.js.map +2 -2
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js +47 -19
- package/dist-cjs/lib/ui/components/Toolbar/LinkEditor.js.map +3 -3
- package/dist-cjs/lib/ui/context/actions.js +2 -1
- package/dist-cjs/lib/ui/context/actions.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useEditorEvents.js +12 -1
- package/dist-cjs/lib/ui/hooks/useEditorEvents.js.map +2 -2
- package/dist-cjs/lib/ui/hooks/useTranslation/TLUiTranslationKey.js.map +1 -1
- package/dist-cjs/lib/ui/version.js +2 -2
- package/dist-cjs/lib/ui/version.js.map +1 -1
- package/dist-cjs/lib/utils/linkUrl.js +39 -0
- package/dist-cjs/lib/utils/linkUrl.js.map +7 -0
- package/dist-cjs/lib/utils/openLink.js +68 -0
- package/dist-cjs/lib/utils/openLink.js.map +7 -0
- package/dist-cjs/lib/utils/text/richText.js +4 -1
- package/dist-cjs/lib/utils/text/richText.js.map +2 -2
- package/dist-esm/index.d.mts +31 -1
- package/dist-esm/index.mjs +4 -1
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs +12 -4
- package/dist-esm/lib/shapes/bookmark/BookmarkShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/shapes/bookmark/bookmarks.mjs +25 -4
- package/dist-esm/lib/shapes/bookmark/bookmarks.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs +4 -0
- package/dist-esm/lib/shapes/shared/HyperlinkButton.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs +13 -2
- package/dist-esm/lib/shapes/shared/RichTextLabel.mjs.map +2 -2
- package/dist-esm/lib/shapes/shared/useOpenLinkHandler.mjs +18 -0
- package/dist-esm/lib/shapes/shared/useOpenLinkHandler.mjs.map +7 -0
- package/dist-esm/lib/ui/components/ConfirmOpenLinkDialog.mjs +43 -0
- package/dist-esm/lib/ui/components/ConfirmOpenLinkDialog.mjs.map +7 -0
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs +16 -18
- package/dist-esm/lib/ui/components/EditLinkDialog.mjs.map +2 -2
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs +38 -20
- package/dist-esm/lib/ui/components/Toolbar/LinkEditor.mjs.map +2 -2
- package/dist-esm/lib/ui/context/actions.mjs +2 -1
- package/dist-esm/lib/ui/context/actions.mjs.map +2 -2
- package/dist-esm/lib/ui/hooks/useEditorEvents.mjs +13 -2
- package/dist-esm/lib/ui/hooks/useEditorEvents.mjs.map +2 -2
- package/dist-esm/lib/ui/version.mjs +2 -2
- package/dist-esm/lib/ui/version.mjs.map +1 -1
- package/dist-esm/lib/utils/linkUrl.mjs +19 -0
- package/dist-esm/lib/utils/linkUrl.mjs.map +7 -0
- package/dist-esm/lib/utils/openLink.mjs +48 -0
- package/dist-esm/lib/utils/openLink.mjs.map +7 -0
- package/dist-esm/lib/utils/text/richText.mjs +5 -1
- package/dist-esm/lib/utils/text/richText.mjs.map +2 -2
- package/package.json +6 -6
- package/src/index.ts +1 -0
- package/src/lib/shapes/bookmark/BookmarkShapeUtil.tsx +12 -6
- package/src/lib/shapes/bookmark/bookmarks.ts +38 -5
- package/src/lib/shapes/shared/HyperlinkButton.tsx +4 -0
- package/src/lib/shapes/shared/RichTextLabel.tsx +18 -2
- package/src/lib/shapes/shared/useOpenLinkHandler.ts +20 -0
- package/src/lib/ui/components/ConfirmOpenLinkDialog.tsx +53 -0
- package/src/lib/ui/components/EditLinkDialog.tsx +22 -26
- package/src/lib/ui/components/Toolbar/LinkEditor.tsx +40 -21
- package/src/lib/ui/context/actions.tsx +2 -1
- package/src/lib/ui/hooks/useEditorEvents.ts +14 -2
- package/src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts +4 -0
- package/src/lib/ui/version.ts +2 -2
- package/src/lib/ui.css +19 -2
- package/src/lib/utils/linkUrl.test.ts +33 -0
- package/src/lib/utils/linkUrl.ts +30 -0
- package/src/lib/utils/openLink.test.ts +83 -0
- package/src/lib/utils/openLink.ts +75 -0
- package/src/lib/utils/text/richText.ts +4 -0
- package/src/test/bookmark-shapes.test.ts +62 -2
- package/src/test/ui/ConfirmOpenLinkDialog.test.tsx +128 -0
- package/src/test/ui/EditLinkDialog.test.tsx +53 -2
- package/src/test/ui/LinkEditor.test.tsx +71 -0
- package/tldraw.css +19 -2
|
@@ -23,10 +23,13 @@ __export(useEditorEvents_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(useEditorEvents_exports);
|
|
24
24
|
var import_editor = require("@tldraw/editor");
|
|
25
25
|
var import_react = require("react");
|
|
26
|
+
var import_ConfirmOpenLinkDialog = require("../components/ConfirmOpenLinkDialog");
|
|
27
|
+
var import_dialogs = require("../context/dialogs");
|
|
26
28
|
var import_toasts = require("../context/toasts");
|
|
27
29
|
function useEditorEvents() {
|
|
28
30
|
const editor = (0, import_editor.useEditor)();
|
|
29
31
|
const { addToast } = (0, import_toasts.useToasts)();
|
|
32
|
+
const { addDialog } = (0, import_dialogs.useDialogs)();
|
|
30
33
|
(0, import_react.useEffect)(() => {
|
|
31
34
|
function handleMaxShapes({ name, count }) {
|
|
32
35
|
addToast({
|
|
@@ -35,10 +38,18 @@ function useEditorEvents() {
|
|
|
35
38
|
severity: "warning"
|
|
36
39
|
});
|
|
37
40
|
}
|
|
41
|
+
function handleConfirmOpenLink({ url }) {
|
|
42
|
+
addDialog({
|
|
43
|
+
id: "confirm-open-link",
|
|
44
|
+
component: ({ onClose }) => (0, import_react.createElement)(import_ConfirmOpenLinkDialog.ConfirmOpenLinkDialog, { url, onClose })
|
|
45
|
+
});
|
|
46
|
+
}
|
|
38
47
|
editor.addListener("max-shapes", handleMaxShapes);
|
|
48
|
+
editor.addListener("confirm-open-link", handleConfirmOpenLink);
|
|
39
49
|
return () => {
|
|
40
50
|
editor.removeListener("max-shapes", handleMaxShapes);
|
|
51
|
+
editor.removeListener("confirm-open-link", handleConfirmOpenLink);
|
|
41
52
|
};
|
|
42
|
-
}, [editor, addToast]);
|
|
53
|
+
}, [editor, addToast, addDialog]);
|
|
43
54
|
}
|
|
44
55
|
//# sourceMappingURL=useEditorEvents.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/ui/hooks/useEditorEvents.ts"],
|
|
4
|
-
"sourcesContent": ["import { useEditor } from '@tldraw/editor'\nimport { useEffect } from 'react'\nimport { useToasts } from '../context/toasts'\n\n/** @internal */\nexport function useEditorEvents() {\n\tconst editor = useEditor()\n\tconst { addToast } = useToasts()\n\n\tuseEffect(() => {\n\t\tfunction handleMaxShapes({ name, count }: { name: string; pageId: string; count: number }) {\n\t\t\taddToast({\n\t\t\t\ttitle: 'Maximum shapes reached',\n\t\t\t\tdescription: `You've reached the maximum number of shapes allowed on ${name} (${count}). Please delete some shapes or move to a different page to continue.`,\n\t\t\t\tseverity: 'warning',\n\t\t\t})\n\t\t}\n\n\t\teditor.addListener('max-shapes', handleMaxShapes)\n\t\treturn () => {\n\t\t\teditor.removeListener('max-shapes', handleMaxShapes)\n\t\t}\n\t}, [editor, addToast])\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAC1B,
|
|
4
|
+
"sourcesContent": ["import { useEditor } from '@tldraw/editor'\nimport { createElement, useEffect } from 'react'\nimport { ConfirmOpenLinkDialog } from '../components/ConfirmOpenLinkDialog'\nimport { useDialogs } from '../context/dialogs'\nimport { useToasts } from '../context/toasts'\n\n/** @internal */\nexport function useEditorEvents() {\n\tconst editor = useEditor()\n\tconst { addToast } = useToasts()\n\tconst { addDialog } = useDialogs()\n\n\tuseEffect(() => {\n\t\tfunction handleMaxShapes({ name, count }: { name: string; pageId: string; count: number }) {\n\t\t\taddToast({\n\t\t\t\ttitle: 'Maximum shapes reached',\n\t\t\t\tdescription: `You've reached the maximum number of shapes allowed on ${name} (${count}). Please delete some shapes or move to a different page to continue.`,\n\t\t\t\tseverity: 'warning',\n\t\t\t})\n\t\t}\n\n\t\tfunction handleConfirmOpenLink({ url }: { url: string }) {\n\t\t\taddDialog({\n\t\t\t\tid: 'confirm-open-link',\n\t\t\t\tcomponent: ({ onClose }) => createElement(ConfirmOpenLinkDialog, { url, onClose }),\n\t\t\t})\n\t\t}\n\n\t\teditor.addListener('max-shapes', handleMaxShapes)\n\t\teditor.addListener('confirm-open-link', handleConfirmOpenLink)\n\t\treturn () => {\n\t\t\teditor.removeListener('max-shapes', handleMaxShapes)\n\t\t\teditor.removeListener('confirm-open-link', handleConfirmOpenLink)\n\t\t}\n\t}, [editor, addToast, addDialog])\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA0B;AAC1B,mBAAyC;AACzC,mCAAsC;AACtC,qBAA2B;AAC3B,oBAA0B;AAGnB,SAAS,kBAAkB;AACjC,QAAM,aAAS,yBAAU;AACzB,QAAM,EAAE,SAAS,QAAI,yBAAU;AAC/B,QAAM,EAAE,UAAU,QAAI,2BAAW;AAEjC,8BAAU,MAAM;AACf,aAAS,gBAAgB,EAAE,MAAM,MAAM,GAAoD;AAC1F,eAAS;AAAA,QACR,OAAO;AAAA,QACP,aAAa,0DAA0D,IAAI,KAAK,KAAK;AAAA,QACrF,UAAU;AAAA,MACX,CAAC;AAAA,IACF;AAEA,aAAS,sBAAsB,EAAE,IAAI,GAAoB;AACxD,gBAAU;AAAA,QACT,IAAI;AAAA,QACJ,WAAW,CAAC,EAAE,QAAQ,UAAM,4BAAc,oDAAuB,EAAE,KAAK,QAAQ,CAAC;AAAA,MAClF,CAAC;AAAA,IACF;AAEA,WAAO,YAAY,cAAc,eAAe;AAChD,WAAO,YAAY,qBAAqB,qBAAqB;AAC7D,WAAO,MAAM;AACZ,aAAO,eAAe,cAAc,eAAe;AACnD,aAAO,eAAe,qBAAqB,qBAAqB;AAAA,IACjE;AAAA,EACD,GAAG,CAAC,QAAQ,UAAU,SAAS,CAAC;AACjC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/ui/hooks/useTranslation/TLUiTranslationKey.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\n/** @public */\nexport type TLUiTranslationKey =\n\t| 'a11y.adjust-shape-styles'\n\t| 'a11y.enlarge-shape'\n\t| 'a11y.enter-leave-container'\n\t| 'a11y.move-shape'\n\t| 'a11y.move-shape-faster'\n\t| 'a11y.multiple-shapes'\n\t| 'a11y.open-context-menu'\n\t| 'a11y.open-keyboard-shortcuts'\n\t| 'a11y.pan-camera'\n\t| 'a11y.repeat-shape'\n\t| 'a11y.rotate-shape-ccw'\n\t| 'a11y.rotate-shape-ccw-fine'\n\t| 'a11y.rotate-shape-cw'\n\t| 'a11y.rotate-shape-cw-fine'\n\t| 'a11y.select-shape'\n\t| 'a11y.select-shape-direction'\n\t| 'a11y.shape-image'\n\t| 'a11y.shape-index'\n\t| 'a11y.shape-video'\n\t| 'a11y.shrink-shape'\n\t| 'a11y.skip-to-main-content'\n\t| 'a11y.status'\n\t| 'action.align-bottom'\n\t| 'action.align-center-horizontal'\n\t| 'action.align-center-horizontal.short'\n\t| 'action.align-center-vertical'\n\t| 'action.align-center-vertical.short'\n\t| 'action.align-left'\n\t| 'action.align-right'\n\t| 'action.align-top'\n\t| 'action.back-to-content'\n\t| 'action.bring-forward'\n\t| 'action.bring-to-front'\n\t| 'action.convert-to-bookmark'\n\t| 'action.convert-to-embed'\n\t| 'action.copy'\n\t| 'action.copy-as-json'\n\t| 'action.copy-as-json.short'\n\t| 'action.copy-as-png'\n\t| 'action.copy-as-png.short'\n\t| 'action.copy-as-svg'\n\t| 'action.copy-as-svg.short'\n\t| 'action.copy-hovered-styles'\n\t| 'action.cut'\n\t| 'action.delete'\n\t| 'action.distribute-horizontal'\n\t| 'action.distribute-horizontal.short'\n\t| 'action.distribute-vertical'\n\t| 'action.distribute-vertical.short'\n\t| 'action.download-original'\n\t| 'action.duplicate'\n\t| 'action.edit-link'\n\t| 'action.enhanced-a11y-mode'\n\t| 'action.enhanced-a11y-mode.menu'\n\t| 'action.exit-pen-mode'\n\t| 'action.export-all-as-png'\n\t| 'action.export-all-as-png.short'\n\t| 'action.export-all-as-svg'\n\t| 'action.export-all-as-svg.short'\n\t| 'action.export-as-png'\n\t| 'action.export-as-png.short'\n\t| 'action.export-as-svg'\n\t| 'action.export-as-svg.short'\n\t| 'action.fit-frame-to-content'\n\t| 'action.flatten-to-image'\n\t| 'action.flip-horizontal'\n\t| 'action.flip-horizontal.short'\n\t| 'action.flip-vertical'\n\t| 'action.flip-vertical.short'\n\t| 'action.frame-selection'\n\t| 'action.group'\n\t| 'action.insert-embed'\n\t| 'action.insert-media'\n\t| 'action.open-cursor-chat'\n\t| 'action.open-embed-link'\n\t| 'action.open-kbd-shortcuts'\n\t| 'action.pack'\n\t| 'action.paste'\n\t| 'action.paste-error-description'\n\t| 'action.paste-error-title'\n\t| 'action.print'\n\t| 'action.redo'\n\t| 'action.remove-frame'\n\t| 'action.rename'\n\t| 'action.rotate-ccw'\n\t| 'action.rotate-cw'\n\t| 'action.save-copy'\n\t| 'action.select-all'\n\t| 'action.select-none'\n\t| 'action.select-zoom-tool'\n\t| 'action.send-backward'\n\t| 'action.send-to-back'\n\t| 'action.stack-horizontal'\n\t| 'action.stack-horizontal.short'\n\t| 'action.stack-vertical'\n\t| 'action.stack-vertical.short'\n\t| 'action.stop-following'\n\t| 'action.stretch-horizontal'\n\t| 'action.stretch-horizontal.short'\n\t| 'action.stretch-vertical'\n\t| 'action.stretch-vertical.short'\n\t| 'action.toggle-auto-none'\n\t| 'action.toggle-auto-pan'\n\t| 'action.toggle-auto-size'\n\t| 'action.toggle-auto-zoom'\n\t| 'action.toggle-dark-mode'\n\t| 'action.toggle-dark-mode.menu'\n\t| 'action.toggle-debug-mode'\n\t| 'action.toggle-debug-mode.menu'\n\t| 'action.toggle-dynamic-size-mode'\n\t| 'action.toggle-dynamic-size-mode.menu'\n\t| 'action.toggle-edge-scrolling'\n\t| 'action.toggle-edge-scrolling.menu'\n\t| 'action.toggle-focus-mode'\n\t| 'action.toggle-focus-mode.menu'\n\t| 'action.toggle-grid'\n\t| 'action.toggle-grid.menu'\n\t| 'action.toggle-invert-zoom'\n\t| 'action.toggle-invert-zoom.menu'\n\t| 'action.toggle-keyboard-shortcuts'\n\t| 'action.toggle-keyboard-shortcuts.menu'\n\t| 'action.toggle-lock'\n\t| 'action.toggle-mouse'\n\t| 'action.toggle-paste-at-cursor'\n\t| 'action.toggle-paste-at-cursor.menu'\n\t| 'action.toggle-reduce-motion'\n\t| 'action.toggle-reduce-motion.menu'\n\t| 'action.toggle-snap-mode'\n\t| 'action.toggle-snap-mode.menu'\n\t| 'action.toggle-tool-lock'\n\t| 'action.toggle-tool-lock.menu'\n\t| 'action.toggle-trackpad'\n\t| 'action.toggle-transparent'\n\t| 'action.toggle-transparent.context-menu'\n\t| 'action.toggle-transparent.menu'\n\t| 'action.toggle-wrap-mode'\n\t| 'action.toggle-wrap-mode.menu'\n\t| 'action.undo'\n\t| 'action.ungroup'\n\t| 'action.unlock-all'\n\t| 'action.zoom-in'\n\t| 'action.zoom-out'\n\t| 'action.zoom-quick'\n\t| 'action.zoom-to-100'\n\t| 'action.zoom-to-fit'\n\t| 'action.zoom-to-selection'\n\t| 'actions-menu.title'\n\t| 'align-style.end'\n\t| 'align-style.justify'\n\t| 'align-style.middle'\n\t| 'align-style.start'\n\t| 'app.loading'\n\t| 'arrow-kind-style.arc'\n\t| 'arrow-kind-style.elbow'\n\t| 'arrowheadEnd-style.arrow'\n\t| 'arrowheadEnd-style.bar'\n\t| 'arrowheadEnd-style.diamond'\n\t| 'arrowheadEnd-style.dot'\n\t| 'arrowheadEnd-style.inverted'\n\t| 'arrowheadEnd-style.none'\n\t| 'arrowheadEnd-style.pipe'\n\t| 'arrowheadEnd-style.square'\n\t| 'arrowheadEnd-style.triangle'\n\t| 'arrowheadStart-style.arrow'\n\t| 'arrowheadStart-style.bar'\n\t| 'arrowheadStart-style.diamond'\n\t| 'arrowheadStart-style.dot'\n\t| 'arrowheadStart-style.inverted'\n\t| 'arrowheadStart-style.none'\n\t| 'arrowheadStart-style.pipe'\n\t| 'arrowheadStart-style.square'\n\t| 'arrowheadStart-style.triangle'\n\t| 'assets.files.amount-too-many'\n\t| 'assets.files.maximum-size'\n\t| 'assets.files.size-too-big'\n\t| 'assets.files.type-not-allowed'\n\t| 'assets.files.upload-failed'\n\t| 'assets.url.failed'\n\t| 'color-style.black'\n\t| 'color-style.blue'\n\t| 'color-style.green'\n\t| 'color-style.grey'\n\t| 'color-style.light-blue'\n\t| 'color-style.light-green'\n\t| 'color-style.light-red'\n\t| 'color-style.light-violet'\n\t| 'color-style.orange'\n\t| 'color-style.red'\n\t| 'color-style.violet'\n\t| 'color-style.white'\n\t| 'color-style.yellow'\n\t| 'comments.add-placeholder'\n\t| 'comments.add-reaction'\n\t| 'comments.cluster-label'\n\t| 'comments.copy-link'\n\t| 'comments.delete'\n\t| 'comments.dismiss'\n\t| 'comments.edit'\n\t| 'comments.edit-placeholder'\n\t| 'comments.empty'\n\t| 'comments.empty-filtered'\n\t| 'comments.filter'\n\t| 'comments.hide'\n\t| 'comments.link-copied'\n\t| 'comments.mention-no-matches'\n\t| 'comments.mention-you'\n\t| 'comments.more-options'\n\t| 'comments.only-my-comments'\n\t| 'comments.only-unread'\n\t| 'comments.pin-label'\n\t| 'comments.pin-label-resolved'\n\t| 'comments.preview-more'\n\t| 'comments.reacted'\n\t| 'comments.reopen'\n\t| 'comments.replies'\n\t| 'comments.reply-placeholder'\n\t| 'comments.resolve'\n\t| 'comments.resolved'\n\t| 'comments.resolved-by'\n\t| 'comments.save'\n\t| 'comments.send'\n\t| 'comments.show'\n\t| 'comments.show-all-pages'\n\t| 'comments.show-resolved'\n\t| 'comments.stack-label'\n\t| 'comments.thread-title'\n\t| 'comments.title'\n\t| 'comments.unknown-author'\n\t| 'context-menu.arrange'\n\t| 'context-menu.copy-as'\n\t| 'context-menu.edit'\n\t| 'context-menu.export-all-as'\n\t| 'context-menu.export-as'\n\t| 'context-menu.move-to-page'\n\t| 'context-menu.reorder'\n\t| 'context-menu.title'\n\t| 'context.pages.new-page'\n\t| 'cursor-chat.type-to-chat'\n\t| 'dash-style.dashed'\n\t| 'dash-style.dotted'\n\t| 'dash-style.draw'\n\t| 'dash-style.solid'\n\t| 'document.default-name'\n\t| 'edit-link-dialog.cancel'\n\t| 'edit-link-dialog.clear'\n\t| 'edit-link-dialog.detail'\n\t| 'edit-link-dialog.invalid-url'\n\t| 'edit-link-dialog.save'\n\t| 'edit-link-dialog.title'\n\t| 'edit-link-dialog.url'\n\t| 'embed-dialog.back'\n\t| 'embed-dialog.cancel'\n\t| 'embed-dialog.create'\n\t| 'embed-dialog.instruction'\n\t| 'embed-dialog.invalid-url'\n\t| 'embed-dialog.learn-more'\n\t| 'embed-dialog.title'\n\t| 'embed-dialog.url'\n\t| 'error.cancel'\n\t| 'error.confirm-reset.description'\n\t| 'error.confirm-reset.title'\n\t| 'error.copied'\n\t| 'error.copy'\n\t| 'error.hide-details'\n\t| 'error.message-label'\n\t| 'error.note-label'\n\t| 'error.refresh-hint'\n\t| 'error.refresh-page'\n\t| 'error.reset-data'\n\t| 'error.reset-hint'\n\t| 'error.reset-note'\n\t| 'error.show-details'\n\t| 'error.stack-trace-label'\n\t| 'error.title'\n\t| 'file-system.confirm-open.cancel'\n\t| 'file-system.confirm-open.description'\n\t| 'file-system.confirm-open.open'\n\t| 'file-system.confirm-open.title'\n\t| 'file-system.file-open-error.file-format-version-too-new'\n\t| 'file-system.file-open-error.generic-corrupted-file'\n\t| 'file-system.file-open-error.not-a-tldraw-file'\n\t| 'file-system.file-open-error.title'\n\t| 'file-system.shared-document-file-open-error.description'\n\t| 'file-system.shared-document-file-open-error.title'\n\t| 'fill-style.fill'\n\t| 'fill-style.lined-fill'\n\t| 'fill-style.none'\n\t| 'fill-style.pattern'\n\t| 'fill-style.semi'\n\t| 'fill-style.solid'\n\t| 'focus-mode.toggle-focus-mode'\n\t| 'font-style.draw'\n\t| 'font-style.mono'\n\t| 'font-style.sans'\n\t| 'font-style.serif'\n\t| 'geo-style.arrow-down'\n\t| 'geo-style.arrow-left'\n\t| 'geo-style.arrow-right'\n\t| 'geo-style.arrow-up'\n\t| 'geo-style.check-box'\n\t| 'geo-style.cloud'\n\t| 'geo-style.diamond'\n\t| 'geo-style.ellipse'\n\t| 'geo-style.heart'\n\t| 'geo-style.hexagon'\n\t| 'geo-style.octagon'\n\t| 'geo-style.oval'\n\t| 'geo-style.pentagon'\n\t| 'geo-style.rectangle'\n\t| 'geo-style.rhombus'\n\t| 'geo-style.rhombus-2'\n\t| 'geo-style.star'\n\t| 'geo-style.trapezoid'\n\t| 'geo-style.triangle'\n\t| 'geo-style.x-box'\n\t| 'help-menu.about'\n\t| 'help-menu.discord'\n\t| 'help-menu.github'\n\t| 'help-menu.keyboard-shortcuts'\n\t| 'help-menu.privacy'\n\t| 'help-menu.terms'\n\t| 'help-menu.title'\n\t| 'help-menu.twitter'\n\t| 'menu.accessibility'\n\t| 'menu.edit'\n\t| 'menu.input-device'\n\t| 'menu.language'\n\t| 'menu.preferences'\n\t| 'menu.theme'\n\t| 'menu.title'\n\t| 'menu.view'\n\t| 'navigation-zone.minimap'\n\t| 'navigation-zone.title'\n\t| 'navigation-zone.toggle-minimap'\n\t| 'navigation-zone.zoom'\n\t| 'opacity-style.0.1'\n\t| 'opacity-style.0.25'\n\t| 'opacity-style.0.5'\n\t| 'opacity-style.0.75'\n\t| 'opacity-style.1'\n\t| 'page-menu.create-new-page'\n\t| 'page-menu.go-to-page'\n\t| 'page-menu.max-pages-reached'\n\t| 'page-menu.new-page-initial-name'\n\t| 'page-menu.resize'\n\t| 'page-menu.submenu.delete'\n\t| 'page-menu.submenu.duplicate-page'\n\t| 'page-menu.submenu.move-down'\n\t| 'page-menu.submenu.move-up'\n\t| 'page-menu.submenu.rename'\n\t| 'page-menu.submenu.title'\n\t| 'people-menu.anonymous-user'\n\t| 'people-menu.avatar-color'\n\t| 'people-menu.change-color'\n\t| 'people-menu.change-name'\n\t| 'people-menu.follow'\n\t| 'people-menu.following'\n\t| 'people-menu.leading'\n\t| 'people-menu.title'\n\t| 'people-menu.user'\n\t| 'shortcuts-dialog.a11y'\n\t| 'shortcuts-dialog.collaboration'\n\t| 'shortcuts-dialog.disabled-notice'\n\t| 'shortcuts-dialog.edit'\n\t| 'shortcuts-dialog.preferences'\n\t| 'shortcuts-dialog.text-formatting'\n\t| 'shortcuts-dialog.title'\n\t| 'shortcuts-dialog.tools'\n\t| 'shortcuts-dialog.transform'\n\t| 'shortcuts-dialog.view'\n\t| 'size-style.l'\n\t| 'size-style.m'\n\t| 'size-style.s'\n\t| 'size-style.xl'\n\t| 'spline-style.cubic'\n\t| 'spline-style.line'\n\t| 'status.offline'\n\t| 'style-panel.align'\n\t| 'style-panel.arrow-kind'\n\t| 'style-panel.arrowhead-end'\n\t| 'style-panel.arrowhead-start'\n\t| 'style-panel.arrowheads'\n\t| 'style-panel.color'\n\t| 'style-panel.dash'\n\t| 'style-panel.fill'\n\t| 'style-panel.font'\n\t| 'style-panel.geo'\n\t| 'style-panel.label-align'\n\t| 'style-panel.mixed'\n\t| 'style-panel.opacity'\n\t| 'style-panel.position'\n\t| 'style-panel.selected'\n\t| 'style-panel.size'\n\t| 'style-panel.spline'\n\t| 'style-panel.title'\n\t| 'style-panel.vertical-align'\n\t| 'theme.dark'\n\t| 'theme.light'\n\t| 'theme.system'\n\t| 'toast.close'\n\t| 'toast.error'\n\t| 'toast.error.copy-fail.desc'\n\t| 'toast.error.copy-fail.title'\n\t| 'toast.error.export-fail.desc'\n\t| 'toast.error.export-fail.title'\n\t| 'toast.info'\n\t| 'toast.moved-to-page.action'\n\t| 'toast.moved-to-page.desc'\n\t| 'toast.moved-to-page.title'\n\t| 'toast.success'\n\t| 'toast.warning'\n\t| 'tool-panel.more'\n\t| 'tool-panel.title'\n\t| 'tool.arrow'\n\t| 'tool.arrow-down'\n\t| 'tool.arrow-left'\n\t| 'tool.arrow-right'\n\t| 'tool.arrow-up'\n\t| 'tool.aspect-ratio'\n\t| 'tool.aspect-ratio.circle'\n\t| 'tool.aspect-ratio.landscape'\n\t| 'tool.aspect-ratio.original'\n\t| 'tool.aspect-ratio.portrait'\n\t| 'tool.aspect-ratio.square'\n\t| 'tool.aspect-ratio.wide'\n\t| 'tool.bookmark'\n\t| 'tool.check-box'\n\t| 'tool.cloud'\n\t| 'tool.comment'\n\t| 'tool.diamond'\n\t| 'tool.draw'\n\t| 'tool.ellipse'\n\t| 'tool.embed'\n\t| 'tool.eraser'\n\t| 'tool.frame'\n\t| 'tool.hand'\n\t| 'tool.heart'\n\t| 'tool.hexagon'\n\t| 'tool.highlight'\n\t| 'tool.image-crop'\n\t| 'tool.image-crop-confirm'\n\t| 'tool.image-toolbar-title'\n\t| 'tool.image-zoom'\n\t| 'tool.laser'\n\t| 'tool.line'\n\t| 'tool.media'\n\t| 'tool.media-alt-text'\n\t| 'tool.media-alt-text-confirm'\n\t| 'tool.media-alt-text-desc'\n\t| 'tool.note'\n\t| 'tool.octagon'\n\t| 'tool.oval'\n\t| 'tool.pentagon'\n\t| 'tool.pointer-down'\n\t| 'tool.rectangle'\n\t| 'tool.replace-media'\n\t| 'tool.rhombus'\n\t| 'tool.rhombus-2'\n\t| 'tool.rich-text-bold'\n\t| 'tool.rich-text-bulletList'\n\t| 'tool.rich-text-code'\n\t| 'tool.rich-text-header'\n\t| 'tool.rich-text-highlight'\n\t| 'tool.rich-text-italic'\n\t| 'tool.rich-text-link'\n\t| 'tool.rich-text-link-remove'\n\t| 'tool.rich-text-link-visit'\n\t| 'tool.rich-text-orderedList'\n\t| 'tool.rich-text-strikethrough'\n\t| 'tool.rich-text-toolbar-title'\n\t| 'tool.select'\n\t| 'tool.star'\n\t| 'tool.text'\n\t| 'tool.trapezoid'\n\t| 'tool.triangle'\n\t| 'tool.video-toolbar-title'\n\t| 'tool.x-box'\n\t| 'ui.checked'\n\t| 'ui.close'\n\t| 'ui.unchecked'\n\t| 'verticalAlign-style.end'\n\t| 'verticalAlign-style.middle'\n\t| 'verticalAlign-style.start'\n\t| 'vscode.file-open.backup'\n\t| 'vscode.file-open.backup-failed'\n\t| 'vscode.file-open.backup-saved'\n\t| 'vscode.file-open.desc'\n\t| 'vscode.file-open.dont-show-again'\n\t| 'vscode.file-open.open'\n"],
|
|
4
|
+
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\n/** @public */\nexport type TLUiTranslationKey =\n\t| 'a11y.adjust-shape-styles'\n\t| 'a11y.enlarge-shape'\n\t| 'a11y.enter-leave-container'\n\t| 'a11y.move-shape'\n\t| 'a11y.move-shape-faster'\n\t| 'a11y.multiple-shapes'\n\t| 'a11y.open-context-menu'\n\t| 'a11y.open-keyboard-shortcuts'\n\t| 'a11y.pan-camera'\n\t| 'a11y.repeat-shape'\n\t| 'a11y.rotate-shape-ccw'\n\t| 'a11y.rotate-shape-ccw-fine'\n\t| 'a11y.rotate-shape-cw'\n\t| 'a11y.rotate-shape-cw-fine'\n\t| 'a11y.select-shape'\n\t| 'a11y.select-shape-direction'\n\t| 'a11y.shape-image'\n\t| 'a11y.shape-index'\n\t| 'a11y.shape-video'\n\t| 'a11y.shrink-shape'\n\t| 'a11y.skip-to-main-content'\n\t| 'a11y.status'\n\t| 'action.align-bottom'\n\t| 'action.align-center-horizontal'\n\t| 'action.align-center-horizontal.short'\n\t| 'action.align-center-vertical'\n\t| 'action.align-center-vertical.short'\n\t| 'action.align-left'\n\t| 'action.align-right'\n\t| 'action.align-top'\n\t| 'action.back-to-content'\n\t| 'action.bring-forward'\n\t| 'action.bring-to-front'\n\t| 'action.convert-to-bookmark'\n\t| 'action.convert-to-embed'\n\t| 'action.copy'\n\t| 'action.copy-as-json'\n\t| 'action.copy-as-json.short'\n\t| 'action.copy-as-png'\n\t| 'action.copy-as-png.short'\n\t| 'action.copy-as-svg'\n\t| 'action.copy-as-svg.short'\n\t| 'action.copy-hovered-styles'\n\t| 'action.cut'\n\t| 'action.delete'\n\t| 'action.distribute-horizontal'\n\t| 'action.distribute-horizontal.short'\n\t| 'action.distribute-vertical'\n\t| 'action.distribute-vertical.short'\n\t| 'action.download-original'\n\t| 'action.duplicate'\n\t| 'action.edit-link'\n\t| 'action.enhanced-a11y-mode'\n\t| 'action.enhanced-a11y-mode.menu'\n\t| 'action.exit-pen-mode'\n\t| 'action.export-all-as-png'\n\t| 'action.export-all-as-png.short'\n\t| 'action.export-all-as-svg'\n\t| 'action.export-all-as-svg.short'\n\t| 'action.export-as-png'\n\t| 'action.export-as-png.short'\n\t| 'action.export-as-svg'\n\t| 'action.export-as-svg.short'\n\t| 'action.fit-frame-to-content'\n\t| 'action.flatten-to-image'\n\t| 'action.flip-horizontal'\n\t| 'action.flip-horizontal.short'\n\t| 'action.flip-vertical'\n\t| 'action.flip-vertical.short'\n\t| 'action.frame-selection'\n\t| 'action.group'\n\t| 'action.insert-embed'\n\t| 'action.insert-media'\n\t| 'action.open-cursor-chat'\n\t| 'action.open-embed-link'\n\t| 'action.open-kbd-shortcuts'\n\t| 'action.pack'\n\t| 'action.paste'\n\t| 'action.paste-error-description'\n\t| 'action.paste-error-title'\n\t| 'action.print'\n\t| 'action.redo'\n\t| 'action.remove-frame'\n\t| 'action.rename'\n\t| 'action.rotate-ccw'\n\t| 'action.rotate-cw'\n\t| 'action.save-copy'\n\t| 'action.select-all'\n\t| 'action.select-none'\n\t| 'action.select-zoom-tool'\n\t| 'action.send-backward'\n\t| 'action.send-to-back'\n\t| 'action.stack-horizontal'\n\t| 'action.stack-horizontal.short'\n\t| 'action.stack-vertical'\n\t| 'action.stack-vertical.short'\n\t| 'action.stop-following'\n\t| 'action.stretch-horizontal'\n\t| 'action.stretch-horizontal.short'\n\t| 'action.stretch-vertical'\n\t| 'action.stretch-vertical.short'\n\t| 'action.toggle-auto-none'\n\t| 'action.toggle-auto-pan'\n\t| 'action.toggle-auto-size'\n\t| 'action.toggle-auto-zoom'\n\t| 'action.toggle-dark-mode'\n\t| 'action.toggle-dark-mode.menu'\n\t| 'action.toggle-debug-mode'\n\t| 'action.toggle-debug-mode.menu'\n\t| 'action.toggle-dynamic-size-mode'\n\t| 'action.toggle-dynamic-size-mode.menu'\n\t| 'action.toggle-edge-scrolling'\n\t| 'action.toggle-edge-scrolling.menu'\n\t| 'action.toggle-focus-mode'\n\t| 'action.toggle-focus-mode.menu'\n\t| 'action.toggle-grid'\n\t| 'action.toggle-grid.menu'\n\t| 'action.toggle-invert-zoom'\n\t| 'action.toggle-invert-zoom.menu'\n\t| 'action.toggle-keyboard-shortcuts'\n\t| 'action.toggle-keyboard-shortcuts.menu'\n\t| 'action.toggle-lock'\n\t| 'action.toggle-mouse'\n\t| 'action.toggle-paste-at-cursor'\n\t| 'action.toggle-paste-at-cursor.menu'\n\t| 'action.toggle-reduce-motion'\n\t| 'action.toggle-reduce-motion.menu'\n\t| 'action.toggle-snap-mode'\n\t| 'action.toggle-snap-mode.menu'\n\t| 'action.toggle-tool-lock'\n\t| 'action.toggle-tool-lock.menu'\n\t| 'action.toggle-trackpad'\n\t| 'action.toggle-transparent'\n\t| 'action.toggle-transparent.context-menu'\n\t| 'action.toggle-transparent.menu'\n\t| 'action.toggle-wrap-mode'\n\t| 'action.toggle-wrap-mode.menu'\n\t| 'action.undo'\n\t| 'action.ungroup'\n\t| 'action.unlock-all'\n\t| 'action.zoom-in'\n\t| 'action.zoom-out'\n\t| 'action.zoom-quick'\n\t| 'action.zoom-to-100'\n\t| 'action.zoom-to-fit'\n\t| 'action.zoom-to-selection'\n\t| 'actions-menu.title'\n\t| 'align-style.end'\n\t| 'align-style.justify'\n\t| 'align-style.middle'\n\t| 'align-style.start'\n\t| 'app.loading'\n\t| 'arrow-kind-style.arc'\n\t| 'arrow-kind-style.elbow'\n\t| 'arrowheadEnd-style.arrow'\n\t| 'arrowheadEnd-style.bar'\n\t| 'arrowheadEnd-style.diamond'\n\t| 'arrowheadEnd-style.dot'\n\t| 'arrowheadEnd-style.inverted'\n\t| 'arrowheadEnd-style.none'\n\t| 'arrowheadEnd-style.pipe'\n\t| 'arrowheadEnd-style.square'\n\t| 'arrowheadEnd-style.triangle'\n\t| 'arrowheadStart-style.arrow'\n\t| 'arrowheadStart-style.bar'\n\t| 'arrowheadStart-style.diamond'\n\t| 'arrowheadStart-style.dot'\n\t| 'arrowheadStart-style.inverted'\n\t| 'arrowheadStart-style.none'\n\t| 'arrowheadStart-style.pipe'\n\t| 'arrowheadStart-style.square'\n\t| 'arrowheadStart-style.triangle'\n\t| 'assets.files.amount-too-many'\n\t| 'assets.files.maximum-size'\n\t| 'assets.files.size-too-big'\n\t| 'assets.files.type-not-allowed'\n\t| 'assets.files.upload-failed'\n\t| 'assets.url.failed'\n\t| 'color-style.black'\n\t| 'color-style.blue'\n\t| 'color-style.green'\n\t| 'color-style.grey'\n\t| 'color-style.light-blue'\n\t| 'color-style.light-green'\n\t| 'color-style.light-red'\n\t| 'color-style.light-violet'\n\t| 'color-style.orange'\n\t| 'color-style.red'\n\t| 'color-style.violet'\n\t| 'color-style.white'\n\t| 'color-style.yellow'\n\t| 'comments.add-placeholder'\n\t| 'comments.add-reaction'\n\t| 'comments.cluster-label'\n\t| 'comments.copy-link'\n\t| 'comments.delete'\n\t| 'comments.dismiss'\n\t| 'comments.edit'\n\t| 'comments.edit-placeholder'\n\t| 'comments.empty'\n\t| 'comments.empty-filtered'\n\t| 'comments.filter'\n\t| 'comments.hide'\n\t| 'comments.link-copied'\n\t| 'comments.mention-no-matches'\n\t| 'comments.mention-you'\n\t| 'comments.more-options'\n\t| 'comments.only-my-comments'\n\t| 'comments.only-unread'\n\t| 'comments.pin-label'\n\t| 'comments.pin-label-resolved'\n\t| 'comments.preview-more'\n\t| 'comments.reacted'\n\t| 'comments.reopen'\n\t| 'comments.replies'\n\t| 'comments.reply-placeholder'\n\t| 'comments.resolve'\n\t| 'comments.resolved'\n\t| 'comments.resolved-by'\n\t| 'comments.save'\n\t| 'comments.send'\n\t| 'comments.show'\n\t| 'comments.show-all-pages'\n\t| 'comments.show-resolved'\n\t| 'comments.stack-label'\n\t| 'comments.thread-title'\n\t| 'comments.title'\n\t| 'comments.unknown-author'\n\t| 'confirm-open-link-dialog.cancel'\n\t| 'confirm-open-link-dialog.detail'\n\t| 'confirm-open-link-dialog.open'\n\t| 'confirm-open-link-dialog.title'\n\t| 'context-menu.arrange'\n\t| 'context-menu.copy-as'\n\t| 'context-menu.edit'\n\t| 'context-menu.export-all-as'\n\t| 'context-menu.export-as'\n\t| 'context-menu.move-to-page'\n\t| 'context-menu.reorder'\n\t| 'context-menu.title'\n\t| 'context.pages.new-page'\n\t| 'cursor-chat.type-to-chat'\n\t| 'dash-style.dashed'\n\t| 'dash-style.dotted'\n\t| 'dash-style.draw'\n\t| 'dash-style.solid'\n\t| 'document.default-name'\n\t| 'edit-link-dialog.cancel'\n\t| 'edit-link-dialog.clear'\n\t| 'edit-link-dialog.detail'\n\t| 'edit-link-dialog.invalid-url'\n\t| 'edit-link-dialog.save'\n\t| 'edit-link-dialog.title'\n\t| 'edit-link-dialog.url'\n\t| 'embed-dialog.back'\n\t| 'embed-dialog.cancel'\n\t| 'embed-dialog.create'\n\t| 'embed-dialog.instruction'\n\t| 'embed-dialog.invalid-url'\n\t| 'embed-dialog.learn-more'\n\t| 'embed-dialog.title'\n\t| 'embed-dialog.url'\n\t| 'error.cancel'\n\t| 'error.confirm-reset.description'\n\t| 'error.confirm-reset.title'\n\t| 'error.copied'\n\t| 'error.copy'\n\t| 'error.hide-details'\n\t| 'error.message-label'\n\t| 'error.note-label'\n\t| 'error.refresh-hint'\n\t| 'error.refresh-page'\n\t| 'error.reset-data'\n\t| 'error.reset-hint'\n\t| 'error.reset-note'\n\t| 'error.show-details'\n\t| 'error.stack-trace-label'\n\t| 'error.title'\n\t| 'file-system.confirm-open.cancel'\n\t| 'file-system.confirm-open.description'\n\t| 'file-system.confirm-open.open'\n\t| 'file-system.confirm-open.title'\n\t| 'file-system.file-open-error.file-format-version-too-new'\n\t| 'file-system.file-open-error.generic-corrupted-file'\n\t| 'file-system.file-open-error.not-a-tldraw-file'\n\t| 'file-system.file-open-error.title'\n\t| 'file-system.shared-document-file-open-error.description'\n\t| 'file-system.shared-document-file-open-error.title'\n\t| 'fill-style.fill'\n\t| 'fill-style.lined-fill'\n\t| 'fill-style.none'\n\t| 'fill-style.pattern'\n\t| 'fill-style.semi'\n\t| 'fill-style.solid'\n\t| 'focus-mode.toggle-focus-mode'\n\t| 'font-style.draw'\n\t| 'font-style.mono'\n\t| 'font-style.sans'\n\t| 'font-style.serif'\n\t| 'geo-style.arrow-down'\n\t| 'geo-style.arrow-left'\n\t| 'geo-style.arrow-right'\n\t| 'geo-style.arrow-up'\n\t| 'geo-style.check-box'\n\t| 'geo-style.cloud'\n\t| 'geo-style.diamond'\n\t| 'geo-style.ellipse'\n\t| 'geo-style.heart'\n\t| 'geo-style.hexagon'\n\t| 'geo-style.octagon'\n\t| 'geo-style.oval'\n\t| 'geo-style.pentagon'\n\t| 'geo-style.rectangle'\n\t| 'geo-style.rhombus'\n\t| 'geo-style.rhombus-2'\n\t| 'geo-style.star'\n\t| 'geo-style.trapezoid'\n\t| 'geo-style.triangle'\n\t| 'geo-style.x-box'\n\t| 'help-menu.about'\n\t| 'help-menu.discord'\n\t| 'help-menu.github'\n\t| 'help-menu.keyboard-shortcuts'\n\t| 'help-menu.privacy'\n\t| 'help-menu.terms'\n\t| 'help-menu.title'\n\t| 'help-menu.twitter'\n\t| 'menu.accessibility'\n\t| 'menu.edit'\n\t| 'menu.input-device'\n\t| 'menu.language'\n\t| 'menu.preferences'\n\t| 'menu.theme'\n\t| 'menu.title'\n\t| 'menu.view'\n\t| 'navigation-zone.minimap'\n\t| 'navigation-zone.title'\n\t| 'navigation-zone.toggle-minimap'\n\t| 'navigation-zone.zoom'\n\t| 'opacity-style.0.1'\n\t| 'opacity-style.0.25'\n\t| 'opacity-style.0.5'\n\t| 'opacity-style.0.75'\n\t| 'opacity-style.1'\n\t| 'page-menu.create-new-page'\n\t| 'page-menu.go-to-page'\n\t| 'page-menu.max-pages-reached'\n\t| 'page-menu.new-page-initial-name'\n\t| 'page-menu.resize'\n\t| 'page-menu.submenu.delete'\n\t| 'page-menu.submenu.duplicate-page'\n\t| 'page-menu.submenu.move-down'\n\t| 'page-menu.submenu.move-up'\n\t| 'page-menu.submenu.rename'\n\t| 'page-menu.submenu.title'\n\t| 'people-menu.anonymous-user'\n\t| 'people-menu.avatar-color'\n\t| 'people-menu.change-color'\n\t| 'people-menu.change-name'\n\t| 'people-menu.follow'\n\t| 'people-menu.following'\n\t| 'people-menu.leading'\n\t| 'people-menu.title'\n\t| 'people-menu.user'\n\t| 'shortcuts-dialog.a11y'\n\t| 'shortcuts-dialog.collaboration'\n\t| 'shortcuts-dialog.disabled-notice'\n\t| 'shortcuts-dialog.edit'\n\t| 'shortcuts-dialog.preferences'\n\t| 'shortcuts-dialog.text-formatting'\n\t| 'shortcuts-dialog.title'\n\t| 'shortcuts-dialog.tools'\n\t| 'shortcuts-dialog.transform'\n\t| 'shortcuts-dialog.view'\n\t| 'size-style.l'\n\t| 'size-style.m'\n\t| 'size-style.s'\n\t| 'size-style.xl'\n\t| 'spline-style.cubic'\n\t| 'spline-style.line'\n\t| 'status.offline'\n\t| 'style-panel.align'\n\t| 'style-panel.arrow-kind'\n\t| 'style-panel.arrowhead-end'\n\t| 'style-panel.arrowhead-start'\n\t| 'style-panel.arrowheads'\n\t| 'style-panel.color'\n\t| 'style-panel.dash'\n\t| 'style-panel.fill'\n\t| 'style-panel.font'\n\t| 'style-panel.geo'\n\t| 'style-panel.label-align'\n\t| 'style-panel.mixed'\n\t| 'style-panel.opacity'\n\t| 'style-panel.position'\n\t| 'style-panel.selected'\n\t| 'style-panel.size'\n\t| 'style-panel.spline'\n\t| 'style-panel.title'\n\t| 'style-panel.vertical-align'\n\t| 'theme.dark'\n\t| 'theme.light'\n\t| 'theme.system'\n\t| 'toast.close'\n\t| 'toast.error'\n\t| 'toast.error.copy-fail.desc'\n\t| 'toast.error.copy-fail.title'\n\t| 'toast.error.export-fail.desc'\n\t| 'toast.error.export-fail.title'\n\t| 'toast.info'\n\t| 'toast.moved-to-page.action'\n\t| 'toast.moved-to-page.desc'\n\t| 'toast.moved-to-page.title'\n\t| 'toast.success'\n\t| 'toast.warning'\n\t| 'tool-panel.more'\n\t| 'tool-panel.title'\n\t| 'tool.arrow'\n\t| 'tool.arrow-down'\n\t| 'tool.arrow-left'\n\t| 'tool.arrow-right'\n\t| 'tool.arrow-up'\n\t| 'tool.aspect-ratio'\n\t| 'tool.aspect-ratio.circle'\n\t| 'tool.aspect-ratio.landscape'\n\t| 'tool.aspect-ratio.original'\n\t| 'tool.aspect-ratio.portrait'\n\t| 'tool.aspect-ratio.square'\n\t| 'tool.aspect-ratio.wide'\n\t| 'tool.bookmark'\n\t| 'tool.check-box'\n\t| 'tool.cloud'\n\t| 'tool.comment'\n\t| 'tool.diamond'\n\t| 'tool.draw'\n\t| 'tool.ellipse'\n\t| 'tool.embed'\n\t| 'tool.eraser'\n\t| 'tool.frame'\n\t| 'tool.hand'\n\t| 'tool.heart'\n\t| 'tool.hexagon'\n\t| 'tool.highlight'\n\t| 'tool.image-crop'\n\t| 'tool.image-crop-confirm'\n\t| 'tool.image-toolbar-title'\n\t| 'tool.image-zoom'\n\t| 'tool.laser'\n\t| 'tool.line'\n\t| 'tool.media'\n\t| 'tool.media-alt-text'\n\t| 'tool.media-alt-text-confirm'\n\t| 'tool.media-alt-text-desc'\n\t| 'tool.note'\n\t| 'tool.octagon'\n\t| 'tool.oval'\n\t| 'tool.pentagon'\n\t| 'tool.pointer-down'\n\t| 'tool.rectangle'\n\t| 'tool.replace-media'\n\t| 'tool.rhombus'\n\t| 'tool.rhombus-2'\n\t| 'tool.rich-text-bold'\n\t| 'tool.rich-text-bulletList'\n\t| 'tool.rich-text-code'\n\t| 'tool.rich-text-header'\n\t| 'tool.rich-text-highlight'\n\t| 'tool.rich-text-italic'\n\t| 'tool.rich-text-link'\n\t| 'tool.rich-text-link-remove'\n\t| 'tool.rich-text-link-visit'\n\t| 'tool.rich-text-orderedList'\n\t| 'tool.rich-text-strikethrough'\n\t| 'tool.rich-text-toolbar-title'\n\t| 'tool.select'\n\t| 'tool.star'\n\t| 'tool.text'\n\t| 'tool.trapezoid'\n\t| 'tool.triangle'\n\t| 'tool.video-toolbar-title'\n\t| 'tool.x-box'\n\t| 'ui.checked'\n\t| 'ui.close'\n\t| 'ui.unchecked'\n\t| 'verticalAlign-style.end'\n\t| 'verticalAlign-style.middle'\n\t| 'verticalAlign-style.start'\n\t| 'vscode.file-open.backup'\n\t| 'vscode.file-open.backup-failed'\n\t| 'vscode.file-open.backup-saved'\n\t| 'vscode.file-open.desc'\n\t| 'vscode.file-open.dont-show-again'\n\t| 'vscode.file-open.open'\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -22,10 +22,10 @@ __export(version_exports, {
|
|
|
22
22
|
version: () => version
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(version_exports);
|
|
25
|
-
const version = "5.6.
|
|
25
|
+
const version = "5.6.2";
|
|
26
26
|
const publishDates = {
|
|
27
27
|
major: "2026-05-06T16:28:18.473Z",
|
|
28
28
|
minor: "2026-10-28T14:20:57.238Z",
|
|
29
|
-
patch: "2026-
|
|
29
|
+
patch: "2026-11-20T13:16:37.205Z"
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/ui/version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.6.
|
|
4
|
+
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '5.6.2'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-10-28T14:20:57.238Z',\n\tpatch: '2026-11-20T13:16:37.205Z',\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var linkUrl_exports = {};
|
|
20
|
+
__export(linkUrl_exports, {
|
|
21
|
+
normalizeLinkUrl: () => normalizeLinkUrl
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(linkUrl_exports);
|
|
24
|
+
var import_editor = require("@tldraw/editor");
|
|
25
|
+
const emailRegex = /^[^\s@/:]+@[^\s@/:]+\.[^\s@/:]+$/;
|
|
26
|
+
function normalizeLinkUrl(input) {
|
|
27
|
+
const url = input.trim().replace(/^https?:\/\/(https?:\/\/)/i, "$1");
|
|
28
|
+
if (import_editor.T.linkUrl.isValid(url)) return url;
|
|
29
|
+
if (emailRegex.test(url)) return `mailto:${url}`;
|
|
30
|
+
const withProtocol = `https://${url}`;
|
|
31
|
+
if (!import_editor.T.linkUrl.isValid(withProtocol)) return null;
|
|
32
|
+
const { hostname, username } = new URL(withProtocol);
|
|
33
|
+
if (username) return null;
|
|
34
|
+
if (hostname === "localhost" || hostname.startsWith("[") || /[^.]\.[^.]+$/.test(hostname)) {
|
|
35
|
+
return withProtocol;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=linkUrl.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/utils/linkUrl.ts"],
|
|
4
|
+
"sourcesContent": ["import { T } from '@tldraw/editor'\n\nconst emailRegex = /^[^\\s@/:]+@[^\\s@/:]+\\.[^\\s@/:]+$/\n\n/**\n * Turn what a user typed into a link field into the url to store, or null if it isn't a link.\n *\n * - Anything `T.linkUrl` accepts is kept as typed, so `mailto:` and app links (`vscode://\u2026`)\n * are never rewritten.\n * - An email address becomes a `mailto:` link.\n * - A bare host (`example.com`, `localhost:3000`) gets `https://`. A word with no dot, like\n * `hello`, is not treated as a host, or every typo would become a dead `https://hello` link.\n * - The empty string means \"no link\".\n */\nexport function normalizeLinkUrl(input: string): string | null {\n\t// Pasting a url into a field that already holds `https://` doubles the protocol.\n\tconst url = input.trim().replace(/^https?:\\/\\/(https?:\\/\\/)/i, '$1')\n\n\tif (T.linkUrl.isValid(url)) return url\n\tif (emailRegex.test(url)) return `mailto:${url}`\n\n\tconst withProtocol = `https://${url}`\n\tif (!T.linkUrl.isValid(withProtocol)) return null\n\tconst { hostname, username } = new URL(withProtocol)\n\tif (username) return null\n\tif (hostname === 'localhost' || hostname.startsWith('[') || /[^.]\\.[^.]+$/.test(hostname)) {\n\t\treturn withProtocol\n\t}\n\treturn null\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkB;AAElB,MAAM,aAAa;AAYZ,SAAS,iBAAiB,OAA8B;AAE9D,QAAM,MAAM,MAAM,KAAK,EAAE,QAAQ,8BAA8B,IAAI;AAEnE,MAAI,gBAAE,QAAQ,QAAQ,GAAG,EAAG,QAAO;AACnC,MAAI,WAAW,KAAK,GAAG,EAAG,QAAO,UAAU,GAAG;AAE9C,QAAM,eAAe,WAAW,GAAG;AACnC,MAAI,CAAC,gBAAE,QAAQ,QAAQ,YAAY,EAAG,QAAO;AAC7C,QAAM,EAAE,UAAU,SAAS,IAAI,IAAI,IAAI,YAAY;AACnD,MAAI,SAAU,QAAO;AACrB,MAAI,aAAa,eAAe,SAAS,WAAW,GAAG,KAAK,eAAe,KAAK,QAAQ,GAAG;AAC1F,WAAO;AAAA,EACR;AACA,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var openLink_exports = {};
|
|
20
|
+
__export(openLink_exports, {
|
|
21
|
+
getLinkOpenPolicy: () => getLinkOpenPolicy,
|
|
22
|
+
openLink: () => openLink
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(openLink_exports);
|
|
25
|
+
var import_editor = require("@tldraw/editor");
|
|
26
|
+
const trustedLinkProtocols = /* @__PURE__ */ new Set([
|
|
27
|
+
"http:",
|
|
28
|
+
"https:",
|
|
29
|
+
"mailto:",
|
|
30
|
+
"claude:",
|
|
31
|
+
"codex:",
|
|
32
|
+
"cursor:",
|
|
33
|
+
"discord:",
|
|
34
|
+
"figma:",
|
|
35
|
+
"jetbrains:",
|
|
36
|
+
"linear:",
|
|
37
|
+
"notion:",
|
|
38
|
+
"obsidian:",
|
|
39
|
+
"slack:",
|
|
40
|
+
"spotify:",
|
|
41
|
+
"vscode:",
|
|
42
|
+
"windsurf:",
|
|
43
|
+
"zed:"
|
|
44
|
+
]);
|
|
45
|
+
function getLinkOpenPolicy(url) {
|
|
46
|
+
if (!url || !import_editor.T.linkUrl.isValid(url)) return "block";
|
|
47
|
+
if (url.startsWith("/") || url.startsWith("./")) return "open";
|
|
48
|
+
return trustedLinkProtocols.has(new URL(url).protocol) ? "open" : "confirm";
|
|
49
|
+
}
|
|
50
|
+
function openLink(editor, url) {
|
|
51
|
+
switch (getLinkOpenPolicy(url)) {
|
|
52
|
+
case "open":
|
|
53
|
+
(0, import_editor.openWindow)(url, "_blank");
|
|
54
|
+
return;
|
|
55
|
+
case "confirm":
|
|
56
|
+
if (editor.listenerCount("confirm-open-link") > 0) {
|
|
57
|
+
editor.emit("confirm-open-link", { url });
|
|
58
|
+
} else {
|
|
59
|
+
console.warn(
|
|
60
|
+
`Not opening ${url}: links into unknown apps need confirming, and nothing is listening for the editor's confirm-open-link event. Add a listener with editor.on('confirm-open-link', ({ url }) => ...) to ask the user, or render the default tldraw UI.`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
case "block":
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=openLink.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/lib/utils/openLink.ts"],
|
|
4
|
+
"sourcesContent": ["import { Editor, openWindow, T } from '@tldraw/editor'\n\n/**\n * How {@link openLink} treats a link. See {@link getLinkOpenPolicy}.\n *\n * @public\n */\nexport type TLLinkOpenPolicy = 'open' | 'confirm' | 'block'\n\n// This list only decides whether we ask before opening, so it can change in any release. Don't move\n// it into `T.linkUrl`: every client and the sync server validate stored urls with that, so changing\n// what it accepts breaks shared boards between versions.\nconst trustedLinkProtocols = new Set([\n\t'http:',\n\t'https:',\n\t'mailto:',\n\t'claude:',\n\t'codex:',\n\t'cursor:',\n\t'discord:',\n\t'figma:',\n\t'jetbrains:',\n\t'linear:',\n\t'notion:',\n\t'obsidian:',\n\t'slack:',\n\t'spotify:',\n\t'vscode:',\n\t'windsurf:',\n\t'zed:',\n])\n\n/**\n * Decide how a link from a shape or rich text should be opened.\n *\n * - `open`: a web link, mailto link, relative link, or a link into a well-known app.\n * - `confirm`: any other link that `T.linkUrl` accepts, such as an app we don't know. Ask the\n * user before opening it.\n * - `block`: anything `T.linkUrl` rejects. Stored records are validated, but a link can also\n * come from rendered rich text or a custom shape, so check again here.\n *\n * @public\n */\nexport function getLinkOpenPolicy(url: string): TLLinkOpenPolicy {\n\tif (!url || !T.linkUrl.isValid(url)) return 'block'\n\tif (url.startsWith('/') || url.startsWith('./')) return 'open'\n\treturn trustedLinkProtocols.has(new URL(url).protocol) ? 'open' : 'confirm'\n}\n\n/**\n * Open a user-provided link in a new window, following {@link getLinkOpenPolicy}. Links that need\n * confirming emit a `confirm-open-link` event, which the default UI answers with a dialog. With no\n * listener for that event (for example with `hideUi`), those links are not opened. To handle them\n * yourself, add a listener that asks the user and calls `openWindow(url, '_blank')` if they agree.\n *\n * @public\n */\nexport function openLink(editor: Editor, url: string) {\n\tswitch (getLinkOpenPolicy(url)) {\n\t\tcase 'open':\n\t\t\topenWindow(url, '_blank')\n\t\t\treturn\n\t\tcase 'confirm':\n\t\t\tif (editor.listenerCount('confirm-open-link') > 0) {\n\t\t\t\teditor.emit('confirm-open-link', { url })\n\t\t\t} else {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Not opening ${url}: links into unknown apps need confirming, and nothing is listening for the editor's confirm-open-link event. Add a listener with editor.on('confirm-open-link', ({ url }) => ...) to ask the user, or render the default tldraw UI.`\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn\n\t\tcase 'block':\n\t\t\treturn\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAsC;AAYtC,MAAM,uBAAuB,oBAAI,IAAI;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAaM,SAAS,kBAAkB,KAA+B;AAChE,MAAI,CAAC,OAAO,CAAC,gBAAE,QAAQ,QAAQ,GAAG,EAAG,QAAO;AAC5C,MAAI,IAAI,WAAW,GAAG,KAAK,IAAI,WAAW,IAAI,EAAG,QAAO;AACxD,SAAO,qBAAqB,IAAI,IAAI,IAAI,GAAG,EAAE,QAAQ,IAAI,SAAS;AACnE;AAUO,SAAS,SAAS,QAAgB,KAAa;AACrD,UAAQ,kBAAkB,GAAG,GAAG;AAAA,IAC/B,KAAK;AACJ,oCAAW,KAAK,QAAQ;AACxB;AAAA,IACD,KAAK;AACJ,UAAI,OAAO,cAAc,mBAAmB,IAAI,GAAG;AAClD,eAAO,KAAK,qBAAqB,EAAE,IAAI,CAAC;AAAA,MACzC,OAAO;AACN,gBAAQ;AAAA,UACP,eAAe,GAAG;AAAA,QACnB;AAAA,MACD;AACA;AAAA,IACD,KAAK;AACJ;AAAA,EACF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -59,7 +59,10 @@ function getTipTapDefaultExtensions(starterKitOptions) {
|
|
|
59
59
|
horizontalRule: false,
|
|
60
60
|
link: {
|
|
61
61
|
openOnClick: false,
|
|
62
|
-
autolink: true
|
|
62
|
+
autolink: true,
|
|
63
|
+
// TipTap strips hrefs outside its own protocol list, which would drop app links
|
|
64
|
+
// (`vscode://…`) that shape links accept.
|
|
65
|
+
isAllowedUri: (url, { defaultValidate }) => defaultValidate(url) || import_editor.T.linkUrl.isValid(url)
|
|
63
66
|
},
|
|
64
67
|
// List every enabled block type: a missing one gets an empty paragraph appended after it
|
|
65
68
|
// that the user can't delete (#7641 for lists, #11113 for headings).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/utils/text/richText.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tExtension,\n\tExtensions,\n\textensions,\n\tgenerateHTML,\n\tgenerateJSON,\n\tgenerateText,\n\tJSONContent,\n} from '@tiptap/core'\nimport { Code } from '@tiptap/extension-code'\nimport { Highlight } from '@tiptap/extension-highlight'\nimport { Typography } from '@tiptap/extension-typography'\nimport { Node } from '@tiptap/pm/model'\nimport { StarterKit, type StarterKitOptions } from '@tiptap/starter-kit'\nimport {\n\tEditor,\n\tgetOwnProperty,\n\tRichTextFontVisitorState,\n\tTLFontFace,\n\tTLRichText,\n\tWeakCache,\n} from '@tldraw/editor'\nimport { DefaultFontFaces } from '../../shapes/shared/defaultFonts'\nimport { LiteralTypingExtension } from './literalTyping'\nimport { WrapSelectionExtension } from './wrapSelection'\n\n/** @public */\nexport const KeyboardShiftEnterTweakExtension = Extension.create({\n\tname: 'keyboardShiftEnterHandler',\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t// We don't support soft breaks, so we just use the default enter command.\n\t\t\t'Shift-Enter': ({ editor }) => editor.commands.enter(),\n\t\t}\n\t},\n})\n\n// We change the default Code to override what's in the StarterKit.\n// It allows for other attributes/extensions.\n// @ts-ignore this is fine.\nCode.config.excludes = undefined\n\n// We want the highlighting to take precedence over bolding/italics/links\n// as far as rendering is concerned. Otherwise, the highlighting\n// looks broken up.\nHighlight.config.priority = 1100\n\n/**\n * Build tldraw's default TipTap extension set, optionally overriding the bundled `StarterKit`\n * options. The one lever most consumers want is turning individual nodes off (e.g. comments use a\n * headingless set via `getTipTapDefaultExtensions({ heading: false })`); because `StarterKit` is a\n * single umbrella extension, its sub-extensions can only be disabled through its config, not by\n * filtering the returned array.\n *\n * @public\n */\nexport function getTipTapDefaultExtensions(\n\tstarterKitOptions?: Partial<StarterKitOptions>\n): Extensions {\n\treturn [\n\t\tStarterKit.configure({\n\t\t\tblockquote: false,\n\t\t\tcodeBlock: false,\n\t\t\thorizontalRule: false,\n\t\t\tlink: {\n\t\t\t\topenOnClick: false,\n\t\t\t\tautolink: true,\n\t\t\t},\n\t\t\t// List every enabled block type: a missing one gets an empty paragraph appended after it\n\t\t\t// that the user can't delete (#7641 for lists, #11113 for headings).\n\t\t\ttrailingNode: {\n\t\t\t\tnotAfter: ['paragraph', 'heading', 'bulletList', 'orderedList', 'listItem'],\n\t\t\t},\n\t\t\t...starterKitOptions,\n\t\t}),\n\t\tHighlight,\n\t\tTypography,\n\t\tLiteralTypingExtension,\n\t\tWrapSelectionExtension,\n\t\tKeyboardShiftEnterTweakExtension,\n\n\t\t// N.B. We disable the text direction core extension in RichTextArea,\n\t\t// but we add it back in again here in our own extensions list so that\n\t\t// people can omit/override it if they want to.\n\t\textensions.TextDirection.configure({ direction: 'auto' }),\n\t]\n}\n\n/**\n * Default extensions for the TipTap editor.\n *\n * @public\n */\nexport const tipTapDefaultExtensions: Extensions = getTipTapDefaultExtensions()\n\n// todo: bust this if the editor changes, too\nconst htmlCache = new WeakCache<TLRichText, string>()\n\n/**\n * Renders HTML from a rich text string using an explicit set of TipTap extensions, rather than the\n * ones configured on an editor. Use this when rendering rich text outside of a shape's editor\n * config (e.g. comments, which render through their own headingless extension set).\n *\n * @param richText - The rich text content.\n * @param extensions - The TipTap extensions to render with.\n *\n * @public\n */\nexport function renderHtmlFromRichTextWithExtensions(\n\trichText: TLRichText,\n\textensions: Extensions\n): string {\n\tconst html = generateHTML(richText as JSONContent, extensions)\n\t// We replace empty paragraphs with a single line break to prevent the browser from collapsing\n\t// them. The paragraph's attributes are kept: paragraphs render with a `dir` attribute, usually\n\t// `auto` but `ltr` or `rtl` when the direction was set explicitly or parsed from pasted HTML.\n\treturn html.replace(/<p([^>]*)><\\/p>/g, '<p$1><br /></p>')\n}\n\n/**\n * Renders HTML from a rich text string.\n *\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichText(editor: Editor, richText: TLRichText) {\n\treturn htmlCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn renderHtmlFromRichTextWithExtensions(richText, tipTapExtensions)\n\t})\n}\n\n/**\n * Renders HTML from a rich text string for measurement.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: TLRichText) {\n\tconst html = renderHtmlFromRichText(editor, richText)\n\treturn `<div class=\"tl-rich-text\">${html}</div>`\n}\n\n// A weak cache used to store plaintext that's been extracted from rich text.\nconst plainTextFromRichTextCache = new WeakCache<TLRichText, string>()\n\nexport function isEmptyRichText(richText: TLRichText) {\n\t// An empty document has no text. It can be encoded several equally-valid ways:\n\t// an empty `content` array at the doc level, or a single paragraph whose own\n\t// `content` is missing or an empty array. The interactive editor emits the\n\t// single-paragraph / missing-`content` form; programmatic authoring (snapshot\n\t// loads, and agents/importers emitting tldraw JSON) commonly emits the\n\t// empty-array forms. Treat them all as empty.\n\tif (richText.content.length === 0) return true\n\tif (richText.content.length === 1) {\n\t\tconst node = richText.content[0] as any\n\t\tif (!node.content || node.content.length === 0) return true\n\t}\n\treturn false\n}\n\n/**\n * Whether the editor's active rich text selection is inside a list.\n *\n * `taskList` isn't in the default extension set, but when it is added its list items bind Tab and\n * Shift-Tab themselves. Leaving it out here lets our own Tab handling run alongside TipTap's, so a\n * single keypress both indents the text and nests the item.\n *\n * @internal\n */\nexport function isEditingRichTextList(editor: Editor) {\n\tconst textEditor = editor.getRichTextEditor()\n\treturn !!(\n\t\ttextEditor?.isActive('bulletList') ||\n\t\ttextEditor?.isActive('orderedList') ||\n\t\ttextEditor?.isActive('taskList')\n\t)\n}\n\n/**\n * Renders plaintext from a rich text string.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderPlaintextFromRichText(editor: Editor, richText: TLRichText) {\n\tif (isEmptyRichText(richText)) return ''\n\n\treturn plainTextFromRichTextCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn generateText(richText as JSONContent, tipTapExtensions, {\n\t\t\tblockSeparator: '\\n',\n\t\t})\n\t})\n}\n\n/**\n * Renders JSONContent from html.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderRichTextFromHTML(editor: Editor, html: string): TLRichText {\n\tconst tipTapExtensions =\n\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\treturn generateJSON(html, tipTapExtensions) as TLRichText\n}\n\n/** @public */\nexport function defaultAddFontsFromNode(\n\tnode: Node,\n\tstate: RichTextFontVisitorState,\n\taddFont: (font: TLFontFace) => void\n) {\n\tfor (const mark of node.marks) {\n\t\tif (mark.type.name === 'bold' && state.weight !== 'bold') {\n\t\t\tstate = { ...state, weight: 'bold' }\n\t\t}\n\t\tif (mark.type.name === 'italic' && state.style !== 'italic') {\n\t\t\tstate = { ...state, style: 'italic' }\n\t\t}\n\t\tif (mark.type.name === 'code' && state.family !== 'tldraw_mono') {\n\t\t\tstate = { ...state, family: 'tldraw_mono' }\n\t\t}\n\t}\n\n\tconst fontsForFamily = getOwnProperty(DefaultFontFaces, state.family)\n\tif (!fontsForFamily) return state\n\n\tconst fontsForStyle = getOwnProperty(fontsForFamily, state.style)\n\tif (!fontsForStyle) return state\n\n\tconst fontsForWeight = getOwnProperty(fontsForStyle, state.weight)\n\tif (!fontsForWeight) return state\n\n\taddFont(fontsForWeight)\n\n\treturn state\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAQO;AACP,4BAAqB;AACrB,iCAA0B;AAC1B,kCAA2B;AAE3B,yBAAmD;AACnD,
|
|
4
|
+
"sourcesContent": ["import {\n\tExtension,\n\tExtensions,\n\textensions,\n\tgenerateHTML,\n\tgenerateJSON,\n\tgenerateText,\n\tJSONContent,\n} from '@tiptap/core'\nimport { Code } from '@tiptap/extension-code'\nimport { Highlight } from '@tiptap/extension-highlight'\nimport { Typography } from '@tiptap/extension-typography'\nimport { Node } from '@tiptap/pm/model'\nimport { StarterKit, type StarterKitOptions } from '@tiptap/starter-kit'\nimport {\n\tEditor,\n\tgetOwnProperty,\n\tRichTextFontVisitorState,\n\tT,\n\tTLFontFace,\n\tTLRichText,\n\tWeakCache,\n} from '@tldraw/editor'\nimport { DefaultFontFaces } from '../../shapes/shared/defaultFonts'\nimport { LiteralTypingExtension } from './literalTyping'\nimport { WrapSelectionExtension } from './wrapSelection'\n\n/** @public */\nexport const KeyboardShiftEnterTweakExtension = Extension.create({\n\tname: 'keyboardShiftEnterHandler',\n\taddKeyboardShortcuts() {\n\t\treturn {\n\t\t\t// We don't support soft breaks, so we just use the default enter command.\n\t\t\t'Shift-Enter': ({ editor }) => editor.commands.enter(),\n\t\t}\n\t},\n})\n\n// We change the default Code to override what's in the StarterKit.\n// It allows for other attributes/extensions.\n// @ts-ignore this is fine.\nCode.config.excludes = undefined\n\n// We want the highlighting to take precedence over bolding/italics/links\n// as far as rendering is concerned. Otherwise, the highlighting\n// looks broken up.\nHighlight.config.priority = 1100\n\n/**\n * Build tldraw's default TipTap extension set, optionally overriding the bundled `StarterKit`\n * options. The one lever most consumers want is turning individual nodes off (e.g. comments use a\n * headingless set via `getTipTapDefaultExtensions({ heading: false })`); because `StarterKit` is a\n * single umbrella extension, its sub-extensions can only be disabled through its config, not by\n * filtering the returned array.\n *\n * @public\n */\nexport function getTipTapDefaultExtensions(\n\tstarterKitOptions?: Partial<StarterKitOptions>\n): Extensions {\n\treturn [\n\t\tStarterKit.configure({\n\t\t\tblockquote: false,\n\t\t\tcodeBlock: false,\n\t\t\thorizontalRule: false,\n\t\t\tlink: {\n\t\t\t\topenOnClick: false,\n\t\t\t\tautolink: true,\n\t\t\t\t// TipTap strips hrefs outside its own protocol list, which would drop app links\n\t\t\t\t// (`vscode://\u2026`) that shape links accept.\n\t\t\t\tisAllowedUri: (url, { defaultValidate }) => defaultValidate(url) || T.linkUrl.isValid(url),\n\t\t\t},\n\t\t\t// List every enabled block type: a missing one gets an empty paragraph appended after it\n\t\t\t// that the user can't delete (#7641 for lists, #11113 for headings).\n\t\t\ttrailingNode: {\n\t\t\t\tnotAfter: ['paragraph', 'heading', 'bulletList', 'orderedList', 'listItem'],\n\t\t\t},\n\t\t\t...starterKitOptions,\n\t\t}),\n\t\tHighlight,\n\t\tTypography,\n\t\tLiteralTypingExtension,\n\t\tWrapSelectionExtension,\n\t\tKeyboardShiftEnterTweakExtension,\n\n\t\t// N.B. We disable the text direction core extension in RichTextArea,\n\t\t// but we add it back in again here in our own extensions list so that\n\t\t// people can omit/override it if they want to.\n\t\textensions.TextDirection.configure({ direction: 'auto' }),\n\t]\n}\n\n/**\n * Default extensions for the TipTap editor.\n *\n * @public\n */\nexport const tipTapDefaultExtensions: Extensions = getTipTapDefaultExtensions()\n\n// todo: bust this if the editor changes, too\nconst htmlCache = new WeakCache<TLRichText, string>()\n\n/**\n * Renders HTML from a rich text string using an explicit set of TipTap extensions, rather than the\n * ones configured on an editor. Use this when rendering rich text outside of a shape's editor\n * config (e.g. comments, which render through their own headingless extension set).\n *\n * @param richText - The rich text content.\n * @param extensions - The TipTap extensions to render with.\n *\n * @public\n */\nexport function renderHtmlFromRichTextWithExtensions(\n\trichText: TLRichText,\n\textensions: Extensions\n): string {\n\tconst html = generateHTML(richText as JSONContent, extensions)\n\t// We replace empty paragraphs with a single line break to prevent the browser from collapsing\n\t// them. The paragraph's attributes are kept: paragraphs render with a `dir` attribute, usually\n\t// `auto` but `ltr` or `rtl` when the direction was set explicitly or parsed from pasted HTML.\n\treturn html.replace(/<p([^>]*)><\\/p>/g, '<p$1><br /></p>')\n}\n\n/**\n * Renders HTML from a rich text string.\n *\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichText(editor: Editor, richText: TLRichText) {\n\treturn htmlCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn renderHtmlFromRichTextWithExtensions(richText, tipTapExtensions)\n\t})\n}\n\n/**\n * Renders HTML from a rich text string for measurement.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderHtmlFromRichTextForMeasurement(editor: Editor, richText: TLRichText) {\n\tconst html = renderHtmlFromRichText(editor, richText)\n\treturn `<div class=\"tl-rich-text\">${html}</div>`\n}\n\n// A weak cache used to store plaintext that's been extracted from rich text.\nconst plainTextFromRichTextCache = new WeakCache<TLRichText, string>()\n\nexport function isEmptyRichText(richText: TLRichText) {\n\t// An empty document has no text. It can be encoded several equally-valid ways:\n\t// an empty `content` array at the doc level, or a single paragraph whose own\n\t// `content` is missing or an empty array. The interactive editor emits the\n\t// single-paragraph / missing-`content` form; programmatic authoring (snapshot\n\t// loads, and agents/importers emitting tldraw JSON) commonly emits the\n\t// empty-array forms. Treat them all as empty.\n\tif (richText.content.length === 0) return true\n\tif (richText.content.length === 1) {\n\t\tconst node = richText.content[0] as any\n\t\tif (!node.content || node.content.length === 0) return true\n\t}\n\treturn false\n}\n\n/**\n * Whether the editor's active rich text selection is inside a list.\n *\n * `taskList` isn't in the default extension set, but when it is added its list items bind Tab and\n * Shift-Tab themselves. Leaving it out here lets our own Tab handling run alongside TipTap's, so a\n * single keypress both indents the text and nests the item.\n *\n * @internal\n */\nexport function isEditingRichTextList(editor: Editor) {\n\tconst textEditor = editor.getRichTextEditor()\n\treturn !!(\n\t\ttextEditor?.isActive('bulletList') ||\n\t\ttextEditor?.isActive('orderedList') ||\n\t\ttextEditor?.isActive('taskList')\n\t)\n}\n\n/**\n * Renders plaintext from a rich text string.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderPlaintextFromRichText(editor: Editor, richText: TLRichText) {\n\tif (isEmptyRichText(richText)) return ''\n\n\treturn plainTextFromRichTextCache.get(richText, () => {\n\t\tconst tipTapExtensions =\n\t\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\t\treturn generateText(richText as JSONContent, tipTapExtensions, {\n\t\t\tblockSeparator: '\\n',\n\t\t})\n\t})\n}\n\n/**\n * Renders JSONContent from html.\n * @param editor - The editor instance.\n * @param richText - The rich text content.\n *\n * @public\n */\nexport function renderRichTextFromHTML(editor: Editor, html: string): TLRichText {\n\tconst tipTapExtensions =\n\t\teditor.getTextOptions().tipTapConfig?.extensions ?? tipTapDefaultExtensions\n\treturn generateJSON(html, tipTapExtensions) as TLRichText\n}\n\n/** @public */\nexport function defaultAddFontsFromNode(\n\tnode: Node,\n\tstate: RichTextFontVisitorState,\n\taddFont: (font: TLFontFace) => void\n) {\n\tfor (const mark of node.marks) {\n\t\tif (mark.type.name === 'bold' && state.weight !== 'bold') {\n\t\t\tstate = { ...state, weight: 'bold' }\n\t\t}\n\t\tif (mark.type.name === 'italic' && state.style !== 'italic') {\n\t\t\tstate = { ...state, style: 'italic' }\n\t\t}\n\t\tif (mark.type.name === 'code' && state.family !== 'tldraw_mono') {\n\t\t\tstate = { ...state, family: 'tldraw_mono' }\n\t\t}\n\t}\n\n\tconst fontsForFamily = getOwnProperty(DefaultFontFaces, state.family)\n\tif (!fontsForFamily) return state\n\n\tconst fontsForStyle = getOwnProperty(fontsForFamily, state.style)\n\tif (!fontsForStyle) return state\n\n\tconst fontsForWeight = getOwnProperty(fontsForStyle, state.weight)\n\tif (!fontsForWeight) return state\n\n\taddFont(fontsForWeight)\n\n\treturn state\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAQO;AACP,4BAAqB;AACrB,iCAA0B;AAC1B,kCAA2B;AAE3B,yBAAmD;AACnD,oBAQO;AACP,0BAAiC;AACjC,2BAAuC;AACvC,2BAAuC;AAGhC,MAAM,mCAAmC,sBAAU,OAAO;AAAA,EAChE,MAAM;AAAA,EACN,uBAAuB;AACtB,WAAO;AAAA;AAAA,MAEN,eAAe,CAAC,EAAE,OAAO,MAAM,OAAO,SAAS,MAAM;AAAA,IACtD;AAAA,EACD;AACD,CAAC;AAKD,2BAAK,OAAO,WAAW;AAKvB,qCAAU,OAAO,WAAW;AAWrB,SAAS,2BACf,mBACa;AACb,SAAO;AAAA,IACN,8BAAW,UAAU;AAAA,MACpB,YAAY;AAAA,MACZ,WAAW;AAAA,MACX,gBAAgB;AAAA,MAChB,MAAM;AAAA,QACL,aAAa;AAAA,QACb,UAAU;AAAA;AAAA;AAAA,QAGV,cAAc,CAAC,KAAK,EAAE,gBAAgB,MAAM,gBAAgB,GAAG,KAAK,gBAAE,QAAQ,QAAQ,GAAG;AAAA,MAC1F;AAAA;AAAA;AAAA,MAGA,cAAc;AAAA,QACb,UAAU,CAAC,aAAa,WAAW,cAAc,eAAe,UAAU;AAAA,MAC3E;AAAA,MACA,GAAG;AAAA,IACJ,CAAC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,uBAAW,cAAc,UAAU,EAAE,WAAW,OAAO,CAAC;AAAA,EACzD;AACD;AAOO,MAAM,0BAAsC,2BAA2B;AAG9E,MAAM,YAAY,IAAI,wBAA8B;AAY7C,SAAS,qCACf,UACAA,aACS;AACT,QAAM,WAAO,0BAAa,UAAyBA,WAAU;AAI7D,SAAO,KAAK,QAAQ,oBAAoB,iBAAiB;AAC1D;AAUO,SAAS,uBAAuB,QAAgB,UAAsB;AAC5E,SAAO,UAAU,IAAI,UAAU,MAAM;AACpC,UAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,WAAO,qCAAqC,UAAU,gBAAgB;AAAA,EACvE,CAAC;AACF;AASO,SAAS,qCAAqC,QAAgB,UAAsB;AAC1F,QAAM,OAAO,uBAAuB,QAAQ,QAAQ;AACpD,SAAO,6BAA6B,IAAI;AACzC;AAGA,MAAM,6BAA6B,IAAI,wBAA8B;AAE9D,SAAS,gBAAgB,UAAsB;AAOrD,MAAI,SAAS,QAAQ,WAAW,EAAG,QAAO;AAC1C,MAAI,SAAS,QAAQ,WAAW,GAAG;AAClC,UAAM,OAAO,SAAS,QAAQ,CAAC;AAC/B,QAAI,CAAC,KAAK,WAAW,KAAK,QAAQ,WAAW,EAAG,QAAO;AAAA,EACxD;AACA,SAAO;AACR;AAWO,SAAS,sBAAsB,QAAgB;AACrD,QAAM,aAAa,OAAO,kBAAkB;AAC5C,SAAO,CAAC,EACP,YAAY,SAAS,YAAY,KACjC,YAAY,SAAS,aAAa,KAClC,YAAY,SAAS,UAAU;AAEjC;AASO,SAAS,4BAA4B,QAAgB,UAAsB;AACjF,MAAI,gBAAgB,QAAQ,EAAG,QAAO;AAEtC,SAAO,2BAA2B,IAAI,UAAU,MAAM;AACrD,UAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,eAAO,0BAAa,UAAyB,kBAAkB;AAAA,MAC9D,gBAAgB;AAAA,IACjB,CAAC;AAAA,EACF,CAAC;AACF;AASO,SAAS,uBAAuB,QAAgB,MAA0B;AAChF,QAAM,mBACL,OAAO,eAAe,EAAE,cAAc,cAAc;AACrD,aAAO,0BAAa,MAAM,gBAAgB;AAC3C;AAGO,SAAS,wBACf,MACA,OACA,SACC;AACD,aAAW,QAAQ,KAAK,OAAO;AAC9B,QAAI,KAAK,KAAK,SAAS,UAAU,MAAM,WAAW,QAAQ;AACzD,cAAQ,EAAE,GAAG,OAAO,QAAQ,OAAO;AAAA,IACpC;AACA,QAAI,KAAK,KAAK,SAAS,YAAY,MAAM,UAAU,UAAU;AAC5D,cAAQ,EAAE,GAAG,OAAO,OAAO,SAAS;AAAA,IACrC;AACA,QAAI,KAAK,KAAK,SAAS,UAAU,MAAM,WAAW,eAAe;AAChE,cAAQ,EAAE,GAAG,OAAO,QAAQ,cAAc;AAAA,IAC3C;AAAA,EACD;AAEA,QAAM,qBAAiB,8BAAe,sCAAkB,MAAM,MAAM;AACpE,MAAI,CAAC,eAAgB,QAAO;AAE5B,QAAM,oBAAgB,8BAAe,gBAAgB,MAAM,KAAK;AAChE,MAAI,CAAC,cAAe,QAAO;AAE3B,QAAM,qBAAiB,8BAAe,eAAe,MAAM,MAAM;AACjE,MAAI,CAAC,eAAgB,QAAO;AAE5B,UAAQ,cAAc;AAEtB,SAAO;AACR;",
|
|
6
6
|
"names": ["extensions"]
|
|
7
7
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -2618,6 +2618,19 @@ export declare function getGeoTypeDefinition(name: string, customGeoTypes?: Reco
|
|
|
2618
2618
|
/** @public */
|
|
2619
2619
|
export declare function getHitShapeOnCanvasPointerDown(editor: Editor, hitLabels?: boolean): TLShape | undefined;
|
|
2620
2620
|
|
|
2621
|
+
/**
|
|
2622
|
+
* Decide how a link from a shape or rich text should be opened.
|
|
2623
|
+
*
|
|
2624
|
+
* - `open`: a web link, mailto link, relative link, or a link into a well-known app.
|
|
2625
|
+
* - `confirm`: any other link that `T.linkUrl` accepts, such as an app we don't know. Ask the
|
|
2626
|
+
* user before opening it.
|
|
2627
|
+
* - `block`: anything `T.linkUrl` rejects. Stored records are validated, but a link can also
|
|
2628
|
+
* come from rendered rich text or a custom shape, so check again here.
|
|
2629
|
+
*
|
|
2630
|
+
* @public
|
|
2631
|
+
*/
|
|
2632
|
+
export declare function getLinkOpenPolicy(url: string): TLLinkOpenPolicy;
|
|
2633
|
+
|
|
2621
2634
|
/** @public */
|
|
2622
2635
|
export declare function getPointsFromDrawSegment(segment: TLDrawShapeSegment, scaleX: number, scaleY: number, points?: Vec[]): Vec[];
|
|
2623
2636
|
|
|
@@ -3204,6 +3217,16 @@ export declare interface OnDragFromToolbarToCreateShapesOpts {
|
|
|
3204
3217
|
maskedToolId?: string;
|
|
3205
3218
|
}
|
|
3206
3219
|
|
|
3220
|
+
/**
|
|
3221
|
+
* Open a user-provided link in a new window, following {@link getLinkOpenPolicy}. Links that need
|
|
3222
|
+
* confirming emit a `confirm-open-link` event, which the default UI answers with a dialog. With no
|
|
3223
|
+
* listener for that event (for example with `hideUi`), those links are not opened. To handle them
|
|
3224
|
+
* yourself, add a listener that asks the user and calls `openWindow(url, '_blank')` if they agree.
|
|
3225
|
+
*
|
|
3226
|
+
* @public
|
|
3227
|
+
*/
|
|
3228
|
+
export declare function openLink(editor: Editor, url: string): void;
|
|
3229
|
+
|
|
3207
3230
|
/** @public @react */
|
|
3208
3231
|
export declare function OvalToolbarItem(): JSX.Element;
|
|
3209
3232
|
|
|
@@ -4824,6 +4847,13 @@ export declare interface TLExternalContentProps {
|
|
|
4824
4847
|
acceptedVideoMimeTypes?: readonly string[];
|
|
4825
4848
|
}
|
|
4826
4849
|
|
|
4850
|
+
/**
|
|
4851
|
+
* How {@link openLink} treats a link. See {@link getLinkOpenPolicy}.
|
|
4852
|
+
*
|
|
4853
|
+
* @public
|
|
4854
|
+
*/
|
|
4855
|
+
export declare type TLLinkOpenPolicy = 'block' | 'confirm' | 'open';
|
|
4856
|
+
|
|
4827
4857
|
/**
|
|
4828
4858
|
* The component used to render a note shape's attribution badge, or `null` to hide it.
|
|
4829
4859
|
*
|
|
@@ -5880,7 +5910,7 @@ export declare interface TLUiTranslation {
|
|
|
5880
5910
|
export declare type TLUiTranslationContextType = TLUiTranslation;
|
|
5881
5911
|
|
|
5882
5912
|
/** @public */
|
|
5883
|
-
export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.rotate-shape-ccw-fine' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-cw' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy-hovered-styles' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.frame-selection' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-kbd-shortcuts' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.select-zoom-tool' | 'action.send-backward' | 'action.send-to-back' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-none' | 'action.toggle-auto-pan' | 'action.toggle-auto-size' | 'action.toggle-auto-zoom' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-invert-zoom.menu' | 'action.toggle-invert-zoom' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.toggle-lock' | 'action.toggle-mouse' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-trackpad' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-quick' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.maximum-size' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'comments.add-placeholder' | 'comments.add-reaction' | 'comments.cluster-label' | 'comments.copy-link' | 'comments.delete' | 'comments.dismiss' | 'comments.edit-placeholder' | 'comments.edit' | 'comments.empty-filtered' | 'comments.empty' | 'comments.filter' | 'comments.hide' | 'comments.link-copied' | 'comments.mention-no-matches' | 'comments.mention-you' | 'comments.more-options' | 'comments.only-my-comments' | 'comments.only-unread' | 'comments.pin-label-resolved' | 'comments.pin-label' | 'comments.preview-more' | 'comments.reacted' | 'comments.reopen' | 'comments.replies' | 'comments.reply-placeholder' | 'comments.resolve' | 'comments.resolved-by' | 'comments.resolved' | 'comments.save' | 'comments.send' | 'comments.show-all-pages' | 'comments.show-resolved' | 'comments.show' | 'comments.stack-label' | 'comments.thread-title' | 'comments.title' | 'comments.unknown-author' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.learn-more' | 'embed-dialog.title' | 'embed-dialog.url' | 'error.cancel' | 'error.confirm-reset.description' | 'error.confirm-reset.title' | 'error.copied' | 'error.copy' | 'error.hide-details' | 'error.message-label' | 'error.note-label' | 'error.refresh-hint' | 'error.refresh-page' | 'error.reset-data' | 'error.reset-hint' | 'error.reset-note' | 'error.show-details' | 'error.stack-trace-label' | 'error.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.lined-fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.accessibility' | 'menu.edit' | 'menu.input-device' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.go-to-page' | 'page-menu.max-pages-reached' | 'page-menu.new-page-initial-name' | 'page-menu.resize' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.disabled-notice' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.selected' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.moved-to-page.action' | 'toast.moved-to-page.desc' | 'toast.moved-to-page.title' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.comment' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop-confirm' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus-2' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.video-toolbar-title' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
5913
|
+
export declare type TLUiTranslationKey = 'a11y.adjust-shape-styles' | 'a11y.enlarge-shape' | 'a11y.enter-leave-container' | 'a11y.move-shape-faster' | 'a11y.move-shape' | 'a11y.multiple-shapes' | 'a11y.open-context-menu' | 'a11y.open-keyboard-shortcuts' | 'a11y.pan-camera' | 'a11y.repeat-shape' | 'a11y.rotate-shape-ccw-fine' | 'a11y.rotate-shape-ccw' | 'a11y.rotate-shape-cw-fine' | 'a11y.rotate-shape-cw' | 'a11y.select-shape-direction' | 'a11y.select-shape' | 'a11y.shape-image' | 'a11y.shape-index' | 'a11y.shape-video' | 'a11y.shrink-shape' | 'a11y.skip-to-main-content' | 'a11y.status' | 'action.align-bottom' | 'action.align-center-horizontal.short' | 'action.align-center-horizontal' | 'action.align-center-vertical.short' | 'action.align-center-vertical' | 'action.align-left' | 'action.align-right' | 'action.align-top' | 'action.back-to-content' | 'action.bring-forward' | 'action.bring-to-front' | 'action.convert-to-bookmark' | 'action.convert-to-embed' | 'action.copy-as-json.short' | 'action.copy-as-json' | 'action.copy-as-png.short' | 'action.copy-as-png' | 'action.copy-as-svg.short' | 'action.copy-as-svg' | 'action.copy-hovered-styles' | 'action.copy' | 'action.cut' | 'action.delete' | 'action.distribute-horizontal.short' | 'action.distribute-horizontal' | 'action.distribute-vertical.short' | 'action.distribute-vertical' | 'action.download-original' | 'action.duplicate' | 'action.edit-link' | 'action.enhanced-a11y-mode.menu' | 'action.enhanced-a11y-mode' | 'action.exit-pen-mode' | 'action.export-all-as-png.short' | 'action.export-all-as-png' | 'action.export-all-as-svg.short' | 'action.export-all-as-svg' | 'action.export-as-png.short' | 'action.export-as-png' | 'action.export-as-svg.short' | 'action.export-as-svg' | 'action.fit-frame-to-content' | 'action.flatten-to-image' | 'action.flip-horizontal.short' | 'action.flip-horizontal' | 'action.flip-vertical.short' | 'action.flip-vertical' | 'action.frame-selection' | 'action.group' | 'action.insert-embed' | 'action.insert-media' | 'action.open-cursor-chat' | 'action.open-embed-link' | 'action.open-kbd-shortcuts' | 'action.pack' | 'action.paste-error-description' | 'action.paste-error-title' | 'action.paste' | 'action.print' | 'action.redo' | 'action.remove-frame' | 'action.rename' | 'action.rotate-ccw' | 'action.rotate-cw' | 'action.save-copy' | 'action.select-all' | 'action.select-none' | 'action.select-zoom-tool' | 'action.send-backward' | 'action.send-to-back' | 'action.stack-horizontal.short' | 'action.stack-horizontal' | 'action.stack-vertical.short' | 'action.stack-vertical' | 'action.stop-following' | 'action.stretch-horizontal.short' | 'action.stretch-horizontal' | 'action.stretch-vertical.short' | 'action.stretch-vertical' | 'action.toggle-auto-none' | 'action.toggle-auto-pan' | 'action.toggle-auto-size' | 'action.toggle-auto-zoom' | 'action.toggle-dark-mode.menu' | 'action.toggle-dark-mode' | 'action.toggle-debug-mode.menu' | 'action.toggle-debug-mode' | 'action.toggle-dynamic-size-mode.menu' | 'action.toggle-dynamic-size-mode' | 'action.toggle-edge-scrolling.menu' | 'action.toggle-edge-scrolling' | 'action.toggle-focus-mode.menu' | 'action.toggle-focus-mode' | 'action.toggle-grid.menu' | 'action.toggle-grid' | 'action.toggle-invert-zoom.menu' | 'action.toggle-invert-zoom' | 'action.toggle-keyboard-shortcuts.menu' | 'action.toggle-keyboard-shortcuts' | 'action.toggle-lock' | 'action.toggle-mouse' | 'action.toggle-paste-at-cursor.menu' | 'action.toggle-paste-at-cursor' | 'action.toggle-reduce-motion.menu' | 'action.toggle-reduce-motion' | 'action.toggle-snap-mode.menu' | 'action.toggle-snap-mode' | 'action.toggle-tool-lock.menu' | 'action.toggle-tool-lock' | 'action.toggle-trackpad' | 'action.toggle-transparent.context-menu' | 'action.toggle-transparent.menu' | 'action.toggle-transparent' | 'action.toggle-wrap-mode.menu' | 'action.toggle-wrap-mode' | 'action.undo' | 'action.ungroup' | 'action.unlock-all' | 'action.zoom-in' | 'action.zoom-out' | 'action.zoom-quick' | 'action.zoom-to-100' | 'action.zoom-to-fit' | 'action.zoom-to-selection' | 'actions-menu.title' | 'align-style.end' | 'align-style.justify' | 'align-style.middle' | 'align-style.start' | 'app.loading' | 'arrow-kind-style.arc' | 'arrow-kind-style.elbow' | 'arrowheadEnd-style.arrow' | 'arrowheadEnd-style.bar' | 'arrowheadEnd-style.diamond' | 'arrowheadEnd-style.dot' | 'arrowheadEnd-style.inverted' | 'arrowheadEnd-style.none' | 'arrowheadEnd-style.pipe' | 'arrowheadEnd-style.square' | 'arrowheadEnd-style.triangle' | 'arrowheadStart-style.arrow' | 'arrowheadStart-style.bar' | 'arrowheadStart-style.diamond' | 'arrowheadStart-style.dot' | 'arrowheadStart-style.inverted' | 'arrowheadStart-style.none' | 'arrowheadStart-style.pipe' | 'arrowheadStart-style.square' | 'arrowheadStart-style.triangle' | 'assets.files.amount-too-many' | 'assets.files.maximum-size' | 'assets.files.size-too-big' | 'assets.files.type-not-allowed' | 'assets.files.upload-failed' | 'assets.url.failed' | 'color-style.black' | 'color-style.blue' | 'color-style.green' | 'color-style.grey' | 'color-style.light-blue' | 'color-style.light-green' | 'color-style.light-red' | 'color-style.light-violet' | 'color-style.orange' | 'color-style.red' | 'color-style.violet' | 'color-style.white' | 'color-style.yellow' | 'comments.add-placeholder' | 'comments.add-reaction' | 'comments.cluster-label' | 'comments.copy-link' | 'comments.delete' | 'comments.dismiss' | 'comments.edit-placeholder' | 'comments.edit' | 'comments.empty-filtered' | 'comments.empty' | 'comments.filter' | 'comments.hide' | 'comments.link-copied' | 'comments.mention-no-matches' | 'comments.mention-you' | 'comments.more-options' | 'comments.only-my-comments' | 'comments.only-unread' | 'comments.pin-label-resolved' | 'comments.pin-label' | 'comments.preview-more' | 'comments.reacted' | 'comments.reopen' | 'comments.replies' | 'comments.reply-placeholder' | 'comments.resolve' | 'comments.resolved-by' | 'comments.resolved' | 'comments.save' | 'comments.send' | 'comments.show-all-pages' | 'comments.show-resolved' | 'comments.show' | 'comments.stack-label' | 'comments.thread-title' | 'comments.title' | 'comments.unknown-author' | 'confirm-open-link-dialog.cancel' | 'confirm-open-link-dialog.detail' | 'confirm-open-link-dialog.open' | 'confirm-open-link-dialog.title' | 'context-menu.arrange' | 'context-menu.copy-as' | 'context-menu.edit' | 'context-menu.export-all-as' | 'context-menu.export-as' | 'context-menu.move-to-page' | 'context-menu.reorder' | 'context-menu.title' | 'context.pages.new-page' | 'cursor-chat.type-to-chat' | 'dash-style.dashed' | 'dash-style.dotted' | 'dash-style.draw' | 'dash-style.solid' | 'document.default-name' | 'edit-link-dialog.cancel' | 'edit-link-dialog.clear' | 'edit-link-dialog.detail' | 'edit-link-dialog.invalid-url' | 'edit-link-dialog.save' | 'edit-link-dialog.title' | 'edit-link-dialog.url' | 'embed-dialog.back' | 'embed-dialog.cancel' | 'embed-dialog.create' | 'embed-dialog.instruction' | 'embed-dialog.invalid-url' | 'embed-dialog.learn-more' | 'embed-dialog.title' | 'embed-dialog.url' | 'error.cancel' | 'error.confirm-reset.description' | 'error.confirm-reset.title' | 'error.copied' | 'error.copy' | 'error.hide-details' | 'error.message-label' | 'error.note-label' | 'error.refresh-hint' | 'error.refresh-page' | 'error.reset-data' | 'error.reset-hint' | 'error.reset-note' | 'error.show-details' | 'error.stack-trace-label' | 'error.title' | 'file-system.confirm-open.cancel' | 'file-system.confirm-open.description' | 'file-system.confirm-open.open' | 'file-system.confirm-open.title' | 'file-system.file-open-error.file-format-version-too-new' | 'file-system.file-open-error.generic-corrupted-file' | 'file-system.file-open-error.not-a-tldraw-file' | 'file-system.file-open-error.title' | 'file-system.shared-document-file-open-error.description' | 'file-system.shared-document-file-open-error.title' | 'fill-style.fill' | 'fill-style.lined-fill' | 'fill-style.none' | 'fill-style.pattern' | 'fill-style.semi' | 'fill-style.solid' | 'focus-mode.toggle-focus-mode' | 'font-style.draw' | 'font-style.mono' | 'font-style.sans' | 'font-style.serif' | 'geo-style.arrow-down' | 'geo-style.arrow-left' | 'geo-style.arrow-right' | 'geo-style.arrow-up' | 'geo-style.check-box' | 'geo-style.cloud' | 'geo-style.diamond' | 'geo-style.ellipse' | 'geo-style.heart' | 'geo-style.hexagon' | 'geo-style.octagon' | 'geo-style.oval' | 'geo-style.pentagon' | 'geo-style.rectangle' | 'geo-style.rhombus-2' | 'geo-style.rhombus' | 'geo-style.star' | 'geo-style.trapezoid' | 'geo-style.triangle' | 'geo-style.x-box' | 'help-menu.about' | 'help-menu.discord' | 'help-menu.github' | 'help-menu.keyboard-shortcuts' | 'help-menu.privacy' | 'help-menu.terms' | 'help-menu.title' | 'help-menu.twitter' | 'menu.accessibility' | 'menu.edit' | 'menu.input-device' | 'menu.language' | 'menu.preferences' | 'menu.theme' | 'menu.title' | 'menu.view' | 'navigation-zone.minimap' | 'navigation-zone.title' | 'navigation-zone.toggle-minimap' | 'navigation-zone.zoom' | 'opacity-style.0.1' | 'opacity-style.0.25' | 'opacity-style.0.5' | 'opacity-style.0.75' | 'opacity-style.1' | 'page-menu.create-new-page' | 'page-menu.go-to-page' | 'page-menu.max-pages-reached' | 'page-menu.new-page-initial-name' | 'page-menu.resize' | 'page-menu.submenu.delete' | 'page-menu.submenu.duplicate-page' | 'page-menu.submenu.move-down' | 'page-menu.submenu.move-up' | 'page-menu.submenu.rename' | 'page-menu.submenu.title' | 'people-menu.anonymous-user' | 'people-menu.avatar-color' | 'people-menu.change-color' | 'people-menu.change-name' | 'people-menu.follow' | 'people-menu.following' | 'people-menu.leading' | 'people-menu.title' | 'people-menu.user' | 'shortcuts-dialog.a11y' | 'shortcuts-dialog.collaboration' | 'shortcuts-dialog.disabled-notice' | 'shortcuts-dialog.edit' | 'shortcuts-dialog.preferences' | 'shortcuts-dialog.text-formatting' | 'shortcuts-dialog.title' | 'shortcuts-dialog.tools' | 'shortcuts-dialog.transform' | 'shortcuts-dialog.view' | 'size-style.l' | 'size-style.m' | 'size-style.s' | 'size-style.xl' | 'spline-style.cubic' | 'spline-style.line' | 'status.offline' | 'style-panel.align' | 'style-panel.arrow-kind' | 'style-panel.arrowhead-end' | 'style-panel.arrowhead-start' | 'style-panel.arrowheads' | 'style-panel.color' | 'style-panel.dash' | 'style-panel.fill' | 'style-panel.font' | 'style-panel.geo' | 'style-panel.label-align' | 'style-panel.mixed' | 'style-panel.opacity' | 'style-panel.position' | 'style-panel.selected' | 'style-panel.size' | 'style-panel.spline' | 'style-panel.title' | 'style-panel.vertical-align' | 'theme.dark' | 'theme.light' | 'theme.system' | 'toast.close' | 'toast.error.copy-fail.desc' | 'toast.error.copy-fail.title' | 'toast.error.export-fail.desc' | 'toast.error.export-fail.title' | 'toast.error' | 'toast.info' | 'toast.moved-to-page.action' | 'toast.moved-to-page.desc' | 'toast.moved-to-page.title' | 'toast.success' | 'toast.warning' | 'tool-panel.more' | 'tool-panel.title' | 'tool.arrow-down' | 'tool.arrow-left' | 'tool.arrow-right' | 'tool.arrow-up' | 'tool.arrow' | 'tool.aspect-ratio.circle' | 'tool.aspect-ratio.landscape' | 'tool.aspect-ratio.original' | 'tool.aspect-ratio.portrait' | 'tool.aspect-ratio.square' | 'tool.aspect-ratio.wide' | 'tool.aspect-ratio' | 'tool.bookmark' | 'tool.check-box' | 'tool.cloud' | 'tool.comment' | 'tool.diamond' | 'tool.draw' | 'tool.ellipse' | 'tool.embed' | 'tool.eraser' | 'tool.frame' | 'tool.hand' | 'tool.heart' | 'tool.hexagon' | 'tool.highlight' | 'tool.image-crop-confirm' | 'tool.image-crop' | 'tool.image-toolbar-title' | 'tool.image-zoom' | 'tool.laser' | 'tool.line' | 'tool.media-alt-text-confirm' | 'tool.media-alt-text-desc' | 'tool.media-alt-text' | 'tool.media' | 'tool.note' | 'tool.octagon' | 'tool.oval' | 'tool.pentagon' | 'tool.pointer-down' | 'tool.rectangle' | 'tool.replace-media' | 'tool.rhombus-2' | 'tool.rhombus' | 'tool.rich-text-bold' | 'tool.rich-text-bulletList' | 'tool.rich-text-code' | 'tool.rich-text-header' | 'tool.rich-text-highlight' | 'tool.rich-text-italic' | 'tool.rich-text-link-remove' | 'tool.rich-text-link-visit' | 'tool.rich-text-link' | 'tool.rich-text-orderedList' | 'tool.rich-text-strikethrough' | 'tool.rich-text-toolbar-title' | 'tool.select' | 'tool.star' | 'tool.text' | 'tool.trapezoid' | 'tool.triangle' | 'tool.video-toolbar-title' | 'tool.x-box' | 'ui.checked' | 'ui.close' | 'ui.unchecked' | 'verticalAlign-style.end' | 'verticalAlign-style.middle' | 'verticalAlign-style.start' | 'vscode.file-open.backup-failed' | 'vscode.file-open.backup-saved' | 'vscode.file-open.backup' | 'vscode.file-open.desc' | 'vscode.file-open.dont-show-again' | 'vscode.file-open.open';
|
|
5884
5914
|
|
|
5885
5915
|
/** @public */
|
|
5886
5916
|
export declare interface TLUiTranslationProviderProps {
|
package/dist-esm/index.mjs
CHANGED
|
@@ -612,6 +612,7 @@ import {
|
|
|
612
612
|
defaultEditorAssetUrls,
|
|
613
613
|
setDefaultEditorAssetUrls
|
|
614
614
|
} from "./lib/utils/static-assets/assetUrls.mjs";
|
|
615
|
+
import { getLinkOpenPolicy, openLink } from "./lib/utils/openLink.mjs";
|
|
615
616
|
import { sanitizeSvg } from "./lib/utils/svg/sanitizeSvg.mjs";
|
|
616
617
|
import {
|
|
617
618
|
defaultAddFontsFromNode,
|
|
@@ -658,7 +659,7 @@ import {
|
|
|
658
659
|
} from "./lib/utils/tldr/file.mjs";
|
|
659
660
|
registerTldrawLibraryVersion(
|
|
660
661
|
"tldraw",
|
|
661
|
-
"5.6.
|
|
662
|
+
"5.6.2",
|
|
662
663
|
"esm"
|
|
663
664
|
);
|
|
664
665
|
export {
|
|
@@ -1020,6 +1021,7 @@ export {
|
|
|
1020
1021
|
getFontStyleItems,
|
|
1021
1022
|
getGeoTypeDefinition,
|
|
1022
1023
|
getHitShapeOnCanvasPointerDown,
|
|
1024
|
+
getLinkOpenPolicy,
|
|
1023
1025
|
getPointsFromDrawSegment,
|
|
1024
1026
|
getPointsFromDrawSegments,
|
|
1025
1027
|
getSchema,
|
|
@@ -1035,6 +1037,7 @@ export {
|
|
|
1035
1037
|
mergeAttributes,
|
|
1036
1038
|
notifyIfFileNotAllowed,
|
|
1037
1039
|
onDragFromToolbarToCreateShape,
|
|
1040
|
+
openLink,
|
|
1038
1041
|
parseAndLoadDocument,
|
|
1039
1042
|
parseTldrawJsonFile,
|
|
1040
1043
|
preloadFont,
|