@salesforcedevs/dx-components 1.17.6 → 1.17.8-search-alpha

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/lwc.config.json CHANGED
@@ -136,6 +136,7 @@
136
136
  "dxUtils/normalizers",
137
137
  "dxUtils/queryCoordinator",
138
138
  "dxUtils/recentSearches",
139
+ "dxUtils/regexps",
139
140
  "dxUtils/withTypedRefs",
140
141
  "dxUtils/wordpress"
141
142
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "1.17.6",
3
+ "version": "1.17.8-search-alpha",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,6 +44,5 @@
44
44
  },
45
45
  "volta": {
46
46
  "node": "20.19.0"
47
- },
48
- "gitHead": "a3108bb2342f34377f5ec64b2bd0cb0c67c2c506"
47
+ }
49
48
  }
@@ -58,6 +58,7 @@
58
58
  value={searchText}
59
59
  onchange={onSearchChange}
60
60
  shortcut-key="j"
61
+ clearable
61
62
  ></dx-input>
62
63
  </div>
63
64
  <slot name="version-picker"></slot>
@@ -4,6 +4,7 @@ import { api } from "lwc";
4
4
  import { TreeNode } from "typings/custom";
5
5
  import { toJson } from "dxUtils/normalizers";
6
6
  import { SidebarBase } from "dxBaseElements/sidebarBase";
7
+ import { escapeRegExp } from "dxUtils/regexps";
7
8
 
8
9
  const WAIT_TIME = 500;
9
10
  const MOBILE_SIZE_MATCH = "768px";
@@ -119,7 +120,11 @@ export default class Sidebar extends SidebarBase {
119
120
  key: this.makeKey(),
120
121
  tree: this.searchText
121
122
  ? this.findMatch(
122
- new RegExp(this.searchText.toLowerCase().trim()),
123
+ new RegExp(
124
+ escapeRegExp(
125
+ this.searchText.toLowerCase().trim()
126
+ )
127
+ ),
123
128
  singleTree
124
129
  )!
125
130
  : singleTree
@@ -1,5 +1,6 @@
1
1
  import { logCoveoPageView } from "docUtils/utils";
2
2
  import { LightningElement, api } from "lwc";
3
+ import { escapeRegExp } from "dxUtils/regexps";
3
4
 
4
5
  const REDUNDANT_INSTANCE_ERROR_MESSAGE =
5
6
  "Multiple <dx-traffic-labeler>s detected, this should never be the case.";
@@ -36,7 +37,7 @@ export default class TrafficLabeler extends LightningElement {
36
37
  const internalIps = this.internalIps?.split(",");
37
38
 
38
39
  const isInternal = internalIps?.some((value) => {
39
- const regex = new RegExp(value);
40
+ const regex = new RegExp(escapeRegExp(value));
40
41
  return regex.test(result.ip);
41
42
  });
42
43
 
@@ -1,4 +1,4 @@
1
- const escapeRegExp = (text: string) =>
1
+ export const escapeRegExp = (text: string) =>
2
2
  text.replace(/[-[\]{}()*+?.,\\^$|]/g, "\\$&");
3
3
 
4
4
  export const createSearchRegExp = (searchTerm: string): RegExp =>
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.