@absolutejs/absolute 0.19.0-beta.419 → 0.19.0-beta.420
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/dist/angular/browser.js +13 -1
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/defer-slot.component.js +12 -1
- package/dist/angular/index.js +14 -2
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +2 -2
- package/dist/angular/server.js.map +1 -1
- package/dist/build.js +2 -2
- package/dist/build.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/src/angular/components/defer-slot.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Input, inject, signal } from '@angular/core';
|
|
1
|
+
import { afterNextRender, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Input, inject, signal } from '@angular/core';
|
|
2
2
|
import { NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import { registerStreamingSlot } from './core/streamingSlotRegistrar.js';
|
|
4
4
|
import { isAngularDeferSlotPayload } from './defer-slot-payload.js';
|
|
@@ -7,6 +7,7 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
export class DeferSlotComponent {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.cdr = inject(ChangeDetectorRef);
|
|
10
|
+
this.runtimeReady = signal(false, ...(ngDevMode ? [{ debugName: "runtimeReady" }] : /* istanbul ignore next */ []));
|
|
10
11
|
this.id = '';
|
|
11
12
|
this.slotData = signal({}, ...(ngDevMode ? [{ debugName: "slotData" }] : /* istanbul ignore next */ []));
|
|
12
13
|
this.state = signal('fallback', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
@@ -48,9 +49,19 @@ export class DeferSlotComponent {
|
|
|
48
49
|
const consumers = (window.__ABS_SLOT_CONSUMERS__ =
|
|
49
50
|
window.__ABS_SLOT_CONSUMERS__ ?? {});
|
|
50
51
|
consumers[id] = (payload) => {
|
|
52
|
+
if (!this.runtimeReady())
|
|
53
|
+
return false;
|
|
51
54
|
this.applyPatchPayload(payload);
|
|
52
55
|
return true;
|
|
53
56
|
};
|
|
57
|
+
afterNextRender(() => {
|
|
58
|
+
this.runtimeReady.set(true);
|
|
59
|
+
if (typeof window.__ABS_SLOT_FLUSH__ === 'function') {
|
|
60
|
+
requestAnimationFrame(() => {
|
|
61
|
+
window.__ABS_SLOT_FLUSH__?.();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
});
|
|
54
65
|
}
|
|
55
66
|
ngOnDestroy() {
|
|
56
67
|
if (typeof window === 'undefined')
|
package/dist/angular/index.js
CHANGED
|
@@ -169199,7 +169199,7 @@ ${registrations}
|
|
|
169199
169199
|
({ tsLibDir } = cached);
|
|
169200
169200
|
cached.lastUsed = Date.now();
|
|
169201
169201
|
} else {
|
|
169202
|
-
const tsPath = __require.resolve("
|
|
169202
|
+
const tsPath = __require.resolve("typescript");
|
|
169203
169203
|
const tsRootDir = dirname(tsPath);
|
|
169204
169204
|
tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve(tsRootDir, "lib");
|
|
169205
169205
|
const config = readConfiguration("./tsconfig.json");
|
|
@@ -181485,6 +181485,7 @@ init_renderIslandMarkup();
|
|
|
181485
181485
|
var renderIsland = (props) => renderIslandMarkup(requireCurrentIslandRegistry(), props);
|
|
181486
181486
|
// src/angular/components/defer-slot.component.ts
|
|
181487
181487
|
import {
|
|
181488
|
+
afterNextRender,
|
|
181488
181489
|
ChangeDetectionStrategy,
|
|
181489
181490
|
ChangeDetectorRef,
|
|
181490
181491
|
Component as Component2,
|
|
@@ -181541,6 +181542,7 @@ class DeferSlotComponent {
|
|
|
181541
181542
|
this.id = "";
|
|
181542
181543
|
}
|
|
181543
181544
|
cdr = inject2(ChangeDetectorRef);
|
|
181545
|
+
runtimeReady = signal(false);
|
|
181544
181546
|
slotData = signal({});
|
|
181545
181547
|
state = signal("fallback");
|
|
181546
181548
|
activeTemplate = () => {
|
|
@@ -181575,9 +181577,19 @@ class DeferSlotComponent {
|
|
|
181575
181577
|
}
|
|
181576
181578
|
const consumers = window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
|
|
181577
181579
|
consumers[id] = (payload) => {
|
|
181580
|
+
if (!this.runtimeReady())
|
|
181581
|
+
return false;
|
|
181578
181582
|
this.applyPatchPayload(payload);
|
|
181579
181583
|
return true;
|
|
181580
181584
|
};
|
|
181585
|
+
afterNextRender(() => {
|
|
181586
|
+
this.runtimeReady.set(true);
|
|
181587
|
+
if (typeof window.__ABS_SLOT_FLUSH__ === "function") {
|
|
181588
|
+
requestAnimationFrame(() => {
|
|
181589
|
+
window.__ABS_SLOT_FLUSH__?.();
|
|
181590
|
+
});
|
|
181591
|
+
}
|
|
181592
|
+
});
|
|
181581
181593
|
}
|
|
181582
181594
|
ngOnDestroy() {
|
|
181583
181595
|
if (typeof window === "undefined")
|
|
@@ -181914,5 +181926,5 @@ export {
|
|
|
181914
181926
|
DeferErrorTemplateDirective
|
|
181915
181927
|
};
|
|
181916
181928
|
|
|
181917
|
-
//# debugId=
|
|
181929
|
+
//# debugId=5A60717DD0A27CF264756E2164756E21
|
|
181918
181930
|
//# sourceMappingURL=index.js.map
|