@salesforcedevs/docs-components 1.17.6-hover-edit → 1.17.6-redoc1

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,10 +18,9 @@
18
18
  "doc/header",
19
19
  "doc/heading",
20
20
  "doc/headingAnchor",
21
- "doc/markdownEditor",
22
- "doc/textSelectionSearch",
23
21
  "doc/overview",
24
22
  "doc/phase",
23
+ "doc/docReference",
25
24
  "doc/specificationContent",
26
25
  "doc/versionPicker",
27
26
  "doc/xmlContent",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.17.6-hover-edit",
3
+ "version": "1.17.6-redoc1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -17,6 +17,6 @@ iframe {
17
17
  border: 1px solid var(--dx-g-gray-90);
18
18
  }
19
19
 
20
- .container {
20
+ .playground-container {
21
21
  position: relative;
22
22
  }
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="container" lwc:if={playgroundAvailable}>
2
+ <div class="playground-container" lwc:if={playgroundAvailable}>
3
3
  <dx-spinner
4
4
  size="large"
5
5
  variant="brand"
@@ -8,7 +8,7 @@
8
8
  <iframe
9
9
  src={playgroundSrc}
10
10
  onload={handleIframeLoad}
11
- title="Component Playground"
11
+ title={playgroundTitle}
12
12
  allow="clipboard-write"
13
13
  ></iframe>
14
14
  </div>
@@ -8,6 +8,19 @@ export default class ComponentPlayground extends LightningElement {
8
8
 
9
9
  isLoading = true;
10
10
 
11
+ /**
12
+ * Returns a formatted title for the component playground
13
+ * Maps 'aura' model to 'Aura' and 'lwc' model to 'Lightning'
14
+ * Capitalizes the first letter of the component name
15
+ * @returns {string} Formatted playground title
16
+ */
17
+ get playgroundTitle() {
18
+ const modelName = this.model === "aura" ? "Aura" : "Lightning";
19
+ const componentName =
20
+ this.component.charAt(0).toUpperCase() + this.component.slice(1);
21
+ return `Example previews and code for ${modelName} ${componentName} component`;
22
+ }
23
+
11
24
  get playgroundAvailable() {
12
25
  return (
13
26
  this.playgroundAppUrl &&
@@ -0,0 +1,52 @@
1
+ @import "docHelpers/amfStyle";
2
+
3
+ :host {
4
+ --reference-container-margin-top: var(--dx-g-spacing-sm);
5
+ --api-documentation-margin-top: var(--dx-g-spacing-3xl);
6
+ }
7
+
8
+ /**
9
+ * 1. We need to scroll to top from the tablet size as side nav bar and content in side by side from tablet size
10
+ * 2. Consider global nav height, doc header height and content margins to scroll to the right position
11
+ */
12
+
13
+ @media screen and (min-width: 769px) {
14
+ .redoc-container {
15
+ scroll-margin-top: calc(
16
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
17
+ var(--reference-container-margin-top) +
18
+ var(--api-documentation-margin-top)
19
+ );
20
+ }
21
+ }
22
+
23
+ .redoc-container {
24
+ width: 100%;
25
+ height: 100%;
26
+ /* Ensure Redoc content is scrollable within the content layout */
27
+ overflow-y: auto;
28
+ }
29
+
30
+ /* Loading state styles */
31
+ .loading-container {
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+ height: 200px;
36
+ font-size: 16px;
37
+ color: var(--dx-g-color-text-secondary);
38
+ }
39
+
40
+ /* Error state styles */
41
+ .error-container {
42
+ padding: 20px;
43
+ background-color: var(--dx-g-color-background-error);
44
+ border: 1px solid var(--dx-g-color-border-error);
45
+ border-radius: 4px;
46
+ margin: 20px 0;
47
+ }
48
+
49
+ .error-message {
50
+ color: var(--dx-g-color-text-error);
51
+ font-weight: 600;
52
+ }
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <doc-content-layout
3
+ lwc:if={isVersionFetched}
4
+ use-old-sidebar={useOldSidebar}
5
+ class="content-type content-type-reference"
6
+ coveo-organization-id={coveoOrganizationId}
7
+ coveo-public-access-token={coveoPublicAccessToken}
8
+ coveo-analytics-token={coveoAnalyticsToken}
9
+ coveo-search-hub={coveoSearchHub}
10
+ coveo-advanced-query-config={coveoAdvancedQueryConfig}
11
+ breadcrumbs={breadcrumbs}
12
+ sidebar-header={sidebarHeader}
13
+ sidebar-value={selectedSidebarValue}
14
+ sidebar-content={navigation}
15
+ onselect={onNavSelect}
16
+ onexpandcollapse={onExpandCollapse}
17
+ toc-title={tocTitle}
18
+ toc-options={tocOptions}
19
+ enable-slot-change="true"
20
+ languages={languages}
21
+ language={language}
22
+ show-footer={enableFooter}
23
+ >
24
+ <doc-phase
25
+ slot="doc-phase"
26
+ lwc:if={docPhaseInfo}
27
+ doc-phase-info={docPhaseInfo}
28
+ ></doc-phase>
29
+ <doc-phase
30
+ slot="version-banner"
31
+ lwc:if={showVersionBanner}
32
+ doc-phase-info={oldVersionInfo}
33
+ icon-name="warning"
34
+ dismissible="true"
35
+ ondismissphase={handleDismissVersionBanner}
36
+ ></doc-phase>
37
+ <div lwc:if={isVersionEnabled} slot="sidebar-header">
38
+ <doc-version-picker
39
+ onchange={handleVersionChange}
40
+ data-type="version"
41
+ versions={versions}
42
+ selected-version={selectedVersion}
43
+ latest-version={latestVersion}
44
+ ></doc-version-picker>
45
+ </div>
46
+ <template lwc:if={showSpecBasedReference}>
47
+ <div class="container">
48
+ <div class="api-documentation">
49
+ <!-- Replace doc-amf-topic with Redoc container -->
50
+ <div
51
+ class="redoc-container"
52
+ lwc:dom="manual"
53
+ data-redoc-container
54
+ ></div>
55
+ </div>
56
+ </div>
57
+ </template>
58
+ <template lwc:else>
59
+ <slot></slot>
60
+ </template>
61
+ </doc-content-layout>
62
+ </template>