@widget-js/core 0.9.28 → 0.10.6

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;
@@ -739,7 +740,7 @@ declare class ElectronUtils {
739
740
 
740
741
  declare class WidgetUrlUtils {
741
742
  static getWidgetUrl(widgetUrl: string, widgetPackage: WidgetPackage, widgetParams: WidgetParams): string;
742
- static getWidgetPackageUrl(url: string, entry: string, hash: boolean): string;
743
+ static getWidgetPackageUrl(url: string, entry: string, hash: boolean, path?: string): string;
743
744
  }
744
745
 
745
746
  /**
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