@salesforcedevs/docs-components 0.7.0 → 0.7.59-sppage-alpha1

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 (102) hide show
  1. package/lwc.config.json +17 -3
  2. package/package.json +16 -6
  3. package/src/modules/README.md +41 -0
  4. package/src/modules/doc/amfModelParser/amfModelParser.ts +674 -0
  5. package/src/modules/doc/amfReference/amfReference.css +25 -0
  6. package/src/modules/doc/amfReference/amfReference.html +60 -0
  7. package/src/modules/doc/amfReference/amfReference.ts +1494 -0
  8. package/src/modules/doc/amfReference/constants.ts +76 -0
  9. package/src/modules/doc/amfReference/types.ts +125 -0
  10. package/src/modules/doc/amfTopic/amfTopic.css +21 -0
  11. package/src/modules/doc/amfTopic/amfTopic.html +3 -0
  12. package/src/modules/doc/amfTopic/amfTopic.ts +111 -0
  13. package/src/modules/doc/amfTopic/types.ts +56 -0
  14. package/src/modules/doc/amfTopic/utils.ts +136 -0
  15. package/src/modules/doc/breadcrumbItem/breadcrumbItem.css +51 -0
  16. package/src/modules/doc/breadcrumbItem/breadcrumbItem.html +5 -0
  17. package/src/modules/doc/breadcrumbItem/breadcrumbItem.ts +71 -0
  18. package/src/modules/doc/breadcrumbs/breadcrumbs.css +27 -0
  19. package/src/modules/doc/breadcrumbs/breadcrumbs.html +58 -0
  20. package/src/modules/doc/breadcrumbs/breadcrumbs.ts +192 -0
  21. package/src/modules/doc/content/content.css +94 -70
  22. package/src/modules/doc/content/content.ts +233 -169
  23. package/src/modules/doc/contentCallout/contentCallout.css +17 -23
  24. package/src/modules/doc/contentCallout/contentCallout.html +13 -4
  25. package/src/modules/doc/contentCallout/contentCallout.ts +16 -3
  26. package/src/modules/doc/contentLayout/contentLayout.css +131 -0
  27. package/src/modules/doc/contentLayout/contentLayout.html +64 -0
  28. package/src/modules/doc/contentLayout/contentLayout.ts +610 -0
  29. package/src/modules/doc/doDont/doDont.css +47 -0
  30. package/src/modules/doc/doDont/doDont.html +27 -0
  31. package/src/modules/doc/doDont/doDont.ts +17 -0
  32. package/src/modules/doc/header/header.css +70 -37
  33. package/src/modules/doc/header/header.html +40 -135
  34. package/src/modules/doc/header/header.ts +29 -78
  35. package/src/modules/doc/heading/heading.css +33 -0
  36. package/src/modules/doc/heading/heading.html +14 -0
  37. package/src/modules/doc/heading/heading.ts +67 -0
  38. package/src/modules/doc/headingAnchor/headingAnchor.css +33 -0
  39. package/src/modules/doc/headingAnchor/headingAnchor.html +19 -0
  40. package/src/modules/doc/headingAnchor/headingAnchor.ts +43 -0
  41. package/src/modules/doc/headingContent/headingContent.css +53 -0
  42. package/src/modules/doc/headingContent/headingContent.html +13 -0
  43. package/src/modules/doc/headingContent/headingContent.ts +30 -0
  44. package/src/modules/doc/overview/overview.css +40 -0
  45. package/src/modules/doc/overview/overview.html +34 -0
  46. package/src/modules/doc/overview/overview.ts +12 -0
  47. package/src/modules/doc/phase/phase.css +70 -0
  48. package/src/modules/doc/phase/phase.html +38 -0
  49. package/src/modules/doc/phase/phase.ts +93 -0
  50. package/src/modules/doc/specificationContent/specificationContent.css +3 -0
  51. package/src/modules/doc/specificationContent/specificationContent.html +99 -0
  52. package/src/modules/doc/specificationContent/specificationContent.ts +56 -0
  53. package/src/modules/doc/sprigSurvey/sprigSurvey.html +20 -0
  54. package/src/modules/doc/sprigSurvey/sprigSurvey.scoped.css +16 -0
  55. package/src/modules/doc/sprigSurvey/sprigSurvey.ts +16 -0
  56. package/src/modules/doc/toc/toc.ts +1 -1
  57. package/src/modules/doc/versionPicker/versionPicker.css +64 -0
  58. package/src/modules/doc/versionPicker/versionPicker.html +38 -0
  59. package/src/modules/doc/versionPicker/versionPicker.ts +65 -0
  60. package/src/modules/doc/xmlContent/types.ts +120 -0
  61. package/src/modules/doc/xmlContent/utils.ts +163 -0
  62. package/src/modules/doc/xmlContent/xmlContent.css +54 -0
  63. package/src/modules/doc/xmlContent/xmlContent.html +52 -0
  64. package/src/modules/doc/xmlContent/xmlContent.ts +780 -0
  65. package/src/modules/docHelpers/amfStyle/amfStyle.css +355 -0
  66. package/src/modules/docHelpers/imgStyle/imgStyle.css +59 -0
  67. package/src/modules/docHelpers/status/status.css +22 -0
  68. package/src/modules/docUtils/searchSyncer/searchSyncer.ts +86 -0
  69. package/src/modules/docUtils/utils/utils.ts +32 -0
  70. package/LICENSE +0 -12
  71. package/src/modules/doc/content/__tests__/content.test.ts +0 -120
  72. package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -292
  73. package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
  74. package/src/modules/doc/content/content.stories.ts +0 -108
  75. package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
  76. package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
  77. package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
  78. package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -97
  79. package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
  80. package/src/modules/doc/header/__tests__/coveoConfig.ts +0 -12
  81. package/src/modules/doc/header/__tests__/header.test.ts +0 -434
  82. package/src/modules/doc/header/__tests__/mockNavDevelopers.ts +0 -427
  83. package/src/modules/doc/header/__tests__/mockNavs.ts +0 -115
  84. package/src/modules/doc/header/__tests__/mockProps.ts +0 -149
  85. package/src/modules/doc/header/header.stories.ts +0 -160
  86. package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
  87. package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
  88. package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
  89. package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
  90. package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
  91. package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
  92. package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
  93. package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
  94. package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
  95. package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
  96. package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
  97. package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
  98. package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
  99. package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
  100. package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
  101. package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
  102. package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
@@ -1,292 +0,0 @@
1
- export const content = `<div><a name='apex_dev_guide'><!-- --></a><h1 class='helpHead1'>Apex Developer Guide</h1><div class='shortdesc'>Salesforce has changed the way organizations do business by moving enterprise
2
- applications that were traditionally client-server-based into the Lightning Platform, an
3
- on-demand, multitenant Web environment. This environment enables you to run and customize
4
- applications, such as Salesforce Automation and Service &amp; Support, and build new custom
5
- applications based on particular business needs. </div><div id='sfdc:seealso' class='related-links'>
6
- <ul class='ullinks'>
7
- <li class='link ulchildlink'>
8
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_intro_get_started.htm'>Getting Started with Apex</a></strong><br>
9
- Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server, in conjunction with calls to the API.</li>
10
- <li class='link ulchildlink'>
11
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_writing.htm'>Writing Apex</a></strong><br>
12
- Apex is like Java for Salesforce. It enables you to add and interact with data in the Lightning Platform persistence layer. It uses classes, data types, variables, and if-else statements. You can make it execute based on a condition, or have a block of code execute repeatedly.</li>
13
- <li class='link ulchildlink'>
14
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_running.htm'>Running Apex</a></strong><br>
15
- You can access many features of the Salesforce user interface programmatically in Apex, and you can integrate with external SOAP and REST Web services. You can run Apex code using a variety of mechanisms. Apex code runs in atomic transactions. </li>
16
- <li class='link ulchildlink'>
17
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_debug_test_deploy.htm'>Debugging, Testing, and Deploying Apex</a></strong><br>
18
- Develop your Apex code in a sandbox and debug it with the Developer Console and debug logs. Unit-test your code, then distribute it to customers using packages.</li>
19
- <li class='link ulchildlink'>
20
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_reference.htm'>Apex Language Reference</a></strong><br>
21
- This Apex reference goes into detail about DML statements and the built-in Apex classes and interfaces.</li>
22
- <li class='link ulchildlink'>
23
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_appendices.htm'>Appendices</a></strong><br>
24
- </li>
25
- <li class='link ulchildlink'>
26
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/glossary_apex.htm'>Glossary</a></strong><br>
27
- </li>
28
- </ul>
29
- </div><!--DRC 228.7--></div>`;
30
-
31
- export const withButtons = `<div><a name='apex_dev_guide'><!-- --></a><h1 class='helpHead1'>Apex Developer Guide</h1><div class='shortdesc'>Salesforce has changed the way organizations do business by moving enterprise
32
- applications that were traditionally client-server-based into the Lightning Platform, an
33
- on-demand, multitenant Web environment. This environment enables you to run and customize
34
- applications, such as Salesforce Automation and Service &amp; Support, and build new custom
35
- applications based on particular business needs. </div><div id='sfdc:seealso' class='related-links'>
36
- <ul class='ullinks'>
37
- <li class='link ulchildlink'>
38
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_intro_get_started.htm'>Getting Started with Apex</a></strong><br>
39
- Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on the Lightning Platform server, in conjunction with calls to the API.</li>
40
- <li class='link ulchildlink'>
41
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_writing.htm'>Writing Apex</a></strong><br>
42
- Apex is like Java for Salesforce. It enables you to add and interact with data in the Lightning Platform persistence layer. It uses classes, data types, variables, and if-else statements. You can make it execute based on a condition, or have a block of code execute repeatedly.</li>
43
- <li class='link ulchildlink'>
44
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_running.htm'>Running Apex</a></strong><br>
45
- You can access many features of the Salesforce user interface programmatically in Apex, and you can integrate with external SOAP and REST Web services. You can run Apex code using a variety of mechanisms. Apex code runs in atomic transactions. </li>
46
- <li class='link ulchildlink'>
47
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_debug_test_deploy.htm'>Debugging, Testing, and Deploying Apex</a></strong><br>
48
- Develop your Apex code in a sandbox and debug it with the Developer Console and debug logs. Unit-test your code, then distribute it to customers using packages.</li>
49
- <li class='link ulchildlink'>
50
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_reference.htm'>Apex Language Reference</a></strong><br>
51
- This Apex reference goes into detail about DML statements and the built-in Apex classes and interfaces.</li>
52
- <li class='link ulchildlink'>
53
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/apex_appendices.htm'>Appendices</a></strong><br>
54
- </li>
55
- <li class='link ulchildlink'>
56
- <strong><a href='atlas.en-us.apexcode.meta/apexcode/glossary_apex.htm'>Glossary</a></strong><br>
57
- </li>
58
- <div style='display: flex; justify-content: space-between; width: 220px; margin-top: 15px;'>
59
- <a href='atlas.en-us.apexcode.meta/apexcode/glossary_apex.htm'>← Previous</a>
60
- <a href='atlas.en-us.apexcode.meta/apexcode/glossary_apex.htm'>Next →</a>
61
- </div>
62
- </ul>
63
- </div><!--DRC 228.7--></div>`;
64
-
65
- export const withImages = `<div>
66
- <div class='section'>
67
- <h2 class='helpHead2'>Sketch</h2>
68
-
69
- <p class='p'>
70
- The following diagram illustrates how Streaming API can be
71
- implemented to stream notifications to the Salesforce user
72
- interface. These notifications are triggered by record changes
73
- in Salesforce.
74
- </p>
75
-
76
- <div class='p'>
77
- <div class='fig fignone'>
78
- <span class='figcap'>
79
- UI Update in Salesforce Triggered by a Data Change
80
- </span>
81
-
82
- <img
83
- class='image'
84
- src='https://developer.salesforce.com/docs/resources/img/en-us/232.0?doc_id=dev_guides%2Fintegration_patterns%2Fimages%2Fui_updates_data_changes.png&amp;folder=integration_patterns_and_practices'
85
- alt='UI Update Based on Data Changes Pattern'
86
- />
87
- </div>
88
- </div>
89
- </div>
90
-
91
- <div class='section'>
92
- <h2 class='helpHead2'>Sketch</h2>
93
-
94
- <p class='p'>
95
- The following diagram illustrates how Streaming API can be
96
- implemented to stream notifications to the Salesforce user
97
- interface. These notifications are triggered by record changes
98
- in Salesforce.
99
- </p>
100
-
101
- <div class='p'>
102
- <div class='fig fignone'>
103
- <span class='figcap'>
104
- UI Update in Salesforce Triggered by a Data Change
105
- </span>
106
-
107
- <img
108
- class='image'
109
- src='https://developer.salesforce.com/docs/resources/img/en-us/232.0?doc_id=dev_guides%2Fintegration_patterns%2Fimages%2Fui_updates_data_changes.png&amp;folder=integration_patterns_and_practices'
110
- alt='UI Update Based on Data Changes Pattern'
111
- />
112
- </div>
113
- </div>
114
- </div>
115
-
116
- <div class='section'>
117
- <h2 class='helpHead2'>Sketch</h2>
118
-
119
- <p class='p'>
120
- The following diagram illustrates how Streaming API can be
121
- implemented to stream notifications to the Salesforce user
122
- interface. These notifications are triggered by record changes
123
- in Salesforce.
124
- </p>
125
-
126
- <div class='p'>
127
- <div class='fig fignone'>
128
- <span class='figcap'>
129
- UI Update in Salesforce Triggered by a Data Change
130
- </span>
131
-
132
- <img
133
- class='image'
134
- src='https://developer.salesforce.com/docs/resources/img/en-us/232.0?doc_id=dev_guides%2Fintegration_patterns%2Fimages%2Fui_updates_data_changes.png&amp;folder=integration_patterns_and_practices'
135
- alt='UI Update Based on Data Changes Pattern'
136
- />
137
- </div>
138
- </div>
139
- </div>
140
- </div>`;
141
-
142
- export const withTable = `<table>
143
- <thead>
144
- <tr>
145
- <th><strong>Parameter</strong></th>
146
- <th><strong>Required</strong></th>
147
- <th><strong>Description</strong></th>
148
- </tr>
149
- </thead>
150
- <tbody>
151
- <tr>
152
- <td><code>grant_type</code></td>
153
- <td>X</td>
154
- <td>The value must be password</td>
155
- </tr>
156
- <tr>
157
- <td><code>client_id</code></td>
158
- <td>X</td>
159
- <td>The consumer key</td>
160
- </tr>
161
- <tr>
162
- <td><code>client_secret</code></td>
163
- <td>X</td>
164
- <td>The consumer secret</td>
165
- </tr>
166
- <tr>
167
- <td><code>username</code></td>
168
- <td>X</td>
169
- <td>The email address of the SSO user account</td>
170
- </tr>
171
- <tr>
172
- <td><code>password</code></td>
173
- <td>X</td>
174
- <td>The password of the SSO user account</td>
175
- </tr>
176
- </tbody>
177
- </table>`;
178
-
179
- export const withVideos = `<div>
180
- <iframe src='https://play.vidyard.com/yThw736PBYf18ts1f8SKXa?disable_popouts=1&v=4.2.30&type=inline' title='Video title'></iframe>
181
- <iframe src='https://play.vidyard.com/yThw736PBYf18ts1f8SKXa?disable_popouts=1&v=4.2.30&type=inline' label='This is from a label'></iframe>
182
- </div>`;
183
-
184
- const noteWithTable = `<div class='box message info'>
185
- <h4>Note with a table</h4>
186
- <div class='data colSort'>
187
- <table class='featureTable sort_table' summary=''>
188
- <thead class='thead sorted' align='left'>
189
- <tr>
190
- <th class='featureTableHeader vertical-align-top ' id='d8672e193'>Organization Type</th>
191
- <th class='featureTableHeader vertical-align-top ' id='d8672e196'>Secure URL</th>
192
- </tr>
193
- </thead>
194
- <tbody class='tbody'>
195
- <tr>
196
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Developer Edition</td>
197
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
198
- class='keyword varname'>MyDomainName</var>-dev-ed.my.salesforce-sites.com</span>
199
- </td>
200
- </tr>
201
- <tr>
202
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Sandbox</td>
203
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
204
- class='keyword varname'>MyDomainName</var>--<var
205
- class='keyword varname'>SandboxName</var>.sandbox.my.salesforce-sites.com</span>
206
- </td>
207
- </tr>
208
- <tr>
209
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Production</td>
210
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
211
- class='keyword varname'>MyDomainName</var>.my.salesforce-sites.com</span></td>
212
- </tr>
213
- </tbody>
214
- </table>
215
- </div>
216
- </div>`;
217
-
218
- const noteWithOrderedList = `<div class='box message info'>
219
- <h4 class='mbs'>Note with ordered list</h4>
220
- <ol class='ol enumList'>
221
- <li class='li'>From Setup, enter <kbd class='ph userinput'>Apex Classes</kbd> in the <span
222
- class='keyword parmname'>Quick
223
- Find</span> box, then select <strong class='ph uicontrol'>Apex Classes</strong>.</li>
224
-
225
- <li class='li'>Click <strong class='ph uicontrol'>Edit</strong> next to SiteRegisterController.</li>
226
-
227
- <li class='li'>Find the <samp class='codeph apex_code'><span class='keyword'>private</span> <span
228
- class='keyword'>static</span> Id PORTAL_ACCOUNT_ID =
229
- <span class='string'>'&lt;Account_ID&gt;'</span>;</samp> line and insert the ID for the account that
230
- you want
231
- to
232
- associate with new users. The line should look similar to
233
- this:
234
- </li>
235
-
236
- <li class='li'>Click <strong class='ph uicontrol'>Save</strong>.</li>
237
- </ol>
238
- </div>`;
239
-
240
- const noteWithUnorderedList = `<div class='box message info'>
241
- <h4 class='mbs'>Note with unordered list</h4>
242
- <ul class='ul bulletList' id='static_resource_service_unavailable_page'>
243
- <li class='li'>Must be a public .zip file 1 MB or smaller.</li>
244
-
245
- <li class='li'>Must contain a page named <span class='ph filepath'>maintenance.html</span> at the root level
246
- of
247
- the .zip file. Other resources in the .zip file, such as images or CSS files, can follow
248
- any directory structure.</li>
249
- <li class='li'>Must contain only files that have file extensions.</li>
250
- </ul>
251
- </div>`;
252
-
253
- const noteWithCodeBlock = `<div class='box message info'>
254
- <div class='inner'>
255
- <div class='bd'>
256
- <div class='media'>
257
- <img class='img mtm'
258
- src='/docs/resources/img/en-us/232.0?doc_id=images%2Ficon_note.png&amp;folder=apexcode'
259
- alt='Note'>
260
- <div class='mediaBd'>
261
- <h4 class='mbs'>Note with code block</h4>
262
- <p><span class='ph' id='instanceof_change_part1'><a name='instanceof_change_part1'>
263
- <!-- --></a>In Apex saved with API version 32.0 and later,
264
- <samp class='codeph apex_code'><span class='statement'>instanceof</span></samp> returns
265
- <samp class='codeph apex_code'><span class='keyword'>false</span></samp> if the left
266
- operand is a null
267
- object. For
268
- example, the following sample returns <samp class='codeph apex_code'><span
269
- class='keyword'>false</span></samp>.
270
- </span></p>
271
- <div class='codeSection apex_code'>
272
- <pre class='codeblock brush:apex' id='instanceof_change_part2'><a name='instanceof_change_part2'><!-- --></a><span class='keyword'>Object</span> o = <span class='keyword'>null</span>;
273
- <span class='keyword'>Boolean</span> result = o <span class='statement'>instanceof</span> Account;
274
- System.assertEquals(<span class='keyword'>false</span>, result);</pre>
275
- </div>
276
- <span class='ph' id='instanceof_change_part3'><a name='instanceof_change_part3'>
277
- <!-- --></a>In API version 31.0 and earlier, <samp class='codeph apex_code'><span
278
- class='statement'>instanceof</span></samp> returns <samp
279
- class='codeph apex_code'><span class='keyword'>true</span></samp> in this case.</span>
280
- <p></p>
281
- </div>
282
- </div>
283
- </div>
284
- </div>
285
- </div>`;
286
-
287
- export const withNotes = `<div>
288
- ${noteWithTable}
289
- ${noteWithUnorderedList}
290
- ${noteWithOrderedList}
291
- ${noteWithCodeBlock}
292
- </div>`;
@@ -1,8 +0,0 @@
1
- export default {
2
- domain: "http://localhost:3000",
3
- page: "docs",
4
- docId: "atlas.en-us.apexcode.meta",
5
- deliverable: "apexcode",
6
- contentDocumentId: "apex_dev_guide.htm",
7
- hash: ""
8
- };
@@ -1,108 +0,0 @@
1
- import * as mockDocContent from "./__tests__/mockDocContent";
2
- import mockPageReference from "./__tests__/mockPageReference";
3
- import { html } from "lit-html";
4
-
5
- export default {
6
- title: "docs/doc-content",
7
- component: "doc-content",
8
-
9
- argTypes: {
10
- showPaginationButtons: {
11
- defaultValue: false,
12
- control: {
13
- type: "boolean"
14
- }
15
- }
16
- }
17
- };
18
-
19
- const defaultArgs = {
20
- pageReference: mockPageReference,
21
- isStorybook: true
22
- };
23
-
24
- export const Base = (args: any) => {
25
- return `
26
- <doc-content
27
- is-storybook="${args.isStorybook}"
28
- page-reference="${JSON.stringify(args.pageReference)}"
29
- docs-data="${args.docsData}"
30
- ></doc-content>`;
31
- };
32
-
33
- Base.args = {
34
- ...defaultArgs,
35
- docsData: mockDocContent.content
36
- };
37
-
38
- export const Images = (args: any) => {
39
- return `
40
- <doc-content
41
- is-storybook="${args.isStorybook}"
42
- page-reference="${JSON.stringify(args.pageReference)}"
43
- docs-data="${args.docsData}"
44
- ></doc-content>`;
45
- };
46
-
47
- Images.args = {
48
- ...defaultArgs,
49
- docsData: mockDocContent.withImages
50
- };
51
-
52
- export const Table = (args: any) => html`
53
- <doc-content
54
- is-storybook="${args.isStorybook}"
55
- page-reference="${JSON.stringify(args.pageReference)}"
56
- docs-data="${args.docsData}"
57
- >
58
- </doc-content>
59
- `;
60
-
61
- Table.args = {
62
- ...defaultArgs,
63
- docsData: mockDocContent.withTable
64
- };
65
-
66
- export const Videos = (args: any) => {
67
- return `
68
- <doc-content
69
- is-storybook="${args.isStorybook}"
70
- page-reference="${JSON.stringify(args.pageReference)}"
71
- docs-data="${args.docsData}"
72
- ></doc-content>`;
73
- };
74
-
75
- Videos.args = {
76
- ...defaultArgs,
77
- docsData: mockDocContent.withVideos
78
- };
79
-
80
- export const Notes = (args: any) => {
81
- return `
82
- <doc-content
83
- is-storybook="${args.isStorybook}"
84
- page-reference="${JSON.stringify(args.pageReference)}"
85
- docs-data="${args.docsData}"
86
- ></doc-content>`;
87
- };
88
-
89
- Notes.args = {
90
- ...defaultArgs,
91
- docsData: mockDocContent.withNotes
92
- };
93
-
94
- export const PaginationButtons = (args: any) => {
95
- return `
96
- <doc-content
97
- is-storybook="${args.isStorybook}"
98
- page-reference="${JSON.stringify(args.pageReference)}"
99
- docs-data="${args.docsData}"
100
- ${args.showPaginationButtons ? `show-pagination-buttons=true` : ``}
101
- ></doc-content>`;
102
- };
103
-
104
- PaginationButtons.args = {
105
- ...defaultArgs,
106
- showPaginationButtons: false,
107
- docsData: mockDocContent.withButtons
108
- };
@@ -1,80 +0,0 @@
1
- import ContentCallout from "../contentCallout";
2
- import { createRenderComponent } from "utils/tests";
3
- import mockProps from "./mockProps";
4
-
5
- const TAG = "dx-content-callout";
6
- const render = createRenderComponent(TAG, ContentCallout);
7
-
8
- describe(TAG, () => {
9
- it("renders the icon, title & body with the tip variant", async () => {
10
- const element = render({
11
- title: mockProps.title,
12
- variant: "tip"
13
- });
14
-
15
- const els = [
16
- ".dx-callout-icon",
17
- ".dx-callout-title",
18
- ".dx-callout-body",
19
- ".dx-callout-tip"
20
- ].map((query) => element.shadowRoot.querySelector(query));
21
-
22
- expect(els).not.toContain(null);
23
-
24
- await expect(element).toBeAccessible();
25
- });
26
-
27
- it("renders the icon, title & body with the warning variant", async () => {
28
- const element = render({
29
- title: mockProps.title,
30
- variant: "warning"
31
- });
32
-
33
- const els = [
34
- ".dx-callout-icon",
35
- ".dx-callout-title",
36
- ".dx-callout-body",
37
- ".dx-callout-warning"
38
- ].map((query) => element.shadowRoot.querySelector(query));
39
-
40
- expect(els).not.toContain(null);
41
-
42
- await expect(element).toBeAccessible();
43
- });
44
-
45
- it("renders the icon, title & body with the note variant", async () => {
46
- const element = render({
47
- title: mockProps.title,
48
- variant: "note"
49
- });
50
-
51
- const els = [
52
- ".dx-callout-icon",
53
- ".dx-callout-title",
54
- ".dx-callout-body",
55
- ".dx-callout-note"
56
- ].map((query) => element.shadowRoot.querySelector(query));
57
-
58
- expect(els).not.toContain(null);
59
-
60
- await expect(element).toBeAccessible();
61
- });
62
-
63
- it("renders the icon, title & body with the caution variant", async () => {
64
- const element = render({
65
- title: mockProps.title,
66
- variant: "caution"
67
- });
68
-
69
- const els = [
70
- ".dx-callout-icon",
71
- ".dx-callout-title",
72
- ".dx-callout-body",
73
- ".dx-callout-caution"
74
- ].map((query) => element.shadowRoot.querySelector(query));
75
-
76
- expect(els).not.toContain(null);
77
-
78
- await expect(element).toBeAccessible();
79
- });
80
- });
@@ -1,14 +0,0 @@
1
- export default {
2
- body: `<ul class="ul bulletList">
3
- <li class="li">Apex SOAP web services allow an external application to invoke Apex methods
4
- through SOAP Web services. <a class="xref" href="docs/atlas.en-us.226.0.apexcode.meta/apexcode/apex_callouts.htm" data-id="docs/atlas.en-us.226.0.apexcode.meta/apexcode/apex_callouts.htm">Apex callouts</a> enable Apex to invoke external web or HTTP
5
- services.</li>
6
-
7
- <li class="li">Apex REST API exposes your Apex classes and methods as REST web services. See
8
- <a class="xref" href="docs/atlas.en-us.226.0.apexcode.meta/apexcode/apex_rest.htm" title="You can expose your Apex classes and methods so that external applications can access your code and your application through the REST architecture." data-id="docs/atlas.en-us.226.0.apexcode.meta/apexcode/apex_rest.htm">Exposing Apex Classes as REST Web
9
- Services</a>.</li>
10
-
11
- </ul>`,
12
- title: "Caution",
13
- variant: "Caution"
14
- };
@@ -1,29 +0,0 @@
1
- import mockProps from "./__tests__/mockProps";
2
-
3
- export default {
4
- title: "docs/doc-content-callout",
5
- component: "doc-content-callout"
6
- };
7
-
8
- export const Base = (args: any) => `
9
- <style>
10
- doc-content-callout {
11
- display:block;
12
- margin-bottom:12px;
13
- }
14
- </style>
15
- <doc-content-callout title='Note'variant="note">
16
- ${args.body}
17
- </doc-content-callout>
18
- <doc-content-callout title='Tip'variant="tip">
19
- ${args.body}
20
- </doc-content-callout>
21
- <doc-content-callout title='Warning' variant="warning">
22
- ${args.body}
23
- </doc-content-callout>
24
- <doc-content-callout title='Caution' variant="caution">
25
- ${args.body}
26
- </doc-content-callout>
27
- `;
28
-
29
- Base.args = mockProps;
@@ -1,97 +0,0 @@
1
- import ContentMedia from "doc/contentMedia";
2
- import { createRenderComponent } from "utils/tests";
3
-
4
- const TAG = "doc-content-media";
5
- const render = createRenderComponent(TAG, ContentMedia);
6
-
7
- describe(TAG, () => {
8
- const originalConsole = global.console;
9
-
10
- beforeAll(() => {
11
- global.console = { ...global.console, error: jest.fn() };
12
- });
13
-
14
- afterEach(() => {
15
- jest.clearAllMocks();
16
- });
17
-
18
- afterAll(() => {
19
- global.console = originalConsole;
20
- });
21
-
22
- it("renders image with passed in props", () => {
23
- const element = render({
24
- mediaTitle: "test title",
25
- contentType: "image",
26
- contentSrc: "https://placekitten.com/400/300",
27
- caption: "test caption"
28
- });
29
-
30
- const title = element.shadowRoot.querySelector(".content-media-title");
31
- expect(title).not.toBeNull();
32
- expect(title.textContent).toBe("test title");
33
-
34
- const caption = element.shadowRoot.querySelector(
35
- ".content-media-caption"
36
- );
37
- expect(caption).not.toBeNull();
38
- expect(caption.textContent).toBe("test caption");
39
-
40
- const image = element.shadowRoot.querySelector(
41
- ".content-media-image img"
42
- );
43
- expect(image).not.toBeNull();
44
- expect(image.src).toBe("https://placekitten.com/400/300");
45
-
46
- return expect(element).toBeAccessible();
47
- });
48
-
49
- it("renders iframe with passed in props", () => {
50
- const element = render({
51
- mediaTitle: "test title",
52
- contentType: "iframe",
53
- contentSrc: "https://www.youtube.com/embed/DfV7WnyEPTE",
54
- caption: "test caption"
55
- });
56
-
57
- const title = element.shadowRoot.querySelector(".content-media-title");
58
- expect(title).not.toBeNull();
59
- expect(title.textContent).toBe("test title");
60
-
61
- const caption = element.shadowRoot.querySelector(
62
- ".content-media-caption"
63
- );
64
- expect(caption).not.toBeNull();
65
- expect(caption.textContent).toBe("test caption");
66
-
67
- const iframe = element.shadowRoot.querySelector(
68
- ".content-media-iframe iframe"
69
- );
70
- expect(iframe).not.toBeNull();
71
- expect(iframe.src).toBe("https://www.youtube.com/embed/DfV7WnyEPTE");
72
-
73
- return expect(element).toBeAccessible();
74
- });
75
-
76
- it("doesn't render title or caption when not provided", () => {
77
- const element = render({
78
- contentType: "iframe",
79
- contentSrc: "https://www.youtube.com/embed/DfV7WnyEPTE"
80
- });
81
-
82
- const title = element.shadowRoot.querySelector(".content-media-title");
83
- expect(title).toBeNull();
84
-
85
- const caption = element.shadowRoot.querySelector(
86
- ".content-media-caption"
87
- );
88
- expect(caption).toBeNull();
89
-
90
- expect(global.console.error).toBeCalledTimes(1);
91
- expect(global.console.error).toBeCalledWith(
92
- "media-title must be specified when using iframe-src attribute."
93
- );
94
-
95
- return expect(element).toBeAccessible();
96
- });
97
- });