@tldraw/editor 5.5.0-canary.ede4a53bffb0 → 5.5.0-canary.efd2cd7e73e0
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.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +15 -25
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +15 -25
- package/dist-esm/lib/editor/Editor.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.ts +15 -31
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
392
392
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
393
393
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
394
394
|
"@tldraw/editor",
|
|
395
|
-
"5.5.0-canary.
|
|
395
|
+
"5.5.0-canary.efd2cd7e73e0",
|
|
396
396
|
"cjs"
|
|
397
397
|
);
|
|
398
398
|
//# sourceMappingURL=index.js.map
|
|
@@ -3755,9 +3755,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
3755
3755
|
if (ids.length <= 0) return this;
|
|
3756
3756
|
this.run(
|
|
3757
3757
|
() => {
|
|
3758
|
-
|
|
3759
|
-
(err) => console.error("Error while removing assets from the asset store:", err)
|
|
3760
|
-
);
|
|
3758
|
+
this.store.props.assets.remove?.(ids);
|
|
3761
3759
|
this.store.remove(ids);
|
|
3762
3760
|
},
|
|
3763
3761
|
{ history: "ignore" }
|
|
@@ -6941,29 +6939,21 @@ class Editor extends import_eventemitter3.default {
|
|
|
6941
6939
|
await Promise.allSettled(
|
|
6942
6940
|
content.assets.map(async (asset) => {
|
|
6943
6941
|
if ((asset.type === "image" || asset.type === "video") && !asset.props.src?.startsWith("data:image") && !asset.props.src?.startsWith("data:video") && !asset.props.src?.startsWith("http")) {
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
return;
|
|
6959
|
-
}
|
|
6960
|
-
console.warn(`Could not inline asset ${asset.id}: fetch returned ${response.status}`);
|
|
6961
|
-
}
|
|
6962
|
-
} catch (err) {
|
|
6963
|
-
console.warn(`Could not inline asset ${asset.id}`, err);
|
|
6964
|
-
}
|
|
6942
|
+
const assetWithDataUrl = (0, import_utils.structuredClone)(asset);
|
|
6943
|
+
const objectUrl = await this.store.props.assets.resolve(asset, {
|
|
6944
|
+
screenScale: 1,
|
|
6945
|
+
steppedScreenScale: 1,
|
|
6946
|
+
dpr: 1,
|
|
6947
|
+
networkEffectiveType: null,
|
|
6948
|
+
shouldResolveToOriginal: true
|
|
6949
|
+
});
|
|
6950
|
+
assetWithDataUrl.props.src = await import_utils.FileHelpers.blobToDataUrl(
|
|
6951
|
+
await (0, import_utils.fetch)(objectUrl).then((r) => r.blob())
|
|
6952
|
+
);
|
|
6953
|
+
assets.push(assetWithDataUrl);
|
|
6954
|
+
} else {
|
|
6955
|
+
assets.push(asset);
|
|
6965
6956
|
}
|
|
6966
|
-
assets.push(asset);
|
|
6967
6957
|
})
|
|
6968
6958
|
);
|
|
6969
6959
|
content.assets = assets;
|