@salesforcedevs/docs-components 1.3.194-search-alpha → 1.3.194-search2-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.194-search-alpha",
3
+ "version": "1.3.194-search2-alpha",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1314,19 +1314,45 @@ export default class AmfReference extends LightningElement {
1314
1314
  const metaNavTitle = document.querySelector('meta[name="nav-title"]');
1315
1315
  // eslint-disable-next-line @lwc/lwc/no-document-query
1316
1316
  const titleTag = document.querySelector("title");
1317
+ const TITLE_SEPARATOR = " | ";
1318
+
1317
1319
  if (metaNavTitle) {
1318
1320
  metaNavTitle.setAttribute("content", navTitle);
1319
1321
  }
1320
1322
 
1323
+ /**
1324
+ * Right now, the title tag only changes when you pick a Ref spec,
1325
+ * not every time you choose a subsection of the Ref spec.
1326
+ * This update aims to refresh the title tag with each selection.
1327
+ * If a Ref spec is chosen, we add the value of the <selected topic> to the title.
1328
+ * If a subsection is selected, we update the first part of the current
1329
+ * title with the new <selected topic>.
1330
+ * Example: Following is a sample project structure.
1331
+ * - Project Name
1332
+ * - Ref Spec1
1333
+ * - Summary
1334
+ * - Endpoints
1335
+ * - E1
1336
+ * - E2
1337
+ * - Ref Spec2
1338
+ * - Summary
1339
+ * - Endpoints
1340
+ * - E1 (Selected)
1341
+ * - E2
1342
+ * Previous Title: Ref Spec2 | Project Name | Salesforce Developer
1343
+ * New Title: E1 | Ref Spec2 | Project Name | Salesforce Developer
1344
+ *
1345
+ */
1321
1346
  if (titleTag) {
1322
1347
  let titleTagValue = titleTag.textContent;
1323
- const tagValues: string[] = titleTagValue?.split(" | ");
1324
- if (tagValues) {
1325
- if (tagValues.length <= 3) {
1326
- titleTagValue = navTitle + " | " + titleTagValue;
1348
+ const titleTagSectionValues: string[] =
1349
+ titleTagValue?.split(TITLE_SEPARATOR);
1350
+ if (titleTagSectionValues) {
1351
+ if (titleTagSectionValues.length <= 3) {
1352
+ titleTagValue = navTitle + TITLE_SEPARATOR + titleTagValue;
1327
1353
  } else {
1328
- tagValues[0] = navTitle;
1329
- titleTagValue = tagValues.join(" | ");
1354
+ titleTagSectionValues[0] = navTitle;
1355
+ titleTagValue = titleTagSectionValues.join(TITLE_SEPARATOR);
1330
1356
  }
1331
1357
  }
1332
1358
  titleTag.textContent = titleTagValue;
@@ -106,7 +106,7 @@ h6 {
106
106
  }
107
107
 
108
108
  img {
109
- image-rendering: -webkit-optimize-contrast;
109
+ image-rendering: optimize-contrast;
110
110
  }
111
111
 
112
112
  p,
@@ -207,9 +207,9 @@ export default class ContentLayout extends LightningElement {
207
207
  ".sticky-doc-header"
208
208
  ) as HTMLElement;
209
209
 
210
- const docPhaseEl = (
211
- this.template.querySelector("[name=doc-phase]")! as any
212
- ).assignedElements()[0] as HTMLSlotElement;
210
+ const docPhaseEl = (this.template.querySelector(
211
+ "[name=doc-phase]"
212
+ )! as any).assignedElements()[0] as HTMLSlotElement;
213
213
 
214
214
  if (!sidebarEl || !globalNavEl || !contextNavEl || !docHeaderEl) {
215
215
  console.warn("One or more required elements are missing.");
@@ -259,8 +259,9 @@ export default class ContentLayout extends LightningElement {
259
259
  });
260
260
 
261
261
  // Adjust right nav bar position when doc phase is present
262
- const rightNavBarEl =
263
- this.template.querySelector(".right-nav-bar");
262
+ const rightNavBarEl = this.template.querySelector(
263
+ ".right-nav-bar"
264
+ );
264
265
 
265
266
  if (rightNavBarEl) {
266
267
  rightNavBarEl.style.top = `${
@@ -322,17 +323,14 @@ export default class ContentLayout extends LightningElement {
322
323
  };
323
324
 
324
325
  onSlotChange(event: Event): void {
325
- const slotElements = (
326
- event.target as HTMLSlotElement
327
- ).assignedElements();
326
+ const slotElements = (event.target as HTMLSlotElement).assignedElements();
328
327
 
329
328
  if (slotElements.length) {
330
329
  this.contentLoaded = true;
331
330
  const slotContentElement = slotElements[0];
332
- const headingElements =
333
- slotContentElement.ownerDocument?.getElementsByTagName(
334
- TOC_HEADER_TAG
335
- );
331
+ const headingElements = slotContentElement.ownerDocument?.getElementsByTagName(
332
+ TOC_HEADER_TAG
333
+ );
336
334
 
337
335
  for (const headingElement of headingElements as any) {
338
336
  // Sometimes elements hash is not being set when slot content is wrapped with div
@@ -392,9 +390,9 @@ export default class ContentLayout extends LightningElement {
392
390
  globalNavEl?.offsetHeight +
393
391
  contextNavEl?.offsetHeight;
394
392
 
395
- const docPhaseEl = (
396
- this.template.querySelector("[name=doc-phase]")! as any
397
- ).assignedElements()[0] as HTMLSlotElement;
393
+ const docPhaseEl = (this.template.querySelector(
394
+ "[name=doc-phase]"
395
+ )! as any).assignedElements()[0] as HTMLSlotElement;
398
396
 
399
397
  const offset = docPhaseEl
400
398
  ? headerHeight + docPhaseEl.offsetHeight
@@ -2,7 +2,6 @@
2
2
 
3
3
  dx-logo {
4
4
  min-width: fit-content;
5
- min-width: -moz-fit-content;
6
5
  }
7
6
 
8
7
  .header_l2 {
@@ -2,7 +2,7 @@
2
2
 
3
3
  button {
4
4
  opacity: 0;
5
- color: rgb(11, 92, 171);
5
+ color: rgb(11 92 171);
6
6
  }
7
7
 
8
8
  button:hover {
@@ -17,7 +17,7 @@ button:focus {
17
17
 
18
18
  button:focus-visible {
19
19
  border-radius: 4px;
20
- border: 2px solid rgb(11, 92, 171);
20
+ border: 2px solid rgb(11 92 171);
21
21
  }
22
22
 
23
23
  .icon-wrapper {
@@ -23,7 +23,7 @@ button {
23
23
  bottom: var(--doc-c-heading-anchor-button-bottom);
24
24
  left: 0;
25
25
  opacity: 0;
26
- color: rgb(11, 92, 171);
26
+ color: rgb(11 92 171);
27
27
  display: flex;
28
28
  justify-content: center;
29
29
  align-items: center;
@@ -4,7 +4,7 @@
4
4
  width: 100%;
5
5
  display: flex;
6
6
  flex-direction: row;
7
- margin: 20px 0 20px 0;
7
+ margin: 20px 0;
8
8
  }
9
9
 
10
10
  dx-hr:first-of-type::part(hr) {
@@ -252,11 +252,14 @@ export default class DocXmlContent extends LightningElementWithState<{
252
252
  }
253
253
 
254
254
  private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
255
- const config: { locale?: string; topicid?: string; version?: string } =
256
- {
257
- locale: this.languageId,
258
- topicid: this.deliverable
259
- };
255
+ const config: {
256
+ locale?: string;
257
+ topicid?: string;
258
+ version?: string;
259
+ } = {
260
+ locale: this.languageId,
261
+ topicid: this.deliverable
262
+ };
260
263
 
261
264
  if (this.releaseVersionId && this.releaseVersionId !== "noversion") {
262
265
  config.version = this.releaseVersionId;
@@ -411,8 +414,12 @@ export default class DocXmlContent extends LightningElementWithState<{
411
414
  }
412
415
 
413
416
  getReferenceFromUrl(): PageReference {
414
- const [page, docId, deliverable, contentDocumentId] =
415
- window.location.pathname.substr(1).split("/");
417
+ const [
418
+ page,
419
+ docId,
420
+ deliverable,
421
+ contentDocumentId
422
+ ] = window.location.pathname.substr(1).split("/");
416
423
 
417
424
  const { origin: domain, hash, search } = window.location;
418
425
 
@@ -574,14 +581,20 @@ export default class DocXmlContent extends LightningElementWithState<{
574
581
  }
575
582
 
576
583
  private updateSearchInput(searchParam: string): void {
577
- (
578
- this.template.querySelector("doc-content-layout") as any
579
- )?.setSidebarInputValue(searchParam);
584
+ (this.template.querySelector(
585
+ "doc-content-layout"
586
+ ) as any)?.setSidebarInputValue(searchParam);
580
587
  }
581
588
 
582
589
  private pageReferenceToString(reference: PageReference): string {
583
- const { page, docId, deliverable, contentDocumentId, hash, search } =
584
- reference;
590
+ const {
591
+ page,
592
+ docId,
593
+ deliverable,
594
+ contentDocumentId,
595
+ hash,
596
+ search
597
+ } = reference;
585
598
  return `/${page}/${docId}/${deliverable}/${contentDocumentId}${this.normalizeSearch(
586
599
  search!
587
600
  )}${this.normalizeHash(hash)}`;
@@ -166,12 +166,12 @@ api-security-documentation {
166
166
  --anypoint-button-emphasis-high-active-background-color: transparent;
167
167
 
168
168
  /* api example */
169
- --api-example-accent-color: rgb(250, 250, 250);
170
- --api-example-background-color: rgb(250, 250, 250);
169
+ --api-example-accent-color: rgb(250 250 250);
170
+ --api-example-background-color: rgb(250 250 250);
171
171
  --api-example-title-background-color: transparent;
172
172
 
173
173
  /* code snippets */
174
- --http-code-snippet-container-background-color: rgb(250, 250, 250);
174
+ --http-code-snippet-container-background-color: rgb(250 250 250);
175
175
  --http-code-snippet-container-padding: var(--dx-g-spacing-md);
176
176
 
177
177
  /* prism */
@@ -208,7 +208,7 @@ api-endpoint-documentation {
208
208
  );
209
209
 
210
210
  /* description */
211
- --api-endpoint-documentation-description-color: rgb(24, 24, 24);
211
+ --api-endpoint-documentation-description-color: rgb(24 24 24);
212
212
  }
213
213
 
214
214
  api-endpoint-documentation,
@@ -271,11 +271,11 @@ api-method-documentation {
271
271
  --api-method-documentation-http-method-label-font-weight: var(
272
272
  --dx-g-font-bold
273
273
  );
274
- --api-method-documentation-description-color: rgb(24, 24, 24);
274
+ --api-method-documentation-description-color: rgb(24 24 24);
275
275
  --api-method-documentation-operation-id-color: var(--dx-g-gray-50);
276
276
 
277
277
  /* body */
278
- --api-body-document-description-color: rgb(24, 24, 24);
278
+ --api-body-document-description-color: rgb(24 24 24);
279
279
  --api-body-document-media-type-selector-color: var(--dx-g-blue-vibrant-20);
280
280
  --api-body-document-media-type-selector-font-size: var(
281
281
  --amf-h8-mod-font-size
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .doc-status-container {
12
- background-color: rgb(254, 243, 217);
12
+ background-color: rgb(254 243 217);
13
13
  border-color: var(--dx-g-yellow-vibrant-80);
14
14
  }
15
15