@salesforcedevs/docs-components 1.3.345-sppage-alpha1 → 1.3.359-test

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
@@ -18,7 +18,6 @@
18
18
  "doc/headingAnchor",
19
19
  "doc/overview",
20
20
  "doc/phase",
21
- "doc/specificationContent",
22
21
  "doc/versionPicker",
23
22
  "doc/xmlContent",
24
23
  "docUtils/utils"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.345-sppage-alpha1",
3
+ "version": "1.3.359-test",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -0,0 +1,12 @@
1
+ @import "dxHelpers/reset";
2
+ @import "dxHelpers/text";
3
+
4
+ .doc-playground-label {
5
+ font-family: var(--dx-g-font-display);
6
+ margin: 10px 0;
7
+ }
8
+
9
+ iframe {
10
+ width: 100%;
11
+ height: 764px;
12
+ }
@@ -0,0 +1,9 @@
1
+ <template>
2
+ <div class="doc-playground-label">PREVIEW</div>
3
+ <dx-spinner size="large" variant="brand" if:true={isLoading}></dx-spinner>
4
+ <iframe
5
+ src={playgroundSrc}
6
+ onload={handleIframeLoad}
7
+ title="Component Playground Preview"
8
+ ></iframe>
9
+ </template>
@@ -0,0 +1,20 @@
1
+ import { LightningElement, api, track } from "lwc";
2
+
3
+ export default class ComponentPlayground extends LightningElement {
4
+ @api model!: string;
5
+ @api namespace!: string;
6
+ @api component!: string;
7
+ @api playgroundAppUrl!: string;
8
+
9
+ @track isLoading = true;
10
+
11
+ get playgroundSrc(): string {
12
+ return `${this.playgroundAppUrl}/playground/${this.model}/${
13
+ this.namespace
14
+ }/${this.component.toLowerCase()}.html`;
15
+ }
16
+
17
+ handleIframeLoad() {
18
+ this.isLoading = false;
19
+ }
20
+ }
@@ -1,3 +0,0 @@
1
- @import "dxHelpers/reset";
2
- @import "dxHelpers/text";
3
- @import "dxHelpers/table";
@@ -1,99 +0,0 @@
1
- <template>
2
- <div title="properties">
3
- <template if:true={hasAttributes}>
4
- <doc-heading
5
- header="Attributes"
6
- hash="attributes"
7
- aria-level="2"
8
- ></doc-heading>
9
- <table>
10
- <thead>
11
- <tr>
12
- <th>Name</th>
13
- <th>Description</th>
14
- </tr>
15
- </thead>
16
- <tbody>
17
- <template for:each={attributes} for:item="attribute">
18
- <tr key={attribute.name}>
19
- <td>{attribute.nameInKebabCase}</td>
20
- <td>{attribute.description}</td>
21
- </tr>
22
- </template>
23
- </tbody>
24
- </table>
25
- </template>
26
-
27
- <template if:true={hasMethods}>
28
- <doc-heading
29
- header="Methods"
30
- hash="methods"
31
- aria-level="2"
32
- ></doc-heading>
33
- <table>
34
- <thead>
35
- <tr>
36
- <th>Name</th>
37
- <th>Description</th>
38
- </tr>
39
- </thead>
40
- <tbody>
41
- <template for:each={methods} for:item="method">
42
- <tr key={method.name}>
43
- <td>{method.nameInKebabCase}</td>
44
- <td>{method.description}</td>
45
- </tr>
46
- </template>
47
- </tbody>
48
- </table>
49
- </template>
50
-
51
- <template if:true={hasSlots}>
52
- <doc-heading
53
- header="Slots"
54
- hash="slots"
55
- aria-level="2"
56
- ></doc-heading>
57
- <table>
58
- <thead>
59
- <tr>
60
- <th>Name</th>
61
- <th>Description</th>
62
- </tr>
63
- </thead>
64
- <tbody>
65
- <template for:each={slots} for:item="slot">
66
- <tr key={slot.name}>
67
- <td>{slot.nameInKebabCase}</td>
68
- <td>{slot.description}</td>
69
- </tr>
70
- </template>
71
- </tbody>
72
- </table>
73
- </template>
74
-
75
- <template if:true={hasEvents}>
76
- <doc-heading
77
- header="Events"
78
- hash="events"
79
- aria-level="2"
80
- ></doc-heading>
81
- <table>
82
- <thead>
83
- <tr>
84
- <th>Name</th>
85
- <th>Description</th>
86
- </tr>
87
- </thead>
88
- <tbody>
89
- <template for:each={slots} for:item="slot">
90
- <tr key={slot.name}>
91
- <td>{slot.nameInKebabCase}</td>
92
- <td>{slot.description}</td>
93
- </tr>
94
- </template>
95
- </tbody>
96
- </table>
97
- </template>
98
- </div>
99
- </template>
@@ -1,56 +0,0 @@
1
- import { LightningElement, track, api } from "lwc";
2
-
3
- export default class SpecificationContent extends LightningElement {
4
- @track data: any;
5
- @api component: string = "button";
6
- @api type: string = "lightning";
7
-
8
- private attributes = [];
9
- private methods = [];
10
- private slots = [];
11
- private events = [];
12
-
13
- connectedCallback() {
14
- this.fetchPropertiesData();
15
- }
16
-
17
- async fetchPropertiesData() {
18
- const url = `http://localhost:3002/get-properties?component=${this.component}&type=${this.type}`;
19
-
20
- try {
21
- const response = await fetch(url);
22
-
23
- if (!response.ok) {
24
- throw new Error(`Failed to fetch: ${response.statusText}`);
25
- }
26
-
27
- const result = await response.json();
28
- this.data = result;
29
- ({
30
- attributes: this.attributes,
31
- methods: this.methods,
32
- slots: this.slots,
33
- events: this.events
34
- } = this.data);
35
- } catch (error) {
36
- this.data = {};
37
- console.error("fetchPropertiesData() failed for:" + url);
38
- }
39
- }
40
-
41
- get hasAttributes() {
42
- return this.attributes;
43
- }
44
-
45
- get hasMethods() {
46
- return this.methods;
47
- }
48
-
49
- get hasSlots() {
50
- return this.slots;
51
- }
52
-
53
- get hasEvents() {
54
- return this.events;
55
- }
56
- }