@contentful/experiences-svelte 0.11.3 → 0.11.4
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 +39 -0
- package/README.md +2 -1
- package/dist/NodeRenderer.svelte +36 -9
- package/dist/NodeRenderer.svelte.d.ts.map +1 -1
- package/dist/attribution.ssr.test.d.ts +2 -0
- package/dist/attribution.ssr.test.d.ts.map +1 -0
- package/dist/attribution.ssr.test.js +91 -0
- package/dist/attribution.test.d.ts +2 -0
- package/dist/attribution.test.d.ts.map +1 -0
- package/dist/attribution.test.js +94 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/test-fixtures/AttributionProbe.svelte +13 -0
- package/dist/test-fixtures/AttributionProbe.svelte.d.ts +19 -0
- package/dist/test-fixtures/AttributionProbe.svelte.d.ts.map +1 -0
- package/dist/test-fixtures/AttributionTemplateProbe.svelte +19 -0
- package/dist/test-fixtures/AttributionTemplateProbe.svelte.d.ts +8 -0
- package/dist/test-fixtures/AttributionTemplateProbe.svelte.d.ts.map +1 -0
- package/dist/test-fixtures/source-map.d.ts +35 -0
- package/dist/test-fixtures/source-map.d.ts.map +1 -0
- package/dist/test-fixtures/source-map.js +14 -0
- package/dist/types.d.ts +13 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
## 0.11.4 (2026-10-14)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- ⚠️ **web:** [NT-4312] track by scope occurrence instead of node id ([#225](https://github.com/contentful/experiences/pull/225))
|
|
6
|
+
- [NT-4312] expose source-map attribution through the adapter context accessors ([#224](https://github.com/contentful/experiences/pull/224))
|
|
7
|
+
|
|
8
|
+
### ⚠️ Breaking Changes
|
|
9
|
+
|
|
10
|
+
- **web:** [NT-4312] track by scope occurrence instead of node id ([#225](https://github.com/contentful/experiences/pull/225))
|
|
11
|
+
`data-ctfl-node-id` is replaced by `data-ctfl-scopes`, a
|
|
12
|
+
space-separated list of scope occurrence keys, and `resolveAttribution` now
|
|
13
|
+
takes a key rather than a node id. `getTrackingAttributes` takes a node's
|
|
14
|
+
`attribution` instead of its `nodeId`.
|
|
15
|
+
A node id cannot say that one element sits in several scopes, or that several
|
|
16
|
+
root elements make up one Fragment occurrence. Keys resolve through
|
|
17
|
+
`plan.attribution.scopes`.
|
|
18
|
+
`getTrackingAttributes` and the attribute names are pure string functions, so
|
|
19
|
+
they move into core, and React, Svelte and Angular re-export them: components
|
|
20
|
+
stamp the attribute from `attribution` without installing `web`. The
|
|
21
|
+
`tracking-attributes` subpath re-exports them from core.
|
|
22
|
+
The detectors group elements by key and hand each group to one observer, so an
|
|
23
|
+
occurrence is one view or hover series: it is in view while any element has a
|
|
24
|
+
visible pixel, hovered until the last element is left, and its final event keeps
|
|
25
|
+
the attribution that qualified it. Clicks go to the innermost Fragment
|
|
26
|
+
occurrence of the nearest tracked ancestor, read from the attribute so the order
|
|
27
|
+
survives `refresh()`. Experiences remain view-only.
|
|
28
|
+
This diverges from the Optimization SDK, which tracks per element; the ticket's
|
|
29
|
+
grouping requirement forces it. The interaction-tracking ADR is removed.
|
|
30
|
+
Refs: NT-4312
|
|
31
|
+
|
|
32
|
+
### 🧱 Updated Dependencies
|
|
33
|
+
|
|
34
|
+
- Updated live-preview to 0.6.4
|
|
35
|
+
- Updated runtime to 0.0.3
|
|
36
|
+
- Updated client to 0.9.4
|
|
37
|
+
- Updated design to 0.12.2
|
|
38
|
+
- Updated core to 0.12.3
|
|
39
|
+
|
|
1
40
|
## 0.11.3 (2026-10-12)
|
|
2
41
|
|
|
3
42
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -119,8 +119,9 @@ NodesRenderer; // Exposed so you can re-render a slot's raw nodes yourself (see
|
|
|
119
119
|
getDesignValues<T>(); // Escape hatch: the same resolved design record that auto-fills props; read in a $derived to stay reactive
|
|
120
120
|
toCss(design, options?); // Turns a design record into a plain style object, keeping only real CSS keys
|
|
121
121
|
getExperience(); // RenderContext: debug, metadata
|
|
122
|
-
getContentfulComponent(); // Raw payload for the enclosing node (or undefined)
|
|
122
|
+
getContentfulComponent(); // Raw payload for the enclosing node (or undefined), including `attribution`
|
|
123
123
|
getContentfulExperienceTemplate(); // Same, for an enclosing coded Experience Template node
|
|
124
|
+
getTrackingAttributes(attribution); // Attributes to spread on a node's outermost element for interaction tracking
|
|
124
125
|
type ToCssOptions;
|
|
125
126
|
```
|
|
126
127
|
|
package/dist/NodeRenderer.svelte
CHANGED
|
@@ -80,23 +80,50 @@
|
|
|
80
80
|
: normalizeComponentRegistration(entry);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
+
// Getters over the reactive `node` prop, not a snapshot: `{#each}` in
|
|
84
|
+
// NodesRenderer keys on `nodeId`, so a plan update that reuses an id keeps
|
|
85
|
+
// this instance, and a one-time copy would go stale.
|
|
83
86
|
if (isExperienceTemplate) {
|
|
84
87
|
const contentful: ContentfulExperienceTemplate = {
|
|
85
88
|
experienceTemplateId: id,
|
|
86
|
-
nodeId
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
get nodeId() {
|
|
90
|
+
return node.nodeId;
|
|
91
|
+
},
|
|
92
|
+
get content() {
|
|
93
|
+
return node.props.content;
|
|
94
|
+
},
|
|
95
|
+
get design() {
|
|
96
|
+
return node.props.designRaw;
|
|
97
|
+
},
|
|
98
|
+
get resolved() {
|
|
99
|
+
return node.props.resolved;
|
|
100
|
+
},
|
|
101
|
+
get attribution() {
|
|
102
|
+
return node.attribution;
|
|
103
|
+
},
|
|
90
104
|
};
|
|
91
105
|
setContentfulExperienceTemplate(contentful);
|
|
92
106
|
} else {
|
|
93
107
|
const contentful: ContentfulComponent = {
|
|
94
108
|
componentId: id,
|
|
95
|
-
nodeId
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
get nodeId() {
|
|
110
|
+
return node.nodeId;
|
|
111
|
+
},
|
|
112
|
+
get content() {
|
|
113
|
+
return node.props.content;
|
|
114
|
+
},
|
|
115
|
+
get design() {
|
|
116
|
+
return node.props.designRaw;
|
|
117
|
+
},
|
|
118
|
+
get resolved() {
|
|
119
|
+
return node.props.resolved;
|
|
120
|
+
},
|
|
121
|
+
get attribution() {
|
|
122
|
+
return node.attribution;
|
|
123
|
+
},
|
|
124
|
+
get slots() {
|
|
125
|
+
return node.slots;
|
|
126
|
+
},
|
|
100
127
|
};
|
|
101
128
|
setContentfulComponent(contentful);
|
|
102
129
|
}
|
|
@@ -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,kCAAkC,CAAC;AAO3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAKH,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,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,kBAAkB,CAAC;IACjC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;CACzC;
|
|
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;AAO3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,EAKH,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,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,kBAAkB,CAAC;IACjC;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;CACzC;AA4KH,QAAA,MAAM,YAAY,uDAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.ssr.test.d.ts","sourceRoot":"","sources":["../src/attribution.ssr.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* `getContentfulComponent().attribution` under `svelte/server`, where the
|
|
3
|
+
* context getters are read once during the synchronous server render.
|
|
4
|
+
*
|
|
5
|
+
* Runs under vitest.ssr.config.ts (environment: node).
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, it } from 'vitest';
|
|
8
|
+
import { render } from 'svelte/server';
|
|
9
|
+
import { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
10
|
+
import ServerExperienceRenderer from './ServerExperienceRenderer.svelte';
|
|
11
|
+
import { minimalSourceMap } from './test-fixtures/source-map.js';
|
|
12
|
+
import AttributionProbe from './test-fixtures/AttributionProbe.svelte';
|
|
13
|
+
import AttributionTemplateProbe from './test-fixtures/AttributionTemplateProbe.svelte';
|
|
14
|
+
const node = {
|
|
15
|
+
id: 'n',
|
|
16
|
+
component: {
|
|
17
|
+
sys: {
|
|
18
|
+
type: 'ResourceLink',
|
|
19
|
+
linkType: 'Contentful:Component',
|
|
20
|
+
urn: 'crn:contentful:::experience:spaces/$self/environments/$self/components/probe',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
const config = { components: { probe: AttributionProbe } };
|
|
25
|
+
describe('getContentfulComponent().attribution (server build)', () => {
|
|
26
|
+
it('renders the node attribution into the markup', async () => {
|
|
27
|
+
const payload = { nodes: [node] };
|
|
28
|
+
const plan = await resolveExperience(payload, config, {
|
|
29
|
+
sourceMap: minimalSourceMap(),
|
|
30
|
+
});
|
|
31
|
+
const { body } = render(ServerExperienceRenderer, {
|
|
32
|
+
props: { experience: plan, config },
|
|
33
|
+
});
|
|
34
|
+
expect(body).toContain('>exp-a</span>');
|
|
35
|
+
});
|
|
36
|
+
it('renders nothing for a plan without a source map', async () => {
|
|
37
|
+
const plan = await resolveExperience({ nodes: [node] }, config);
|
|
38
|
+
const { body } = render(ServerExperienceRenderer, {
|
|
39
|
+
props: { experience: plan, config },
|
|
40
|
+
});
|
|
41
|
+
expect(body).toMatch(/<span data-scopes=""[^>]*><\/span>/);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('getContentfulExperienceTemplate().attribution (server build)', () => {
|
|
45
|
+
it('renders the template node attribution into the markup', async () => {
|
|
46
|
+
const templateConfig = {
|
|
47
|
+
components: {},
|
|
48
|
+
experienceTemplates: { page: AttributionTemplateProbe },
|
|
49
|
+
};
|
|
50
|
+
const plan = await resolveExperience({
|
|
51
|
+
nodes: [
|
|
52
|
+
{
|
|
53
|
+
id: 'tpl',
|
|
54
|
+
experienceTemplate: {
|
|
55
|
+
sys: {
|
|
56
|
+
type: 'ResourceLink',
|
|
57
|
+
linkType: 'Contentful:ExperienceTemplate',
|
|
58
|
+
urn: 'crn:contentful:::experience:spaces/$self/environments/$self/experienceTemplates/page',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
}, templateConfig, {
|
|
64
|
+
sourceMap: minimalSourceMap({
|
|
65
|
+
node: 'tpl',
|
|
66
|
+
leaf: { kind: 'ExperienceTemplate', id: 'page' },
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
const { body } = render(ServerExperienceRenderer, {
|
|
70
|
+
props: { experience: plan, config: templateConfig },
|
|
71
|
+
});
|
|
72
|
+
expect(body).toContain('exp-a');
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
describe('an unusable source map (server build)', () => {
|
|
76
|
+
const good = minimalSourceMap();
|
|
77
|
+
// A wrong version, a missing table, and a node whose chain is nonsense.
|
|
78
|
+
const unusable = [
|
|
79
|
+
{ ...good, version: 99 },
|
|
80
|
+
{ ...good, layers: undefined },
|
|
81
|
+
{ ...good, nodes: { n: { layers: 'nope', scope: 0 } } },
|
|
82
|
+
];
|
|
83
|
+
it.each(unusable.map((map, i) => [i, map]))('still server-renders the component, with no attribution (case %i)', async (_i, map) => {
|
|
84
|
+
const plan = await resolveExperience({ nodes: [node] }, config, { sourceMap: map });
|
|
85
|
+
const { body } = render(ServerExperienceRenderer, {
|
|
86
|
+
props: { experience: plan, config },
|
|
87
|
+
});
|
|
88
|
+
expect(body).toMatch(/<span data-scopes=""[^>]*><\/span>/);
|
|
89
|
+
expect(plan.diagnostics).toEqual([]);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution.test.d.ts","sourceRoot":"","sources":["../src/attribution.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { render } from '@testing-library/svelte';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
4
|
+
import ClientExperienceRenderer from './ClientExperienceRenderer.svelte';
|
|
5
|
+
import { minimalSourceMap } from './test-fixtures/source-map.js';
|
|
6
|
+
import AttributionProbe from './test-fixtures/AttributionProbe.svelte';
|
|
7
|
+
import AttributionTemplateProbe from './test-fixtures/AttributionTemplateProbe.svelte';
|
|
8
|
+
const node = {
|
|
9
|
+
id: 'n',
|
|
10
|
+
component: {
|
|
11
|
+
sys: {
|
|
12
|
+
type: 'ResourceLink',
|
|
13
|
+
linkType: 'Contentful:Component',
|
|
14
|
+
urn: 'crn:contentful:::experience:spaces/$self/environments/$self/components/probe',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
const payload = { nodes: [node] };
|
|
19
|
+
const config = { components: { probe: AttributionProbe } };
|
|
20
|
+
const sourceMap = (experienceId) => minimalSourceMap({ experienceId });
|
|
21
|
+
describe('getContentfulComponent().attribution (client build)', () => {
|
|
22
|
+
it('exposes the node attribution and replaces it when a plan reuses the node id', async () => {
|
|
23
|
+
const first = await resolveExperience(payload, config, { sourceMap: sourceMap('exp-a') });
|
|
24
|
+
const second = await resolveExperience(payload, config, { sourceMap: sourceMap('exp-b') });
|
|
25
|
+
const cleared = await resolveExperience(payload, config);
|
|
26
|
+
const { container, rerender } = render(ClientExperienceRenderer, {
|
|
27
|
+
props: { experience: first, config },
|
|
28
|
+
});
|
|
29
|
+
const text = () => container.querySelector('[data-scopes]')?.textContent;
|
|
30
|
+
expect(text()).toBe('exp-a');
|
|
31
|
+
// Exactly what the plan carries: the same value React and Angular are held to.
|
|
32
|
+
expect(container.querySelector('[data-scopes]')?.getAttribute('data-json')).toBe(JSON.stringify(first.nodes[0].attribution));
|
|
33
|
+
await rerender({ experience: second, config });
|
|
34
|
+
expect(text()).toBe('exp-b');
|
|
35
|
+
await rerender({ experience: cleared, config });
|
|
36
|
+
expect(text()).toBe('');
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
describe('an unusable source map (client build)', () => {
|
|
40
|
+
const good = minimalSourceMap();
|
|
41
|
+
// A wrong version, a missing table, and a node whose chain is nonsense.
|
|
42
|
+
const unusable = [
|
|
43
|
+
{ ...good, version: 99 },
|
|
44
|
+
{ ...good, layers: undefined },
|
|
45
|
+
{ ...good, nodes: { n: { layers: 'nope', scope: 0 } } },
|
|
46
|
+
];
|
|
47
|
+
it.each(unusable.map((map, i) => [i, map]))('still renders the component, with no attribution (case %i)', async (_i, map) => {
|
|
48
|
+
const plan = await resolveExperience(payload, config, { sourceMap: map });
|
|
49
|
+
const { container } = render(ClientExperienceRenderer, {
|
|
50
|
+
props: { experience: plan, config },
|
|
51
|
+
});
|
|
52
|
+
expect(container.querySelector('[data-scopes]')).not.toBeNull();
|
|
53
|
+
expect(container.querySelector('[data-scopes]')?.textContent).toBe('');
|
|
54
|
+
expect(container.querySelector('[data-scopes]')?.getAttribute('data-json')).toBe('null');
|
|
55
|
+
expect(plan.diagnostics).toEqual([]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
describe('getContentfulExperienceTemplate().attribution (client build)', () => {
|
|
59
|
+
const templateNode = {
|
|
60
|
+
id: 'tpl',
|
|
61
|
+
experienceTemplate: {
|
|
62
|
+
sys: {
|
|
63
|
+
type: 'ResourceLink',
|
|
64
|
+
linkType: 'Contentful:ExperienceTemplate',
|
|
65
|
+
urn: 'crn:contentful:::experience:spaces/$self/environments/$self/experienceTemplates/page',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const templateConfig = {
|
|
70
|
+
components: {},
|
|
71
|
+
experienceTemplates: { page: AttributionTemplateProbe },
|
|
72
|
+
};
|
|
73
|
+
const templateMap = (experienceId) => minimalSourceMap({
|
|
74
|
+
experienceId,
|
|
75
|
+
node: 'tpl',
|
|
76
|
+
leaf: { kind: 'ExperienceTemplate', id: 'page' },
|
|
77
|
+
});
|
|
78
|
+
it('exposes the template node attribution and replaces it when a plan reuses the node id', async () => {
|
|
79
|
+
const payload = { nodes: [templateNode] };
|
|
80
|
+
const first = await resolveExperience(payload, templateConfig, {
|
|
81
|
+
sourceMap: templateMap('exp-a'),
|
|
82
|
+
});
|
|
83
|
+
const second = await resolveExperience(payload, templateConfig, {
|
|
84
|
+
sourceMap: templateMap('exp-b'),
|
|
85
|
+
});
|
|
86
|
+
const { container, rerender } = render(ClientExperienceRenderer, {
|
|
87
|
+
props: { experience: first, config: templateConfig },
|
|
88
|
+
});
|
|
89
|
+
const text = () => container.querySelector('[data-template-scopes]')?.textContent?.trim();
|
|
90
|
+
expect(text()).toBe('exp-a');
|
|
91
|
+
await rerender({ experience: second, config: templateConfig });
|
|
92
|
+
expect(text()).toBe('exp-b');
|
|
93
|
+
});
|
|
94
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type { ClientExperienceRendererProps, ClientExperienceRendererProps as Ex
|
|
|
21
21
|
export { defineComponent, defineExperienceTemplate, normalizeComponentRegistration, normalizeExperienceTemplateRegistration, } from './types.js';
|
|
22
22
|
export type { ComponentConfig, Components, Config, ContentfulComponent, ContentfulExperienceTemplate, ExperienceTemplateConfig, ExperienceTemplateRegistration, ExperienceTemplates, Registration, RenderContext, ResolveToken, } from './types.js';
|
|
23
23
|
export { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
24
|
+
export { getTrackingAttributes, TRACKING_CLICKABLE_ATTRIBUTE, TRACKING_SCOPES_ATTRIBUTE, } from '@contentful/experiences-sdk-core';
|
|
25
|
+
export type { TrackingAttributes } from '@contentful/experiences-sdk-core';
|
|
24
26
|
export type { ResolverConfig, ResolveExperienceOptions } from '@contentful/experiences-sdk-core';
|
|
25
27
|
export { DEFAULT_PAGE_PROPERTIES, EventBuilder } from '@contentful/experiences-runtime';
|
|
26
28
|
export type { ClickBuilderArgs, EventBuilderConfig, FlagViewBuilderArgs, HoverBuilderArgs, IdentifyBuilderArgs, InteractionBuilderArgsBase, PageViewBuilderArgs, TrackBuilderArgs, UniversalEventBuilderArgs, ViewBuilderArgs, } from '@contentful/experiences-runtime';
|
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;AACxE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAKtE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,YAAY,EACV,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEhG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,YAAY,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iCAAiC,CAAC;AACzC,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,2BAA2B,EAC3B,+BAA+B,EAC/B,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,aAAa,EACb,sBAA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} from './design-utils.js';
|
|
|
34
34
|
export { defineComponent, defineExperienceTemplate, normalizeComponentRegistration, normalizeExperienceTemplateRegistration, } from './types.js';
|
|
35
35
|
// ─── Resolver (re-exported from render-core) ──────────────────────────────
|
|
36
36
|
export { resolveExperience } from '@contentful/experiences-sdk-core';
|
|
37
|
+
export { getTrackingAttributes, TRACKING_CLICKABLE_ATTRIBUTE, TRACKING_SCOPES_ATTRIBUTE, } from '@contentful/experiences-sdk-core';
|
|
37
38
|
// ─── Event builder (re-exported from runtime) ─────────────────────────────
|
|
38
39
|
export { DEFAULT_PAGE_PROPERTIES, EventBuilder } from '@contentful/experiences-runtime';
|
|
39
40
|
// ─── Design utilities (re-exported from design) ───────────────────────────
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Test fixture: renders the enclosing node's attributed scope ids from
|
|
3
|
+
`getContentfulComponent()`. Read in the template so the value is reactive.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { getContentfulComponent } from '../context.js';
|
|
7
|
+
|
|
8
|
+
const contentful = getContentfulComponent();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<span data-scopes data-json={JSON.stringify(contentful?.attribution ?? null)}
|
|
12
|
+
>{contentful?.attribution?.scopes.map((s) => s.entityId).join(',') ?? ''}</span
|
|
13
|
+
>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const AttributionProbe: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type AttributionProbe = InstanceType<typeof AttributionProbe>;
|
|
18
|
+
export default AttributionProbe;
|
|
19
|
+
//# sourceMappingURL=AttributionProbe.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttributionProbe.svelte.d.ts","sourceRoot":"","sources":["../../src/test-fixtures/AttributionProbe.svelte.ts"],"names":[],"mappings":"AAgBA,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,gBAAgB;;kBAA+E,CAAC;AACpF,KAAK,gBAAgB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Test fixture: a coded Experience Template that renders its own attributed
|
|
3
|
+
scope ids from `getContentfulExperienceTemplate()`, then its slot children.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import type { Snippet } from 'svelte';
|
|
7
|
+
|
|
8
|
+
import { getContentfulExperienceTemplate } from '../context.js';
|
|
9
|
+
|
|
10
|
+
let { content }: { content?: Snippet[] } = $props();
|
|
11
|
+
const contentful = getContentfulExperienceTemplate();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<main data-template-scopes>
|
|
15
|
+
{contentful?.attribution?.scopes.map((s) => s.entityId).join(',') ?? ''}
|
|
16
|
+
{#each content ?? [] as childSnippet, index (index)}
|
|
17
|
+
{@render childSnippet()}
|
|
18
|
+
{/each}
|
|
19
|
+
</main>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
content?: Snippet[];
|
|
4
|
+
};
|
|
5
|
+
declare const AttributionTemplateProbe: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
6
|
+
type AttributionTemplateProbe = ReturnType<typeof AttributionTemplateProbe>;
|
|
7
|
+
export default AttributionTemplateProbe;
|
|
8
|
+
//# sourceMappingURL=AttributionTemplateProbe.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AttributionTemplateProbe.svelte.d.ts","sourceRoot":"","sources":["../../src/test-fixtures/AttributionTemplateProbe.svelte.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAIrC,KAAK,gBAAgB,GAAI;IAAE,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,CAAC;AAoBlD,QAAA,MAAM,wBAAwB,sDAAwC,CAAC;AACvE,KAAK,wBAAwB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC5E,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type Leaf = {
|
|
2
|
+
kind: string;
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function minimalSourceMap({ experienceId, node, leaf, }?: {
|
|
6
|
+
experienceId?: string;
|
|
7
|
+
node?: string;
|
|
8
|
+
leaf?: Leaf;
|
|
9
|
+
}): {
|
|
10
|
+
version: number;
|
|
11
|
+
variants: {
|
|
12
|
+
type: string;
|
|
13
|
+
id: string;
|
|
14
|
+
}[];
|
|
15
|
+
spaces: never[];
|
|
16
|
+
environments: never[];
|
|
17
|
+
locales: never[];
|
|
18
|
+
entries: never[];
|
|
19
|
+
assets: never[];
|
|
20
|
+
layers: (Leaf | {
|
|
21
|
+
kind: string;
|
|
22
|
+
id: string;
|
|
23
|
+
variants: number[];
|
|
24
|
+
})[];
|
|
25
|
+
dataAssemblies: never[];
|
|
26
|
+
nodes: {
|
|
27
|
+
[node]: {
|
|
28
|
+
layers: number[];
|
|
29
|
+
scope: number;
|
|
30
|
+
contentProperties: never[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=source-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-map.d.ts","sourceRoot":"","sources":["../../src/test-fixtures/source-map.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,wBAAgB,gBAAgB,CAAC,EAC/B,YAAsB,EACtB,IAAU,EACV,IAAyC,GAC1C,GAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO;;;;;;;;;;;;;;;;;;QAWhD,CAAC,IAAI,CAAC;;;;UAAqD;;EAEvE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function minimalSourceMap({ experienceId = 'exp-a', node = 'n', leaf = { kind: 'Component', id: 'probe' }, } = {}) {
|
|
2
|
+
return {
|
|
3
|
+
version: 1,
|
|
4
|
+
variants: [{ type: 'personalization', id: 'default' }],
|
|
5
|
+
spaces: [],
|
|
6
|
+
environments: [],
|
|
7
|
+
locales: [],
|
|
8
|
+
entries: [],
|
|
9
|
+
assets: [],
|
|
10
|
+
layers: [{ kind: 'Experience', id: experienceId, variants: [0] }, leaf],
|
|
11
|
+
dataAssemblies: [],
|
|
12
|
+
nodes: { [node]: { layers: [1, 0], scope: 0, contentProperties: [] } },
|
|
13
|
+
};
|
|
14
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from 'svelte';
|
|
2
|
-
import type { DesignPropValue, RenderContext, ResolveContext, ResolveToken } from '@contentful/experiences-sdk-core';
|
|
2
|
+
import type { DesignPropValue, NodeAttribution, RenderContext, ResolveContext, ResolveToken } 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
|
|
@@ -19,6 +19,12 @@ export interface ContentfulComponent {
|
|
|
19
19
|
content: Record<string, unknown>;
|
|
20
20
|
design: Record<string, DesignPropValue>;
|
|
21
21
|
resolved?: Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Reportable scopes this node belongs to (Experience, persisted Fragment),
|
|
24
|
+
* resolved from the source map. Absent unless the fetch opted into
|
|
25
|
+
* `extensions.sourceMap` and the node has an id. Plain, serializable data.
|
|
26
|
+
*/
|
|
27
|
+
attribution?: NodeAttribution;
|
|
22
28
|
/**
|
|
23
29
|
* Raw per-slot node arrays from the payload. Every slot is also rendered
|
|
24
30
|
* automatically and passed as a same-named `Snippet[]` prop (`children` is
|
|
@@ -38,6 +44,12 @@ export interface ContentfulExperienceTemplate {
|
|
|
38
44
|
content: Record<string, unknown>;
|
|
39
45
|
design: Record<string, DesignPropValue>;
|
|
40
46
|
resolved?: Record<string, unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* Reportable scopes this node belongs to (Experience, persisted Fragment),
|
|
49
|
+
* resolved from the source map. Absent unless the fetch opted into
|
|
50
|
+
* `extensions.sourceMap` and the node has an id. Plain, serializable data.
|
|
51
|
+
*/
|
|
52
|
+
attribution?: NodeAttribution;
|
|
41
53
|
}
|
|
42
54
|
/** Render-time experience context, read with `getExperience()`. Declared in core so all adapters share one shape. */
|
|
43
55
|
export type { RenderContext };
|
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,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,kCAAkC,CAAC;AAE1C,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,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;;;;G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AAK,CAAC,CAAC;AAEnD,wBAAgB,wBAAwB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrF,MAAM,EAAE,wBAAwB,CAAC,KAAK,CAAC,GACtC,wBAAwB,CAAC,KAAK,CAAC,CAEjC;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;AAED;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AAE3D;;;;;GAKG;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtF,MAAM,WAAW,MAAM;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;;;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,uCAAuC,CAAC,CAAC,SAAS,MAAM,EACtE,GAAG,EAAE,8BAA8B,CAAC,CAAC,CAAC,GACrC,wBAAwB,CAAC,CAAC,CAAC,CAM7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experiences-svelte",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"description": "Svelte adapter for Contentful Experiences — Server and Client renderers over a PortableRenderPlan",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@contentful/experiences-client": "0.9.
|
|
39
|
-
"@contentful/experiences-runtime": "0.0.
|
|
40
|
-
"@contentful/experiences-sdk-core": "0.12.
|
|
41
|
-
"@contentful/experiences-design": "0.12.
|
|
42
|
-
"@contentful/experiences-live-preview": "0.6.
|
|
38
|
+
"@contentful/experiences-client": "0.9.4",
|
|
39
|
+
"@contentful/experiences-runtime": "0.0.3",
|
|
40
|
+
"@contentful/experiences-sdk-core": "0.12.3",
|
|
41
|
+
"@contentful/experiences-design": "0.12.2",
|
|
42
|
+
"@contentful/experiences-live-preview": "0.6.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"svelte": "^5.55.7"
|