@widget-js/core 24.1.1-beta.2 → 24.1.1-beta.3

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/index.cjs CHANGED
@@ -1394,7 +1394,7 @@ var WidgetPackage = class {
1394
1394
  this.remoteEntry = options.remoteEntry;
1395
1395
  this.requiredAppVersion = options.requiredAppVersion;
1396
1396
  this.remotePackage = options.remotePackage;
1397
- this.hash = options.hash;
1397
+ this.hash = options.hash ?? false;
1398
1398
  this.url = "";
1399
1399
  this.icon = options.icon;
1400
1400
  this.devOptions = options.devOptions;
@@ -2069,8 +2069,8 @@ var WidgetDataApiImpl = class {
2069
2069
  let data;
2070
2070
  if (args.length === 2) {
2071
2071
  name = args[0];
2072
- const type = args[1];
2073
- data = new type(name);
2072
+ const Type = args[1];
2073
+ data = new Type(name);
2074
2074
  } else {
2075
2075
  data = args[0];
2076
2076
  name = data.name;
@@ -2083,11 +2083,11 @@ var WidgetDataApiImpl = class {
2083
2083
  }
2084
2084
  return void 0;
2085
2085
  }
2086
- async find(name, id, type) {
2086
+ async find(name, id, Type) {
2087
2087
  const store = this.getStore(name);
2088
2088
  const result = await store.getItem(this.getKey(name, id));
2089
2089
  if (result) {
2090
- const widgetData = new type(name, id);
2090
+ const widgetData = new Type(name, id);
2091
2091
  widgetData.parseJSON(JSON.parse(result));
2092
2092
  return widgetData;
2093
2093
  }
@@ -2393,8 +2393,8 @@ var DeployedWidgetApiImpl = class extends BaseApi {
2393
2393
  async removeDeployedWidget(id) {
2394
2394
  return this.invokeMethod("removeDeployedWidget", id);
2395
2395
  }
2396
- addWidget(widgetName, hostMode) {
2397
- return this.invokeMethod("addWidget", widgetName, hostMode);
2396
+ addWidget(options) {
2397
+ return this.invokeMethod("addWidget", options);
2398
2398
  }
2399
2399
  /**
2400
2400
  * 通过组件名移除已添加的组件