@tldraw/editor 5.7.0-next.0ef3ff64787a → 5.7.0-next.147eae59044f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.d.ts +5 -8
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js +91 -29
- package/dist-cjs/lib/components/default-components/DefaultErrorFallback.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +8 -2
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ThemeManager/defaultThemes.js +3 -1
- package/dist-cjs/lib/editor/managers/ThemeManager/defaultThemes.js.map +2 -2
- package/dist-cjs/lib/editor/managers/ThemeManager/drawFontCheckbox.js +35 -0
- package/dist-cjs/lib/editor/managers/ThemeManager/drawFontCheckbox.js.map +7 -0
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/license/LicenseManager.js +2 -2
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.d.mts +5 -8
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs +91 -29
- package/dist-esm/lib/components/default-components/DefaultErrorFallback.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +8 -2
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ThemeManager/defaultThemes.mjs +3 -1
- package/dist-esm/lib/editor/managers/ThemeManager/defaultThemes.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/ThemeManager/drawFontCheckbox.mjs +15 -0
- package/dist-esm/lib/editor/managers/ThemeManager/drawFontCheckbox.mjs.map +7 -0
- package/dist-esm/lib/license/LicenseManager.mjs +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +266 -58
- package/package.json +7 -7
- package/src/lib/components/default-components/DefaultErrorFallback.tsx +84 -38
- package/src/lib/editor/Editor.ts +6 -2
- package/src/lib/editor/managers/ThemeManager/defaultThemes.ts +2 -0
- package/src/lib/editor/managers/ThemeManager/drawFontCheckbox.ts +18 -0
- package/src/lib/editor/types/emit-types.ts +1 -0
- package/src/lib/license/LicenseManager.test.ts +19 -18
- package/src/lib/license/LicenseManager.ts +5 -5
- package/src/version.ts +3 -3
|
@@ -23,6 +23,7 @@ __export(defaultThemes_exports, {
|
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(defaultThemes_exports);
|
|
25
25
|
var import_tlschema = require("@tldraw/tlschema");
|
|
26
|
+
var import_drawFontCheckbox = require("./drawFontCheckbox");
|
|
26
27
|
const DEFAULT_THEME = {
|
|
27
28
|
id: "default",
|
|
28
29
|
fontSize: 16,
|
|
@@ -50,7 +51,8 @@ const DEFAULT_THEME = {
|
|
|
50
51
|
weight: "bold",
|
|
51
52
|
style: "italic"
|
|
52
53
|
}
|
|
53
|
-
]
|
|
54
|
+
],
|
|
55
|
+
checkbox: import_drawFontCheckbox.DRAW_FONT_CHECKBOX
|
|
54
56
|
},
|
|
55
57
|
sans: {
|
|
56
58
|
fontFamily: import_tlschema.DefaultFontFamilies.sans,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/lib/editor/managers/ThemeManager/defaultThemes.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tDefaultFontFamilies,\n\tTLDefaultColor,\n\tTLDefaultColorStyle,\n\tTLTheme,\n\tTLThemeColors,\n} from '@tldraw/tlschema'\n\n/**\n * The default theme definition containing color palettes for both light and dark modes.\n *\n * @public\n */\nexport const DEFAULT_THEME: TLTheme = {\n\tid: 'default',\n\tfontSize: 16,\n\tlineHeight: 1.35,\n\tstrokeWidth: 2,\n\tfonts: {\n\t\tdraw: {\n\t\t\tfontFamily: DefaultFontFamilies.draw,\n\t\t\tfaces: [\n\t\t\t\t{ family: 'tldraw_draw', src: { url: 'tldraw_draw', format: 'woff2' }, weight: 'normal' },\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tsans: {\n\t\t\tfontFamily: DefaultFontFamilies.sans,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tserif: {\n\t\t\tfontFamily: DefaultFontFamilies.serif,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tmono: {\n\t\t\tfontFamily: DefaultFontFamilies.mono,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tcolors: {\n\t\tlight: {\n\t\t\ttext: '#000000',\n\t\t\tbackground: '#f9fafb',\n\t\t\tnegativeSpace: '#f9fafb',\n\t\t\tsolid: '#fcfffe',\n\t\t\tcursor: 'black',\n\t\t\tnoteBorder: 'rgb(144, 144, 144)',\n\t\t\tsnap: 'hsl(0, 76%, 60%)',\n\t\t\tselectionStroke: 'hsl(214, 84%, 56%)',\n\t\t\tselectionFill: 'hsl(210, 100%, 56%, 24%)',\n\t\t\tbrushFill: 'hsl(0, 0%, 56%, 10.2%)',\n\t\t\tbrushStroke: 'hsl(0, 0%, 56%, 25.1%)',\n\t\t\tselectedContrast: '#ffffff',\n\t\t\tlaser: 'hsl(0, 100%, 50%)',\n\t\t\tblack: {\n\t\t\t\tsolid: '#1d1d1d',\n\t\t\t\tfill: '#1d1d1d',\n\t\t\t\tlinedFill: '#363636',\n\t\t\t\tframeHeadingStroke: '#717171',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#717171',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FCE19C',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#e8e8e8',\n\t\t\t\tpattern: '#494949',\n\t\t\t\thighlightSrgb: '#fddd00',\n\t\t\t\thighlightP3: 'color(display-p3 0.972 0.8205 0.05)',\n\t\t\t},\n\t\t\tblue: {\n\t\t\t\tsolid: '#4465e9',\n\t\t\t\tfill: '#4465e9',\n\t\t\t\tlinedFill: '#6580ec',\n\t\t\t\tframeHeadingStroke: '#6681ec',\n\t\t\t\tframeHeadingFill: '#f9fafe',\n\t\t\t\tframeStroke: '#6681ec',\n\t\t\t\tframeFill: '#f9fafe',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#8AA3FF',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#dce1f8',\n\t\t\t\tpattern: '#6681ee',\n\t\t\t\thighlightSrgb: '#10acff',\n\t\t\t\thighlightP3: 'color(display-p3 0.308 0.6632 0.9996)',\n\t\t\t},\n\t\t\tgreen: {\n\t\t\t\tsolid: '#099268',\n\t\t\t\tfill: '#099268',\n\t\t\t\tlinedFill: '#0bad7c',\n\t\t\t\tframeHeadingStroke: '#37a684',\n\t\t\t\tframeHeadingFill: '#f8fcfa',\n\t\t\t\tframeStroke: '#37a684',\n\t\t\t\tframeFill: '#f8fcfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#6FC896',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#d3e9e3',\n\t\t\t\tpattern: '#39a785',\n\t\t\t\thighlightSrgb: '#00ffc8',\n\t\t\t\thighlightP3: 'color(display-p3 0.2536 0.984 0.7981)',\n\t\t\t},\n\t\t\tgrey: {\n\t\t\t\tsolid: '#9fa8b2',\n\t\t\t\tfill: '#9fa8b2',\n\t\t\t\tlinedFill: '#bbc1c9',\n\t\t\t\tframeHeadingStroke: '#aaaaab',\n\t\t\t\tframeHeadingFill: '#fbfcfc',\n\t\t\t\tframeStroke: '#aaaaab',\n\t\t\t\tframeFill: '#fcfcfd',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#C0CAD3',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#eceef0',\n\t\t\t\tpattern: '#bcc3c9',\n\t\t\t\thighlightSrgb: '#cbe7f1',\n\t\t\t\thighlightP3: 'color(display-p3 0.8163 0.9023 0.9416)',\n\t\t\t},\n\t\t\t'light-blue': {\n\t\t\t\tsolid: '#4ba1f1',\n\t\t\t\tfill: '#4ba1f1',\n\t\t\t\tlinedFill: '#7abaf5',\n\t\t\t\tframeHeadingStroke: '#6cb2f3',\n\t\t\t\tframeHeadingFill: '#f8fbfe',\n\t\t\t\tframeStroke: '#6cb2f3',\n\t\t\t\tframeFill: '#fafcff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#9BC4FD',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#ddedfa',\n\t\t\t\tpattern: '#6fbbf8',\n\t\t\t\thighlightSrgb: '#00f4ff',\n\t\t\t\thighlightP3: 'color(display-p3 0.1512 0.9414 0.9996)',\n\t\t\t},\n\t\t\t'light-green': {\n\t\t\t\tsolid: '#4cb05e',\n\t\t\t\tfill: '#4cb05e',\n\t\t\t\tlinedFill: '#7ec88c',\n\t\t\t\tframeHeadingStroke: '#6dbe7c',\n\t\t\t\tframeHeadingFill: '#f8fcf9',\n\t\t\t\tframeStroke: '#6dbe7c',\n\t\t\t\tframeFill: '#fafdfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#98D08A',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#dbf0e0',\n\t\t\t\tpattern: '#65cb78',\n\t\t\t\thighlightSrgb: '#65f641',\n\t\t\t\thighlightP3: 'color(display-p3 0.563 0.9495 0.3857)',\n\t\t\t},\n\t\t\t'light-red': {\n\t\t\t\tsolid: '#f87777',\n\t\t\t\tfill: '#f87777',\n\t\t\t\tlinedFill: '#f99a9a',\n\t\t\t\tframeHeadingStroke: '#f89090',\n\t\t\t\tframeHeadingFill: '#fffafa',\n\t\t\t\tframeStroke: '#f89090',\n\t\t\t\tframeFill: '#fffbfb',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#F7A5A1',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f4dadb',\n\t\t\t\tpattern: '#fe9e9e',\n\t\t\t\thighlightSrgb: '#ff7fa3',\n\t\t\t\thighlightP3: 'color(display-p3 0.9988 0.5301 0.6397)',\n\t\t\t},\n\t\t\t'light-violet': {\n\t\t\t\tsolid: '#e085f4',\n\t\t\t\tfill: '#e085f4',\n\t\t\t\tlinedFill: '#e9abf7',\n\t\t\t\tframeHeadingStroke: '#e59bf5',\n\t\t\t\tframeHeadingFill: '#fefaff',\n\t\t\t\tframeStroke: '#e59bf5',\n\t\t\t\tframeFill: '#fefbff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#DFB0F9',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f5eafa',\n\t\t\t\tpattern: '#e9acf8',\n\t\t\t\thighlightSrgb: '#ff88ff',\n\t\t\t\thighlightP3: 'color(display-p3 0.9676 0.5652 0.9999)',\n\t\t\t},\n\t\t\torange: {\n\t\t\t\tsolid: '#e16919',\n\t\t\t\tfill: '#e16919',\n\t\t\t\tlinedFill: '#ea8643',\n\t\t\t\tframeHeadingStroke: '#e68544',\n\t\t\t\tframeHeadingFill: '#fef9f6',\n\t\t\t\tframeStroke: '#e68544',\n\t\t\t\tframeFill: '#fef9f6',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FAA475',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f8e2d4',\n\t\t\t\tpattern: '#f78438',\n\t\t\t\thighlightSrgb: '#ffa500',\n\t\t\t\thighlightP3: 'color(display-p3 0.9988 0.6905 0.266)',\n\t\t\t},\n\t\t\tred: {\n\t\t\t\tsolid: '#e03131',\n\t\t\t\tfill: '#e03131',\n\t\t\t\tlinedFill: '#e75f5f',\n\t\t\t\tframeHeadingStroke: '#e55757',\n\t\t\t\tframeHeadingFill: '#fef7f7',\n\t\t\t\tframeStroke: '#e55757',\n\t\t\t\tframeFill: '#fef9f9',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FC8282',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f4dadb',\n\t\t\t\tpattern: '#e55959',\n\t\t\t\thighlightSrgb: '#ff636e',\n\t\t\t\thighlightP3: 'color(display-p3 0.9992 0.4376 0.45)',\n\t\t\t},\n\t\t\tviolet: {\n\t\t\t\tsolid: '#ae3ec9',\n\t\t\t\tfill: '#ae3ec9',\n\t\t\t\tlinedFill: '#be68d4',\n\t\t\t\tframeHeadingStroke: '#bc62d3',\n\t\t\t\tframeHeadingFill: '#fcf7fd',\n\t\t\t\tframeStroke: '#bc62d3',\n\t\t\t\tframeFill: '#fdf9fd',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#DB91FD',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#ecdcf2',\n\t\t\t\tpattern: '#bd63d3',\n\t\t\t\thighlightSrgb: '#c77cff',\n\t\t\t\thighlightP3: 'color(display-p3 0.7469 0.5089 0.9995)',\n\t\t\t},\n\t\t\tyellow: {\n\t\t\t\tsolid: '#f1ac4b',\n\t\t\t\tfill: '#f1ac4b',\n\t\t\t\tlinedFill: '#f5c27a',\n\t\t\t\tframeHeadingStroke: '#f3bb6c',\n\t\t\t\tframeHeadingFill: '#fefcf8',\n\t\t\t\tframeStroke: '#f3bb6c',\n\t\t\t\tframeFill: '#fffdfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FED49A',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f9f0e6',\n\t\t\t\tpattern: '#fecb92',\n\t\t\t\thighlightSrgb: '#fddd00',\n\t\t\t\thighlightP3: 'color(display-p3 0.972 0.8705 0.05)',\n\t\t\t},\n\t\t\twhite: {\n\t\t\t\tsolid: '#FFFFFF',\n\t\t\t\tfill: '#FFFFFF',\n\t\t\t\tlinedFill: '#ffffff',\n\t\t\t\tsemi: '#f5f5f5',\n\t\t\t\tpattern: '#f9f9f9',\n\t\t\t\tframeHeadingStroke: '#7d7d7d',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#7d7d7d',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FFFFFF',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\thighlightSrgb: '#ffffff',\n\t\t\t\thighlightP3: 'color(display-p3 1 1 1)',\n\t\t\t},\n\t\t},\n\t\tdark: {\n\t\t\ttext: 'hsl(210, 17%, 98%)',\n\t\t\tbackground: 'hsl(240, 5%, 6.5%)',\n\t\t\tnegativeSpace: 'hsl(240, 5%, 6.5%)',\n\t\t\tsolid: '#010403',\n\t\t\tcursor: 'white',\n\t\t\tsnap: 'hsl(0, 76%, 60%)',\n\t\t\tselectionStroke: 'hsl(214, 84%, 56%)',\n\t\t\tselectionFill: 'hsl(209, 100%, 57%, 20%)',\n\t\t\tbrushFill: 'hsl(0, 0%, 56%, 10.2%)',\n\t\t\tbrushStroke: 'hsl(0, 0%, 56%, 25.1%)',\n\t\t\tselectedContrast: '#ffffff',\n\t\t\tlaser: 'hsl(0, 100%, 50%)',\n\t\t\tnoteBorder: 'rgb(20, 20, 20)',\n\n\t\t\tblack: {\n\t\t\t\tsolid: '#f2f2f2',\n\t\t\t\tfill: '#f2f2f2',\n\t\t\t\tlinedFill: '#ffffff',\n\t\t\t\tframeHeadingStroke: '#5c5c5c',\n\t\t\t\tframeHeadingFill: '#252525',\n\t\t\t\tframeStroke: '#5c5c5c',\n\t\t\t\tframeFill: '#0c0c0c',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#2c2c2c',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2c3036',\n\t\t\t\tpattern: '#989898',\n\t\t\t\thighlightSrgb: '#d2b700',\n\t\t\t\thighlightP3: 'color(display-p3 0.8078 0.6225 0.0312)',\n\t\t\t},\n\t\t\tblue: {\n\t\t\t\tsolid: '#4f72fc', // 3c60f0\n\t\t\t\tfill: '#4f72fc',\n\t\t\t\tlinedFill: '#3c5cdd',\n\t\t\t\tframeHeadingStroke: '#384994',\n\t\t\t\tframeHeadingFill: '#1C2036',\n\t\t\t\tframeStroke: '#384994',\n\t\t\t\tframeFill: '#11141f',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#2A3F98',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#262d40',\n\t\t\t\tpattern: '#3a4b9e',\n\t\t\t\thighlightSrgb: '#0079d2',\n\t\t\t\thighlightP3: 'color(display-p3 0.0032 0.4655 0.7991)',\n\t\t\t},\n\t\t\tgreen: {\n\t\t\t\tsolid: '#099268',\n\t\t\t\tfill: '#099268',\n\t\t\t\tlinedFill: '#087856',\n\t\t\t\tframeHeadingStroke: '#10513C',\n\t\t\t\tframeHeadingFill: '#14241f',\n\t\t\t\tframeStroke: '#10513C',\n\t\t\t\tframeFill: '#0E1614',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#014429',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#253231',\n\t\t\t\tpattern: '#366a53',\n\t\t\t\thighlightSrgb: '#009774',\n\t\t\t\thighlightP3: 'color(display-p3 0.0085 0.582 0.4604)',\n\t\t\t},\n\t\t\tgrey: {\n\t\t\t\tsolid: '#9398b0',\n\t\t\t\tfill: '#9398b0',\n\t\t\t\tlinedFill: '#8388a5',\n\t\t\t\tframeHeadingStroke: '#42474D',\n\t\t\t\tframeHeadingFill: '#23262A',\n\t\t\t\tframeStroke: '#42474D',\n\t\t\t\tframeFill: '#151719',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#56595F',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#33373c',\n\t\t\t\tpattern: '#7c8187',\n\t\t\t\thighlightSrgb: '#9cb4cb',\n\t\t\t\thighlightP3: 'color(display-p3 0.6299 0.7012 0.7856)',\n\t\t\t},\n\t\t\t'light-blue': {\n\t\t\t\tsolid: '#4dabf7',\n\t\t\t\tfill: '#4dabf7',\n\t\t\t\tlinedFill: '#2793ec',\n\t\t\t\tframeHeadingStroke: '#075797',\n\t\t\t\tframeHeadingFill: '#142839',\n\t\t\t\tframeStroke: '#075797',\n\t\t\t\tframeFill: '#0B1823',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#1F5495',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2a3642',\n\t\t\t\tpattern: '#4d7aa9',\n\t\t\t\thighlightSrgb: '#00bdc8',\n\t\t\t\thighlightP3: 'color(display-p3 0.0023 0.7259 0.7735)',\n\t\t\t},\n\t\t\t'light-green': {\n\t\t\t\tsolid: '#40c057',\n\t\t\t\tfill: '#40c057',\n\t\t\t\tlinedFill: '#37a44b',\n\t\t\t\tframeHeadingStroke: '#1C5427',\n\t\t\t\tframeHeadingFill: '#18251A',\n\t\t\t\tframeStroke: '#1C5427',\n\t\t\t\tframeFill: '#0F1911',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#21581D',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2a3830',\n\t\t\t\tpattern: '#4e874e',\n\t\t\t\thighlightSrgb: '#00a000',\n\t\t\t\thighlightP3: 'color(display-p3 0.2711 0.6172 0.0195)',\n\t\t\t},\n\t\t\t'light-red': {\n\t\t\t\tsolid: '#ff8787',\n\t\t\t\tfill: '#ff8787',\n\t\t\t\tlinedFill: '#ff6666',\n\t\t\t\tframeHeadingStroke: '#6f3232',\n\t\t\t\tframeHeadingFill: '#341818',\n\t\t\t\tframeStroke: '#6f3232',\n\t\t\t\tframeFill: '#181212',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7a3333',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3c2b2b',\n\t\t\t\tpattern: '#a56767',\n\t\t\t\thighlightSrgb: '#db005b',\n\t\t\t\thighlightP3: 'color(display-p3 0.7849 0.0585 0.3589)',\n\t\t\t},\n\t\t\t'light-violet': {\n\t\t\t\tsolid: '#e599f7',\n\t\t\t\tfill: '#e599f7',\n\t\t\t\tlinedFill: '#dc71f4',\n\t\t\t\tframeHeadingStroke: '#6c367a',\n\t\t\t\tframeHeadingFill: '#2D2230',\n\t\t\t\tframeStroke: '#6c367a',\n\t\t\t\tframeFill: '#1C151E',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#762F8E',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#383442',\n\t\t\t\tpattern: '#9770a9',\n\t\t\t\thighlightSrgb: '#c400c7',\n\t\t\t\thighlightP3: 'color(display-p3 0.7024 0.0403 0.753)',\n\t\t\t},\n\t\t\torange: {\n\t\t\t\tsolid: '#f76707',\n\t\t\t\tfill: '#f76707',\n\t\t\t\tlinedFill: '#f54900',\n\t\t\t\tframeHeadingStroke: '#773a0e',\n\t\t\t\tframeHeadingFill: '#2f1d13',\n\t\t\t\tframeStroke: '#773a0e',\n\t\t\t\tframeFill: '#1c1512',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7c3905',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3b2e27',\n\t\t\t\tpattern: '#9f552d',\n\t\t\t\thighlightSrgb: '#d07a00',\n\t\t\t\thighlightP3: 'color(display-p3 0.7699 0.4937 0.0085)',\n\t\t\t},\n\t\t\tred: {\n\t\t\t\tsolid: '#e03131',\n\t\t\t\tfill: '#e03131',\n\t\t\t\tlinedFill: '#c31d1d',\n\t\t\t\tframeHeadingStroke: '#701e1e',\n\t\t\t\tframeHeadingFill: '#301616',\n\t\t\t\tframeStroke: '#701e1e',\n\t\t\t\tframeFill: '#1b1313',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7e201f',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#382726',\n\t\t\t\tpattern: '#8f3734',\n\t\t\t\thighlightSrgb: '#de002c',\n\t\t\t\thighlightP3: 'color(display-p3 0.7978 0.0509 0.2035)',\n\t\t\t},\n\t\t\tviolet: {\n\t\t\t\tsolid: '#ae3ec9',\n\t\t\t\tfill: '#ae3ec9',\n\t\t\t\tlinedFill: '#8f2fa7',\n\t\t\t\tframeHeadingStroke: '#6d1583',\n\t\t\t\tframeHeadingFill: '#27152e',\n\t\t\t\tframeStroke: '#6d1583',\n\t\t\t\tframeFill: '#1b0f21',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#5f1c70',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#342938',\n\t\t\t\tpattern: '#763a8b',\n\t\t\t\thighlightSrgb: '#9e00ee',\n\t\t\t\thighlightP3: 'color(display-p3 0.5651 0.0079 0.8986)',\n\t\t\t},\n\t\t\tyellow: {\n\t\t\t\tsolid: '#ffc034',\n\t\t\t\tfill: '#ffc034',\n\t\t\t\tlinedFill: '#ffae00',\n\t\t\t\tframeHeadingStroke: '#684e12',\n\t\t\t\tframeHeadingFill: '#2a2113',\n\t\t\t\tframeStroke: '#684e12',\n\t\t\t\tframeFill: '#1e1911',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#8a5e1c',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3b352b',\n\t\t\t\tpattern: '#fecb92',\n\t\t\t\thighlightSrgb: '#d2b700',\n\t\t\t\thighlightP3: 'color(display-p3 0.8078 0.7225 0.0312)',\n\t\t\t},\n\t\t\twhite: {\n\t\t\t\tsolid: '#f3f3f3',\n\t\t\t\tfill: '#f3f3f3',\n\t\t\t\tlinedFill: '#f3f3f3',\n\t\t\t\tsemi: '#f5f5f5',\n\t\t\t\tpattern: '#f9f9f9',\n\t\t\t\tframeHeadingStroke: '#ffffff',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#ffffff',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#eaeaea',\n\t\t\t\tnoteText: '#1d1d1d',\n\t\t\t\thighlightSrgb: '#ffffff',\n\t\t\t\thighlightP3: 'color(display-p3 1 1 1)',\n\t\t\t},\n\t\t},\n\t},\n}\n\n/**\n * Resolves a color style value to its actual CSS color string for a given theme and variant.\n * If the color is not a default theme color, returns the color value as-is.\n *\n * @param colors - The color palette for the current color mode (e.g. `theme.colors[colorMode]`)\n * @param color - The color style value to resolve\n * @param variant - Which variant of the color to return (solid, fill, pattern, etc.)\n * @returns The CSS color string for the specified color and variant\n *\n * @example\n * ```ts\n * import { getColorValue } from 'tldraw'\n *\n * const colors = editor.getCurrentTheme().colors[editor.getColorMode()]\n *\n * // Get the solid variant of red\n * const redSolid = getColorValue(colors, 'red', 'solid') // '#e03131'\n *\n * // Get the fill variant of blue\n * const blueFill = getColorValue(colors, 'blue', 'fill') // '#4465e9'\n *\n * // Custom color passes through unchanged\n * const customColor = getColorValue(colors, '#ff0000', 'solid') // '#ff0000'\n * ```\n *\n * @public\n */\nexport function getColorValue(\n\tcolors: TLThemeColors,\n\tcolor: TLDefaultColorStyle | string,\n\tvariant: keyof TLDefaultColor\n): string {\n\tconst colorEntry = colors[color as TLDefaultColorStyle]\n\tif (!colorEntry || typeof colorEntry === 'string') {\n\t\treturn color\n\t}\n\treturn colorEntry[variant]\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMO;
|
|
4
|
+
"sourcesContent": ["import {\n\tDefaultFontFamilies,\n\tTLDefaultColor,\n\tTLDefaultColorStyle,\n\tTLTheme,\n\tTLThemeColors,\n} from '@tldraw/tlschema'\nimport { DRAW_FONT_CHECKBOX } from './drawFontCheckbox'\n\n/**\n * The default theme definition containing color palettes for both light and dark modes.\n *\n * @public\n */\nexport const DEFAULT_THEME: TLTheme = {\n\tid: 'default',\n\tfontSize: 16,\n\tlineHeight: 1.35,\n\tstrokeWidth: 2,\n\tfonts: {\n\t\tdraw: {\n\t\t\tfontFamily: DefaultFontFamilies.draw,\n\t\t\tfaces: [\n\t\t\t\t{ family: 'tldraw_draw', src: { url: 'tldraw_draw', format: 'woff2' }, weight: 'normal' },\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_draw',\n\t\t\t\t\tsrc: { url: 'tldraw_draw_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t\tcheckbox: DRAW_FONT_CHECKBOX,\n\t\t},\n\t\tsans: {\n\t\t\tfontFamily: DefaultFontFamilies.sans,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_sans',\n\t\t\t\t\tsrc: { url: 'tldraw_sans_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tserif: {\n\t\t\tfontFamily: DefaultFontFamilies.serif,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_serif',\n\t\t\t\t\tsrc: { url: 'tldraw_serif_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tmono: {\n\t\t\tfontFamily: DefaultFontFamilies.mono,\n\t\t\tfaces: [\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'normal',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_italic', format: 'woff2' },\n\t\t\t\t\tweight: 'normal',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tfamily: 'tldraw_mono',\n\t\t\t\t\tsrc: { url: 'tldraw_mono_italic_bold', format: 'woff2' },\n\t\t\t\t\tweight: 'bold',\n\t\t\t\t\tstyle: 'italic',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tcolors: {\n\t\tlight: {\n\t\t\ttext: '#000000',\n\t\t\tbackground: '#f9fafb',\n\t\t\tnegativeSpace: '#f9fafb',\n\t\t\tsolid: '#fcfffe',\n\t\t\tcursor: 'black',\n\t\t\tnoteBorder: 'rgb(144, 144, 144)',\n\t\t\tsnap: 'hsl(0, 76%, 60%)',\n\t\t\tselectionStroke: 'hsl(214, 84%, 56%)',\n\t\t\tselectionFill: 'hsl(210, 100%, 56%, 24%)',\n\t\t\tbrushFill: 'hsl(0, 0%, 56%, 10.2%)',\n\t\t\tbrushStroke: 'hsl(0, 0%, 56%, 25.1%)',\n\t\t\tselectedContrast: '#ffffff',\n\t\t\tlaser: 'hsl(0, 100%, 50%)',\n\t\t\tblack: {\n\t\t\t\tsolid: '#1d1d1d',\n\t\t\t\tfill: '#1d1d1d',\n\t\t\t\tlinedFill: '#363636',\n\t\t\t\tframeHeadingStroke: '#717171',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#717171',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FCE19C',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#e8e8e8',\n\t\t\t\tpattern: '#494949',\n\t\t\t\thighlightSrgb: '#fddd00',\n\t\t\t\thighlightP3: 'color(display-p3 0.972 0.8205 0.05)',\n\t\t\t},\n\t\t\tblue: {\n\t\t\t\tsolid: '#4465e9',\n\t\t\t\tfill: '#4465e9',\n\t\t\t\tlinedFill: '#6580ec',\n\t\t\t\tframeHeadingStroke: '#6681ec',\n\t\t\t\tframeHeadingFill: '#f9fafe',\n\t\t\t\tframeStroke: '#6681ec',\n\t\t\t\tframeFill: '#f9fafe',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#8AA3FF',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#dce1f8',\n\t\t\t\tpattern: '#6681ee',\n\t\t\t\thighlightSrgb: '#10acff',\n\t\t\t\thighlightP3: 'color(display-p3 0.308 0.6632 0.9996)',\n\t\t\t},\n\t\t\tgreen: {\n\t\t\t\tsolid: '#099268',\n\t\t\t\tfill: '#099268',\n\t\t\t\tlinedFill: '#0bad7c',\n\t\t\t\tframeHeadingStroke: '#37a684',\n\t\t\t\tframeHeadingFill: '#f8fcfa',\n\t\t\t\tframeStroke: '#37a684',\n\t\t\t\tframeFill: '#f8fcfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#6FC896',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#d3e9e3',\n\t\t\t\tpattern: '#39a785',\n\t\t\t\thighlightSrgb: '#00ffc8',\n\t\t\t\thighlightP3: 'color(display-p3 0.2536 0.984 0.7981)',\n\t\t\t},\n\t\t\tgrey: {\n\t\t\t\tsolid: '#9fa8b2',\n\t\t\t\tfill: '#9fa8b2',\n\t\t\t\tlinedFill: '#bbc1c9',\n\t\t\t\tframeHeadingStroke: '#aaaaab',\n\t\t\t\tframeHeadingFill: '#fbfcfc',\n\t\t\t\tframeStroke: '#aaaaab',\n\t\t\t\tframeFill: '#fcfcfd',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#C0CAD3',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#eceef0',\n\t\t\t\tpattern: '#bcc3c9',\n\t\t\t\thighlightSrgb: '#cbe7f1',\n\t\t\t\thighlightP3: 'color(display-p3 0.8163 0.9023 0.9416)',\n\t\t\t},\n\t\t\t'light-blue': {\n\t\t\t\tsolid: '#4ba1f1',\n\t\t\t\tfill: '#4ba1f1',\n\t\t\t\tlinedFill: '#7abaf5',\n\t\t\t\tframeHeadingStroke: '#6cb2f3',\n\t\t\t\tframeHeadingFill: '#f8fbfe',\n\t\t\t\tframeStroke: '#6cb2f3',\n\t\t\t\tframeFill: '#fafcff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#9BC4FD',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#ddedfa',\n\t\t\t\tpattern: '#6fbbf8',\n\t\t\t\thighlightSrgb: '#00f4ff',\n\t\t\t\thighlightP3: 'color(display-p3 0.1512 0.9414 0.9996)',\n\t\t\t},\n\t\t\t'light-green': {\n\t\t\t\tsolid: '#4cb05e',\n\t\t\t\tfill: '#4cb05e',\n\t\t\t\tlinedFill: '#7ec88c',\n\t\t\t\tframeHeadingStroke: '#6dbe7c',\n\t\t\t\tframeHeadingFill: '#f8fcf9',\n\t\t\t\tframeStroke: '#6dbe7c',\n\t\t\t\tframeFill: '#fafdfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#98D08A',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#dbf0e0',\n\t\t\t\tpattern: '#65cb78',\n\t\t\t\thighlightSrgb: '#65f641',\n\t\t\t\thighlightP3: 'color(display-p3 0.563 0.9495 0.3857)',\n\t\t\t},\n\t\t\t'light-red': {\n\t\t\t\tsolid: '#f87777',\n\t\t\t\tfill: '#f87777',\n\t\t\t\tlinedFill: '#f99a9a',\n\t\t\t\tframeHeadingStroke: '#f89090',\n\t\t\t\tframeHeadingFill: '#fffafa',\n\t\t\t\tframeStroke: '#f89090',\n\t\t\t\tframeFill: '#fffbfb',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#F7A5A1',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f4dadb',\n\t\t\t\tpattern: '#fe9e9e',\n\t\t\t\thighlightSrgb: '#ff7fa3',\n\t\t\t\thighlightP3: 'color(display-p3 0.9988 0.5301 0.6397)',\n\t\t\t},\n\t\t\t'light-violet': {\n\t\t\t\tsolid: '#e085f4',\n\t\t\t\tfill: '#e085f4',\n\t\t\t\tlinedFill: '#e9abf7',\n\t\t\t\tframeHeadingStroke: '#e59bf5',\n\t\t\t\tframeHeadingFill: '#fefaff',\n\t\t\t\tframeStroke: '#e59bf5',\n\t\t\t\tframeFill: '#fefbff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#DFB0F9',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f5eafa',\n\t\t\t\tpattern: '#e9acf8',\n\t\t\t\thighlightSrgb: '#ff88ff',\n\t\t\t\thighlightP3: 'color(display-p3 0.9676 0.5652 0.9999)',\n\t\t\t},\n\t\t\torange: {\n\t\t\t\tsolid: '#e16919',\n\t\t\t\tfill: '#e16919',\n\t\t\t\tlinedFill: '#ea8643',\n\t\t\t\tframeHeadingStroke: '#e68544',\n\t\t\t\tframeHeadingFill: '#fef9f6',\n\t\t\t\tframeStroke: '#e68544',\n\t\t\t\tframeFill: '#fef9f6',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FAA475',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f8e2d4',\n\t\t\t\tpattern: '#f78438',\n\t\t\t\thighlightSrgb: '#ffa500',\n\t\t\t\thighlightP3: 'color(display-p3 0.9988 0.6905 0.266)',\n\t\t\t},\n\t\t\tred: {\n\t\t\t\tsolid: '#e03131',\n\t\t\t\tfill: '#e03131',\n\t\t\t\tlinedFill: '#e75f5f',\n\t\t\t\tframeHeadingStroke: '#e55757',\n\t\t\t\tframeHeadingFill: '#fef7f7',\n\t\t\t\tframeStroke: '#e55757',\n\t\t\t\tframeFill: '#fef9f9',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FC8282',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f4dadb',\n\t\t\t\tpattern: '#e55959',\n\t\t\t\thighlightSrgb: '#ff636e',\n\t\t\t\thighlightP3: 'color(display-p3 0.9992 0.4376 0.45)',\n\t\t\t},\n\t\t\tviolet: {\n\t\t\t\tsolid: '#ae3ec9',\n\t\t\t\tfill: '#ae3ec9',\n\t\t\t\tlinedFill: '#be68d4',\n\t\t\t\tframeHeadingStroke: '#bc62d3',\n\t\t\t\tframeHeadingFill: '#fcf7fd',\n\t\t\t\tframeStroke: '#bc62d3',\n\t\t\t\tframeFill: '#fdf9fd',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#DB91FD',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#ecdcf2',\n\t\t\t\tpattern: '#bd63d3',\n\t\t\t\thighlightSrgb: '#c77cff',\n\t\t\t\thighlightP3: 'color(display-p3 0.7469 0.5089 0.9995)',\n\t\t\t},\n\t\t\tyellow: {\n\t\t\t\tsolid: '#f1ac4b',\n\t\t\t\tfill: '#f1ac4b',\n\t\t\t\tlinedFill: '#f5c27a',\n\t\t\t\tframeHeadingStroke: '#f3bb6c',\n\t\t\t\tframeHeadingFill: '#fefcf8',\n\t\t\t\tframeStroke: '#f3bb6c',\n\t\t\t\tframeFill: '#fffdfa',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FED49A',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\tsemi: '#f9f0e6',\n\t\t\t\tpattern: '#fecb92',\n\t\t\t\thighlightSrgb: '#fddd00',\n\t\t\t\thighlightP3: 'color(display-p3 0.972 0.8705 0.05)',\n\t\t\t},\n\t\t\twhite: {\n\t\t\t\tsolid: '#FFFFFF',\n\t\t\t\tfill: '#FFFFFF',\n\t\t\t\tlinedFill: '#ffffff',\n\t\t\t\tsemi: '#f5f5f5',\n\t\t\t\tpattern: '#f9f9f9',\n\t\t\t\tframeHeadingStroke: '#7d7d7d',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#7d7d7d',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#FFFFFF',\n\t\t\t\tnoteText: '#000000',\n\t\t\t\thighlightSrgb: '#ffffff',\n\t\t\t\thighlightP3: 'color(display-p3 1 1 1)',\n\t\t\t},\n\t\t},\n\t\tdark: {\n\t\t\ttext: 'hsl(210, 17%, 98%)',\n\t\t\tbackground: 'hsl(240, 5%, 6.5%)',\n\t\t\tnegativeSpace: 'hsl(240, 5%, 6.5%)',\n\t\t\tsolid: '#010403',\n\t\t\tcursor: 'white',\n\t\t\tsnap: 'hsl(0, 76%, 60%)',\n\t\t\tselectionStroke: 'hsl(214, 84%, 56%)',\n\t\t\tselectionFill: 'hsl(209, 100%, 57%, 20%)',\n\t\t\tbrushFill: 'hsl(0, 0%, 56%, 10.2%)',\n\t\t\tbrushStroke: 'hsl(0, 0%, 56%, 25.1%)',\n\t\t\tselectedContrast: '#ffffff',\n\t\t\tlaser: 'hsl(0, 100%, 50%)',\n\t\t\tnoteBorder: 'rgb(20, 20, 20)',\n\n\t\t\tblack: {\n\t\t\t\tsolid: '#f2f2f2',\n\t\t\t\tfill: '#f2f2f2',\n\t\t\t\tlinedFill: '#ffffff',\n\t\t\t\tframeHeadingStroke: '#5c5c5c',\n\t\t\t\tframeHeadingFill: '#252525',\n\t\t\t\tframeStroke: '#5c5c5c',\n\t\t\t\tframeFill: '#0c0c0c',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#2c2c2c',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2c3036',\n\t\t\t\tpattern: '#989898',\n\t\t\t\thighlightSrgb: '#d2b700',\n\t\t\t\thighlightP3: 'color(display-p3 0.8078 0.6225 0.0312)',\n\t\t\t},\n\t\t\tblue: {\n\t\t\t\tsolid: '#4f72fc', // 3c60f0\n\t\t\t\tfill: '#4f72fc',\n\t\t\t\tlinedFill: '#3c5cdd',\n\t\t\t\tframeHeadingStroke: '#384994',\n\t\t\t\tframeHeadingFill: '#1C2036',\n\t\t\t\tframeStroke: '#384994',\n\t\t\t\tframeFill: '#11141f',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#2A3F98',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#262d40',\n\t\t\t\tpattern: '#3a4b9e',\n\t\t\t\thighlightSrgb: '#0079d2',\n\t\t\t\thighlightP3: 'color(display-p3 0.0032 0.4655 0.7991)',\n\t\t\t},\n\t\t\tgreen: {\n\t\t\t\tsolid: '#099268',\n\t\t\t\tfill: '#099268',\n\t\t\t\tlinedFill: '#087856',\n\t\t\t\tframeHeadingStroke: '#10513C',\n\t\t\t\tframeHeadingFill: '#14241f',\n\t\t\t\tframeStroke: '#10513C',\n\t\t\t\tframeFill: '#0E1614',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#014429',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#253231',\n\t\t\t\tpattern: '#366a53',\n\t\t\t\thighlightSrgb: '#009774',\n\t\t\t\thighlightP3: 'color(display-p3 0.0085 0.582 0.4604)',\n\t\t\t},\n\t\t\tgrey: {\n\t\t\t\tsolid: '#9398b0',\n\t\t\t\tfill: '#9398b0',\n\t\t\t\tlinedFill: '#8388a5',\n\t\t\t\tframeHeadingStroke: '#42474D',\n\t\t\t\tframeHeadingFill: '#23262A',\n\t\t\t\tframeStroke: '#42474D',\n\t\t\t\tframeFill: '#151719',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#56595F',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#33373c',\n\t\t\t\tpattern: '#7c8187',\n\t\t\t\thighlightSrgb: '#9cb4cb',\n\t\t\t\thighlightP3: 'color(display-p3 0.6299 0.7012 0.7856)',\n\t\t\t},\n\t\t\t'light-blue': {\n\t\t\t\tsolid: '#4dabf7',\n\t\t\t\tfill: '#4dabf7',\n\t\t\t\tlinedFill: '#2793ec',\n\t\t\t\tframeHeadingStroke: '#075797',\n\t\t\t\tframeHeadingFill: '#142839',\n\t\t\t\tframeStroke: '#075797',\n\t\t\t\tframeFill: '#0B1823',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#1F5495',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2a3642',\n\t\t\t\tpattern: '#4d7aa9',\n\t\t\t\thighlightSrgb: '#00bdc8',\n\t\t\t\thighlightP3: 'color(display-p3 0.0023 0.7259 0.7735)',\n\t\t\t},\n\t\t\t'light-green': {\n\t\t\t\tsolid: '#40c057',\n\t\t\t\tfill: '#40c057',\n\t\t\t\tlinedFill: '#37a44b',\n\t\t\t\tframeHeadingStroke: '#1C5427',\n\t\t\t\tframeHeadingFill: '#18251A',\n\t\t\t\tframeStroke: '#1C5427',\n\t\t\t\tframeFill: '#0F1911',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#21581D',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#2a3830',\n\t\t\t\tpattern: '#4e874e',\n\t\t\t\thighlightSrgb: '#00a000',\n\t\t\t\thighlightP3: 'color(display-p3 0.2711 0.6172 0.0195)',\n\t\t\t},\n\t\t\t'light-red': {\n\t\t\t\tsolid: '#ff8787',\n\t\t\t\tfill: '#ff8787',\n\t\t\t\tlinedFill: '#ff6666',\n\t\t\t\tframeHeadingStroke: '#6f3232',\n\t\t\t\tframeHeadingFill: '#341818',\n\t\t\t\tframeStroke: '#6f3232',\n\t\t\t\tframeFill: '#181212',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7a3333',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3c2b2b',\n\t\t\t\tpattern: '#a56767',\n\t\t\t\thighlightSrgb: '#db005b',\n\t\t\t\thighlightP3: 'color(display-p3 0.7849 0.0585 0.3589)',\n\t\t\t},\n\t\t\t'light-violet': {\n\t\t\t\tsolid: '#e599f7',\n\t\t\t\tfill: '#e599f7',\n\t\t\t\tlinedFill: '#dc71f4',\n\t\t\t\tframeHeadingStroke: '#6c367a',\n\t\t\t\tframeHeadingFill: '#2D2230',\n\t\t\t\tframeStroke: '#6c367a',\n\t\t\t\tframeFill: '#1C151E',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#762F8E',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#383442',\n\t\t\t\tpattern: '#9770a9',\n\t\t\t\thighlightSrgb: '#c400c7',\n\t\t\t\thighlightP3: 'color(display-p3 0.7024 0.0403 0.753)',\n\t\t\t},\n\t\t\torange: {\n\t\t\t\tsolid: '#f76707',\n\t\t\t\tfill: '#f76707',\n\t\t\t\tlinedFill: '#f54900',\n\t\t\t\tframeHeadingStroke: '#773a0e',\n\t\t\t\tframeHeadingFill: '#2f1d13',\n\t\t\t\tframeStroke: '#773a0e',\n\t\t\t\tframeFill: '#1c1512',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7c3905',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3b2e27',\n\t\t\t\tpattern: '#9f552d',\n\t\t\t\thighlightSrgb: '#d07a00',\n\t\t\t\thighlightP3: 'color(display-p3 0.7699 0.4937 0.0085)',\n\t\t\t},\n\t\t\tred: {\n\t\t\t\tsolid: '#e03131',\n\t\t\t\tfill: '#e03131',\n\t\t\t\tlinedFill: '#c31d1d',\n\t\t\t\tframeHeadingStroke: '#701e1e',\n\t\t\t\tframeHeadingFill: '#301616',\n\t\t\t\tframeStroke: '#701e1e',\n\t\t\t\tframeFill: '#1b1313',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#7e201f',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#382726',\n\t\t\t\tpattern: '#8f3734',\n\t\t\t\thighlightSrgb: '#de002c',\n\t\t\t\thighlightP3: 'color(display-p3 0.7978 0.0509 0.2035)',\n\t\t\t},\n\t\t\tviolet: {\n\t\t\t\tsolid: '#ae3ec9',\n\t\t\t\tfill: '#ae3ec9',\n\t\t\t\tlinedFill: '#8f2fa7',\n\t\t\t\tframeHeadingStroke: '#6d1583',\n\t\t\t\tframeHeadingFill: '#27152e',\n\t\t\t\tframeStroke: '#6d1583',\n\t\t\t\tframeFill: '#1b0f21',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#5f1c70',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#342938',\n\t\t\t\tpattern: '#763a8b',\n\t\t\t\thighlightSrgb: '#9e00ee',\n\t\t\t\thighlightP3: 'color(display-p3 0.5651 0.0079 0.8986)',\n\t\t\t},\n\t\t\tyellow: {\n\t\t\t\tsolid: '#ffc034',\n\t\t\t\tfill: '#ffc034',\n\t\t\t\tlinedFill: '#ffae00',\n\t\t\t\tframeHeadingStroke: '#684e12',\n\t\t\t\tframeHeadingFill: '#2a2113',\n\t\t\t\tframeStroke: '#684e12',\n\t\t\t\tframeFill: '#1e1911',\n\t\t\t\tframeText: '#f2f2f2',\n\t\t\t\tnoteFill: '#8a5e1c',\n\t\t\t\tnoteText: '#f2f2f2',\n\t\t\t\tsemi: '#3b352b',\n\t\t\t\tpattern: '#fecb92',\n\t\t\t\thighlightSrgb: '#d2b700',\n\t\t\t\thighlightP3: 'color(display-p3 0.8078 0.7225 0.0312)',\n\t\t\t},\n\t\t\twhite: {\n\t\t\t\tsolid: '#f3f3f3',\n\t\t\t\tfill: '#f3f3f3',\n\t\t\t\tlinedFill: '#f3f3f3',\n\t\t\t\tsemi: '#f5f5f5',\n\t\t\t\tpattern: '#f9f9f9',\n\t\t\t\tframeHeadingStroke: '#ffffff',\n\t\t\t\tframeHeadingFill: '#ffffff',\n\t\t\t\tframeStroke: '#ffffff',\n\t\t\t\tframeFill: '#ffffff',\n\t\t\t\tframeText: '#000000',\n\t\t\t\tnoteFill: '#eaeaea',\n\t\t\t\tnoteText: '#1d1d1d',\n\t\t\t\thighlightSrgb: '#ffffff',\n\t\t\t\thighlightP3: 'color(display-p3 1 1 1)',\n\t\t\t},\n\t\t},\n\t},\n}\n\n/**\n * Resolves a color style value to its actual CSS color string for a given theme and variant.\n * If the color is not a default theme color, returns the color value as-is.\n *\n * @param colors - The color palette for the current color mode (e.g. `theme.colors[colorMode]`)\n * @param color - The color style value to resolve\n * @param variant - Which variant of the color to return (solid, fill, pattern, etc.)\n * @returns The CSS color string for the specified color and variant\n *\n * @example\n * ```ts\n * import { getColorValue } from 'tldraw'\n *\n * const colors = editor.getCurrentTheme().colors[editor.getColorMode()]\n *\n * // Get the solid variant of red\n * const redSolid = getColorValue(colors, 'red', 'solid') // '#e03131'\n *\n * // Get the fill variant of blue\n * const blueFill = getColorValue(colors, 'blue', 'fill') // '#4465e9'\n *\n * // Custom color passes through unchanged\n * const customColor = getColorValue(colors, '#ff0000', 'solid') // '#ff0000'\n * ```\n *\n * @public\n */\nexport function getColorValue(\n\tcolors: TLThemeColors,\n\tcolor: TLDefaultColorStyle | string,\n\tvariant: keyof TLDefaultColor\n): string {\n\tconst colorEntry = colors[color as TLDefaultColorStyle]\n\tif (!colorEntry || typeof colorEntry === 'string') {\n\t\treturn color\n\t}\n\treturn colorEntry[variant]\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMO;AACP,8BAAmC;AAO5B,MAAM,gBAAyB;AAAA,EACrC,IAAI;AAAA,EACJ,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,OAAO;AAAA,IACN,MAAM;AAAA,MACL,YAAY,oCAAoB;AAAA,MAChC,OAAO;AAAA,QACN,EAAE,QAAQ,eAAe,KAAK,EAAE,KAAK,eAAe,QAAQ,QA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S;AACT,QAAM,aAAa,OAAO,KAA4B;AACtD,MAAI,CAAC,cAAc,OAAO,eAAe,UAAU;AAClD,WAAO;AAAA,EACR;AACA,SAAO,WAAW,OAAO;AAC1B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 drawFontCheckbox_exports = {};
|
|
20
|
+
__export(drawFontCheckbox_exports, {
|
|
21
|
+
DRAW_FONT_CHECKBOX: () => DRAW_FONT_CHECKBOX
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(drawFontCheckbox_exports);
|
|
24
|
+
const DRAW_FONT_CHECKBOX = {
|
|
25
|
+
boxes: [
|
|
26
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.82 -3.88 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.7942 -0.7977 L 20.9303 0.1728 Q 27.9303 0.1728 27.9303 6.6728 L 27.563 18.8742 Q 27.563 25.3742 20.563 25.3742 L 6.7319 25.3957 Q -0.2681 25.3957 -0.2681 18.8957 L 0.7942 5.7023 Q 0.7942 -0.7977 7.7942 -0.7977 M 8.032 -0.1323 L 20.7344 -0.3169 Q 27.7344 -0.3169 27.7344 6.1831 L 28.1662 20.0728 Q 28.1662 26.5728 21.1662 26.5728 L 7.689 25.7836 Q 0.689 25.7836 0.689 19.2836 L 1.032 6.3677 Q 1.032 -0.1323 8.032 -0.1323' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E",
|
|
27
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.95 -3.81 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.2504 0.4966 L 21.5032 -0.5973 Q 28.5032 -0.5973 28.5032 5.9027 L 27.5021 19.2322 Q 27.5021 25.7322 20.5021 25.7322 L 8.1299 26.0094 Q 1.1299 26.0094 1.1299 19.5094 L -0.7496 6.9966 Q -0.7496 0.4966 6.2504 0.4966 M 6.4494 0.8401 L 21.4457 0.4984 Q 28.4457 0.4984 28.4457 6.9984 L 28.2656 19.6803 Q 28.2656 26.1803 21.2656 26.1803 L 6.1284 26.511 Q -0.8716 26.511 -0.8716 20.011 L -0.5506 7.3401 Q -0.5506 0.8401 6.4494 0.8401' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E",
|
|
28
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.6 -3.86 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.6462 0.7616 L 19.9118 0.0937 Q 26.9118 0.0937 26.9118 6.5937 L 27.233 19.5467 Q 27.233 26.0467 20.233 26.0467 L 7.4038 26.3203 Q 0.4038 26.3203 0.4038 19.8203 L 0.6462 7.2616 Q 0.6462 0.7616 7.6462 0.7616 M 7.1783 0.9003 L 20.1038 -0.5038 Q 27.1038 -0.5038 27.1038 5.9962 L 28.409 19.0812 Q 28.409 25.5812 21.409 25.5812 L 6.9218 26.062 Q -0.0782 26.062 -0.0782 19.562 L 0.1783 7.4003 Q 0.1783 0.9003 7.1783 0.9003' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E",
|
|
29
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.62 -3.36 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.4356 0.5013 L 21.8359 0.6755 Q 28.8359 0.6755 28.8359 7.1755 L 28.1881 18.6065 Q 28.1881 25.1065 21.1881 25.1065 L 8.1605 25.8971 Q 1.1605 25.8971 1.1605 19.3971 L -0.5644 7.0013 Q -0.5644 0.5013 6.4356 0.5013 M 6.6292 0.531 L 22.1652 -0.0355 Q 29.1652 -0.0355 29.1652 6.4645 L 27.4982 20.3388 Q 27.4982 26.8388 20.4982 26.8388 L 6.1336 25.4065 Q -0.8664 25.4065 -0.8664 18.9065 L -0.3708 7.031 Q -0.3708 0.531 6.6292 0.531' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E",
|
|
30
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.58 -3.98 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.4122 -1.0816 L 20.5836 -0.3961 Q 27.5836 -0.3961 27.5836 6.1039 L 28.6339 20.1467 Q 28.6339 26.6467 21.6339 26.6467 L 6.717 26.007 Q -0.283 26.007 -0.283 19.507 L 0.4122 5.4184 Q 0.4122 -1.0816 7.4122 -1.0816 M 7.8241 -0.7087 L 20.7916 0.2964 Q 27.7916 0.2964 27.7916 6.7964 L 27.0591 19.2197 Q 27.0591 25.7197 20.0591 25.7197 L 7.4822 26.3218 Q 0.4822 26.3218 0.4822 19.8218 L 0.8241 5.7913 Q 0.8241 -0.7087 7.8241 -0.7087' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E",
|
|
31
|
+
"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.94 -3.81 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.1214 -0.381 L 21.2459 0.7554 Q 28.2459 0.7554 28.2459 7.2554 L 28.5419 18.8817 Q 28.5419 25.3817 21.5419 25.3817 L 8.1179 26.2372 Q 1.1179 26.2372 1.1179 19.7372 L -0.8786 6.119 Q -0.8786 -0.381 6.1214 -0.381 M 6.3687 -0.5776 L 21.2599 -0.5987 Q 28.2599 -0.5987 28.2599 5.9013 L 27.3476 19.5423 Q 27.3476 26.0423 20.3476 26.0423 L 6.1089 26.506 Q -0.8911 26.506 -0.8911 20.006 L -0.6313 5.9224 Q -0.6313 -0.5776 6.3687 -0.5776' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E"
|
|
32
|
+
],
|
|
33
|
+
tick: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M34.87 62.29L42.93 71.72L63.5 47.63' fill='none' stroke='%23000' stroke-width='10.55' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=drawFontCheckbox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/lib/editor/managers/ThemeManager/drawFontCheckbox.ts"],
|
|
4
|
+
"sourcesContent": ["import { TLThemeFontCheckbox } from '@tldraw/tlschema'\n\n/**\n * The draw font's checkboxes: draw-dash rectangles taken off the canvas, so a checkbox reads as\n * drawn alongside the shapes around it, and a round-capped tick. Each box is two passes around the\n * same rectangle, which is where its uneven weight comes from.\n */\nexport const DRAW_FONT_CHECKBOX: TLThemeFontCheckbox = {\n\tboxes: [\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.82 -3.88 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.7942 -0.7977 L 20.9303 0.1728 Q 27.9303 0.1728 27.9303 6.6728 L 27.563 18.8742 Q 27.563 25.3742 20.563 25.3742 L 6.7319 25.3957 Q -0.2681 25.3957 -0.2681 18.8957 L 0.7942 5.7023 Q 0.7942 -0.7977 7.7942 -0.7977 M 8.032 -0.1323 L 20.7344 -0.3169 Q 27.7344 -0.3169 27.7344 6.1831 L 28.1662 20.0728 Q 28.1662 26.5728 21.1662 26.5728 L 7.689 25.7836 Q 0.689 25.7836 0.689 19.2836 L 1.032 6.3677 Q 1.032 -0.1323 8.032 -0.1323' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.95 -3.81 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.2504 0.4966 L 21.5032 -0.5973 Q 28.5032 -0.5973 28.5032 5.9027 L 27.5021 19.2322 Q 27.5021 25.7322 20.5021 25.7322 L 8.1299 26.0094 Q 1.1299 26.0094 1.1299 19.5094 L -0.7496 6.9966 Q -0.7496 0.4966 6.2504 0.4966 M 6.4494 0.8401 L 21.4457 0.4984 Q 28.4457 0.4984 28.4457 6.9984 L 28.2656 19.6803 Q 28.2656 26.1803 21.2656 26.1803 L 6.1284 26.511 Q -0.8716 26.511 -0.8716 20.011 L -0.5506 7.3401 Q -0.5506 0.8401 6.4494 0.8401' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.6 -3.86 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.6462 0.7616 L 19.9118 0.0937 Q 26.9118 0.0937 26.9118 6.5937 L 27.233 19.5467 Q 27.233 26.0467 20.233 26.0467 L 7.4038 26.3203 Q 0.4038 26.3203 0.4038 19.8203 L 0.6462 7.2616 Q 0.6462 0.7616 7.6462 0.7616 M 7.1783 0.9003 L 20.1038 -0.5038 Q 27.1038 -0.5038 27.1038 5.9962 L 28.409 19.0812 Q 28.409 25.5812 21.409 25.5812 L 6.9218 26.062 Q -0.0782 26.062 -0.0782 19.562 L 0.1783 7.4003 Q 0.1783 0.9003 7.1783 0.9003' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.62 -3.36 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.4356 0.5013 L 21.8359 0.6755 Q 28.8359 0.6755 28.8359 7.1755 L 28.1881 18.6065 Q 28.1881 25.1065 21.1881 25.1065 L 8.1605 25.8971 Q 1.1605 25.8971 1.1605 19.3971 L -0.5644 7.0013 Q -0.5644 0.5013 6.4356 0.5013 M 6.6292 0.531 L 22.1652 -0.0355 Q 29.1652 -0.0355 29.1652 6.4645 L 27.4982 20.3388 Q 27.4982 26.8388 20.4982 26.8388 L 6.1336 25.4065 Q -0.8664 25.4065 -0.8664 18.9065 L -0.3708 7.031 Q -0.3708 0.531 6.6292 0.531' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.58 -3.98 33.53 33.53' overflow='visible'%3E%3Cpath d='M 7.4122 -1.0816 L 20.5836 -0.3961 Q 27.5836 -0.3961 27.5836 6.1039 L 28.6339 20.1467 Q 28.6339 26.6467 21.6339 26.6467 L 6.717 26.007 Q -0.283 26.007 -0.283 19.507 L 0.4122 5.4184 Q 0.4122 -1.0816 7.4122 -1.0816 M 7.8241 -0.7087 L 20.7916 0.2964 Q 27.7916 0.2964 27.7916 6.7964 L 27.0591 19.2197 Q 27.0591 25.7197 20.0591 25.7197 L 7.4822 26.3218 Q 0.4822 26.3218 0.4822 19.8218 L 0.8241 5.7913 Q 0.8241 -0.7087 7.8241 -0.7087' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t\t\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Csvg x='0' y='20' width='96' height='80' viewBox='-2.94 -3.81 33.53 33.53' overflow='visible'%3E%3Cpath d='M 6.1214 -0.381 L 21.2459 0.7554 Q 28.2459 0.7554 28.2459 7.2554 L 28.5419 18.8817 Q 28.5419 25.3817 21.5419 25.3817 L 8.1179 26.2372 Q 1.1179 26.2372 1.1179 19.7372 L -0.8786 6.119 Q -0.8786 -0.381 6.1214 -0.381 M 6.3687 -0.5776 L 21.2599 -0.5987 Q 28.2599 -0.5987 28.2599 5.9013 L 27.3476 19.5423 Q 27.3476 26.0423 20.3476 26.0423 L 6.1089 26.506 Q -0.8911 26.506 -0.8911 20.006 L -0.6313 5.9224 Q -0.6313 -0.5776 6.3687 -0.5776' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%3C/svg%3E\",\n\t],\n\ttick: \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M34.87 62.29L42.93 71.72L63.5 47.63' fill='none' stroke='%23000' stroke-width='10.55' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\",\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,MAAM,qBAA0C;AAAA,EACtD,OAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACA,MAAM;AACP;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/lib/editor/types/emit-types.ts"],
|
|
4
|
-
"sourcesContent": ["import { HistoryEntry } from '@tldraw/store'\nimport { BoxModel, TLPageId, TLRecord, TLShapeId } from '@tldraw/tlschema'\nimport { TLEventInfo } from './event-types'\n\n/** @public */\nexport interface TLEventMap {\n\t// Lifecycle / Internal\n\tmount: []\n\tunmount: []\n\t'max-shapes': [{ name: string; pageId: TLPageId; count: number }]\n\tchange: [HistoryEntry<TLRecord>]\n\tupdate: []\n\tcrash: [{ error: unknown }]\n\t'stop-camera-animation': []\n\t'stop-following': []\n\t'before-event': [TLEventInfo]\n\tevent: [TLEventInfo]\n\ttick: [number]\n\tframe: [number]\n\tresize: [BoxModel]\n\t'select-all-text': [{ shapeId: TLShapeId }]\n\t'place-caret': [{ shapeId: TLShapeId; point: { x: number; y: number } }]\n\t'created-shapes': [TLRecord[]]\n\t'edited-shapes': [TLRecord[]]\n\t'deleted-shapes': [TLShapeId[]]\n\tedit: []\n\tdispose: []\n}\n\n/** @public */\nexport type TLEventMapHandler<T extends keyof TLEventMap> = (...args: TLEventMap[T]) => void\n"],
|
|
4
|
+
"sourcesContent": ["import { HistoryEntry } from '@tldraw/store'\nimport { BoxModel, TLPageId, TLRecord, TLShapeId } from '@tldraw/tlschema'\nimport { TLEventInfo } from './event-types'\n\n/** @public */\nexport interface TLEventMap {\n\t// Lifecycle / Internal\n\tmount: []\n\tunmount: []\n\t'max-shapes': [{ name: string; pageId: TLPageId; count: number }]\n\t'confirm-open-link': [{ url: string }]\n\tchange: [HistoryEntry<TLRecord>]\n\tupdate: []\n\tcrash: [{ error: unknown }]\n\t'stop-camera-animation': []\n\t'stop-following': []\n\t'before-event': [TLEventInfo]\n\tevent: [TLEventInfo]\n\ttick: [number]\n\tframe: [number]\n\tresize: [BoxModel]\n\t'select-all-text': [{ shapeId: TLShapeId }]\n\t'place-caret': [{ shapeId: TLShapeId; point: { x: number; y: number } }]\n\t'created-shapes': [TLRecord[]]\n\t'edited-shapes': [TLRecord[]]\n\t'deleted-shapes': [TLShapeId[]]\n\tedit: []\n\tdispose: []\n}\n\n/** @public */\nexport type TLEventMapHandler<T extends keyof TLEventMap> = (...args: TLEventMap[T]) => void\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,7 +30,7 @@ var import_utils = require("@tldraw/utils");
|
|
|
30
30
|
var import_version = require("../../version");
|
|
31
31
|
var import_assets = require("../utils/assets");
|
|
32
32
|
var import_licensing = require("../utils/licensing");
|
|
33
|
-
const GRACE_PERIOD_DAYS =
|
|
33
|
+
const GRACE_PERIOD_DAYS = 5;
|
|
34
34
|
const FLAGS = {
|
|
35
35
|
// -- MUTUALLY EXCLUSIVE FLAGS
|
|
36
36
|
// Annual means the license expires after a time period, usually 1 year.
|
|
@@ -507,7 +507,7 @@ function getLicenseState(result, outputMessages, isDevelopment) {
|
|
|
507
507
|
}
|
|
508
508
|
if (result.isPerpetualLicenseExpired || result.isAnnualLicenseExpired) {
|
|
509
509
|
outputMessages([
|
|
510
|
-
|
|
510
|
+
`Your tldraw license has been expired for more than ${GRACE_PERIOD_DAYS} days!`,
|
|
511
511
|
`Please reach out to ${LICENSE_EMAIL} to renew your license.`
|
|
512
512
|
]);
|
|
513
513
|
return "expired";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/license/LicenseManager.ts"],
|
|
4
|
-
"sourcesContent": ["import { atom, transact } from '@tldraw/state'\nimport { noop } from '@tldraw/utils'\nimport { publishDates, version } from '../../version'\nimport { getDefaultCdnBaseUrl } from '../utils/assets'\nimport { importPublicKey, str2ab } from '../utils/licensing'\n\nconst GRACE_PERIOD_DAYS = 30\n\nexport const FLAGS = {\n\t// -- MUTUALLY EXCLUSIVE FLAGS\n\t// Annual means the license expires after a time period, usually 1 year.\n\tANNUAL_LICENSE: 1,\n\t// Perpetual means the license never expires up to the max supported version.\n\tPERPETUAL_LICENSE: 1 << 1,\n\n\t// -- ADDITIVE FLAGS --\n\t// Internal means the license is for internal use only.\n\tINTERNAL_LICENSE: 1 << 2,\n\t// Watermark means the product is watermarked.\n\tWITH_WATERMARK: 1 << 3,\n\t// Evaluation means the license is for evaluation purposes only.\n\tEVALUATION_LICENSE: 1 << 4,\n\t// Native means the license is for native apps which switches\n\t// on special-case logic.\n\tNATIVE_LICENSE: 1 << 5,\n\n\t// -- FEATURE FLAGS --\n\t// Collaboration is the umbrella flag for collaboration features; it grants all sub-features.\n\tFEAT_COLLABORATION: 1 << 6,\n\t// Commenting is the first sub-feature of collaboration.\n\tFEAT_COMMENTING: 1 << 7,\n\tTRACKED: 1 << 8,\n}\nconst HIGHEST_FLAG = Math.max(...Object.values(FLAGS))\n\nexport const PROPERTIES = {\n\tID: 0,\n\tHOSTS: 1,\n\tFLAGS: 2,\n\tEXPIRY_DATE: 3,\n}\nconst NUMBER_OF_KNOWN_PROPERTIES = Object.keys(PROPERTIES).length\n\nconst LICENSE_EMAIL = 'sales@tldraw.com'\n\n/**\n * tldraw's own public domains. A page served from one of these hosts \u2014 or any subdomain of one \u2014 is\n * licensed without a key, because we own them: minting and rotating keys for our own properties was\n * a recurring source of expired and wrong-domain deployments.\n *\n * This list ships in the bundle, so it holds only domains we already serve from publicly. tldraw's\n * private domains are deliberately absent and keep using a real license key.\n */\nconst CANONICAL_TLDRAW_HOSTS = [\n\t'tldraw.com',\n\t'tldraw.dev',\n\t'tldraw.club',\n\t'tldraw.workers.dev',\n\t'tldraw.xyz',\n]\n\n/** Our VS Code extension, whose webviews are served from `vscode-webview:` with a random hostname. */\nconst CANONICAL_VSCODE_EXTENSION_ID = 'tldraw-org.tldraw-vscode'\n\n/** Marks a license as the keyless canonical-host grant, which is never tracked. */\nconst CANONICAL_HOST_LICENSE_ID = 'tldraw-canonical-host'\n\n/** The canonical-host grant has no key behind it, and so no expiry date to fall due. */\nconst CANONICAL_HOST_NEVER_EXPIRES = new Date(8640000000000000)\n\nconst WATERMARK_TRACK_SRC = `${getDefaultCdnBaseUrl()}/watermarks/watermark-track.svg`\n\n/** @internal */\nexport interface LicenseInfo {\n\tid: string\n\thosts: string[]\n\tflags: number\n\texpiryDate: string\n}\n\n/**\n * Names of the licensable product features gated by the license. `collaboration` is an umbrella\n * that also grants all of its sub-features (currently just `commenting`).\n *\n * @internal\n */\nexport type LicenseFeatureName = 'collaboration' | 'commenting'\n\nconst NO_FEATURES: Readonly<Record<LicenseFeatureName, boolean>> = {\n\tcollaboration: false,\n\tcommenting: false,\n}\nconst ALL_FEATURES: Readonly<Record<LicenseFeatureName, boolean>> = {\n\tcollaboration: true,\n\tcommenting: true,\n}\n\n/** @internal */\nexport type LicenseState =\n\t| 'pending' // License validation is in progress\n\t| 'licensed' // License is valid and active (no restrictions)\n\t| 'licensed-with-watermark' // License is valid but shows watermark (evaluation licenses, WITH_WATERMARK licenses)\n\t| 'unlicensed' // No valid license found or license is invalid (development)\n\t| 'unlicensed-production' // No valid license in production deployment (missing, invalid, or wrong domain)\n\t| 'expired' // License has been expired (30 days past expiration for regular licenses, immediately for evaluation licenses)\n/** @internal */\nexport type InvalidLicenseReason =\n\t| 'invalid-license-key'\n\t| 'no-key-provided'\n\t| 'has-key-development-mode'\n\n/** @internal */\nexport type LicenseFromKeyResult = InvalidLicenseKeyResult | ValidLicenseKeyResult\n\n/** @internal */\nexport interface InvalidLicenseKeyResult {\n\tisLicenseParseable: false\n\treason: InvalidLicenseReason\n}\n\n/** @internal */\nexport interface ValidLicenseKeyResult {\n\tisLicenseParseable: true\n\tlicense: LicenseInfo\n\tisDevelopment: boolean\n\tisDomainValid: boolean\n\texpiryDate: Date\n\tisAnnualLicense: boolean\n\tisAnnualLicenseExpired: boolean\n\tisPerpetualLicense: boolean\n\tisPerpetualLicenseExpired: boolean\n\tisInternalLicense: boolean\n\tisNativeLicense: boolean\n\tisLicensedWithWatermark: boolean\n\tisEvaluationLicense: boolean\n\tisEvaluationLicenseExpired: boolean\n\tisCollaborationEnabled: boolean\n\tisCommentingEnabled: boolean\n\tdaysSinceExpiry: number\n}\n\n/** @internal */\nexport type TrackType = 'unlicensed' | 'with_watermark' | 'evaluation' | 'tracked' | null\n\n/** @internal */\nexport class LicenseManager {\n\tprivate publicKey =\n\t\t'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHJh0uUfxHtCGyerXmmatE368Hd9rI6LH9oPDQihnaCryRFWEVeOvf9U/SPbyxX74LFyJs5tYeAHq5Nc0Ax25LQ'\n\tpublic isDevelopment: boolean\n\tpublic isTest: boolean\n\tpublic isCryptoAvailable: boolean\n\tstate = atom<LicenseState>('license state', 'pending')\n\tfeatureFlags = atom<Record<LicenseFeatureName, boolean>>('license feature flags', {\n\t\t...NO_FEATURES,\n\t})\n\tpublic verbose = true\n\tprivate isDisposed = false\n\n\tconstructor(licenseKey: string | undefined, testPublicKey?: string) {\n\t\tthis.isTest = process.env.NODE_ENV === 'test'\n\t\tthis.isDevelopment = this.getIsDevelopment()\n\t\tthis.publicKey = testPublicKey || this.publicKey\n\t\tthis.isCryptoAvailable = !!crypto.subtle\n\n\t\t// In development every feature is enabled (see `getEnabledFeatures`), and that doesn't depend\n\t\t// on the async validation result. Reflect it eagerly so features aren't reported as disabled\n\t\t// during the validation window \u2014 or left disabled if validation rejects (the `.catch` below\n\t\t// never sets `featureFlags`). In production the fail-closed default stands until validation.\n\t\tif (this.isDevelopment) {\n\t\t\tthis.featureFlags.set({ ...ALL_FEATURES })\n\t\t}\n\n\t\tthis.getLicenseFromKey(licenseKey)\n\t\t\t.then((result) => {\n\t\t\t\t// replaced by a manager for a newer key: this one's messages, tracking ping and state\n\t\t\t\t// would describe a key the app no longer uses\n\t\t\t\tif (this.isDisposed) return\n\t\t\t\tconst licenseState = getLicenseState(\n\t\t\t\t\tresult,\n\t\t\t\t\t(messages: string[]) => this.outputMessages(messages),\n\t\t\t\t\tthis.isDevelopment\n\t\t\t\t)\n\n\t\t\t\tthis.maybeTrack(result, licenseState)\n\n\t\t\t\t// Update both atoms atomically so dependents never observe the license state and the\n\t\t\t\t// feature flags out of sync mid-update.\n\t\t\t\ttransact(() => {\n\t\t\t\t\tthis.state.set(licenseState)\n\t\t\t\t\tthis.featureFlags.set(getEnabledFeatures(result, licenseState, this.isDevelopment))\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tif (this.isDisposed) return\n\t\t\t\tconsole.error('License validation failed:', error)\n\t\t\t\tthis.state.set('unlicensed')\n\t\t\t})\n\t}\n\n\t/** Ignore the pending validation: nothing is logged, tracked or set once the manager is replaced. */\n\tdispose() {\n\t\tthis.isDisposed = true\n\t}\n\n\t/**\n\t * Returns whether a given licensable feature is enabled. Reactive: reading this inside a signal\n\t * recomputes when license validation resolves.\n\t */\n\tisFeatureEnabled(feature: LicenseFeatureName): boolean {\n\t\treturn this.featureFlags.get()[feature]\n\t}\n\n\tprivate getIsDevelopment() {\n\t\tconst { protocol, hostname } = this.getOriginLocation()\n\n\t\t// Tauri uses `tauri://localhost` on macOS and Linux and `http://tauri.localhost` on Windows.\n\t\tif (hostname.endsWith('.localhost')) {\n\t\t\treturn process.env.NODE_ENV !== 'production'\n\t\t}\n\n\t\treturn (\n\t\t\tprotocol === 'http:' ||\n\t\t\t(protocol === 'https:' && this.isLoopbackHost(hostname)) ||\n\t\t\tprocess.env.NODE_ENV !== 'production'\n\t\t)\n\t}\n\n\tprivate getOriginLocation() {\n\t\t// A document loaded from `blob:https://example.com/<uuid>` has protocol `blob:` and an empty\n\t\t// hostname, but its origin is the page that created the blob. Opaque origins ('null': custom\n\t\t// schemes, file:, about:) keep using the location.\n\t\tconst { origin, protocol, hostname } = window.location\n\t\tconst source = origin && origin !== 'null' ? new URL(origin) : { protocol, hostname }\n\t\treturn { protocol: source.protocol, hostname: source.hostname.toLowerCase() }\n\t}\n\n\tprivate isLoopbackHost(hostname: string) {\n\t\t// localhost, IPv4 loopback (127.0.0.0/8) and IPv6 loopback (::1) are all local development hosts\n\t\tconst host = hostname.toLowerCase().replace(/^\\[|\\]$/g, '')\n\t\treturn host === 'localhost' || host === '::1' || /^127(?:\\.\\d{1,3}){3}$/.test(host)\n\t}\n\n\t/** Whether the page is served from one of tldraw's own domains, a subdomain of one, or our VS Code extension. */\n\tprivate isCanonicalTldrawHost() {\n\t\tif (window.location.protocol === 'vscode-webview:') {\n\t\t\tconst extensionId = new URL(window.location.href).searchParams.get('extensionId')\n\t\t\treturn extensionId === CANONICAL_VSCODE_EXTENSION_ID\n\t\t}\n\t\tconst hostname = window.location.hostname.toLowerCase()\n\t\treturn CANONICAL_TLDRAW_HOSTS.some((host) => hostname === host || hostname.endsWith(`.${host}`))\n\t}\n\n\t/**\n\t * The license tldraw's own domains get without a key. It keeps the watermark \u2014 our properties\n\t * advertise the SDK the same way any other watermarked deployment does \u2014 and grants the\n\t * collaboration features our apps are built on.\n\t *\n\t * Every expiry-derived field is a literal rather than something computed from a date, because\n\t * there is no key here to expire: the grant lasts as long as the host is ours.\n\t */\n\tprivate getCanonicalHostLicense(): ValidLicenseKeyResult {\n\t\treturn {\n\t\t\tisLicenseParseable: true,\n\t\t\tlicense: {\n\t\t\t\tid: CANONICAL_HOST_LICENSE_ID,\n\t\t\t\thosts: [window.location.hostname.toLowerCase()],\n\t\t\t\tflags: FLAGS.WITH_WATERMARK | FLAGS.FEAT_COLLABORATION | FLAGS.FEAT_COMMENTING,\n\t\t\t\texpiryDate: CANONICAL_HOST_NEVER_EXPIRES.toISOString(),\n\t\t\t},\n\t\t\tisDevelopment: this.isDevelopment,\n\t\t\tisDomainValid: true,\n\t\t\texpiryDate: CANONICAL_HOST_NEVER_EXPIRES,\n\t\t\tisAnnualLicense: false,\n\t\t\tisAnnualLicenseExpired: false,\n\t\t\tisPerpetualLicense: false,\n\t\t\tisPerpetualLicenseExpired: false,\n\t\t\tisInternalLicense: false,\n\t\t\tisNativeLicense: false,\n\t\t\tisLicensedWithWatermark: true,\n\t\t\tisEvaluationLicense: false,\n\t\t\tisEvaluationLicenseExpired: false,\n\t\t\tisCollaborationEnabled: true,\n\t\t\tisCommentingEnabled: true,\n\t\t\tdaysSinceExpiry: 0,\n\t\t}\n\t}\n\n\tprivate getTrackType(result: LicenseFromKeyResult, licenseState: LicenseState): TrackType {\n\t\t// Our own domains are licensed without a key, and the watermark ping exists to tell us about\n\t\t// deployments we don't already know about. Reporting our own apps back to ourselves would only\n\t\t// add noise to the numbers we read, so the canonical-host grant is never tracked.\n\t\tif ('license' in result && result.license.id === CANONICAL_HOST_LICENSE_ID) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Track watermark for unlicensed production deployments\n\t\tif (licenseState === 'unlicensed-production') {\n\t\t\treturn 'unlicensed'\n\t\t}\n\n\t\tif (this.isDevelopment) {\n\t\t\treturn null\n\t\t}\n\n\t\tif (!result.isLicenseParseable) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Track evaluation licenses (for analytics, even though no watermark is shown)\n\t\tif (result.isEvaluationLicense) {\n\t\t\treturn 'evaluation'\n\t\t}\n\n\t\tif (this.isFlagEnabled(result.license.flags, FLAGS.TRACKED)) {\n\t\t\treturn 'tracked'\n\t\t}\n\n\t\t// Track licenses that show watermarks\n\t\tif (licenseState === 'licensed-with-watermark') {\n\t\t\treturn 'with_watermark'\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate maybeTrack(result: LicenseFromKeyResult, licenseState: LicenseState): void {\n\t\tconst trackType = this.getTrackType(result, licenseState)\n\t\tif (!trackType) {\n\t\t\treturn\n\t\t}\n\n\t\tconst url = new URL(WATERMARK_TRACK_SRC)\n\t\turl.searchParams.set('version', version)\n\t\turl.searchParams.set('license_type', trackType)\n\t\tif ('license' in result) {\n\t\t\turl.searchParams.set('license_id', result.license.id)\n\t\t\tconst sku = this.isFlagEnabled(result.license.flags, FLAGS.EVALUATION_LICENSE)\n\t\t\t\t? 'evaluation'\n\t\t\t\t: this.isFlagEnabled(result.license.flags, FLAGS.ANNUAL_LICENSE)\n\t\t\t\t\t? 'annual'\n\t\t\t\t\t: this.isFlagEnabled(result.license.flags, FLAGS.PERPETUAL_LICENSE)\n\t\t\t\t\t\t? 'perpetual'\n\t\t\t\t\t\t: 'unknown'\n\t\t\turl.searchParams.set('sku', sku)\n\t\t}\n\t\turl.searchParams.set('url', window.location.href)\n\t\tif (process.env.NODE_ENV) {\n\t\t\turl.searchParams.set('environment', process.env.NODE_ENV)\n\t\t}\n\n\t\t// best-effort: a blocked or offline request must not surface as an unhandled rejection\n\t\t// eslint-disable-next-line no-restricted-globals\n\t\tfetch(url.toString()).catch(noop)\n\t}\n\n\tprivate async extractLicenseKey(licenseKey: string): Promise<LicenseInfo> {\n\t\tconst [data, signature] = licenseKey.split('.')\n\t\tconst [prefix, encodedData] = data.split('/')\n\n\t\tif (!prefix.startsWith('tldraw-')) {\n\t\t\tthrow new Error(`Unsupported prefix '${prefix}'`)\n\t\t}\n\n\t\tconst publicCryptoKey = await importPublicKey(this.publicKey)\n\n\t\tlet isVerified\n\t\ttry {\n\t\t\tisVerified = await crypto.subtle.verify(\n\t\t\t\t{\n\t\t\t\t\tname: 'ECDSA',\n\t\t\t\t\thash: { name: 'SHA-256' },\n\t\t\t\t},\n\t\t\t\tpublicCryptoKey,\n\t\t\t\tnew Uint8Array(str2ab(atob(signature))),\n\t\t\t\tnew Uint8Array(str2ab(atob(encodedData)))\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tthrow new Error('Could not perform signature validation')\n\t\t}\n\n\t\tif (!isVerified) {\n\t\t\tthrow new Error('Invalid signature')\n\t\t}\n\n\t\tlet decodedData: any\n\t\ttry {\n\t\t\tdecodedData = JSON.parse(atob(encodedData))\n\t\t} catch {\n\t\t\tthrow new Error('Could not parse object')\n\t\t}\n\t\tif (decodedData.length > NUMBER_OF_KNOWN_PROPERTIES) {\n\t\t\tthis.outputMessages([\n\t\t\t\t'License key contains some unknown properties.',\n\t\t\t\t'You may want to update tldraw packages to a newer version to get access to new functionality.',\n\t\t\t])\n\t\t}\n\n\t\treturn {\n\t\t\tid: decodedData[PROPERTIES.ID],\n\t\t\thosts: decodedData[PROPERTIES.HOSTS],\n\t\t\tflags: decodedData[PROPERTIES.FLAGS],\n\t\t\texpiryDate: decodedData[PROPERTIES.EXPIRY_DATE],\n\t\t}\n\t}\n\n\tasync getLicenseFromKey(licenseKey?: string): Promise<LicenseFromKeyResult> {\n\t\t// A key that is provided still wins, so an app on one of our hosts can opt into a different\n\t\t// license \u2014 a native or feature-specific key \u2014 just by passing it.\n\t\tif (!licenseKey && this.isCanonicalTldrawHost()) {\n\t\t\treturn this.getCanonicalHostLicense()\n\t\t}\n\n\t\tif (!licenseKey) {\n\t\t\tif (!this.isDevelopment) {\n\t\t\t\tthis.outputNoLicenseKeyProvided()\n\t\t\t}\n\n\t\t\treturn { isLicenseParseable: false, reason: 'no-key-provided' }\n\t\t}\n\n\t\tif (this.isDevelopment && !this.isCryptoAvailable) {\n\t\t\tif (this.verbose) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t'tldraw: you seem to be in a development environment that does not support crypto. License not verified.'\n\t\t\t\t)\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log('You should check that this works in production separately.')\n\t\t\t}\n\t\t\t// We can't parse the license if we are in development mode since crypto\n\t\t\t// is not available on http\n\t\t\treturn { isLicenseParseable: false, reason: 'has-key-development-mode' }\n\t\t}\n\n\t\t// Borrowed idea from AG Grid:\n\t\t// Copying from various sources (like PDFs) can include zero-width characters.\n\t\t// This helps makes sure the key validation doesn't fail.\n\t\tlet cleanedLicenseKey = licenseKey.replace(/[\\u200B-\\u200D\\uFEFF]/g, '')\n\t\tcleanedLicenseKey = cleanedLicenseKey.replace(/\\r?\\n|\\r/g, '')\n\n\t\ttry {\n\t\t\tconst licenseInfo = await this.extractLicenseKey(cleanedLicenseKey)\n\t\t\tconst expiryDate = new Date(licenseInfo.expiryDate)\n\t\t\tconst isAnnualLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.ANNUAL_LICENSE)\n\t\t\tconst isPerpetualLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.PERPETUAL_LICENSE)\n\t\t\tconst isEvaluationLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.EVALUATION_LICENSE)\n\n\t\t\tconst isAnnualLicenseExpired = isAnnualLicense && this.isAnnualLicenseExpired(expiryDate)\n\t\t\tconst isPerpetualLicenseExpired =\n\t\t\t\tisPerpetualLicense && this.isPerpetualLicenseExpired(expiryDate)\n\n\t\t\t// The collaboration umbrella grants all of its sub-features, so commenting is enabled\n\t\t\t// by either the commenting flag or the collaboration flag.\n\t\t\tconst isCollaborationEnabled = this.isFlagEnabled(licenseInfo.flags, FLAGS.FEAT_COLLABORATION)\n\t\t\tconst isCommentingEnabled =\n\t\t\t\tisCollaborationEnabled || this.isFlagEnabled(licenseInfo.flags, FLAGS.FEAT_COMMENTING)\n\n\t\t\t// For perpetual licenses, the calendar expiry date only gates access to future\n\t\t\t// major/minor releases; it does not \"expire\" the license itself. While the user\n\t\t\t// is still on a covered version we report `daysSinceExpiry` as 0 so consumers\n\t\t\t// (and the grace-period warning) don't treat them as past expiry.\n\t\t\tconst daysSinceExpiry =\n\t\t\t\tisPerpetualLicense && !isPerpetualLicenseExpired ? 0 : this.getDaysSinceExpiry(expiryDate)\n\n\t\t\tconst result: ValidLicenseKeyResult = {\n\t\t\t\tlicense: licenseInfo,\n\t\t\t\tisLicenseParseable: true,\n\t\t\t\tisDevelopment: this.isDevelopment,\n\t\t\t\tisDomainValid: this.isDomainValid(licenseInfo),\n\t\t\t\texpiryDate,\n\t\t\t\tisAnnualLicense,\n\t\t\t\tisAnnualLicenseExpired,\n\t\t\t\tisPerpetualLicense,\n\t\t\t\tisPerpetualLicenseExpired,\n\t\t\t\tisInternalLicense: this.isFlagEnabled(licenseInfo.flags, FLAGS.INTERNAL_LICENSE),\n\t\t\t\tisNativeLicense: this.isNativeLicense(licenseInfo),\n\t\t\t\tisLicensedWithWatermark: this.isFlagEnabled(licenseInfo.flags, FLAGS.WITH_WATERMARK),\n\t\t\t\tisEvaluationLicense,\n\t\t\t\tisEvaluationLicenseExpired:\n\t\t\t\t\tisEvaluationLicense && this.isEvaluationLicenseExpired(expiryDate),\n\t\t\t\tisCollaborationEnabled,\n\t\t\t\tisCommentingEnabled,\n\t\t\t\tdaysSinceExpiry,\n\t\t\t}\n\t\t\tthis.outputLicenseInfoIfNeeded(result)\n\n\t\t\treturn result\n\t\t} catch (e: any) {\n\t\t\tthis.outputInvalidLicenseKey(e.message)\n\t\t\t// If the license can't be parsed, it's invalid\n\t\t\treturn { isLicenseParseable: false, reason: 'invalid-license-key' }\n\t\t}\n\t}\n\n\tprivate isDomainValid(licenseInfo: LicenseInfo) {\n\t\tconst currentHostname = this.getOriginLocation().hostname\n\n\t\treturn licenseInfo.hosts.some((host) => {\n\t\t\tconst normalizedHostOrUrlRegex = host.toLowerCase().trim()\n\n\t\t\t// Allow the domain if listed and www variations, 'example.com' allows 'example.com' and 'www.example.com'\n\t\t\tif (\n\t\t\t\tnormalizedHostOrUrlRegex === currentHostname ||\n\t\t\t\t`www.${normalizedHostOrUrlRegex}` === currentHostname ||\n\t\t\t\tnormalizedHostOrUrlRegex === `www.${currentHostname}`\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// If host is '*', we allow all domains.\n\t\t\tif (host === '*') {\n\t\t\t\t// All domains allowed.\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// Native license support\n\t\t\t// In this case, `normalizedHost` is actually a protocol, e.g. `app-bundle:`\n\t\t\tif (this.isNativeLicense(licenseInfo)) {\n\t\t\t\treturn new RegExp(normalizedHostOrUrlRegex).test(window.location.href)\n\t\t\t}\n\n\t\t\t// Glob testing, we only support '*.somedomain.com' right now.\n\t\t\tif (host.includes('*')) {\n\t\t\t\tconst globToRegex = new RegExp(\n\t\t\t\t\tnormalizedHostOrUrlRegex.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*?') + '$'\n\t\t\t\t)\n\t\t\t\treturn globToRegex.test(currentHostname) || globToRegex.test(`www.${currentHostname}`)\n\t\t\t}\n\n\t\t\t// VSCode support\n\t\t\tif (window.location.protocol === 'vscode-webview:') {\n\t\t\t\tconst currentUrl = new URL(window.location.href)\n\t\t\t\tconst extensionId = currentUrl.searchParams.get('extensionId')\n\t\t\t\tif (normalizedHostOrUrlRegex === extensionId) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t})\n\t}\n\n\tprivate isNativeLicense(licenseInfo: LicenseInfo) {\n\t\treturn this.isFlagEnabled(licenseInfo.flags, FLAGS.NATIVE_LICENSE)\n\t}\n\n\tprivate getExpirationDateWithoutGracePeriod(expiryDate: Date) {\n\t\t// The named expiry date is the last day the license is fully usable, so the license\n\t\t// expires at the end of that day, i.e. the start of the following day. We work in UTC\n\t\t// (the expiry date is minted and parsed as a UTC date-only string) so the cutoff is a\n\t\t// single predictable instant for every user regardless of their local timezone.\n\t\treturn new Date(\n\t\t\tDate.UTC(\n\t\t\t\texpiryDate.getUTCFullYear(),\n\t\t\t\texpiryDate.getUTCMonth(),\n\t\t\t\texpiryDate.getUTCDate() + 1 // Add 1 day so the named date is fully usable\n\t\t\t)\n\t\t)\n\t}\n\n\tprivate getExpirationDateWithGracePeriod(expiryDate: Date) {\n\t\treturn new Date(\n\t\t\tDate.UTC(\n\t\t\t\texpiryDate.getUTCFullYear(),\n\t\t\t\texpiryDate.getUTCMonth(),\n\t\t\t\texpiryDate.getUTCDate() + GRACE_PERIOD_DAYS + 1 // Add 1 day to include the expiration day\n\t\t\t)\n\t\t)\n\t}\n\n\tprivate isAnnualLicenseExpired(expiryDate: Date) {\n\t\tconst expiration = this.getExpirationDateWithGracePeriod(expiryDate)\n\t\treturn new Date() >= expiration\n\t}\n\n\tprivate isPerpetualLicenseExpired(expiryDate: Date) {\n\t\tconst expiration = this.getExpirationDateWithGracePeriod(expiryDate)\n\t\tconst dates = {\n\t\t\tmajor: new Date(publishDates.major),\n\t\t\tminor: new Date(publishDates.minor),\n\t\t}\n\t\t// We allow patch releases, but the major and minor releases should be within the expiration date\n\t\treturn dates.major >= expiration || dates.minor >= expiration\n\t}\n\n\tprivate getDaysSinceExpiry(expiryDate: Date): number {\n\t\tconst now = new Date()\n\t\tconst expiration = this.getExpirationDateWithoutGracePeriod(expiryDate)\n\t\tconst diffTime = now.getTime() - expiration.getTime()\n\t\tconst diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24))\n\t\treturn Math.max(0, diffDays)\n\t}\n\n\tprivate isEvaluationLicenseExpired(expiryDate: Date): boolean {\n\t\t// Evaluation licenses have no grace period - they expire immediately\n\t\tconst now = new Date()\n\t\tconst expiration = this.getExpirationDateWithoutGracePeriod(expiryDate)\n\t\treturn now >= expiration\n\t}\n\n\tprivate isFlagEnabled(flags: number, flag: number) {\n\t\treturn (flags & flag) === flag\n\t}\n\n\tprivate outputNoLicenseKeyProvided() {\n\t\t// Noop, we don't need to show this message.\n\t\t// this.outputMessages([\n\t\t// \t'No tldraw license key provided!',\n\t\t// \t`Please reach out to ${LICENSE_EMAIL} if you would like to license tldraw or if you'd like a trial.`,\n\t\t// ])\n\t}\n\n\tprivate outputInvalidLicenseKey(msg: string) {\n\t\tthis.outputMessages(['Invalid tldraw license key', `Reason: ${msg}`])\n\t}\n\n\tprivate outputLicenseInfoIfNeeded(result: ValidLicenseKeyResult) {\n\t\t// If we added a new flag it will be twice the value of the currently highest flag.\n\t\t// And if all the current flags are on we would get the `HIGHEST_FLAG * 2 - 1`, so anything higher than that means there are new flags.\n\t\tif (result.license.flags >= HIGHEST_FLAG * 2) {\n\t\t\tthis.outputMessages(\n\t\t\t\t[\n\t\t\t\t\t'Warning: This tldraw license contains some unknown flags.',\n\t\t\t\t\t'This will still work, however, you may want to update tldraw packages to a newer version to get access to new functionality.',\n\t\t\t\t],\n\t\t\t\t'warning'\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate outputMessages(messages: string[], type: 'warning' | 'error' = 'error') {\n\t\tif (this.isTest) return\n\t\tif (this.verbose) {\n\t\t\tthis.outputDelimiter(type)\n\t\t\tfor (const message of messages) {\n\t\t\t\tconst bgColor = type === 'warning' ? 'orange' : 'crimson'\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`%c${message}`,\n\t\t\t\t\t`color: white; background: ${bgColor}; padding: 2px; border-radius: 3px;`\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.outputDelimiter(type)\n\t\t}\n\t}\n\n\tprivate outputDelimiter(type: 'warning' | 'error' = 'error') {\n\t\tconst bgColor = type === 'warning' ? 'orange' : 'crimson'\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t'%c-------------------------------------------------------------------',\n\t\t\t`color: white; background: ${bgColor}; padding: 2px; border-radius: 3px;`\n\t\t)\n\t}\n\n\tstatic className = 'tl-watermark_SEE-LICENSE'\n}\n\n/**\n * Derives which licensable features are enabled from the parse result and the derived license\n * state. In development every feature is enabled so SDK developers can build against them; in\n * production a feature requires both an active, valid license and the corresponding flag.\n *\n * @internal\n */\nexport function getEnabledFeatures(\n\tresult: LicenseFromKeyResult,\n\tlicenseState: LicenseState,\n\tisDevelopment: boolean\n): Record<LicenseFeatureName, boolean> {\n\t// Development gets all features so SDK developers can build against them.\n\tif (isDevelopment) {\n\t\treturn { ...ALL_FEATURES }\n\t}\n\n\t// Features require an active, valid license. Both the 30-day grace-period 'licensed' state and\n\t// the watermark state count as valid; unlicensed/expired/pending do not.\n\tif (\n\t\t!result.isLicenseParseable ||\n\t\t(licenseState !== 'licensed' && licenseState !== 'licensed-with-watermark')\n\t) {\n\t\treturn { ...NO_FEATURES }\n\t}\n\n\t// Evaluation licenses get every feature so prospects can trial the whole product without us\n\t// having to mint per-feature evaluation keys. Expired evaluation licenses are already excluded\n\t// above: they resolve to the 'expired' state.\n\tif (result.isEvaluationLicense) {\n\t\treturn { ...ALL_FEATURES }\n\t}\n\n\treturn {\n\t\tcollaboration: result.isCollaborationEnabled,\n\t\tcommenting: result.isCommentingEnabled,\n\t}\n}\n\nexport function getLicenseState(\n\tresult: LicenseFromKeyResult,\n\toutputMessages: (messages: string[]) => void,\n\tisDevelopment: boolean\n): LicenseState {\n\tif (!result.isLicenseParseable) {\n\t\tif (isDevelopment) {\n\t\t\treturn 'unlicensed'\n\t\t}\n\n\t\t// All unlicensed scenarios should not work in production\n\t\tif (result.reason === 'no-key-provided') {\n\t\t\toutputMessages([\n\t\t\t\t'No tldraw license key provided!',\n\t\t\t\t'A license is required for production deployments.',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t\t])\n\t\t} else {\n\t\t\toutputMessages([\n\t\t\t\t'Invalid license key. tldraw requires a valid license for production use.',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t\t])\n\t\t}\n\t\treturn 'unlicensed-production'\n\t}\n\n\tif (!result.isDomainValid && !result.isDevelopment) {\n\t\toutputMessages([\n\t\t\t'License key is not valid for this domain.',\n\t\t\t'A license is required for production deployments.',\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t])\n\t\treturn 'unlicensed-production'\n\t}\n\n\t// Handle evaluation licenses - they expire immediately with no grace period\n\tif (result.isEvaluationLicense) {\n\t\tif (result.isEvaluationLicenseExpired) {\n\t\t\toutputMessages([\n\t\t\t\t'Your tldraw evaluation license has expired!',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a full license.`,\n\t\t\t])\n\t\t\treturn 'expired'\n\t\t} else {\n\t\t\t// Valid evaluation license - tracked but no watermark shown\n\t\t\treturn 'licensed'\n\t\t}\n\t}\n\n\t// Handle expired regular licenses (both annual and perpetual)\n\tif (result.isPerpetualLicenseExpired || result.isAnnualLicenseExpired) {\n\t\toutputMessages([\n\t\t\t'Your tldraw license has been expired for more than 30 days!',\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to renew your license.`,\n\t\t])\n\t\treturn 'expired'\n\t}\n\n\t// Check if license is past expiry date but within grace period\n\tconst daysSinceExpiry = result.daysSinceExpiry\n\tif (daysSinceExpiry > 0 && !result.isEvaluationLicense) {\n\t\toutputMessages([\n\t\t\t'Your tldraw license has expired.',\n\t\t\t`License expired ${daysSinceExpiry} days ago.`,\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to renew your license.`,\n\t\t])\n\t\t// Within 30-day grace period: still licensed (no watermark)\n\t\treturn 'licensed'\n\t}\n\n\t// License is valid, determine if it has watermark\n\tif (result.isLicensedWithWatermark) {\n\t\treturn 'licensed-with-watermark'\n\t}\n\n\treturn 'licensed'\n}\n"],
|
|
5
|
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O;AAAA,IACtB,YAAY,OAAO;AAAA,EACpB;AACD;AAEO,SAAS,gBACf,QACA,gBACA,eACe;AACf,MAAI,CAAC,OAAO,oBAAoB;AAC/B,QAAI,eAAe;AAClB,aAAO;AAAA,IACR;AAGA,QAAI,OAAO,WAAW,mBAAmB;AACxC,qBAAe;AAAA,QACd;AAAA,QACA;AAAA,QACA,uBAAuB,aAAa;AAAA,MACrC,CAAC;AAAA,IACF,OAAO;AACN,qBAAe;AAAA,QACd;AAAA,QACA,uBAAuB,aAAa;AAAA,MACrC,CAAC;AAAA,IACF;AACA,WAAO;AAAA,EACR;AAEA,MAAI,CAAC,OAAO,iBAAiB,CAAC,OAAO,eAAe;AACnD,mBAAe;AAAA,MACd;AAAA,MACA;AAAA,MACA,uBAAuB,aAAa;AAAA,IACrC,CAAC;AACD,WAAO;AAAA,EACR;AAGA,MAAI,OAAO,qBAAqB;AAC/B,QAAI,OAAO,4BAA4B;AACtC,qBAAe;AAAA,QACd;AAAA,QACA,uBAAuB,aAAa;AAAA,MACrC,CAAC;AACD,aAAO;AAAA,IACR,OAAO;AAEN,aAAO;AAAA,IACR;AAAA,EACD;AAGA,MAAI,OAAO,6BAA6B,OAAO,wBAAwB;AACtE,mBAAe;AAAA,MACd;AAAA,MACA,uBAAuB,aAAa;AAAA,IACrC,CAAC;AACD,WAAO;AAAA,EACR;AAGA,QAAM,kBAAkB,OAAO;AAC/B,MAAI,kBAAkB,KAAK,CAAC,OAAO,qBAAqB;AACvD,mBAAe;AAAA,MACd;AAAA,MACA,mBAAmB,eAAe;AAAA,MAClC,uBAAuB,aAAa;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACR;AAGA,MAAI,OAAO,yBAAyB;AACnC,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
4
|
+
"sourcesContent": ["import { atom, transact } from '@tldraw/state'\nimport { noop } from '@tldraw/utils'\nimport { publishDates, version } from '../../version'\nimport { getDefaultCdnBaseUrl } from '../utils/assets'\nimport { importPublicKey, str2ab } from '../utils/licensing'\n\nconst GRACE_PERIOD_DAYS = 5\n\nexport const FLAGS = {\n\t// -- MUTUALLY EXCLUSIVE FLAGS\n\t// Annual means the license expires after a time period, usually 1 year.\n\tANNUAL_LICENSE: 1,\n\t// Perpetual means the license never expires up to the max supported version.\n\tPERPETUAL_LICENSE: 1 << 1,\n\n\t// -- ADDITIVE FLAGS --\n\t// Internal means the license is for internal use only.\n\tINTERNAL_LICENSE: 1 << 2,\n\t// Watermark means the product is watermarked.\n\tWITH_WATERMARK: 1 << 3,\n\t// Evaluation means the license is for evaluation purposes only.\n\tEVALUATION_LICENSE: 1 << 4,\n\t// Native means the license is for native apps which switches\n\t// on special-case logic.\n\tNATIVE_LICENSE: 1 << 5,\n\n\t// -- FEATURE FLAGS --\n\t// Collaboration is the umbrella flag for collaboration features; it grants all sub-features.\n\tFEAT_COLLABORATION: 1 << 6,\n\t// Commenting is the first sub-feature of collaboration.\n\tFEAT_COMMENTING: 1 << 7,\n\tTRACKED: 1 << 8,\n}\nconst HIGHEST_FLAG = Math.max(...Object.values(FLAGS))\n\nexport const PROPERTIES = {\n\tID: 0,\n\tHOSTS: 1,\n\tFLAGS: 2,\n\tEXPIRY_DATE: 3,\n}\nconst NUMBER_OF_KNOWN_PROPERTIES = Object.keys(PROPERTIES).length\n\nconst LICENSE_EMAIL = 'sales@tldraw.com'\n\n/**\n * tldraw's own public domains. A page served from one of these hosts \u2014 or any subdomain of one \u2014 is\n * licensed without a key, because we own them: minting and rotating keys for our own properties was\n * a recurring source of expired and wrong-domain deployments.\n *\n * This list ships in the bundle, so it holds only domains we already serve from publicly. tldraw's\n * private domains are deliberately absent and keep using a real license key.\n */\nconst CANONICAL_TLDRAW_HOSTS = [\n\t'tldraw.com',\n\t'tldraw.dev',\n\t'tldraw.club',\n\t'tldraw.workers.dev',\n\t'tldraw.xyz',\n]\n\n/** Our VS Code extension, whose webviews are served from `vscode-webview:` with a random hostname. */\nconst CANONICAL_VSCODE_EXTENSION_ID = 'tldraw-org.tldraw-vscode'\n\n/** Marks a license as the keyless canonical-host grant, which is never tracked. */\nconst CANONICAL_HOST_LICENSE_ID = 'tldraw-canonical-host'\n\n/** The canonical-host grant has no key behind it, and so no expiry date to fall due. */\nconst CANONICAL_HOST_NEVER_EXPIRES = new Date(8640000000000000)\n\nconst WATERMARK_TRACK_SRC = `${getDefaultCdnBaseUrl()}/watermarks/watermark-track.svg`\n\n/** @internal */\nexport interface LicenseInfo {\n\tid: string\n\thosts: string[]\n\tflags: number\n\texpiryDate: string\n}\n\n/**\n * Names of the licensable product features gated by the license. `collaboration` is an umbrella\n * that also grants all of its sub-features (currently just `commenting`).\n *\n * @internal\n */\nexport type LicenseFeatureName = 'collaboration' | 'commenting'\n\nconst NO_FEATURES: Readonly<Record<LicenseFeatureName, boolean>> = {\n\tcollaboration: false,\n\tcommenting: false,\n}\nconst ALL_FEATURES: Readonly<Record<LicenseFeatureName, boolean>> = {\n\tcollaboration: true,\n\tcommenting: true,\n}\n\n/** @internal */\nexport type LicenseState =\n\t| 'pending' // License validation is in progress\n\t| 'licensed' // License is valid and active (no restrictions)\n\t| 'licensed-with-watermark' // License is valid but shows watermark (evaluation licenses, WITH_WATERMARK licenses)\n\t| 'unlicensed' // No valid license found or license is invalid (development)\n\t| 'unlicensed-production' // No valid license in production deployment (missing, invalid, or wrong domain)\n\t| 'expired' // License has been expired (+ grace period days past expiration for regular licenses, immediately for evaluation licenses)\n/** @internal */\nexport type InvalidLicenseReason =\n\t| 'invalid-license-key'\n\t| 'no-key-provided'\n\t| 'has-key-development-mode'\n\n/** @internal */\nexport type LicenseFromKeyResult = InvalidLicenseKeyResult | ValidLicenseKeyResult\n\n/** @internal */\nexport interface InvalidLicenseKeyResult {\n\tisLicenseParseable: false\n\treason: InvalidLicenseReason\n}\n\n/** @internal */\nexport interface ValidLicenseKeyResult {\n\tisLicenseParseable: true\n\tlicense: LicenseInfo\n\tisDevelopment: boolean\n\tisDomainValid: boolean\n\texpiryDate: Date\n\tisAnnualLicense: boolean\n\tisAnnualLicenseExpired: boolean\n\tisPerpetualLicense: boolean\n\tisPerpetualLicenseExpired: boolean\n\tisInternalLicense: boolean\n\tisNativeLicense: boolean\n\tisLicensedWithWatermark: boolean\n\tisEvaluationLicense: boolean\n\tisEvaluationLicenseExpired: boolean\n\tisCollaborationEnabled: boolean\n\tisCommentingEnabled: boolean\n\tdaysSinceExpiry: number\n}\n\n/** @internal */\nexport type TrackType = 'unlicensed' | 'with_watermark' | 'evaluation' | 'tracked' | null\n\n/** @internal */\nexport class LicenseManager {\n\tprivate publicKey =\n\t\t'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHJh0uUfxHtCGyerXmmatE368Hd9rI6LH9oPDQihnaCryRFWEVeOvf9U/SPbyxX74LFyJs5tYeAHq5Nc0Ax25LQ'\n\tpublic isDevelopment: boolean\n\tpublic isTest: boolean\n\tpublic isCryptoAvailable: boolean\n\tstate = atom<LicenseState>('license state', 'pending')\n\tfeatureFlags = atom<Record<LicenseFeatureName, boolean>>('license feature flags', {\n\t\t...NO_FEATURES,\n\t})\n\tpublic verbose = true\n\tprivate isDisposed = false\n\n\tconstructor(licenseKey: string | undefined, testPublicKey?: string) {\n\t\tthis.isTest = process.env.NODE_ENV === 'test'\n\t\tthis.isDevelopment = this.getIsDevelopment()\n\t\tthis.publicKey = testPublicKey || this.publicKey\n\t\tthis.isCryptoAvailable = !!crypto.subtle\n\n\t\t// In development every feature is enabled (see `getEnabledFeatures`), and that doesn't depend\n\t\t// on the async validation result. Reflect it eagerly so features aren't reported as disabled\n\t\t// during the validation window \u2014 or left disabled if validation rejects (the `.catch` below\n\t\t// never sets `featureFlags`). In production the fail-closed default stands until validation.\n\t\tif (this.isDevelopment) {\n\t\t\tthis.featureFlags.set({ ...ALL_FEATURES })\n\t\t}\n\n\t\tthis.getLicenseFromKey(licenseKey)\n\t\t\t.then((result) => {\n\t\t\t\t// replaced by a manager for a newer key: this one's messages, tracking ping and state\n\t\t\t\t// would describe a key the app no longer uses\n\t\t\t\tif (this.isDisposed) return\n\t\t\t\tconst licenseState = getLicenseState(\n\t\t\t\t\tresult,\n\t\t\t\t\t(messages: string[]) => this.outputMessages(messages),\n\t\t\t\t\tthis.isDevelopment\n\t\t\t\t)\n\n\t\t\t\tthis.maybeTrack(result, licenseState)\n\n\t\t\t\t// Update both atoms atomically so dependents never observe the license state and the\n\t\t\t\t// feature flags out of sync mid-update.\n\t\t\t\ttransact(() => {\n\t\t\t\t\tthis.state.set(licenseState)\n\t\t\t\t\tthis.featureFlags.set(getEnabledFeatures(result, licenseState, this.isDevelopment))\n\t\t\t\t})\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tif (this.isDisposed) return\n\t\t\t\tconsole.error('License validation failed:', error)\n\t\t\t\tthis.state.set('unlicensed')\n\t\t\t})\n\t}\n\n\t/** Ignore the pending validation: nothing is logged, tracked or set once the manager is replaced. */\n\tdispose() {\n\t\tthis.isDisposed = true\n\t}\n\n\t/**\n\t * Returns whether a given licensable feature is enabled. Reactive: reading this inside a signal\n\t * recomputes when license validation resolves.\n\t */\n\tisFeatureEnabled(feature: LicenseFeatureName): boolean {\n\t\treturn this.featureFlags.get()[feature]\n\t}\n\n\tprivate getIsDevelopment() {\n\t\tconst { protocol, hostname } = this.getOriginLocation()\n\n\t\t// Tauri uses `tauri://localhost` on macOS and Linux and `http://tauri.localhost` on Windows.\n\t\tif (hostname.endsWith('.localhost')) {\n\t\t\treturn process.env.NODE_ENV !== 'production'\n\t\t}\n\n\t\treturn (\n\t\t\tprotocol === 'http:' ||\n\t\t\t(protocol === 'https:' && this.isLoopbackHost(hostname)) ||\n\t\t\tprocess.env.NODE_ENV !== 'production'\n\t\t)\n\t}\n\n\tprivate getOriginLocation() {\n\t\t// A document loaded from `blob:https://example.com/<uuid>` has protocol `blob:` and an empty\n\t\t// hostname, but its origin is the page that created the blob. Opaque origins ('null': custom\n\t\t// schemes, file:, about:) keep using the location.\n\t\tconst { origin, protocol, hostname } = window.location\n\t\tconst source = origin && origin !== 'null' ? new URL(origin) : { protocol, hostname }\n\t\treturn { protocol: source.protocol, hostname: source.hostname.toLowerCase() }\n\t}\n\n\tprivate isLoopbackHost(hostname: string) {\n\t\t// localhost, IPv4 loopback (127.0.0.0/8) and IPv6 loopback (::1) are all local development hosts\n\t\tconst host = hostname.toLowerCase().replace(/^\\[|\\]$/g, '')\n\t\treturn host === 'localhost' || host === '::1' || /^127(?:\\.\\d{1,3}){3}$/.test(host)\n\t}\n\n\t/** Whether the page is served from one of tldraw's own domains, a subdomain of one, or our VS Code extension. */\n\tprivate isCanonicalTldrawHost() {\n\t\tif (window.location.protocol === 'vscode-webview:') {\n\t\t\tconst extensionId = new URL(window.location.href).searchParams.get('extensionId')\n\t\t\treturn extensionId === CANONICAL_VSCODE_EXTENSION_ID\n\t\t}\n\t\tconst hostname = window.location.hostname.toLowerCase()\n\t\treturn CANONICAL_TLDRAW_HOSTS.some((host) => hostname === host || hostname.endsWith(`.${host}`))\n\t}\n\n\t/**\n\t * The license tldraw's own domains get without a key. It keeps the watermark \u2014 our properties\n\t * advertise the SDK the same way any other watermarked deployment does \u2014 and grants the\n\t * collaboration features our apps are built on.\n\t *\n\t * Every expiry-derived field is a literal rather than something computed from a date, because\n\t * there is no key here to expire: the grant lasts as long as the host is ours.\n\t */\n\tprivate getCanonicalHostLicense(): ValidLicenseKeyResult {\n\t\treturn {\n\t\t\tisLicenseParseable: true,\n\t\t\tlicense: {\n\t\t\t\tid: CANONICAL_HOST_LICENSE_ID,\n\t\t\t\thosts: [window.location.hostname.toLowerCase()],\n\t\t\t\tflags: FLAGS.WITH_WATERMARK | FLAGS.FEAT_COLLABORATION | FLAGS.FEAT_COMMENTING,\n\t\t\t\texpiryDate: CANONICAL_HOST_NEVER_EXPIRES.toISOString(),\n\t\t\t},\n\t\t\tisDevelopment: this.isDevelopment,\n\t\t\tisDomainValid: true,\n\t\t\texpiryDate: CANONICAL_HOST_NEVER_EXPIRES,\n\t\t\tisAnnualLicense: false,\n\t\t\tisAnnualLicenseExpired: false,\n\t\t\tisPerpetualLicense: false,\n\t\t\tisPerpetualLicenseExpired: false,\n\t\t\tisInternalLicense: false,\n\t\t\tisNativeLicense: false,\n\t\t\tisLicensedWithWatermark: true,\n\t\t\tisEvaluationLicense: false,\n\t\t\tisEvaluationLicenseExpired: false,\n\t\t\tisCollaborationEnabled: true,\n\t\t\tisCommentingEnabled: true,\n\t\t\tdaysSinceExpiry: 0,\n\t\t}\n\t}\n\n\tprivate getTrackType(result: LicenseFromKeyResult, licenseState: LicenseState): TrackType {\n\t\t// Our own domains are licensed without a key, and the watermark ping exists to tell us about\n\t\t// deployments we don't already know about. Reporting our own apps back to ourselves would only\n\t\t// add noise to the numbers we read, so the canonical-host grant is never tracked.\n\t\tif ('license' in result && result.license.id === CANONICAL_HOST_LICENSE_ID) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Track watermark for unlicensed production deployments\n\t\tif (licenseState === 'unlicensed-production') {\n\t\t\treturn 'unlicensed'\n\t\t}\n\n\t\tif (this.isDevelopment) {\n\t\t\treturn null\n\t\t}\n\n\t\tif (!result.isLicenseParseable) {\n\t\t\treturn null\n\t\t}\n\n\t\t// Track evaluation licenses (for analytics, even though no watermark is shown)\n\t\tif (result.isEvaluationLicense) {\n\t\t\treturn 'evaluation'\n\t\t}\n\n\t\tif (this.isFlagEnabled(result.license.flags, FLAGS.TRACKED)) {\n\t\t\treturn 'tracked'\n\t\t}\n\n\t\t// Track licenses that show watermarks\n\t\tif (licenseState === 'licensed-with-watermark') {\n\t\t\treturn 'with_watermark'\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate maybeTrack(result: LicenseFromKeyResult, licenseState: LicenseState): void {\n\t\tconst trackType = this.getTrackType(result, licenseState)\n\t\tif (!trackType) {\n\t\t\treturn\n\t\t}\n\n\t\tconst url = new URL(WATERMARK_TRACK_SRC)\n\t\turl.searchParams.set('version', version)\n\t\turl.searchParams.set('license_type', trackType)\n\t\tif ('license' in result) {\n\t\t\turl.searchParams.set('license_id', result.license.id)\n\t\t\tconst sku = this.isFlagEnabled(result.license.flags, FLAGS.EVALUATION_LICENSE)\n\t\t\t\t? 'evaluation'\n\t\t\t\t: this.isFlagEnabled(result.license.flags, FLAGS.ANNUAL_LICENSE)\n\t\t\t\t\t? 'annual'\n\t\t\t\t\t: this.isFlagEnabled(result.license.flags, FLAGS.PERPETUAL_LICENSE)\n\t\t\t\t\t\t? 'perpetual'\n\t\t\t\t\t\t: 'unknown'\n\t\t\turl.searchParams.set('sku', sku)\n\t\t}\n\t\turl.searchParams.set('url', window.location.href)\n\t\tif (process.env.NODE_ENV) {\n\t\t\turl.searchParams.set('environment', process.env.NODE_ENV)\n\t\t}\n\n\t\t// best-effort: a blocked or offline request must not surface as an unhandled rejection\n\t\t// eslint-disable-next-line no-restricted-globals\n\t\tfetch(url.toString()).catch(noop)\n\t}\n\n\tprivate async extractLicenseKey(licenseKey: string): Promise<LicenseInfo> {\n\t\tconst [data, signature] = licenseKey.split('.')\n\t\tconst [prefix, encodedData] = data.split('/')\n\n\t\tif (!prefix.startsWith('tldraw-')) {\n\t\t\tthrow new Error(`Unsupported prefix '${prefix}'`)\n\t\t}\n\n\t\tconst publicCryptoKey = await importPublicKey(this.publicKey)\n\n\t\tlet isVerified\n\t\ttry {\n\t\t\tisVerified = await crypto.subtle.verify(\n\t\t\t\t{\n\t\t\t\t\tname: 'ECDSA',\n\t\t\t\t\thash: { name: 'SHA-256' },\n\t\t\t\t},\n\t\t\t\tpublicCryptoKey,\n\t\t\t\tnew Uint8Array(str2ab(atob(signature))),\n\t\t\t\tnew Uint8Array(str2ab(atob(encodedData)))\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\tthrow new Error('Could not perform signature validation')\n\t\t}\n\n\t\tif (!isVerified) {\n\t\t\tthrow new Error('Invalid signature')\n\t\t}\n\n\t\tlet decodedData: any\n\t\ttry {\n\t\t\tdecodedData = JSON.parse(atob(encodedData))\n\t\t} catch {\n\t\t\tthrow new Error('Could not parse object')\n\t\t}\n\t\tif (decodedData.length > NUMBER_OF_KNOWN_PROPERTIES) {\n\t\t\tthis.outputMessages([\n\t\t\t\t'License key contains some unknown properties.',\n\t\t\t\t'You may want to update tldraw packages to a newer version to get access to new functionality.',\n\t\t\t])\n\t\t}\n\n\t\treturn {\n\t\t\tid: decodedData[PROPERTIES.ID],\n\t\t\thosts: decodedData[PROPERTIES.HOSTS],\n\t\t\tflags: decodedData[PROPERTIES.FLAGS],\n\t\t\texpiryDate: decodedData[PROPERTIES.EXPIRY_DATE],\n\t\t}\n\t}\n\n\tasync getLicenseFromKey(licenseKey?: string): Promise<LicenseFromKeyResult> {\n\t\t// A key that is provided still wins, so an app on one of our hosts can opt into a different\n\t\t// license \u2014 a native or feature-specific key \u2014 just by passing it.\n\t\tif (!licenseKey && this.isCanonicalTldrawHost()) {\n\t\t\treturn this.getCanonicalHostLicense()\n\t\t}\n\n\t\tif (!licenseKey) {\n\t\t\tif (!this.isDevelopment) {\n\t\t\t\tthis.outputNoLicenseKeyProvided()\n\t\t\t}\n\n\t\t\treturn { isLicenseParseable: false, reason: 'no-key-provided' }\n\t\t}\n\n\t\tif (this.isDevelopment && !this.isCryptoAvailable) {\n\t\t\tif (this.verbose) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t'tldraw: you seem to be in a development environment that does not support crypto. License not verified.'\n\t\t\t\t)\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log('You should check that this works in production separately.')\n\t\t\t}\n\t\t\t// We can't parse the license if we are in development mode since crypto\n\t\t\t// is not available on http\n\t\t\treturn { isLicenseParseable: false, reason: 'has-key-development-mode' }\n\t\t}\n\n\t\t// Borrowed idea from AG Grid:\n\t\t// Copying from various sources (like PDFs) can include zero-width characters.\n\t\t// This helps makes sure the key validation doesn't fail.\n\t\tlet cleanedLicenseKey = licenseKey.replace(/[\\u200B-\\u200D\\uFEFF]/g, '')\n\t\tcleanedLicenseKey = cleanedLicenseKey.replace(/\\r?\\n|\\r/g, '')\n\n\t\ttry {\n\t\t\tconst licenseInfo = await this.extractLicenseKey(cleanedLicenseKey)\n\t\t\tconst expiryDate = new Date(licenseInfo.expiryDate)\n\t\t\tconst isAnnualLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.ANNUAL_LICENSE)\n\t\t\tconst isPerpetualLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.PERPETUAL_LICENSE)\n\t\t\tconst isEvaluationLicense = this.isFlagEnabled(licenseInfo.flags, FLAGS.EVALUATION_LICENSE)\n\n\t\t\tconst isAnnualLicenseExpired = isAnnualLicense && this.isAnnualLicenseExpired(expiryDate)\n\t\t\tconst isPerpetualLicenseExpired =\n\t\t\t\tisPerpetualLicense && this.isPerpetualLicenseExpired(expiryDate)\n\n\t\t\t// The collaboration umbrella grants all of its sub-features, so commenting is enabled\n\t\t\t// by either the commenting flag or the collaboration flag.\n\t\t\tconst isCollaborationEnabled = this.isFlagEnabled(licenseInfo.flags, FLAGS.FEAT_COLLABORATION)\n\t\t\tconst isCommentingEnabled =\n\t\t\t\tisCollaborationEnabled || this.isFlagEnabled(licenseInfo.flags, FLAGS.FEAT_COMMENTING)\n\n\t\t\t// For perpetual licenses, the calendar expiry date only gates access to future\n\t\t\t// major/minor releases; it does not \"expire\" the license itself. While the user\n\t\t\t// is still on a covered version we report `daysSinceExpiry` as 0 so consumers\n\t\t\t// (and the grace-period warning) don't treat them as past expiry.\n\t\t\tconst daysSinceExpiry =\n\t\t\t\tisPerpetualLicense && !isPerpetualLicenseExpired ? 0 : this.getDaysSinceExpiry(expiryDate)\n\n\t\t\tconst result: ValidLicenseKeyResult = {\n\t\t\t\tlicense: licenseInfo,\n\t\t\t\tisLicenseParseable: true,\n\t\t\t\tisDevelopment: this.isDevelopment,\n\t\t\t\tisDomainValid: this.isDomainValid(licenseInfo),\n\t\t\t\texpiryDate,\n\t\t\t\tisAnnualLicense,\n\t\t\t\tisAnnualLicenseExpired,\n\t\t\t\tisPerpetualLicense,\n\t\t\t\tisPerpetualLicenseExpired,\n\t\t\t\tisInternalLicense: this.isFlagEnabled(licenseInfo.flags, FLAGS.INTERNAL_LICENSE),\n\t\t\t\tisNativeLicense: this.isNativeLicense(licenseInfo),\n\t\t\t\tisLicensedWithWatermark: this.isFlagEnabled(licenseInfo.flags, FLAGS.WITH_WATERMARK),\n\t\t\t\tisEvaluationLicense,\n\t\t\t\tisEvaluationLicenseExpired:\n\t\t\t\t\tisEvaluationLicense && this.isEvaluationLicenseExpired(expiryDate),\n\t\t\t\tisCollaborationEnabled,\n\t\t\t\tisCommentingEnabled,\n\t\t\t\tdaysSinceExpiry,\n\t\t\t}\n\t\t\tthis.outputLicenseInfoIfNeeded(result)\n\n\t\t\treturn result\n\t\t} catch (e: any) {\n\t\t\tthis.outputInvalidLicenseKey(e.message)\n\t\t\t// If the license can't be parsed, it's invalid\n\t\t\treturn { isLicenseParseable: false, reason: 'invalid-license-key' }\n\t\t}\n\t}\n\n\tprivate isDomainValid(licenseInfo: LicenseInfo) {\n\t\tconst currentHostname = this.getOriginLocation().hostname\n\n\t\treturn licenseInfo.hosts.some((host) => {\n\t\t\tconst normalizedHostOrUrlRegex = host.toLowerCase().trim()\n\n\t\t\t// Allow the domain if listed and www variations, 'example.com' allows 'example.com' and 'www.example.com'\n\t\t\tif (\n\t\t\t\tnormalizedHostOrUrlRegex === currentHostname ||\n\t\t\t\t`www.${normalizedHostOrUrlRegex}` === currentHostname ||\n\t\t\t\tnormalizedHostOrUrlRegex === `www.${currentHostname}`\n\t\t\t) {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// If host is '*', we allow all domains.\n\t\t\tif (host === '*') {\n\t\t\t\t// All domains allowed.\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\t// Native license support\n\t\t\t// In this case, `normalizedHost` is actually a protocol, e.g. `app-bundle:`\n\t\t\tif (this.isNativeLicense(licenseInfo)) {\n\t\t\t\treturn new RegExp(normalizedHostOrUrlRegex).test(window.location.href)\n\t\t\t}\n\n\t\t\t// Glob testing, we only support '*.somedomain.com' right now.\n\t\t\tif (host.includes('*')) {\n\t\t\t\tconst globToRegex = new RegExp(\n\t\t\t\t\tnormalizedHostOrUrlRegex.replace(/\\./g, '\\\\.').replace(/\\*/g, '.*?') + '$'\n\t\t\t\t)\n\t\t\t\treturn globToRegex.test(currentHostname) || globToRegex.test(`www.${currentHostname}`)\n\t\t\t}\n\n\t\t\t// VSCode support\n\t\t\tif (window.location.protocol === 'vscode-webview:') {\n\t\t\t\tconst currentUrl = new URL(window.location.href)\n\t\t\t\tconst extensionId = currentUrl.searchParams.get('extensionId')\n\t\t\t\tif (normalizedHostOrUrlRegex === extensionId) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false\n\t\t})\n\t}\n\n\tprivate isNativeLicense(licenseInfo: LicenseInfo) {\n\t\treturn this.isFlagEnabled(licenseInfo.flags, FLAGS.NATIVE_LICENSE)\n\t}\n\n\tprivate getExpirationDateWithoutGracePeriod(expiryDate: Date) {\n\t\t// The named expiry date is the last day the license is fully usable, so the license\n\t\t// expires at the end of that day, i.e. the start of the following day. We work in UTC\n\t\t// (the expiry date is minted and parsed as a UTC date-only string) so the cutoff is a\n\t\t// single predictable instant for every user regardless of their local timezone.\n\t\treturn new Date(\n\t\t\tDate.UTC(\n\t\t\t\texpiryDate.getUTCFullYear(),\n\t\t\t\texpiryDate.getUTCMonth(),\n\t\t\t\texpiryDate.getUTCDate() + 1 // Add 1 day so the named date is fully usable\n\t\t\t)\n\t\t)\n\t}\n\n\tprivate getExpirationDateWithGracePeriod(expiryDate: Date) {\n\t\treturn new Date(\n\t\t\tDate.UTC(\n\t\t\t\texpiryDate.getUTCFullYear(),\n\t\t\t\texpiryDate.getUTCMonth(),\n\t\t\t\texpiryDate.getUTCDate() + GRACE_PERIOD_DAYS + 1 // Add 1 day to include the expiration day\n\t\t\t)\n\t\t)\n\t}\n\n\tprivate isAnnualLicenseExpired(expiryDate: Date) {\n\t\tconst expiration = this.getExpirationDateWithGracePeriod(expiryDate)\n\t\treturn new Date() >= expiration\n\t}\n\n\tprivate isPerpetualLicenseExpired(expiryDate: Date) {\n\t\tconst expiration = this.getExpirationDateWithGracePeriod(expiryDate)\n\t\tconst dates = {\n\t\t\tmajor: new Date(publishDates.major),\n\t\t\tminor: new Date(publishDates.minor),\n\t\t}\n\t\t// We allow patch releases, but the major and minor releases should be within the expiration date\n\t\treturn dates.major >= expiration || dates.minor >= expiration\n\t}\n\n\tprivate getDaysSinceExpiry(expiryDate: Date): number {\n\t\tconst now = new Date()\n\t\tconst expiration = this.getExpirationDateWithoutGracePeriod(expiryDate)\n\t\tconst diffTime = now.getTime() - expiration.getTime()\n\t\tconst diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24))\n\t\treturn Math.max(0, diffDays)\n\t}\n\n\tprivate isEvaluationLicenseExpired(expiryDate: Date): boolean {\n\t\t// Evaluation licenses have no grace period - they expire immediately\n\t\tconst now = new Date()\n\t\tconst expiration = this.getExpirationDateWithoutGracePeriod(expiryDate)\n\t\treturn now >= expiration\n\t}\n\n\tprivate isFlagEnabled(flags: number, flag: number) {\n\t\treturn (flags & flag) === flag\n\t}\n\n\tprivate outputNoLicenseKeyProvided() {\n\t\t// Noop, we don't need to show this message.\n\t\t// this.outputMessages([\n\t\t// \t'No tldraw license key provided!',\n\t\t// \t`Please reach out to ${LICENSE_EMAIL} if you would like to license tldraw or if you'd like a trial.`,\n\t\t// ])\n\t}\n\n\tprivate outputInvalidLicenseKey(msg: string) {\n\t\tthis.outputMessages(['Invalid tldraw license key', `Reason: ${msg}`])\n\t}\n\n\tprivate outputLicenseInfoIfNeeded(result: ValidLicenseKeyResult) {\n\t\t// If we added a new flag it will be twice the value of the currently highest flag.\n\t\t// And if all the current flags are on we would get the `HIGHEST_FLAG * 2 - 1`, so anything higher than that means there are new flags.\n\t\tif (result.license.flags >= HIGHEST_FLAG * 2) {\n\t\t\tthis.outputMessages(\n\t\t\t\t[\n\t\t\t\t\t'Warning: This tldraw license contains some unknown flags.',\n\t\t\t\t\t'This will still work, however, you may want to update tldraw packages to a newer version to get access to new functionality.',\n\t\t\t\t],\n\t\t\t\t'warning'\n\t\t\t)\n\t\t}\n\t}\n\n\tprivate outputMessages(messages: string[], type: 'warning' | 'error' = 'error') {\n\t\tif (this.isTest) return\n\t\tif (this.verbose) {\n\t\t\tthis.outputDelimiter(type)\n\t\t\tfor (const message of messages) {\n\t\t\t\tconst bgColor = type === 'warning' ? 'orange' : 'crimson'\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log(\n\t\t\t\t\t`%c${message}`,\n\t\t\t\t\t`color: white; background: ${bgColor}; padding: 2px; border-radius: 3px;`\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.outputDelimiter(type)\n\t\t}\n\t}\n\n\tprivate outputDelimiter(type: 'warning' | 'error' = 'error') {\n\t\tconst bgColor = type === 'warning' ? 'orange' : 'crimson'\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t'%c-------------------------------------------------------------------',\n\t\t\t`color: white; background: ${bgColor}; padding: 2px; border-radius: 3px;`\n\t\t)\n\t}\n\n\tstatic className = 'tl-watermark_SEE-LICENSE'\n}\n\n/**\n * Derives which licensable features are enabled from the parse result and the derived license\n * state. In development every feature is enabled so SDK developers can build against them; in\n * production a feature requires both an active, valid license and the corresponding flag.\n *\n * @internal\n */\nexport function getEnabledFeatures(\n\tresult: LicenseFromKeyResult,\n\tlicenseState: LicenseState,\n\tisDevelopment: boolean\n): Record<LicenseFeatureName, boolean> {\n\t// Development gets all features so SDK developers can build against them.\n\tif (isDevelopment) {\n\t\treturn { ...ALL_FEATURES }\n\t}\n\n\t// Features require an active, valid license. Both the grace-period 'licensed' state and\n\t// the watermark state count as valid; unlicensed/expired/pending do not.\n\tif (\n\t\t!result.isLicenseParseable ||\n\t\t(licenseState !== 'licensed' && licenseState !== 'licensed-with-watermark')\n\t) {\n\t\treturn { ...NO_FEATURES }\n\t}\n\n\t// Evaluation licenses get every feature so prospects can trial the whole product without us\n\t// having to mint per-feature evaluation keys. Expired evaluation licenses are already excluded\n\t// above: they resolve to the 'expired' state.\n\tif (result.isEvaluationLicense) {\n\t\treturn { ...ALL_FEATURES }\n\t}\n\n\treturn {\n\t\tcollaboration: result.isCollaborationEnabled,\n\t\tcommenting: result.isCommentingEnabled,\n\t}\n}\n\nexport function getLicenseState(\n\tresult: LicenseFromKeyResult,\n\toutputMessages: (messages: string[]) => void,\n\tisDevelopment: boolean\n): LicenseState {\n\tif (!result.isLicenseParseable) {\n\t\tif (isDevelopment) {\n\t\t\treturn 'unlicensed'\n\t\t}\n\n\t\t// All unlicensed scenarios should not work in production\n\t\tif (result.reason === 'no-key-provided') {\n\t\t\toutputMessages([\n\t\t\t\t'No tldraw license key provided!',\n\t\t\t\t'A license is required for production deployments.',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t\t])\n\t\t} else {\n\t\t\toutputMessages([\n\t\t\t\t'Invalid license key. tldraw requires a valid license for production use.',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t\t])\n\t\t}\n\t\treturn 'unlicensed-production'\n\t}\n\n\tif (!result.isDomainValid && !result.isDevelopment) {\n\t\toutputMessages([\n\t\t\t'License key is not valid for this domain.',\n\t\t\t'A license is required for production deployments.',\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a license.`,\n\t\t])\n\t\treturn 'unlicensed-production'\n\t}\n\n\t// Handle evaluation licenses - they expire immediately with no grace period\n\tif (result.isEvaluationLicense) {\n\t\tif (result.isEvaluationLicenseExpired) {\n\t\t\toutputMessages([\n\t\t\t\t'Your tldraw evaluation license has expired!',\n\t\t\t\t`Please reach out to ${LICENSE_EMAIL} to purchase a full license.`,\n\t\t\t])\n\t\t\treturn 'expired'\n\t\t} else {\n\t\t\t// Valid evaluation license - tracked but no watermark shown\n\t\t\treturn 'licensed'\n\t\t}\n\t}\n\n\t// Handle expired regular licenses (both annual and perpetual)\n\tif (result.isPerpetualLicenseExpired || result.isAnnualLicenseExpired) {\n\t\toutputMessages([\n\t\t\t`Your tldraw license has been expired for more than ${GRACE_PERIOD_DAYS} days!`,\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to renew your license.`,\n\t\t])\n\t\treturn 'expired'\n\t}\n\n\t// Check if license is past expiry date but within grace period\n\tconst daysSinceExpiry = result.daysSinceExpiry\n\tif (daysSinceExpiry > 0 && !result.isEvaluationLicense) {\n\t\toutputMessages([\n\t\t\t'Your tldraw license has expired.',\n\t\t\t`License expired ${daysSinceExpiry} days ago.`,\n\t\t\t`Please reach out to ${LICENSE_EMAIL} to renew your license.`,\n\t\t])\n\t\t// Within grace period: still licensed (no watermark)\n\t\treturn 'licensed'\n\t}\n\n\t// License is valid, determine if it has watermark\n\tif (result.isLicensedWithWatermark) {\n\t\treturn 'licensed-with-watermark'\n\t}\n\n\treturn 'licensed'\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+B;AAC/B,mBAAqB;AACrB,qBAAsC;AACtC,oBAAqC;AACrC,uBAAwC;AAExC,MAAM,oBAAoB;AAEnB,MAAM,QAAQ;AAAA;AAAA;AAAA,EAGpB,gBAAgB;AAAA;AAAA,EAEhB,mBAAmB,KAAK;AAAA;AAAA;AAAA,EAIxB,kBAAkB,KAAK;AAAA;AAAA,EAEvB,gBAAgB,KAAK;AAAA;AAAA,EAErB,oBAAoB,KAAK;AAAA;AAAA;AAAA,EAGzB,gBAAgB,KAAK;AAAA;AAAA;AAAA,EAIrB,oBAAoB,KAAK;AAAA;AAAA,EAEzB,iBAAiB,KAAK;AAAA,EACtB,SAAS,KAAK;AACf;AACA,MAAM,eAAe,KAAK,IAAI,GAAG,O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B;AAC/B,QAAI,OAAO,4BAA4B;AACtC,qBAAe;AAAA,QACd;AAAA,QACA,uBAAuB,aAAa;AAAA,MACrC,CAAC;AACD,aAAO;AAAA,IACR,OAAO;AAEN,aAAO;AAAA,IACR;AAAA,EACD;AAGA,MAAI,OAAO,6BAA6B,OAAO,wBAAwB;AACtE,mBAAe;AAAA,MACd,sDAAsD,iBAAiB;AAAA,MACvE,uBAAuB,aAAa;AAAA,IACrC,CAAC;AACD,WAAO;AAAA,EACR;AAGA,QAAM,kBAAkB,OAAO;AAC/B,MAAI,kBAAkB,KAAK,CAAC,OAAO,qBAAqB;AACvD,mBAAe;AAAA,MACd;AAAA,MACA,mBAAmB,eAAe;AAAA,MAClC,uBAAuB,aAAa;AAAA,IACrC,CAAC;AAED,WAAO;AAAA,EACR;AAGA,MAAI,OAAO,yBAAyB;AACnC,WAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist-cjs/version.js
CHANGED
|
@@ -22,10 +22,10 @@ __export(version_exports, {
|
|
|
22
22
|
version: () => version
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(version_exports);
|
|
25
|
-
const version = "5.7.0-next.
|
|
25
|
+
const version = "5.7.0-next.147eae59044f";
|
|
26
26
|
const publishDates = {
|
|
27
27
|
major: "2026-05-06T16:28:18.473Z",
|
|
28
|
-
minor: "2026-11-
|
|
29
|
-
patch: "2026-11-
|
|
28
|
+
minor: "2026-11-25T09:33:10.500Z",
|
|
29
|
+
patch: "2026-11-25T09:33:10.500Z"
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=version.js.map
|
package/dist-cjs/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/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.7.0-next.
|
|
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.7.0-next.147eae59044f'\nexport const publishDates = {\n\tmajor: '2026-05-06T16:28:18.473Z',\n\tminor: '2026-11-25T09:33:10.500Z',\n\tpatch: '2026-11-25T09:33:10.500Z',\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
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -1977,14 +1977,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1977
1977
|
* @public
|
|
1978
1978
|
*/
|
|
1979
1979
|
getCurrentPageShapesInReadingOrder(): TLShape[];
|
|
1980
|
-
|
|
1981
|
-
* Sort the given shapes into reading order (left-to-right, top-to-bottom), dropping any that
|
|
1982
|
-
* can't be tabbed to. Use this for the children of a frame or group, which
|
|
1983
|
-
* {@link Editor.getCurrentPageShapesInReadingOrder} leaves out.
|
|
1984
|
-
*
|
|
1985
|
-
* @public
|
|
1986
|
-
*/
|
|
1987
|
-
getShapesInReadingOrder(shapes: TLShape[]): TLShape[];
|
|
1980
|
+
/* Excluded from this release type: getShapesInReadingOrder */
|
|
1988
1981
|
/**
|
|
1989
1982
|
* Find the nearest adjacent shape in a specific direction.
|
|
1990
1983
|
*
|
|
@@ -4066,6 +4059,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
4066
4059
|
* @param historyOptions - The history options for the change.
|
|
4067
4060
|
*/
|
|
4068
4061
|
setOpacityForNextShapes(opacity: number, historyOptions?: TLHistoryBatchOptions): this;
|
|
4062
|
+
private getOpacityForNextShape;
|
|
4069
4063
|
/**
|
|
4070
4064
|
* Set the current opacity. This will effect any selected shapes.
|
|
4071
4065
|
*
|
|
@@ -8799,6 +8793,9 @@ export declare interface TLEventMap {
|
|
|
8799
8793
|
name: string;
|
|
8800
8794
|
pageId: TLPageId;
|
|
8801
8795
|
}];
|
|
8796
|
+
'confirm-open-link': [{
|
|
8797
|
+
url: string;
|
|
8798
|
+
}];
|
|
8802
8799
|
change: [HistoryEntry<TLRecord>];
|
|
8803
8800
|
update: [];
|
|
8804
8801
|
crash: [{
|
package/dist-esm/index.mjs
CHANGED
|
@@ -319,7 +319,7 @@ import { LocalIndexedDb, Table } from "./lib/utils/sync/LocalIndexedDb.mjs";
|
|
|
319
319
|
import { uniq } from "./lib/utils/uniq.mjs";
|
|
320
320
|
registerTldrawLibraryVersion(
|
|
321
321
|
"@tldraw/editor",
|
|
322
|
-
"5.7.0-next.
|
|
322
|
+
"5.7.0-next.147eae59044f",
|
|
323
323
|
"esm"
|
|
324
324
|
);
|
|
325
325
|
import { getColorValue } from "./lib/editor/managers/ThemeManager/defaultThemes.mjs";
|