@salesforcedevs/docs-components 0.22.0 → 0.26.0-alpha.2

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 (43) hide show
  1. package/package.json +2 -6
  2. package/src/modules/doc/header/header.css +5 -2
  3. package/src/modules/doc/header/header.html +1 -0
  4. package/src/modules/doc/header/header.ts +1 -1
  5. package/LICENSE +0 -12
  6. package/src/modules/doc/content/__tests__/content.test.ts +0 -312
  7. package/src/modules/doc/content/__tests__/mockDocContent.ts +0 -348
  8. package/src/modules/doc/content/__tests__/mockPageReference.ts +0 -8
  9. package/src/modules/doc/content/__tests__/mockSidebar.ts +0 -81
  10. package/src/modules/doc/content/content.stories.ts +0 -148
  11. package/src/modules/doc/contentCallout/__tests__/contentCallout.test.ts +0 -80
  12. package/src/modules/doc/contentCallout/__tests__/mockProps.ts +0 -14
  13. package/src/modules/doc/contentCallout/contentCallout.stories.ts +0 -29
  14. package/src/modules/doc/contentMedia/__tests__/contentMedia.test.ts +0 -93
  15. package/src/modules/doc/contentMedia/contentMedia.stories.ts +0 -113
  16. package/src/modules/doc/header/__tests__/coveoConfig.ts +0 -6
  17. package/src/modules/doc/header/__tests__/header.test.ts +0 -437
  18. package/src/modules/doc/header/__tests__/mockNavDevelopers.ts +0 -427
  19. package/src/modules/doc/header/__tests__/mockNavs.ts +0 -115
  20. package/src/modules/doc/header/__tests__/mockProps.ts +0 -152
  21. package/src/modules/doc/header/header.stories.ts +0 -190
  22. package/src/modules/doc/headingAnchor/__tests__/headingAnchor.test.ts +0 -110
  23. package/src/modules/doc/headingAnchor/headingAnchor.stories.ts +0 -33
  24. package/src/modules/doc/nav/__tests__/mockAvailableLanguages.ts +0 -8
  25. package/src/modules/doc/nav/__tests__/mockAvailableVersions.ts +0 -122
  26. package/src/modules/doc/nav/__tests__/mockPageReference.ts +0 -8
  27. package/src/modules/doc/nav/__tests__/mockPdfUrl.ts +0 -1
  28. package/src/modules/doc/nav/__tests__/mockSelectedLanguage.ts +0 -8
  29. package/src/modules/doc/nav/__tests__/mockSelectedVersion.ts +0 -8
  30. package/src/modules/doc/nav/__tests__/mockToc.ts +0 -146
  31. package/src/modules/doc/nav/__tests__/nav.test.ts +0 -58
  32. package/src/modules/doc/phase/__tests__/mockProps.ts +0 -13
  33. package/src/modules/doc/phase/__tests__/phase.test.ts +0 -60
  34. package/src/modules/doc/phase/phase.stories.ts +0 -12
  35. package/src/modules/doc/toc/__tests__/mockPageReference.ts +0 -8
  36. package/src/modules/doc/toc/__tests__/mockToc.ts +0 -146
  37. package/src/modules/doc/toc/__tests__/toc.test.ts +0 -29
  38. package/src/modules/doc/toolbar/__tests__/mockAvailableLanguages.ts +0 -8
  39. package/src/modules/doc/toolbar/__tests__/mockAvailableVersions.ts +0 -122
  40. package/src/modules/doc/toolbar/__tests__/mockPdfUrl.ts +0 -1
  41. package/src/modules/doc/toolbar/__tests__/mockSelectedLanguage.ts +0 -8
  42. package/src/modules/doc/toolbar/__tests__/mockSelectedVersion.ts +0 -8
  43. package/src/modules/doc/toolbar/__tests__/toolbar.test.ts +0 -44
@@ -1,348 +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
- <tr>
177
- <td><code>list</code></td>
178
- <td>X</td>
179
- <td class="with-list">
180
- The items in this list should not have larger text than normal:
181
- <ul>
182
- <li class="li">Item one</li>
183
- <li class="li">Item two</li>
184
- </ul>
185
- </td>
186
- </tr>
187
- <tr>
188
- <td><a href="#">link</a></td>
189
- <td>X</td>
190
- <td class="with-link-and-p">
191
- The link text should not be larger than normal.
192
- <p>Paragraph text should not be larger either.</p>
193
- </td>
194
- </tr>
195
- <tr>
196
- <td><code>callout</code></td>
197
- <td></td>
198
- <td class="with-callout">
199
- This callout should still have larger text:
200
- <doc-content-callout title="Callout test" variant="note">
201
- <p>The text here should *not* be the same size as other table text.</p>
202
- </doc-content-callout>
203
- </td>
204
- </tr>
205
- </tbody>
206
- </table>`;
207
-
208
- export const withVideos = `<div>
209
- <iframe src='https://play.vidyard.com/yThw736PBYf18ts1f8SKXa?disable_popouts=1&v=4.2.30&type=inline' title='Video title'></iframe>
210
- <iframe src='https://play.vidyard.com/yThw736PBYf18ts1f8SKXa?disable_popouts=1&v=4.2.30&type=inline' label='This is from a label'></iframe>
211
- </div>`;
212
-
213
- const noteWithTable = `<div class='box message info'>
214
- <h4>Note with a table</h4>
215
- <div class='data colSort'>
216
- <table class='featureTable sort_table' summary=''>
217
- <thead class='thead sorted' align='left'>
218
- <tr>
219
- <th class='featureTableHeader vertical-align-top ' id='d8672e193'>Organization Type</th>
220
- <th class='featureTableHeader vertical-align-top ' id='d8672e196'>Secure URL</th>
221
- </tr>
222
- </thead>
223
- <tbody class='tbody'>
224
- <tr>
225
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Developer Edition</td>
226
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
227
- class='keyword varname'>MyDomainName</var>-dev-ed.my.salesforce-sites.com</span>
228
- </td>
229
- </tr>
230
- <tr>
231
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Sandbox</td>
232
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
233
- class='keyword varname'>MyDomainName</var>--<var
234
- class='keyword varname'>SandboxName</var>.sandbox.my.salesforce-sites.com</span>
235
- </td>
236
- </tr>
237
- <tr>
238
- <td class='entry' headers='d8672e193' data-title='Organization Type'>Production</td>
239
- <td class='entry' headers='d8672e196' data-title='Secure URL'><span class='ph filepath'><var
240
- class='keyword varname'>MyDomainName</var>.my.salesforce-sites.com</span></td>
241
- </tr>
242
- </tbody>
243
- </table>
244
- </div>
245
- </div>`;
246
-
247
- const noteWithOrderedList = `<div class='box message info'>
248
- <h4 class='mbs'>Note with ordered list</h4>
249
- <ol class='ol enumList'>
250
- <li class='li'>From Setup, enter <kbd class='ph userinput'>Apex Classes</kbd> in the <span
251
- class='keyword parmname'>Quick
252
- Find</span> box, then select <strong class='ph uicontrol'>Apex Classes</strong>.</li>
253
-
254
- <li class='li'>Click <strong class='ph uicontrol'>Edit</strong> next to SiteRegisterController.</li>
255
-
256
- <li class='li'>Find the <samp class='codeph apex_code'><span class='keyword'>private</span> <span
257
- class='keyword'>static</span> Id PORTAL_ACCOUNT_ID =
258
- <span class='string'>'&lt;Account_ID&gt;'</span>;</samp> line and insert the ID for the account that
259
- you want
260
- to
261
- associate with new users. The line should look similar to
262
- this:
263
- </li>
264
-
265
- <li class='li'>Click <strong class='ph uicontrol'>Save</strong>.</li>
266
- </ol>
267
- </div>`;
268
-
269
- const noteWithUnorderedList = `<div class='box message info'>
270
- <h4 class='mbs'>Note with unordered list</h4>
271
- <ul class='ul bulletList' id='static_resource_service_unavailable_page'>
272
- <li class='li'>Must be a public .zip file 1 MB or smaller.</li>
273
-
274
- <li class='li'>Must contain a page named <span class='ph filepath'>maintenance.html</span> at the root level
275
- of
276
- the .zip file. Other resources in the .zip file, such as images or CSS files, can follow
277
- any directory structure.</li>
278
- <li class='li'>Must contain only files that have file extensions.</li>
279
- </ul>
280
- </div>`;
281
-
282
- const noteWithCodeBlock = `<div class='box message info'>
283
- <div class='inner'>
284
- <div class='bd'>
285
- <div class='media'>
286
- <img class='img mtm'
287
- src='/docs/resources/img/en-us/232.0?doc_id=images%2Ficon_note.png&amp;folder=apexcode'
288
- alt='Note'>
289
- <div class='mediaBd'>
290
- <h4 class='mbs'>Note with code block</h4>
291
- <p><span class='ph' id='instanceof_change_part1'><a name='instanceof_change_part1'>
292
- <!-- --></a>In Apex saved with API version 32.0 and later,
293
- <samp class='codeph apex_code'><span class='statement'>instanceof</span></samp> returns
294
- <samp class='codeph apex_code'><span class='keyword'>false</span></samp> if the left
295
- operand is a null
296
- object. For
297
- example, the following sample returns <samp class='codeph apex_code'><span
298
- class='keyword'>false</span></samp>.
299
- </span></p>
300
- <div class='codeSection apex_code'>
301
- <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>;
302
- <span class='keyword'>Boolean</span> result = o <span class='statement'>instanceof</span> Account;
303
- System.assertEquals(<span class='keyword'>false</span>, result);</pre>
304
- </div>
305
- <span class='ph' id='instanceof_change_part3'><a name='instanceof_change_part3'>
306
- <!-- --></a>In API version 31.0 and earlier, <samp class='codeph apex_code'><span
307
- class='statement'>instanceof</span></samp> returns <samp
308
- class='codeph apex_code'><span class='keyword'>true</span></samp> in this case.</span>
309
- <p></p>
310
- </div>
311
- </div>
312
- </div>
313
- </div>
314
- </div>`;
315
-
316
- export const sampleCodeBlockAndNote = `
317
- <h1 class='helpHead1'>Using the instanceof Keyword</h1>
318
- <p class="p">If you need to verify at run time whether an object is actually an instance of a particular class, use the
319
- <samp class="codeph apex_code"><span class="statement">instanceof</span></samp> keyword.
320
- The <samp class="codeph apex_code"><span class="statement">instanceof</span></samp> keyword can only be used to
321
- verify if the target type in the expression on the right of the keyword is a viable
322
- alternative for the declared type of the expression on the left.
323
- </p>
324
- <div class="p">You could add the following check to the <samp class="codeph apex_code">Report</samp>class in the <a class="xref" href="atlas.en-us.apexcode.meta/apexcode/apex_classes_casting.htm" title="In general, all type information is available at run time. This means that Apex enables casting, that is, a data type of one class can be assigned to a data type of another class, but only if one class is a subclass of the other class. Use casting when you want to convert an object from one data type to another.">classes and casting example</a> before you cast the item back into a <samp class="codeph apex_code">CustomReport</samp> object.
325
- <div class="codeSection apex_code">
326
- <pre class="codeblock brush:apex">If (Reports.get(0) <span class="statement">instanceof</span> CustomReport) {\n <span class="onelineComment">// Can safely cast it back to a custom report object</span>\n CustomReport c = (CustomReport) Reports.get(0);\n} Else {\n <span class="onelineComment">// Do something with the non-custom-report.</span>\n}</pre>
327
- </div>
328
- </div>
329
- ${noteWithOrderedList}
330
- <div class="p">
331
- Follow these steps:
332
- <ol class="ol enumList">
333
- <li class="li">Add the data in a .csv file.</li>
334
- <li class="li">Create a static resource for this file.</li>
335
- <li class="li">
336
- Call <samp class="codeph apex_code">Test.loadData</samp> within your test
337
- method and passing it the sObject type token and the static resource name.
338
- </li>
339
- </ol>
340
- </div>
341
- `;
342
-
343
- export const withNotes = `<div>
344
- ${noteWithTable}
345
- ${noteWithUnorderedList}
346
- ${noteWithOrderedList}
347
- ${noteWithCodeBlock}
348
- </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,81 +0,0 @@
1
- export default [
2
- {
3
- label: "Getting started",
4
- name: "started",
5
- isExpanded: true,
6
- children: [
7
- {
8
- label: "Introduction",
9
- name: "introduction"
10
- },
11
- {
12
- label: "Getting started",
13
- name: "started-child"
14
- },
15
- {
16
- label: "Authentication",
17
- name: "authentication"
18
- },
19
- {
20
- label: "Token",
21
- name: "token"
22
- },
23
- {
24
- label: "Error",
25
- name: "error"
26
- },
27
- {
28
- label: "Limits",
29
- name: "limit"
30
- },
31
- {
32
- label: "Release note",
33
- name: "release-note"
34
- }
35
- ]
36
- },
37
- {
38
- label: "Einstein Vision",
39
- name: "einstein-vision",
40
- children: [
41
- {
42
- label: "Introduction",
43
- name: "einstein-introduction"
44
- },
45
- {
46
- label: "Terminology",
47
- name: "terminology"
48
- },
49
- {
50
- label: "Object detection quickstart for beginner",
51
- name: "object-quickstart",
52
- isExpanded: true,
53
- children: [
54
- {
55
- label: "Scenario: this block is intended to show how a large text looks like in the sidebar",
56
- name: "scenario",
57
- isExpanded: true,
58
- children: [
59
- {
60
- label: "Scenario A: this block is intended to show how a large text looks like in the sidebar",
61
- name: "scenario-a"
62
- },
63
- {
64
- label: "Scenario B",
65
- name: "scenario-b"
66
- }
67
- ]
68
- },
69
- {
70
- label: "Prerequisites",
71
- name: "prerequisites"
72
- }
73
- ]
74
- },
75
- {
76
- label: "Best Practices",
77
- name: "best-practices"
78
- }
79
- ]
80
- }
81
- ];
@@ -1,148 +0,0 @@
1
- import * as mockDocContent from "./__tests__/mockDocContent";
2
- import mockPageReference from "./__tests__/mockPageReference";
3
- import mockSidebar from "./__tests__/mockSidebar";
4
- import { html } from "lit-html";
5
-
6
- export default {
7
- title: "docs/doc-content",
8
- component: "doc-content",
9
-
10
- argTypes: {
11
- showPaginationButtons: {
12
- defaultValue: false,
13
- control: {
14
- type: "boolean"
15
- }
16
- }
17
- }
18
- };
19
-
20
- const defaultArgs = {
21
- pageReference: mockPageReference,
22
- isStorybook: true
23
- };
24
-
25
- export const Base = (args: any) => {
26
- return `
27
- <doc-content
28
- is-storybook="${args.isStorybook}"
29
- page-reference="${JSON.stringify(args.pageReference)}"
30
- docs-data="${args.docsData}"
31
- ></doc-content>`;
32
- };
33
-
34
- Base.args = {
35
- ...defaultArgs,
36
- docsData: mockDocContent.content
37
- };
38
-
39
- export const Images = (args: any) => {
40
- return `
41
- <doc-content
42
- is-storybook="${args.isStorybook}"
43
- page-reference="${JSON.stringify(args.pageReference)}"
44
- docs-data="${args.docsData}"
45
- ></doc-content>`;
46
- };
47
-
48
- Images.args = {
49
- ...defaultArgs,
50
- docsData: mockDocContent.withImages
51
- };
52
-
53
- export const Table = (args: any) => html`
54
- <doc-content
55
- is-storybook="${args.isStorybook}"
56
- page-reference="${JSON.stringify(args.pageReference)}"
57
- docs-data="${args.docsData}"
58
- >
59
- </doc-content>
60
- `;
61
-
62
- Table.args = {
63
- ...defaultArgs,
64
- docsData: mockDocContent.withTable
65
- };
66
-
67
- export const Videos = (args: any) => {
68
- return `
69
- <doc-content
70
- is-storybook="${args.isStorybook}"
71
- page-reference="${JSON.stringify(args.pageReference)}"
72
- docs-data="${args.docsData}"
73
- ></doc-content>`;
74
- };
75
-
76
- Videos.args = {
77
- ...defaultArgs,
78
- docsData: mockDocContent.withVideos
79
- };
80
-
81
- export const Notes = (args: any) => {
82
- return `
83
- <doc-content
84
- is-storybook="${args.isStorybook}"
85
- page-reference="${JSON.stringify(args.pageReference)}"
86
- docs-data="${args.docsData}"
87
- ></doc-content>`;
88
- };
89
-
90
- Notes.args = {
91
- ...defaultArgs,
92
- docsData: mockDocContent.withNotes
93
- };
94
-
95
- export const PaginationButtons = (args: any) => {
96
- return `
97
- <doc-content
98
- is-storybook="${args.isStorybook}"
99
- page-reference="${JSON.stringify(args.pageReference)}"
100
- docs-data="${args.docsData}"
101
- ${args.showPaginationButtons ? `show-pagination-buttons=true` : ``}
102
- ></doc-content>`;
103
- };
104
-
105
- PaginationButtons.args = {
106
- ...defaultArgs,
107
- showPaginationButtons: false,
108
- docsData: mockDocContent.withButtons
109
- };
110
-
111
- export const HighlightedTerm = ({ docsData, trees }: any) => html`
112
- <style>
113
- .sb-show-main.sb-main-padded {
114
- padding: 0;
115
- }
116
-
117
- .container {
118
- display: flex;
119
- }
120
-
121
- dx-sidebar {
122
- --dx-c-sidebar-min-height: 100vh;
123
- margin-right: 16px;
124
- }
125
-
126
- doc-content {
127
- margin: 16px 16px;
128
- }
129
- </style>
130
-
131
- <div class="container">
132
- <dx-sidebar
133
- header="Guides"
134
- trees="${JSON.stringify(trees)}"
135
- ></dx-sidebar>
136
- <doc-content
137
- is-storybook="true"
138
- page-reference="${JSON.stringify(mockPageReference)}"
139
- docs-data="${docsData}"
140
- ></doc-content>
141
- </div>
142
- `;
143
-
144
- HighlightedTerm.args = {
145
- ...defaultArgs,
146
- docsData: mockDocContent.sampleCodeBlockAndNote,
147
- trees: mockSidebar
148
- };
@@ -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
- });