smoothly 1.114.0 → 1.115.0

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.
@@ -77,7 +77,7 @@ const SmoothlyApp = class {
77
77
  this.menuOpen = false;
78
78
  }
79
79
  if (!event.detail.history) {
80
- const path = this.selected.element.path.toString();
80
+ const path = event.detail.path;
81
81
  const location = new URL(window.location.pathname == path ? window.location.href : window.location.origin);
82
82
  location.pathname = path;
83
83
  location.search = event.detail.query ? `?${event.detail.query}` : "";
@@ -96,7 +96,7 @@ const SmoothlyApp = class {
96
96
  }
97
97
  }
98
98
  render() {
99
- return (h(Host, { key: 'c0204db44c75c6235d5eb2adc776112372989a13', class: { "smoothly-mobile-mode": this.mobileMode } }, h("smoothly-notifier", { key: '2c9ff0711219189499cbe1cb6f37e41715f4234a' }, h("header", { key: '25b6ac0023b7ff634d315627297f1968fe78d199', color: this.color }, h("h1", { key: 'cb52ccc4d73bee709c95597b08c7260c28c116c0' }, h("a", { key: '9db53cc3d88d3bb2c557dddc306adda2b9c1bb57', href: "" }, this.label)), h("slot", { key: 'd8f71e17edf3b65d4579386004666b4b7d8655f7', name: "header" }), h("nav", { key: '71416658d3fd7578d1e9911355efe8250b7f1b73', ref: e => (this.navElement = e) }, h("ul", { key: '79dae2e8b641e4d4fcb13245fa647d3b4fcbdea7' }, h("div", { key: '4f85e34495814cf144eb1b39b4b0f5a07807ee51', class: "nav-start-container" }, h("slot", { key: '06f4ce02a90619d13ea21d6564f5434233346c06', name: "nav-start" })), h("slot", { key: 'f261dcbcd2781b0c6d6f499bd559763bc7172742' }), h("div", { key: 'ed668608a800ef08363b9ae239a392dfd515f49a', class: "nav-end-container" }, h("slot", { key: 'c5d11b8ac9b158ca030df27ff345c82979cb6ae5', name: "nav-end" })))), h("smoothly-burger", { key: 'ce9f13229cc55cc95e5bc9bacc4c692febd15ec4', ref: e => (this.burgerElement = e), open: this.menuOpen, onSmoothlyNavStatus: e => (e.stopPropagation(), (this.menuOpen = e.detail)) })), h("main", { key: '62e5ea6a00dbbc910f8c2682b55727487202b248', ref: e => (this.mainElement = e) }))));
99
+ return (h(Host, { key: '746fa3adf359072b95f0b00ecea914189bdfead2', class: { "smoothly-mobile-mode": this.mobileMode } }, h("smoothly-notifier", { key: 'ddf542afef536ab6141394b658e82686bd414e69' }, h("header", { key: '511a856fb813b5476a705c993734380ad94194cf', color: this.color }, h("h1", { key: '9c3e79f9fcd3ef587183e3b83d646753a0f8dd7c' }, h("a", { key: '9be4ba4d2ffaeaca1cb00752b5fcba0b1b64c261', href: "" }, this.label)), h("slot", { key: '92573b6cffad97e2afbfb6b6a7d5d1fb8f0ec59e', name: "header" }), h("nav", { key: '4a7c5cbbb39a82b845775d6dd0015a47ab72757d', ref: e => (this.navElement = e) }, h("ul", { key: 'a8035a4e9143d4cd49ac4edfbb837785a8a58cd8' }, h("div", { key: '2c4de281ad7f522c2c09acfcad890eadabc30c40', class: "nav-start-container" }, h("slot", { key: '05e3f3a40f45d9505a463a29c90bbfcc2a3ff330', name: "nav-start" })), h("slot", { key: '695fd5bef476d1c00e5654803c03e94c8218943a' }), h("div", { key: '382c0271207f040374c3f69aa2946d0938bbb1c1', class: "nav-end-container" }, h("slot", { key: '02fe44b3c557b7a930f24fdc465d8824eccbbbef', name: "nav-end" })))), h("smoothly-burger", { key: 'fad0b5d8e2841ed284af04d9b0554e91ddf98575', ref: e => (this.burgerElement = e), open: this.menuOpen, onSmoothlyNavStatus: e => (e.stopPropagation(), (this.menuOpen = e.detail)) })), h("main", { key: '5c6464b6db6e0eba2acbaf5efd549cebe08c1a95', ref: e => (this.mainElement = e) }))));
100
100
  }
101
101
  static get watchers() { return {
102
102
  "selected": [{
@@ -1550,9 +1550,11 @@ const SmoothlyAppRoom = class {
1550
1550
  this.selected && this.smoothlyUrlChange.emit(window.location.href);
1551
1551
  }
1552
1552
  componentWillLoad() {
1553
- this.selected = (typeof this.path == "string" ? new URLPattern({ pathname: this.path }) : this.path).test(window.location);
1553
+ const stringOrPatternPaths = Array.isArray(this.path) ? this.path : [this.path];
1554
+ this.paths = stringOrPatternPaths.map(path => (typeof path == "string" ? new URLPattern({ pathname: path }) : path));
1555
+ this.selected = this.paths.some(pattern => pattern.test(window.location.href));
1554
1556
  this.smoothlyRoomLoad.emit({ selected: this.selected });
1555
- this.selected && window.history.replaceState({ smoothlyPath: this.path }, "", window.location.href);
1557
+ this.selected && window.history.replaceState({ smoothlyPath: this.paths[0].pathname }, "", window.location.href);
1556
1558
  }
1557
1559
  async setMobileMode(mobile) {
1558
1560
  this.mobileMode = mobile;
@@ -1563,7 +1565,7 @@ const SmoothlyAppRoom = class {
1563
1565
  async setSelected(selected, options) {
1564
1566
  this.selected = selected;
1565
1567
  if (selected) {
1566
- this.smoothlyRoomSelect.emit({ history: !!(options === null || options === void 0 ? void 0 : options.history), query: this.query });
1568
+ this.smoothlyRoomSelect.emit({ history: !!(options === null || options === void 0 ? void 0 : options.history), path: this.paths[0].pathname, query: this.query });
1567
1569
  }
1568
1570
  }
1569
1571
  async setQuery(event) {
@@ -1580,7 +1582,8 @@ const SmoothlyAppRoom = class {
1580
1582
  }
1581
1583
  }
1582
1584
  render() {
1583
- return (h(Host, { key: 'e06ad4adb4d72a03e6b33e6a2d11698f3cdc450e', class: { "smoothly-mobile-mode": this.mobileMode } }, h("li", { key: 'f236706b03f0cd505b1081f0998ed1dd0b721766' }, h("a", { key: '2147ccb7a8296d1de4cdaa0bf968955c14711e7b', href: typeof this.path == "string" ? this.path : this.path.pathname, onClick: e => this.clickHandler(e) }, this.icon && h("smoothly-icon", { key: '4d1530eb064e95429de842958f1d07e4946dcf15', name: this.icon }), this.label && h("span", { key: 'e5badd955a4fd1b5d12e37fa8dea3bc88eed3841', class: "label" }, this.label))), h("div", { key: 'cf23be6250b7c42f814b74637f4ed6b6510a216f', ref: e => (this.contentElement = e) }, this.content && h("smoothly-lazy", { key: '3a6825efc72c8490827df6e6154b0fbfe3a15d72', content: this.content }), h("slot", { key: 'a786686ce15650ef54ef56fd1778f9b8e28c339e' }))));
1585
+ var _a;
1586
+ return (h(Host, { key: '416a7250b9c2f2a42060522a0c305d3e10c530e2', class: { "smoothly-mobile-mode": this.mobileMode } }, h("li", { key: '13946e4e07e65dd755e6752c7c24b0e9f70a6519' }, h("a", { key: 'be5cc463ec7a2adeb513da59cb925de5f470242f', href: (_a = this.paths[0]) === null || _a === void 0 ? void 0 : _a.pathname, onClick: e => this.clickHandler(e) }, this.icon && h("smoothly-icon", { key: '9b76338e6f64f0331f00d85cbc164da9951051e6', name: this.icon }), this.label && h("span", { key: '1e12b7e8e3b35920f3f5c162e41208e4a87a5033', class: "label" }, this.label))), h("div", { key: '1e3e09244c7e623768dfee215c9a63a801fdf663', ref: e => (this.contentElement = e) }, this.content && h("smoothly-lazy", { key: '1f5938ff9fd197cf96761e5ee6868b45213c18a7', content: this.content }), h("slot", { key: 'f68188a185d5b6792b6dd7b3c971e69145fcb554' }))));
1584
1587
  }
1585
1588
  };
1586
1589
  SmoothlyAppRoom.style = styleCss$1j();