@absolutejs/absolute 0.19.0-beta.432 → 0.19.0-beta.434
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/ai/index.js +95 -1
- package/dist/ai/index.js.map +5 -4
- package/dist/ai-client/react/ai/index.js +252 -10
- package/dist/angular/index.js +7 -3
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +2 -2
- package/dist/angular/server.js.map +1 -1
- package/dist/build.js +2 -2
- package/dist/build.js.map +1 -1
- package/dist/client/index.js +6 -2
- package/dist/client/index.js.map +3 -3
- package/dist/index.js +7 -3
- package/dist/index.js.map +3 -3
- package/dist/react/ai/index.js +253 -11
- package/dist/react/ai/index.js.map +11 -7
- package/dist/react/index.js +6 -2
- package/dist/react/index.js.map +3 -3
- package/dist/src/ai/client/actions.d.ts +1 -1
- package/dist/src/ai/index.d.ts +2 -2
- package/dist/src/ai/rag/index.d.ts +1 -0
- package/dist/src/ai/rag/presentation.d.ts +10 -0
- package/dist/src/ai/rag/types.d.ts +1 -1
- package/dist/src/react/ai/index.d.ts +3 -0
- package/dist/src/react/ai/useRAG.d.ts +64 -0
- package/dist/src/react/ai/useRAGCitations.d.ts +7 -0
- package/dist/src/react/ai/useRAGIngest.d.ts +8 -2
- package/dist/src/react/ai/useRAGSearch.d.ts +3 -0
- package/dist/src/react/ai/useRAGSources.d.ts +8 -0
- package/dist/src/react/ai/useRAGStatus.d.ts +1 -0
- package/dist/src/react/ai/useRAGStream.d.ts +9 -1
- package/dist/svelte/index.js +6 -2
- package/dist/svelte/index.js.map +3 -3
- package/dist/types/ai.d.ts +20 -0
- package/dist/vue/components/index.js +20 -3
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +27 -6
- package/dist/vue/index.js.map +4 -4
- package/package.json +1 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"sources": ["../src/core/streamingSlotRegistrar.ts", "../src/vue/components/SuspenseSlot.ts", "../src/vue/components/StreamSlot.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\ntype StreamingSlotRegistrarGlobal = typeof globalThis & {\n\t[STREAMING_SLOT_REGISTRAR_KEY]?: StreamingSlotRegistrar | null;\n};\n\nconst getRegistrarGlobal = () => globalThis as StreamingSlotRegistrarGlobal;\n\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tgetRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY] = nextRegistrar;\n};\n\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegistrarGlobal()[STREAMING_SLOT_REGISTRAR_KEY]?.(slot);\n};\n",
|
|
6
|
-
"import {\n\tdefineComponent,\n\th,\n\tonMounted,\n\tref,\n\ttype PropType,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\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\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object as PropType<Promise<unknown>>\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function as PropType<() => Promise<unknown> | unknown>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props, { slots }) {\n\t\tconst isResolved = ref(false);\n\t\tconst resolvedValue = ref<unknown>(undefined);\n\t\tconst hasError = ref(false);\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\n\t\tif (typeof window === 'undefined') {\n\t\t\tif (!usesFrameworkSlots && props.resolve) {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: props.resolve as () => Promise<string> | string,\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\t\tprops.resolve !== undefined\n\t\t\t\t\t\t\t\t\t? await props.resolve()\n\t\t\t\t\t\t\t\t\t: props.promise !== undefined\n\t\t\t\t\t\t\t\t\t\t? await props.promise\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\thtml
|
|
6
|
+
"import {\n\tdefineComponent,\n\th,\n\tonMounted,\n\tonBeforeUnmount,\n\tref,\n\ttype PropType,\n\ttype Slot,\n\ttype VNodeChild\n} from 'vue';\nimport { registerStreamingSlot } from '../../core/streamingSlotRegistrar';\n\nconst renderVueNodesToHtml = async (nodes: VNodeChild) => {\n\tconst { createSSRApp, h: createVNode } = await import('vue');\n\tconst { renderToString } = await import('vue/server-renderer');\n\n\tconst app = createSSRApp({\n\t\trender: () => createVNode('div', undefined, nodes ?? undefined)\n\t});\n\tconst html = await renderToString(app);\n\n\treturn html.replace(/^<div>|<\\/div>$/g, '');\n};\n\nconst hasFrameworkSlots = (\n\tdefaultSlot: Slot | undefined,\n\tfallbackSlot: Slot | undefined,\n\terrorSlot: Slot | undefined,\n\tpromise: Promise<unknown> | undefined\n) =>\n\tdefaultSlot !== undefined ||\n\tfallbackSlot !== undefined ||\n\terrorSlot !== undefined ||\n\tpromise !== undefined;\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\tpromise: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Object as PropType<Promise<unknown>>\n\t\t},\n\t\tresolve: {\n\t\t\tdefault: undefined,\n\t\t\ttype: Function as PropType<() => Promise<unknown> | unknown>\n\t\t},\n\t\ttimeoutMs: { default: undefined, type: Number }\n\t},\n\tsetup(props, { slots }) {\n\t\tconst isResolved = ref(false);\n\t\tconst resolvedValue = ref<unknown>(undefined);\n\t\tconst hasError = ref(false);\n\t\tconst hasPatchedDom = ref(false);\n\t\tconst usesFrameworkSlots = hasFrameworkSlots(\n\t\t\tslots.default,\n\t\t\tslots.fallback,\n\t\t\tslots.error,\n\t\t\tprops.promise\n\t\t);\n\n\t\tif (typeof window === 'undefined') {\n\t\t\tif (!usesFrameworkSlots && props.resolve) {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\terrorHtml: props.errorHtml,\n\t\t\t\t\tfallbackHtml: props.fallbackHtml,\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: props.resolve as () => Promise<string> | string,\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tregisterStreamingSlot({\n\t\t\t\t\tid: props.id,\n\t\t\t\t\tresolve: async () => {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst value =\n\t\t\t\t\t\t\t\tprops.resolve !== undefined\n\t\t\t\t\t\t\t\t\t? await props.resolve()\n\t\t\t\t\t\t\t\t\t: props.promise !== undefined\n\t\t\t\t\t\t\t\t\t\t? await props.promise\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\tconst nodes = slots.default?.({ value }) ?? [];\n\t\t\t\t\t\t\tconst html = await renderVueNodesToHtml(nodes);\n\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\thtml,\n\t\t\t\t\t\t\t\tkind: 'vue-suspense',\n\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\tconst errorNodes = slots.error?.({ error });\n\t\t\t\t\t\t\tif (errorNodes !== undefined) {\n\t\t\t\t\t\t\t\treturn renderVueNodesToHtml(errorNodes);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (typeof props.errorHtml === 'string') {\n\t\t\t\t\t\t\t\treturn props.errorHtml;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\ttimeoutMs: props.timeoutMs\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif (typeof window !== 'undefined' && usesFrameworkSlots) {\n\t\t\tconst consumers = (window.__ABS_SLOT_CONSUMERS__ =\n\t\t\t\twindow.__ABS_SLOT_CONSUMERS__ ?? {});\n\t\t\tlet runtimeReady = false;\n\t\t\tconsumers[props.id] = (payload) => {\n\t\t\t\tif (!runtimeReady) return false;\n\t\t\t\tif (\n\t\t\t\t\t!payload ||\n\t\t\t\t\ttypeof payload !== 'object' ||\n\t\t\t\t\t(payload as { kind?: unknown }).kind !== 'vue-suspense'\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst candidate = payload as {\n\t\t\t\t\tstate?: unknown;\n\t\t\t\t\tvalue?: unknown;\n\t\t\t\t};\n\t\t\t\thasError.value = candidate.state === 'error';\n\t\t\t\tresolvedValue.value = candidate.value;\n\t\t\t\tisResolved.value = candidate.state !== 'error';\n\t\t\t\thasPatchedDom.value = false;\n\n\t\t\t\treturn true;\n\t\t\t};\n\t\t\tconst handlePatchedDom = (event: Event) => {\n\t\t\t\tconst patchEvent = event as CustomEvent<{ id?: string }>;\n\t\t\t\tif (patchEvent.detail?.id === props.id) {\n\t\t\t\t\thasPatchedDom.value = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tonMounted(() => {\n\t\t\t\twindow.addEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom as EventListener\n\t\t\t\t);\n\t\t\t\truntimeReady = true;\n\t\t\t\twindow.__ABS_SLOT_FLUSH__?.();\n\t\t\t});\n\t\t\tonBeforeUnmount(() => {\n\t\t\t\twindow.removeEventListener(\n\t\t\t\t\t'absolutejs:slot-patch',\n\t\t\t\t\thandlePatchedDom as EventListener\n\t\t\t\t);\n\t\t\t\tdelete window.__ABS_SLOT_CONSUMERS__?.[props.id];\n\t\t\t});\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!usesFrameworkSlots) {\n\t\t\t\treturn h('div', {\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`,\n\t\t\t\t\tinnerHTML: props.fallbackHtml\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn h(\n\t\t\t\t'div',\n\t\t\t\t{\n\t\t\t\t\tclass: props.className,\n\t\t\t\t\t'data-allow-mismatch': '',\n\t\t\t\t\t'data-absolute-slot': 'true',\n\t\t\t\t\tid: `slot-${props.id}`\n\t\t\t\t},\n\t\t\t\thasPatchedDom.value && !isResolved.value\n\t\t\t\t\t? undefined\n\t\t\t\t\t: \n\t\t\t\thasError.value\n\t\t\t\t\t? (slots.error?.({ error: undefined }) ??\n\t\t\t\t\t\tslots.fallback?.() ??\n\t\t\t\t\t\tundefined)\n\t\t\t\t\t: isResolved.value\n\t\t\t\t\t\t? (slots.default?.({ value: resolvedValue.value }) ??\n\t\t\t\t\t\t\tundefined)\n\t\t\t\t\t\t: (slots.fallback?.() ?? undefined)\n\t\t\t);\n\t\t};\n\t}\n});\n",
|
|
7
7
|
"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"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAM,+B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MAClB,WAAW,MAAM;AAAA,IAClB,CAAC;AAAA;AAEJ,CAAC;",
|
|
10
|
+
"debugId": "C6512760CE6CC3F064756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/vue/index.js
CHANGED
|
@@ -1746,6 +1746,7 @@ import {
|
|
|
1746
1746
|
defineComponent,
|
|
1747
1747
|
h,
|
|
1748
1748
|
onMounted,
|
|
1749
|
+
onBeforeUnmount,
|
|
1749
1750
|
ref
|
|
1750
1751
|
} from "vue";
|
|
1751
1752
|
var renderVueNodesToHtml = async (nodes) => {
|
|
@@ -1779,6 +1780,7 @@ var SuspenseSlot = defineComponent({
|
|
|
1779
1780
|
const isResolved = ref(false);
|
|
1780
1781
|
const resolvedValue = ref(undefined);
|
|
1781
1782
|
const hasError = ref(false);
|
|
1783
|
+
const hasPatchedDom = ref(false);
|
|
1782
1784
|
const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
|
|
1783
1785
|
if (typeof window === "undefined") {
|
|
1784
1786
|
if (!usesFrameworkSlots && props.resolve) {
|
|
@@ -1795,8 +1797,10 @@ var SuspenseSlot = defineComponent({
|
|
|
1795
1797
|
resolve: async () => {
|
|
1796
1798
|
try {
|
|
1797
1799
|
const value = props.resolve !== undefined ? await props.resolve() : props.promise !== undefined ? await props.promise : undefined;
|
|
1800
|
+
const nodes = slots.default?.({ value }) ?? [];
|
|
1801
|
+
const html = await renderVueNodesToHtml(nodes);
|
|
1798
1802
|
return {
|
|
1799
|
-
html
|
|
1803
|
+
html,
|
|
1800
1804
|
kind: "vue-suspense",
|
|
1801
1805
|
value
|
|
1802
1806
|
};
|
|
@@ -1828,12 +1832,24 @@ var SuspenseSlot = defineComponent({
|
|
|
1828
1832
|
hasError.value = candidate.state === "error";
|
|
1829
1833
|
resolvedValue.value = candidate.value;
|
|
1830
1834
|
isResolved.value = candidate.state !== "error";
|
|
1835
|
+
hasPatchedDom.value = false;
|
|
1831
1836
|
return true;
|
|
1832
1837
|
};
|
|
1838
|
+
const handlePatchedDom = (event) => {
|
|
1839
|
+
const patchEvent = event;
|
|
1840
|
+
if (patchEvent.detail?.id === props.id) {
|
|
1841
|
+
hasPatchedDom.value = true;
|
|
1842
|
+
}
|
|
1843
|
+
};
|
|
1833
1844
|
onMounted(() => {
|
|
1845
|
+
window.addEventListener("absolutejs:slot-patch", handlePatchedDom);
|
|
1834
1846
|
runtimeReady = true;
|
|
1835
1847
|
window.__ABS_SLOT_FLUSH__?.();
|
|
1836
1848
|
});
|
|
1849
|
+
onBeforeUnmount(() => {
|
|
1850
|
+
window.removeEventListener("absolutejs:slot-patch", handlePatchedDom);
|
|
1851
|
+
delete window.__ABS_SLOT_CONSUMERS__?.[props.id];
|
|
1852
|
+
});
|
|
1837
1853
|
}
|
|
1838
1854
|
return () => {
|
|
1839
1855
|
if (!usesFrameworkSlots) {
|
|
@@ -1846,9 +1862,10 @@ var SuspenseSlot = defineComponent({
|
|
|
1846
1862
|
}
|
|
1847
1863
|
return h("div", {
|
|
1848
1864
|
class: props.className,
|
|
1865
|
+
"data-allow-mismatch": "",
|
|
1849
1866
|
"data-absolute-slot": "true",
|
|
1850
1867
|
id: `slot-${props.id}`
|
|
1851
|
-
}, hasError.value ? slots.error?.({ error: undefined }) ?? slots.fallback?.() ?? undefined : isResolved.value ? slots.default?.({ value: resolvedValue.value }) ?? undefined : slots.fallback?.() ?? undefined);
|
|
1868
|
+
}, hasPatchedDom.value && !isResolved.value ? undefined : hasError.value ? slots.error?.({ error: undefined }) ?? slots.fallback?.() ?? undefined : isResolved.value ? slots.default?.({ value: resolvedValue.value }) ?? undefined : slots.fallback?.() ?? undefined);
|
|
1852
1869
|
};
|
|
1853
1870
|
}
|
|
1854
1871
|
});
|
|
@@ -1929,7 +1946,7 @@ var streamSwapRuntime = () => {
|
|
|
1929
1946
|
return;
|
|
1930
1947
|
}
|
|
1931
1948
|
}
|
|
1932
|
-
if (isAngularDeferPayload(payload)
|
|
1949
|
+
if (isAngularDeferPayload(payload)) {
|
|
1933
1950
|
pending[id] = payload;
|
|
1934
1951
|
return;
|
|
1935
1952
|
}
|
|
@@ -1943,6 +1960,10 @@ var streamSwapRuntime = () => {
|
|
|
1943
1960
|
window.dispatchEvent(new CustomEvent(SLOT_PATCH_EVENT, {
|
|
1944
1961
|
detail: { html, id, payload }
|
|
1945
1962
|
}));
|
|
1963
|
+
if (isVueSuspensePayload(payload)) {
|
|
1964
|
+
pending[id] = payload;
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1946
1967
|
delete pending[id];
|
|
1947
1968
|
};
|
|
1948
1969
|
const flush = () => {
|
|
@@ -2684,7 +2705,7 @@ var createTypedIsland = (registry) => defineRuntimeIslandComponent2((props) => {
|
|
|
2684
2705
|
});
|
|
2685
2706
|
});
|
|
2686
2707
|
// src/vue/useIslandStore.ts
|
|
2687
|
-
import { customRef, onBeforeUnmount } from "vue";
|
|
2708
|
+
import { customRef, onBeforeUnmount as onBeforeUnmount2 } from "vue";
|
|
2688
2709
|
|
|
2689
2710
|
// node_modules/zustand/esm/vanilla.mjs
|
|
2690
2711
|
var createStoreImpl = (createState) => {
|
|
@@ -2816,7 +2837,7 @@ var useIslandStore = (store, selector) => {
|
|
|
2816
2837
|
set() {}
|
|
2817
2838
|
};
|
|
2818
2839
|
});
|
|
2819
|
-
|
|
2840
|
+
onBeforeUnmount2(() => {
|
|
2820
2841
|
unsubscribe?.();
|
|
2821
2842
|
});
|
|
2822
2843
|
return state;
|
|
@@ -2834,5 +2855,5 @@ export {
|
|
|
2834
2855
|
Image_default as Image
|
|
2835
2856
|
};
|
|
2836
2857
|
|
|
2837
|
-
//# debugId=
|
|
2858
|
+
//# debugId=8773917EE428CB6B64756E2164756E21
|
|
2838
2859
|
//# sourceMappingURL=index.js.map
|