@contentful/experiences-svelte 0.6.4 → 0.6.6

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 CHANGED
@@ -1,3 +1,27 @@
1
+ ## 0.6.6 (2026-09-21)
2
+
3
+ ### 🚀 Features
4
+
5
+ - deprecate the SDK viewport surface, guard absent viewports [SPA-5272] ([4a74473](https://github.com/contentful/experiences/commit/4a74473))
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - reword deprecation notices, drop internal ticket link [SPA-5272] ([8361460](https://github.com/contentful/experiences/commit/8361460))
10
+
11
+ ### 🧱 Updated Dependencies
12
+
13
+ - Updated live-preview to 0.1.4
14
+ - Updated client to 0.4.5
15
+ - Updated design to 0.8.4
16
+ - Updated core to 0.8.4
17
+
18
+ ## 0.6.5 (2026-09-21)
19
+
20
+ ### 🧱 Updated Dependencies
21
+
22
+ - Updated live-preview to 0.1.3
23
+ - Updated client to 0.4.4
24
+
1
25
  ## 0.6.4 (2026-09-18)
2
26
 
3
27
  ### 🚀 Features
@@ -767,6 +767,24 @@ describe('ServerExperienceRenderer — server pre-resolved design values', () =>
767
767
  expect(container.innerHTML).toContain('data-padding="12px"');
768
768
  });
769
769
  });
770
+ describe('ServerExperienceRenderer — absent payload.viewports', () => {
771
+ it('renders flat design values when the payload has no viewports field', async () => {
772
+ const cfg = { components: { heading: HeadingFixture } };
773
+ const plan = await resolveExperience({
774
+ nodes: [
775
+ componentNode('heading', {
776
+ id: 'h',
777
+ designProperties: { cfFontSize: m('32px') },
778
+ }),
779
+ ],
780
+ }, cfg);
781
+ expect(plan.viewports).toEqual([]);
782
+ const { container } = render(ServerExperienceRenderer, {
783
+ props: { experience: plan, config: cfg },
784
+ });
785
+ expect(container.innerHTML).toContain('data-font-size="32px"');
786
+ });
787
+ });
770
788
  describe('toCss (Svelte)', () => {
771
789
  it('converts bare (non-cf) CSS keys — the shape real payloads use', () => {
772
790
  expect(toCss({ fontSize: '20px', backgroundColor: '#4f39f6' })).toEqual({
@@ -1,4 +1,9 @@
1
1
  import type { ViewportDef } from '@contentful/experiences-sdk-core';
2
+ /**
3
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
4
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
5
+ * Will not be removed before 2026-10-06.
6
+ */
2
7
  export interface UseActiveViewportResult {
3
8
  readonly activeViewportIndex: number;
4
9
  }
@@ -9,6 +14,10 @@ export interface UseActiveViewportResult {
9
14
  *
10
15
  * Must be called at the top level of a `.svelte` component or a function
11
16
  * that's itself called during component setup (because of `$effect`).
17
+ *
18
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
19
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
20
+ * Will not be removed before 2026-10-06.
12
21
  */
13
22
  export declare function useActiveViewport(viewports: ViewportDef[], initialViewportId?: string): UseActiveViewportResult;
14
23
  //# sourceMappingURL=use-active-viewport.svelte.d.ts.map
@@ -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,kCAAkC,CAAC;AAGpE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EAAE,EACxB,iBAAiB,CAAC,EAAE,MAAM,GACzB,uBAAuB,CAiDzB"}
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;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,WAAW,EAAE,EACxB,iBAAiB,CAAC,EAAE,MAAM,GACzB,uBAAuB,CAiDzB"}
@@ -18,6 +18,10 @@ import { createMediaQueryMatchers, getViewportIndex } from '@contentful/experien
18
18
  *
19
19
  * Must be called at the top level of a `.svelte` component or a function
20
20
  * that's itself called during component setup (because of `$effect`).
21
+ *
22
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
23
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
24
+ * Will not be removed before 2026-10-06.
21
25
  */
22
26
  export function useActiveViewport(viewports, initialViewportId) {
23
27
  const initialIndex = getViewportIndex(viewports, initialViewportId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-svelte",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Svelte adapter for Contentful Experiences — Server and Client renderers over a PortableRenderPlan",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,10 +35,10 @@
35
35
  "check": "svelte-check --tsconfig ./tsconfig.json"
36
36
  },
37
37
  "dependencies": {
38
- "@contentful/experiences-client": "0.4.3",
39
- "@contentful/experiences-sdk-core": "0.8.3",
40
- "@contentful/experiences-design": "0.8.3",
41
- "@contentful/experiences-live-preview": "0.1.2"
38
+ "@contentful/experiences-client": "0.4.5",
39
+ "@contentful/experiences-sdk-core": "0.8.4",
40
+ "@contentful/experiences-design": "0.8.4",
41
+ "@contentful/experiences-live-preview": "0.1.4"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "svelte": "^5.55.7"