@salesforcedevs/docs-components 0.0.0

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.
Files changed (67) hide show
  1. package/LICENSE +12 -0
  2. package/lwc.config.json +20 -0
  3. package/package.json +28 -0
  4. package/src/modules/README.md +41 -0
  5. package/src/modules/doc/amfReference/amfReference.css +5 -0
  6. package/src/modules/doc/amfReference/amfReference.html +47 -0
  7. package/src/modules/doc/amfReference/amfReference.ts +1361 -0
  8. package/src/modules/doc/amfReference/constants.ts +76 -0
  9. package/src/modules/doc/amfReference/types.ts +133 -0
  10. package/src/modules/doc/amfReference/utils.ts +669 -0
  11. package/src/modules/doc/amfTopic/amfTopic.css +1 -0
  12. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  13. package/src/modules/doc/amfTopic/amfTopic.ts +94 -0
  14. package/src/modules/doc/amfTopic/types.ts +54 -0
  15. package/src/modules/doc/amfTopic/utils.ts +130 -0
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
  18. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +64 -0
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.html +60 -0
  21. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +187 -0
  22. package/src/modules/doc/content/content.css +399 -0
  23. package/src/modules/doc/content/content.html +6 -0
  24. package/src/modules/doc/content/content.ts +378 -0
  25. package/src/modules/doc/contentCallout/contentCallout.css +56 -0
  26. package/src/modules/doc/contentCallout/contentCallout.html +15 -0
  27. package/src/modules/doc/contentCallout/contentCallout.ts +58 -0
  28. package/src/modules/doc/contentLayout/contentLayout.css +98 -0
  29. package/src/modules/doc/contentLayout/contentLayout.html +50 -0
  30. package/src/modules/doc/contentLayout/contentLayout.ts +322 -0
  31. package/src/modules/doc/contentMedia/contentMedia.css +49 -0
  32. package/src/modules/doc/contentMedia/contentMedia.html +23 -0
  33. package/src/modules/doc/contentMedia/contentMedia.ts +34 -0
  34. package/src/modules/doc/header/header.css +103 -0
  35. package/src/modules/doc/header/header.html +153 -0
  36. package/src/modules/doc/header/header.ts +142 -0
  37. package/src/modules/doc/heading/heading.css +54 -0
  38. package/src/modules/doc/heading/heading.html +14 -0
  39. package/src/modules/doc/heading/heading.ts +65 -0
  40. package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
  41. package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
  42. package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
  43. package/src/modules/doc/headingContent/headingContent.css +53 -0
  44. package/src/modules/doc/headingContent/headingContent.html +13 -0
  45. package/src/modules/doc/headingContent/headingContent.ts +30 -0
  46. package/src/modules/doc/nav/nav.css +14 -0
  47. package/src/modules/doc/nav/nav.html +12 -0
  48. package/src/modules/doc/nav/nav.ts +39 -0
  49. package/src/modules/doc/phase/phase.css +55 -0
  50. package/src/modules/doc/phase/phase.html +28 -0
  51. package/src/modules/doc/phase/phase.ts +57 -0
  52. package/src/modules/doc/toc/toc.css +31 -0
  53. package/src/modules/doc/toc/toc.html +127 -0
  54. package/src/modules/doc/toc/toc.ts +27 -0
  55. package/src/modules/doc/toolbar/toolbar.css +8 -0
  56. package/src/modules/doc/toolbar/toolbar.html +34 -0
  57. package/src/modules/doc/toolbar/toolbar.ts +79 -0
  58. package/src/modules/doc/xmlContent/types.ts +114 -0
  59. package/src/modules/doc/xmlContent/utils.ts +161 -0
  60. package/src/modules/doc/xmlContent/xmlContent.css +32 -0
  61. package/src/modules/doc/xmlContent/xmlContent.html +40 -0
  62. package/src/modules/doc/xmlContent/xmlContent.ts +659 -0
  63. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +93 -0
  64. package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
  65. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +39 -0
  66. package/src/modules/docHelpers/status/status.css +22 -0
  67. package/src/modules/docUtils/SearchSyncer/SearchSyncer.ts +85 -0
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.
@@ -0,0 +1,20 @@
1
+ {
2
+ "modules": [
3
+ { "dir": "src/modules" },
4
+ { "npm": "@salesforcedevs/dx-components" }
5
+ ],
6
+ "expose": [
7
+ "doc/amfReference",
8
+ "doc/breadcrumbs",
9
+ "doc/content",
10
+ "doc/contentCallout",
11
+ "doc/contentLayout",
12
+ "doc/contentMedia",
13
+ "doc/docXmlContent",
14
+ "doc/header",
15
+ "doc/heading",
16
+ "doc/headingAnchor",
17
+ "doc/phase",
18
+ "doc/xmlContent"
19
+ ]
20
+ }
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@salesforcedevs/docs-components",
3
+ "version": "0.0.0",
4
+ "description": "Docs Lightning web components for DSC",
5
+ "license": "MIT",
6
+ "main": "index.js",
7
+ "engines": {
8
+ "node": ">= 14.x"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "dependencies": {
14
+ "@api-components/amf-helper-mixin": "^4.5.17",
15
+ "classnames": "^2.2.6",
16
+ "kagekiri": "^1.4.1",
17
+ "lodash.orderby": "^4.6.0",
18
+ "lodash.uniqby": "^4.7.0",
19
+ "query-string": "^7.1.1",
20
+ "sentence-case": "^3.0.4"
21
+ },
22
+ "devDependencies": {
23
+ "@types/classnames": "^2.2.10",
24
+ "@types/lodash.orderby": "^4.6.7",
25
+ "@types/lodash.uniqby": "^4.7.7"
26
+ },
27
+ "gitHead": "28224ddff4bbcb00044ecca05aea6f6511b4eccc"
28
+ }
@@ -0,0 +1,41 @@
1
+ ## AMF Reference
2
+
3
+ AMF refers to MuleSoft’s AML Modeling Framework for modeling documentation and it’s metadata. In this context, AMF is leveraged to parse and normalize API documentation from varying sources and formats, to one format which is the AMF file. We then leverage HTML Web Components created by MuleSoft to render this API documentation by passing it the generated AMF. These HTML Web Components may be referred to as API Console components, ARC (advanced rest components) components, or api documentation components (for the npm package).
4
+
5
+ Ref:
6
+ https://a.ml/docs/amf/
7
+ https://github.com/aml-org/amf
8
+
9
+ ## AMF Reference Component
10
+
11
+ _Components:_ doc-amf-reference, apihub-amf-topic
12
+
13
+ The AMF Reference Component is a LWC component defined within the developer website’s theme. This component is rendered on the API Reference pages.
14
+
15
+ Ref: https://github.com/salesforcedevs/developer-website/tree/main/theme/src/modules/apihub
16
+
17
+ This component takes as input a list of JSON metadata containing the URL information of the reference spec data files. This JSON configuration is generated for each writer repository that contains reference content, and is generated by the SFDocs framework.
18
+
19
+ This component
20
+
21
+ - Takes as input the reference data files (as AMF JSON)
22
+ - Parses the AML data into a model
23
+ - Plugs the model into the ARC components to surface documentation content
24
+ - Handles navigation events to browse the content
25
+
26
+ ### AMF Parser
27
+
28
+ Ref: https://github.com/salesforcedevs/developer-website/blob/main/theme/src/modules/apihub/amfReference/amf-parser.js
29
+
30
+ This class parses the AMF JSON data for one spec and extrapolates the data specific to rendering sections of that specs topic documentation.
31
+
32
+ The parsed data includes:
33
+
34
+ - Title
35
+ - Topics:
36
+ - Summary
37
+ - Endpoints
38
+ - Methods
39
+ - Types
40
+ - Docs
41
+ - Security
@@ -0,0 +1,5 @@
1
+ @import "docHelpers/phaseContentLayout";
2
+
3
+ .version-picker {
4
+ margin-left: auto;
5
+ }
@@ -0,0 +1,47 @@
1
+ <template>
2
+ <doc-content-layout
3
+ use-old-sidebar={useOldSidebar}
4
+ class="content-type content-type-reference"
5
+ coveo-organization-id={coveoOrganizationId}
6
+ coveo-public-access-token={coveoPublicAccessToken}
7
+ coveo-search-hub={coveoSearchHub}
8
+ coveo-advanced-query-config={coveoAdvancedQueryConfig}
9
+ breadcrumbs={breadcrumbs}
10
+ sidebar-header={sidebarHeader}
11
+ sidebar-value={selectedSidebarValue}
12
+ sidebar-content={navigation}
13
+ onselect={onNavSelect}
14
+ onexpandcollapse={onExpandCollapse}
15
+ toc-title={tocTitle}
16
+ toc-options={tocOptions}
17
+ enable-slot-change="true"
18
+ >
19
+ <div slot="doc-phase" if:true={docPhaseInfo} class="doc-phase-wrapper">
20
+ <doc-phase doc-phase-info={docPhaseInfo}></doc-phase>
21
+ </div>
22
+ <div slot="sidebar-header" class="version-picker">
23
+ <template if:true={isVersionEnabled}>
24
+ <dx-dropdown
25
+ suppress-gtm-nav-headings
26
+ onchange={handleVersionChange}
27
+ data-type="version"
28
+ options={versions}
29
+ value={selectedVersion.id}
30
+ width="290px"
31
+ >
32
+ <dx-button variant="inline">{selectedVersion.id}</dx-button>
33
+ </dx-dropdown>
34
+ </template>
35
+ </div>
36
+ <template if:false={showSpecBasedReference}>
37
+ <slot></slot>
38
+ </template>
39
+ <template if:true={showSpecBasedReference}>
40
+ <div class="container">
41
+ <div class="api-documentation">
42
+ <doc-amf-topic model={topicModel}></doc-amf-topic>
43
+ </div>
44
+ </div>
45
+ </template>
46
+ </doc-content-layout>
47
+ </template>