@tldraw/editor 4.2.0-internal.d43dfb4f2e76 → 4.2.0-next.2d6bd31c2305
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 +13 -3
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +29 -27
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- 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 +1 -1
- 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 +13 -3
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +29 -27
- 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 +1 -1
- 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 +43 -43
- package/src/lib/license/LicenseManager.ts +1 -0
- package/src/lib/license/Watermark.tsx +1 -1
- package/src/lib/utils/runtime.ts +3 -3
- package/src/lib/utils/window-open.ts +13 -3
- package/src/version.ts +3 -3
|
@@ -130,60 +130,60 @@ export function DefaultCanvas({ className }: TLCanvasComponentProps) {
|
|
|
130
130
|
return (
|
|
131
131
|
<>
|
|
132
132
|
<div
|
|
133
|
+
ref={rCanvas}
|
|
133
134
|
draggable={false}
|
|
134
135
|
data-iseditinganything={isEditingAnything}
|
|
135
136
|
data-isselectinganything={isSelectingAnything}
|
|
136
137
|
className={classNames('tl-canvas', className)}
|
|
137
138
|
data-testid="canvas"
|
|
139
|
+
{...events}
|
|
138
140
|
>
|
|
139
|
-
<
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<
|
|
150
|
-
<Background />
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
<GridWrapper />
|
|
154
|
-
<div ref={rHtmlLayer} className="tl-html-layer tl-shapes" draggable={false}>
|
|
155
|
-
<OnTheCanvasWrapper />
|
|
156
|
-
{SelectionBackground && <SelectionBackgroundWrapper />}
|
|
157
|
-
{hideShapes ? null : debugSvg ? <ShapesWithSVGs /> : <ShapesToDisplay />}
|
|
141
|
+
<svg className="tl-svg-context" aria-hidden="true">
|
|
142
|
+
<defs>
|
|
143
|
+
{shapeSvgDefs}
|
|
144
|
+
<CursorDef />
|
|
145
|
+
<CollaboratorHintDef />
|
|
146
|
+
{SvgDefs && <SvgDefs />}
|
|
147
|
+
</defs>
|
|
148
|
+
</svg>
|
|
149
|
+
{Background && (
|
|
150
|
+
<div className="tl-background__wrapper">
|
|
151
|
+
<Background />
|
|
158
152
|
</div>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
onTouchEnd={editor.markEventAsHandled}
|
|
180
|
-
>
|
|
181
|
-
<InFrontOfTheCanvasWrapper />
|
|
153
|
+
)}
|
|
154
|
+
<GridWrapper />
|
|
155
|
+
<div ref={rHtmlLayer} className="tl-html-layer tl-shapes" draggable={false}>
|
|
156
|
+
<OnTheCanvasWrapper />
|
|
157
|
+
{SelectionBackground && <SelectionBackgroundWrapper />}
|
|
158
|
+
{hideShapes ? null : debugSvg ? <ShapesWithSVGs /> : <ShapesToDisplay />}
|
|
159
|
+
</div>
|
|
160
|
+
<div className="tl-overlays">
|
|
161
|
+
<div ref={rHtmlLayer2} className="tl-html-layer">
|
|
162
|
+
{debugGeometry ? <GeometryDebuggingView /> : null}
|
|
163
|
+
<BrushWrapper />
|
|
164
|
+
<ScribbleWrapper />
|
|
165
|
+
<ZoomBrushWrapper />
|
|
166
|
+
{ShapeIndicators && <ShapeIndicators />}
|
|
167
|
+
<HintedShapeIndicator />
|
|
168
|
+
<SnapIndicatorWrapper />
|
|
169
|
+
<SelectionForegroundWrapper />
|
|
170
|
+
<HandlesWrapper />
|
|
171
|
+
<OverlaysWrapper />
|
|
172
|
+
<LiveCollaborators />
|
|
182
173
|
</div>
|
|
183
174
|
</div>
|
|
184
175
|
<MovingCameraHitTestBlocker />
|
|
185
|
-
<MenuClickCapture />
|
|
186
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
|
+
<MenuClickCapture />
|
|
187
187
|
</>
|
|
188
188
|
)
|
|
189
189
|
}
|
|
@@ -70,7 +70,7 @@ 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={() => runtime.openWindow(url, '_blank')}
|
|
73
|
+
onClick={() => runtime.openWindow(url, '_blank', true)} // allow referrer
|
|
74
74
|
>
|
|
75
75
|
Get a license for production
|
|
76
76
|
</button>
|
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-
|
|
4
|
+
export const version = '4.2.0-next.2d6bd31c2305'
|
|
5
5
|
export const publishDates = {
|
|
6
6
|
major: '2025-09-18T14:39:22.803Z',
|
|
7
|
-
minor: '2025-
|
|
8
|
-
patch: '2025-
|
|
7
|
+
minor: '2025-11-07T12:07:15.921Z',
|
|
8
|
+
patch: '2025-11-07T12:07:15.921Z',
|
|
9
9
|
}
|