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

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,25 @@ 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));
9591
+ this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(this.fallbackHtml));
9601
9592
  }
9602
9593
  ngAfterViewInit() {
9603
9594
  if (typeof window === "undefined")
9604
9595
  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();
9596
+ const consumers = window.__ABS_SLOT_CONSUMERS__ = window.__ABS_SLOT_CONSUMERS__ ?? {};
9597
+ consumers[this.id] = this.slotConsumer;
9598
+ const pendingHtml = window.__ABS_SLOT_PENDING__?.[this.id];
9599
+ if (typeof pendingHtml === "string") {
9600
+ this.slotConsumer(pendingHtml);
9601
+ delete window.__ABS_SLOT_PENDING__?.[this.id];
9610
9602
  }
9611
9603
  }
9612
9604
  ngOnDestroy() {
9613
9605
  if (typeof window === "undefined")
9614
9606
  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 ?? "";
9607
+ if (window.__ABS_SLOT_CONSUMERS__) {
9608
+ delete window.__ABS_SLOT_CONSUMERS__[this.id];
9609
+ }
9620
9610
  }
9621
9611
  }
9622
9612
  __legacyDecorateClassTS([
@@ -9645,9 +9635,6 @@ __legacyDecorateClassTS([
9645
9635
  ], StreamSlotComponent.prototype, "timeoutMs", undefined);
9646
9636
  StreamSlotComponent = __legacyDecorateClassTS([
9647
9637
  Component2({
9648
- host: {
9649
- ngSkipHydration: "true"
9650
- },
9651
9638
  changeDetection: ChangeDetectionStrategy.OnPush,
9652
9639
  selector: "abs-stream-slot",
9653
9640
  standalone: true,
@@ -9856,5 +9843,5 @@ export {
9856
9843
  DeferSlotComponent
9857
9844
  };
9858
9845
 
9859
- //# debugId=C2AC8DF32DE23EC564756E2164756E21
9846
+ //# debugId=EF8B0D441AD9D61C64756E2164756E21
9860
9847
  //# sourceMappingURL=browser.js.map