@widget-js/core 0.9.28 → 0.10.8

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.d.ts CHANGED
@@ -385,6 +385,7 @@ declare class WidgetPackage implements RemotePackageUrlInfo {
385
385
  * @example file://C:/users/neo/desktop/index.html#
386
386
  */
387
387
  getIndexUrl(hash?: boolean): string;
388
+ getUrl(path: string, hash?: boolean): string;
388
389
  }
389
390
  type DevOptions = {
390
391
  folder?: string;
@@ -513,6 +514,7 @@ interface IAppApi {
513
514
  getConfig(key: string, defaultValue: string | number | boolean): Promise<string | number | boolean>;
514
515
  getVersion(): Promise<string>;
515
516
  getPreloadPath(): Promise<string>;
517
+ getAppPath(): Promise<string>;
516
518
  openAddWidgetWindow(): Promise<void>;
517
519
  openSettingWindow(): Promise<void>;
518
520
  getIconFile(): Promise<string>;
@@ -739,7 +741,7 @@ declare class ElectronUtils {
739
741
 
740
742
  declare class WidgetUrlUtils {
741
743
  static getWidgetUrl(widgetUrl: string, widgetPackage: WidgetPackage, widgetParams: WidgetParams): string;
742
- static getWidgetPackageUrl(url: string, entry: string, hash: boolean): string;
744
+ static getWidgetPackageUrl(url: string, entry: string, hash: boolean, path?: string): string;
743
745
  }
744
746
 
745
747
  /**
package/dist/index.js CHANGED
@@ -813,7 +813,7 @@ var WidgetUrlUtils = class {
813
813
  arr.push(widgetParams.toUrlParams().toString());
814
814
  return normalizeUrl(arr.join("")).replaceAll("//", "/");
815
815
  }
816
- static getWidgetPackageUrl(url, entry, hash) {
816
+ static getWidgetPackageUrl(url, entry, hash, path = "") {
817
817
  const arr = [url];
818
818
  if (url.startsWith("http")) {
819
819
  if (hash) {
@@ -822,11 +822,11 @@ var WidgetUrlUtils = class {
822
822
  } else {
823
823
  arr.push(`/${entry}`);
824
824
  if (hash) {
825
- arr.push("#/");
825
+ arr.push("#");
826
826
  }
827
827
  }
828
- return normalizeUrl(arr.join("")).replaceAll("//", "/");
829
- ;
828
+ arr.push(path);
829
+ return arr.join("");
830
830
  }
831
831
  };
832
832
 
@@ -974,6 +974,9 @@ var WidgetPackage = class {
974
974
  getIndexUrl(hash) {
975
975
  return WidgetUrlUtils.getWidgetPackageUrl(this.url, this.entry, hash == null ? this.hash : hash);
976
976
  }
977
+ getUrl(path, hash) {
978
+ return WidgetUrlUtils.getWidgetPackageUrl(this.url, this.entry, hash == null ? this.hash : hash, path);
979
+ }
977
980
  };
978
981
 
979
982
  // src/utils/ElectronUtils.ts
@@ -1807,6 +1810,9 @@ var AppApiConstants = /* @__PURE__ */ ((AppApiConstants2) => {
1807
1810
  return AppApiConstants2;
1808
1811
  })(AppApiConstants || {});
1809
1812
  var AppApiImpl = class extends BaseApi {
1813
+ getAppPath() {
1814
+ return this.invokeMethod("getAppPath");
1815
+ }
1810
1816
  async getIconFile() {
1811
1817
  return this.invokeMethod("getIconFile");
1812
1818
  }