@absolutejs/absolute 0.19.0-beta.411 → 0.19.0-beta.412

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.
@@ -1,18 +1,24 @@
1
- import { Component, ElementRef, Input, inject, signal } from '@angular/core';
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, NgZone, inject, signal } from '@angular/core';
2
2
  import { DomSanitizer } from '@angular/platform-browser';
3
3
  import { registerStreamingSlot } from './core/streamingSlotRegistrar.js';
4
4
  import * as i0 from "@angular/core";
5
5
  const SLOT_PATCH_EVENT = 'absolutejs:slot-patch';
6
6
  export class StreamSlotComponent {
7
7
  constructor() {
8
+ this.cdr = inject(ChangeDetectorRef);
8
9
  this.sanitizer = inject(DomSanitizer);
9
10
  this.hostElement = inject((ElementRef));
11
+ this.zone = inject(NgZone);
10
12
  this.patchListener = (event) => {
11
13
  const detail = event.detail;
12
14
  if (!detail || detail.id !== this.id || typeof detail.html !== 'string') {
13
15
  return;
14
16
  }
15
- this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(detail.html));
17
+ const nextHtml = detail.html;
18
+ this.zone.run(() => {
19
+ this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(nextHtml));
20
+ this.cdr.markForCheck();
21
+ });
16
22
  };
17
23
  this.fallbackHtml = '';
18
24
  this.currentHtml = signal('', ...(ngDevMode ? [{ debugName: "currentHtml" }] : /* istanbul ignore next */ []));
@@ -37,6 +43,7 @@ export class StreamSlotComponent {
37
43
  const existingHtml = slotElement?.innerHTML;
38
44
  if (existingHtml && existingHtml !== this.fallbackHtml) {
39
45
  this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(existingHtml));
46
+ this.cdr.markForCheck();
40
47
  }
41
48
  }
42
49
  ngOnDestroy() {
@@ -45,21 +52,19 @@ export class StreamSlotComponent {
45
52
  window.removeEventListener(SLOT_PATCH_EVENT, this.patchListener);
46
53
  }
47
54
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: StreamSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
48
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: StreamSlotComponent, isStandalone: true, selector: "abs-stream-slot", inputs: { className: "className", errorHtml: "errorHtml", fallbackHtml: "fallbackHtml", id: "id", resolve: "resolve", timeoutMs: "timeoutMs" }, host: { attributes: { "ngSkipHydration": "true" } }, ngImport: i0, template: `
55
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: StreamSlotComponent, isStandalone: true, selector: "abs-stream-slot", inputs: { className: "className", errorHtml: "errorHtml", fallbackHtml: "fallbackHtml", id: "id", resolve: "resolve", timeoutMs: "timeoutMs" }, ngImport: i0, template: `
49
56
  <div
50
57
  [attr.id]="'slot-' + id"
51
58
  [attr.class]="className"
52
59
  data-absolute-slot="true"
53
60
  [innerHTML]="currentHtml()"
54
61
  ></div>
55
- `, isInline: true }); }
62
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
56
63
  }
57
64
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: StreamSlotComponent, decorators: [{
58
65
  type: Component,
59
66
  args: [{
60
- host: {
61
- ngSkipHydration: 'true'
62
- },
67
+ changeDetection: ChangeDetectionStrategy.OnPush,
63
68
  selector: 'abs-stream-slot',
64
69
  standalone: true,
65
70
  template: `
@@ -169160,7 +169160,7 @@ ${registrations}
169160
169160
  ({ tsLibDir } = cached);
169161
169161
  cached.lastUsed = Date.now();
169162
169162
  } else {
169163
- const tsPath = __require.resolve("typescript");
169163
+ const tsPath = __require.resolve("/home/alexkahn/abs/absolutejs/node_modules/typescript/lib/typescript.js");
169164
169164
  const tsRootDir = dirname(tsPath);
169165
169165
  tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve(tsRootDir, "lib");
169166
169166
  const config = readConfiguration("./tsconfig.json");
@@ -181372,9 +181372,12 @@ import { Component as Component3, computed, input } from "@angular/core";
181372
181372
 
181373
181373
  // src/angular/components/stream-slot.component.ts
181374
181374
  import {
181375
+ ChangeDetectionStrategy,
181376
+ ChangeDetectorRef,
181375
181377
  Component as Component2,
181376
181378
  ElementRef,
181377
181379
  Input as Input2,
181380
+ NgZone,
181378
181381
  inject,
181379
181382
  signal
181380
181383
  } from "@angular/core";
@@ -181385,14 +181388,20 @@ class StreamSlotComponent {
181385
181388
  constructor() {
181386
181389
  this.fallbackHtml = "";
181387
181390
  }
181391
+ cdr = inject(ChangeDetectorRef);
181388
181392
  sanitizer = inject(DomSanitizer);
181389
181393
  hostElement = inject(ElementRef);
181394
+ zone = inject(NgZone);
181390
181395
  patchListener = (event) => {
181391
181396
  const detail = event.detail;
181392
181397
  if (!detail || detail.id !== this.id || typeof detail.html !== "string") {
181393
181398
  return;
181394
181399
  }
181395
- this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(detail.html));
181400
+ const nextHtml = detail.html;
181401
+ this.zone.run(() => {
181402
+ this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(nextHtml));
181403
+ this.cdr.markForCheck();
181404
+ });
181396
181405
  };
181397
181406
  currentHtml = signal("");
181398
181407
  ngOnInit() {
@@ -181415,6 +181424,7 @@ class StreamSlotComponent {
181415
181424
  const existingHtml = slotElement?.innerHTML;
181416
181425
  if (existingHtml && existingHtml !== this.fallbackHtml) {
181417
181426
  this.currentHtml.set(this.sanitizer.bypassSecurityTrustHtml(existingHtml));
181427
+ this.cdr.markForCheck();
181418
181428
  }
181419
181429
  }
181420
181430
  ngOnDestroy() {
@@ -181449,9 +181459,7 @@ __legacyDecorateClassTS([
181449
181459
  ], StreamSlotComponent.prototype, "timeoutMs", undefined);
181450
181460
  StreamSlotComponent = __legacyDecorateClassTS([
181451
181461
  Component2({
181452
- host: {
181453
- ngSkipHydration: "true"
181454
- },
181462
+ changeDetection: ChangeDetectionStrategy.OnPush,
181455
181463
  selector: "abs-stream-slot",
181456
181464
  standalone: true,
181457
181465
  template: `
@@ -181659,5 +181667,5 @@ export {
181659
181667
  DeferSlotComponent
181660
181668
  };
181661
181669
 
181662
- //# debugId=EC33B7D6E4EF9E1F64756E2164756E21
181670
+ //# debugId=69C195A7E1EB7A6764756E2164756E21
181663
181671
  //# sourceMappingURL=index.js.map