@datocms/svelte 1.2.1 → 1.3.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 (70) hide show
  1. package/README.md +33 -6
  2. package/{components → package/components}/StructuredText/StructuredText.svelte.d.ts +1 -1
  3. package/{index.d.ts → package/index.d.ts} +2 -2
  4. package/package.json +222 -70
  5. package/components/Head/__tests__/Head.test.d.ts +0 -1
  6. package/components/Head/__tests__/Head.test.js +0 -11
  7. package/components/Head/__tests__/__fixtures__/head.d.ts +0 -2
  8. package/components/Head/__tests__/__fixtures__/head.js +0 -280
  9. package/components/Head/__tests__/__snapshots__/Head.test.ts.snap +0 -221
  10. package/components/Image/__tests__/Image.svelte.test.d.ts +0 -1
  11. package/components/Image/__tests__/Image.svelte.test.js +0 -44
  12. package/components/Image/__tests__/__fixtures__/image.d.ts +0 -40
  13. package/components/Image/__tests__/__fixtures__/image.js +0 -40
  14. package/components/Image/__tests__/__snapshots__/Image.svelte.test.ts.snap +0 -903
  15. package/components/StructuredText/__tests__/StructuredText.svelte.test.d.ts +0 -1
  16. package/components/StructuredText/__tests__/StructuredText.svelte.test.js +0 -171
  17. package/components/StructuredText/__tests__/__fixtures__/Block.svelte +0 -11
  18. package/components/StructuredText/__tests__/__fixtures__/Block.svelte.d.ts +0 -19
  19. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte +0 -49
  20. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte.d.ts +0 -19
  21. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte +0 -8
  22. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte.d.ts +0 -19
  23. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte +0 -8
  24. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte.d.ts +0 -19
  25. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte +0 -15
  26. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte.d.ts +0 -21
  27. package/components/StructuredText/__tests__/__fixtures__/structuredText.d.ts +0 -7
  28. package/components/StructuredText/__tests__/__fixtures__/structuredText.js +0 -575
  29. package/components/StructuredText/__tests__/__fixtures__/types.d.ts +0 -27
  30. package/components/StructuredText/__tests__/__fixtures__/types.js +0 -1
  31. package/components/StructuredText/__tests__/__snapshots__/StructuredText.svelte.test.ts.snap +0 -531
  32. /package/{components → package/components}/Head/Head.svelte +0 -0
  33. /package/{components → package/components}/Head/Head.svelte.d.ts +0 -0
  34. /package/{components → package/components}/Head/README.md +0 -0
  35. /package/{components → package/components}/Image/Image.svelte +0 -0
  36. /package/{components → package/components}/Image/Image.svelte.d.ts +0 -0
  37. /package/{components → package/components}/Image/Placeholder.svelte +0 -0
  38. /package/{components → package/components}/Image/Placeholder.svelte.d.ts +0 -0
  39. /package/{components → package/components}/Image/README.md +0 -0
  40. /package/{components → package/components}/Image/Sizer.svelte +0 -0
  41. /package/{components → package/components}/Image/Sizer.svelte.d.ts +0 -0
  42. /package/{components → package/components}/Image/Source.svelte +0 -0
  43. /package/{components → package/components}/Image/Source.svelte.d.ts +0 -0
  44. /package/{components → package/components}/StructuredText/Node.svelte +0 -0
  45. /package/{components → package/components}/StructuredText/Node.svelte.d.ts +0 -0
  46. /package/{components → package/components}/StructuredText/README.md +0 -0
  47. /package/{components → package/components}/StructuredText/StructuredText.svelte +0 -0
  48. /package/{components → package/components}/StructuredText/nodes/Blockquote.svelte +0 -0
  49. /package/{components → package/components}/StructuredText/nodes/Blockquote.svelte.d.ts +0 -0
  50. /package/{components → package/components}/StructuredText/nodes/Code.svelte +0 -0
  51. /package/{components → package/components}/StructuredText/nodes/Code.svelte.d.ts +0 -0
  52. /package/{components → package/components}/StructuredText/nodes/Heading.svelte +0 -0
  53. /package/{components → package/components}/StructuredText/nodes/Heading.svelte.d.ts +0 -0
  54. /package/{components → package/components}/StructuredText/nodes/Link.svelte +0 -0
  55. /package/{components → package/components}/StructuredText/nodes/Link.svelte.d.ts +0 -0
  56. /package/{components → package/components}/StructuredText/nodes/List.svelte +0 -0
  57. /package/{components → package/components}/StructuredText/nodes/List.svelte.d.ts +0 -0
  58. /package/{components → package/components}/StructuredText/nodes/ListItem.svelte +0 -0
  59. /package/{components → package/components}/StructuredText/nodes/ListItem.svelte.d.ts +0 -0
  60. /package/{components → package/components}/StructuredText/nodes/Paragraph.svelte +0 -0
  61. /package/{components → package/components}/StructuredText/nodes/Paragraph.svelte.d.ts +0 -0
  62. /package/{components → package/components}/StructuredText/nodes/Root.svelte +0 -0
  63. /package/{components → package/components}/StructuredText/nodes/Root.svelte.d.ts +0 -0
  64. /package/{components → package/components}/StructuredText/nodes/Span.svelte +0 -0
  65. /package/{components → package/components}/StructuredText/nodes/Span.svelte.d.ts +0 -0
  66. /package/{components → package/components}/StructuredText/nodes/ThematicBreak.svelte +0 -0
  67. /package/{components → package/components}/StructuredText/nodes/ThematicBreak.svelte.d.ts +0 -0
  68. /package/{components → package/components}/StructuredText/utils/Lines.svelte +0 -0
  69. /package/{components → package/components}/StructuredText/utils/Lines.svelte.d.ts +0 -0
  70. /package/{index.js → package/index.js} +0 -0
@@ -1,531 +0,0 @@
1
- // Vitest Snapshot v1
2
-
3
- exports[`StructuredText > with a dast including links and blocks > with default rules > renders the document 1`] = `
4
- <body>
5
- <div>
6
- <h1>
7
- This is a
8
-
9
-
10
- <!--&lt;Lines&gt;-->
11
-
12
- <!--&lt;Span&gt;-->
13
-
14
-
15
-
16
- <!--&lt;Node&gt;-->
17
- <mark>
18
- title
19
-
20
-
21
- <!--&lt;Lines&gt;-->
22
-
23
- <!--&lt;Span&gt;-->
24
- </mark>
25
-
26
-
27
- <!--&lt;Span&gt;-->
28
-
29
-
30
-
31
- <!--&lt;Node&gt;-->
32
- <a
33
- href="/docs/how-to-code"
34
- >
35
- How to code
36
- </a>
37
- ;
38
-
39
- <!--&lt;InlineItem&gt;-->
40
-
41
-
42
-
43
- <!--&lt;Node&gt;-->
44
- <a
45
- href="/docs/how-to-code"
46
- target="_blank"
47
- >
48
- here!
49
-
50
-
51
- <!--&lt;Lines&gt;-->
52
-
53
- <!--&lt;Span&gt;-->
54
-
55
-
56
-
57
- <!--&lt;Node&gt;-->
58
-
59
-
60
- </a>
61
-
62
- <!--&lt;ItemLink&gt;-->
63
-
64
-
65
-
66
- <!--&lt;Node&gt;-->
67
-
68
-
69
- </h1>
70
-
71
- <!--&lt;Heading&gt;-->
72
-
73
-
74
-
75
- <!--&lt;Node&gt;-->
76
- <figure>
77
- <blockquote>
78
- Foo bar.
79
- </blockquote>
80
-
81
- <figcaption>
82
- Mark Smith
83
- </figcaption>
84
- </figure>
85
-
86
- <!--&lt;Block&gt;-->
87
-
88
-
89
-
90
- <!--&lt;Node&gt;-->
91
-
92
-
93
- <!--&lt;Root&gt;-->
94
-
95
-
96
-
97
- <!--&lt;Node&gt;-->
98
-
99
- <!--&lt;StructuredText&gt;-->
100
- </div>
101
- </body>
102
- `;
103
-
104
- exports[`StructuredText > with a dast including links and blocks > with missing blocks > raises an error 1`] = `"The Structured Text document contains a 'block' node, but cannot find a record with ID 456 inside data.blocks!"`;
105
-
106
- exports[`StructuredText > with a dast including links and blocks > with missing component for blocks > raises an error 1`] = `"The Structured Text document contains a 'block' node, but no component for rendering is specified!"`;
107
-
108
- exports[`StructuredText > with a dast including links and blocks > with missing component for inline items > raises an error 1`] = `"The Structured Text document contains an 'inlineItem' node, but no component for rendering is specified!"`;
109
-
110
- exports[`StructuredText > with a dast including links and blocks > with missing component for item links > raises an error 1`] = `"The Structured Text document contains an 'itemLink' node, but no component for rendering is specified!"`;
111
-
112
- exports[`StructuredText > with a dast including links and blocks > with missing links > raises an error 1`] = `"The Structured Text document contains an 'itemLink' node, but cannot find a record with ID 123 inside data.links!"`;
113
-
114
- exports[`StructuredText > with a dast which has a link inside > with default rules > renders the document 1`] = `
115
- <body>
116
- <div>
117
- <p>
118
- This is a paragraph with a
119
-
120
-
121
- <!--&lt;Lines&gt;-->
122
-
123
- <!--&lt;Span&gt;-->
124
-
125
-
126
-
127
- <!--&lt;Node&gt;-->
128
- <a
129
- href="https://random.link"
130
- rel="nofollow"
131
- target="_blank"
132
- >
133
- very cool link
134
-
135
-
136
- <!--&lt;Lines&gt;-->
137
-
138
- <!--&lt;Span&gt;-->
139
-
140
-
141
-
142
- <!--&lt;Node&gt;-->
143
-
144
-
145
- </a>
146
- <!--&lt;Link&gt;-->
147
-
148
-
149
-
150
- <!--&lt;Node&gt;-->
151
- . And the link has the target and the rel attributes set.
152
-
153
-
154
- <!--&lt;Lines&gt;-->
155
-
156
- <!--&lt;Span&gt;-->
157
-
158
-
159
-
160
- <!--&lt;Node&gt;-->
161
-
162
-
163
- </p>
164
- <!--&lt;Paragraph&gt;-->
165
-
166
-
167
-
168
- <!--&lt;Node&gt;-->
169
-
170
-
171
- <!--&lt;Root&gt;-->
172
-
173
-
174
-
175
- <!--&lt;Node&gt;-->
176
-
177
- <!--&lt;StructuredText&gt;-->
178
- </div>
179
- </body>
180
- `;
181
-
182
- exports[`StructuredText > with a dast with no links nor blocks > with custom rules > renders the document 1`] = `
183
- <body>
184
- <div>
185
- <h2>
186
- This
187
-
188
- <br />
189
-
190
- is a
191
-
192
-
193
- <!--&lt;Lines&gt;-->
194
-
195
- <!--&lt;Lines&gt;-->
196
-
197
- <!--&lt;Span&gt;-->
198
-
199
-
200
-
201
- <!--&lt;Node&gt;-->
202
- <strong>
203
- title
204
-
205
-
206
- <!--&lt;Lines&gt;-->
207
-
208
- <!--&lt;Span&gt;-->
209
- </strong>
210
-
211
-
212
- <!--&lt;Span&gt;-->
213
-
214
-
215
-
216
- <!--&lt;Node&gt;-->
217
-
218
-
219
- </h2>
220
-
221
- <!--&lt;IncreasedLevelHeading&gt;-->
222
-
223
-
224
-
225
- <!--&lt;Node&gt;-->
226
-
227
-
228
- <!--&lt;Root&gt;-->
229
-
230
-
231
-
232
- <!--&lt;Node&gt;-->
233
-
234
- <!--&lt;StructuredText&gt;-->
235
- </div>
236
- </body>
237
- `;
238
-
239
- exports[`StructuredText > with a dast with no links nor blocks > with default rules > renders the document 1`] = `
240
- <body>
241
- <div>
242
- <h1>
243
- This
244
-
245
- <br />
246
-
247
- is a
248
-
249
-
250
- <!--&lt;Lines&gt;-->
251
-
252
- <!--&lt;Lines&gt;-->
253
-
254
- <!--&lt;Span&gt;-->
255
-
256
-
257
-
258
- <!--&lt;Node&gt;-->
259
- <strong>
260
- title
261
-
262
-
263
- <!--&lt;Lines&gt;-->
264
-
265
- <!--&lt;Span&gt;-->
266
- </strong>
267
-
268
-
269
- <!--&lt;Span&gt;-->
270
-
271
-
272
-
273
- <!--&lt;Node&gt;-->
274
-
275
-
276
- </h1>
277
-
278
- <!--&lt;Heading&gt;-->
279
-
280
-
281
-
282
- <!--&lt;Node&gt;-->
283
-
284
-
285
- <!--&lt;Root&gt;-->
286
-
287
-
288
-
289
- <!--&lt;Node&gt;-->
290
-
291
- <!--&lt;StructuredText&gt;-->
292
- </div>
293
- </body>
294
- `;
295
-
296
- exports[`StructuredText > with a very simple dast > with custom mark rules > renders the document 1`] = `
297
- <body>
298
- <div>
299
- <h1>
300
- This
301
-
302
- <br />
303
-
304
- is a
305
-
306
-
307
- <!--&lt;Lines&gt;-->
308
-
309
- <!--&lt;Lines&gt;-->
310
-
311
- <!--&lt;CustomSpan&gt;-->
312
-
313
-
314
-
315
- <!--&lt;Node&gt;-->
316
- <b>
317
- title
318
-
319
-
320
- <!--&lt;Lines&gt;-->
321
-
322
- <!--&lt;CustomSpan&gt;-->
323
- </b>
324
-
325
-
326
- <!--&lt;CustomSpan&gt;-->
327
-
328
-
329
-
330
- <!--&lt;Node&gt;-->
331
-
332
-
333
- </h1>
334
-
335
- <!--&lt;Heading&gt;-->
336
-
337
-
338
-
339
- <!--&lt;Node&gt;-->
340
-
341
-
342
- <!--&lt;Root&gt;-->
343
-
344
-
345
-
346
- <!--&lt;Node&gt;-->
347
-
348
- <!--&lt;StructuredText&gt;-->
349
- </div>
350
- </body>
351
- `;
352
-
353
- exports[`StructuredText > with a very simple dast > with default rules > renders the document 1`] = `
354
- <body>
355
- <div>
356
- <h1>
357
- This
358
-
359
- <br />
360
-
361
- is a
362
-
363
-
364
- <!--&lt;Lines&gt;-->
365
-
366
- <!--&lt;Lines&gt;-->
367
-
368
- <!--&lt;Span&gt;-->
369
-
370
-
371
-
372
- <!--&lt;Node&gt;-->
373
- <strong>
374
- title
375
-
376
-
377
- <!--&lt;Lines&gt;-->
378
-
379
- <!--&lt;Span&gt;-->
380
- </strong>
381
-
382
-
383
- <!--&lt;Span&gt;-->
384
-
385
-
386
-
387
- <!--&lt;Node&gt;-->
388
-
389
-
390
- </h1>
391
-
392
- <!--&lt;Heading&gt;-->
393
-
394
-
395
-
396
- <!--&lt;Node&gt;-->
397
-
398
-
399
- <!--&lt;Root&gt;-->
400
-
401
-
402
-
403
- <!--&lt;Node&gt;-->
404
-
405
- <!--&lt;StructuredText&gt;-->
406
- </div>
407
- </body>
408
- `;
409
-
410
- exports[`StructuredText > with a very simple pure dast (only the \`value\` of a structured text) > with custom mark rules > renders the document 1`] = `
411
- <body>
412
- <div>
413
- <h1>
414
- This
415
-
416
- <br />
417
-
418
- is a
419
-
420
-
421
- <!--&lt;Lines&gt;-->
422
-
423
- <!--&lt;Lines&gt;-->
424
-
425
- <!--&lt;CustomSpan&gt;-->
426
-
427
-
428
-
429
- <!--&lt;Node&gt;-->
430
- <b>
431
- title
432
-
433
-
434
- <!--&lt;Lines&gt;-->
435
-
436
- <!--&lt;CustomSpan&gt;-->
437
- </b>
438
-
439
-
440
- <!--&lt;CustomSpan&gt;-->
441
-
442
-
443
-
444
- <!--&lt;Node&gt;-->
445
-
446
-
447
- </h1>
448
-
449
- <!--&lt;Heading&gt;-->
450
-
451
-
452
-
453
- <!--&lt;Node&gt;-->
454
-
455
-
456
- <!--&lt;Root&gt;-->
457
-
458
-
459
-
460
- <!--&lt;Node&gt;-->
461
-
462
- <!--&lt;StructuredText&gt;-->
463
- </div>
464
- </body>
465
- `;
466
-
467
- exports[`StructuredText > with a very simple pure dast (only the \`value\` of a structured text) > with default rules > renders the document 1`] = `
468
- <body>
469
- <div>
470
- <h1>
471
- This
472
-
473
- <br />
474
-
475
- is a
476
-
477
-
478
- <!--&lt;Lines&gt;-->
479
-
480
- <!--&lt;Lines&gt;-->
481
-
482
- <!--&lt;Span&gt;-->
483
-
484
-
485
-
486
- <!--&lt;Node&gt;-->
487
- <strong>
488
- title
489
-
490
-
491
- <!--&lt;Lines&gt;-->
492
-
493
- <!--&lt;Span&gt;-->
494
- </strong>
495
-
496
-
497
- <!--&lt;Span&gt;-->
498
-
499
-
500
-
501
- <!--&lt;Node&gt;-->
502
-
503
-
504
- </h1>
505
-
506
- <!--&lt;Heading&gt;-->
507
-
508
-
509
-
510
- <!--&lt;Node&gt;-->
511
-
512
-
513
- <!--&lt;Root&gt;-->
514
-
515
-
516
-
517
- <!--&lt;Node&gt;-->
518
-
519
- <!--&lt;StructuredText&gt;-->
520
- </div>
521
- </body>
522
- `;
523
-
524
- exports[`StructuredText > with no value > renders null 1`] = `
525
- <body>
526
- <div>
527
-
528
- <!--&lt;StructuredText&gt;-->
529
- </div>
530
- </body>
531
- `;
File without changes