@tldraw/editor 4.2.0-canary.2bb634d0af63 → 4.2.0-canary.2d743164f8d3
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 +16 -3
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +11 -11
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/editor/types/emit-types.js.map +1 -1
- package/dist-cjs/lib/license/LicenseManager.js +1 -0
- package/dist-cjs/lib/license/LicenseManager.js.map +2 -2
- package/dist-cjs/lib/license/Watermark.js +8 -2
- package/dist-cjs/lib/license/Watermark.js.map +2 -2
- package/dist-cjs/lib/utils/runtime.js +2 -2
- package/dist-cjs/lib/utils/runtime.js.map +2 -2
- package/dist-cjs/lib/utils/window-open.js +2 -2
- package/dist-cjs/lib/utils/window-open.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 +16 -3
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +11 -11
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +1 -0
- package/dist-esm/lib/license/LicenseManager.mjs.map +2 -2
- package/dist-esm/lib/license/Watermark.mjs +8 -2
- package/dist-esm/lib/license/Watermark.mjs.map +2 -2
- package/dist-esm/lib/utils/runtime.mjs +2 -2
- package/dist-esm/lib/utils/runtime.mjs.map +2 -2
- package/dist-esm/lib/utils/window-open.mjs +2 -2
- package/dist-esm/lib/utils/window-open.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/components/default-components/DefaultCanvas.tsx +9 -9
- package/src/lib/editor/types/emit-types.ts +1 -0
- package/src/lib/license/LicenseManager.ts +1 -0
- package/src/lib/license/Watermark.tsx +8 -2
- package/src/lib/utils/runtime.ts +3 -3
- package/src/lib/utils/window-open.ts +13 -3
- package/src/version.ts +3 -3
|
@@ -172,17 +172,17 @@ export function DefaultCanvas({ className }: TLCanvasComponentProps) {
|
|
|
172
172
|
<LiveCollaborators />
|
|
173
173
|
</div>
|
|
174
174
|
</div>
|
|
175
|
-
<div
|
|
176
|
-
className="tl-canvas__in-front"
|
|
177
|
-
onPointerDown={editor.markEventAsHandled}
|
|
178
|
-
onPointerUp={editor.markEventAsHandled}
|
|
179
|
-
onTouchStart={editor.markEventAsHandled}
|
|
180
|
-
onTouchEnd={editor.markEventAsHandled}
|
|
181
|
-
>
|
|
182
|
-
<InFrontOfTheCanvasWrapper />
|
|
183
|
-
</div>
|
|
184
175
|
<MovingCameraHitTestBlocker />
|
|
185
176
|
</div>
|
|
177
|
+
<div
|
|
178
|
+
className="tl-canvas__in-front"
|
|
179
|
+
onPointerDown={editor.markEventAsHandled}
|
|
180
|
+
onPointerUp={editor.markEventAsHandled}
|
|
181
|
+
onTouchStart={editor.markEventAsHandled}
|
|
182
|
+
onTouchEnd={editor.markEventAsHandled}
|
|
183
|
+
>
|
|
184
|
+
<InFrontOfTheCanvasWrapper />
|
|
185
|
+
</div>
|
|
186
186
|
<MenuClickCapture />
|
|
187
187
|
</>
|
|
188
188
|
)
|
|
@@ -70,7 +70,10 @@ const UnlicensedWatermark = memo(function UnlicensedWatermark({
|
|
|
70
70
|
preventDefault(e)
|
|
71
71
|
}}
|
|
72
72
|
title="The tldraw SDK requires a license key to work in production. You can get a free 100-day trial license at tldraw.dev/pricing."
|
|
73
|
-
onClick={() =>
|
|
73
|
+
onClick={() => {
|
|
74
|
+
editor.emit('click-watermark', { url })
|
|
75
|
+
runtime.openWindow(url, '_blank', true)
|
|
76
|
+
}} // allow referrer
|
|
74
77
|
>
|
|
75
78
|
Get a license for production
|
|
76
79
|
</button>
|
|
@@ -120,7 +123,10 @@ const WatermarkInner = memo(function WatermarkInner({
|
|
|
120
123
|
preventDefault(e)
|
|
121
124
|
}}
|
|
122
125
|
title="Build infinite canvas applications with the tldraw SDK. Learn more at https://tldraw.dev."
|
|
123
|
-
onClick={() =>
|
|
126
|
+
onClick={() => {
|
|
127
|
+
editor.emit('click-watermark', { url })
|
|
128
|
+
runtime.openWindow(url, '_blank')
|
|
129
|
+
}}
|
|
124
130
|
style={{ mask: maskCss, WebkitMask: maskCss }}
|
|
125
131
|
/>
|
|
126
132
|
</div>
|
package/src/lib/utils/runtime.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @public */
|
|
2
2
|
export const runtime: {
|
|
3
|
-
openWindow(url: string, target: string): void
|
|
3
|
+
openWindow(url: string, target: string, allowReferrer?: boolean): void
|
|
4
4
|
refreshPage(): void
|
|
5
5
|
hardReset(): void
|
|
6
6
|
} = {
|
|
7
|
-
openWindow(url, target) {
|
|
8
|
-
window.open(url, target, 'noopener noreferrer')
|
|
7
|
+
openWindow(url, target, allowReferrer = false) {
|
|
8
|
+
return window.open(url, target, allowReferrer ? 'noopener' : 'noopener noreferrer')
|
|
9
9
|
},
|
|
10
10
|
refreshPage() {
|
|
11
11
|
window.location.reload()
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { runtime } from './runtime'
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Open a new window with the given URL and target. Prefer this to the window.open function, as it
|
|
5
|
+
* will work more reliably in embedded scenarios, such as our VS Code extension. See the runtime
|
|
6
|
+
* object in tldraw/editor for more details.
|
|
7
|
+
*
|
|
8
|
+
* @param url - The URL to open.
|
|
9
|
+
* @param target - The target window to open the URL in.
|
|
10
|
+
* @param allowReferrer - Whether to allow the referrer to be sent to the new window.
|
|
11
|
+
* @returns The new window object.
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export function openWindow(url: string, target = '_blank', allowReferrer?: boolean) {
|
|
15
|
+
return runtime.openWindow(url, target, allowReferrer)
|
|
6
16
|
}
|
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 = '4.2.0-canary.
|
|
4
|
+
export const version = '4.2.0-canary.2d743164f8d3'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2025-
|
|
8
|
-
patch: '2025-
|
|
7
|
+
minor: '2025-11-10T17:19:29.058Z',
|
|
8
|
+
patch: '2025-11-10T17:19:29.058Z',
|
|
9
9
|
}
|