@absolutejs/absolute 0.19.0-beta.360 → 0.19.0-beta.362
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/{StreamSlot-m5a5fnfq.svelte → StreamSlot-kyee4w0z.svelte} +1 -1
- package/dist/ai/index.js +13 -1
- package/dist/ai/index.js.map +3 -3
- package/dist/angular/browser.js +402 -4
- package/dist/angular/browser.js.map +9 -4
- package/dist/angular/components/core/streamingSlotRegistrar.js +15 -0
- package/dist/angular/components/core/streamingSlotRegistry.js +12 -3
- package/dist/angular/components/stream-slot.component.js +1 -1
- package/dist/angular/index.js +12 -2
- package/dist/angular/index.js.map +6 -5
- package/dist/index.js +12 -2
- package/dist/index.js.map +5 -4
- package/dist/react/components/browser/index.js +3 -8
- package/dist/react/components/index.js +6 -37
- package/dist/react/components/index.js.map +5 -5
- package/dist/react/index.js +12 -2
- package/dist/react/index.js.map +5 -4
- package/dist/src/ai/rag/collection.d.ts +9 -0
- package/dist/src/angular/browser.d.ts +3 -0
- package/dist/src/core/streamingSlotRegistrar.d.ts +5 -0
- package/dist/src/core/streamingSlotRegistry.d.ts +0 -1
- package/dist/src/svelte/browser.d.ts +2 -0
- package/dist/svelte/browser.js +8 -2
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/components/StreamSlot.svelte +1 -1
- package/dist/svelte/index.js +13 -3
- package/dist/svelte/index.js.map +5 -4
- package/dist/types/ai.d.ts +16 -1
- package/dist/vue/components/index.js +6 -37
- package/dist/vue/components/index.js.map +5 -5
- package/dist/vue/index.js +47 -37
- package/dist/vue/index.js.map +6 -5
- package/package.json +1 -1
|
@@ -86,44 +86,13 @@ import { defineComponent as defineComponent2, h as h2 } from "vue";
|
|
|
86
86
|
// src/vue/components/StreamSlot.ts
|
|
87
87
|
import { defineComponent, h } from "vue";
|
|
88
88
|
|
|
89
|
-
// src/core/
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
if (typeof asyncLocalStorage !== "undefined")
|
|
94
|
-
return asyncLocalStorage;
|
|
95
|
-
if (!isServerRuntime()) {
|
|
96
|
-
asyncLocalStorage = null;
|
|
97
|
-
return asyncLocalStorage;
|
|
98
|
-
}
|
|
99
|
-
const mod = await import("async_hooks");
|
|
100
|
-
asyncLocalStorage = new mod.AsyncLocalStorage;
|
|
101
|
-
return asyncLocalStorage;
|
|
89
|
+
// src/core/streamingSlotRegistrar.ts
|
|
90
|
+
var registrar = null;
|
|
91
|
+
var setStreamingSlotRegistrar = (nextRegistrar) => {
|
|
92
|
+
registrar = nextRegistrar;
|
|
102
93
|
};
|
|
103
94
|
var registerStreamingSlot = (slot) => {
|
|
104
|
-
|
|
105
|
-
return;
|
|
106
|
-
const store = asyncLocalStorage.getStore();
|
|
107
|
-
if (!store)
|
|
108
|
-
return;
|
|
109
|
-
store.set(slot.id, slot);
|
|
110
|
-
};
|
|
111
|
-
var runWithStreamingSlotRegistry = async (task) => {
|
|
112
|
-
const storage = await ensureAsyncLocalStorage();
|
|
113
|
-
if (!storage) {
|
|
114
|
-
return {
|
|
115
|
-
result: await task(),
|
|
116
|
-
slots: []
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return storage.run(new Map, async () => {
|
|
120
|
-
const result = await task();
|
|
121
|
-
const store = storage.getStore();
|
|
122
|
-
return {
|
|
123
|
-
result,
|
|
124
|
-
slots: store ? [...store.values()] : []
|
|
125
|
-
};
|
|
126
|
-
});
|
|
95
|
+
registrar?.(slot);
|
|
127
96
|
};
|
|
128
97
|
|
|
129
98
|
// src/vue/components/StreamSlot.ts
|
|
@@ -183,5 +152,5 @@ export {
|
|
|
183
152
|
Image_default as Image
|
|
184
153
|
};
|
|
185
154
|
|
|
186
|
-
//# debugId=
|
|
155
|
+
//# debugId=57F325425F6054AD64756E2164756E21
|
|
187
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts", "../src/core/
|
|
3
|
+
"sources": ["../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts", "../src/core/streamingSlotRegistrar.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { defineComponent, h, type PropType } from 'vue';\nimport { StreamSlot } from './StreamSlot';\n\nexport const SuspenseSlot = defineComponent({\n\tname: 'AbsoluteSuspenseSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tresolve: {\n\t\t\trequired: true,\n\t\t\ttype: Function as PropType<() => Promise<string> | string>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props) {\n\t\treturn () => h(StreamSlot, props);\n\t}\n});\n",
|
|
6
|
-
"import { defineComponent, h, type PropType } from 'vue';\nimport { registerStreamingSlot } from '../../core/
|
|
7
|
-
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype
|
|
6
|
+
"import { defineComponent, h, type PropType } from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nexport const StreamSlot = defineComponent({\n\tname: 'AbsoluteStreamSlot',\n\tprops: {\n\t\tclassName: { default: undefined, type: String },\n\t\terrorHtml: { default: undefined, type: String },\n\t\tfallbackHtml: { default: '', type: String },\n\t\tid: { required: true, type: String },\n\t\tresolve: {\n\t\t\trequired: true,\n\t\t\ttype: Function as PropType<() => Promise<string> | string>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props) {\n\t\tif (typeof window === 'undefined') {\n\t\t\tregisterStreamingSlot({\n\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\tid: props.id,\n\t\t\t\tresolve: props.resolve,\n\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t});\n\t\t}\n\n\t\treturn () =>\n\t\t\th('div', {\n\t\t\t\tclass: props.className,\n\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\tid: `slot-${props.id}`,\n\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t});\n\t}\n});\n",
|
|
7
|
+
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\n\nlet registrar: StreamingSlotRegistrar | null = null;\n\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tregistrar = nextRegistrar;\n};\n\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tregistrar?.(slot);\n};\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAAS,uBAAiB;;;ACA1B;;;
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAAS,uBAAiB;;;ACA1B;;;ACIA,IAAI,YAA2C;AAExC,IAAM,4BAA4B,CACxC,kBACI;AAAA,EACJ,YAAY;AAAA;AAGN,IAAM,wBAAwB,CAAC,SAAwB;AAAA,EAC7D,YAAY,IAAI;AAAA;;;ADVV,IAAM,aAAa,gBAAgB;AAAA,EACzC,MAAM;AAAA,EACN,OAAO;AAAA,IACN,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,cAAc,EAAE,SAAS,IAAI,MAAM,OAAO;AAAA,IAC1C,IAAI,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACnC,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,EAC/C;AAAA,EACA,KAAK,CAAC,OAAO;AAAA,IACZ,IAAI,OAAO,WAAW,aAAa;AAAA,MAClC,sBAAsB;AAAA,QACrB,WAAW,MAAM;AAAA,QACjB,cAAc,MAAM;AAAA,QACpB,IAAI,MAAM;AAAA,QACV,SAAS,MAAM;AAAA,QACf,WAAW,MAAM;AAAA,MAClB,CAAC;AAAA,IACF;AAAA,IAEA,OAAO,MACN,EAAE,OAAO;AAAA,MACR,OAAO,MAAM;AAAA,MACb,sBAAsB;AAAA,MACtB,IAAI,QAAQ,MAAM;AAAA,MAClB,WAAW,MAAM;AAAA,IAClB,CAAC;AAAA;AAEJ,CAAC;;;ADhCM,IAAM,eAAe,iBAAgB;AAAA,EAC3C,MAAM;AAAA,EACN,OAAO;AAAA,IACN,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,IAC9C,cAAc,EAAE,SAAS,IAAI,MAAM,OAAO;AAAA,IAC1C,IAAI,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACnC,SAAS;AAAA,MACR,UAAU;AAAA,MACV,MAAM;AAAA,IACP;AAAA,IACA,WAAW,EAAE,SAAS,WAAW,MAAM,OAAO;AAAA,EAC/C;AAAA,EACA,KAAK,CAAC,OAAO;AAAA,IACZ,OAAO,MAAM,GAAE,YAAY,KAAK;AAAA;AAElC,CAAC;",
|
|
10
|
+
"debugId": "57F325425F6054AD64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/vue/index.js
CHANGED
|
@@ -1575,44 +1575,13 @@ import { defineComponent as defineComponent2, h as h2 } from "vue";
|
|
|
1575
1575
|
// src/vue/components/StreamSlot.ts
|
|
1576
1576
|
import { defineComponent, h } from "vue";
|
|
1577
1577
|
|
|
1578
|
-
// src/core/
|
|
1579
|
-
var
|
|
1580
|
-
var
|
|
1581
|
-
|
|
1582
|
-
if (typeof asyncLocalStorage !== "undefined")
|
|
1583
|
-
return asyncLocalStorage;
|
|
1584
|
-
if (!isServerRuntime()) {
|
|
1585
|
-
asyncLocalStorage = null;
|
|
1586
|
-
return asyncLocalStorage;
|
|
1587
|
-
}
|
|
1588
|
-
const mod = await import("async_hooks");
|
|
1589
|
-
asyncLocalStorage = new mod.AsyncLocalStorage;
|
|
1590
|
-
return asyncLocalStorage;
|
|
1578
|
+
// src/core/streamingSlotRegistrar.ts
|
|
1579
|
+
var registrar = null;
|
|
1580
|
+
var setStreamingSlotRegistrar = (nextRegistrar) => {
|
|
1581
|
+
registrar = nextRegistrar;
|
|
1591
1582
|
};
|
|
1592
1583
|
var registerStreamingSlot = (slot) => {
|
|
1593
|
-
|
|
1594
|
-
return;
|
|
1595
|
-
const store = asyncLocalStorage.getStore();
|
|
1596
|
-
if (!store)
|
|
1597
|
-
return;
|
|
1598
|
-
store.set(slot.id, slot);
|
|
1599
|
-
};
|
|
1600
|
-
var runWithStreamingSlotRegistry = async (task) => {
|
|
1601
|
-
const storage = await ensureAsyncLocalStorage();
|
|
1602
|
-
if (!storage) {
|
|
1603
|
-
return {
|
|
1604
|
-
result: await task(),
|
|
1605
|
-
slots: []
|
|
1606
|
-
};
|
|
1607
|
-
}
|
|
1608
|
-
return storage.run(new Map, async () => {
|
|
1609
|
-
const result = await task();
|
|
1610
|
-
const store = storage.getStore();
|
|
1611
|
-
return {
|
|
1612
|
-
result,
|
|
1613
|
-
slots: store ? [...store.values()] : []
|
|
1614
|
-
};
|
|
1615
|
-
});
|
|
1584
|
+
registrar?.(slot);
|
|
1616
1585
|
};
|
|
1617
1586
|
|
|
1618
1587
|
// src/vue/components/StreamSlot.ts
|
|
@@ -2155,6 +2124,47 @@ var appendStreamingSlotPatchesToStream = (stream, slots = [], {
|
|
|
2155
2124
|
});
|
|
2156
2125
|
};
|
|
2157
2126
|
|
|
2127
|
+
// src/core/streamingSlotRegistry.ts
|
|
2128
|
+
var asyncLocalStorage;
|
|
2129
|
+
var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
|
|
2130
|
+
var ensureAsyncLocalStorage = async () => {
|
|
2131
|
+
if (typeof asyncLocalStorage !== "undefined")
|
|
2132
|
+
return asyncLocalStorage;
|
|
2133
|
+
if (!isServerRuntime()) {
|
|
2134
|
+
asyncLocalStorage = null;
|
|
2135
|
+
return asyncLocalStorage;
|
|
2136
|
+
}
|
|
2137
|
+
const mod = await import("async_hooks");
|
|
2138
|
+
asyncLocalStorage = new mod.AsyncLocalStorage;
|
|
2139
|
+
return asyncLocalStorage;
|
|
2140
|
+
};
|
|
2141
|
+
var registerStreamingSlot2 = (slot) => {
|
|
2142
|
+
if (!asyncLocalStorage)
|
|
2143
|
+
return;
|
|
2144
|
+
const store = asyncLocalStorage.getStore();
|
|
2145
|
+
if (!store)
|
|
2146
|
+
return;
|
|
2147
|
+
store.set(slot.id, slot);
|
|
2148
|
+
};
|
|
2149
|
+
setStreamingSlotRegistrar(registerStreamingSlot2);
|
|
2150
|
+
var runWithStreamingSlotRegistry = async (task) => {
|
|
2151
|
+
const storage = await ensureAsyncLocalStorage();
|
|
2152
|
+
if (!storage) {
|
|
2153
|
+
return {
|
|
2154
|
+
result: await task(),
|
|
2155
|
+
slots: []
|
|
2156
|
+
};
|
|
2157
|
+
}
|
|
2158
|
+
return storage.run(new Map, async () => {
|
|
2159
|
+
const result = await task();
|
|
2160
|
+
const store = storage.getStore();
|
|
2161
|
+
return {
|
|
2162
|
+
result,
|
|
2163
|
+
slots: store ? [...store.values()] : []
|
|
2164
|
+
};
|
|
2165
|
+
});
|
|
2166
|
+
};
|
|
2167
|
+
|
|
2158
2168
|
// src/core/responseEnhancers.ts
|
|
2159
2169
|
var toResponse = async (responseLike) => await responseLike;
|
|
2160
2170
|
var cloneHeaders = (response) => {
|
|
@@ -2519,5 +2529,5 @@ export {
|
|
|
2519
2529
|
Image_default as Image
|
|
2520
2530
|
};
|
|
2521
2531
|
|
|
2522
|
-
//# debugId=
|
|
2532
|
+
//# debugId=8F79CE2746C9940964756E2164756E21
|
|
2523
2533
|
//# sourceMappingURL=index.js.map
|