@prismicio/svelte 1.4.0 → 1.5.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.
@@ -1,5 +1,4 @@
1
- <script>import { TableComponents } from "../types";
2
- export let type;
1
+ <script>export let type;
3
2
  </script>
4
3
 
5
4
  <svelte:element this={type}><slot /></svelte:element>
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponent } from "svelte";
2
- import { TableComponents } from "../types";
2
+ import type { TableComponents } from "../types";
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  type: keyof TableComponents;
@@ -1,7 +1,6 @@
1
1
  <script>import { isFilled } from "@prismicio/client";
2
2
  import {} from "svelte";
3
3
  import PrismicRichText from "../PrismicRichText/PrismicRichText.svelte";
4
- import { SvelteRichTextSerializer } from "../types";
5
4
  import DefaultComponent from "./DefaultComponent.svelte";
6
5
  export let field;
7
6
  export let components = {};
@@ -26,17 +25,17 @@ const { Component: Td, props: tdProps } = createComponent("td");
26
25
  <Table {...tableProps} table={field}>
27
26
  {#if field?.head}
28
27
  <Thead {...theadProps} head={field.head}>
29
- {#each field.head.rows as row}
28
+ {#each field.head.rows as row (row.key)}
30
29
  <Tr {...trProps} {row}>
31
- {#each row.cells as cell}
30
+ {#each row.cells as cell (cell.key)}
32
31
  <Th {...thProps} {cell}>
33
32
  <PrismicRichText field={cell.content} {components} /></Th
34
33
  >{/each}</Tr
35
34
  >{/each}</Thead
36
35
  >{/if}<Tbody {...tbodyProps} body={field.body}>
37
- {#each field.body.rows as row}
36
+ {#each field.body.rows as row (row.key)}
38
37
  <Tr {...trProps} {row}>
39
- {#each row.cells as cell}
38
+ {#each row.cells as cell (cell.key)}
40
39
  {#if cell.type === "header"}
41
40
  <Th {...thProps} {cell}>
42
41
  <PrismicRichText field={cell.content} {components} /></Th
@@ -1,7 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  import { type TableField } from "@prismicio/client";
3
3
  import { type ComponentType } from "svelte";
4
- import { type TableComponents } from "../types";
4
+ import type { TableComponents } from "../types";
5
5
  declare const __propDef: {
6
6
  props: {
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/svelte",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "description": "Svelte components to present Prismic content.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -52,7 +52,7 @@
52
52
  "release": "npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
53
53
  "release:alpha": "npm run test && standard-version --release-as minor --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
54
54
  "release:alpha:dry": "standard-version --release-as minor --prerelease alpha --dry-run",
55
- "release:dry": "standard-version --dry-run",
55
+ "release:dry": "standard-version --release-as patch --dry-run",
56
56
  "size": "size-limit",
57
57
  "test": "npm run lint && npm run types && npm run unit && npm run build && npm run size",
58
58
  "types": "vitest --typecheck.only --run && tsc --noEmit",
@@ -65,7 +65,7 @@
65
65
  "esm-env": "^1.0.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@prismicio/client": "^7.16.1",
68
+ "@prismicio/client": "^7.17.0",
69
69
  "@prismicio/mock": "^0.7.1",
70
70
  "@size-limit/preset-small-lib": "^11.0.1",
71
71
  "@sveltejs/kit": "^2.0.0",
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { TableComponents } from "../types";
2
+ import type { TableComponents } from "../types";
3
3
  export let type: keyof TableComponents;
4
4
  </script>
5
5
 
@@ -3,7 +3,7 @@
3
3
  import { type ComponentType } from "svelte";
4
4
 
5
5
  import PrismicRichText from "../PrismicRichText/PrismicRichText.svelte";
6
- import { SvelteRichTextSerializer, type TableComponents } from "../types";
6
+ import type { SvelteRichTextSerializer, TableComponents } from "../types";
7
7
  import DefaultComponent from "./DefaultComponent.svelte";
8
8
 
9
9
  /**
@@ -47,17 +47,17 @@
47
47
  <Table {...tableProps} table={field}>
48
48
  {#if field?.head}
49
49
  <Thead {...theadProps} head={field.head}>
50
- {#each field.head.rows as row}
50
+ {#each field.head.rows as row (row.key)}
51
51
  <Tr {...trProps} {row}>
52
- {#each row.cells as cell}
52
+ {#each row.cells as cell (cell.key)}
53
53
  <Th {...thProps} {cell}>
54
54
  <PrismicRichText field={cell.content} {components} /></Th
55
55
  >{/each}</Tr
56
56
  >{/each}</Thead
57
57
  >{/if}<Tbody {...tbodyProps} body={field.body}>
58
- {#each field.body.rows as row}
58
+ {#each field.body.rows as row (row.key)}
59
59
  <Tr {...trProps} {row}>
60
- {#each row.cells as cell}
60
+ {#each row.cells as cell (cell.key)}
61
61
  {#if cell.type === "header"}
62
62
  <Th {...thProps} {cell}>
63
63
  <PrismicRichText field={cell.content} {components} /></Th