@tldraw/editor 3.16.0-canary.887377ec7acc → 3.16.0-canary.89a61e4ca1a4
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 +8 -2
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +6 -2
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/license/LicenseManager.js +21 -4
- 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 +8 -2
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +6 -2
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/license/LicenseManager.mjs +21 -4
- 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/package.json +7 -7
- package/src/lib/editor/Editor.test.ts +90 -0
- package/src/lib/editor/Editor.ts +12 -2
- package/src/lib/license/LicenseManager.test.ts +78 -2
- package/src/lib/license/LicenseManager.ts +28 -5
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -3557,14 +3557,20 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3557
3557
|
* Handle external content, such as files, urls, embeds, or plain text which has been put into the app, for example by pasting external text or dropping external images onto canvas.
|
|
3558
3558
|
*
|
|
3559
3559
|
* @param info - Info about the external content.
|
|
3560
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3560
3561
|
*/
|
|
3561
|
-
putExternalContent<E>(info: TLExternalContent<E
|
|
3562
|
+
putExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3563
|
+
force?: boolean;
|
|
3564
|
+
}): Promise<void>;
|
|
3562
3565
|
/**
|
|
3563
3566
|
* Handle replacing external content.
|
|
3564
3567
|
*
|
|
3565
3568
|
* @param info - Info about the external content.
|
|
3569
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
3566
3570
|
*/
|
|
3567
|
-
replaceExternalContent<E>(info: TLExternalContent<E
|
|
3571
|
+
replaceExternalContent<E>(info: TLExternalContent<E>, opts?: {
|
|
3572
|
+
force?: boolean;
|
|
3573
|
+
}): Promise<void>;
|
|
3568
3574
|
/**
|
|
3569
3575
|
* Get content that can be exported for the given shape ids.
|
|
3570
3576
|
*
|
package/dist-cjs/index.js
CHANGED
|
@@ -369,7 +369,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
369
369
|
var import_window_open = require("./lib/utils/window-open");
|
|
370
370
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
371
371
|
"@tldraw/editor",
|
|
372
|
-
"3.16.0-canary.
|
|
372
|
+
"3.16.0-canary.89a61e4ca1a4",
|
|
373
373
|
"cjs"
|
|
374
374
|
);
|
|
375
375
|
//# sourceMappingURL=index.js.map
|
|
@@ -6438,16 +6438,20 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
6438
6438
|
* Handle external content, such as files, urls, embeds, or plain text which has been put into the app, for example by pasting external text or dropping external images onto canvas.
|
|
6439
6439
|
*
|
|
6440
6440
|
* @param info - Info about the external content.
|
|
6441
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
6441
6442
|
*/
|
|
6442
|
-
async putExternalContent(info) {
|
|
6443
|
+
async putExternalContent(info, opts = {}) {
|
|
6444
|
+
if (!opts.force && this.getIsReadonly()) return;
|
|
6443
6445
|
return this.externalContentHandlers[info.type]?.(info);
|
|
6444
6446
|
}
|
|
6445
6447
|
/**
|
|
6446
6448
|
* Handle replacing external content.
|
|
6447
6449
|
*
|
|
6448
6450
|
* @param info - Info about the external content.
|
|
6451
|
+
* @param opts - Options for handling external content, including force flag to bypass readonly checks.
|
|
6449
6452
|
*/
|
|
6450
|
-
async replaceExternalContent(info) {
|
|
6453
|
+
async replaceExternalContent(info, opts = {}) {
|
|
6454
|
+
if (!opts.force && this.getIsReadonly()) return;
|
|
6451
6455
|
return this.externalContentHandlers[info.type]?.(info);
|
|
6452
6456
|
}
|
|
6453
6457
|
/**
|