@absolutejs/absolute 0.19.0-beta.414 → 0.19.0-beta.416

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.
@@ -9555,33 +9555,25 @@ import {
9555
9555
  ChangeDetectionStrategy,
9556
9556
  ChangeDetectorRef,
9557
9557
  Component as Component2,
9558
- ElementRef as ElementRef2,
9559
9558
  Input as Input2,
9560
9559
  NgZone,
9561
9560
  inject,
9562
9561
  signal
9563
9562
  } from "@angular/core";
9564
9563
  import { DomSanitizer } from "@angular/platform-browser";
9565
- var SLOT_PATCH_EVENT = "absolutejs:slot-patch";
9566
-
9567
9564
  class StreamSlotComponent {
9568
9565
  constructor() {
9569
9566
  this.fallbackHtml = "";
9570
9567
  }
9571
9568
  cdr = inject(ChangeDetectorRef);
9572
9569
  sanitizer = inject(DomSanitizer);
9573
- hostElement = inject(ElementRef2);
9574
9570
  zone = inject(NgZone);
9575
- patchListener = (event) => {
9576
- const detail = event.detail;
9577
- if (!detail || detail.id !== this.id || typeof detail.html !== "string") {
9578
- return;
9579
- }
9580
- const nextHtml = detail.html;
9571
+ slotConsumer = (html) => {
9581
9572
  this.zone.run(() => {
9582
- this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(nextHtml));
9573
+ this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(html));
9583
9574
  this.cdr.markForCheck();
9584
9575
  });
9576
+ return true;
9585
9577
  };
9586
9578
  currentHtml = signal("");
9587
9579
  ngOnInit() {
@@ -9596,27 +9588,21 @@ class StreamSlotComponent {
9596
9588
  });
9597
9589
  return;
9598
9590
  }
9599
- const existingHtml = this.readSlotHtml();
9600
- this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(existingHtml && existingHtml.length > 0 ? existingHtml : this.fallbackHtml));
9601
- }
9602
- ngAfterViewInit() {
9603
- if (typeof window === "undefined")
9604
- return;
9605
- window.addEventListener(SLOT_PATCH_EVENT, this.patchListener);
9606
- const existingHtml = this.readSlotHtml();
9607
- if (existingHtml && existingHtml !== this.fallbackHtml) {
9608
- this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(existingHtml));
9609
- this.cdr.markForCheck();
9591
+ const consumers = window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
9592
+ consumers[this.id] = this.slotConsumer;
9593
+ this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(this.fallbackHtml));
9594
+ const pendingHtml = window.__ABS_SLOT_PENDING__?.[this.id];
9595
+ if (typeof pendingHtml === "string") {
9596
+ this.slotConsumer(pendingHtml);
9597
+ delete window.__ABS_SLOT_PENDING__?.[this.id];
9610
9598
  }
9611
9599
  }
9612
9600
  ngOnDestroy() {
9613
9601
  if (typeof window === "undefined")
9614
9602
  return;
9615
- window.removeEventListener(SLOT_PATCH_EVENT, this.patchListener);
9616
- }
9617
- readSlotHtml() {
9618
- const slotElement = this.hostElement.nativeElement.querySelector(`#slot-${this.id}`);
9619
- return slotElement?.innerHTML ?? "";
9603
+ if (window.__ABS_SLOT_CONSUMERS__) {
9604
+ delete window.__ABS_SLOT_CONSUMERS__[this.id];
9605
+ }
9620
9606
  }
9621
9607
  }
9622
9608
  __legacyDecorateClassTS([
@@ -9645,9 +9631,6 @@ __legacyDecorateClassTS([
9645
9631
  ], StreamSlotComponent.prototype, "timeoutMs", undefined);
9646
9632
  StreamSlotComponent = __legacyDecorateClassTS([
9647
9633
  Component2({
9648
- host: {
9649
- ngSkipHydration: "true"
9650
- },
9651
9634
  changeDetection: ChangeDetectionStrategy.OnPush,
9652
9635
  selector: "abs-stream-slot",
9653
9636
  standalone: true,
@@ -9856,5 +9839,5 @@ export {
9856
9839
  DeferSlotComponent
9857
9840
  };
9858
9841
 
9859
- //# debugId=C2AC8DF32DE23EC564756E2164756E21
9842
+ //# debugId=A491037FA344484C64756E2164756E21
9860
9843
  //# sourceMappingURL=browser.js.map