@triptease/tt-navbar 0.0.36 → 0.0.38

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.
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.36
2
+ * @triptease/tt-navbar v0.0.38
3
3
  */
4
4
  //# sourceMappingURL=global.d.js.map
package/dist/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.36
2
+ * @triptease/tt-navbar v0.0.38
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -865,7 +865,7 @@ var i6 = e7(class extends i5 {
865
865
  }
866
866
  });
867
867
 
868
- // node_modules/@triptease/tt-combobox/node_modules/@triptease/icons/dist/src/icons/chevron-down.js
868
+ // ../../node_modules/@triptease/icons/dist/src/icons/chevron-down.js
869
869
  var chevronDown2 = `
870
870
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-chevron-down chevron-down"
871
871
  viewBox="0 0 16 16" role="presentation">
@@ -874,12 +874,12 @@ var chevronDown2 = `
874
874
  stroke="currentColor"/>
875
875
  </svg>`;
876
876
 
877
- // node_modules/@triptease/tt-combobox/node_modules/@triptease/icons/dist/src/icons/alert.js
877
+ // ../../node_modules/@triptease/icons/dist/src/icons/alert.js
878
878
  var alert2 = `<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
879
879
  <path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47715 15.5228 0 10 0C4.47715 0 0 4.47715 0 10C0 15.5228 4.47715 20 10 20ZM9.25 5.75C9.25 5.33579 9.58579 5 10 5C10.4142 5 10.75 5.33579 10.75 5.75V11.25C10.75 11.6642 10.4142 12 10 12C9.58579 12 9.25 11.6642 9.25 11.25V5.75ZM10.75 13.75C10.75 14.1642 10.4142 14.5 10 14.5C9.58579 14.5 9.25 14.1642 9.25 13.75C9.25 13.3358 9.58579 13 10 13C10.4142 13 10.75 13.3358 10.75 13.75Z" fill="#3B353B"/>
880
880
  </svg>`;
881
881
 
882
- // node_modules/@triptease/tt-combobox/dist/src/styles.js
882
+ // ../../node_modules/@triptease/tt-combobox/dist/src/styles.js
883
883
  var styles = i`
884
884
  :host {
885
885
  display: flex;
@@ -1161,7 +1161,7 @@ var styles = i`
1161
1161
  }
1162
1162
  `;
1163
1163
 
1164
- // node_modules/@triptease/tt-combobox/dist/src/TtCombobox.js
1164
+ // ../../node_modules/@triptease/tt-combobox/dist/src/TtCombobox.js
1165
1165
  var TtCombobox = class extends i4 {
1166
1166
  get form() {
1167
1167
  return this.internals.form;
@@ -1604,7 +1604,7 @@ __decorate([
1604
1604
  n4({ type: Array, attribute: "value" })
1605
1605
  ], TtCombobox.prototype, "value", void 0);
1606
1606
 
1607
- // node_modules/@triptease/tt-combobox/dist/src/tt-combobox.js
1607
+ // ../../node_modules/@triptease/tt-combobox/dist/src/tt-combobox.js
1608
1608
  if (typeof window !== "undefined") {
1609
1609
  if (!window.customElements.get("tt-combobox")) {
1610
1610
  window.customElements.define("tt-combobox", TtCombobox);
@@ -2010,7 +2010,12 @@ var urlMappings = {
2010
2010
  "/messages/$CLIENT_KEY/messages": "/channels",
2011
2011
  "/$CLIENT_KEY/email": "/channels",
2012
2012
  "/pricematch/$CLIENT_KEY/performance": "/channels",
2013
- "/chat/insights/$CLIENT_KEY": "/channels"
2013
+ "/chat/insights/$CLIENT_KEY": "/channels",
2014
+ "/settings/$CLIENT_KEY/branding": "/settings/$CLIENT_KEY/guides",
2015
+ "/settings/$CLIENT_KEY/price-check": "/settings/$CLIENT_KEY/guides",
2016
+ "/settings/$CLIENT_KEY/price-config": "/settings/$CLIENT_KEY/guides",
2017
+ "/settings/$CLIENT_KEY/hotel-details-finder": "/settings/$CLIENT_KEY/guides",
2018
+ "/settings/$CLIENT_KEY/deactivation-center": "/settings/$CLIENT_KEY/guides"
2014
2019
  };
2015
2020
 
2016
2021
  // src/Routes.ts
@@ -2041,7 +2046,16 @@ var NavbarController = class {
2041
2046
  this._isOpen = newState;
2042
2047
  if (window.Clerk) {
2043
2048
  await window.Clerk.user?.update({
2044
- unsafeMetadata: { preferences: { ui: { navigationOpen: newState } } }
2049
+ unsafeMetadata: {
2050
+ ...window.Clerk.user?.unsafeMetadata,
2051
+ preferences: {
2052
+ ...window.Clerk.user?.unsafeMetadata?.preferences,
2053
+ ui: {
2054
+ ...window.Clerk.user?.unsafeMetadata?.preferences?.ui,
2055
+ navigationOpen: newState
2056
+ }
2057
+ }
2058
+ }
2045
2059
  });
2046
2060
  }
2047
2061
  this.host.requestUpdate();
@@ -2096,8 +2110,9 @@ var TtNavbar = class extends i4 {
2096
2110
  const parsedPath = currentPath.replace(this.clientKey, "$CLIENT_KEY");
2097
2111
  const mappedUrl = urlMappings[parsedPath];
2098
2112
  if (mappedUrl) {
2113
+ const clientSpecificUrl = mappedUrl.includes("$CLIENT_KEY") ? mappedUrl.replace("$CLIENT_KEY", this.clientKey) : mappedUrl;
2099
2114
  const links = Object.values(this.allNavLinks);
2100
- bestMatch = links.find((link) => link.href.includes(mappedUrl));
2115
+ bestMatch = links.find((link) => link.href.includes(clientSpecificUrl));
2101
2116
  }
2102
2117
  }
2103
2118
  if (!bestMatch) {
@@ -2346,24 +2361,24 @@ var TtNavbar = class extends i4 {
2346
2361
  <div class='nav-items'>
2347
2362
  <div id="client-selector">
2348
2363
  ${this.clients.length > 1 ? x`
2349
- <tt-combobox
2350
- .openUpward=${true}
2351
- .value=${this.clientKey ? [this.clientKey] : []}
2352
- @change=${this.handleClientChange}
2353
- >
2354
- ${this.clients.map(
2364
+ <tt-combobox
2365
+ .openUpward=${true}
2366
+ .value=${this.clientKey ? [this.clientKey] : []}
2367
+ @change=${this.handleClientChange}
2368
+ >
2369
+ ${this.clients.map(
2355
2370
  (client) => x`
2356
- <option slot="option" value=${client.clientKey}>
2357
- ${client.displayName}
2358
- </option>
2359
- `
2371
+ <option slot="option" value=${client.clientKey}>
2372
+ ${client.displayName}
2373
+ </option>
2374
+ `
2360
2375
  )}
2361
- </tt-combobox>
2362
- ` : x`
2363
- <div class="single-client-name">
2364
- ${this.clients.find((m3) => m3.clientKey === this.clientKey)?.displayName}
2365
- </div>
2366
- `}
2376
+ </tt-combobox>
2377
+ ` : x`
2378
+ <div class="single-client-name">
2379
+ ${this.clients.find((m3) => m3.clientKey === this.clientKey)?.displayName}
2380
+ </div>
2381
+ `}
2367
2382
  </div>
2368
2383
  <a
2369
2384
  id="logout-link"