@absolutejs/absolute 0.19.0-beta.421 → 0.19.0-beta.423

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.
Files changed (40) hide show
  1. package/dist/ai/client/index.js +15 -1
  2. package/dist/ai/client/index.js.map +3 -3
  3. package/dist/ai/index.js +240 -8
  4. package/dist/ai/index.js.map +8 -7
  5. package/dist/ai-client/angular/ai/index.js +14 -0
  6. package/dist/ai-client/react/ai/index.js +14 -0
  7. package/dist/ai-client/vue/ai/index.js +14 -0
  8. package/dist/angular/ai/index.js +15 -1
  9. package/dist/angular/ai/index.js.map +3 -3
  10. package/dist/angular/browser.js +8 -11
  11. package/dist/angular/browser.js.map +3 -3
  12. package/dist/angular/components/defer-slot.component.js +9 -11
  13. package/dist/angular/index.js +24 -16
  14. package/dist/angular/index.js.map +6 -6
  15. package/dist/index.js +14 -5
  16. package/dist/index.js.map +4 -4
  17. package/dist/react/ai/index.js +15 -1
  18. package/dist/react/ai/index.js.map +3 -3
  19. package/dist/react/index.js +14 -5
  20. package/dist/react/index.js.map +4 -4
  21. package/dist/src/ai/client/ragClient.d.ts +2 -1
  22. package/dist/src/ai/index.d.ts +2 -2
  23. package/dist/src/ai/rag/chat.d.ts +1 -0
  24. package/dist/src/ai/rag/collection.d.ts +2 -1
  25. package/dist/src/ai/rag/index.d.ts +3 -2
  26. package/dist/src/ai/rag/ingestion.d.ts +4 -0
  27. package/dist/src/ai/rag/types.d.ts +1 -1
  28. package/dist/src/angular/components/defer-slot.component.d.ts +3 -1
  29. package/dist/src/core/responseEnhancers.d.ts +1 -1
  30. package/dist/src/utils/streamingSlots.d.ts +4 -3
  31. package/dist/svelte/ai/index.js +15 -1
  32. package/dist/svelte/ai/index.js.map +3 -3
  33. package/dist/svelte/index.js +14 -5
  34. package/dist/svelte/index.js.map +4 -4
  35. package/dist/types/ai.d.ts +31 -0
  36. package/dist/vue/ai/index.js +15 -1
  37. package/dist/vue/ai/index.js.map +3 -3
  38. package/dist/vue/index.js +14 -5
  39. package/dist/vue/index.js.map +4 -4
  40. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { afterNextRender, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, Input, inject, signal } from '@angular/core';
1
+ import { 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';
@@ -54,13 +54,14 @@ export class DeferSlotComponent {
54
54
  this.applyPatchPayload(payload);
55
55
  return true;
56
56
  };
57
- afterNextRender(() => {
57
+ }
58
+ ngAfterViewInit() {
59
+ if (typeof window === 'undefined')
60
+ return;
61
+ requestAnimationFrame(() => {
58
62
  this.runtimeReady.set(true);
59
- if (typeof window.__ABS_SLOT_FLUSH__ === 'function') {
60
- requestAnimationFrame(() => {
61
- window.__ABS_SLOT_FLUSH__?.();
62
- });
63
- }
63
+ this.cdr.markForCheck();
64
+ window.__ABS_SLOT_FLUSH__?.();
64
65
  });
65
66
  }
66
67
  ngOnDestroy() {
@@ -88,7 +89,7 @@ export class DeferSlotComponent {
88
89
  this.cdr.markForCheck();
89
90
  }
90
91
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.6", ngImport: i0, type: DeferSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
91
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: DeferSlotComponent, isStandalone: true, selector: "abs-defer-slot", inputs: { className: "className", id: "id", payload: "payload" }, host: { attributes: { "ngSkipHydration": "true" } }, queries: [{ propertyName: "resolvedTemplate", first: true, predicate: DeferResolvedTemplateDirective, descendants: true }, { propertyName: "fallbackTemplate", first: true, predicate: DeferFallbackTemplateDirective, descendants: true }, { propertyName: "errorTemplate", first: true, predicate: DeferErrorTemplateDirective, descendants: true }], ngImport: i0, template: `
92
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.6", type: DeferSlotComponent, isStandalone: true, selector: "abs-defer-slot", inputs: { className: "className", id: "id", payload: "payload" }, queries: [{ propertyName: "resolvedTemplate", first: true, predicate: DeferResolvedTemplateDirective, descendants: true }, { propertyName: "fallbackTemplate", first: true, predicate: DeferFallbackTemplateDirective, descendants: true }, { propertyName: "errorTemplate", first: true, predicate: DeferErrorTemplateDirective, descendants: true }], ngImport: i0, template: `
92
93
  <div
93
94
  [attr.id]="'slot-' + id"
94
95
  [attr.class]="className"
@@ -105,9 +106,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.6", ngImpor
105
106
  type: Component,
106
107
  args: [{
107
108
  changeDetection: ChangeDetectionStrategy.OnPush,
108
- host: {
109
- ngSkipHydration: 'true'
110
- },
111
109
  selector: 'abs-defer-slot',
112
110
  standalone: true,
113
111
  imports: [
@@ -180785,7 +180785,13 @@ var createSlotPatchStatement = (id, payload) => `(window.${STREAMING_RUNTIME_GLO
180785
180785
  var createNonceAttr = (nonce) => nonce ? ` nonce="${nonce}"` : "";
180786
180786
  var createStreamingSlotId = () => `${SLOT_ID_PREFIX}${Math.random().toString(36).slice(2, 10)}`;
180787
180787
  var getStreamingSlotsRuntimeScript = () => getStreamSwapRuntimeScript();
180788
- var renderStreamingSlotsRuntimeTag = (nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(getStreamingSlotsRuntimeScript())}</script>`;
180788
+ var renderStreamingSlotsRuntimeTag = (nonce, runtimePreludeScript) => {
180789
+ const runtimeBody = [
180790
+ runtimePreludeScript?.trim() ? runtimePreludeScript.trim() : "",
180791
+ getStreamingSlotsRuntimeScript()
180792
+ ].filter(Boolean).join(";");
180793
+ return `<script${createNonceAttr(nonce)}>${escapeScriptContent(runtimeBody)}</script>`;
180794
+ };
180789
180795
  var renderStreamingSlotPlaceholder = (id, fallbackHtml = "") => `<div id="${createSlotPlaceholderId(id)}" data-absolute-slot="true">${fallbackHtml}</div>`;
180790
180796
  var renderStreamingSlotPatchTag = (id, payload, nonce) => `<script${createNonceAttr(nonce)}>${escapeScriptContent(createSlotPatchStatement(id, payload))}</script>`;
180791
180797
  var injectHtmlIntoHead = (html, injection) => {
@@ -181090,8 +181096,8 @@ var streamOutOfOrderSlots = ({
181090
181096
  }
181091
181097
  });
181092
181098
  };
181093
- var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head") => {
181094
- const runtimeTag = renderStreamingSlotsRuntimeTag(nonce);
181099
+ var injectStreamingRuntimeIntoStream = (stream, nonce, runtimePlacement = "head", runtimePreludeScript) => {
181100
+ const runtimeTag = renderStreamingSlotsRuntimeTag(nonce, runtimePreludeScript);
181095
181101
  const encoder = new TextEncoder;
181096
181102
  const decoder = new TextDecoder;
181097
181103
  const closingTag = runtimePlacement === "body" ? CLOSING_BODY_TAG : CLOSING_HEAD_TAG;
@@ -181148,6 +181154,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
181148
181154
  onError,
181149
181155
  onSlotMetric,
181150
181156
  policy,
181157
+ runtimePreludeScript,
181151
181158
  runtimePlacement = "head"
181152
181159
  } = {}) => {
181153
181160
  const resolvedPolicy = resolveStreamingSlotPolicy(policy);
@@ -181165,7 +181172,7 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
181165
181172
  });
181166
181173
  if (preparedSlots.length === 0)
181167
181174
  return stream;
181168
- const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement) : stream;
181175
+ const source = injectRuntime ? injectStreamingRuntimeIntoStream(stream, nonce, runtimePlacement, runtimePreludeScript) : stream;
181169
181176
  const encoder = new TextEncoder;
181170
181177
  const decoder = new TextDecoder;
181171
181178
  const reader = source.getReader();
@@ -181254,6 +181261,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
181254
181261
  nonce,
181255
181262
  onError,
181256
181263
  runtimePlacement,
181264
+ runtimePreludeScript,
181257
181265
  streamingSlots = [],
181258
181266
  policy
181259
181267
  } = {}) => {
@@ -181264,6 +181272,7 @@ var enhanceHtmlResponseWithStreamingSlots = (response, {
181264
181272
  nonce,
181265
181273
  onError,
181266
181274
  policy,
181275
+ runtimePreludeScript,
181267
181276
  runtimePlacement
181268
181277
  });
181269
181278
  return new Response(body, {
@@ -181485,7 +181494,6 @@ init_renderIslandMarkup();
181485
181494
  var renderIsland = (props) => renderIslandMarkup(requireCurrentIslandRegistry(), props);
181486
181495
  // src/angular/components/defer-slot.component.ts
181487
181496
  import {
181488
- afterNextRender,
181489
181497
  ChangeDetectionStrategy,
181490
181498
  ChangeDetectorRef,
181491
181499
  Component as Component2,
@@ -181582,13 +181590,14 @@ class DeferSlotComponent {
181582
181590
  this.applyPatchPayload(payload);
181583
181591
  return true;
181584
181592
  };
181585
- afterNextRender(() => {
181593
+ }
181594
+ ngAfterViewInit() {
181595
+ if (typeof window === "undefined")
181596
+ return;
181597
+ requestAnimationFrame(() => {
181586
181598
  this.runtimeReady.set(true);
181587
- if (typeof window.__ABS_SLOT_FLUSH__ === "function") {
181588
- requestAnimationFrame(() => {
181589
- window.__ABS_SLOT_FLUSH__?.();
181590
- });
181591
- }
181599
+ this.cdr.markForCheck();
181600
+ window.__ABS_SLOT_FLUSH__?.();
181592
181601
  });
181593
181602
  }
181594
181603
  ngOnDestroy() {
@@ -181641,9 +181650,6 @@ __legacyDecorateClassTS([
181641
181650
  DeferSlotComponent = __legacyDecorateClassTS([
181642
181651
  Component2({
181643
181652
  changeDetection: ChangeDetectionStrategy.OnPush,
181644
- host: {
181645
- ngSkipHydration: "true"
181646
- },
181647
181653
  selector: "abs-defer-slot",
181648
181654
  standalone: true,
181649
181655
  imports: [
@@ -181913,7 +181919,9 @@ StreamSlotComponent = __legacyDecorateClassTS([
181913
181919
  ], StreamSlotComponent);
181914
181920
 
181915
181921
  // src/angular/index.ts
181916
- var handleAngularPageRequest2 = wrapPageHandlerWithStreamingSlots(handleAngularPageRequest);
181922
+ var handleAngularPageRequest2 = wrapPageHandlerWithStreamingSlots(handleAngularPageRequest, {
181923
+ runtimePreludeScript: "window.__ABS_SLOT_HYDRATION_PENDING__ = true;"
181924
+ });
181917
181925
  export {
181918
181926
  renderIsland,
181919
181927
  handleAngularPageRequest2 as handleAngularPageRequest,
@@ -181929,5 +181937,5 @@ export {
181929
181937
  DeferErrorTemplateDirective
181930
181938
  };
181931
181939
 
181932
- //# debugId=983A18DFE8EA4EA664756E2164756E21
181940
+ //# debugId=F985A10B96E2618164756E2164756E21
181933
181941
  //# sourceMappingURL=index.js.map