@salesforcedevs/docs-components 1.2.22-alpha → 1.3.4-alpha

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 (73) hide show
  1. package/lwc.config.json +10 -2
  2. package/package.json +12 -12
  3. package/src/modules/doc/{amfReference/utils.ts → amfModelParser/amfModelParser.ts} +10 -5
  4. package/src/modules/doc/amfReference/amfReference.css +23 -3
  5. package/src/modules/doc/amfReference/amfReference.html +34 -21
  6. package/src/modules/doc/amfReference/amfReference.ts +225 -92
  7. package/src/modules/doc/amfReference/types.ts +3 -11
  8. package/src/modules/doc/amfTopic/amfTopic.css +20 -0
  9. package/src/modules/doc/amfTopic/amfTopic.ts +35 -18
  10. package/src/modules/doc/amfTopic/types.ts +15 -13
  11. package/src/modules/doc/amfTopic/utils.ts +12 -6
  12. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +17 -10
  13. package/src/modules/doc/breadcrumbs/breadcrumbs.html +7 -9
  14. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +30 -34
  15. package/src/modules/doc/componentPlayground/componentPlayground.css +22 -0
  16. package/src/modules/doc/componentPlayground/componentPlayground.html +15 -0
  17. package/src/modules/doc/componentPlayground/componentPlayground.ts +20 -0
  18. package/src/modules/doc/content/content.css +70 -76
  19. package/src/modules/doc/content/content.ts +18 -14
  20. package/src/modules/doc/contentCallout/contentCallout.css +12 -1
  21. package/src/modules/doc/contentCallout/contentCallout.html +11 -4
  22. package/src/modules/doc/contentCallout/contentCallout.ts +8 -1
  23. package/src/modules/doc/contentLayout/contentLayout.css +1 -98
  24. package/src/modules/doc/contentLayout/contentLayout.html +25 -11
  25. package/src/modules/doc/contentLayout/contentLayout.ts +296 -89
  26. package/src/modules/doc/doDont/doDont.css +47 -0
  27. package/src/modules/doc/doDont/doDont.html +27 -0
  28. package/src/modules/doc/doDont/doDont.ts +17 -0
  29. package/src/modules/doc/header/header.css +65 -36
  30. package/src/modules/doc/header/header.html +40 -139
  31. package/src/modules/doc/header/header.ts +32 -77
  32. package/src/modules/doc/heading/heading.css +16 -37
  33. package/src/modules/doc/heading/heading.html +4 -4
  34. package/src/modules/doc/heading/heading.ts +12 -10
  35. package/src/modules/doc/headingAnchor/headingAnchor.css +2 -2
  36. package/src/modules/doc/headingAnchor/headingAnchor.ts +2 -2
  37. package/src/modules/doc/headingContent/headingContent.css +1 -1
  38. package/src/modules/doc/headingContent/headingContent.html +2 -2
  39. package/src/modules/doc/headingContent/headingContent.ts +2 -2
  40. package/src/modules/doc/lwcContentLayout/lwcContentLayout.css +1 -0
  41. package/src/modules/doc/lwcContentLayout/lwcContentLayout.html +64 -0
  42. package/src/modules/doc/lwcContentLayout/lwcContentLayout.ts +168 -0
  43. package/src/modules/doc/overview/overview.css +40 -0
  44. package/src/modules/doc/overview/overview.html +34 -0
  45. package/src/modules/doc/overview/overview.ts +12 -0
  46. package/src/modules/doc/phase/phase.css +18 -3
  47. package/src/modules/doc/phase/phase.html +12 -2
  48. package/src/modules/doc/phase/phase.ts +44 -8
  49. package/src/modules/doc/specificationContent/specificationContent.css +31 -0
  50. package/src/modules/doc/specificationContent/specificationContent.html +164 -0
  51. package/src/modules/doc/specificationContent/specificationContent.ts +114 -0
  52. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  53. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  54. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  55. package/src/modules/doc/toc/toc.html +1 -3
  56. package/src/modules/doc/toc/toc.ts +1 -1
  57. package/src/modules/doc/toolbar/toolbar.ts +6 -6
  58. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  59. package/src/modules/doc/versionPicker/versionPicker.html +38 -0
  60. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  61. package/src/modules/doc/xmlContent/types.ts +9 -3
  62. package/src/modules/doc/xmlContent/utils.ts +3 -1
  63. package/src/modules/doc/xmlContent/xmlContent.css +25 -3
  64. package/src/modules/doc/xmlContent/xmlContent.html +29 -17
  65. package/src/modules/doc/xmlContent/xmlContent.ts +186 -74
  66. package/src/modules/docHelpers/amfStyle/amfStyle.css +6 -6
  67. package/src/modules/docHelpers/contentLayoutStyle/contentLayoutStyle.css +131 -0
  68. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  69. package/src/modules/docHelpers/status/status.css +1 -1
  70. package/src/modules/docUtils/{SearchSyncer/SearchSyncer.ts → searchSyncer/searchSyncer.ts} +1 -0
  71. package/src/modules/docUtils/utils/utils.ts +32 -0
  72. package/src/modules/docBaseElements/lightningElementWithState/lightningElementWithState.ts +0 -93
  73. package/src/modules/docHelpers/phaseContentLayout/phaseContentLayout.css +0 -39
@@ -0,0 +1,131 @@
1
+ :host {
2
+ --dx-c-content-vertical-spacing: var(--dx-g-spacing-lg);
3
+ --dx-c-content-sidebar-sticky-top: calc(
4
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
5
+ );
6
+ --dx-c-sidebar-height: calc(
7
+ 100vh -
8
+ calc(
9
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height)
10
+ )
11
+ );
12
+ --dx-c-content-scroll-margin-top: calc(
13
+ var(--dx-g-global-header-height) + var(--dx-g-doc-header-height) +
14
+ var(--dx-g-spacing-2xl)
15
+ );
16
+
17
+ display: block;
18
+ }
19
+
20
+ doc-breadcrumbs {
21
+ --dx-c-popover-z-index: 5;
22
+
23
+ display: block;
24
+ margin-bottom: var(--dx-g-spacing-2xl);
25
+ }
26
+
27
+ dx-sidebar,
28
+ dx-sidebar-old {
29
+ --dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
30
+
31
+ z-index: calc(var(--dx-g-z-index-100) + 5);
32
+ }
33
+
34
+ dx-toc {
35
+ --dx-c-toc-width: unset;
36
+
37
+ height: calc(100% - var(--dx-c-content-vertical-spacing) * 2);
38
+ margin: var(--dx-c-content-vertical-spacing) 0;
39
+ overflow-y: auto;
40
+ }
41
+
42
+ dx-sidebar,
43
+ dx-toc {
44
+ display: block;
45
+ }
46
+
47
+ /* offset page jump link due to fixed header */
48
+ ::slotted(doc-heading) {
49
+ scroll-margin-top: var(--dx-c-content-scroll-margin-top);
50
+ }
51
+
52
+ .content {
53
+ display: flex;
54
+ position: relative;
55
+ }
56
+
57
+ .content-body-doc-phase-container {
58
+ flex: 1;
59
+ border-left: 1px solid var(--dx-g-gray-90);
60
+ }
61
+
62
+ .content-body-container {
63
+ display: flex;
64
+ flex-direction: row;
65
+ justify-content: center;
66
+ max-width: var(--dx-g-doc-content-max-width);
67
+
68
+ /* Derived this manually by substracting (topHeader, doc header, banner and the content). */
69
+ min-height: 62vh;
70
+ margin: auto;
71
+ padding: 0 var(--dx-g-global-header-padding-horizontal);
72
+ margin-bottom: calc(2 * (var(--dx-g-spacing-5xl) + 4px));
73
+ }
74
+
75
+ .content-body {
76
+ margin: var(--dx-g-spacing-md) 0 0;
77
+ max-width: 900px;
78
+ flex: 1;
79
+ width: 0;
80
+ }
81
+
82
+ .is-sticky {
83
+ align-self: flex-start;
84
+ position: sticky;
85
+ top: var(--dx-c-content-sidebar-sticky-top);
86
+ }
87
+
88
+ .right-nav-bar {
89
+ margin-left: var(--dx-g-spacing-2xl);
90
+ }
91
+
92
+ @media screen and (max-width: 1024px) {
93
+ .right-nav-bar {
94
+ display: none;
95
+ }
96
+ }
97
+
98
+ @media screen and (max-width: 800px) {
99
+ .content-body {
100
+ margin-top: var(--dx-c-content-vertical-spacing);
101
+ }
102
+
103
+ .content-body-doc-phase-container {
104
+ border-left: 0;
105
+ }
106
+ }
107
+
108
+ @media screen and (max-width: 768px) {
109
+ .is-sticky {
110
+ width: 100%;
111
+ }
112
+
113
+ .content {
114
+ flex-direction: column;
115
+ }
116
+
117
+ .content-body-container {
118
+ padding-right: 0;
119
+ overflow-x: auto;
120
+ margin-bottom: calc(var(--dx-g-spacing-5xl) + 4px);
121
+ }
122
+
123
+ .left-nav-bar {
124
+ height: unset;
125
+ }
126
+
127
+ .content-body {
128
+ margin-left: var(--dx-g-spacing-mlg, 20px);
129
+ margin-right: var(--dx-g-spacing-mlg, 20px);
130
+ }
131
+ }
@@ -0,0 +1,59 @@
1
+ img.content-image {
2
+ height: auto;
3
+ display: unset;
4
+ }
5
+
6
+ .image-framed {
7
+ border: 1px solid black;
8
+ }
9
+
10
+ .image-xxl,
11
+ .image-full {
12
+ max-width: 1000px;
13
+ width: 100%;
14
+ }
15
+
16
+ .image-xl {
17
+ max-width: 750px;
18
+ width: 100%;
19
+ }
20
+
21
+ .image-lg {
22
+ max-width: 660px;
23
+ width: 100%;
24
+ }
25
+
26
+ .image-md {
27
+ max-width: 500px;
28
+ width: 100%;
29
+ }
30
+
31
+ .image-sm {
32
+ max-width: 330px;
33
+ width: 100%;
34
+ }
35
+
36
+ .image-xs {
37
+ max-width: 250px;
38
+ width: 100%;
39
+ }
40
+
41
+ .image-xxs {
42
+ max-width: 125px;
43
+ width: 100%;
44
+ }
45
+
46
+ .image-icon-lg {
47
+ max-width: 32px;
48
+ width: 100%;
49
+ }
50
+
51
+ .image-icon-md {
52
+ max-width: 20px;
53
+ width: 100%;
54
+ }
55
+
56
+ .image-icon-sm {
57
+ max-width: 16px;
58
+ width: 100%;
59
+ }
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .doc-status-container {
12
- background-color: rgb(254, 243, 217);
12
+ background-color: rgb(253 252 247);
13
13
  border-color: var(--dx-g-yellow-vibrant-80);
14
14
  }
15
15
 
@@ -47,6 +47,7 @@ export class SearchSyncer {
47
47
  this.handleSearchChange
48
48
  );
49
49
  this.target.removeEventListener("popstate", this.handlePopState);
50
+ // @ts-ignore
50
51
  this.target = undefined;
51
52
  this.callbacks.onSearchChange = undefined;
52
53
  this.callbacks.onUrlChange = undefined;
@@ -0,0 +1,32 @@
1
+ import { CoveoAnalyticsClient } from "coveo.analytics";
2
+
3
+ export const oldVersionDocInfo = (latestVersionLink: string) => {
4
+ return {
5
+ title: "Newer Version Available",
6
+ body: `This content describes an older version of this product.
7
+ <a style="font-weight: bold;" href="${latestVersionLink}">View Latest</a>`
8
+ };
9
+ };
10
+
11
+ export function logCoveoPageView(
12
+ coveoOrganizationId: string | undefined,
13
+ coveoAnalyticsToken: string | undefined
14
+ ) {
15
+ if (coveoOrganizationId && coveoAnalyticsToken) {
16
+ const ua = new CoveoAnalyticsClient({
17
+ token: coveoAnalyticsToken,
18
+ endpoint: `https://${coveoOrganizationId}.analytics.org.coveo.com`
19
+ });
20
+ const pathParts = window.location.pathname.split("/");
21
+ let contentType;
22
+ if (pathParts.length >= 2) {
23
+ contentType = pathParts[1];
24
+ }
25
+
26
+ ua.sendViewEvent({
27
+ contentIdKey: "@clickableuri",
28
+ contentType: contentType,
29
+ contentIdValue: window.location.href
30
+ });
31
+ }
32
+ }
@@ -1,93 +0,0 @@
1
- import { LightningElement, track } from "lwc";
2
-
3
- /**
4
- * This is a helper class for when you want your LWC component to have state
5
- * that is automatically tracked _along with_ its previous state, in a React-
6
- * like fashion, so that you can compare current state with previous state
7
- * after a render (like React's `commponentDidUpdate`). One benefit of doing
8
- * things this way is that you can put all of your reactions to state changes
9
- * in one place, in `renderedCallback`, rather than having them in various
10
- * places throughout the component.
11
- *
12
- * The API consists in `this.prevState`, `this.state`, and `this.setState`.
13
- *
14
- * Usage:
15
- *
16
- * ```
17
- * type MyState = {
18
- * isFetchingContent: boolean;
19
- * };
20
- *
21
- * class MyFetchingComponent extends LightningElementWithState<MyState> {
22
- * constructor() {
23
- * // `this.state` can only be initialized once
24
- * this.state = {
25
- * isFetchingContent: false
26
- * };
27
- * }
28
- *
29
- * // Queued for execution whenever a `setState` call completes
30
- * renderedCallback() {
31
- * if (this.prevState.isFetchingContent && !this.state.isFetchingContent) {
32
- * // Do something knowing that we just finished fetching.
33
- * notifyFetchSuccessful();
34
- * }
35
- * }
36
- *
37
- * fetchSomething() {
38
- * this.setState({
39
- * isFetchingContent: true
40
- * });
41
- *
42
- * fetch(whatever).then(() => {
43
- * this.setState({
44
- * isFetching: false
45
- * }
46
- * });
47
- * }
48
- * }
49
- * ```
50
- */
51
- export abstract class LightningElementWithState<
52
- T extends { [key: string]: unknown }
53
- > extends LightningElement {
54
- private _prevState = {} as T;
55
- @track private _state = {} as T;
56
-
57
- private _didInitializeState = false;
58
-
59
- protected get prevState(): T {
60
- return Object.freeze({
61
- ...this._prevState
62
- });
63
- }
64
-
65
- protected get state(): T {
66
- return Object.freeze({
67
- ...this._state
68
- });
69
- }
70
-
71
- protected set state(initialState: T) {
72
- if (!this._didInitializeState) {
73
- this._state = {
74
- ...initialState
75
- };
76
- this._didInitializeState = true;
77
- } else {
78
- throw new Error(
79
- "To mutate state after initialization, use `this.setState`."
80
- );
81
- }
82
- }
83
-
84
- protected setState = (state: Partial<T>): void => {
85
- this._prevState = {
86
- ...this._state
87
- };
88
- this._state = {
89
- ...this._state,
90
- ...state
91
- };
92
- };
93
- }
@@ -1,39 +0,0 @@
1
- doc-phase::part(container) {
2
- margin-bottom: var(--dx-g-spacing-sm);
3
- padding-left: var(--dx-g-spacing-mlg);
4
- padding-right: var(--dx-g-spacing-lg);
5
- width: auto;
6
- }
7
-
8
- .doc-phase-wrapper {
9
- position: sticky;
10
- top: 0;
11
- z-index: 4;
12
- }
13
-
14
- @media screen and (max-width: 800px) {
15
- doc-phase::part(container) {
16
- margin-bottom: 0;
17
- }
18
- }
19
-
20
- @media screen and (min-width: 1024px) and (max-width: 1496px) {
21
- doc-phase::part(container) {
22
- padding-right: var(--dx-g-spacing-3xl);
23
- }
24
- }
25
-
26
- @media screen and (min-width: 1496px) {
27
- doc-phase::part(container) {
28
- margin-right: calc(
29
- var(--dx-g-page-padding-horizontal) - var(--dx-g-spacing-lg)
30
- );
31
- }
32
- }
33
-
34
- @media screen and (max-width: 768px) {
35
- /* We are giving top value because there is one more sticky item(lnb) with height 40px */
36
- .doc-phase-wrapper {
37
- top: 40px;
38
- }
39
- }