@salesforcedevs/dx-components 0.59.0 → 0.59.1-flex-ref1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.59.0",
3
+ "version": "0.59.1-flex-ref1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -24,6 +24,5 @@
24
24
  "@types/debounce": "^1.2.0",
25
25
  "@types/lodash.get": "^4.4.6",
26
26
  "@types/vimeo__player": "^2.16.2"
27
- },
28
- "gitHead": "a3674ea38091ac2c72808281b5ff09ebab643645"
27
+ }
29
28
  }
@@ -307,10 +307,26 @@ export default class SidebarSearch extends LightningElement {
307
307
  }
308
308
 
309
309
  let href;
310
- if (queryParam) {
310
+ let isSelected = false;
311
+ const isReferenceUrl = clickUri.includes("/references/");
312
+ if (isReferenceUrl) {
311
313
  href = `${pathname}${queryParam}&q=${this.value}`;
314
+
315
+ //NOTE: This is specific to references related comparison
316
+ const resultHrefWithMetaQuery = `${pathname}${queryParam}`;
317
+
318
+ const urlParams = new URLSearchParams(window.location.search);
319
+ const metaQueryParam = urlParams.get("meta");
320
+
321
+ let currentUrlPathWithQuery = window.location.pathname;
322
+ if (metaQueryParam) {
323
+ currentUrlPathWithQuery = `${currentUrlPathWithQuery}?meta=${metaQueryParam}`;
324
+ }
325
+
326
+ isSelected = resultHrefWithMetaQuery === currentUrlPathWithQuery;
312
327
  } else {
313
328
  href = `${pathname}?q=${this.value}`;
329
+ isSelected = pathname === window.location.pathname;
314
330
  }
315
331
 
316
332
  return {
@@ -320,7 +336,7 @@ export default class SidebarSearch extends LightningElement {
320
336
  excerptHighlights,
321
337
  uniqueId,
322
338
  href,
323
- selected: pathname === window.location.pathname
339
+ selected: isSelected
324
340
  };
325
341
  };
326
342
 
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.