@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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TLThemeFontCheckbox } from '@tldraw/tlschema'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The draw font's checkboxes: draw-dash rectangles taken off the canvas, so a checkbox reads as
|
|
5
|
+
* drawn alongside the shapes around it, and a round-capped tick. Each box is two passes around the
|
|
6
|
+
* same rectangle, which is where its uneven weight comes from.
|
|
7
|
+
*/
|
|
8
|
+
export const DRAW_FONT_CHECKBOX: TLThemeFontCheckbox = {
|
|
9
|
+
boxes: [
|
|
10
|
+
"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",
|
|
11
|
+
"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",
|
|
12
|
+
"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",
|
|
13
|
+
"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",
|
|
14
|
+
"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",
|
|
15
|
+
"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",
|
|
16
|
+
],
|
|
17
|
+
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",
|
|
18
|
+
}
|
|
@@ -23,6 +23,7 @@ vi.mock('../../version', () => {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
const now = new Date()
|
|
26
|
+
const EXPECTED_GRACE_PERIOD_DAYS = 5
|
|
26
27
|
const expiryDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 5).toISOString()
|
|
27
28
|
|
|
28
29
|
const STANDARD_LICENSE_INFO = JSON.stringify([
|
|
@@ -1083,7 +1084,7 @@ describe('LicenseManager', () => {
|
|
|
1083
1084
|
describe('License expiry and grace period', () => {
|
|
1084
1085
|
it('Fails if the license key has expired beyond grace period', async () => {
|
|
1085
1086
|
const expiredLicenseInfo = JSON.parse(STANDARD_LICENSE_INFO)
|
|
1086
|
-
const expiryDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() -
|
|
1087
|
+
const expiryDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 10)
|
|
1087
1088
|
expiredLicenseInfo[PROPERTIES.EXPIRY_DATE] = expiryDate
|
|
1088
1089
|
const expiredLicenseKey = await generateLicenseKey(
|
|
1089
1090
|
JSON.stringify(expiredLicenseInfo),
|
|
@@ -1097,7 +1098,7 @@ describe('LicenseManager', () => {
|
|
|
1097
1098
|
|
|
1098
1099
|
it('Allows a grace period for expired licenses', async () => {
|
|
1099
1100
|
const almostExpiredLicenseInfo = JSON.parse(STANDARD_LICENSE_INFO)
|
|
1100
|
-
const expiryDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() -
|
|
1101
|
+
const expiryDate = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 4)
|
|
1101
1102
|
almostExpiredLicenseInfo[PROPERTIES.EXPIRY_DATE] = expiryDate
|
|
1102
1103
|
const almostExpiredLicenseKey = await generateLicenseKey(
|
|
1103
1104
|
JSON.stringify(almostExpiredLicenseInfo),
|
|
@@ -1109,15 +1110,15 @@ describe('LicenseManager', () => {
|
|
|
1109
1110
|
expect(result.isAnnualLicenseExpired).toBe(false)
|
|
1110
1111
|
})
|
|
1111
1112
|
|
|
1112
|
-
it('Handles grace period correctly -
|
|
1113
|
+
it('Handles grace period correctly - 4 days expired should still be within grace period', async () => {
|
|
1113
1114
|
// Pin the clock and use a date-only UTC expiry so the calculation is timezone
|
|
1114
|
-
// independent. The named day is fully usable, so an expiry
|
|
1115
|
-
// "now" has been past its usable window for
|
|
1115
|
+
// independent. The named day is fully usable, so an expiry 4 calendar days before
|
|
1116
|
+
// "now" has been past its usable window for 3 full days.
|
|
1116
1117
|
vi.useFakeTimers()
|
|
1117
1118
|
vi.setSystemTime(new Date('2026-06-26T12:00:00.000Z'))
|
|
1118
1119
|
try {
|
|
1119
1120
|
const expiredLicenseInfo = JSON.parse(STANDARD_LICENSE_INFO)
|
|
1120
|
-
expiredLicenseInfo[PROPERTIES.EXPIRY_DATE] = '2026-06-
|
|
1121
|
+
expiredLicenseInfo[PROPERTIES.EXPIRY_DATE] = '2026-06-22' // 4 days before now
|
|
1121
1122
|
|
|
1122
1123
|
const expiredLicenseKey = await generateLicenseKey(
|
|
1123
1124
|
JSON.stringify(expiredLicenseInfo),
|
|
@@ -1129,8 +1130,8 @@ describe('LicenseManager', () => {
|
|
|
1129
1130
|
expiredLicenseKey
|
|
1130
1131
|
)) as ValidLicenseKeyResult
|
|
1131
1132
|
expect(result.isAnnualLicense).toBe(true)
|
|
1132
|
-
expect(result.isAnnualLicenseExpired).toBe(false) // Within
|
|
1133
|
-
expect(result.daysSinceExpiry).toBe(
|
|
1133
|
+
expect(result.isAnnualLicenseExpired).toBe(false) // Within grace period
|
|
1134
|
+
expect(result.daysSinceExpiry).toBe(3)
|
|
1134
1135
|
} finally {
|
|
1135
1136
|
vi.useRealTimers()
|
|
1136
1137
|
}
|
|
@@ -1495,12 +1496,12 @@ describe('getLicenseState', () => {
|
|
|
1495
1496
|
})
|
|
1496
1497
|
|
|
1497
1498
|
describe('Grace period handling', () => {
|
|
1498
|
-
it('returns "licensed" for license
|
|
1499
|
+
it('returns "licensed" for license within grace period', () => {
|
|
1499
1500
|
const messages: string[][] = []
|
|
1500
1501
|
const licenseResult = getDefaultLicenseResult({
|
|
1501
1502
|
isAnnualLicense: true,
|
|
1502
|
-
isAnnualLicenseExpired: false, // Still within
|
|
1503
|
-
daysSinceExpiry:
|
|
1503
|
+
isAnnualLicenseExpired: false, // Still within grace period
|
|
1504
|
+
daysSinceExpiry: 4,
|
|
1504
1505
|
isInternalLicense: false,
|
|
1505
1506
|
})
|
|
1506
1507
|
|
|
@@ -1509,19 +1510,19 @@ describe('getLicenseState', () => {
|
|
|
1509
1510
|
expect(messages).toHaveLength(1)
|
|
1510
1511
|
expect(messages[0]).toEqual([
|
|
1511
1512
|
'Your tldraw license has expired.',
|
|
1512
|
-
'License expired
|
|
1513
|
+
'License expired 4 days ago.',
|
|
1513
1514
|
'Please reach out to sales@tldraw.com to renew your license.',
|
|
1514
1515
|
])
|
|
1515
1516
|
})
|
|
1516
1517
|
})
|
|
1517
1518
|
|
|
1518
1519
|
describe('Expired licenses', () => {
|
|
1519
|
-
it('returns "expired" for license
|
|
1520
|
+
it('returns "expired" for license past expiry+grace period', () => {
|
|
1520
1521
|
const messages: string[][] = []
|
|
1521
1522
|
const licenseResult = getDefaultLicenseResult({
|
|
1522
1523
|
isAnnualLicense: true,
|
|
1523
|
-
isAnnualLicenseExpired: true, // Beyond
|
|
1524
|
-
daysSinceExpiry:
|
|
1524
|
+
isAnnualLicenseExpired: true, // Beyond grace period
|
|
1525
|
+
daysSinceExpiry: 10,
|
|
1525
1526
|
isInternalLicense: false,
|
|
1526
1527
|
})
|
|
1527
1528
|
|
|
@@ -1529,7 +1530,7 @@ describe('getLicenseState', () => {
|
|
|
1529
1530
|
|
|
1530
1531
|
expect(messages).toHaveLength(1)
|
|
1531
1532
|
expect(messages[0]).toEqual([
|
|
1532
|
-
|
|
1533
|
+
`Your tldraw license has been expired for more than ${EXPECTED_GRACE_PERIOD_DAYS} days!`,
|
|
1533
1534
|
'Please reach out to sales@tldraw.com to renew your license.',
|
|
1534
1535
|
])
|
|
1535
1536
|
})
|
|
@@ -1586,7 +1587,7 @@ describe('getLicenseState', () => {
|
|
|
1586
1587
|
|
|
1587
1588
|
expect(messages).toHaveLength(1)
|
|
1588
1589
|
expect(messages[0]).toEqual([
|
|
1589
|
-
|
|
1590
|
+
`Your tldraw license has been expired for more than ${EXPECTED_GRACE_PERIOD_DAYS} days!`,
|
|
1590
1591
|
'Please reach out to sales@tldraw.com to renew your license.',
|
|
1591
1592
|
])
|
|
1592
1593
|
})
|
|
@@ -1606,7 +1607,7 @@ describe('getLicenseState', () => {
|
|
|
1606
1607
|
|
|
1607
1608
|
expect(messages).toHaveLength(1)
|
|
1608
1609
|
expect(messages[0]).toEqual([
|
|
1609
|
-
|
|
1610
|
+
`Your tldraw license has been expired for more than ${EXPECTED_GRACE_PERIOD_DAYS} days!`,
|
|
1610
1611
|
'Please reach out to sales@tldraw.com to renew your license.',
|
|
1611
1612
|
])
|
|
1612
1613
|
})
|
|
@@ -4,7 +4,7 @@ import { publishDates, version } from '../../version'
|
|
|
4
4
|
import { getDefaultCdnBaseUrl } from '../utils/assets'
|
|
5
5
|
import { importPublicKey, str2ab } from '../utils/licensing'
|
|
6
6
|
|
|
7
|
-
const GRACE_PERIOD_DAYS =
|
|
7
|
+
const GRACE_PERIOD_DAYS = 5
|
|
8
8
|
|
|
9
9
|
export const FLAGS = {
|
|
10
10
|
// -- MUTUALLY EXCLUSIVE FLAGS
|
|
@@ -102,7 +102,7 @@ export type LicenseState =
|
|
|
102
102
|
| 'licensed-with-watermark' // License is valid but shows watermark (evaluation licenses, WITH_WATERMARK licenses)
|
|
103
103
|
| 'unlicensed' // No valid license found or license is invalid (development)
|
|
104
104
|
| 'unlicensed-production' // No valid license in production deployment (missing, invalid, or wrong domain)
|
|
105
|
-
| 'expired' // License has been expired (
|
|
105
|
+
| 'expired' // License has been expired (+ grace period days past expiration for regular licenses, immediately for evaluation licenses)
|
|
106
106
|
/** @internal */
|
|
107
107
|
export type InvalidLicenseReason =
|
|
108
108
|
| 'invalid-license-key'
|
|
@@ -674,7 +674,7 @@ export function getEnabledFeatures(
|
|
|
674
674
|
return { ...ALL_FEATURES }
|
|
675
675
|
}
|
|
676
676
|
|
|
677
|
-
// Features require an active, valid license. Both the
|
|
677
|
+
// Features require an active, valid license. Both the grace-period 'licensed' state and
|
|
678
678
|
// the watermark state count as valid; unlicensed/expired/pending do not.
|
|
679
679
|
if (
|
|
680
680
|
!result.isLicenseParseable ||
|
|
@@ -748,7 +748,7 @@ export function getLicenseState(
|
|
|
748
748
|
// Handle expired regular licenses (both annual and perpetual)
|
|
749
749
|
if (result.isPerpetualLicenseExpired || result.isAnnualLicenseExpired) {
|
|
750
750
|
outputMessages([
|
|
751
|
-
|
|
751
|
+
`Your tldraw license has been expired for more than ${GRACE_PERIOD_DAYS} days!`,
|
|
752
752
|
`Please reach out to ${LICENSE_EMAIL} to renew your license.`,
|
|
753
753
|
])
|
|
754
754
|
return 'expired'
|
|
@@ -762,7 +762,7 @@ export function getLicenseState(
|
|
|
762
762
|
`License expired ${daysSinceExpiry} days ago.`,
|
|
763
763
|
`Please reach out to ${LICENSE_EMAIL} to renew your license.`,
|
|
764
764
|
])
|
|
765
|
-
// Within
|
|
765
|
+
// Within grace period: still licensed (no watermark)
|
|
766
766
|
return 'licensed'
|
|
767
767
|
}
|
|
768
768
|
|
package/src/version.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is automatically generated by internal/scripts/refresh-assets.ts.
|
|
2
2
|
// Do not edit manually. Or do, I'm a comment, not a cop.
|
|
3
3
|
|
|
4
|
-
export const version = '5.7.0-next.
|
|
4
|
+
export const version = '5.7.0-next.147eae59044f'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2026-05-06T16:28:18.473Z',
|
|
7
|
-
minor: '2026-11-
|
|
8
|
-
patch: '2026-11-
|
|
7
|
+
minor: '2026-11-25T09:33:10.500Z',
|
|
8
|
+
patch: '2026-11-25T09:33:10.500Z',
|
|
9
9
|
}
|