@contentful/experiences-svelte 0.5.6 → 0.5.7

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,15 @@
1
+ ## 0.5.7 (2026-08-20)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **adapter-angular:** scaffold @contentful/experiences-angular [AIS-361] ([#134](https://github.com/contentful/experiences/pull/134))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated client to 0.3.6
10
+ - Updated design to 0.7.6
11
+ - Updated core to 0.7.6
12
+
1
13
  ## 0.5.6 (2026-08-12)
2
14
 
3
15
  ### 🩹 Fixes
@@ -12,13 +12,13 @@
12
12
  import type { Snippet } from 'svelte';
13
13
 
14
14
  import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
15
+ import { selectResolvedDesign } from '@contentful/experiences-design';
15
16
 
16
17
  import {
17
18
  setContentfulComponent,
18
19
  setContentfulExperienceTemplate,
19
20
  setResolvedDesign,
20
21
  } from './context.js';
21
- import { selectResolvedDesign } from './design-utils.js';
22
22
  import type { RenderUnknown } from './component-props.js';
23
23
  import {
24
24
  normalizeComponentRegistration,
@@ -1,11 +1,3 @@
1
- import type { DesignPropValue, ResolveToken, ViewportDef } from '@contentful/experiences-sdk-core';
2
- export declare function selectResolvedDesign(props: {
3
- design: Record<string, unknown>;
4
- designRaw: Record<string, DesignPropValue>;
5
- }, viewports: ViewportDef[], activeViewportIndex: number, fallbackViewportIndex: number, resolveToken: ResolveToken | undefined): {
6
- props: Record<string, unknown>;
7
- unresolved: string[];
8
- };
9
1
  export interface ToCssOptions {
10
2
  /** Keys to skip, matched against the original record key. */
11
3
  exclude?: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"design-utils.d.ts","sourceRoot":"","sources":["../src/design-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAUnG,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CAAE,EACtF,SAAS,EAAE,WAAW,EAAE,EACxB,mBAAmB,EAAE,MAAM,EAC3B,qBAAqB,EAAE,MAAM,EAC7B,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,CAM1D;AAED,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,OAAO,EAAE,GAAE,YAAiB,GACtC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAYjC"}
1
+ {"version":3,"file":"design-utils.d.ts","sourceRoot":"","sources":["../src/design-utils.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,KAAK,CACnB,MAAM,EAAE,MAAM,EACd,EAAE,OAAO,EAAE,OAAO,EAAE,GAAE,YAAiB,GACtC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAYjC"}
@@ -1,13 +1,4 @@
1
- import { applyTokenResolver, isCssProperty, resolveDesignProperties, toCssKey, } from '@contentful/experiences-design';
2
- // Use the server-resolved `props.design` when the active viewport matches the
3
- // fallback; otherwise recompute the cascade from raw `props.designRaw`.
4
- export function selectResolvedDesign(props, viewports, activeViewportIndex, fallbackViewportIndex, resolveToken) {
5
- if (activeViewportIndex === fallbackViewportIndex) {
6
- return { props: props.design, unresolved: [] };
7
- }
8
- const resolvedDesign = resolveDesignProperties(props.designRaw, viewports, activeViewportIndex);
9
- return applyTokenResolver(resolvedDesign, resolveToken);
10
- }
1
+ import { isCssProperty, toCssKey } from '@contentful/experiences-design';
11
2
  /**
12
3
  * Convert a design record into a plain style object, keeping only keys that
13
4
  * normalize to a known CSS property. Non-CSS keys (`variant`, `as`, …) and
@@ -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;AA4BD;;;;;;;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,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"}
@@ -10,28 +10,7 @@
10
10
  * to seed the first render so SSR + client agree on viewport before
11
11
  * window.matchMedia takes over.
12
12
  */
13
- import { getViewportIndex, toCssMediaQuery } from '@contentful/experiences-design';
14
- function createMediaQueryMatchers(viewports) {
15
- const mediaQueryMatches = new Array(viewports.length).fill(false);
16
- // The first viewport is the wildcard "*" and always matches.
17
- mediaQueryMatches[0] = true;
18
- const mediaQueryMatchers = [];
19
- if (typeof window === 'undefined') {
20
- return [mediaQueryMatchers, mediaQueryMatches];
21
- }
22
- for (let index = 0; index < viewports.length; index++) {
23
- const viewport = viewports[index];
24
- if (!viewport)
25
- continue;
26
- const cssQuery = toCssMediaQuery(viewport);
27
- if (!cssQuery)
28
- continue;
29
- const matcher = window.matchMedia(cssQuery);
30
- mediaQueryMatches[index] = matcher.matches;
31
- mediaQueryMatchers.push({ index, signal: matcher });
32
- }
33
- return [mediaQueryMatchers, mediaQueryMatches];
34
- }
13
+ import { createMediaQueryMatchers, getViewportIndex } from '@contentful/experiences-design';
35
14
  /**
36
15
  * Returns a reactive object whose `activeViewportIndex` updates as the
37
16
  * window's matched media queries change. Mounts listeners via `$effect`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-svelte",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Svelte adapter for Contentful Experiences — Server and Client renderers over a PortableRenderPlan",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,9 +35,9 @@
35
35
  "check": "svelte-check --tsconfig ./tsconfig.json"
36
36
  },
37
37
  "dependencies": {
38
- "@contentful/experiences-client": "0.3.5",
39
- "@contentful/experiences-sdk-core": "0.7.5",
40
- "@contentful/experiences-design": "0.7.5"
38
+ "@contentful/experiences-client": "0.3.6",
39
+ "@contentful/experiences-sdk-core": "0.7.6",
40
+ "@contentful/experiences-design": "0.7.6"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "svelte": "^5.55.7"