@salesforcedevs/docs-components 1.3.74-lwc-example → 1.3.81

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/LICENSE ADDED
@@ -0,0 +1,12 @@
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.
package/lwc.config.json CHANGED
@@ -2,9 +2,7 @@
2
2
  "modules": [
3
3
  { "dir": "src/modules" },
4
4
  { "npm": "@salesforcedevs/dx-components" },
5
- { "npm": "@salesforcedevs/dw-components" },
6
- { "npm": "lightning-base-components" },
7
- { "npm": "@mulesoft/api-console-lwc" }
5
+ { "npm": "@salesforcedevs/dw-components" }
8
6
  ],
9
7
  "expose": [
10
8
  "doc/amfReference",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.74-lwc-example",
3
+ "version": "1.3.81",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -12,21 +12,17 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@api-components/amf-helper-mixin": "^4.5.17",
15
- "@mulesoft/api-console-lwc": "^0.2.28",
16
15
  "classnames": "^2.2.6",
17
- "cpx": "^1.5.0",
18
16
  "kagekiri": "^1.4.1",
19
- "lightning-base-components": "1.15.4-alpha",
20
17
  "lodash.orderby": "^4.6.0",
21
18
  "lodash.uniqby": "^4.7.0",
22
19
  "query-string": "^7.1.1",
23
20
  "sentence-case": "^3.0.4"
24
21
  },
25
22
  "devDependencies": {
26
- "@salesforce-ux/design-system": "^2.19.0",
27
23
  "@types/classnames": "^2.2.10",
28
24
  "@types/lodash.orderby": "^4.6.7",
29
25
  "@types/lodash.uniqby": "^4.7.7"
30
26
  },
31
- "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
27
+ "gitHead": "92a788995a419856ee81fe2ea13f877865506a9b"
32
28
  }
@@ -36,14 +36,9 @@
36
36
  <slot></slot>
37
37
  </template>
38
38
  <template if:true={showSpecBasedReference}>
39
- <div class="container" if:true={topicModel}>
39
+ <div class="container">
40
40
  <div class="api-documentation">
41
- <arc-api-documentation
42
- amf={topicModel.amf}
43
- selected={topicModel.id}
44
- selected-type={topicModel.type}
45
- no-try-it
46
- ></arc-api-documentation>
41
+ <doc-amf-topic model={topicModel}></doc-amf-topic>
47
42
  </div>
48
43
  </div>
49
44
  </template>
@@ -167,17 +167,15 @@ export default class AmfReference extends LightningElement {
167
167
  constructor() {
168
168
  super();
169
169
 
170
- this._boundOnApiNavigationChanged = this.onApiNavigationChanged.bind(
171
- this
172
- );
173
- this._boundUpdateSelectedItemFromUrlQuery = this.updateSelectedItemFromUrlQuery.bind(
174
- this
175
- );
170
+ this._boundOnApiNavigationChanged =
171
+ this.onApiNavigationChanged.bind(this);
172
+ this._boundUpdateSelectedItemFromUrlQuery =
173
+ this.updateSelectedItemFromUrlQuery.bind(this);
176
174
  }
177
175
 
178
176
  connectedCallback(): void {
179
177
  this.addEventListener(
180
- "api_navigation_selection_changed",
178
+ "api-navigation-selection-changed",
181
179
  this._boundOnApiNavigationChanged
182
180
  );
183
181
  window.addEventListener(
@@ -188,7 +186,7 @@ export default class AmfReference extends LightningElement {
188
186
 
189
187
  disconnectedCallback(): void {
190
188
  this.removeEventListener(
191
- "api_navigation_selection_changed",
189
+ "api-navigation-selection-changed",
192
190
  this._boundOnApiNavigationChanged
193
191
  );
194
192
  window.removeEventListener(
@@ -228,9 +226,8 @@ export default class AmfReference extends LightningElement {
228
226
  const updatedReferenceId =
229
227
  oldReferenceIdNewReferenceIdMap[referenceId];
230
228
  const newReferenceId = updatedReferenceId || referenceId;
231
- const referenceItemConfig = this.getAmfConfigWithId(
232
- newReferenceId
233
- );
229
+ const referenceItemConfig =
230
+ this.getAmfConfigWithId(newReferenceId);
234
231
  if (referenceItemConfig) {
235
232
  hashBasedRedirectUrl = `${referenceItemConfig.href}?meta=${encodedMeta}`;
236
233
  }
@@ -299,9 +296,8 @@ export default class AmfReference extends LightningElement {
299
296
  for (let i = 0; i < allVersions.length; i++) {
300
297
  const versionItem = allVersions[i];
301
298
  const referenceLink = versionItem.link.href;
302
- const referenceId = this.getReferenceIdFromUrl(
303
- referenceLink
304
- );
299
+ const referenceId =
300
+ this.getReferenceIdFromUrl(referenceLink);
305
301
  if (this._currentReferenceId === referenceId) {
306
302
  // This is to navigate to respective topic in the changed version
307
303
  versionItem.link.href = `${referenceLink}/${currentRefMeta}`;
@@ -1226,12 +1222,10 @@ export default class AmfReference extends LightningElement {
1226
1222
  }
1227
1223
  if (!isRedirecting) {
1228
1224
  const currentReferenceUrl = window.location.href;
1229
- const referenceMeta = this.getMarkdownReferenceMeta(
1230
- currentReferenceUrl
1231
- );
1232
- const selectedItemRefId = this.getReferenceIdFromUrl(
1233
- currentReferenceUrl
1234
- );
1225
+ const referenceMeta =
1226
+ this.getMarkdownReferenceMeta(currentReferenceUrl);
1227
+ const selectedItemRefId =
1228
+ this.getReferenceIdFromUrl(currentReferenceUrl);
1235
1229
  const referenceDetails = this.getRefDetailsForGivenTopicMeta(
1236
1230
  selectedItemRefId,
1237
1231
  referenceMeta
@@ -1270,9 +1264,8 @@ export default class AmfReference extends LightningElement {
1270
1264
  const name = event.detail.name;
1271
1265
  if (name) {
1272
1266
  const urlReferenceId = this.getReferenceIdFromUrl(name);
1273
- const specBasedReference = this.isSpecBasedReference(
1274
- urlReferenceId
1275
- );
1267
+ const specBasedReference =
1268
+ this.isSpecBasedReference(urlReferenceId);
1276
1269
  if (specBasedReference) {
1277
1270
  const metaVal = this.getMetaFromUrl(name);
1278
1271
  const currentSelectedMeta = this.selectedTopic
@@ -1322,9 +1315,8 @@ export default class AmfReference extends LightningElement {
1322
1315
  const currentReferenceId = this.getReferenceIdFromUrl(currentUrl);
1323
1316
  //No need to do anything if user is expanding currently selected reference
1324
1317
  if (referenceId !== currentReferenceId) {
1325
- const isSpecBasedReference = this.isSpecBasedReference(
1326
- referenceId
1327
- );
1318
+ const isSpecBasedReference =
1319
+ this.isSpecBasedReference(referenceId);
1328
1320
  if (isSpecBasedReference) {
1329
1321
  // Perform functionality same as item selection
1330
1322
  this.onNavSelect(event);
@@ -324,9 +324,8 @@ export default class Content extends LightningElement {
324
324
  event.preventDefault();
325
325
  // eslint-disable-next-line no-use-before-define
326
326
  const target = event.currentTarget.dataset.id;
327
- const [page, docId, deliverable, tempContentDocumentId] = target.split(
328
- "/"
329
- );
327
+ const [page, docId, deliverable, tempContentDocumentId] =
328
+ target.split("/");
330
329
  const [contentDocumentId, hash] = tempContentDocumentId.split("#");
331
330
  const newPageReference = {
332
331
  page: page,
@@ -220,14 +220,17 @@ export default class ContentLayout extends LightningElement {
220
220
  }
221
221
 
222
222
  onSlotChange(event: Event): void {
223
- const slotElements = (event.target as HTMLSlotElement).assignedElements();
223
+ const slotElements = (
224
+ event.target as HTMLSlotElement
225
+ ).assignedElements();
224
226
 
225
227
  if (slotElements.length) {
226
228
  this.contentLoaded = true;
227
229
  const slotContentElement = slotElements[0];
228
- const headingElements = slotContentElement.ownerDocument?.getElementsByTagName(
229
- TOC_HEADER_TAG
230
- );
230
+ const headingElements =
231
+ slotContentElement.ownerDocument?.getElementsByTagName(
232
+ TOC_HEADER_TAG
233
+ );
231
234
 
232
235
  for (const headingElement of headingElements) {
233
236
  // Sometimes elements hash is not being set when slot content is wrapped with div
@@ -43,9 +43,8 @@ export default class Phase extends LightningElement {
43
43
  }
44
44
 
45
45
  renderedCallback() {
46
- const phaseBodyContainer = this.template.querySelector(
47
- ".doc-phase-body"
48
- );
46
+ const phaseBodyContainer =
47
+ this.template.querySelector(".doc-phase-body");
49
48
  if (phaseBodyContainer && this.docPhaseInfo) {
50
49
  // eslint-disable-next-line @lwc/lwc/no-inner-html
51
50
  phaseBodyContainer.innerHTML = this.docPhaseInfo.body;
@@ -96,7 +96,9 @@
96
96
  <a
97
97
  href={child5.a_attr.href}
98
98
  data-id={child5.id}
99
- class="nav1"
99
+ class="
100
+ nav1
101
+ "
100
102
  onclick={handleNavClick}
101
103
  >
102
104
  {child5.text}
@@ -40,9 +40,9 @@ export default class Toolbar extends LightningElement {
40
40
  "select[name=languages]"
41
41
  ) as HTMLSelectElement;
42
42
  if (languageEl) {
43
- const languageValue = (languageEl[
44
- languageEl.selectedIndex
45
- ] as HTMLOptionElement).value;
43
+ const languageValue = (
44
+ languageEl[languageEl.selectedIndex] as HTMLOptionElement
45
+ ).value;
46
46
  this.dispatchEvent(
47
47
  new CustomEvent("languageselected", {
48
48
  detail: {
@@ -61,9 +61,9 @@ export default class Toolbar extends LightningElement {
61
61
  "select[name=versions]"
62
62
  ) as HTMLSelectElement;
63
63
  if (versionEl) {
64
- const versionValue = (versionEl[
65
- versionEl.selectedIndex
66
- ] as HTMLOptionElement).value;
64
+ const versionValue = (
65
+ versionEl[versionEl.selectedIndex] as HTMLOptionElement
66
+ ).value;
67
67
  this.dispatchEvent(
68
68
  new CustomEvent("versionselected", {
69
69
  detail: {
@@ -87,9 +87,7 @@ export class FetchContent {
87
87
  return json;
88
88
  }
89
89
 
90
- private normalizeToc(
91
- apiToc: Array<ApiNavItem>
92
- ): {
90
+ private normalizeToc(apiToc: Array<ApiNavItem>): {
93
91
  tocMap: { [key: string]: TreeNode };
94
92
  normalizedToc: Array<TreeNode>;
95
93
  } {
@@ -355,12 +355,8 @@ export default class DocXmlContent extends LightningElementWithState<{
355
355
  }
356
356
 
357
357
  getReferenceFromUrl(): PageReference {
358
- const [
359
- page,
360
- docId,
361
- deliverable,
362
- contentDocumentId
363
- ] = window.location.pathname.substr(1).split("/");
358
+ const [page, docId, deliverable, contentDocumentId] =
359
+ window.location.pathname.substr(1).split("/");
364
360
 
365
361
  const { origin: domain, hash, search } = window.location;
366
362
 
@@ -527,14 +523,8 @@ export default class DocXmlContent extends LightningElementWithState<{
527
523
  }
528
524
 
529
525
  private pageReferenceToString(reference: PageReference): string {
530
- const {
531
- page,
532
- docId,
533
- deliverable,
534
- contentDocumentId,
535
- hash,
536
- search
537
- } = reference;
526
+ const { page, docId, deliverable, contentDocumentId, hash, search } =
527
+ reference;
538
528
  return `/${page}/${docId}/${deliverable}/${contentDocumentId}${this.normalizeSearch(
539
529
  search
540
530
  )}${this.normalizeHash(hash)}`;