@salesforcedevs/dx-components 0.19.3-alpha.18 → 0.19.3-alpha.22

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.19.3-alpha.18",
3
+ "version": "0.19.3-alpha.22",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -144,9 +144,7 @@ export default class SidebarSearch extends LightningElement {
144
144
  // If this is the first render and there is a search value, trigger
145
145
  // term highlighting
146
146
  if (!this.didRender && this.value) {
147
- console.log('dispatching highlight term in the render')
148
147
  this.dispatchHighlightedTermChange();
149
- document.addEventListener('search-syncer-initialized', () => console.log('SEARCH SYNCER INITD'))
150
148
  }
151
149
 
152
150
  this.didRender = true;
@@ -337,6 +335,8 @@ export default class SidebarSearch extends LightningElement {
337
335
  }
338
336
 
339
337
  private dispatchHighlightedTermChange = debounce(() => {
338
+ console.log(this.engine);
339
+ console.log(this.engine?.state.search.response.termsToHighlight);
340
340
  this.dispatchEvent(
341
341
  new CustomEvent("highlightedtermchange", {
342
342
  detail: this.value,
@@ -2,9 +2,7 @@ import { createSearchRegExp } from "utils/regexps";
2
2
 
3
3
  const MARK_TAGS = /<\/?mark>/gi;
4
4
 
5
- // mark tags not being removed from ref page
6
5
  // mark tags dif color on ref page
7
- // need to reset to first match on highlight change
8
6
 
9
7
  export const highlightTerms = (
10
8
  // eslint-disable-next-line no-undef
@@ -14,7 +12,6 @@ export const highlightTerms = (
14
12
  searchTerm = searchTerm.trim();
15
13
  const searchExp = createSearchRegExp(searchTerm);
16
14
  let scrolled = false;
17
- console.log('highlighting called', elements)
18
15
  elements.forEach((element) => {
19
16
  if (
20
17
  element?.innerHTML.includes("<dx-") ||
@@ -34,17 +31,19 @@ export const highlightTerms = (
34
31
  innerHtml = innerHtml.replace(searchExp, "<mark>$&</mark>");
35
32
  }
36
33
 
37
- element.setAttribute('lwc:dom', 'manual')
38
34
  element.innerHTML = innerHtml;
39
35
  } catch (e) {
40
36
  console.error(e, element);
41
37
  }
42
38
 
43
- console.log("should i scroll?");
39
+ element.querySelectorAll("mark").forEach((el) => {
40
+ console.log(el)
41
+ el.style.backgroundColor = "var(--dx-g-yellow-vibrant-90)";
42
+ });
43
+
44
44
  const mark = element.querySelector("mark");
45
45
  if (mark && !scrolled) {
46
46
  scrolled = true;
47
- console.log("scrolling", mark);
48
47
  mark.scrollIntoView({ block: "nearest" });
49
48
  }
50
49
  });