@datocms/svelte 1.2.0 → 1.2.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 (70) hide show
  1. package/README.md +33 -6
  2. package/package.json +186 -41
  3. package/components/Head/Head.svelte +0 -14
  4. package/components/Head/Head.svelte.d.ts +0 -61
  5. package/components/Head/README.md +0 -68
  6. package/components/Head/__tests__/Head.test.d.ts +0 -1
  7. package/components/Head/__tests__/Head.test.js +0 -11
  8. package/components/Head/__tests__/__fixtures__/head.d.ts +0 -2
  9. package/components/Head/__tests__/__fixtures__/head.js +0 -280
  10. package/components/Head/__tests__/__snapshots__/Head.test.ts.snap +0 -221
  11. package/components/Image/Image.svelte +0 -172
  12. package/components/Image/Image.svelte.d.ts +0 -83
  13. package/components/Image/Placeholder.svelte +0 -30
  14. package/components/Image/Placeholder.svelte.d.ts +0 -22
  15. package/components/Image/README.md +0 -167
  16. package/components/Image/Sizer.svelte +0 -17
  17. package/components/Image/Sizer.svelte.d.ts +0 -19
  18. package/components/Image/Source.svelte +0 -6
  19. package/components/Image/Source.svelte.d.ts +0 -18
  20. package/components/Image/__tests__/Image.svelte.test.d.ts +0 -1
  21. package/components/Image/__tests__/Image.svelte.test.js +0 -44
  22. package/components/Image/__tests__/__fixtures__/image.d.ts +0 -40
  23. package/components/Image/__tests__/__fixtures__/image.js +0 -40
  24. package/components/Image/__tests__/__snapshots__/Image.svelte.test.ts.snap +0 -903
  25. package/components/StructuredText/Node.svelte +0 -112
  26. package/components/StructuredText/Node.svelte.d.ts +0 -22
  27. package/components/StructuredText/README.md +0 -201
  28. package/components/StructuredText/StructuredText.svelte +0 -15
  29. package/components/StructuredText/StructuredText.svelte.d.ts +0 -19
  30. package/components/StructuredText/__tests__/StructuredText.svelte.test.d.ts +0 -1
  31. package/components/StructuredText/__tests__/StructuredText.svelte.test.js +0 -171
  32. package/components/StructuredText/__tests__/__fixtures__/Block.svelte +0 -11
  33. package/components/StructuredText/__tests__/__fixtures__/Block.svelte.d.ts +0 -19
  34. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte +0 -49
  35. package/components/StructuredText/__tests__/__fixtures__/CustomSpan.svelte.d.ts +0 -19
  36. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte +0 -8
  37. package/components/StructuredText/__tests__/__fixtures__/IncreasedLevelHeading.svelte.d.ts +0 -19
  38. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte +0 -8
  39. package/components/StructuredText/__tests__/__fixtures__/InlineItem.svelte.d.ts +0 -19
  40. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte +0 -15
  41. package/components/StructuredText/__tests__/__fixtures__/ItemLink.svelte.d.ts +0 -21
  42. package/components/StructuredText/__tests__/__fixtures__/structuredText.d.ts +0 -7
  43. package/components/StructuredText/__tests__/__fixtures__/structuredText.js +0 -575
  44. package/components/StructuredText/__tests__/__fixtures__/types.d.ts +0 -27
  45. package/components/StructuredText/__tests__/__fixtures__/types.js +0 -1
  46. package/components/StructuredText/__tests__/__snapshots__/StructuredText.svelte.test.ts.snap +0 -531
  47. package/components/StructuredText/nodes/Blockquote.svelte +0 -5
  48. package/components/StructuredText/nodes/Blockquote.svelte.d.ts +0 -19
  49. package/components/StructuredText/nodes/Code.svelte +0 -6
  50. package/components/StructuredText/nodes/Code.svelte.d.ts +0 -17
  51. package/components/StructuredText/nodes/Heading.svelte +0 -8
  52. package/components/StructuredText/nodes/Heading.svelte.d.ts +0 -19
  53. package/components/StructuredText/nodes/Link.svelte +0 -20
  54. package/components/StructuredText/nodes/Link.svelte.d.ts +0 -19
  55. package/components/StructuredText/nodes/List.svelte +0 -10
  56. package/components/StructuredText/nodes/List.svelte.d.ts +0 -19
  57. package/components/StructuredText/nodes/ListItem.svelte +0 -5
  58. package/components/StructuredText/nodes/ListItem.svelte.d.ts +0 -19
  59. package/components/StructuredText/nodes/Paragraph.svelte +0 -5
  60. package/components/StructuredText/nodes/Paragraph.svelte.d.ts +0 -19
  61. package/components/StructuredText/nodes/Root.svelte +0 -5
  62. package/components/StructuredText/nodes/Root.svelte.d.ts +0 -19
  63. package/components/StructuredText/nodes/Span.svelte +0 -49
  64. package/components/StructuredText/nodes/Span.svelte.d.ts +0 -19
  65. package/components/StructuredText/nodes/ThematicBreak.svelte +0 -5
  66. package/components/StructuredText/nodes/ThematicBreak.svelte.d.ts +0 -17
  67. package/components/StructuredText/utils/Lines.svelte +0 -11
  68. package/components/StructuredText/utils/Lines.svelte.d.ts +0 -16
  69. package/index.d.ts +0 -9
  70. package/index.js +0 -3
@@ -1,19 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { Paragraph } from 'datocms-structured-text-utils';
3
- declare const __propDef: {
4
- props: {
5
- node: Paragraph;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {
11
- default: {};
12
- };
13
- };
14
- export type ParagraphProps = typeof __propDef.props;
15
- export type ParagraphEvents = typeof __propDef.events;
16
- export type ParagraphSlots = typeof __propDef.slots;
17
- export default class Paragraph extends SvelteComponentTyped<ParagraphProps, ParagraphEvents, ParagraphSlots> {
18
- }
19
- export {};
@@ -1,5 +0,0 @@
1
- <script>export let node;
2
- node;
3
- </script>
4
-
5
- <slot />
@@ -1,19 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { Root } from 'datocms-structured-text-utils';
3
- declare const __propDef: {
4
- props: {
5
- node: Root;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {
11
- default: {};
12
- };
13
- };
14
- export type RootProps = typeof __propDef.props;
15
- export type RootEvents = typeof __propDef.events;
16
- export type RootSlots = typeof __propDef.slots;
17
- export default class Root extends SvelteComponentTyped<RootProps, RootEvents, RootSlots> {
18
- }
19
- export {};
@@ -1,49 +0,0 @@
1
- <script>import Lines from "../utils/Lines.svelte";
2
- export let node;
3
- $:
4
- ({ type, value, marks } = node);
5
- $:
6
- [mark, ...otherMarks] = marks ?? [];
7
- </script>
8
-
9
- {#if mark}
10
- {#if mark === 'emphasis'}
11
- <em>
12
- <svelte:self node={{ type, value, marks: otherMarks }}>
13
- <slot />
14
- </svelte:self>
15
- </em>
16
- {:else if mark === 'highlight'}
17
- <mark>
18
- <svelte:self node={{ type, value, marks: otherMarks }}>
19
- <slot />
20
- </svelte:self>
21
- </mark>
22
- {:else if mark === 'strikethrough'}
23
- <del>
24
- <svelte:self node={{ type, value, marks: otherMarks }}>
25
- <slot />
26
- </svelte:self>
27
- </del>
28
- {:else if mark === 'strong'}
29
- <strong>
30
- <svelte:self node={{ type, value, marks: otherMarks }}>
31
- <slot />
32
- </svelte:self>
33
- </strong>
34
- {:else if mark === 'underline'}
35
- <u>
36
- <svelte:self node={{ type, value, marks: otherMarks }}>
37
- <slot />
38
- </svelte:self>
39
- </u>
40
- {:else if mark === 'code'}
41
- <pre>
42
- <svelte:self node={{ type, value, marks: otherMarks }}>
43
- <slot />
44
- </svelte:self>
45
- </pre>
46
- {/if}
47
- {:else}
48
- <Lines lines={node.value.split(/\n/)} />
49
- {/if}
@@ -1,19 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { Span } from 'datocms-structured-text-utils';
3
- declare const __propDef: {
4
- props: {
5
- node: Span;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {
11
- default: {};
12
- };
13
- };
14
- export type SpanProps = typeof __propDef.props;
15
- export type SpanEvents = typeof __propDef.events;
16
- export type SpanSlots = typeof __propDef.slots;
17
- export default class Span extends SvelteComponentTyped<SpanProps, SpanEvents, SpanSlots> {
18
- }
19
- export {};
@@ -1,5 +0,0 @@
1
- <script>export let node;
2
- node;
3
- </script>
4
-
5
- <hr />
@@ -1,17 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { ThematicBreak } from 'datocms-structured-text-utils';
3
- declare const __propDef: {
4
- props: {
5
- node: ThematicBreak;
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {};
11
- };
12
- export type ThematicBreakProps = typeof __propDef.props;
13
- export type ThematicBreakEvents = typeof __propDef.events;
14
- export type ThematicBreakSlots = typeof __propDef.slots;
15
- export default class ThematicBreak extends SvelteComponentTyped<ThematicBreakProps, ThematicBreakEvents, ThematicBreakSlots> {
16
- }
17
- export {};
@@ -1,11 +0,0 @@
1
- <script>export let lines = [];
2
- $:
3
- [first, ...rest] = lines;
4
- </script>
5
-
6
- {first}
7
-
8
- {#if rest.length > 0}
9
- <br />
10
- <svelte:self lines={rest} />
11
- {/if}
@@ -1,16 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- lines?: string[] | undefined;
5
- };
6
- events: {
7
- [evt: string]: CustomEvent<any>;
8
- };
9
- slots: {};
10
- };
11
- export type LinesProps = typeof __propDef.props;
12
- export type LinesEvents = typeof __propDef.events;
13
- export type LinesSlots = typeof __propDef.slots;
14
- export default class Lines extends SvelteComponentTyped<LinesProps, LinesEvents, LinesSlots> {
15
- }
16
- export {};
package/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { Node } from 'datocms-structured-text-utils';
2
- import type { SvelteComponentTyped } from 'svelte';
3
- export { default as StructuredText } from './components/StructuredText/StructuredText.svelte';
4
- export { default as Image } from './components/Image/Image.svelte';
5
- export { default as Head } from './components/Head/Head.svelte';
6
- export type PredicateComponentTuple = [
7
- (n: Node) => boolean,
8
- new (...any: any) => SvelteComponentTyped
9
- ];
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- export { default as StructuredText } from './components/StructuredText/StructuredText.svelte';
2
- export { default as Image } from './components/Image/Image.svelte';
3
- export { default as Head } from './components/Head/Head.svelte';