@contentful/experiences-svelte 0.3.1 → 0.3.3
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.
- package/CHANGELOG.md +24 -0
- package/README.md +46 -20
- package/dist/ClientExperienceRenderer.svelte +1 -1
- package/dist/NodeRenderer.svelte +1 -1
- package/dist/NodeRenderer.svelte.d.ts +1 -1
- package/dist/NodeRenderer.svelte.d.ts.map +1 -1
- package/dist/NodesRenderer.svelte +1 -1
- package/dist/NodesRenderer.svelte.d.ts +1 -1
- package/dist/NodesRenderer.svelte.d.ts.map +1 -1
- package/dist/ServerExperienceRenderer.svelte +1 -1
- package/dist/WrapWithTemplate.svelte +1 -1
- package/dist/WrapWithTemplate.svelte.d.ts +1 -1
- package/dist/WrapWithTemplate.svelte.d.ts.map +1 -1
- package/dist/component-props.d.ts +1 -1
- package/dist/component-props.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/server-renderer.test.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/use-active-viewport.svelte.d.ts +1 -1
- package/dist/use-active-viewport.svelte.d.ts.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## 0.3.3 (2026-07-21)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- render missing-component fallback as element in RSC [AIS-316] ([#79](https://github.com/contentful/experiences/pull/79))
|
|
6
|
+
|
|
7
|
+
### 🧱 Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated client to 0.1.3
|
|
10
|
+
- Updated design to 0.5.3
|
|
11
|
+
- Updated core to 0.5.3
|
|
12
|
+
|
|
13
|
+
## 0.3.2 (2026-07-20)
|
|
14
|
+
|
|
15
|
+
### 🩹 Fixes
|
|
16
|
+
|
|
17
|
+
- rename experiences-core to experiences-sdk-core [AIS-305] ([#76](https://github.com/contentful/experiences/pull/76))
|
|
18
|
+
|
|
19
|
+
### 🧱 Updated Dependencies
|
|
20
|
+
|
|
21
|
+
- Updated client to 0.1.2
|
|
22
|
+
- Updated design to 0.5.2
|
|
23
|
+
- Updated core to 0.5.2
|
|
24
|
+
|
|
1
25
|
## 0.3.1 (2026-07-17)
|
|
2
26
|
|
|
3
27
|
### 🚀 Features
|
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# @contentful/experiences-svelte
|
|
2
2
|
|
|
3
|
-
> ⚠️ **
|
|
3
|
+
> ⚠️ **Alpha.** Published to npm. APIs are unstable and will change.
|
|
4
4
|
|
|
5
|
-
The Svelte adapter for the Contentful Experiences SDK
|
|
5
|
+
The Svelte adapter for the Contentful Experiences SDK. You bring your own Svelte 5 components; it renders Experience payloads from the Experience Delivery API (XDA) with them.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install @contentful/experiences-svelte
|
|
8
|
+
npm install @contentful/experiences-svelte
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
This is the **only SDK package
|
|
11
|
+
This is the **only SDK package you install**. It re-exports everything you need from `@contentful/experiences-sdk-core` and `@contentful/experiences-design`. The other packages are workspace-internal.
|
|
12
12
|
|
|
13
|
-
The public API mirrors `@contentful/experiences-react` 1:1 in shape; only the rendering primitives change (
|
|
13
|
+
The public API mirrors `@contentful/experiences-react` 1:1 in shape; only the rendering primitives change (Svelte 5 `Component`s, Snippets instead of `children: ReactNode`, and `getDesignValues()` instead of `useDesignValues()`).
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -26,7 +26,7 @@ defineTemplate<Props>(config); // Same shape, for page-level template wrappers
|
|
|
26
26
|
### Resolver
|
|
27
27
|
|
|
28
28
|
```ts
|
|
29
|
-
resolveExperience(payload, config, opts?); // Async
|
|
29
|
+
resolveExperience(payload, config, opts?); // Async; walks payload, runs resolveData, returns a PortableRenderPlan
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
### Renderers
|
|
@@ -35,25 +35,40 @@ resolveExperience(payload, config, opts?); // Async — walks payload, runs reso
|
|
|
35
35
|
ServerExperienceRenderer; // SSR-safe; active viewport seeded from initialViewportId
|
|
36
36
|
ClientExperienceRenderer; // Subscribes to window.matchMedia via runes
|
|
37
37
|
MissingComponent; // Default fallback for unregistered component types
|
|
38
|
-
|
|
38
|
+
NodesRenderer; // Exposed so you can render non-`children` slots manually
|
|
39
|
+
useActiveViewport; // Rune-backed reactive object; you'll rarely need it directly
|
|
39
40
|
```
|
|
40
41
|
|
|
42
|
+
### Styling + runtime context (helpers)
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
getDesignValues<T>(); // Resolved design values for the current node; read in a $derived to stay reactive
|
|
46
|
+
toCss(design, options?); // Turns a design record into a plain style object, keeping only real CSS keys
|
|
47
|
+
getExperience(); // RenderContext: isPreview, metadata, viewports, activeViewport
|
|
48
|
+
getContentfulComponent(); // Raw payload for the enclosing node (or undefined)
|
|
49
|
+
getContentfulTemplate(); // Same, for the page-level template
|
|
50
|
+
type ToCssOptions;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Design is **not** injected as props; components read it via `getDesignValues()` from the top of their `<script>` block. Token resolution is configured with `resolveToken` on your `Config` (`type ResolveToken`).
|
|
54
|
+
|
|
41
55
|
### Re-exported types and utilities
|
|
42
56
|
|
|
43
57
|
```ts
|
|
44
58
|
// From core
|
|
45
|
-
type Config, Components, Templates,
|
|
59
|
+
type Config, Components, Templates, Registration, TemplateRegistration,
|
|
46
60
|
type ComponentConfig, TemplateConfig,
|
|
47
|
-
type
|
|
48
|
-
type RenderContext,
|
|
61
|
+
type ContentfulComponent, ContentfulTemplate,
|
|
62
|
+
type RenderContext, ResolveToken,
|
|
49
63
|
type ExperiencePayload, ExperienceNode, ComponentTypeNode, TemplateNode,
|
|
50
64
|
type PortableRenderPlan, PortableRenderNode, PortableTemplate,
|
|
51
65
|
type DesignPropValue, ManualDesignValue, DesignToken, ValuesByViewport,
|
|
52
66
|
type ViewportDef, ExperienceContext, ResolveContext,
|
|
53
67
|
type ResolverConfig, ResolveExperienceOptions
|
|
54
68
|
|
|
55
|
-
// From design (
|
|
56
|
-
getValueForViewport, getViewportIndex, resolveDesignProperties, toCssMediaQuery
|
|
69
|
+
// From design (if you want to do your own viewport-aware resolution)
|
|
70
|
+
getValueForViewport, getViewportIndex, resolveDesignProperties, toCssMediaQuery,
|
|
71
|
+
isCssProperty, toCssKey, CSS_PROPERTIES
|
|
57
72
|
```
|
|
58
73
|
|
|
59
74
|
---
|
|
@@ -61,32 +76,43 @@ getValueForViewport, getViewportIndex, resolveDesignProperties, toCssMediaQuery
|
|
|
61
76
|
## Quick reference
|
|
62
77
|
|
|
63
78
|
```svelte
|
|
64
|
-
<!-- Button.svelte -->
|
|
79
|
+
<!-- Button.svelte: content via props, design via the helper -->
|
|
65
80
|
<script lang="ts">
|
|
66
|
-
|
|
81
|
+
import { getDesignValues, toCss } from '@contentful/experiences-svelte';
|
|
82
|
+
|
|
83
|
+
let { label = 'Button', url }: ButtonProps = $props();
|
|
84
|
+
const design = $derived(getDesignValues());
|
|
85
|
+
const style = $derived(toCss(design));
|
|
67
86
|
</script>
|
|
68
87
|
{#if url}
|
|
69
|
-
<a href={url}>{
|
|
88
|
+
<a href={url} style={style}>{label}</a>
|
|
70
89
|
{:else}
|
|
71
|
-
<button type="button">{
|
|
90
|
+
<button type="button" style={style}>{label}</button>
|
|
72
91
|
{/if}
|
|
73
92
|
```
|
|
74
93
|
|
|
75
94
|
```ts
|
|
76
95
|
// experience-config.ts
|
|
77
|
-
import {
|
|
96
|
+
import {
|
|
97
|
+
defineComponent,
|
|
98
|
+
type Components,
|
|
99
|
+
type Config,
|
|
100
|
+
type ResolveToken,
|
|
101
|
+
} from '@contentful/experiences-svelte';
|
|
78
102
|
import Button from './components/Button.svelte';
|
|
79
103
|
import type { ButtonProps } from './components/Button.svelte';
|
|
80
104
|
|
|
81
105
|
const components: Components = {
|
|
82
|
-
|
|
83
|
-
|
|
106
|
+
// Bare component, or defineComponent({...}) when you need defaults/resolveData.
|
|
107
|
+
Button: defineComponent<ButtonProps>({
|
|
84
108
|
resolveData: ({ content }) => ({ url: ensureScheme(content.url) }),
|
|
85
109
|
component: Button,
|
|
86
110
|
}),
|
|
87
111
|
};
|
|
88
112
|
|
|
89
|
-
|
|
113
|
+
const resolveToken: ResolveToken = (token) => designTokens[token.value];
|
|
114
|
+
|
|
115
|
+
export const experienceConfig: Config = { components, resolveToken };
|
|
90
116
|
```
|
|
91
117
|
|
|
92
118
|
```svelte
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* same seed.
|
|
10
10
|
-->
|
|
11
11
|
<script lang="ts">
|
|
12
|
-
import type { ExperienceContext, ViewportDef } from '@contentful/experiences-core';
|
|
12
|
+
import type { ExperienceContext, ViewportDef } from '@contentful/experiences-sdk-core';
|
|
13
13
|
|
|
14
14
|
import MissingComponent from './MissingComponent.svelte';
|
|
15
15
|
import NodesRenderer from './NodesRenderer.svelte';
|
package/dist/NodeRenderer.svelte
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<script lang="ts">
|
|
7
7
|
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
|
-
import type { PortableRenderNode } from '@contentful/experiences-core';
|
|
9
|
+
import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
|
|
10
10
|
import { applyTokenResolver, resolveDesignProperties } from '@contentful/experiences-design';
|
|
11
11
|
|
|
12
12
|
import { setContentfulComponent, setResolvedDesign } from './context.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { PortableRenderNode } from '@contentful/experiences-core';
|
|
2
|
+
import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
|
|
3
3
|
import type { RenderUnknown } from './component-props.js';
|
|
4
4
|
import { type Config, type RenderContext } from './types.js';
|
|
5
5
|
interface NodeRendererProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRenderer.svelte.d.ts","sourceRoot":"","sources":["../src/NodeRenderer.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NodeRenderer.svelte.d.ts","sourceRoot":"","sources":["../src/NodeRenderer.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAGH,KAAK,MAAM,EACX,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAGpB,UAAU,iBAAiB;IACzB,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,aAAa,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAoEH,QAAA,MAAM,YAAY,uDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* the active viewport is sourced (initial seed vs reactive matchMedia).
|
|
26
26
|
-->
|
|
27
27
|
<script lang="ts">
|
|
28
|
-
import type { PortableRenderNode } from '@contentful/experiences-core';
|
|
28
|
+
import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
|
|
29
29
|
|
|
30
30
|
import NodeRenderer from './NodeRenderer.svelte';
|
|
31
31
|
import NodesRenderer from './NodesRenderer.svelte';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PortableRenderNode } from '@contentful/experiences-core';
|
|
1
|
+
import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
|
|
2
2
|
import NodesRenderer from './NodesRenderer.svelte';
|
|
3
3
|
import type { RenderUnknown } from './component-props.js';
|
|
4
4
|
import type { Config, RenderContext } from './types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodesRenderer.svelte.d.ts","sourceRoot":"","sources":["../src/NodesRenderer.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NodesRenderer.svelte.d.ts","sourceRoot":"","sources":["../src/NodesRenderer.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,aAAa,MAAM,wBAAwB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGtD,UAAU,kBAAkB;IAC1B,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,aAAa,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;CAC9B;AAwBH,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* renderer. For editor mode, render the client variant on a hydrated route.
|
|
9
9
|
-->
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import type { ExperienceContext, ViewportDef } from '@contentful/experiences-core';
|
|
11
|
+
import type { ExperienceContext, ViewportDef } from '@contentful/experiences-sdk-core';
|
|
12
12
|
import { getViewportIndex } from '@contentful/experiences-design';
|
|
13
13
|
|
|
14
14
|
import MissingComponent from './MissingComponent.svelte';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import type { Snippet } from 'svelte';
|
|
10
10
|
|
|
11
|
-
import type { PortableTemplate } from '@contentful/experiences-core';
|
|
11
|
+
import type { PortableTemplate } from '@contentful/experiences-sdk-core';
|
|
12
12
|
import { applyTokenResolver, resolveDesignProperties } from '@contentful/experiences-design';
|
|
13
13
|
|
|
14
14
|
import { setContentfulTemplate, setResolvedDesign } from './context.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { PortableTemplate } from '@contentful/experiences-core';
|
|
2
|
+
import type { PortableTemplate } from '@contentful/experiences-sdk-core';
|
|
3
3
|
import { type Config, type RenderContext } from './types.js';
|
|
4
4
|
interface WrapWithTemplateProps {
|
|
5
5
|
template: PortableTemplate | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapWithTemplate.svelte.d.ts","sourceRoot":"","sources":["../src/WrapWithTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"WrapWithTemplate.svelte.d.ts","sourceRoot":"","sources":["../src/WrapWithTemplate.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE,OAAO,EAGH,KAAK,MAAM,EACX,KAAK,aAAa,EACnB,MAAM,YAAY,CAAC;AAGpB,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,aAAa,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB;AA0EH,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'svelte';
|
|
2
|
-
import type { ExperienceContext, PortableRenderPlan } from '@contentful/experiences-core';
|
|
2
|
+
import type { ExperienceContext, PortableRenderPlan } from '@contentful/experiences-sdk-core';
|
|
3
3
|
import type { Config } from './types.js';
|
|
4
4
|
export interface ServerExperienceRendererProps {
|
|
5
5
|
experience: PortableRenderPlan | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../src/component-props.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"component-props.d.ts","sourceRoot":"","sources":["../src/component-props.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,MAAM,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AAE1E,MAAM,WAAW,qBAAqB;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,9 +12,9 @@ export type { ToCssOptions } from './design-utils.js';
|
|
|
12
12
|
export type { ClientExperienceRendererProps, ClientExperienceRendererProps as ExperienceRendererProps, MissingComponentProps, RenderUnknown, ServerExperienceRendererProps, } from './component-props.js';
|
|
13
13
|
export { defineComponent, defineTemplate, normalizeComponentRegistration, normalizeTemplateRegistration, } from './types.js';
|
|
14
14
|
export type { ComponentConfig, Components, Config, ContentfulComponent, ContentfulTemplate, Registration, RenderContext, ResolveToken, TemplateConfig, TemplateRegistration, Templates, } from './types.js';
|
|
15
|
-
export { resolveExperience } from '@contentful/experiences-core';
|
|
16
|
-
export type { ResolverConfig, ResolveExperienceOptions } from '@contentful/experiences-core';
|
|
17
|
-
export type { ComponentTypeNode, ComponentTypeRef, DesignPropValue, DesignToken, ExperienceContext, ExperienceNode, ExperiencePayload, ExperienceSys, ManualDesignValue, PortableRegistration, PortableRenderNode, PortableRenderPlan, PortableTemplate, ResolveContext, TemplateNode, TemplateRef, ValuesByViewport, ViewportDef, } from '@contentful/experiences-core';
|
|
15
|
+
export { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
16
|
+
export type { ResolverConfig, ResolveExperienceOptions } from '@contentful/experiences-sdk-core';
|
|
17
|
+
export type { ComponentTypeNode, ComponentTypeRef, DesignPropValue, DesignToken, ExperienceContext, ExperienceNode, ExperiencePayload, ExperienceSys, ManualDesignValue, PortableRegistration, PortableRenderNode, PortableRenderPlan, PortableTemplate, ResolveContext, TemplateNode, TemplateRef, ValuesByViewport, ViewportDef, } from '@contentful/experiences-sdk-core';
|
|
18
18
|
export { CSS_PROPERTIES, getValueForViewport, getViewportIndex, isCssProperty, resolveDesignProperties, toCssKey, toCssMediaQuery, } from '@contentful/experiences-design';
|
|
19
19
|
export { ContentfulViewDelivery, ContentfulViewDeliveryClient, NotFoundError, createClient, fetchExperience, } from '@contentful/experiences-client';
|
|
20
20
|
export type { ClientOptions, CreateClientOptions, ExperienceOptions, ResolveOptions, } from '@contentful/experiences-client';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AACxF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIxE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItD,YAAY,EACV,6BAA6B,EAC7B,6BAA6B,IAAI,uBAAuB,EACxD,qBAAqB,EACrB,aAAa,EACb,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,cAAc,EACd,8BAA8B,EAC9B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,eAAe,EACf,UAAU,EACV,MAAM,EACN,mBAAmB,EACnB,kBAAkB,EAClB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YAAY,CAAC;AAGpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAGjG,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,WAAW,GACZ,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,uBAAuB,EACvB,QAAQ,EACR,eAAe,GAChB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,GACf,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Customers add ONLY this package to their app's dependencies. Everything
|
|
5
5
|
* needed to render an Experience — types, the resolver, viewport utilities,
|
|
6
6
|
* the renderer components, the authoring helpers — is re-exported from here.
|
|
7
|
-
* The internal `@contentful/experiences-core` and
|
|
7
|
+
* The internal `@contentful/experiences-sdk-core` and
|
|
8
8
|
* `@contentful/experiences-design` packages are workspace-only implementation
|
|
9
9
|
* details; they are not part of the public API.
|
|
10
10
|
*
|
|
@@ -27,7 +27,7 @@ export { toCss } from './design-utils.js';
|
|
|
27
27
|
// ─── Authoring helpers + Config types ─────────────────────────────────────
|
|
28
28
|
export { defineComponent, defineTemplate, normalizeComponentRegistration, normalizeTemplateRegistration, } from './types.js';
|
|
29
29
|
// ─── Resolver (re-exported from render-core) ──────────────────────────────
|
|
30
|
-
export { resolveExperience } from '@contentful/experiences-core';
|
|
30
|
+
export { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
31
31
|
// ─── Design utilities (re-exported from design) ───────────────────────────
|
|
32
32
|
export { CSS_PROPERTIES, getValueForViewport, getViewportIndex, isCssProperty, resolveDesignProperties, toCssKey, toCssMediaQuery, } from '@contentful/experiences-design';
|
|
33
33
|
// ─── Delivery client + fetchExperience ────────────────────────────────────
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { render } from '@testing-library/svelte';
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import { resolveExperience } from '@contentful/experiences-core';
|
|
3
|
+
import { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
4
4
|
import ServerExperienceRenderer from './ServerExperienceRenderer.svelte';
|
|
5
5
|
import CapturingComponent from './test-fixtures/CapturingComponent.svelte';
|
|
6
6
|
import ButtonFixture from './test-fixtures/ButtonFixture.svelte';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'svelte';
|
|
2
|
-
import type { DesignPropValue, ExperienceContext, ResolveContext, ResolveToken, ViewportDef } from '@contentful/experiences-core';
|
|
2
|
+
import type { DesignPropValue, ExperienceContext, ResolveContext, ResolveToken, ViewportDef } from '@contentful/experiences-sdk-core';
|
|
3
3
|
export type { ResolveContext, ResolveToken };
|
|
4
4
|
/**
|
|
5
5
|
* The full Contentful-side payload for a single component instance, exposed
|
|
@@ -84,7 +84,7 @@ export interface Config {
|
|
|
84
84
|
/**
|
|
85
85
|
* Resolves `DesignToken` envelopes to runtime values before they reach a
|
|
86
86
|
* component. If omitted, envelopes pass through unchanged. See `ResolveToken`
|
|
87
|
-
* in `@contentful/experiences-core` for the full contract.
|
|
87
|
+
* in `@contentful/experiences-sdk-core` for the full contract.
|
|
88
88
|
*/
|
|
89
89
|
resolveToken?: ResolveToken;
|
|
90
90
|
}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,WAAW,EACZ,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,WAAW,EACZ,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,WAAW,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AC,KAAK,CAAC,GAC5B,cAAc,CAAC,KAAK,CAAC,CAEvB;AAED,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5E,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAC7B,eAAe,CAAC,KAAK,CAAC,CAExB;AAGD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC;AAElE,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,MAAM,EAC7D,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC,GACnB,eAAe,CAAC,CAAC,CAAC,CAMpB;AAED,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,MAAM,EAC5D,GAAG,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC3B,cAAc,CAAC,CAAC,CAAC,CAMnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-active-viewport.svelte.d.ts","sourceRoot":"","sources":["../src/use-active-viewport.svelte.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-active-viewport.svelte.d.ts","sourceRoot":"","sources":["../src/use-active-viewport.svelte.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAGpE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AA4BD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EAAE,EACxB,iBAAiB,CAAC,EAAE,MAAM,GACzB,uBAAuB,CAiDzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-svelte",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Svelte adapter for Contentful Experiences — Server and Client renderers over a PortableRenderPlan",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@contentful/experiences-client": "0.1.
|
|
39
|
-
"@contentful/experiences-core": "0.5.
|
|
40
|
-
"@contentful/experiences-design": "0.5.
|
|
38
|
+
"@contentful/experiences-client": "0.1.3",
|
|
39
|
+
"@contentful/experiences-sdk-core": "0.5.3",
|
|
40
|
+
"@contentful/experiences-design": "0.5.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"svelte": "^5.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/package": "^2.
|
|
46
|
+
"@sveltejs/package": "^2.5.8",
|
|
47
47
|
"@sveltejs/vite-plugin-svelte": "^4.0.4",
|
|
48
|
-
"@testing-library/jest-dom": "^6.
|
|
49
|
-
"@testing-library/svelte": "^5.2
|
|
50
|
-
"jsdom": "^
|
|
51
|
-
"publint": "^0.
|
|
48
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
49
|
+
"@testing-library/svelte": "^5.4.2",
|
|
50
|
+
"jsdom": "^29.1.1",
|
|
51
|
+
"publint": "^0.3.21",
|
|
52
52
|
"svelte": "^5.0.0",
|
|
53
|
-
"svelte-check": "^4.
|
|
53
|
+
"svelte-check": "^4.7.1"
|
|
54
54
|
}
|
|
55
55
|
}
|