@salesforcedevs/docs-components 0.55.3 → 0.55.5

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/docs-components",
3
- "version": "0.55.3",
3
+ "version": "0.55.5",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -24,5 +24,5 @@
24
24
  "@types/lodash.orderby": "^4.6.7",
25
25
  "@types/lodash.uniqby": "^4.7.7"
26
26
  },
27
- "gitHead": "dd93f0c0ca98a79366972c0f6c063a2292a427a9"
27
+ "gitHead": "0adec410bc1b08455553d508e88596b30568019e"
28
28
  }
@@ -150,11 +150,26 @@ export default class Content extends LightningElement {
150
150
  is: ContentCallout
151
151
  });
152
152
  const detailEls = calloutEl.querySelectorAll(
153
- "p, div.data, ol, ul, .codeSection, .mediaBd > span.ph"
153
+ "p, div.data, ol, ul, p+.codeSection, .mediaBd > span.ph"
154
154
  );
155
155
  detailEls.forEach((detailEl) => {
156
- calloutCompEl.appendChild(detailEl);
156
+ if (detailEl.innerHTML.trim() !== "") {
157
+ calloutCompEl.appendChild(detailEl);
158
+ }
157
159
  });
160
+
161
+ let flag = 1;
162
+ for (let i = 0; i < detailEls.length; i++) {
163
+ flag &= detailEls[i].innerHTML.trim() === "";
164
+ }
165
+
166
+ if (flag) {
167
+ const codeEls = calloutEl.querySelectorAll(".codeSection");
168
+ codeEls.forEach((codeEl) => {
169
+ calloutCompEl.appendChild(codeEl);
170
+ });
171
+ }
172
+
158
173
  const type = calloutEl.querySelector("h4").textContent;
159
174
  const typeLower = type.toLowerCase();
160
175
  Object.assign(calloutCompEl, {
@@ -9,7 +9,7 @@
9
9
  sidebar-content={sidebarContent}
10
10
  sidebar-value={sidebarValue}
11
11
  onselect={handleSelect}
12
- use-old-sidebar
12
+ use-old-sidebar={useOldSidebar}
13
13
  >
14
14
  <div slot="sidebar-header" class="document-pickers">
15
15
  <dx-dropdown
@@ -180,6 +180,19 @@ export default class DocXmlContent extends LightningElementWithState<{
180
180
  return this.pageReference.deliverable;
181
181
  }
182
182
 
183
+ private get useOldSidebar(): boolean {
184
+ // Coveo is enabled and the version is greater than 51 (within the latest 3 versions)
185
+ // TODO: we need a better fix for version number check
186
+ return !(
187
+ process.env.COVEO_ORGANIZATION_ID &&
188
+ process.env.COVEO_PUBLIC_ACCESS_TOKEN &&
189
+ (!this.version?.releaseVersion ||
190
+ (this.version?.releaseVersion &&
191
+ parseInt(this.version.releaseVersion.replace("v", ""), 10) >
192
+ 51))
193
+ );
194
+ }
195
+
183
196
  private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
184
197
  return {
185
198
  // Temporary fix for empty results on apexref page