@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.
- package/CHANGELOG.md +189 -0
- package/README.md +368 -0
- package/dist/client-experience-renderer.component.d.ts +42 -0
- package/dist/client-experience-renderer.component.d.ts.map +1 -0
- package/dist/client-experience-renderer.component.js +155 -0
- package/dist/client-experience-renderer.component.js.map +1 -0
- package/dist/component-error.component.d.ts +14 -0
- package/dist/component-error.component.d.ts.map +1 -0
- package/dist/component-error.component.js +81 -0
- package/dist/component-error.component.js.map +1 -0
- package/dist/context.d.ts +21 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +54 -0
- package/dist/context.js.map +1 -0
- package/dist/debug-experience.component.d.ts +17 -0
- package/dist/debug-experience.component.d.ts.map +1 -0
- package/dist/debug-experience.component.js +143 -0
- package/dist/debug-experience.component.js.map +1 -0
- package/dist/design-utils.d.ts +22 -0
- package/dist/design-utils.d.ts.map +1 -0
- package/dist/design-utils.js +40 -0
- package/dist/design-utils.js.map +1 -0
- package/dist/experience-defaults.d.ts +16 -0
- package/dist/experience-defaults.d.ts.map +1 -0
- package/dist/experience-defaults.js +27 -0
- package/dist/experience-defaults.js.map +1 -0
- package/dist/experience-scope.d.ts +33 -0
- package/dist/experience-scope.d.ts.map +1 -0
- package/dist/experience-scope.js +90 -0
- package/dist/experience-scope.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/inject-active-viewport.d.ts +32 -0
- package/dist/inject-active-viewport.d.ts.map +1 -0
- package/dist/inject-active-viewport.js +78 -0
- package/dist/inject-active-viewport.js.map +1 -0
- package/dist/inject-design-values.d.ts +14 -0
- package/dist/inject-design-values.d.ts.map +1 -0
- package/dist/inject-design-values.js +24 -0
- package/dist/inject-design-values.js.map +1 -0
- package/dist/inject-experience-plan.d.ts +15 -0
- package/dist/inject-experience-plan.d.ts.map +1 -0
- package/dist/inject-experience-plan.js +39 -0
- package/dist/inject-experience-plan.js.map +1 -0
- package/dist/inject-live-preview-experience.d.ts +13 -0
- package/dist/inject-live-preview-experience.d.ts.map +1 -0
- package/dist/inject-live-preview-experience.js +47 -0
- package/dist/inject-live-preview-experience.js.map +1 -0
- package/dist/inject-live-preview.d.ts +16 -0
- package/dist/inject-live-preview.d.ts.map +1 -0
- package/dist/inject-live-preview.js +14 -0
- package/dist/inject-live-preview.js.map +1 -0
- package/dist/missing-component.component.d.ts +14 -0
- package/dist/missing-component.component.d.ts.map +1 -0
- package/dist/missing-component.component.js +83 -0
- package/dist/missing-component.component.js.map +1 -0
- package/dist/node-render-engine.d.ts +109 -0
- package/dist/node-render-engine.d.ts.map +1 -0
- package/dist/node-render-engine.js +528 -0
- package/dist/node-render-engine.js.map +1 -0
- package/dist/node-renderer.directive.d.ts +46 -0
- package/dist/node-renderer.directive.d.ts.map +1 -0
- package/dist/node-renderer.directive.js +96 -0
- package/dist/node-renderer.directive.js.map +1 -0
- package/dist/node-scopes.d.ts +39 -0
- package/dist/node-scopes.d.ts.map +1 -0
- package/dist/node-scopes.js +75 -0
- package/dist/node-scopes.js.map +1 -0
- package/dist/server-experience-renderer.component.d.ts +46 -0
- package/dist/server-experience-renderer.component.d.ts.map +1 -0
- package/dist/server-experience-renderer.component.js +159 -0
- package/dist/server-experience-renderer.component.js.map +1 -0
- package/dist/types.d.ts +137 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +44 -0
- package/dist/types.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-live-preview.d.ts","sourceRoot":"","sources":["../src/inject-live-preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAChC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,qCAAqC,CAAC;AAE7C,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,4BAA4B,CAAC;CAC9C;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAClD,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC,OAAO,CAAC,CAAC;CAC5D;AAED,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,wBAAwB,GACzC,uBAAuB,CAYzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { injectExperiencePlan, } from './inject-experience-plan.js';
|
|
2
|
+
import { injectLivePreviewExperience, } from './inject-live-preview-experience.js';
|
|
3
|
+
export function injectLivePreview(getOptions) {
|
|
4
|
+
const livePreview = injectLivePreviewExperience(() => {
|
|
5
|
+
const { previewSessionOptions, initialPayload } = getOptions();
|
|
6
|
+
return { previewSessionOptions, initialPayload };
|
|
7
|
+
});
|
|
8
|
+
const plan = injectExperiencePlan(() => {
|
|
9
|
+
const { initialPlan, resolveOptions } = getOptions();
|
|
10
|
+
return { payload: livePreview.data(), initialPlan, resolveOptions };
|
|
11
|
+
});
|
|
12
|
+
return { data: plan.data, error: livePreview.error };
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=inject-live-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject-live-preview.js","sourceRoot":"","sources":["../src/inject-live-preview.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,GAGrB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,2BAA2B,GAE5B,MAAM,qCAAqC,CAAC;AAc7C,MAAM,UAAU,iBAAiB,CAC/B,UAA0C;IAE1C,MAAM,WAAW,GAAG,2BAA2B,CAAC,GAAG,EAAE;QACnD,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;QAC/D,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,oBAAoB,CAAC,GAAG,EAAE;QACrC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;QACrD,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class MissingComponentComponent implements OnInit {
|
|
4
|
+
protected readonly componentIdValue: import("@angular/core").WritableSignal<string>;
|
|
5
|
+
protected readonly nodeIdValue: import("@angular/core").WritableSignal<string | undefined>;
|
|
6
|
+
set componentId(value: string);
|
|
7
|
+
set nodeId(value: string | undefined);
|
|
8
|
+
protected readonly experience: import("@angular/core").Signal<import("@contentful/experiences-sdk-core").RenderContext>;
|
|
9
|
+
protected readonly details: import("@angular/core").Signal<string>;
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MissingComponentComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MissingComponentComponent, "cf-missing-component", never, { "componentId": { "alias": "componentId"; "required": true; }; "nodeId": { "alias": "nodeId"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=missing-component.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-component.component.d.ts","sourceRoot":"","sources":["../src/missing-component.component.ts"],"names":[],"mappings":"AAcA,OAAO,EAIL,KAAK,MAAM,EAGZ,MAAM,eAAe,CAAC;;AAIvB,qBAmBa,yBAA0B,YAAW,MAAM;IACtD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,iDAAc;IACjD,SAAS,CAAC,QAAQ,CAAC,WAAW,6DAAyC;IAEvE,IAA+B,WAAW,CAAC,KAAK,EAAE,MAAM,EAEvD;IAED,IAAa,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAE5C;IAED,SAAS,CAAC,QAAQ,CAAC,UAAU,2FAAsB;IAEnD,SAAS,CAAC,QAAQ,CAAC,OAAO,yCAMxB;IAEF,QAAQ,IAAI,IAAI;yCAtBL,yBAAyB;2CAAzB,yBAAyB;CAgCrC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Fallback for a node whose component id is not in the registry. Port of
|
|
3
|
+
* adapter-svelte/src/MissingComponent.svelte.
|
|
4
|
+
*
|
|
5
|
+
* Loud in the console always, visible on the page only in debug mode: a missing
|
|
6
|
+
* registration is a developer mistake, and a red box in production would make it
|
|
7
|
+
* the visitor's problem too.
|
|
8
|
+
*
|
|
9
|
+
* The warning fires from `ngOnInit` rather than the constructor because inputs
|
|
10
|
+
* are not bound yet in the constructor, and rather than `afterNextRender`
|
|
11
|
+
* because that never runs on the server — SSR would silently drop the
|
|
12
|
+
* diagnostic. `ngOnInit` runs in both.
|
|
13
|
+
*/
|
|
14
|
+
import { ChangeDetectionStrategy, Component, Input, computed, signal, } from '@angular/core';
|
|
15
|
+
import { injectExperience } from './context.js';
|
|
16
|
+
import * as i0 from "@angular/core";
|
|
17
|
+
export class MissingComponentComponent {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.componentIdValue = signal('', ...(ngDevMode ? [{ debugName: "componentIdValue" }] : []));
|
|
20
|
+
this.nodeIdValue = signal(undefined, ...(ngDevMode ? [{ debugName: "nodeIdValue" }] : []));
|
|
21
|
+
this.experience = injectExperience();
|
|
22
|
+
this.details = computed(() => JSON.stringify({ componentId: this.componentIdValue(), nodeId: this.nodeIdValue() ?? null }, null, 2), ...(ngDevMode ? [{ debugName: "details" }] : []));
|
|
23
|
+
}
|
|
24
|
+
set componentId(value) {
|
|
25
|
+
this.componentIdValue.set(value);
|
|
26
|
+
}
|
|
27
|
+
set nodeId(value) {
|
|
28
|
+
this.nodeIdValue.set(value);
|
|
29
|
+
}
|
|
30
|
+
ngOnInit() {
|
|
31
|
+
if (typeof console === 'undefined')
|
|
32
|
+
return;
|
|
33
|
+
const nodeId = this.nodeIdValue();
|
|
34
|
+
const idLabel = nodeId ? ` (nodeId: ${nodeId})` : '';
|
|
35
|
+
// No framework suffix on this one: it is identical across all adapters, and
|
|
36
|
+
// customers grep for it.
|
|
37
|
+
console.warn(`[@contentful/experiences] No component registered for id "${this.componentIdValue()}"${idLabel}.`);
|
|
38
|
+
}
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: MissingComponentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.28", type: MissingComponentComponent, isStandalone: true, selector: "cf-missing-component", inputs: { componentId: "componentId", nodeId: "nodeId" }, ngImport: i0, template: `
|
|
41
|
+
@if (experience().debug) {
|
|
42
|
+
<div
|
|
43
|
+
[attr.data-experiences-missing]="componentIdValue()"
|
|
44
|
+
style="border: 2px solid red; padding: 1rem; color: red; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem;"
|
|
45
|
+
>
|
|
46
|
+
<strong>Missing component ‘{{ componentIdValue() }}’</strong>
|
|
47
|
+
<p style="margin: 0.5rem 0;">
|
|
48
|
+
This node references a component id that is not in the registry. Register it under this
|
|
49
|
+
key in your <code>components</code> map:
|
|
50
|
+
</p>
|
|
51
|
+
<pre style="margin: 0; white-space: pre-wrap;">{{ details() }}</pre>
|
|
52
|
+
</div>
|
|
53
|
+
}
|
|
54
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.28", ngImport: i0, type: MissingComponentComponent, decorators: [{
|
|
57
|
+
type: Component,
|
|
58
|
+
args: [{
|
|
59
|
+
selector: 'cf-missing-component',
|
|
60
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
|
+
template: `
|
|
62
|
+
@if (experience().debug) {
|
|
63
|
+
<div
|
|
64
|
+
[attr.data-experiences-missing]="componentIdValue()"
|
|
65
|
+
style="border: 2px solid red; padding: 1rem; color: red; background: #fff; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem;"
|
|
66
|
+
>
|
|
67
|
+
<strong>Missing component ‘{{ componentIdValue() }}’</strong>
|
|
68
|
+
<p style="margin: 0.5rem 0;">
|
|
69
|
+
This node references a component id that is not in the registry. Register it under this
|
|
70
|
+
key in your <code>components</code> map:
|
|
71
|
+
</p>
|
|
72
|
+
<pre style="margin: 0; white-space: pre-wrap;">{{ details() }}</pre>
|
|
73
|
+
</div>
|
|
74
|
+
}
|
|
75
|
+
`,
|
|
76
|
+
}]
|
|
77
|
+
}], propDecorators: { componentId: [{
|
|
78
|
+
type: Input,
|
|
79
|
+
args: [{ required: true }]
|
|
80
|
+
}], nodeId: [{
|
|
81
|
+
type: Input
|
|
82
|
+
}] } });
|
|
83
|
+
//# sourceMappingURL=missing-component.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-component.component.js","sourceRoot":"","sources":["../src/missing-component.component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,KAAK,EAEL,QAAQ,EACR,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;;AAqBhD,MAAM,OAAO,yBAAyB;IAnBtC;QAoBqB,qBAAgB,GAAG,MAAM,CAAC,EAAE,4DAAC,CAAC;QAC9B,gBAAW,GAAG,MAAM,CAAqB,SAAS,uDAAC,CAAC;QAUpD,eAAU,GAAG,gBAAgB,EAAE,CAAC;QAEhC,YAAO,GAAG,QAAQ,CAAC,GAAG,EAAE,CACzC,IAAI,CAAC,SAAS,CACZ,EAAE,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,EAAE,EAC5E,IAAI,EACJ,CAAC,CACF,mDACF,CAAC;KAYH;IA5BC,IAA+B,WAAW,CAAC,KAAa;QACtD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,IAAa,MAAM,CAAC,KAAyB;QAC3C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAYD,QAAQ;QACN,IAAI,OAAO,OAAO,KAAK,WAAW;YAAE,OAAO;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,4EAA4E;QAC5E,yBAAyB;QACzB,OAAO,CAAC,IAAI,CACV,6DAA6D,IAAI,CAAC,gBAAgB,EAAE,IAAI,OAAO,GAAG,CACnG,CAAC;IACJ,CAAC;+GA/BU,yBAAyB;mGAAzB,yBAAyB,0IAhB1B;;;;;;;;;;;;;;GAcT;;4FAEU,yBAAyB;kBAnBrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;;;;;;;;;;;;;GAcT;iBACF;;sBAKE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAIxB,KAAK"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Injector, type ViewContainerRef } from '@angular/core';
|
|
2
|
+
import type { PortableRenderNode } from '@contentful/experiences-sdk-core';
|
|
3
|
+
import { ExperienceScope } from './experience-scope.js';
|
|
4
|
+
/**
|
|
5
|
+
* Creates, reuses, reorders and destroys the views for a list of nodes in one
|
|
6
|
+
* `ViewContainerRef`. Driven by the two structural directives in
|
|
7
|
+
* node-renderer.directive.ts; not exported from the package.
|
|
8
|
+
*/
|
|
9
|
+
export declare class NodeRenderEngine {
|
|
10
|
+
private readonly viewContainerRef;
|
|
11
|
+
private readonly hostInjector;
|
|
12
|
+
private readonly experienceScope;
|
|
13
|
+
private readonly units;
|
|
14
|
+
private nodes;
|
|
15
|
+
private lastConfig;
|
|
16
|
+
constructor(viewContainerRef: ViewContainerRef, hostInjector: Injector, experienceScope: ExperienceScope);
|
|
17
|
+
/**
|
|
18
|
+
* Called synchronously from the directive's input setter — the same point
|
|
19
|
+
* `NgComponentOutlet` creates from in `ngOnChanges`. It has to be synchronous
|
|
20
|
+
* rather than deferred to an effect: a single `detectChanges()` (which is all
|
|
21
|
+
* the test harness and `renderApplication` give us) must produce the full
|
|
22
|
+
* tree.
|
|
23
|
+
*/
|
|
24
|
+
setNodes(nodes: readonly PortableRenderNode[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Re-syncs if the registry changed under us. Which component a node resolves
|
|
27
|
+
* to depends on `config`, and nothing else the engine reads is structural —
|
|
28
|
+
* design values and content flow through the input bindings, which change
|
|
29
|
+
* detection already tracks.
|
|
30
|
+
*/
|
|
31
|
+
checkConfig(): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
private sync;
|
|
34
|
+
/**
|
|
35
|
+
* Walks `nodes` in DOM order, appending every unit that owns a view to
|
|
36
|
+
* `live`. Recurses only through orphaned experience templates: ordinary
|
|
37
|
+
* recursion happens through the customer component, which renders its own
|
|
38
|
+
* slots with its own `*cfNodes`.
|
|
39
|
+
*/
|
|
40
|
+
private collect;
|
|
41
|
+
/**
|
|
42
|
+
* Reports every diagnostic in a fresh `resolution` computation exactly
|
|
43
|
+
* once. `resolution.diagnostics` is a new array only when `resolveNode`
|
|
44
|
+
* actually re-ran (a reference check, not a deep-equality one) —
|
|
45
|
+
* `collect()` reads `unit.resolution()` on every sync, including syncs
|
|
46
|
+
* where nothing about this node changed, and re-reporting on every read
|
|
47
|
+
* would spam `ExperienceScope.diagnostics` with duplicates of the same
|
|
48
|
+
* event.
|
|
49
|
+
*/
|
|
50
|
+
private reportDiagnostics;
|
|
51
|
+
/**
|
|
52
|
+
* Creates the view for a `render`-mode resolution. Wrapped in try/catch: a
|
|
53
|
+
* customer component that throws while Angular constructs and first-checks
|
|
54
|
+
* it (constructor, template evaluation, `ngOnInit`) must not take down its
|
|
55
|
+
* siblings.
|
|
56
|
+
*
|
|
57
|
+
* This covers the SSR path with no separate SSR-specific code needed,
|
|
58
|
+
* unlike the React and Svelte adapters: `@angular/platform-server` runs
|
|
59
|
+
* this exact `createComponent` call, not a parallel server renderer, so a
|
|
60
|
+
* synchronous creation-time throw is caught here identically in SSR and
|
|
61
|
+
* CSR.
|
|
62
|
+
*
|
|
63
|
+
* A *later* throw — one that happens after creation succeeded, on a
|
|
64
|
+
* subsequent sync rather than this one — is a different case, covered by
|
|
65
|
+
* `collect()`'s own try/catch around `unit.resolution()`, not here. That
|
|
66
|
+
* split matters: `resolution.bindable`'s `inputBinding` getters (built by
|
|
67
|
+
* `bindings()` below) also call `unit.resolution()`, and it's tempting to
|
|
68
|
+
* wrap *those* instead — but `resolution`'s only tracked dependencies
|
|
69
|
+
* (`unit.node`, `experienceScope.config()`) are exclusively mutated from
|
|
70
|
+
* inside `collect()` (`unit.node.set(...)`, and `checkConfig()`'s call into
|
|
71
|
+
* `sync()`/`collect()`), so any throw from a genuine dependency change
|
|
72
|
+
* always reaches `collect()`'s own read first — by the time Angular's CD
|
|
73
|
+
* independently re-invokes a binding getter for that unit, the computed's
|
|
74
|
+
* error is already cached and `collect()` has already handled it. A
|
|
75
|
+
* `bindings()`-level catch would be unreachable dead code.
|
|
76
|
+
*
|
|
77
|
+
* What no fix here reaches: a throw inside the *customer* component's own
|
|
78
|
+
* internals on a later change-detection pass (its own template expression,
|
|
79
|
+
* computed, or lifecycle hook unrelated to our bindings) — that never
|
|
80
|
+
* touches adapter code at all. A per-node `ErrorHandler` provider in
|
|
81
|
+
* `unit.injector` doesn't help here either: `ApplicationRef.tick()`
|
|
82
|
+
* resolves `ErrorHandler` once, from the *root* injector, at construction,
|
|
83
|
+
* and never re-resolves it from whichever component's injector actually
|
|
84
|
+
* threw — a per-node override in a child injector is structurally
|
|
85
|
+
* unreachable from that catch. Documented gap; see the README's
|
|
86
|
+
* error-handling section.
|
|
87
|
+
*/
|
|
88
|
+
private createView;
|
|
89
|
+
/**
|
|
90
|
+
* Shared by `createView`'s creation-time catch and
|
|
91
|
+
* `reportPostCreationFailure`'s later-pass catch: reports the diagnostic
|
|
92
|
+
* and mounts the customer's `renderError` override (or the built-in
|
|
93
|
+
* default) at `index`. The caller picks `index` — appending at the current
|
|
94
|
+
* end for a brand-new unit, or the unit's own prior position when
|
|
95
|
+
* replacing an already-mounted view — since this method has no way to
|
|
96
|
+
* know which situation it's in.
|
|
97
|
+
*/
|
|
98
|
+
private mountErrorFallback;
|
|
99
|
+
private createUnit;
|
|
100
|
+
/**
|
|
101
|
+
* Change-detection-integrated, unlike a one-shot `setInput` record: each
|
|
102
|
+
* binding re-reads the merged props when the node, the active viewport or a
|
|
103
|
+
* design token changes, and marks the (likely `OnPush`) customer component
|
|
104
|
+
* dirty only when its own value did.
|
|
105
|
+
*/
|
|
106
|
+
private bindings;
|
|
107
|
+
private detach;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=node-render-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-render-engine.d.ts","sourceRoot":"","sources":["../src/node-render-engine.ts"],"names":[],"mappings":"AAiCA,OAAO,EAGL,QAAQ,EAIR,KAAK,gBAAgB,EAMtB,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAyRxD;;;;GAIG;AACH,qBAAa,gBAAgB;IAMzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAPlC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA2B;IACjD,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,UAAU,CAAuB;gBAGtB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,QAAQ,EACtB,eAAe,EAAE,eAAe;IAGnD;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,GAAG,IAAI;IAKpD;;;;;OAKG;IACH,WAAW,IAAI,IAAI;IAKnB,OAAO,IAAI,IAAI;IAKf,OAAO,CAAC,IAAI;IAuBZ;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IA4Gf;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,OAAO,CAAC,UAAU;IAiBlB;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAmC1B,OAAO,CAAC,UAAU;IAwClB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,MAAM;CAQf"}
|