@leafer-game/miniapp 2.3.3 → 2.3.4

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.
@@ -1740,6 +1740,7 @@ const Platform = {
1740
1740
  if (fileType === "text") url = "data:text/plain;charset=utf-8," + url; else if (fileType === "svg") url = "data:image/svg+xml," + url;
1741
1741
  return url;
1742
1742
  },
1743
+ origin: {},
1743
1744
  image: {
1744
1745
  hitCanvasSize: 100,
1745
1746
  maxCacheSize: 2560 * 1600,
@@ -7081,7 +7082,7 @@ class LeafLevelList {
7081
7082
  }
7082
7083
  }
7083
7084
 
7084
- const version = "2.3.3";
7085
+ const version = "2.3.4";
7085
7086
 
7086
7087
  if (typeof globalThis !== "undefined") {
7087
7088
  const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
@@ -7199,7 +7200,7 @@ Object.assign(Creator, {
7199
7200
  });
7200
7201
 
7201
7202
  function useCanvas(_canvasType, app) {
7202
- Platform.origin = {
7203
+ Object.assign(Platform.origin, {
7203
7204
  createCanvas: (width, height, _format) => {
7204
7205
  const data = {
7205
7206
  type: "2d",
@@ -7268,7 +7269,7 @@ function useCanvas(_canvasType, app) {
7268
7269
  }));
7269
7270
  },
7270
7271
  noRepeat: "repeat-x"
7271
- };
7272
+ });
7272
7273
  Platform.miniapp = {
7273
7274
  select(name) {
7274
7275
  return app.createSelectorQuery().select(name);
@@ -7409,6 +7410,7 @@ class Watcher {
7409
7410
  this.add(event.target);
7410
7411
  }
7411
7412
  add(leaf) {
7413
+ if (!this.target) return;
7412
7414
  if (this.config.usePartLayout) this.__updatedList.add(leaf);
7413
7415
  this.update();
7414
7416
  }