@triptease/tt-navbar 0.0.20 → 0.0.21

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/web/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @triptease/tt-navbar v0.0.20
2
+ * @triptease/tt-navbar v0.0.21
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1070,6 +1070,11 @@ var urlMappings = {
1070
1070
  "/chat/insights/$CLIENT_KEY": "/channels"
1071
1071
  };
1072
1072
 
1073
+ // src/Routes.ts
1074
+ var Routes = {
1075
+ CampaignManager: "CampaignManager"
1076
+ };
1077
+
1073
1078
  // src/TtNavbar.ts
1074
1079
  var TtNavbar = class extends i4 {
1075
1080
  constructor() {
@@ -1100,11 +1105,9 @@ var TtNavbar = class extends i4 {
1100
1105
  const currentPath = window.location.pathname;
1101
1106
  let bestMatch;
1102
1107
  let bestMatchLength = 0;
1103
- if (this.campaignManagerUrl.includes(window.location.host)) {
1108
+ if (this.activeRoute === Routes.CampaignManager) {
1104
1109
  const links = Object.values(this.allNavLinks);
1105
- bestMatch = links.find(
1106
- (link) => link.href.includes(this.campaignManagerUrl)
1107
- );
1110
+ bestMatch = links.find((link) => link.id === Routes.CampaignManager);
1108
1111
  }
1109
1112
  if (!bestMatch && this.clientKey) {
1110
1113
  const parsedPath = currentPath.replace(this.clientKey, "$CLIENT_KEY");
@@ -1198,7 +1201,7 @@ var TtNavbar = class extends i4 {
1198
1201
  @click=${this.onAnchorClick}
1199
1202
  >${o7(home)}<span>Dashboard</span></a
1200
1203
  >
1201
- <a class="nav-item" href=${this.campaignManagerUrl}
1204
+ <a id="${Routes.CampaignManager}" class="nav-item" href=${this.campaignManagerUrl}
1202
1205
  >${o7(campaigns)}<span>Campaigns</span></a
1203
1206
  >
1204
1207
  <a
@@ -1363,6 +1366,9 @@ __decorateClass([
1363
1366
  __decorateClass([
1364
1367
  n4({ type: String, attribute: "client-key" })
1365
1368
  ], TtNavbar.prototype, "clientKey", 2);
1369
+ __decorateClass([
1370
+ n4({ type: String, attribute: "active-route" })
1371
+ ], TtNavbar.prototype, "activeRoute", 2);
1366
1372
  __decorateClass([
1367
1373
  r6("details")
1368
1374
  ], TtNavbar.prototype, "allDetailsElements", 2);
@@ -1373,6 +1379,7 @@ __decorateClass([
1373
1379
  r5()
1374
1380
  ], TtNavbar.prototype, "sidebarOpen", 2);
1375
1381
  export {
1382
+ Routes,
1376
1383
  TtNavbar
1377
1384
  };
1378
1385
  /*! Bundled license information: