@salesforcedevs/docs-components 1.17.6-redoc1 → 1.17.6-redoc2

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
@@ -14,13 +14,13 @@
14
14
  "doc/contentLayout",
15
15
  "doc/contentMedia",
16
16
  "doc/docXmlContent",
17
+ "doc/flexReference",
17
18
  "doc/lwcContentLayout",
18
19
  "doc/header",
19
20
  "doc/heading",
20
21
  "doc/headingAnchor",
21
22
  "doc/overview",
22
23
  "doc/phase",
23
- "doc/docReference",
24
24
  "doc/specificationContent",
25
25
  "doc/versionPicker",
26
26
  "doc/xmlContent",
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.17.6-redoc1",
3
+ "version": "1.17.6-redoc2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "engines": {
8
8
  "node": "20.x"
9
9
  },
10
+ "volta": {
11
+ "node": "20.18.2",
12
+ "yarn": "1.22.19"
13
+ },
10
14
  "publishConfig": {
11
15
  "access": "public"
12
16
  },
@@ -0,0 +1,20 @@
1
+ export const REFERENCE_TYPES = {
2
+ markdown: "markdown",
3
+ raml: "rest-raml",
4
+ oa2: "rest-oa2",
5
+ oa3: "rest-oa3"
6
+ };
7
+
8
+ const oldReferenceIdNewReferenceIdMap: Record<string, string> = {
9
+ "commerce-api-assignments": "assignments",
10
+ "commerce-api-campaigns": "campaigns",
11
+ "commerce-api-catalogs": "catalogs",
12
+ "cdn-zones": "cdn-api-process-apis",
13
+ "inventory-impex": "impex",
14
+ "inventory-reservations": "inventory-reservation-service",
15
+ "shopper-login-and-api-access-service": "shopper-login",
16
+ "shopper-login-and-api-access-service-admin": "slas-admin",
17
+ "einstein-recommendations": "einstein-api-quick-start-guide"
18
+ };
19
+
20
+ export { oldReferenceIdNewReferenceIdMap };
@@ -6,12 +6,12 @@ import type {
6
6
  ReferenceVersion,
7
7
  ReferenceSetConfig,
8
8
  ParsedMarkdownTopic
9
- } from "../amfReference/types";
9
+ } from "./types";
10
10
 
11
11
  import {
12
12
  REFERENCE_TYPES,
13
13
  oldReferenceIdNewReferenceIdMap
14
- } from "../amfReference/constants";
14
+ } from "./constants";
15
15
  import { restoreScroll } from "dx/scrollManager";
16
16
  import { DocPhaseInfo } from "typings/custom";
17
17
  import { logCoveoPageView, oldVersionDocInfo } from "docUtils/utils";
@@ -26,7 +26,7 @@ type NavigationItem = {
26
26
  isChildrenLoading: boolean;
27
27
  };
28
28
 
29
- export default class DocReference extends LightningElement {
29
+ export default class FlexReference extends LightningElement {
30
30
  @api breadcrumbs: string | null = null;
31
31
  @api sidebarHeader!: string;
32
32
  @api coveoOrganizationId!: string;
@@ -0,0 +1,80 @@
1
+ import { DocPhaseInfo } from "typings/custom";
2
+
3
+ // Redoc type declarations for window object
4
+ export interface RedocNavigationItem {
5
+ label: string;
6
+ name: string; // Hash-based URL (#section-id)
7
+ id: string; // Section ID for scroll targeting
8
+ children?: RedocNavigationItem[];
9
+ }
10
+
11
+ export interface RedocSidebarData {
12
+ spec: {
13
+ title: string;
14
+ version: string;
15
+ };
16
+ items: RedocNavigationItem[];
17
+ }
18
+
19
+ // Core types needed for reference handling
20
+ export type ReferenceType = "markdown" | "rest-raml" | "rest-oa2" | "rest-oa3";
21
+
22
+ /**
23
+ * Represents parsed topic for the sidebar.
24
+ */
25
+ export interface ParsedMarkdownTopic {
26
+ label: string;
27
+ name: string;
28
+ children: ParsedMarkdownTopic[];
29
+ link?: {
30
+ href: string;
31
+ target?: string;
32
+ };
33
+ isExpanded?: boolean;
34
+ }
35
+
36
+ export interface AmfConfig {
37
+ id: string;
38
+ version?: string;
39
+ docPhase?: DocPhaseInfo;
40
+ title: string;
41
+ href: string;
42
+ referenceType: ReferenceType;
43
+
44
+ // determines if a reference config is the current active and selected one.
45
+ isSelected: boolean;
46
+
47
+ // required for spec based references
48
+ amf?: string;
49
+
50
+ // required for markdown based references
51
+ topic?: ParsedMarkdownTopic;
52
+ }
53
+
54
+ export interface ReferenceVersion {
55
+ id: string;
56
+ label: string;
57
+ deprecated?: boolean;
58
+ selected?: boolean;
59
+ link: {
60
+ href: string;
61
+ };
62
+ }
63
+
64
+ export interface ReferenceSetConfig {
65
+ refId?: string;
66
+ versionToRefMap?: Map<string, Array<AmfConfig>>;
67
+ refList: Array<AmfConfig>;
68
+ versions: Array<ReferenceVersion>;
69
+ }
70
+
71
+ declare global {
72
+ interface Window {
73
+ Redoc?: {
74
+ init: (specUrl: string, options: any, container: Element) => Promise<void>;
75
+ getSpecStructure?: (specUrl: string) => Promise<RedocSidebarData>;
76
+ };
77
+ }
78
+ }
79
+
80
+ export {};
@@ -1,24 +0,0 @@
1
- // Redoc type declarations for window object
2
- export interface RedocNavigationItem {
3
- label: string;
4
- name: string; // Hash-based URL (#section-id)
5
- id: string; // Section ID for scroll targeting
6
- children?: RedocNavigationItem[];
7
- }
8
-
9
- export interface RedocSidebarData {
10
- spec: {
11
- title: string;
12
- version: string;
13
- };
14
- items: RedocNavigationItem[];
15
- }
16
-
17
- declare global {
18
- interface Window {
19
- Redoc?: {
20
- init: (specUrl: string, options: any, container: Element) => Promise<void>;
21
- getSpecStructure?: (specUrl: string) => Promise<RedocSidebarData>;
22
- };
23
- }
24
- }