@molecule/app-angular 3.10.0 → 3.12.1
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/README.md +244 -11
- package/dist/dom-placement.d.ts +172 -0
- package/dist/dom-placement.d.ts.map +1 -0
- package/dist/dom-placement.js +518 -0
- package/dist/dom-placement.js.map +1 -0
- package/dist/hooks/use-router.js +1 -1
- package/dist/hooks/use-router.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +3 -1
- package/dist/providers.js.map +1 -1
- package/dist/routed-view-token.js +1 -1
- package/dist/routed-view-token.js.map +1 -1
- package/dist/services/forms.service.d.ts +1 -0
- package/dist/services/forms.service.d.ts.map +1 -1
- package/dist/services/forms.service.js +1 -0
- package/dist/services/forms.service.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM placement for the Angular ports.
|
|
3
|
+
*
|
|
4
|
+
* One owner for every case where a port's DOM must differ from where Angular
|
|
5
|
+
* put a node:
|
|
6
|
+
*
|
|
7
|
+
* - an element that is absent while React would render nothing
|
|
8
|
+
* ({@link setElementPresent}, {@link useHostPresence});
|
|
9
|
+
* - an element rendered in another parent, React's `createPortal`
|
|
10
|
+
* ({@link placeElement});
|
|
11
|
+
* - a slot's content rendered in another parent ({@link placeContent});
|
|
12
|
+
* - one wrapper element per projected child, React's
|
|
13
|
+
* `children.map((c) => <div>{c}</div>)` ({@link WrappedChildren},
|
|
14
|
+
* {@link MolWrapEachChild}).
|
|
15
|
+
*
|
|
16
|
+
* Angular keeps inserting, moving and removing the nodes it created, and it
|
|
17
|
+
* finds their place through the nodes themselves: it inserts a view before the
|
|
18
|
+
* first node of the next view, under the parent of the container's anchor
|
|
19
|
+
* comment. A node a component moved elsewhere breaks that (NG05106). So the
|
|
20
|
+
* placement rules are applied where Angular places nodes, in its renderer
|
|
21
|
+
* ({@link provideDomPlacement}); components never move a node themselves.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import { afterEveryRender, ChangeDetectorRef, DestroyRef, Directive, effect, ElementRef, inject, Injectable, InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer, RendererFactory2, signal, } from '@angular/core';
|
|
26
|
+
import * as i0 from "@angular/core";
|
|
27
|
+
/** Set once {@link provideDomPlacement} decorated the application's renderer factory. */
|
|
28
|
+
const DOM_PLACEMENT = new InjectionToken('@molecule/app-angular DOM placement');
|
|
29
|
+
/** The renderer factories already decorated (a wrapper of a wrapper would wrap each child twice). */
|
|
30
|
+
const decorated = new WeakSet();
|
|
31
|
+
/** An absent element → the empty comment that holds its place. */
|
|
32
|
+
const placeholders = new WeakMap();
|
|
33
|
+
/** An absent host element → the check that restores it once its component renders again. */
|
|
34
|
+
const absentHosts = new WeakMap();
|
|
35
|
+
/** An element whose children are each wrapped → its wrapper bookkeeping. */
|
|
36
|
+
const wrappingParents = new WeakMap();
|
|
37
|
+
/** A wrapper element → the bookkeeping that created it. */
|
|
38
|
+
const wrapperOwners = new WeakMap();
|
|
39
|
+
/**
|
|
40
|
+
* Elements {@link placeElement} rendered in another parent. Angular removes only
|
|
41
|
+
* a view's root nodes, so an element moved out of a component goes when its
|
|
42
|
+
* placeholder's view goes (React unmounts a portal with its owner).
|
|
43
|
+
*/
|
|
44
|
+
const elsewhere = new Set();
|
|
45
|
+
/**
|
|
46
|
+
* Whether Angular's node is one React child: an element, or a text node that
|
|
47
|
+
* is not template indentation. Angular creates an interpolated text node empty
|
|
48
|
+
* and fills it in the same pass, so an empty text node is a child; comments are
|
|
49
|
+
* Angular's own block anchors.
|
|
50
|
+
*
|
|
51
|
+
* @param node - The node Angular is placing.
|
|
52
|
+
* @returns Whether the node gets its own wrapper.
|
|
53
|
+
*/
|
|
54
|
+
function isChild(node) {
|
|
55
|
+
if (node.nodeType === 1)
|
|
56
|
+
return true;
|
|
57
|
+
if (node.nodeType !== 3)
|
|
58
|
+
return false;
|
|
59
|
+
const text = node.data;
|
|
60
|
+
return text.length === 0 || text.trim() !== '';
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The node that holds `ref`'s place among `parent`'s children: `ref` itself,
|
|
64
|
+
* the placeholder of an absent element, or the wrapper around a wrapped child.
|
|
65
|
+
*
|
|
66
|
+
* @param ref - The node Angular wants to insert before.
|
|
67
|
+
* @param parent - The parent Angular is inserting into.
|
|
68
|
+
* @returns The child of `parent` to insert before.
|
|
69
|
+
*/
|
|
70
|
+
function placeOf(ref, parent) {
|
|
71
|
+
let node = placeholders.get(ref) ?? ref;
|
|
72
|
+
while (node.parentNode !== null && node.parentNode !== parent) {
|
|
73
|
+
if (!wrapperOwners.has(node.parentNode))
|
|
74
|
+
break;
|
|
75
|
+
node = node.parentNode;
|
|
76
|
+
}
|
|
77
|
+
return node;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Forgets an absent element's placeholder: Angular is removing or re-placing
|
|
81
|
+
* the element, so the old place is no longer its place.
|
|
82
|
+
*
|
|
83
|
+
* @param node - The node Angular is removing or inserting.
|
|
84
|
+
*/
|
|
85
|
+
function dropPlaceholder(node) {
|
|
86
|
+
const placeholder = placeholders.get(node);
|
|
87
|
+
if (placeholder === undefined)
|
|
88
|
+
return;
|
|
89
|
+
placeholders.delete(node);
|
|
90
|
+
elsewhere.delete(node);
|
|
91
|
+
const wrapper = placeholder.parentNode;
|
|
92
|
+
placeholder.remove();
|
|
93
|
+
dropEmptyWrapper(wrapper);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Removes a wrapper whose child Angular removed (React renders one wrapper per
|
|
97
|
+
* child).
|
|
98
|
+
*
|
|
99
|
+
* @param node - The removed node's former parent.
|
|
100
|
+
*/
|
|
101
|
+
function dropEmptyWrapper(node) {
|
|
102
|
+
if (node === null || node.hasChildNodes())
|
|
103
|
+
return;
|
|
104
|
+
const owner = wrapperOwners.get(node);
|
|
105
|
+
if (owner === undefined)
|
|
106
|
+
return;
|
|
107
|
+
node.remove();
|
|
108
|
+
owner.refresh();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Removes every element rendered elsewhere whose place was inside a subtree
|
|
112
|
+
* Angular just removed.
|
|
113
|
+
*
|
|
114
|
+
* @param removed - The node Angular removed.
|
|
115
|
+
*/
|
|
116
|
+
function dropElsewhereInside(removed) {
|
|
117
|
+
for (const element of elsewhere) {
|
|
118
|
+
const placeholder = placeholders.get(element);
|
|
119
|
+
if (placeholder === undefined) {
|
|
120
|
+
elsewhere.delete(element);
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (!removed.contains(placeholder))
|
|
124
|
+
continue;
|
|
125
|
+
elsewhere.delete(element);
|
|
126
|
+
placeholders.delete(element);
|
|
127
|
+
element.remove();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Restores an absent host as soon as Angular renders a node into it, so the
|
|
132
|
+
* component's new content is created inside the document (its children's
|
|
133
|
+
* `ngAfterViewInit` can focus and measure, as a React effect can).
|
|
134
|
+
*
|
|
135
|
+
* @param parent - The parent Angular just inserted into.
|
|
136
|
+
*/
|
|
137
|
+
function restoreAbsentHostOf(parent) {
|
|
138
|
+
if (parent.isConnected)
|
|
139
|
+
return;
|
|
140
|
+
absentHosts.get(parent.getRootNode())?.();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Wraps one of Angular's renderers so the placement rules apply to every node
|
|
144
|
+
* it inserts or removes. Everything else is the wrapped renderer's.
|
|
145
|
+
*
|
|
146
|
+
* @param renderer - The application's renderer.
|
|
147
|
+
* @returns The renderer Angular uses instead.
|
|
148
|
+
*/
|
|
149
|
+
function withPlacement(renderer) {
|
|
150
|
+
const placed = Object.create(renderer);
|
|
151
|
+
const insert = (parent, child, ref, isMove) => {
|
|
152
|
+
// Angular injects a container's anchor through a host that is not in the
|
|
153
|
+
// DOM yet (a component created inside a view before it is inserted), and
|
|
154
|
+
// its own renderer ignores a null parent. Forward that call unchanged:
|
|
155
|
+
// `appendChild` would throw, while `insertBefore` does nothing.
|
|
156
|
+
if (parent === null) {
|
|
157
|
+
;
|
|
158
|
+
renderer.insertBefore(parent, child, ref, isMove);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
dropPlaceholder(child);
|
|
162
|
+
const from = child.parentNode;
|
|
163
|
+
const before = ref === null ? null : placeOf(ref, parent);
|
|
164
|
+
const owner = wrappingParents.get(parent);
|
|
165
|
+
let node = child;
|
|
166
|
+
if (owner !== undefined && isChild(child)) {
|
|
167
|
+
node = owner.createWrapper();
|
|
168
|
+
node.appendChild(child);
|
|
169
|
+
}
|
|
170
|
+
if (before === null)
|
|
171
|
+
renderer.appendChild(parent, node);
|
|
172
|
+
else
|
|
173
|
+
renderer.insertBefore(parent, node, before, isMove);
|
|
174
|
+
if (from !== parent)
|
|
175
|
+
dropEmptyWrapper(from);
|
|
176
|
+
owner?.refresh();
|
|
177
|
+
restoreAbsentHostOf(parent);
|
|
178
|
+
};
|
|
179
|
+
placed.appendChild = (parent, child) => insert(parent, child, null);
|
|
180
|
+
placed.insertBefore = (parent, child, ref, isMove) => insert(parent, child, ref ?? null, isMove);
|
|
181
|
+
placed.removeChild = (parent, child, ...rest) => {
|
|
182
|
+
dropPlaceholder(child);
|
|
183
|
+
const from = child.parentNode;
|
|
184
|
+
renderer.removeChild(parent, child, ...rest);
|
|
185
|
+
dropEmptyWrapper(from);
|
|
186
|
+
if (elsewhere.size > 0)
|
|
187
|
+
dropElsewhereInside(child);
|
|
188
|
+
};
|
|
189
|
+
return placed;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Installs the placement rules in the application's renderer. `provideMolecule`
|
|
193
|
+
* includes it; a test that mounts a port without `provideMolecule` adds it to
|
|
194
|
+
* the application's providers. It wraps whatever renderer factory the
|
|
195
|
+
* application configured, so it also applies under an animation renderer.
|
|
196
|
+
*
|
|
197
|
+
* @returns The environment providers.
|
|
198
|
+
*/
|
|
199
|
+
export function provideDomPlacement() {
|
|
200
|
+
return makeEnvironmentProviders([
|
|
201
|
+
{ provide: DOM_PLACEMENT, useValue: true },
|
|
202
|
+
provideEnvironmentInitializer(() => {
|
|
203
|
+
const factory = inject(RendererFactory2);
|
|
204
|
+
// provideMolecule() and a direct provideDomPlacement() together decorate it once.
|
|
205
|
+
if (decorated.has(factory))
|
|
206
|
+
return;
|
|
207
|
+
decorated.add(factory);
|
|
208
|
+
const create = factory.createRenderer.bind(factory);
|
|
209
|
+
const placed = new WeakMap();
|
|
210
|
+
factory.createRenderer = (element, type) => {
|
|
211
|
+
const renderer = create(element, type);
|
|
212
|
+
let wrapped = placed.get(renderer);
|
|
213
|
+
if (wrapped === undefined)
|
|
214
|
+
placed.set(renderer, (wrapped = withPlacement(renderer)));
|
|
215
|
+
return wrapped;
|
|
216
|
+
};
|
|
217
|
+
}),
|
|
218
|
+
]);
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Throws when the application has no {@link provideDomPlacement}: without it
|
|
222
|
+
* Angular throws NG05106 the first time it inserts before a wrapped or absent
|
|
223
|
+
* node, which depends on the data.
|
|
224
|
+
*
|
|
225
|
+
* @param user - The API the caller used, for the message.
|
|
226
|
+
*/
|
|
227
|
+
function assertDomPlacement(user) {
|
|
228
|
+
if (inject(DOM_PLACEMENT, { optional: true }) === null) {
|
|
229
|
+
throw new Error(`${user} needs provideDomPlacement() from @molecule/app-angular in the application's providers ` +
|
|
230
|
+
`(provideMolecule() includes it).`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Takes an element out of its parent while `present` is false and puts it back
|
|
235
|
+
* in the same place once it is true: Angular's equivalent of React's
|
|
236
|
+
* `{cond && <span>…</span>}` for an element the template must keep (one that
|
|
237
|
+
* holds an `<ng-content>`). "Attached" means the element has a parent, not
|
|
238
|
+
* that it is in the document, so it also works inside a host that is itself
|
|
239
|
+
* absent. An element that was never taken out is left where Angular put it.
|
|
240
|
+
* Angular may remove or move the element while it is absent; its placeholder
|
|
241
|
+
* goes then.
|
|
242
|
+
*
|
|
243
|
+
* @param element - The element (nothing happens without one).
|
|
244
|
+
* @param present - Whether React would render it now.
|
|
245
|
+
*/
|
|
246
|
+
export function setElementPresent(element, present) {
|
|
247
|
+
if (!element)
|
|
248
|
+
return;
|
|
249
|
+
const placeholder = placeholders.get(element);
|
|
250
|
+
if (present) {
|
|
251
|
+
if (placeholder === undefined)
|
|
252
|
+
return;
|
|
253
|
+
placeholders.delete(element);
|
|
254
|
+
elsewhere.delete(element);
|
|
255
|
+
// A placeholder whose parent was removed meanwhile has nowhere to restore to.
|
|
256
|
+
if (placeholder.parentNode !== null)
|
|
257
|
+
placeholder.replaceWith(element);
|
|
258
|
+
}
|
|
259
|
+
else if (placeholder === undefined && element.parentNode !== null) {
|
|
260
|
+
const comment = element.ownerDocument.createComment('');
|
|
261
|
+
element.replaceWith(comment);
|
|
262
|
+
placeholders.set(element, comment);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Renders an element in another parent while it keeps its place in Angular's
|
|
267
|
+
* view: Angular's equivalent of React's `createPortal(child, document.body)`.
|
|
268
|
+
* An empty comment holds the element's place, so Angular can still insert
|
|
269
|
+
* before it and remove it. `null` puts it back where Angular put it. Calling it
|
|
270
|
+
* again with the same target moves nothing. If Angular moves the element while
|
|
271
|
+
* it is elsewhere, the element follows Angular and the next call moves it
|
|
272
|
+
* again. When Angular removes the view that holds its place, the element is
|
|
273
|
+
* removed from the other parent too, as React unmounts a portal.
|
|
274
|
+
*
|
|
275
|
+
* @param element - The element (nothing happens without one).
|
|
276
|
+
* @param target - The parent to render it in, or `null` for its own place.
|
|
277
|
+
*/
|
|
278
|
+
export function placeElement(element, target) {
|
|
279
|
+
if (!element)
|
|
280
|
+
return;
|
|
281
|
+
if (target === null) {
|
|
282
|
+
setElementPresent(element, true);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (!placeholders.has(element) && element.parentNode !== null) {
|
|
286
|
+
const comment = element.ownerDocument.createComment('');
|
|
287
|
+
element.replaceWith(comment);
|
|
288
|
+
placeholders.set(element, comment);
|
|
289
|
+
}
|
|
290
|
+
elsewhere.add(element);
|
|
291
|
+
if (element.parentNode !== target)
|
|
292
|
+
target.appendChild(element);
|
|
293
|
+
}
|
|
294
|
+
/** A capture element → the comments that bracket its content wherever it is. */
|
|
295
|
+
const contentRanges = new WeakMap();
|
|
296
|
+
/**
|
|
297
|
+
* Renders a capture element's content somewhere else: Angular's equivalent of
|
|
298
|
+
* React placing the same `{slot}` in a different parent depending on props
|
|
299
|
+
* (`loading ? <span>{label}</span> : label`). The capture element is the
|
|
300
|
+
* template element that holds the `<ng-content>`.
|
|
301
|
+
*
|
|
302
|
+
* The whole content moves as one run, Angular's block anchors included, so the
|
|
303
|
+
* consumer's `@for` and `@if` keep working at the new place: Angular inserts a
|
|
304
|
+
* view under the parent of its anchor, before a node of the same run. Never
|
|
305
|
+
* move a filtered or remembered list of nodes instead; the anchors or the
|
|
306
|
+
* nodes Angular adds later stay behind (NG05106). Calling it again with the
|
|
307
|
+
* same target moves nothing.
|
|
308
|
+
*
|
|
309
|
+
* @param capture - The element Angular projected the content into.
|
|
310
|
+
* @param target - The parent to render the content in, or `null` to put it
|
|
311
|
+
* back inside `capture`.
|
|
312
|
+
* @param before - The child of `target` to place the content before (default:
|
|
313
|
+
* at the end).
|
|
314
|
+
*/
|
|
315
|
+
export function placeContent(capture, target, before = null) {
|
|
316
|
+
if (!capture)
|
|
317
|
+
return;
|
|
318
|
+
let range = contentRanges.get(capture);
|
|
319
|
+
if (range === undefined) {
|
|
320
|
+
if (target === null)
|
|
321
|
+
return;
|
|
322
|
+
const document = capture.ownerDocument;
|
|
323
|
+
range = { start: document.createComment(''), end: document.createComment('') };
|
|
324
|
+
capture.prepend(range.start);
|
|
325
|
+
capture.append(range.end);
|
|
326
|
+
contentRanges.set(capture, range);
|
|
327
|
+
}
|
|
328
|
+
const parent = target ?? capture;
|
|
329
|
+
if (range.start.parentNode === parent)
|
|
330
|
+
return;
|
|
331
|
+
const run = [];
|
|
332
|
+
for (let node = range.start; node !== null; node = node.nextSibling) {
|
|
333
|
+
run.push(node);
|
|
334
|
+
if (node === range.end)
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
const ref = target === null ? null : before;
|
|
338
|
+
for (const node of run)
|
|
339
|
+
parent.insertBefore(node, ref);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Whether a slot renders anything, React's `{slot && …}` for projected
|
|
343
|
+
* content: an element, or text that is not template indentation. It reads the
|
|
344
|
+
* content wherever {@link placeContent} rendered it, so a component that moved
|
|
345
|
+
* its slot elsewhere still sees it. Comments (Angular's anchors) are not
|
|
346
|
+
* content.
|
|
347
|
+
*
|
|
348
|
+
* @param capture - The element Angular projected the content into.
|
|
349
|
+
* @returns Whether the slot has content.
|
|
350
|
+
*/
|
|
351
|
+
export function hasContent(capture) {
|
|
352
|
+
if (!capture)
|
|
353
|
+
return false;
|
|
354
|
+
const range = contentRanges.get(capture);
|
|
355
|
+
const nodes = [];
|
|
356
|
+
if (range === undefined || range.start.parentNode === capture) {
|
|
357
|
+
nodes.push(...Array.from(capture.childNodes));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
for (let node = range.start.nextSibling; node !== null && node !== range.end;) {
|
|
361
|
+
nodes.push(node);
|
|
362
|
+
node = node.nextSibling;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
return nodes.some((node) => node.nodeType === 1 || (node.nodeType === 3 && (node.textContent ?? '').trim() !== ''));
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Keeps the calling component's host element out of the DOM while
|
|
369
|
+
* `isPresent()` is false: Angular's equivalent of a React component that
|
|
370
|
+
* returns `null`. Call it in the component's injection context.
|
|
371
|
+
*
|
|
372
|
+
* The host is put back before the component's own view refreshes whenever that
|
|
373
|
+
* is knowable: when a signal `isPresent` reads changed (an effect, which
|
|
374
|
+
* Angular runs before the view), and when Angular renders the first node into
|
|
375
|
+
* the absent host (so an `@if` branch that turns on with a plain input is
|
|
376
|
+
* built inside the document). Every render ends with the same check, which
|
|
377
|
+
* covers a predicate that reads what the render produced; a host restored
|
|
378
|
+
* there gets one more check with its content in the page.
|
|
379
|
+
*
|
|
380
|
+
* @param isPresent - Whether the component renders anything now. It may read
|
|
381
|
+
* inputs, plain fields or signals.
|
|
382
|
+
*/
|
|
383
|
+
export function useHostPresence(isPresent) {
|
|
384
|
+
assertDomPlacement('useHostPresence');
|
|
385
|
+
const host = inject((ElementRef)).nativeElement;
|
|
386
|
+
const sync = () => {
|
|
387
|
+
const present = isPresent();
|
|
388
|
+
if (present) {
|
|
389
|
+
absentHosts.delete(host);
|
|
390
|
+
setElementPresent(host, true);
|
|
391
|
+
}
|
|
392
|
+
else if (host.parentNode !== null) {
|
|
393
|
+
// React removes the subtree and the focus with it.
|
|
394
|
+
const active = host.ownerDocument.activeElement;
|
|
395
|
+
if (active instanceof HTMLElement && host.contains(active))
|
|
396
|
+
active.blur();
|
|
397
|
+
setElementPresent(host, false);
|
|
398
|
+
absentHosts.set(host, sync);
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
effect(sync);
|
|
402
|
+
const changeDetector = inject(ChangeDetectorRef);
|
|
403
|
+
afterEveryRender({
|
|
404
|
+
write: () => {
|
|
405
|
+
const wasAbsent = placeholders.has(host);
|
|
406
|
+
sync();
|
|
407
|
+
// Restored only after the render (a plain-input predicate whose change rendered no new
|
|
408
|
+
// node): the content was checked outside the page, so check it once more inside it.
|
|
409
|
+
if (wasAbsent && !placeholders.has(host))
|
|
410
|
+
changeDetector.markForCheck();
|
|
411
|
+
},
|
|
412
|
+
});
|
|
413
|
+
inject(DestroyRef).onDestroy(() => absentHosts.delete(host));
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* The wrappers around a component's projected children: React's
|
|
417
|
+
* `children.map((child) => <div>{child}</div>)`.
|
|
418
|
+
*
|
|
419
|
+
* The component lists it in `providers`, injects it, and puts
|
|
420
|
+
* `molWrapEachChild` on the template element that holds `<ng-content>`.
|
|
421
|
+
* Angular then places every projected child — at creation and whenever the
|
|
422
|
+
* consumer's `@for` or `@if` adds one later, anywhere in the list — inside its
|
|
423
|
+
* own wrapper, and a wrapper goes with its child. No node is moved after
|
|
424
|
+
* Angular placed it. The component styles the wrappers from {@link wrappers}
|
|
425
|
+
* (an effect), and reads React's `children.length` as `wrappers().length`.
|
|
426
|
+
*/
|
|
427
|
+
export class WrappedChildren {
|
|
428
|
+
constructor() {
|
|
429
|
+
this.state = signal([], /* @ts-ignore */
|
|
430
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
431
|
+
this.parent = null;
|
|
432
|
+
this.create = (document) => document.createElement('div');
|
|
433
|
+
/** The wrappers, in render order. */
|
|
434
|
+
this.wrappers = this.state.asReadonly();
|
|
435
|
+
assertDomPlacement('WrappedChildren');
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Sets how a wrapper element is created (default: an empty `<div>`). Call it
|
|
439
|
+
* in the constructor; attributes that depend on the child's index belong in
|
|
440
|
+
* an effect over {@link wrappers}.
|
|
441
|
+
*
|
|
442
|
+
* @param create - Builds one wrapper element.
|
|
443
|
+
*/
|
|
444
|
+
wrapWith(create) {
|
|
445
|
+
this.create = create;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* Starts wrapping the children Angular places in `parent`.
|
|
449
|
+
*
|
|
450
|
+
* @param parent - The element that holds the projected content.
|
|
451
|
+
* @internal
|
|
452
|
+
*/
|
|
453
|
+
attach(parent) {
|
|
454
|
+
if (this.parent !== null) {
|
|
455
|
+
throw new Error('WrappedChildren: one component wraps the children of one element.');
|
|
456
|
+
}
|
|
457
|
+
this.parent = parent;
|
|
458
|
+
wrappingParents.set(parent, this);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Creates one wrapper.
|
|
462
|
+
*
|
|
463
|
+
* @returns The wrapper element.
|
|
464
|
+
* @internal
|
|
465
|
+
*/
|
|
466
|
+
createWrapper() {
|
|
467
|
+
const wrapper = this.create(this.parent.ownerDocument);
|
|
468
|
+
wrapperOwners.set(wrapper, this);
|
|
469
|
+
return wrapper;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Re-reads the wrappers after Angular added or removed a child.
|
|
473
|
+
*
|
|
474
|
+
* @internal
|
|
475
|
+
*/
|
|
476
|
+
refresh() {
|
|
477
|
+
if (this.parent === null)
|
|
478
|
+
return;
|
|
479
|
+
const next = [];
|
|
480
|
+
for (const child of Array.from(this.parent.children)) {
|
|
481
|
+
if (wrapperOwners.get(child) !== this)
|
|
482
|
+
continue;
|
|
483
|
+
// Angular's `animate.leave` removes a cancelled leaving element without the renderer.
|
|
484
|
+
if (child.hasChildNodes())
|
|
485
|
+
next.push(child);
|
|
486
|
+
else
|
|
487
|
+
child.remove();
|
|
488
|
+
}
|
|
489
|
+
const current = this.state();
|
|
490
|
+
if (next.length === current.length && next.every((wrapper, i) => wrapper === current[i]))
|
|
491
|
+
return;
|
|
492
|
+
this.state.set(next);
|
|
493
|
+
}
|
|
494
|
+
static { this.ɵfac = function WrappedChildren_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || WrappedChildren)(); }; }
|
|
495
|
+
static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: WrappedChildren, factory: WrappedChildren.ɵfac }); }
|
|
496
|
+
}
|
|
497
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WrappedChildren, [{
|
|
498
|
+
type: Injectable
|
|
499
|
+
}], () => [], null); })();
|
|
500
|
+
/**
|
|
501
|
+
* Marks the template element whose projected children are each wrapped:
|
|
502
|
+
* `<div molWrapEachChild><ng-content /></div>`. See {@link WrappedChildren}.
|
|
503
|
+
* The marker attribute is taken off the element, so the markup stays React's.
|
|
504
|
+
*/
|
|
505
|
+
export class MolWrapEachChild {
|
|
506
|
+
constructor() {
|
|
507
|
+
const parent = inject((ElementRef)).nativeElement;
|
|
508
|
+
parent.removeAttribute('molWrapEachChild');
|
|
509
|
+
inject(WrappedChildren).attach(parent);
|
|
510
|
+
}
|
|
511
|
+
static { this.ɵfac = function MolWrapEachChild_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MolWrapEachChild)(); }; }
|
|
512
|
+
static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: MolWrapEachChild, selectors: [["", "molWrapEachChild", ""]] }); }
|
|
513
|
+
}
|
|
514
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MolWrapEachChild, [{
|
|
515
|
+
type: Directive,
|
|
516
|
+
args: [{ selector: '[molWrapEachChild]', standalone: true }]
|
|
517
|
+
}], () => [], null); })();
|
|
518
|
+
//# sourceMappingURL=dom-placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-placement.js","sourceRoot":"","sources":["../src/dom-placement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,MAAM,EACN,UAAU,EAEV,MAAM,EACN,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,6BAA6B,EAE7B,gBAAgB,EAEhB,MAAM,GACP,MAAM,eAAe,CAAA;;AAEtB,yFAAyF;AACzF,MAAM,aAAa,GAAG,IAAI,cAAc,CAAO,qCAAqC,CAAC,CAAA;AAErF,qGAAqG;AACrG,MAAM,SAAS,GAAG,IAAI,OAAO,EAAoB,CAAA;AAEjD,kEAAkE;AAClE,MAAM,YAAY,GAAG,IAAI,OAAO,E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gBAAgB;IAC3B;QACE,MAAM,MAAM,GAAG,MAAM,CAAC,CAAA,UAAuB,CAAA,CAAC,CAAC,aAA4B,CAAA;QAC3E,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAA;QAC1C,MAAM,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACxC,CAAC;iHALU,gBAAgB;oEAAhB,gBAAgB;;iFAAhB,gBAAgB;cAD5B,SAAS;eAAC,EAAE,QAAQ,EAAE,oBAAoB,EAAE,UAAU,EAAE,IAAI,EAAE"}
|
package/dist/hooks/use-router.js
CHANGED
|
@@ -22,7 +22,7 @@ import { ROUTER } from '../tokens.js';
|
|
|
22
22
|
export function useRouterInstance() {
|
|
23
23
|
const router = inject(ROUTER, { optional: true });
|
|
24
24
|
if (!router) {
|
|
25
|
-
throw new I18nError('angular.error.useRouterOutsideProvider', undefined, "No router here. Add `provideMoleculeRouter()` from the routing bond (`@molecule/app-routing-angular-router`) to the app's providers, after Angular's `provideRouter(routes)`, or pass `router` to `provideMolecule`.");
|
|
25
|
+
throw new I18nError('angular.error.useRouterOutsideProvider', undefined, "No router here. Add `provideMoleculeRouter()` from the routing bond (`@molecule/app-routing-angular-router`) to the app's providers, after Angular's `provideRouter(routes)`, or pass `router` to `provideMolecule`. If the app already does this, its routing bond is older than this binding: update it (`npm install @molecule/app-routing-angular-router@latest`).");
|
|
26
26
|
}
|
|
27
27
|
return router;
|
|
28
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-router.js","sourceRoot":"","sources":["../../src/hooks/use-router.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,MAAM,EACN,MAAM,EAEN,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAW9C,OAAO,EACL,yBAAyB,EACzB,iBAA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AAA;QACd,UAAU,GAAG,IAAI,CAAA;IACnB,CAAC,CAAC,CAAA;IACF,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -95,6 +95,13 @@
|
|
|
95
95
|
* Molecule service whose token was never provided fails at DI time.
|
|
96
96
|
* Per-concern helpers (`provideAuth`, `provideTheme`, ...) exist for
|
|
97
97
|
* piecemeal setup.
|
|
98
|
+
* - The Molecule Angular components render through `provideDomPlacement()`,
|
|
99
|
+
* which `provideMolecule` includes. An app or test that mounts them without
|
|
100
|
+
* `provideMolecule` adds `provideDomPlacement()` to its providers; a component
|
|
101
|
+
* that needs it throws a message naming it. A component never moves a node
|
|
102
|
+
* Angular rendered (`appendChild`, `insertBefore`, `remove`): it uses
|
|
103
|
+
* `useHostPresence`, `setElementPresent`, `placeElement`, `placeContent` or
|
|
104
|
+
* `WrappedChildren`, which keep Angular's own inserts working (NG05106).
|
|
98
105
|
* - In-app links use the `Link` directive (`<a molLink="/settings">`, `imports: [Link]`): it
|
|
99
106
|
* navigates through the molecule router with react-router `<Link>`'s click rules. A bare
|
|
100
107
|
* `<a href>` reloads the page; a hand-written `(click)` handler that calls `navigate()`
|
|
@@ -104,6 +111,7 @@
|
|
|
104
111
|
*/
|
|
105
112
|
export * from './agent-identity.js';
|
|
106
113
|
export * from './chat.js';
|
|
114
|
+
export * from './dom-placement.js';
|
|
107
115
|
export * from './hooks/index.js';
|
|
108
116
|
export * from './i18n-reactive.js';
|
|
109
117
|
export * from './link.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AAEH,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -95,6 +95,13 @@
|
|
|
95
95
|
* Molecule service whose token was never provided fails at DI time.
|
|
96
96
|
* Per-concern helpers (`provideAuth`, `provideTheme`, ...) exist for
|
|
97
97
|
* piecemeal setup.
|
|
98
|
+
* - The Molecule Angular components render through `provideDomPlacement()`,
|
|
99
|
+
* which `provideMolecule` includes. An app or test that mounts them without
|
|
100
|
+
* `provideMolecule` adds `provideDomPlacement()` to its providers; a component
|
|
101
|
+
* that needs it throws a message naming it. A component never moves a node
|
|
102
|
+
* Angular rendered (`appendChild`, `insertBefore`, `remove`): it uses
|
|
103
|
+
* `useHostPresence`, `setElementPresent`, `placeElement`, `placeContent` or
|
|
104
|
+
* `WrappedChildren`, which keep Angular's own inserts working (NG05106).
|
|
98
105
|
* - In-app links use the `Link` directive (`<a molLink="/settings">`, `imports: [Link]`): it
|
|
99
106
|
* navigates through the molecule router with react-router `<Link>`'s click rules. A bare
|
|
100
107
|
* `<a href>` reloads the page; a hand-written `(click)` handler that calls `navigate()`
|
|
@@ -104,6 +111,7 @@
|
|
|
104
111
|
*/
|
|
105
112
|
export * from './agent-identity.js';
|
|
106
113
|
export * from './chat.js';
|
|
114
|
+
export * from './dom-placement.js';
|
|
107
115
|
export * from './hooks/index.js';
|
|
108
116
|
export * from './i18n-reactive.js';
|
|
109
117
|
export * from './link.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8GG;AAEH,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
package/dist/providers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAY,IAAI,EAAE,MAAM,eAAe,CAAA;AASzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,K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