@absolutejs/absolute 0.19.0-beta.623 → 0.19.0-beta.625

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 (51) hide show
  1. package/dist/ai/client/index.js +8751 -6935
  2. package/dist/ai/client/index.js.map +5 -5
  3. package/dist/ai/client/ui.js +6402 -42
  4. package/dist/ai/client/ui.js.map +7 -4
  5. package/dist/ai/index.js +12994 -8132
  6. package/dist/ai/index.js.map +15 -13
  7. package/dist/ai/rag/quality.js +4194 -37
  8. package/dist/ai/rag/quality.js.map +6 -5
  9. package/dist/ai/rag/ui.js +6407 -42
  10. package/dist/ai/rag/ui.js.map +7 -4
  11. package/dist/ai-client/angular/ai/index.js +401 -4
  12. package/dist/ai-client/react/ai/index.js +537 -511
  13. package/dist/ai-client/vue/ai/index.js +743 -720
  14. package/dist/angular/ai/index.js +9400 -3140
  15. package/dist/angular/ai/index.js.map +7 -6
  16. package/dist/react/ai/index.js +8187 -6372
  17. package/dist/react/ai/index.js.map +5 -5
  18. package/dist/src/ai/index.d.ts +2 -2
  19. package/dist/src/ai/rag/adapters/filtering.d.ts +2 -0
  20. package/dist/src/ai/rag/adapters/queryPlanning.d.ts +11 -0
  21. package/dist/src/ai/rag/index.d.ts +4 -4
  22. package/dist/src/ai/rag/ingestion.d.ts +3 -0
  23. package/dist/src/ai/rag/presentation.d.ts +6 -1
  24. package/dist/src/ai/rag/quality.d.ts +95 -2
  25. package/dist/src/ai/rag/sync.d.ts +20 -1
  26. package/dist/src/ai/rag/types.d.ts +1 -1
  27. package/dist/src/ai/rag/ui.d.ts +1 -1
  28. package/dist/src/react/ai/useRAG.d.ts +1 -1
  29. package/dist/src/react/ai/useRAGIndexAdmin.d.ts +2 -2
  30. package/dist/src/vue/ai/useRAG.d.ts +408 -0
  31. package/dist/src/vue/ai/useRAGEvaluate.d.ts +84 -0
  32. package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +222 -0
  33. package/dist/src/vue/ai/useRAGOps.d.ts +102 -0
  34. package/dist/src/vue/components/Image.d.ts +74 -0
  35. package/dist/src/vue/components/index.d.ts +1 -1
  36. package/dist/src/vue/index.d.ts +1 -1
  37. package/dist/svelte/ai/index.js +8186 -6371
  38. package/dist/svelte/ai/index.js.map +4 -4
  39. package/dist/types/ai.d.ts +389 -1
  40. package/dist/vue/ai/index.js +8186 -6371
  41. package/dist/vue/ai/index.js.map +4 -4
  42. package/dist/vue/components/Image.js +253 -0
  43. package/dist/vue/components/Image.js.map +11 -0
  44. package/dist/vue/components/index.js +181 -16
  45. package/dist/vue/components/index.js.map +5 -3
  46. package/dist/vue/index.js +195 -30
  47. package/dist/vue/index.js.map +6 -4
  48. package/package.json +11 -11
  49. package/dist/Image-0pe96k20.vue +0 -186
  50. package/dist/vue/components/Image.vue +0 -186
  51. package/dist/vue/components/Image.vue.d.ts +0 -4
package/dist/vue/index.js CHANGED
@@ -1501,12 +1501,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1501
1501
  });
1502
1502
  return { body, styles };
1503
1503
  }, renderVueError = async (conventionPath, errorProps) => {
1504
- const { createSSRApp, h: h3 } = await import("vue");
1504
+ const { createSSRApp, h: h4 } = await import("vue");
1505
1505
  const { renderToString } = await import("vue/server-renderer");
1506
1506
  const mod = await import(conventionPath);
1507
1507
  const ErrorComponent = mod.default;
1508
1508
  const app = createSSRApp({
1509
- render: () => h3(ErrorComponent, errorProps)
1509
+ render: () => h4(ErrorComponent, errorProps)
1510
1510
  });
1511
1511
  const rawBody = await renderToString(app);
1512
1512
  const { styles, body } = unescapeVueStyles(rawBody);
@@ -1569,12 +1569,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", isConventionsMap = (value) => Boo
1569
1569
  status: 404
1570
1570
  });
1571
1571
  }, renderVueNotFound = async (conventionPath) => {
1572
- const { createSSRApp, h: h3 } = await import("vue");
1572
+ const { createSSRApp, h: h4 } = await import("vue");
1573
1573
  const { renderToString } = await import("vue/server-renderer");
1574
1574
  const mod = await import(conventionPath);
1575
1575
  const NotFoundComponent = mod.default;
1576
1576
  const app = createSSRApp({
1577
- render: () => h3(NotFoundComponent)
1577
+ render: () => h4(NotFoundComponent)
1578
1578
  });
1579
1579
  const rawBody = await renderToString(app);
1580
1580
  const { styles, body } = unescapeVueStyles(rawBody);
@@ -1720,10 +1720,10 @@ var ssrDirty = false, isRecord2 = (value) => typeof value === "object" && value
1720
1720
  };
1721
1721
  };
1722
1722
  const resolvedPage = await resolvePageComponent();
1723
- const { createSSRApp, h: h3 } = await import("vue");
1723
+ const { createSSRApp, h: h4 } = await import("vue");
1724
1724
  const { renderToWebStream } = await import("vue/server-renderer");
1725
1725
  const app = createSSRApp({
1726
- render: () => h3(resolvedPage.component, maybeProps ?? null)
1726
+ render: () => h4(resolvedPage.component, maybeProps ?? null)
1727
1727
  });
1728
1728
  const bodyStream = renderToWebStream(app);
1729
1729
  const { firstChunk, reader } = await primeVueStream(bodyStream);
@@ -2374,9 +2374,9 @@ var renderAngularIslandToHtmlInternal = async (component, props, islandId) => {
2374
2374
  }, renderAngularIslandToHtml2, renderReactIslandToHtml = (component, props) => import("react").then(({ createElement }) => import("react-dom/server").then(({ renderToStaticMarkup }) => renderToStaticMarkup(createElement(component, props)))), renderSvelteIslandToHtml = (component, props) => import("svelte/server").then(({ render }) => {
2375
2375
  const { body } = render(component, { props });
2376
2376
  return body;
2377
- }), renderVueIslandToHtml = (component, props) => import("vue").then(({ createSSRApp, h: h3 }) => {
2377
+ }), renderVueIslandToHtml = (component, props) => import("vue").then(({ createSSRApp, h: h4 }) => {
2378
2378
  const app = createSSRApp({
2379
- render: () => h3(component, props)
2379
+ render: () => h4(component, props)
2380
2380
  });
2381
2381
  return import("vue/server-renderer").then(({ renderToString }) => renderToString(app));
2382
2382
  });
@@ -2870,18 +2870,183 @@ var init_renderIslandMarkup = __esm(() => {
2870
2870
  resolvedServerBuildComponentCache = new Map;
2871
2871
  });
2872
2872
 
2873
- // src/vue/components/Image.vue
2874
- var Image_default = "../Image-0pe96k20.vue";
2873
+ // src/vue/components/Image.ts
2874
+ import { computed, defineComponent, h, ref } from "vue";
2875
+
2876
+ // src/utils/imageClient.ts
2877
+ var DEFAULT_DEVICE_SIZES = [
2878
+ 640,
2879
+ 750,
2880
+ 828,
2881
+ 1080,
2882
+ 1200,
2883
+ 1920,
2884
+ 2048,
2885
+ 3840
2886
+ ];
2887
+ var DEFAULT_IMAGE_SIZES = [16, 32, 48, 64, 96, 128, 256, 384];
2888
+ var DEFAULT_QUALITY = 75;
2889
+ var OPTIMIZATION_ENDPOINT = "/_absolute/image";
2890
+ var buildOptimizedUrl = (src, width, quality, basePath = OPTIMIZATION_ENDPOINT) => `${basePath}?url=${encodeURIComponent(src)}&w=${width}&q=${quality}`;
2891
+ var getAllSizes = (deviceSizes, imageSizes) => {
2892
+ const device = deviceSizes ?? DEFAULT_DEVICE_SIZES;
2893
+ const image = imageSizes ?? DEFAULT_IMAGE_SIZES;
2894
+ return [...device, ...image].sort((left, right) => left - right);
2895
+ };
2896
+ var snapToSize = (target, sizes) => {
2897
+ for (const size of sizes) {
2898
+ if (size >= target)
2899
+ return size;
2900
+ }
2901
+ return sizes[sizes.length - 1] ?? target;
2902
+ };
2903
+ var generateBlurSvg = (base64Thumbnail) => {
2904
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320"><filter id="b" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="20"/><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1"/></filter><image filter="url(#b)" x="0" y="0" width="100%" height="100%" href="${base64Thumbnail}"/></svg>`;
2905
+ const encoded = encodeURIComponent(svg);
2906
+ return `url("data:image/svg+xml,${encoded}")`;
2907
+ };
2908
+ var generateSrcSet = (src, width, sizes, deviceSizes, imageSizes) => {
2909
+ const quality = DEFAULT_QUALITY;
2910
+ if (sizes) {
2911
+ const allSizes = getAllSizes(deviceSizes, imageSizes);
2912
+ return allSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
2913
+ }
2914
+ if (width) {
2915
+ const allSizes = getAllSizes(deviceSizes, imageSizes);
2916
+ const w1x = snapToSize(width, allSizes);
2917
+ const w2x = snapToSize(width * 2, allSizes);
2918
+ return `${buildOptimizedUrl(src, w1x, quality)} 1x, ${buildOptimizedUrl(src, w2x, quality)} 2x`;
2919
+ }
2920
+ const devSizes = deviceSizes ?? DEFAULT_DEVICE_SIZES;
2921
+ return devSizes.map((sizeWidth) => `${buildOptimizedUrl(src, sizeWidth, quality)} ${sizeWidth}w`).join(", ");
2922
+ };
2923
+
2924
+ // src/vue/components/Image.ts
2925
+ var fillWrapperStyle = {
2926
+ display: "block",
2927
+ height: "100%",
2928
+ overflow: "hidden",
2929
+ position: "relative",
2930
+ width: "100%"
2931
+ };
2932
+ var Image_default = defineComponent({
2933
+ name: "AbsoluteImage",
2934
+ props: {
2935
+ src: { required: true, type: String },
2936
+ alt: { required: true, type: String },
2937
+ width: { default: undefined, type: Number },
2938
+ height: { default: undefined, type: Number },
2939
+ fill: { default: false, type: Boolean },
2940
+ quality: { default: DEFAULT_QUALITY, type: Number },
2941
+ sizes: { default: undefined, type: String },
2942
+ loader: { default: undefined, type: Function },
2943
+ unoptimized: { default: false, type: Boolean },
2944
+ loading: { default: "lazy", type: String },
2945
+ priority: { default: false, type: Boolean },
2946
+ placeholder: { default: undefined, type: String },
2947
+ blurDataURL: { default: undefined, type: String },
2948
+ className: { default: undefined, type: String },
2949
+ style: { default: undefined, type: Object },
2950
+ onLoad: { default: undefined, type: Function },
2951
+ onError: { default: undefined, type: Function },
2952
+ crossOrigin: { default: undefined, type: String },
2953
+ referrerPolicy: { default: undefined, type: String },
2954
+ fetchPriority: { default: undefined, type: String },
2955
+ overrideSrc: { default: undefined, type: String }
2956
+ },
2957
+ setup(props) {
2958
+ const blurRemoved = ref(false);
2959
+ const resolvedSrc = computed(() => {
2960
+ if (props.overrideSrc)
2961
+ return props.overrideSrc;
2962
+ if (props.unoptimized)
2963
+ return props.src;
2964
+ if (props.loader) {
2965
+ return props.loader({
2966
+ quality: props.quality ?? DEFAULT_QUALITY,
2967
+ src: props.src,
2968
+ width: props.width ?? 0
2969
+ });
2970
+ }
2971
+ if (!props.width) {
2972
+ return buildOptimizedUrl(props.src, 0, props.quality ?? DEFAULT_QUALITY);
2973
+ }
2974
+ return buildOptimizedUrl(props.src, props.width, props.quality ?? DEFAULT_QUALITY);
2975
+ });
2976
+ const srcSet = computed(() => props.unoptimized ? undefined : generateSrcSet(props.src, props.width, props.sizes));
2977
+ const resolvedSizes = computed(() => props.sizes ?? (props.fill ? "100vw" : undefined));
2978
+ const resolvedLoading = computed(() => props.priority ? "eager" : props.loading ?? "lazy");
2979
+ const resolvedFetchPriority = computed(() => props.priority ? "high" : props.fetchPriority);
2980
+ const hasBlur = computed(() => props.placeholder === "blur" || typeof props.placeholder === "string" && props.placeholder !== "empty" && props.placeholder.startsWith("data:"));
2981
+ const blurBackground = computed(() => {
2982
+ if (!hasBlur.value || blurRemoved.value)
2983
+ return;
2984
+ if (typeof props.placeholder === "string" && props.placeholder !== "blur" && props.placeholder.startsWith("data:")) {
2985
+ return generateBlurSvg(props.placeholder);
2986
+ }
2987
+ if (props.blurDataURL)
2988
+ return generateBlurSvg(props.blurDataURL);
2989
+ return;
2990
+ });
2991
+ const imgStyle = computed(() => {
2992
+ const base = {
2993
+ ...props.style ?? {},
2994
+ color: "transparent"
2995
+ };
2996
+ if (blurBackground.value) {
2997
+ base.backgroundImage = blurBackground.value;
2998
+ base.backgroundPosition = "center";
2999
+ base.backgroundRepeat = "no-repeat";
3000
+ base.backgroundSize = "cover";
3001
+ }
3002
+ if (props.fill) {
3003
+ base.height = "100%";
3004
+ base.inset = "0";
3005
+ base.objectFit = "cover";
3006
+ base.position = "absolute";
3007
+ base.width = "100%";
3008
+ }
3009
+ return base;
3010
+ });
3011
+ const handleLoad = (event) => {
3012
+ blurRemoved.value = true;
3013
+ props.onLoad?.(event);
3014
+ };
3015
+ const handleError = (event) => {
3016
+ props.onError?.(event);
3017
+ };
3018
+ return () => {
3019
+ const imgNode = h("img", {
3020
+ alt: props.alt,
3021
+ class: props.className,
3022
+ crossorigin: props.crossOrigin,
3023
+ decoding: "async",
3024
+ fetchpriority: resolvedFetchPriority.value,
3025
+ height: props.fill ? undefined : props.height,
3026
+ loading: resolvedLoading.value,
3027
+ onError: handleError,
3028
+ onLoad: handleLoad,
3029
+ referrerpolicy: props.referrerPolicy,
3030
+ sizes: resolvedSizes.value,
3031
+ src: resolvedSrc.value,
3032
+ srcset: srcSet.value,
3033
+ style: imgStyle.value,
3034
+ width: props.fill ? undefined : props.width
3035
+ });
3036
+ return props.fill ? h("span", { style: fillWrapperStyle }, [imgNode]) : imgNode;
3037
+ };
3038
+ }
3039
+ });
2875
3040
  // src/vue/components/SuspenseSlot.ts
2876
3041
  init_streamingSlotRegistrar();
2877
3042
  import {
2878
3043
  cloneVNode,
2879
- defineComponent,
2880
- h,
3044
+ defineComponent as defineComponent2,
3045
+ h as h2,
2881
3046
  isVNode,
2882
3047
  onMounted,
2883
3048
  onBeforeUnmount,
2884
- ref,
3049
+ ref as ref2,
2885
3050
  useSSRContext
2886
3051
  } from "vue";
2887
3052
  var renderVueNodesToHtml = async (nodes) => {
@@ -2955,7 +3120,7 @@ var registerLegacySuspenseSlot = (props) => {
2955
3120
  timeoutMs: props.timeoutMs
2956
3121
  });
2957
3122
  };
2958
- var SuspenseSlot = defineComponent({
3123
+ var SuspenseSlot = defineComponent2({
2959
3124
  name: "AbsoluteSuspenseSlot",
2960
3125
  props: {
2961
3126
  className: { default: undefined, type: String },
@@ -2981,10 +3146,10 @@ var SuspenseSlot = defineComponent({
2981
3146
  return false;
2982
3147
  return slotNode.getAttribute("data-absolute-slot-state") === "resolved";
2983
3148
  };
2984
- const isResolved = ref(false);
2985
- const resolvedValue = ref(undefined);
2986
- const hasError = ref(false);
2987
- const hasPatchedDom = ref(readPatchedDomState());
3149
+ const isResolved = ref2(false);
3150
+ const resolvedValue = ref2(undefined);
3151
+ const hasError = ref2(false);
3152
+ const hasPatchedDom = ref2(readPatchedDomState());
2988
3153
  const usesFrameworkSlots = hasFrameworkSlots(slots.default, slots.fallback, slots.error, props.promise);
2989
3154
  const isSsrRender = useSSRContext() !== undefined;
2990
3155
  if (isSsrRender) {
@@ -3063,14 +3228,14 @@ var SuspenseSlot = defineComponent({
3063
3228
  };
3064
3229
  return () => {
3065
3230
  if (!usesFrameworkSlots) {
3066
- return h("div", {
3231
+ return h2("div", {
3067
3232
  class: props.className,
3068
3233
  "data-absolute-slot": "true",
3069
3234
  id: props.id,
3070
3235
  innerHTML: props.fallbackHtml
3071
3236
  });
3072
3237
  }
3073
- return h("div", {
3238
+ return h2("div", {
3074
3239
  class: props.className,
3075
3240
  "data-absolute-slot": "true",
3076
3241
  "data-allow-mismatch": "",
@@ -3081,8 +3246,8 @@ var SuspenseSlot = defineComponent({
3081
3246
  });
3082
3247
  // src/vue/components/StreamSlot.ts
3083
3248
  init_streamingSlotRegistrar();
3084
- import { defineComponent as defineComponent2, h as h2, useSSRContext as useSSRContext2 } from "vue";
3085
- var StreamSlot = defineComponent2({
3249
+ import { defineComponent as defineComponent3, h as h3, useSSRContext as useSSRContext2 } from "vue";
3250
+ var StreamSlot = defineComponent3({
3086
3251
  name: "AbsoluteStreamSlot",
3087
3252
  props: {
3088
3253
  className: { default: undefined, type: String },
@@ -3109,7 +3274,7 @@ var StreamSlot = defineComponent2({
3109
3274
  warnMissingStreamingSlotCollector("StreamSlot");
3110
3275
  }
3111
3276
  }
3112
- return () => h2("div", {
3277
+ return () => h3("div", {
3113
3278
  class: props.className,
3114
3279
  "data-absolute-slot": "true",
3115
3280
  id: props.id,
@@ -3121,7 +3286,7 @@ var StreamSlot = defineComponent2({
3121
3286
  init_pageHandler();
3122
3287
 
3123
3288
  // src/vue/Island.ts
3124
- import { defineComponent as defineComponent3, h as h3, onServerPrefetch } from "vue";
3289
+ import { defineComponent as defineComponent4, h as h4, onServerPrefetch } from "vue";
3125
3290
 
3126
3291
  // src/client/preserveIslandMarkup.ts
3127
3292
  init_islandMarkupAttributes();
@@ -3209,7 +3374,7 @@ var preserveIslandMarkup = (props) => {
3209
3374
  // src/vue/Island.ts
3210
3375
  init_islandMarkupAttributes();
3211
3376
  init_renderIslandMarkup();
3212
- var defineRuntimeIslandComponent = (setup) => defineComponent3({
3377
+ var defineRuntimeIslandComponent = (setup) => defineComponent4({
3213
3378
  name: "AbsoluteIsland",
3214
3379
  props: {
3215
3380
  component: {
@@ -3241,7 +3406,7 @@ var Island = defineRuntimeIslandComponent((props) => {
3241
3406
  });
3242
3407
  return () => {
3243
3408
  const preserved = isBrowser ? preserveIslandMarkup(props) : null;
3244
- return h3("div", {
3409
+ return h4("div", {
3245
3410
  ...preserved?.attributes ?? markerAttributes,
3246
3411
  "data-allow-mismatch": "",
3247
3412
  innerHTML: isBrowser ? preserved?.innerHTML : html
@@ -3251,8 +3416,8 @@ var Island = defineRuntimeIslandComponent((props) => {
3251
3416
  // src/vue/createIsland.ts
3252
3417
  init_islandMarkupAttributes();
3253
3418
  init_renderIslandMarkup();
3254
- import { defineComponent as defineComponent4, h as h4, onServerPrefetch as onServerPrefetch2 } from "vue";
3255
- var defineRuntimeIslandComponent2 = (setup) => defineComponent4({
3419
+ import { defineComponent as defineComponent5, h as h5, onServerPrefetch as onServerPrefetch2 } from "vue";
3420
+ var defineRuntimeIslandComponent2 = (setup) => defineComponent5({
3256
3421
  name: "AbsoluteIsland",
3257
3422
  props: {
3258
3423
  component: {
@@ -3282,7 +3447,7 @@ var createTypedIsland = (registry) => defineRuntimeIslandComponent2((props) => {
3282
3447
  const result = await renderIslandResult(registry, props);
3283
3448
  ({ attributes: markerAttributes, html } = result);
3284
3449
  });
3285
- return () => h4("div", {
3450
+ return () => h5("div", {
3286
3451
  ...markerAttributes,
3287
3452
  "data-allow-mismatch": "",
3288
3453
  innerHTML: isBrowser ? undefined : html
@@ -3436,5 +3601,5 @@ export {
3436
3601
  Image_default as Image
3437
3602
  };
3438
3603
 
3439
- //# debugId=E56AFBF4A689CCFA64756E2164756E21
3604
+ //# debugId=367D86E23CA4210164756E2164756E21
3440
3605
  //# sourceMappingURL=index.js.map