@contentful/experiences-angular 0.2.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +368 -0
  3. package/dist/client-experience-renderer.component.d.ts +42 -0
  4. package/dist/client-experience-renderer.component.d.ts.map +1 -0
  5. package/dist/client-experience-renderer.component.js +155 -0
  6. package/dist/client-experience-renderer.component.js.map +1 -0
  7. package/dist/component-error.component.d.ts +14 -0
  8. package/dist/component-error.component.d.ts.map +1 -0
  9. package/dist/component-error.component.js +81 -0
  10. package/dist/component-error.component.js.map +1 -0
  11. package/dist/context.d.ts +21 -0
  12. package/dist/context.d.ts.map +1 -0
  13. package/dist/context.js +54 -0
  14. package/dist/context.js.map +1 -0
  15. package/dist/debug-experience.component.d.ts +17 -0
  16. package/dist/debug-experience.component.d.ts.map +1 -0
  17. package/dist/debug-experience.component.js +143 -0
  18. package/dist/debug-experience.component.js.map +1 -0
  19. package/dist/design-utils.d.ts +22 -0
  20. package/dist/design-utils.d.ts.map +1 -0
  21. package/dist/design-utils.js +40 -0
  22. package/dist/design-utils.js.map +1 -0
  23. package/dist/experience-defaults.d.ts +16 -0
  24. package/dist/experience-defaults.d.ts.map +1 -0
  25. package/dist/experience-defaults.js +27 -0
  26. package/dist/experience-defaults.js.map +1 -0
  27. package/dist/experience-scope.d.ts +33 -0
  28. package/dist/experience-scope.d.ts.map +1 -0
  29. package/dist/experience-scope.js +90 -0
  30. package/dist/experience-scope.js.map +1 -0
  31. package/dist/index.d.ts +40 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +62 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/inject-active-viewport.d.ts +32 -0
  36. package/dist/inject-active-viewport.d.ts.map +1 -0
  37. package/dist/inject-active-viewport.js +78 -0
  38. package/dist/inject-active-viewport.js.map +1 -0
  39. package/dist/inject-design-values.d.ts +14 -0
  40. package/dist/inject-design-values.d.ts.map +1 -0
  41. package/dist/inject-design-values.js +24 -0
  42. package/dist/inject-design-values.js.map +1 -0
  43. package/dist/inject-experience-plan.d.ts +15 -0
  44. package/dist/inject-experience-plan.d.ts.map +1 -0
  45. package/dist/inject-experience-plan.js +39 -0
  46. package/dist/inject-experience-plan.js.map +1 -0
  47. package/dist/inject-live-preview-experience.d.ts +13 -0
  48. package/dist/inject-live-preview-experience.d.ts.map +1 -0
  49. package/dist/inject-live-preview-experience.js +47 -0
  50. package/dist/inject-live-preview-experience.js.map +1 -0
  51. package/dist/inject-live-preview.d.ts +16 -0
  52. package/dist/inject-live-preview.d.ts.map +1 -0
  53. package/dist/inject-live-preview.js +14 -0
  54. package/dist/inject-live-preview.js.map +1 -0
  55. package/dist/missing-component.component.d.ts +14 -0
  56. package/dist/missing-component.component.d.ts.map +1 -0
  57. package/dist/missing-component.component.js +83 -0
  58. package/dist/missing-component.component.js.map +1 -0
  59. package/dist/node-render-engine.d.ts +109 -0
  60. package/dist/node-render-engine.d.ts.map +1 -0
  61. package/dist/node-render-engine.js +528 -0
  62. package/dist/node-render-engine.js.map +1 -0
  63. package/dist/node-renderer.directive.d.ts +46 -0
  64. package/dist/node-renderer.directive.d.ts.map +1 -0
  65. package/dist/node-renderer.directive.js +96 -0
  66. package/dist/node-renderer.directive.js.map +1 -0
  67. package/dist/node-scopes.d.ts +39 -0
  68. package/dist/node-scopes.d.ts.map +1 -0
  69. package/dist/node-scopes.js +75 -0
  70. package/dist/node-scopes.js.map +1 -0
  71. package/dist/server-experience-renderer.component.d.ts +46 -0
  72. package/dist/server-experience-renderer.component.d.ts.map +1 -0
  73. package/dist/server-experience-renderer.component.js +159 -0
  74. package/dist/server-experience-renderer.component.js.map +1 -0
  75. package/dist/types.d.ts +137 -0
  76. package/dist/types.d.ts.map +1 -0
  77. package/dist/types.js +44 -0
  78. package/dist/types.js.map +1 -0
  79. package/package.json +57 -0
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Internal defaults shared by the two experience renderers. Copied from
3
+ * adapter-svelte/src/ServerExperienceRenderer.svelte, where they are duplicated
4
+ * per component because Svelte has no cheap place to share them; Angular does.
5
+ *
6
+ * Not exported from the package: they are the shape of "no experience yet", not
7
+ * something a customer should build on.
8
+ */
9
+ export const DEFAULT_CONTEXT = { debug: false, metadata: {}, viewports: [] };
10
+ /**
11
+ * Stands in when there is no experience to read viewports from, so descendants
12
+ * always see a viewport rather than having to branch on `undefined`. `query: '*'`
13
+ * matches everything, mirroring what real single-viewport payloads ship today.
14
+ */
15
+ export const FALLBACK_VIEWPORT = {
16
+ id: '_',
17
+ query: '*',
18
+ displayName: 'Default',
19
+ previewSize: '100%',
20
+ };
21
+ /**
22
+ * Read only in the window between a renderer's construction and Angular binding
23
+ * its `config` input — the scope stores a getter, and nothing below the renderer
24
+ * exists to call it yet. It exists so the getter's return type needs no `null`.
25
+ */
26
+ export const EMPTY_CONFIG = { components: {} };
27
+ //# sourceMappingURL=experience-defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-defaults.js","sourceRoot":"","sources":["../src/experience-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,CAAC,MAAM,eAAe,GAAsB,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAEhG;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAgB;IAC5C,EAAE,EAAE,GAAG;IACP,KAAK,EAAE,GAAG;IACV,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,MAAM;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { type Signal, type Type } from '@angular/core';
2
+ import type { Config, RenderContext } from './types.js';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ExperienceScope {
5
+ private readonly experienceSource;
6
+ private readonly configSource;
7
+ private readonly renderUnknownSource;
8
+ private readonly renderErrorSource;
9
+ /**
10
+ * Render-time diagnostics (unregistered id, a component that threw),
11
+ * reported by every `NodeRenderEngine` sharing this scope — there is one
12
+ * engine per `*cfNodes`/`*cfNode` directive instance, all connected to the
13
+ * same scope, so this is the one place their reports converge. Signal-backed
14
+ * rather than a plain array: `<cf-debug-experience>`'s `errors` input reads
15
+ * it reactively, so — unlike the React/Svelte adapters, which need an
16
+ * element-order trick or a `$state` mirror for this — nothing here depends
17
+ * on template order.
18
+ */
19
+ private readonly diagnosticsSignal;
20
+ readonly experience: Signal<RenderContext>;
21
+ readonly config: Signal<Config>;
22
+ readonly renderUnknown: Signal<Type<unknown>>;
23
+ readonly renderError: Signal<Type<unknown>>;
24
+ readonly diagnostics: Signal<Error[]>;
25
+ connectExperience(read: () => RenderContext): void;
26
+ connectConfig(read: () => Config): void;
27
+ connectRenderUnknown(read: () => Type<unknown>): void;
28
+ connectRenderError(read: () => Type<unknown>): void;
29
+ reportDiagnostic(error: Error): void;
30
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExperienceScope, never>;
31
+ static ɵprov: i0.ɵɵInjectableDeclaration<ExperienceScope>;
32
+ }
33
+ //# sourceMappingURL=experience-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-scope.d.ts","sourceRoot":"","sources":["../src/experience-scope.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAc,KAAK,MAAM,EAAE,KAAK,IAAI,EAAoB,MAAM,eAAe,CAAC;AAErF,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;;AAExD,qBACa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA8C;IAC/E,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAuC;IACpE,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA8C;IAClF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA8C;IAChF;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAuB;IAEzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,aAAa,CAAC,CAQvC;IAEH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAQ5B;IAEH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAQ1C;IAEH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAQxC;IAEH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAuC;IAE5E,iBAAiB,CAAC,IAAI,EAAE,MAAM,aAAa,GAAG,IAAI;IAIlD,aAAa,CAAC,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI;IAIvC,oBAAoB,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI;IAIrD,kBAAkB,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI;IAInD,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;yCA3EzB,eAAe;6CAAf,eAAe;CA8E3B"}
@@ -0,0 +1,90 @@
1
+ /*
2
+ * Experience-wide DI scope. The Angular analogue of the Svelte adapter's
3
+ * `setExperience()` / `getExperience()` context pair.
4
+ *
5
+ * Both renderers provide this scope and connect it in their constructor, so
6
+ * everything below them in the element-injector tree can reach the render
7
+ * context, the registry, and the unknown-component renderer.
8
+ *
9
+ * Why three independent sources rather than one object: connecting them
10
+ * separately keeps a viewport change (which only touches `experience`) from
11
+ * invalidating readers of `config` or `renderUnknown`.
12
+ *
13
+ * Why getters rather than snapshots: a static `providers` array cannot see
14
+ * instance inputs, and reading an input during construction is too early. A
15
+ * scope therefore stores a *getter* that closes over the renderer's own
16
+ * signals, and dereferences it lazily inside a `computed`. Reads stay reactive
17
+ * for free, matching the Svelte adapter's `setResolvedDesign(() => …)`
18
+ * contract.
19
+ */
20
+ import { Injectable, computed, signal } from '@angular/core';
21
+ import * as i0 from "@angular/core";
22
+ export class ExperienceScope {
23
+ constructor() {
24
+ this.experienceSource = signal(null, ...(ngDevMode ? [{ debugName: "experienceSource" }] : []));
25
+ this.configSource = signal(null, ...(ngDevMode ? [{ debugName: "configSource" }] : []));
26
+ this.renderUnknownSource = signal(null, ...(ngDevMode ? [{ debugName: "renderUnknownSource" }] : []));
27
+ this.renderErrorSource = signal(null, ...(ngDevMode ? [{ debugName: "renderErrorSource" }] : []));
28
+ /**
29
+ * Render-time diagnostics (unregistered id, a component that threw),
30
+ * reported by every `NodeRenderEngine` sharing this scope — there is one
31
+ * engine per `*cfNodes`/`*cfNode` directive instance, all connected to the
32
+ * same scope, so this is the one place their reports converge. Signal-backed
33
+ * rather than a plain array: `<cf-debug-experience>`'s `errors` input reads
34
+ * it reactively, so — unlike the React/Svelte adapters, which need an
35
+ * element-order trick or a `$state` mirror for this — nothing here depends
36
+ * on template order.
37
+ */
38
+ this.diagnosticsSignal = signal([], ...(ngDevMode ? [{ debugName: "diagnosticsSignal" }] : []));
39
+ this.experience = computed(() => {
40
+ const read = this.experienceSource();
41
+ if (!read) {
42
+ throw new Error('[@contentful/experiences-angular] ExperienceScope was read before a renderer connected it.');
43
+ }
44
+ return read();
45
+ }, ...(ngDevMode ? [{ debugName: "experience" }] : []));
46
+ this.config = computed(() => {
47
+ const read = this.configSource();
48
+ if (!read) {
49
+ throw new Error('[@contentful/experiences-angular] ExperienceScope was read before a renderer connected it.');
50
+ }
51
+ return read();
52
+ }, ...(ngDevMode ? [{ debugName: "config" }] : []));
53
+ this.renderUnknown = computed(() => {
54
+ const read = this.renderUnknownSource();
55
+ if (!read) {
56
+ throw new Error('[@contentful/experiences-angular] ExperienceScope was read before a renderer connected it.');
57
+ }
58
+ return read();
59
+ }, ...(ngDevMode ? [{ debugName: "renderUnknown" }] : []));
60
+ this.renderError = computed(() => {
61
+ const read = this.renderErrorSource();
62
+ if (!read) {
63
+ throw new Error('[@contentful/experiences-angular] ExperienceScope was read before a renderer connected it.');
64
+ }
65
+ return read();
66
+ }, ...(ngDevMode ? [{ debugName: "renderError" }] : []));
67
+ this.diagnostics = this.diagnosticsSignal.asReadonly();
68
+ }
69
+ connectExperience(read) {
70
+ this.experienceSource.set(read);
71
+ }
72
+ connectConfig(read) {
73
+ this.configSource.set(read);
74
+ }
75
+ connectRenderUnknown(read) {
76
+ this.renderUnknownSource.set(read);
77
+ }
78
+ connectRenderError(read) {
79
+ this.renderErrorSource.set(read);
80
+ }
81
+ reportDiagnostic(error) {
82
+ this.diagnosticsSignal.update((prev) => [...prev, error]);
83
+ }
84
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: ExperienceScope, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
85
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: ExperienceScope }); }
86
+ }
87
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: ExperienceScope, decorators: [{
88
+ type: Injectable
89
+ }] });
90
+ //# sourceMappingURL=experience-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"experience-scope.js","sourceRoot":"","sources":["../src/experience-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAA0B,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;;AAKrF,MAAM,OAAO,eAAe;IAD5B;QAEmB,qBAAgB,GAAG,MAAM,CAA+B,IAAI,4DAAC,CAAC;QAC9D,iBAAY,GAAG,MAAM,CAAwB,IAAI,wDAAC,CAAC;QACnD,wBAAmB,GAAG,MAAM,CAA+B,IAAI,+DAAC,CAAC;QACjE,sBAAiB,GAAG,MAAM,CAA+B,IAAI,6DAAC,C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AAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,aAAa,CAAC,IAAkB;QAC9B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,oBAAoB,CAAC,IAAyB;QAC5C,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,kBAAkB,CAAC,IAAyB;QAC1C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,gBAAgB,CAAC,KAAY;QAC3B,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC;+GA7EU,eAAe;mHAAf,eAAe;;4FAAf,eAAe;kBAD3B,UAAU"}
@@ -0,0 +1,40 @@
1
+ export { ClientExperienceRendererComponent } from './client-experience-renderer.component.js';
2
+ export { ClientExperienceRendererComponent as ClientExperienceRenderer } from './client-experience-renderer.component.js';
3
+ export { ClientExperienceRendererComponent as ExperienceRenderer } from './client-experience-renderer.component.js';
4
+ export { ServerExperienceRendererComponent } from './server-experience-renderer.component.js';
5
+ export { ServerExperienceRendererComponent as ServerExperienceRenderer } from './server-experience-renderer.component.js';
6
+ export { MissingComponentComponent } from './missing-component.component.js';
7
+ export { MissingComponentComponent as MissingComponent } from './missing-component.component.js';
8
+ export { ComponentErrorComponent } from './component-error.component.js';
9
+ export { ComponentErrorComponent as ComponentError } from './component-error.component.js';
10
+ export { DebugExperienceComponent } from './debug-experience.component.js';
11
+ export { DebugExperienceComponent as DebugExperience } from './debug-experience.component.js';
12
+ export { NodesRendererDirective } from './node-renderer.directive.js';
13
+ export { NodesRendererDirective as NodesRenderer } from './node-renderer.directive.js';
14
+ export { NodeRendererDirective } from './node-renderer.directive.js';
15
+ export { NodeRendererDirective as NodeRenderer } from './node-renderer.directive.js';
16
+ export { injectActiveViewport } from './inject-active-viewport.js';
17
+ export type { InjectActiveViewportResult } from './inject-active-viewport.js';
18
+ export { injectLivePreviewExperience } from './inject-live-preview-experience.js';
19
+ export type { InjectLivePreviewExperienceOptions, InjectLivePreviewExperienceResult, } from './inject-live-preview-experience.js';
20
+ export { injectLivePreview } from './inject-live-preview.js';
21
+ export type { InjectLivePreviewOptions, InjectLivePreviewResult } from './inject-live-preview.js';
22
+ export { injectExperiencePlan } from './inject-experience-plan.js';
23
+ export type { ExperiencePlanResolveOptions, InjectExperiencePlanOptions, InjectExperiencePlanResult, } from './inject-experience-plan.js';
24
+ export type { LivePreviewClient, LivePreviewResult, PreviewSessionClientOptions, PreviewSessionExperienceOptions, PreviewSessionOptions, PreviewSessionResolveOptions, } from '@contentful/experiences-live-preview';
25
+ export { fetchPreviewSession, LivePreviewConnectionError, PREVIEW_WEBSOCKET_HOST, PreviewSessionFetchError, } from '@contentful/experiences-live-preview';
26
+ export { injectExperience, injectContentfulComponent, injectContentfulExperienceTemplate, } from './context.js';
27
+ export { injectDesignValues } from './inject-design-values.js';
28
+ export { toCss } from './design-utils.js';
29
+ export type { ToCssOptions } from './design-utils.js';
30
+ export { defineComponent, defineExperienceTemplate, normalizeComponentRegistration, normalizeExperienceTemplateRegistration, } from './types.js';
31
+ export type { ComponentConfig, Components, Config, ContentfulComponent, ContentfulExperienceTemplate, ExperienceTemplateConfig, ExperienceTemplateRegistration, ExperienceTemplates, Registration, RenderContext, RenderError, RenderUnknown, ResolveToken, SlotNodes, } from './types.js';
32
+ export { resolveExperience } from '@contentful/experiences-sdk-core';
33
+ export type { ResolverConfig, ResolveExperienceOptions } from '@contentful/experiences-sdk-core';
34
+ export { DEFAULT_PAGE_PROPERTIES, EventBuilder } from '@contentful/experiences-client';
35
+ export type { ClickBuilderArgs, EventBuilderConfig, FlagViewBuilderArgs, HoverBuilderArgs, IdentifyBuilderArgs, InteractionBuilderArgsBase, PageViewBuilderArgs, TrackBuilderArgs, UniversalEventBuilderArgs, ViewBuilderArgs, } from '@contentful/experiences-client';
36
+ export type { ComponentNode, ComponentRef, DesignPropValue, DesignToken, ExperienceContext, ExperienceNode, ExperiencePayload, ExperienceSourceMap, ExperienceSys, ExperienceTemplateNode, ExperienceTemplateRef, ManualDesignValue, PortableRegistration, PortableRenderNode, PortableRenderPlan, ResolveContext, ValuesByViewport, ViewportDef, } from '@contentful/experiences-sdk-core';
37
+ export { CSS_PROPERTIES, getValueForViewport, getViewportIndex, isCssProperty, resolveDesignProperties, toCssKey, toCssMediaQuery, } from '@contentful/experiences-design';
38
+ export { ContentfulViewDelivery, ContentfulViewDeliveryClient, DELIVERY_HOST, ExperienceFetchError, NotFoundError, PREVIEW_HOST, createClient, fetchExperience, readSourceMap, toExperiencePayload, toExperiencePayloadFromDestination, } from '@contentful/experiences-client';
39
+ export type { ByDestinationNodeIdExperienceOptions, ByDestinationPathExperienceOptions, ByIdExperienceOptions, ClientOptions, CreateClientOptions, DestinationRedirectResult, ExperienceOptions, ExperienceResponse, ResolveOptions, } from '@contentful/experiences-client';
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iCAAiC,IAAI,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1H,OAAO,EAAE,iCAAiC,IAAI,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpH,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iCAAiC,IAAI,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1H,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAE,u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AAC;AAGxC,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,oCAAoC,EACpC,kCAAkC,EAClC,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,GACf,MAAM,gCAAgC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,62 @@
1
+ /*
2
+ * Public API surface for `@contentful/experiences-angular`.
3
+ *
4
+ * Customers add ONLY this package to their app's dependencies. Everything
5
+ * needed to render an Experience — types, the resolver, viewport utilities,
6
+ * the renderer components, the authoring helpers — is re-exported from here.
7
+ * The internal `@contentful/experiences-sdk-core` and
8
+ * `@contentful/experiences-design` packages are workspace-only implementation
9
+ * details; they are not part of the public API.
10
+ *
11
+ * `ExperienceRenderer` is an alias for `ClientExperienceRenderer`; SSR
12
+ * consumers explicitly import `ServerExperienceRenderer`.
13
+ *
14
+ * Names carry Angular's `Component` or `Directive` suffix, matching the
15
+ * framework's own convention; the un-suffixed aliases exist so the three
16
+ * adapters read the same in customer code. See the README's parity table for the
17
+ * full mapping.
18
+ */
19
+ // ─── Renderers ─────────────────────────────────────────────────────────────
20
+ export { ClientExperienceRendererComponent } from './client-experience-renderer.component.js';
21
+ export { ClientExperienceRendererComponent as ClientExperienceRenderer } from './client-experience-renderer.component.js';
22
+ export { ClientExperienceRendererComponent as ExperienceRenderer } from './client-experience-renderer.component.js';
23
+ export { ServerExperienceRendererComponent } from './server-experience-renderer.component.js';
24
+ export { ServerExperienceRendererComponent as ServerExperienceRenderer } from './server-experience-renderer.component.js';
25
+ export { MissingComponentComponent } from './missing-component.component.js';
26
+ export { MissingComponentComponent as MissingComponent } from './missing-component.component.js';
27
+ export { ComponentErrorComponent } from './component-error.component.js';
28
+ export { ComponentErrorComponent as ComponentError } from './component-error.component.js';
29
+ export { DebugExperienceComponent } from './debug-experience.component.js';
30
+ export { DebugExperienceComponent as DebugExperience } from './debug-experience.component.js';
31
+ // Load-bearing in this adapter, not an escape hatch: Angular has no lazy
32
+ // renderable-child primitive for arbitrary named slots, so each slot arrives as
33
+ // a same-named `PortableRenderNode[]` input and the receiving component renders
34
+ // it with `<ng-container *cfNodes="children()"></ng-container>`.
35
+ //
36
+ // Structural directives rather than components, so the adapter contributes no
37
+ // elements of its own — slot children become direct children of whatever element
38
+ // the customer wrapped them in, exactly as in React and Svelte.
39
+ export { NodesRendererDirective } from './node-renderer.directive.js';
40
+ export { NodesRendererDirective as NodesRenderer } from './node-renderer.directive.js';
41
+ export { NodeRendererDirective } from './node-renderer.directive.js';
42
+ export { NodeRendererDirective as NodeRenderer } from './node-renderer.directive.js';
43
+ export { injectActiveViewport } from './inject-active-viewport.js';
44
+ export { injectLivePreviewExperience } from './inject-live-preview-experience.js';
45
+ export { injectLivePreview } from './inject-live-preview.js';
46
+ export { injectExperiencePlan } from './inject-experience-plan.js';
47
+ export { fetchPreviewSession, LivePreviewConnectionError, PREVIEW_WEBSOCKET_HOST, PreviewSessionFetchError, } from '@contentful/experiences-live-preview';
48
+ // ─── Runtime context helpers ─────────────────────────────────────────────
49
+ export { injectExperience, injectContentfulComponent, injectContentfulExperienceTemplate, } from './context.js';
50
+ export { injectDesignValues } from './inject-design-values.js';
51
+ export { toCss } from './design-utils.js';
52
+ // ─── Authoring helpers + Config types ─────────────────────────────────────
53
+ export { defineComponent, defineExperienceTemplate, normalizeComponentRegistration, normalizeExperienceTemplateRegistration, } from './types.js';
54
+ // ─── Resolver (re-exported from render-core) ──────────────────────────────
55
+ export { resolveExperience } from '@contentful/experiences-sdk-core';
56
+ // ─── Event builder (re-exported from client) ──────────────────────────────
57
+ export { DEFAULT_PAGE_PROPERTIES, EventBuilder } from '@contentful/experiences-client';
58
+ // ─── Design utilities (re-exported from design) ───────────────────────────
59
+ export { CSS_PROPERTIES, getValueForViewport, getViewportIndex, isCssProperty, resolveDesignProperties, toCssKey, toCssMediaQuery, } from '@contentful/experiences-design';
60
+ // ─── Delivery client + fetchExperience ────────────────────────────────────
61
+ export { ContentfulViewDelivery, ContentfulViewDeliveryClient, DELIVERY_HOST, ExperienceFetchError, NotFoundError, PREVIEW_HOST, createClient, fetchExperience, readSourceMap, toExperiencePayload, toExperiencePayloadFromDestination, } from '@contentful/experiences-client';
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,8EAA8E;AAC9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iCAAiC,IAAI,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1H,OAAO,EAAE,iCAAiC,IAAI,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpH,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,iCAAiC,IAAI,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1H,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,IAAI,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,uBAAuB,IAAI,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAAE,wBAAwB,IAAI,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE9F,yEAAyE;AACzE,gFAAgF;AAChF,gFAAgF;AAChF,iEAAiE;AACjE,EAAE;AACF,8EAA8E;AAC9E,iFAAiF;AACjF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ACb,oBAAoB,EACpB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type Signal } from '@angular/core';
2
+ import type { ViewportDef } from '@contentful/experiences-sdk-core';
3
+ /**
4
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
5
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
6
+ * Will not be removed before 2026-10-06.
7
+ */
8
+ export interface InjectActiveViewportResult {
9
+ readonly activeViewportIndex: Signal<number>;
10
+ }
11
+ /**
12
+ * Returns a signal that tracks which viewport's media query currently matches.
13
+ * Listeners mount after the first browser render and tear down with the calling
14
+ * component.
15
+ *
16
+ * Must be called from an injection context — a field initializer or a
17
+ * constructor — like any other `inject()`-based API. Both arguments are getters
18
+ * rather than values, which is the Angular divergence from the React and Svelte
19
+ * signatures: an injection context runs *before* inputs are bound, so a
20
+ * component passing its own `@Input()` viewports has nothing to hand over yet.
21
+ * Deferring the read to first render fixes that, and since every `Signal` is
22
+ * already a getter, `injectActiveViewport(this.viewports)` works unchanged.
23
+ *
24
+ * readonly experience = injectExperience();
25
+ * private readonly tracker = injectActiveViewport(() => this.experience().viewports);
26
+ *
27
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
28
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
29
+ * Will not be removed before 2026-10-06.
30
+ */
31
+ export declare function injectActiveViewport(viewports: () => ViewportDef[], initialViewportId?: () => string | undefined): InjectActiveViewportResult;
32
+ //# sourceMappingURL=inject-active-viewport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-active-viewport.d.ts","sourceRoot":"","sources":["../src/inject-active-viewport.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAc,KAAK,MAAM,EAA6C,MAAM,eAAe,CAAC;AAGnG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,WAAW,EAAE,EAC9B,iBAAiB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,GAC3C,0BAA0B,CA+C5B"}
@@ -0,0 +1,78 @@
1
+ /*
2
+ * Reactive viewport matcher. Port of adapter-svelte/src/use-active-viewport.svelte.ts.
3
+ *
4
+ * "Active viewport" = the last-matching media query in the ordered viewports
5
+ * list. With desktop-first ordering (`*`, `<992px`, `<576px`), the narrowest
6
+ * matching query wins. With mobile-first ordering, the widest wins. Either
7
+ * way: the last `findLastIndex` of `mediaQueryMatches[i] === true`.
8
+ *
9
+ * Pass `initialViewportId` (typically derived from User-Agent on the server) to
10
+ * seed the first render so SSR and the client agree on viewport before
11
+ * `window.matchMedia` takes over.
12
+ *
13
+ * Why `afterNextRender` rather than `effect()`: it is browser-only by contract,
14
+ * so nothing here touches `window` during server rendering, and it fires after
15
+ * the first render has already committed. That preserves the seed-then-correct
16
+ * ordering hydration needs — the first paint uses `initialViewportId`, matching
17
+ * the server's HTML, and the real media-query state lands immediately after.
18
+ */
19
+ import { DestroyRef, afterNextRender, computed, inject, signal } from '@angular/core';
20
+ import { createMediaQueryMatchers, getViewportIndex } from '@contentful/experiences-design';
21
+ /**
22
+ * Returns a signal that tracks which viewport's media query currently matches.
23
+ * Listeners mount after the first browser render and tear down with the calling
24
+ * component.
25
+ *
26
+ * Must be called from an injection context — a field initializer or a
27
+ * constructor — like any other `inject()`-based API. Both arguments are getters
28
+ * rather than values, which is the Angular divergence from the React and Svelte
29
+ * signatures: an injection context runs *before* inputs are bound, so a
30
+ * component passing its own `@Input()` viewports has nothing to hand over yet.
31
+ * Deferring the read to first render fixes that, and since every `Signal` is
32
+ * already a getter, `injectActiveViewport(this.viewports)` works unchanged.
33
+ *
34
+ * readonly experience = injectExperience();
35
+ * private readonly tracker = injectActiveViewport(() => this.experience().viewports);
36
+ *
37
+ * @deprecated Viewports are being removed from the Experiences APIs, with no
38
+ * direct replacement — use CSS media queries or `window.matchMedia` instead.
39
+ * Will not be removed before 2026-10-06.
40
+ */
41
+ export function injectActiveViewport(viewports, initialViewportId) {
42
+ const destroyRef = inject(DestroyRef);
43
+ // `null` means the browser has not taken over yet: on the server, and on the
44
+ // client up to the first `afterNextRender`. Readers fall back to the seed.
45
+ const matches = signal(null, ...(ngDevMode ? [{ debugName: "matches" }] : []));
46
+ const activeViewportIndex = computed(() => {
47
+ const seedIndex = getViewportIndex(viewports(), initialViewportId?.());
48
+ const current = matches();
49
+ if (!current)
50
+ return seedIndex;
51
+ const found = current.findLastIndex((isMatch) => isMatch);
52
+ return found === -1 ? seedIndex : found;
53
+ }, ...(ngDevMode ? [{ debugName: "activeViewportIndex" }] : []));
54
+ afterNextRender(() => {
55
+ const [matchers, seeded] = createMediaQueryMatchers(viewports());
56
+ // Sync once on mount, in case the initial index came from the server.
57
+ matches.set(matchers.reduce((acc, { index, signal: mediaQuery }) => {
58
+ acc[index] = mediaQuery.matches;
59
+ return acc;
60
+ }, [...seeded]));
61
+ const listeners = matchers.map(({ index, signal: mediaQuery }) => {
62
+ const onChange = () => {
63
+ const next = [...(matches() ?? seeded)];
64
+ next[index] = mediaQuery.matches;
65
+ matches.set(next);
66
+ };
67
+ mediaQuery.addEventListener('change', onChange);
68
+ return onChange;
69
+ });
70
+ destroyRef.onDestroy(() => {
71
+ listeners.forEach((listener, i) => {
72
+ matchers[i]?.signal.removeEventListener('change', listener);
73
+ });
74
+ });
75
+ });
76
+ return { activeViewportIndex };
77
+ }
78
+ //# sourceMappingURL=inject-active-viewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-active-viewport.js","sourceRoot":"","sources":["../src/inject-active-viewport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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,MAAM,CAAC,CACZ,CACF,CAAC;QAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,EAAE;YAC/D,MAAM,QAAQ,GAAG,GAAS,EAAE;gBAC1B,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC;gBACxC,IAAI,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC;gBACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC,CAAC;YACF,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAChD,OAAO,QAAQ,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,SAAS,CAAC,GAAG,EAAE;YACxB,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE;gBAChC,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC9D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,mBAAmB,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type Signal } from '@angular/core';
2
+ /**
3
+ * Viewport-cascaded, token-resolved design values for the enclosing node.
4
+ *
5
+ * The renderer already assigns every design key the target component declares as
6
+ * an input; this is for the rest — keys a component reads dynamically, or design
7
+ * properties it never declared. Returns a signal of an empty record outside a
8
+ * rendered node.
9
+ *
10
+ * readonly design = injectDesignValues<{ cfPadding?: string }>();
11
+ * // template: [style.padding]="design().cfPadding"
12
+ */
13
+ export declare function injectDesignValues<T extends object = Record<string, unknown>>(): Signal<T>;
14
+ //# sourceMappingURL=inject-design-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-design-values.d.ts","sourceRoot":"","sources":["../src/inject-design-values.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAA4B,MAAM,eAAe,CAAC;AAMtE;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAI1F"}
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Port of adapter-svelte/src/get-design-values.ts.
3
+ */
4
+ import { computed, inject, signal } from '@angular/core';
5
+ import { DesignScope } from './node-scopes.js';
6
+ const EMPTY = signal({}).asReadonly();
7
+ /**
8
+ * Viewport-cascaded, token-resolved design values for the enclosing node.
9
+ *
10
+ * The renderer already assigns every design key the target component declares as
11
+ * an input; this is for the rest — keys a component reads dynamically, or design
12
+ * properties it never declared. Returns a signal of an empty record outside a
13
+ * rendered node.
14
+ *
15
+ * readonly design = injectDesignValues<{ cfPadding?: string }>();
16
+ * // template: [style.padding]="design().cfPadding"
17
+ */
18
+ export function injectDesignValues() {
19
+ const scope = inject(DesignScope, { optional: true });
20
+ if (!scope)
21
+ return EMPTY;
22
+ return computed(() => scope.resolvedDesign());
23
+ }
24
+ //# sourceMappingURL=inject-design-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-design-values.js","sourceRoot":"","sources":["../src/inject-design-values.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAe,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,KAAK,GAAG,MAAM,CAA0B,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;AAE/D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAkB,CAAC;IACtC,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,EAAO,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { type Signal } from '@angular/core';
2
+ import type { ExperiencePayload, PortableRenderPlan, ResolveExperienceOptions, ResolverConfig } from '@contentful/experiences-sdk-core';
3
+ export interface ExperiencePlanResolveOptions extends ResolveExperienceOptions {
4
+ config: ResolverConfig;
5
+ }
6
+ export interface InjectExperiencePlanOptions {
7
+ payload: ExperiencePayload | undefined;
8
+ initialPlan?: PortableRenderPlan;
9
+ resolveOptions: ExperiencePlanResolveOptions;
10
+ }
11
+ export interface InjectExperiencePlanResult {
12
+ readonly data: Signal<PortableRenderPlan | undefined>;
13
+ }
14
+ export declare function injectExperiencePlan(getOptions: () => InjectExperiencePlanOptions): InjectExperiencePlanResult;
15
+ //# sourceMappingURL=inject-experience-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-experience-plan.d.ts","sourceRoot":"","sources":["../src/inject-experience-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAA4B,MAAM,eAAe,CAAC;AAGtE,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACf,MAAM,kCAAkC,CAAC;AAE1C,MAAM,WAAW,4BAA6B,SAAQ,wBAAwB;IAC5E,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACvC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,4BAA4B,CAAC;CAC9C;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;CACvD;AAyBD,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,2BAA2B,GAC5C,0BAA0B,CAiC5B"}
@@ -0,0 +1,39 @@
1
+ import { computed, effect, signal } from '@angular/core';
2
+ import { resolveExperience } from '@contentful/experiences-sdk-core';
3
+ function areExperienceUpdateOptionsEqual(first, second) {
4
+ return (first.payload === second.payload &&
5
+ first.config === second.config &&
6
+ first.metadata === second.metadata &&
7
+ first.debug === second.debug &&
8
+ first.initialViewportId === second.initialViewportId &&
9
+ first.sourceMap === second.sourceMap);
10
+ }
11
+ export function injectExperiencePlan(getOptions) {
12
+ const currentPlan = signal(undefined, ...(ngDevMode ? [{ debugName: "currentPlan" }] : []));
13
+ const data = computed(() => currentPlan() ?? getOptions().initialPlan, ...(ngDevMode ? [{ debugName: "data" }] : []));
14
+ const updateOptions = computed(() => {
15
+ const { payload, resolveOptions } = getOptions();
16
+ const { config, metadata, debug, initialViewportId, sourceMap } = resolveOptions;
17
+ return { payload, config, metadata, debug, initialViewportId, sourceMap };
18
+ }, ...(ngDevMode ? [{ debugName: "updateOptions", equal: areExperienceUpdateOptionsEqual }] : [{ equal: areExperienceUpdateOptionsEqual }]));
19
+ effect((onCleanup) => {
20
+ const { payload, config, metadata, debug, initialViewportId, sourceMap } = updateOptions();
21
+ if (payload === undefined)
22
+ return;
23
+ let isCurrent = true;
24
+ onCleanup(() => {
25
+ isCurrent = false;
26
+ });
27
+ void resolveExperience(payload, config, { metadata, debug, initialViewportId, sourceMap })
28
+ .then((nextPlan) => {
29
+ if (isCurrent && nextPlan.diagnostics.length === 0) {
30
+ currentPlan.set(nextPlan);
31
+ }
32
+ })
33
+ .catch(() => {
34
+ // Keep the last usable experience when resolving an update fails.
35
+ });
36
+ });
37
+ return { data };
38
+ }
39
+ //# sourceMappingURL=inject-experience-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-experience-plan.js","sourceRoot":"","sources":["../src/inject-experience-plan.ts"],"names":[],"mappings":"AAAA,OAA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iB,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,CAAC;QAC3F,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO;QAElC,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,SAAS,CAAC,GAAG,EAAE;YACb,SAAS,GAAG,KAAK,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,KAAK,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,CAAC;aACvF,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjB,IAAI,SAAS,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACnD,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,kEAAkE;QACpE,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type Signal } from '@angular/core';
2
+ import { type PreviewSessionOptions } from '@contentful/experiences-live-preview';
3
+ import type { ExperiencePayload } from '@contentful/experiences-sdk-core';
4
+ export type InjectLivePreviewExperienceOptions = {
5
+ previewSessionOptions?: PreviewSessionOptions;
6
+ initialPayload?: ExperiencePayload;
7
+ };
8
+ export interface InjectLivePreviewExperienceResult {
9
+ readonly data: Signal<ExperiencePayload | undefined>;
10
+ readonly error: Signal<Error | undefined>;
11
+ }
12
+ export declare function injectLivePreviewExperience(getOptions: () => InjectLivePreviewExperienceOptions): InjectLivePreviewExperienceResult;
13
+ //# sourceMappingURL=inject-live-preview-experience.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-live-preview-experience.d.ts","sourceRoot":"","sources":["../src/inject-live-preview-experience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAA6C,MAAM,eAAe,CAAC;AAEvF,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,MAAM,kCAAkC,GAAG;IAC/C,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAEF,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;CAC3C;AAkBD,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,kCAAkC,GACnD,iCAAiC,CAoCnC"}
@@ -0,0 +1,47 @@
1
+ import { afterNextRender, computed, effect, signal } from '@angular/core';
2
+ import { createLivePreviewClient, sendPreviewStatus, } from '@contentful/experiences-live-preview';
3
+ function areConnectionOptionsEqual(first, second) {
4
+ if (first === undefined || second === undefined)
5
+ return first === second;
6
+ return (first?.spaceId === second.spaceId &&
7
+ first?.environmentId === second.environmentId &&
8
+ first?.previewToken === second.previewToken &&
9
+ first?.sessionId === second.sessionId &&
10
+ first?.resourceResolution === second.resourceResolution &&
11
+ first?.sessionHost === second.sessionHost &&
12
+ first?.debug === second.debug);
13
+ }
14
+ export function injectLivePreviewExperience(getOptions) {
15
+ const browserReady = signal(false, ...(ngDevMode ? [{ debugName: "browserReady" }] : []));
16
+ const currentResult = signal({ data: undefined, error: undefined }, ...(ngDevMode ? [{ debugName: "currentResult" }] : []));
17
+ const data = computed(() => currentResult().data ?? getOptions().initialPayload, ...(ngDevMode ? [{ debugName: "data" }] : []));
18
+ const error = computed(() => currentResult().error, ...(ngDevMode ? [{ debugName: "error" }] : []));
19
+ const connectionOptions = computed(() => getOptions().previewSessionOptions, ...(ngDevMode ? [{ debugName: "connectionOptions", equal: areConnectionOptionsEqual }] : [{
20
+ equal: areConnectionOptionsEqual,
21
+ }]));
22
+ afterNextRender(() => {
23
+ browserReady.set(true);
24
+ });
25
+ effect((onCleanup) => {
26
+ if (!browserReady())
27
+ return;
28
+ const options = connectionOptions();
29
+ currentResult.update((result) => ({ ...result, error: undefined }));
30
+ if (options === undefined) {
31
+ sendPreviewStatus('static');
32
+ return;
33
+ }
34
+ const client = createLivePreviewClient(options);
35
+ const unsubscribeStatus = client.subscribeStatus(sendPreviewStatus);
36
+ currentResult.set(client.getResult());
37
+ const unsubscribe = client.subscribe(() => {
38
+ currentResult.set(client.getResult());
39
+ });
40
+ onCleanup(() => {
41
+ unsubscribeStatus();
42
+ unsubscribe();
43
+ });
44
+ });
45
+ return { data, error };
46
+ }
47
+ //# sourceMappingURL=inject-live-preview-experience.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject-live-preview-experience.js","sourceRoot":"","sources":["../src/inject-live-preview-experience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAGlB,MAAM,sCAAsC,CAAC;AAe9C,SAAS,yBAAyB,CAAC,KAAwB,EAAE,MAAyB;IACpF,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,KAAK,MAAM,CAAC;IAEzE,OAAO,CACL,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC,OAAO;QACjC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,aAAa;QAC7C,KAAK,EAAE,YAAY,KAAK,MAAM,CAAC,YAAY;QAC3C,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,SAAS;QACrC,KAAK,EAAE,kBAAkB,KAAK,MAAM,CAAC,kBAAkB;QACvD,KAAK,EAAE,WAAW,KAAK,MAAM,CAAC,WAAW;QAC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BAAiB,CAAC,CAAC;QACpE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE;YACxC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,GAAG,EAAE;YACb,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ExperiencePayload, PortableRenderPlan } from '@contentful/experiences-sdk-core';
2
+ import type { PreviewSessionOptions } from '@contentful/experiences-live-preview';
3
+ import { type ExperiencePlanResolveOptions, type InjectExperiencePlanResult } from './inject-experience-plan.js';
4
+ import { type InjectLivePreviewExperienceResult } from './inject-live-preview-experience.js';
5
+ export interface InjectLivePreviewOptions {
6
+ previewSessionOptions?: PreviewSessionOptions;
7
+ initialPayload?: ExperiencePayload;
8
+ initialPlan?: PortableRenderPlan;
9
+ resolveOptions: ExperiencePlanResolveOptions;
10
+ }
11
+ export interface InjectLivePreviewResult {
12
+ readonly data: InjectExperiencePlanResult['data'];
13
+ readonly error: InjectLivePreviewExperienceResult['error'];
14
+ }
15
+ export declare function injectLivePreview(getOptions: () => InjectLivePreviewOptions): InjectLivePreviewResult;
16
+ //# sourceMappingURL=inject-live-preview.d.ts.map