@exdst-sitecore-content-sdk/astro 0.0.23 → 0.0.25

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 (72) hide show
  1. package/package.json +9 -14
  2. package/src/client/sitecore-astro-client.ts +0 -45
  3. package/src/context.ts +14 -16
  4. package/src/env.d.ts +1 -1
  5. package/src/sharedTypes/component-props.ts +0 -10
  6. package/src/tools/generate-map.ts +9 -21
  7. package/src/client/sitecore-astro-client.test.ts +0 -292
  8. package/src/components/AstroImage.astro.test.ts +0 -541
  9. package/src/components/Date.astro.test.ts +0 -197
  10. package/src/components/EditingScripts.astro.test.ts +0 -267
  11. package/src/components/ErrorBoundary.astro.test.ts +0 -252
  12. package/src/components/ErrorComponent.astro.test.ts +0 -31
  13. package/src/components/FieldMetadata.astro.test.ts +0 -40
  14. package/src/components/File.astro.test.ts +0 -68
  15. package/src/components/HiddenRendering.astro.test.ts +0 -36
  16. package/src/components/Image.astro.test.ts +0 -438
  17. package/src/components/Link.astro.test.ts +0 -261
  18. package/src/components/MissingComponent.astro.test.ts +0 -21
  19. package/src/components/Placeholder/Placeholder.astro.test.ts +0 -1088
  20. package/src/components/Placeholder/PlaceholderMetadata.astro.test.ts +0 -228
  21. package/src/components/Placeholder/PlaceholderUtils.astro.test.ts +0 -149
  22. package/src/components/Placeholder/placeholder-utils.test.ts +0 -309
  23. package/src/components/RichText.astro.test.ts +0 -205
  24. package/src/components/Text.astro.test.ts +0 -273
  25. package/src/config/define-config.test.ts +0 -526
  26. package/src/config-cli/define-cli-config.test.ts +0 -88
  27. package/src/editing/editing-config-middleware.test.ts +0 -164
  28. package/src/editing/editing-render-middleware.test.ts +0 -1143
  29. package/src/editing/render-middleware.test.ts +0 -57
  30. package/src/editing/utils.test.ts +0 -1212
  31. package/src/enhancers/WithEmptyFieldEditingComponent.astro.test.ts +0 -380
  32. package/src/enhancers/WithFieldMetadata.astro.test.ts +0 -113
  33. package/src/middleware/middleware.test.ts +0 -520
  34. package/src/middleware/multisite-middleware.test.ts +0 -667
  35. package/src/middleware/robots-middleware.test.ts +0 -129
  36. package/src/middleware/sitemap-middleware.test.ts +0 -184
  37. package/src/services/component-props-service.ts +0 -183
  38. package/src/tests/astro-helpers.ts +0 -61
  39. package/src/tests/helpers.ts +0 -46
  40. package/src/tests/personalizeData.ts +0 -63
  41. package/src/tests/test-components/CustomErrorComponent.astro +0 -3
  42. package/src/tests/test-components/CustomHiddenRendering.astro +0 -10
  43. package/src/tests/test-components/CustomMissingComponent.astro +0 -9
  44. package/src/tests/test-components/DownloadCallout.astro +0 -12
  45. package/src/tests/test-components/EmptyFieldEditingComponent.astro +0 -5
  46. package/src/tests/test-components/ErrorBoundaryWithError.astro +0 -10
  47. package/src/tests/test-components/Home.astro +0 -12
  48. package/src/tests/test-components/SxaRichText.astro +0 -23
  49. package/src/tests/test-components/SxaRichTextDefault.astro +0 -7
  50. package/src/tests/test-components/SxaRichTextWithTitle.astro +0 -8
  51. package/src/tests/test-components/TestComponent.astro +0 -9
  52. package/src/tests/test-components/TestComponentWithError.astro +0 -4
  53. package/src/tests/test-components/TestComponentWithField.astro +0 -17
  54. package/src/tests/test-components/TestHeader.astro +0 -8
  55. package/src/tests/test-components/TestLogo.astro +0 -5
  56. package/src/tests/test-components/TestParentWrapperComponent.astro +0 -5
  57. package/src/tests/test-components/TestWrapperComponent.astro +0 -5
  58. package/src/tests/test-components/map-components/Bar.astro +0 -0
  59. package/src/tests/test-components/map-components/Baz.astro +0 -0
  60. package/src/tests/test-components/map-components/Foo.astro +0 -0
  61. package/src/tests/test-components/map-components/Hero.variant.astro +0 -0
  62. package/src/tests/test-components/map-components/NotComponent.bsx +0 -0
  63. package/src/tests/test-components/map-components/Qux.astro +0 -0
  64. package/src/tests/test-components/map-components/folded/Folded.astro +0 -0
  65. package/src/tests/test-components/map-components/folded/random-file-2.docx +0 -0
  66. package/src/tests/test-components/map-components/random-file.txt +0 -0
  67. package/src/tests/test-data/metadata-data.ts +0 -86
  68. package/src/tests/test-data/normal-mode-data.ts +0 -466
  69. package/src/tests/vitest.setup.ts +0 -4
  70. package/src/tools/templating/components.test.ts +0 -318
  71. package/src/tools/templating/default-component.test.ts +0 -31
  72. package/src/utils/utils.test.ts +0 -48
@@ -1,466 +0,0 @@
1
- import { LayoutServiceData } from '@sitecore-content-sdk/content/layout';
2
-
3
- export const convertedDevData: LayoutServiceData = {
4
- sitecore: {
5
- context: {
6
- pageEditing: false,
7
- },
8
- route: {
9
- name: 'home',
10
- displayName: 'Home',
11
- placeholders: {
12
- main: [
13
- {
14
- componentName: 'Home',
15
- fields: {
16
- message: {
17
- value: 'JavaScript all the things!',
18
- },
19
- },
20
- uid: '2339622d-093b-4258-8334-95979e41efa6',
21
- placeholders: {
22
- 'page-header': [
23
- {
24
- componentName: 'Jumbotron',
25
- params: {
26
- shade: 'dark',
27
- titleSize: '1',
28
- },
29
- fields: {
30
- titleText: {
31
- value: 'Your Favorite Source of Free Bootstrap Themes!',
32
- },
33
- body: {
34
- value:
35
- '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>',
36
- },
37
- },
38
- uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30',
39
- },
40
- ],
41
- 'page-content': [
42
- {
43
- componentName: 'DownloadCallout',
44
- fields: {
45
- linkText: {
46
- value: 'Download',
47
- },
48
- },
49
- uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908',
50
- params: {},
51
- },
52
- {
53
- uid: '55555555-845d-4de4-bf8e-1f4feddf8908',
54
- componentName: 'BrokenComponent',
55
- fields: {},
56
- },
57
- {
58
- uid: '77777777-845d-4de4-bf8e-1f4feddf8908',
59
- componentName: 'DynamicComponent',
60
- fields: {
61
- title: {
62
- value: 'Dynamic Component',
63
- },
64
- },
65
- },
66
- ],
67
- mainEmpty: [],
68
- },
69
- },
70
- ],
71
- },
72
- fields: {
73
- key: {
74
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
75
- },
76
- },
77
- },
78
- },
79
- };
80
-
81
- export const convertedLayoutServiceData = {
82
- sitecore: {
83
- context: {
84
- pageEditing: false,
85
- },
86
- route: {
87
- name: 'home',
88
- displayName: 'Home',
89
- placeholders: {
90
- main: [
91
- {
92
- componentName: 'Home',
93
- fields: {
94
- message: {
95
- value: 'JavaScript all the things!',
96
- editable: 'JavaScript all the things!',
97
- },
98
- },
99
- uid: '2339622d-093b-4258-8334-95979e41efa6',
100
- renderingParams: [] as { [key: string]: unknown }[],
101
- placeholders: {
102
- 'page-header': [
103
- {
104
- componentName: 'Jumbotron',
105
- fields: {
106
- titleText: {
107
- value: 'Your Favorite Source of Free Bootstrap Themes!',
108
- editable: 'Your Favorite Source of Free Bootstrap Themes!',
109
- },
110
- body: {
111
- value:
112
- '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>',
113
- editable:
114
- '<p>Start Bootstrap can help you build better websites using the Bootstrap CSS framework! Just download your template and start going, no strings attached!</p>',
115
- },
116
- },
117
- params: {
118
- shade: 'dark',
119
- titleSize: '1',
120
- },
121
- uid: '53c31a2a-75d5-43c6-a0b8-66b7c7859c30',
122
- },
123
- ],
124
- 'page-content': [
125
- {
126
- componentName: 'DownloadCallout',
127
- fields: {
128
- linkText: {
129
- value: 'Download',
130
- editable: 'Download',
131
- },
132
- },
133
- uid: '6701ac71-845d-4de4-bf8e-1f4feddf8908',
134
- params: {},
135
- },
136
- ],
137
- },
138
- },
139
- ],
140
- mainEmpty: [],
141
- },
142
- fields: {
143
- key: {
144
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
145
- },
146
- },
147
- },
148
- },
149
- };
150
-
151
- export const sxaRenderingVariantData = {
152
- sitecore: {
153
- context: {
154
- pageEditing: false,
155
- },
156
- route: {
157
- name: 'Home',
158
- displayName: 'Home',
159
- fields: {
160
- key: {
161
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
162
- },
163
- },
164
- placeholders: {
165
- main: [
166
- {
167
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
168
- componentName: 'RichText',
169
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
170
- params: {
171
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
172
- FieldNames: 'WithTitle',
173
- Styles: 'test-css-class-x',
174
- },
175
- fields: {
176
- Text: {
177
- value: 'Test RichText',
178
- },
179
- Title: {
180
- value: 'Rich Text Rendering Variant',
181
- },
182
- },
183
- },
184
- ],
185
- 'main-second': [
186
- {
187
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
188
- componentName: 'RichText',
189
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
190
- params: {
191
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
192
- FieldNames: 'Default',
193
- Styles: 'test-css-class-y',
194
- },
195
- fields: {
196
- Text: {
197
- value: 'Test RichText',
198
- },
199
- Title: {
200
- value: 'Rich Text Rendering Variant',
201
- },
202
- },
203
- },
204
- ],
205
- },
206
- },
207
- },
208
- };
209
-
210
- export const sxaRenderingVariantDataWithCommonContainerName = {
211
- sitecore: {
212
- context: {
213
- pageEditing: false,
214
- },
215
- route: {
216
- name: 'Home',
217
- displayName: 'Home',
218
- fields: {
219
- key: {
220
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
221
- },
222
- },
223
- placeholders: {
224
- 'container-{*}': [
225
- {
226
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
227
- componentName: 'RichText',
228
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
229
- params: {
230
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
231
- FieldNames: 'WithTitle',
232
- Styles: 'test-css-class-x',
233
- },
234
- fields: {
235
- Text: {
236
- value: 'Test RichText',
237
- },
238
- Title: {
239
- value: 'Rich Text Rendering Variant',
240
- },
241
- },
242
- },
243
- ],
244
- },
245
- },
246
- },
247
- };
248
-
249
- export const sxaRenderingVariantDoubleDigitDynamicPlaceholder = {
250
- sitecore: {
251
- context: {
252
- pageEditing: false,
253
- },
254
- route: {
255
- name: 'Home',
256
- displayName: 'Home',
257
- fields: {
258
- key: {
259
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
260
- },
261
- },
262
- placeholders: {
263
- 'dynamic-1-{*}': [
264
- {
265
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
266
- componentName: 'RichText',
267
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
268
- params: {
269
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
270
- FieldNames: 'WithTitle',
271
- Styles: 'test-css-class-x',
272
- },
273
- fields: {
274
- Text: {
275
- value: 'Test RichText',
276
- },
277
- Title: {
278
- value: 'Rich Text Rendering Variant',
279
- },
280
- },
281
- },
282
- ],
283
- },
284
- },
285
- },
286
- };
287
-
288
- export const sxaRenderingVariantDataWithoutCommonContainerName = {
289
- sitecore: {
290
- context: {
291
- pageEditing: false,
292
- },
293
- route: {
294
- name: 'Home',
295
- displayName: 'Home',
296
- fields: {
297
- key: {
298
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
299
- },
300
- },
301
- placeholders: {
302
- 'no-container': [
303
- {
304
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
305
- componentName: 'RichText',
306
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
307
- params: {
308
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
309
- FieldNames: 'WithTitle',
310
- Styles: 'test-css-class-x',
311
- },
312
- fields: {
313
- Text: {
314
- value: 'Test RichText',
315
- },
316
- Title: {
317
- value: 'Rich Text Rendering Variant',
318
- },
319
- },
320
- },
321
- ],
322
- },
323
- },
324
- },
325
- };
326
-
327
- export const sxaRenderingColumnSplitterVariant = {
328
- sitecore: {
329
- context: {
330
- pageEditing: false,
331
- },
332
- route: {
333
- name: 'Home',
334
- displayName: 'Home',
335
- fields: {
336
- key: {
337
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
338
- },
339
- },
340
- placeholders: {
341
- 'column-1-{*}': [
342
- {
343
- uid: 'c4d5d43b-5aa8-4e03-8f16-9428f3e02d5c',
344
- componentName: 'RichText',
345
- dataSource: '/sitecore/content/SxaSample/SxaSampleSite/Home/Data/RichText',
346
- params: {
347
- GridParameters: 'col-9|col-sm-10|col-md-12|col-lg-6|col-xl-7|col-xxl-8',
348
- FieldNames: 'Default',
349
- Styles: 'test-css-class-y',
350
- },
351
- fields: {
352
- Text: {
353
- value: 'Test RichText',
354
- },
355
- Title: {
356
- value: 'Rich Text Rendering Variant',
357
- },
358
- },
359
- },
360
- ],
361
- },
362
- },
363
- },
364
- };
365
-
366
- export const byocWrapperData = {
367
- sitecore: {
368
- context: {
369
- pageEditing: false,
370
- },
371
- route: {
372
- name: 'Home',
373
- displayName: 'Home',
374
- fields: {
375
- key: {
376
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
377
- },
378
- },
379
- placeholders: {
380
- main: [
381
- {
382
- uid: '278b99a7-8d73-4362-ac05-53e7c35154d5',
383
- componentName: 'BYOCWrapper',
384
- dataSource: '',
385
- params: {
386
- ComponentName: 'Foo',
387
- ComponentProps: '{ "columns": 7 }',
388
- GridParameters: 'col-12',
389
- DynamicPlaceholderId: '1',
390
- FieldNames: 'Default',
391
- },
392
- },
393
- {
394
- uid: '278b99a7-8d73-4362-ac05-53e7c35154d5',
395
- componentName: 'BYOCComponent',
396
- dataSource: '',
397
- params: {
398
- ComponentName: 'Bar',
399
- ComponentProps: '{ "columns": 5 }',
400
- GridParameters: 'col-12',
401
- DynamicPlaceholderId: '1',
402
- FieldNames: 'Default',
403
- },
404
- },
405
- ],
406
- },
407
- },
408
- },
409
- };
410
-
411
- export const feaasWrapperData = {
412
- sitecore: {
413
- context: {
414
- pageEditing: false,
415
- },
416
- route: {
417
- name: 'Home',
418
- displayName: 'Home',
419
- fields: {
420
- key: {
421
- value: 'This is a some sample &lt;p&gt;field data&lt;/p&gt; o&#39;boy! &quot;wow&quot;',
422
- },
423
- },
424
- placeholders: {
425
- main: [
426
- {
427
- uid: 'd07d1832-f2a1-4f56-a949-5d1ab263a1d5',
428
- componentName: 'FEaaSWrapper',
429
- dataSource: '',
430
- params: {
431
- ComponentName: 'Two product teaser',
432
- LibraryId: '4lcTPh6h5L4soeuM0WkXtf',
433
- ComponentId: 'bkpRNHFB2v',
434
- ComponentVersion: 'responsive',
435
- ComponentRevision: 'staged',
436
- ComponentHostName: 'https://feaas.windows.net',
437
- ComponentInstanceId: 'bSE5grxVRMCVB0K',
438
- GridParameters: 'col-12',
439
- CacheClearingBehavior: 'Clear on publish',
440
- DynamicPlaceholderId: '2',
441
- FieldNames: 'Default',
442
- },
443
- },
444
- {
445
- uid: 'd07d1832-f2a1-4f56-a949-5d1ab263a1d5',
446
- componentName: 'FEaaSComponent',
447
- dataSource: '',
448
- params: {
449
- ComponentName: 'One product teaser',
450
- LibraryId: '4lcTPh6h5L4soeuM0WkXtf',
451
- ComponentId: 'bkpRNHFB2v',
452
- ComponentVersion: 'responsive',
453
- ComponentRevision: 'staged',
454
- ComponentHostName: 'https://feaas.windows.net',
455
- ComponentInstanceId: 'bSE5grxVRMCVB0K',
456
- GridParameters: 'col-9',
457
- CacheClearingBehavior: 'Clear on publish',
458
- DynamicPlaceholderId: '2',
459
- FieldNames: 'Default',
460
- },
461
- },
462
- ],
463
- },
464
- },
465
- },
466
- };
@@ -1,4 +0,0 @@
1
- import '@testing-library/jest-dom/vitest';
2
- import { GlobalRegistrator } from '@happy-dom/global-registrator';
3
-
4
- GlobalRegistrator.register();