@8wave/ai-elements 0.77.0 → 0.78.0
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/_chunks/{PkStreamingMarkdown-COZApJzT.js → PkStreamingMarkdown-gIAvEY1t.js} +370 -301
- package/dist/_chunks/PkStreamingMarkdown-gIAvEY1t.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-BZQixk9z.js → PkToolShowArtifact-BwW4Yn6k.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-BZQixk9z.js.map → PkToolShowArtifact-BwW4Yn6k.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-thS7c8iL.js → PkToolShowContactForm-DTE-iF_c.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-thS7c8iL.js.map → PkToolShowContactForm-DTE-iF_c.js.map} +1 -1
- package/dist/_chunks/PkToolShowImageGallery-CGL-HL6v.js +60 -0
- package/dist/_chunks/PkToolShowImageGallery-CGL-HL6v.js.map +1 -0
- package/dist/_chunks/{PkToolShowProductList-DEo7XogW.js → PkToolShowProductList-C8YIh0Dw.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-DEo7XogW.js.map → PkToolShowProductList-C8YIh0Dw.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BMXftK6O.js → PkToolShowSources-TSjtd1ps.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-BMXftK6O.js.map → PkToolShowSources-TSjtd1ps.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CPAnHI0c.js → PkToolShowSuggestedReply-c9sLv4n4.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CPAnHI0c.js.map → PkToolShowSuggestedReply-c9sLv4n4.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-DcSUbzx0.js → PkToolShowWeather-ChJ5lB4K.js} +48 -48
- package/dist/_chunks/PkToolShowWeather-ChJ5lB4K.js.map +1 -0
- package/dist/_chunks/{PkToolShowWebPages-aH_GarEV.js → PkToolShowWebPages-CL2mYxh-.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-aH_GarEV.js.map → PkToolShowWebPages-CL2mYxh-.js.map} +1 -1
- package/dist/_chunks/{PkUrl-BHD0_pal.js → PkUrl-CvztUywv.js} +2 -2
- package/dist/_chunks/{PkUrl-BHD0_pal.js.map → PkUrl-CvztUywv.js.map} +1 -1
- package/dist/_chunks/{useLightbox-DL_oVBep.js → useLightbox-Ddvue042.js} +5 -3
- package/{dist-vue/_chunks/useLightbox-1sB7fmFb.js.map → dist/_chunks/useLightbox-Ddvue042.js.map} +1 -1
- package/dist/ai-elements.es.js +3097 -3010
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotFilePreview.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-B9RSkQmJ.js → PkChatbot-BEJTYq-D.js} +4 -4
- package/dist-vue/_chunks/{PkChatbot-B9RSkQmJ.js.map → PkChatbot-BEJTYq-D.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFilePreview-DHzuGtz5.js → PkChatbotFilePreview-hRNtv2OJ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotFilePreview-DHzuGtz5.js.map → PkChatbotFilePreview-hRNtv2OJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-C5QSmt21.js → PkChatbotInput-BbGLBVim.js} +124 -116
- package/dist-vue/_chunks/PkChatbotInput-BbGLBVim.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-j3ALQmGG.js +467 -0
- package/dist-vue/_chunks/PkChatbotMessages-j3ALQmGG.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-C2FuDayB.js → PkChatbotViewChat-Z05fqNFE.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotViewChat-C2FuDayB.js.map → PkChatbotViewChat-Z05fqNFE.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BAhC3uGK.js → PkStreamingMarkdown-BBTAwHd_.js} +311 -252
- package/dist-vue/_chunks/PkStreamingMarkdown-BBTAwHd_.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-RzrDPcEQ.js → PkToolShowArtifact-CbqpjzCA.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-RzrDPcEQ.js.map → PkToolShowArtifact-CbqpjzCA.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-5H4jfq1F.js → PkToolShowContactForm-BkgfSyw7.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-5H4jfq1F.js.map → PkToolShowContactForm-BkgfSyw7.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-B7Bt6ZGv.js → PkToolShowImageGallery-Ckyxa0mx.js} +18 -21
- package/dist-vue/_chunks/PkToolShowImageGallery-Ckyxa0mx.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowSources-Dv0uuvqS.js → PkToolShowSources-7Xt3iK2Z.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-Dv0uuvqS.js.map → PkToolShowSources-7Xt3iK2Z.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWeather-Coq6H0iv.js → PkToolShowWeather-B5Wp8WAt.js} +26 -26
- package/dist-vue/_chunks/PkToolShowWeather-B5Wp8WAt.js.map +1 -0
- package/dist-vue/_chunks/{useLightbox-1sB7fmFb.js → useLightbox-Cl8REkfc.js} +5 -3
- package/{dist/_chunks/useLightbox-DL_oVBep.js.map → dist-vue/_chunks/useLightbox-Cl8REkfc.js.map} +1 -1
- package/dist-vue/index.js +11 -11
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -5
- package/dist-vue/packages/components/src/chat/PkStreamingMarkdown.d.ts +9 -1
- package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +15 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkStreamingMarkdown-COZApJzT.js.map +0 -1
- package/dist/_chunks/PkToolShowImageGallery-DmJztS-Z.js +0 -63
- package/dist/_chunks/PkToolShowImageGallery-DmJztS-Z.js.map +0 -1
- package/dist/_chunks/PkToolShowWeather-DcSUbzx0.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotInput-C5QSmt21.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-DOeUT6YL.js +0 -388
- package/dist-vue/_chunks/PkChatbotMessages-DOeUT6YL.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-BAhC3uGK.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowImageGallery-B7Bt6ZGv.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowWeather-Coq6H0iv.js.map +0 -1
- /package/dist/_chunks/{_plugin-vue_export-helper-BI3pHb34.js → _plugin-vue_export-helper-C6kC663S.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PkToolShowWeather-B5Wp8WAt.js","names":[],"sources":["../../../../packages/components/src/chat/PkToolShowWeather.vue","../../../../packages/components/src/chat/PkToolShowWeather.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n interface WeatherCurrent {\n temperature: number\n feelsLike: number\n humidity: number\n precipitation: number\n weatherCode: number\n windSpeed: number\n windDirection: number\n uvIndex: number\n }\n\n interface WeatherHourly {\n time: string\n temperature: number\n precipitationProbability: number\n precipitation: number\n weatherCode: number\n windSpeed: number\n }\n\n interface WeatherDaily {\n date: string\n maxTemp: number\n minTemp: number\n weatherCode: number\n precipitationSum: number\n precipitationProbabilityMax: number\n uvIndexMax: number\n sunrise: string\n sunset: string\n }\n\n interface AirQuality {\n aqi: number\n pm10: number\n pm25: number\n no2: number\n ozone: number\n }\n\n interface WeatherData {\n locationName: string\n latitude: number\n longitude: number\n timezone: string\n current: WeatherCurrent | null\n hourly: WeatherHourly[]\n daily: WeatherDaily[]\n airQuality: AirQuality | null\n }\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { t: $t, d: $d, n: $n } = useI18n({ useScope: 'global' })\n\n const toolPart = computed(() => {\n return props.part as { input?: WeatherData; output?: WeatherData }\n })\n\n const data = computed(\n () => toolPart.value.output ?? toolPart.value.input ?? null,\n )\n\n const selectedDayIndex = ref(0)\n\n const dailyOpen = ref(!data.value?.current)\n\n watch(selectedDayIndex, (index) => {\n if (index > 0) {\n dailyOpen.value = true\n }\n })\n\n const selectedDay = computed(\n () => data.value?.daily?.[selectedDayIndex.value],\n )\n\n /** Hourly entries filtered to the selected day's date */\n const filteredHourly = computed(() => {\n if (!data.value?.hourly?.length || !selectedDay.value) {\n return data.value?.hourly ?? []\n }\n const dayDate = selectedDay.value.date\n return data.value.hourly.filter((h) => h.time.startsWith(dayDate))\n })\n\n /**\n * Parses a date/time string in various formats the LLM might produce.\n * Tries ISO, space-separated, time-only, and common human-readable formats.\n */\n function safeDate(value: string): Date {\n // 1. Try native parsing (works for ISO 8601 and many standard formats)\n const direct = new Date(value)\n if (!Number.isNaN(direct.getTime())) {\n return direct\n }\n\n // 2. Replace space separator → T (\"2024-04-15 14:00\" → \"2024-04-15T14:00\")\n if (/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}/.test(value)) {\n const withT = new Date(value.replace(' ', 'T'))\n if (!Number.isNaN(withT.getTime())) {\n return withT\n }\n }\n\n // 3. Time-only (\"14:00\" or \"14:00:00\") → today at that hour\n const timeOnly = value.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/)\n if (timeOnly) {\n const today = new Date()\n today.setHours(\n Number(timeOnly[1]),\n Number(timeOnly[2]),\n Number(timeOnly[3] ?? 0),\n 0,\n )\n return today\n }\n\n // 4. Date-only (\"2024-04-15\") → noon to avoid timezone edge\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) {\n const noon = new Date(value + 'T12:00:00')\n if (!Number.isNaN(noon.getTime())) {\n return noon\n }\n }\n\n // Last resort: return an obviously invalid sentinel so callers can handle it\n return new Date(NaN)\n }\n\n /** Maps WMO weather code to an Iconify wi: icon name */\n function wmoToIcon(code: number): string {\n if (code === 0) {\n return 'wi:day-sunny'\n }\n if (code === 1) {\n return 'wi:day-sunny-overcast'\n }\n if (code === 2) {\n return 'wi:day-cloudy'\n }\n if (code === 3) {\n return 'wi:cloudy'\n }\n if (code === 45 || code === 48) {\n return 'wi:fog'\n }\n if (code >= 51 && code <= 55) {\n return 'wi:sprinkle'\n }\n if (code === 56 || code === 57) {\n return 'wi:sleet'\n }\n if (code >= 61 && code <= 65) {\n return 'wi:rain'\n }\n if (code === 66 || code === 67) {\n return 'wi:rain-mix'\n }\n if (code >= 71 && code <= 77) {\n return 'wi:snow'\n }\n if (code >= 80 && code <= 82) {\n return 'wi:showers'\n }\n if (code === 85 || code === 86) {\n return 'wi:snow-wind'\n }\n if (code === 95) {\n return 'wi:thunderstorm'\n }\n if (code === 96 || code === 99) {\n return 'wi:storm-showers'\n }\n return 'wi:na'\n }\n\n /**\n * Returns a formatted day label for daily forecast.\n * When daily has 1-2 entries, use the date string directly.\n * Otherwise, use index-based computation from today.\n */\n function formatDay(isoDate: string, index: number, total: number): string {\n const parsed = safeDate(isoDate + 'T12:00:00')\n if (!Number.isNaN(parsed.getTime())) {\n const today = new Date()\n today.setHours(12, 0, 0, 0)\n const diffDays = Math.round(\n (parsed.getTime() - today.getTime()) / 86_400_000,\n )\n if (diffDays === 0) {\n return $t('weather.today')\n }\n return $d(parsed, 'weekday-day')\n }\n if (index === 0 && total <= 7) {\n return $t('weather.today')\n }\n const fallback = new Date()\n fallback.setDate(fallback.getDate() + index)\n return $d(fallback, 'weekday-day')\n }\n\n const headerDate = computed(() => {\n if (selectedDay.value) {\n const parsed = safeDate(selectedDay.value.date + 'T12:00:00')\n if (!Number.isNaN(parsed.getTime())) {\n return formatDay(\n selectedDay.value.date,\n selectedDayIndex.value,\n data.value?.daily?.length ?? 1,\n )\n }\n }\n return formatDay(new Date().toISOString().slice(0, 10), 0, 1)\n })\n\n /** Returns AQI label and CSS class for European AQI */\n function aqiInfo(aqi: number): { label: string; class: string } {\n if (aqi <= 20) {\n return {\n label: $t('weather.aqiGood'),\n class: 'text-green-600 bg-green-50',\n }\n }\n if (aqi <= 40) {\n return {\n label: $t('weather.aqiFair'),\n class: 'text-lime-600 bg-lime-50',\n }\n }\n if (aqi <= 60) {\n return {\n label: $t('weather.aqiModerate'),\n class: 'text-yellow-600 bg-yellow-50',\n }\n }\n if (aqi <= 80) {\n return {\n label: $t('weather.aqiPoor'),\n class: 'text-orange-600 bg-orange-50',\n }\n }\n if (aqi <= 100) {\n return {\n label: $t('weather.aqiVeryPoor'),\n class: 'text-red-600 bg-red-50',\n }\n }\n return {\n label: $t('weather.aqiHazardous'),\n class: 'text-purple-700 bg-purple-50',\n }\n }\n\n /** Formats wind direction degrees to compass label */\n function windDirectionLabel(deg: number): string {\n const dirs = ['N', 'NE', 'E', 'SE', 'S', 'SO', 'O', 'NO']\n return dirs[Math.round(deg / 45) % 8]\n }\n</script>\n\n<template>\n <div\n v-if=\"data\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <!-- Header -->\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:temp-cold-line\" class=\"text-16\" />\n <strong class=\"font-bold truncate\">\n {{ data.locationName }}\n </strong>\n <span class=\"ml-auto shrink-0 capitalize\">\n {{ headerDate }}\n </span>\n </div>\n\n <!-- Current conditions (only when real-time current is available AND first day is selected) -->\n <div\n v-if=\"data.current && selectedDayIndex === 0\"\n class=\"px-sm py-md flex items-center gap-md flex-wrap\">\n <div class=\"flex items-center gap-8\">\n <VvIcon\n :name=\"wmoToIcon(data.current.weatherCode)\"\n class=\"text-48 text-word-2 shrink-0\" />\n <span class=\"text-48 font-light leading-none text-word-1\">\n {{ $n(data.current.temperature, 'integer') }}°\n </span>\n </div>\n <div class=\"flex flex-col gap-4 text-12 text-word-3\">\n <div class=\"flex items-center gap-6\">\n {{ $t('weather.feelsLike') }}\n {{ $n(data.current.feelsLike, 'integer') }}°\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:water-percent-line\" class=\"text-14\" />\n {{ data.current.humidity }}%\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:windy-line\" class=\"text-14\" />\n {{ $n(data.current.windSpeed, 'integer') }} km/h\n {{ windDirectionLabel(data.current.windDirection) }}\n </div>\n <div\n v-if=\"data.current.uvIndex > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-line\" class=\"text-14\" />\n UV {{ $n(data.current.uvIndex, 'integer') }}\n </div>\n </div>\n </div>\n\n <!-- Day summary (when no real-time current, or a non-today day is selected) -->\n <div\n v-else-if=\"selectedDay\"\n class=\"px-sm py-md flex items-center gap-md flex-wrap\">\n <div class=\"flex items-center gap-8\">\n <VvIcon\n :name=\"wmoToIcon(selectedDay.weatherCode)\"\n class=\"text-48 text-word-2 shrink-0\" />\n <div class=\"flex flex-col leading-none\">\n <span class=\"text-48 font-light text-word-1\">\n {{ $n(selectedDay.maxTemp, 'integer') }}°\n </span>\n <span class=\"text-20 text-word-3\">\n {{ $n(selectedDay.minTemp, 'integer') }}°\n </span>\n </div>\n </div>\n <div class=\"flex flex-col gap-4 text-12 text-word-3\">\n <div\n v-if=\"selectedDay.precipitationProbabilityMax > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:drop-line\" class=\"text-14\" />\n {{ selectedDay.precipitationProbabilityMax }}% ({{\n selectedDay.precipitationSum\n }}\n mm)\n </div>\n <div\n v-if=\"selectedDay.uvIndexMax > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-line\" class=\"text-14\" />\n UV {{ $n(selectedDay.uvIndexMax, 'integer') }}\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-foggy-line\" class=\"text-14\" />\n {{ $d(safeDate(selectedDay.sunrise), 'time') }}\n –\n {{ $d(safeDate(selectedDay.sunset), 'time') }}\n </div>\n </div>\n </div>\n\n <!-- Hourly forecast (filtered to selected day) -->\n <transition>\n <div\n v-if=\"filteredHourly.length > 0\"\n class=\"border-t border-surface-3\">\n <div\n class=\"flex overflow-x-auto gap-2 px-sm py-8 light-scrollbar\">\n <div\n v-for=\"hour in filteredHourly\"\n :key=\"hour.time\"\n class=\"flex flex-col items-center gap-4 min-w-48 px-4 py-6 rounded-lg text-11 text-word-3 shrink-0\">\n <span class=\"text-word-3\">{{\n Number.isNaN(safeDate(hour.time).getTime())\n ? hour.time\n : $d(safeDate(hour.time), 'time')\n }}</span>\n <VvIcon\n :name=\"wmoToIcon(hour.weatherCode)\"\n class=\"text-20 text-word-2\" />\n <span class=\"font-medium text-word-1\">\n {{ $n(hour.temperature, 'integer') }}°\n </span>\n <span\n v-if=\"hour.precipitationProbability > 0\"\n class=\"text-word-5 text-smaller\">\n {{ hour.precipitationProbability }}%\n </span>\n </div>\n </div>\n </div>\n </transition>\n\n <!-- Daily forecast (clickable, inside accordion) -->\n <transition>\n <VvAccordion\n v-if=\"data.daily?.length > 1\"\n v-model=\"dailyOpen\"\n modifiers=\"details no-padding\"\n :title=\"$t('weather.dailyForecast')\"\n class=\"border-t border-surface-3\">\n <button\n v-for=\"(day, index) in data.daily\"\n :key=\"day.date\"\n type=\"button\"\n class=\"flex items-center gap-sm px-sm py-8 text-12 w-full text-left transition-colors cursor-pointer border-t border-surface-3\"\n :class=\"\n index === selectedDayIndex\n ? 'bg-surface-2'\n : 'hover:bg-surface-1'\n \"\n @click=\"selectedDayIndex = index\">\n <span class=\"w-48 shrink-0 text-word-3 capitalize\">\n {{ formatDay(day.date, index, data.daily.length) }}\n </span>\n <VvIcon\n :name=\"wmoToIcon(day.weatherCode)\"\n class=\"text-18 text-word-2 shrink-0\" />\n <span\n v-if=\"day.precipitationProbabilityMax > 0\"\n class=\"text-word-5 text-11 w-32 shrink-0\">\n {{ day.precipitationProbabilityMax }}%\n </span>\n <span v-else class=\"w-32 shrink-0\" />\n <div class=\"ml-auto flex items-center gap-8 text-word-3\">\n <span class=\"text-word-1 font-semibold\">\n {{ $n(day.maxTemp, 'integer') }}°\n </span>\n <span>{{ $n(day.minTemp, 'integer') }}°</span>\n </div>\n </button>\n </VvAccordion>\n </transition>\n\n <!-- Air quality -->\n <div\n v-if=\"data.airQuality\"\n class=\"border-t border-surface-3 px-sm py-8 flex items-center gap-8 text-12\">\n <VvIcon name=\"ri:windy-line\" class=\"text-14 text-word-3\" />\n <span class=\"text-word-3\">{{ $t('weather.airQuality') }}</span>\n <span\n :class=\"[\n 'ml-auto px-8 py-2 text-11 font-semibold',\n aqiInfo(data.airQuality.aqi).class,\n ]\">\n {{ aqiInfo(data.airQuality.aqi).label }}\n ({{ data.airQuality.aqi }})\n </span>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n interface WeatherCurrent {\n temperature: number\n feelsLike: number\n humidity: number\n precipitation: number\n weatherCode: number\n windSpeed: number\n windDirection: number\n uvIndex: number\n }\n\n interface WeatherHourly {\n time: string\n temperature: number\n precipitationProbability: number\n precipitation: number\n weatherCode: number\n windSpeed: number\n }\n\n interface WeatherDaily {\n date: string\n maxTemp: number\n minTemp: number\n weatherCode: number\n precipitationSum: number\n precipitationProbabilityMax: number\n uvIndexMax: number\n sunrise: string\n sunset: string\n }\n\n interface AirQuality {\n aqi: number\n pm10: number\n pm25: number\n no2: number\n ozone: number\n }\n\n interface WeatherData {\n locationName: string\n latitude: number\n longitude: number\n timezone: string\n current: WeatherCurrent | null\n hourly: WeatherHourly[]\n daily: WeatherDaily[]\n airQuality: AirQuality | null\n }\n\n const props = defineProps<{\n part: unknown\n }>()\n\n const { t: $t, d: $d, n: $n } = useI18n({ useScope: 'global' })\n\n const toolPart = computed(() => {\n return props.part as { input?: WeatherData; output?: WeatherData }\n })\n\n const data = computed(\n () => toolPart.value.output ?? toolPart.value.input ?? null,\n )\n\n const selectedDayIndex = ref(0)\n\n const dailyOpen = ref(!data.value?.current)\n\n watch(selectedDayIndex, (index) => {\n if (index > 0) {\n dailyOpen.value = true\n }\n })\n\n const selectedDay = computed(\n () => data.value?.daily?.[selectedDayIndex.value],\n )\n\n /** Hourly entries filtered to the selected day's date */\n const filteredHourly = computed(() => {\n if (!data.value?.hourly?.length || !selectedDay.value) {\n return data.value?.hourly ?? []\n }\n const dayDate = selectedDay.value.date\n return data.value.hourly.filter((h) => h.time.startsWith(dayDate))\n })\n\n /**\n * Parses a date/time string in various formats the LLM might produce.\n * Tries ISO, space-separated, time-only, and common human-readable formats.\n */\n function safeDate(value: string): Date {\n // 1. Try native parsing (works for ISO 8601 and many standard formats)\n const direct = new Date(value)\n if (!Number.isNaN(direct.getTime())) {\n return direct\n }\n\n // 2. Replace space separator → T (\"2024-04-15 14:00\" → \"2024-04-15T14:00\")\n if (/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}/.test(value)) {\n const withT = new Date(value.replace(' ', 'T'))\n if (!Number.isNaN(withT.getTime())) {\n return withT\n }\n }\n\n // 3. Time-only (\"14:00\" or \"14:00:00\") → today at that hour\n const timeOnly = value.match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/)\n if (timeOnly) {\n const today = new Date()\n today.setHours(\n Number(timeOnly[1]),\n Number(timeOnly[2]),\n Number(timeOnly[3] ?? 0),\n 0,\n )\n return today\n }\n\n // 4. Date-only (\"2024-04-15\") → noon to avoid timezone edge\n if (/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) {\n const noon = new Date(value + 'T12:00:00')\n if (!Number.isNaN(noon.getTime())) {\n return noon\n }\n }\n\n // Last resort: return an obviously invalid sentinel so callers can handle it\n return new Date(NaN)\n }\n\n /** Maps WMO weather code to an Iconify wi: icon name */\n function wmoToIcon(code: number): string {\n if (code === 0) {\n return 'wi:day-sunny'\n }\n if (code === 1) {\n return 'wi:day-sunny-overcast'\n }\n if (code === 2) {\n return 'wi:day-cloudy'\n }\n if (code === 3) {\n return 'wi:cloudy'\n }\n if (code === 45 || code === 48) {\n return 'wi:fog'\n }\n if (code >= 51 && code <= 55) {\n return 'wi:sprinkle'\n }\n if (code === 56 || code === 57) {\n return 'wi:sleet'\n }\n if (code >= 61 && code <= 65) {\n return 'wi:rain'\n }\n if (code === 66 || code === 67) {\n return 'wi:rain-mix'\n }\n if (code >= 71 && code <= 77) {\n return 'wi:snow'\n }\n if (code >= 80 && code <= 82) {\n return 'wi:showers'\n }\n if (code === 85 || code === 86) {\n return 'wi:snow-wind'\n }\n if (code === 95) {\n return 'wi:thunderstorm'\n }\n if (code === 96 || code === 99) {\n return 'wi:storm-showers'\n }\n return 'wi:na'\n }\n\n /**\n * Returns a formatted day label for daily forecast.\n * When daily has 1-2 entries, use the date string directly.\n * Otherwise, use index-based computation from today.\n */\n function formatDay(isoDate: string, index: number, total: number): string {\n const parsed = safeDate(isoDate + 'T12:00:00')\n if (!Number.isNaN(parsed.getTime())) {\n const today = new Date()\n today.setHours(12, 0, 0, 0)\n const diffDays = Math.round(\n (parsed.getTime() - today.getTime()) / 86_400_000,\n )\n if (diffDays === 0) {\n return $t('weather.today')\n }\n return $d(parsed, 'weekday-day')\n }\n if (index === 0 && total <= 7) {\n return $t('weather.today')\n }\n const fallback = new Date()\n fallback.setDate(fallback.getDate() + index)\n return $d(fallback, 'weekday-day')\n }\n\n const headerDate = computed(() => {\n if (selectedDay.value) {\n const parsed = safeDate(selectedDay.value.date + 'T12:00:00')\n if (!Number.isNaN(parsed.getTime())) {\n return formatDay(\n selectedDay.value.date,\n selectedDayIndex.value,\n data.value?.daily?.length ?? 1,\n )\n }\n }\n return formatDay(new Date().toISOString().slice(0, 10), 0, 1)\n })\n\n /** Returns AQI label and CSS class for European AQI */\n function aqiInfo(aqi: number): { label: string; class: string } {\n if (aqi <= 20) {\n return {\n label: $t('weather.aqiGood'),\n class: 'text-green-600 bg-green-50',\n }\n }\n if (aqi <= 40) {\n return {\n label: $t('weather.aqiFair'),\n class: 'text-lime-600 bg-lime-50',\n }\n }\n if (aqi <= 60) {\n return {\n label: $t('weather.aqiModerate'),\n class: 'text-yellow-600 bg-yellow-50',\n }\n }\n if (aqi <= 80) {\n return {\n label: $t('weather.aqiPoor'),\n class: 'text-orange-600 bg-orange-50',\n }\n }\n if (aqi <= 100) {\n return {\n label: $t('weather.aqiVeryPoor'),\n class: 'text-red-600 bg-red-50',\n }\n }\n return {\n label: $t('weather.aqiHazardous'),\n class: 'text-purple-700 bg-purple-50',\n }\n }\n\n /** Formats wind direction degrees to compass label */\n function windDirectionLabel(deg: number): string {\n const dirs = ['N', 'NE', 'E', 'SE', 'S', 'SO', 'O', 'NO']\n return dirs[Math.round(deg / 45) % 8]\n }\n</script>\n\n<template>\n <div\n v-if=\"data\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden\">\n <!-- Header -->\n <div\n class=\"px-sm py-6 bg-surface-1 text-12 border-b border-surface-3 text-word-3 flex items-center gap-8 min-h-40\">\n <VvIcon name=\"ri:temp-cold-line\" class=\"text-16\" />\n <strong class=\"font-bold truncate\">\n {{ data.locationName }}\n </strong>\n <span class=\"ml-auto shrink-0 capitalize\">\n {{ headerDate }}\n </span>\n </div>\n\n <!-- Current conditions (only when real-time current is available AND first day is selected) -->\n <div\n v-if=\"data.current && selectedDayIndex === 0\"\n class=\"px-sm py-md flex items-center gap-md flex-wrap\">\n <div class=\"flex items-center gap-8\">\n <VvIcon\n :name=\"wmoToIcon(data.current.weatherCode)\"\n class=\"text-48 text-word-2 shrink-0\" />\n <span class=\"text-48 font-light leading-none text-word-1\">\n {{ $n(data.current.temperature, 'integer') }}°\n </span>\n </div>\n <div class=\"flex flex-col gap-4 text-12 text-word-3\">\n <div class=\"flex items-center gap-6\">\n {{ $t('weather.feelsLike') }}\n {{ $n(data.current.feelsLike, 'integer') }}°\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:water-percent-line\" class=\"text-14\" />\n {{ data.current.humidity }}%\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:windy-line\" class=\"text-14\" />\n {{ $n(data.current.windSpeed, 'integer') }} km/h\n {{ windDirectionLabel(data.current.windDirection) }}\n </div>\n <div\n v-if=\"data.current.uvIndex > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-line\" class=\"text-14\" />\n UV {{ $n(data.current.uvIndex, 'integer') }}\n </div>\n </div>\n </div>\n\n <!-- Day summary (when no real-time current, or a non-today day is selected) -->\n <div\n v-else-if=\"selectedDay\"\n class=\"px-sm py-md flex items-center gap-md flex-wrap\">\n <div class=\"flex items-center gap-8\">\n <VvIcon\n :name=\"wmoToIcon(selectedDay.weatherCode)\"\n class=\"text-48 text-word-2 shrink-0\" />\n <div class=\"flex flex-col leading-none\">\n <span class=\"text-48 font-light text-word-1\">\n {{ $n(selectedDay.maxTemp, 'integer') }}°\n </span>\n <span class=\"text-20 text-word-3\">\n {{ $n(selectedDay.minTemp, 'integer') }}°\n </span>\n </div>\n </div>\n <div class=\"flex flex-col gap-4 text-12 text-word-3\">\n <div\n v-if=\"selectedDay.precipitationProbabilityMax > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:drop-line\" class=\"text-14\" />\n {{ selectedDay.precipitationProbabilityMax }}% ({{\n selectedDay.precipitationSum\n }}\n mm)\n </div>\n <div\n v-if=\"selectedDay.uvIndexMax > 0\"\n class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-line\" class=\"text-14\" />\n UV {{ $n(selectedDay.uvIndexMax, 'integer') }}\n </div>\n <div class=\"flex items-center gap-6\">\n <VvIcon name=\"ri:sun-foggy-line\" class=\"text-14\" />\n {{ $d(safeDate(selectedDay.sunrise), 'time') }}\n –\n {{ $d(safeDate(selectedDay.sunset), 'time') }}\n </div>\n </div>\n </div>\n\n <!-- Hourly forecast (filtered to selected day) -->\n <transition>\n <div\n v-if=\"filteredHourly.length > 0\"\n class=\"border-t border-surface-3\">\n <div\n class=\"flex overflow-x-auto gap-2 px-sm py-8 light-scrollbar\">\n <div\n v-for=\"hour in filteredHourly\"\n :key=\"hour.time\"\n class=\"flex flex-col items-center gap-4 min-w-48 px-4 py-6 rounded-lg text-11 text-word-3 shrink-0\">\n <span class=\"text-word-3\">{{\n Number.isNaN(safeDate(hour.time).getTime())\n ? hour.time\n : $d(safeDate(hour.time), 'time')\n }}</span>\n <VvIcon\n :name=\"wmoToIcon(hour.weatherCode)\"\n class=\"text-20 text-word-2\" />\n <span class=\"font-medium text-word-1\">\n {{ $n(hour.temperature, 'integer') }}°\n </span>\n <span\n v-if=\"hour.precipitationProbability > 0\"\n class=\"text-word-5 text-smaller\">\n {{ hour.precipitationProbability }}%\n </span>\n </div>\n </div>\n </div>\n </transition>\n\n <!-- Daily forecast (clickable, inside accordion) -->\n <transition>\n <VvAccordion\n v-if=\"data.daily?.length > 1\"\n v-model=\"dailyOpen\"\n modifiers=\"details no-padding\"\n :title=\"$t('weather.dailyForecast')\"\n class=\"border-t border-surface-3\">\n <button\n v-for=\"(day, index) in data.daily\"\n :key=\"day.date\"\n type=\"button\"\n class=\"flex items-center gap-sm px-sm py-8 text-12 w-full text-left transition-colors cursor-pointer border-t border-surface-3\"\n :class=\"\n index === selectedDayIndex\n ? 'bg-surface-2'\n : 'hover:bg-surface-1'\n \"\n @click=\"selectedDayIndex = index\">\n <span class=\"w-48 shrink-0 text-word-3 capitalize\">\n {{ formatDay(day.date, index, data.daily.length) }}\n </span>\n <VvIcon\n :name=\"wmoToIcon(day.weatherCode)\"\n class=\"text-18 text-word-2 shrink-0\" />\n <span\n v-if=\"day.precipitationProbabilityMax > 0\"\n class=\"text-word-5 text-11 w-32 shrink-0\">\n {{ day.precipitationProbabilityMax }}%\n </span>\n <span v-else class=\"w-32 shrink-0\" />\n <div class=\"ml-auto flex items-center gap-8 text-word-3\">\n <span class=\"text-word-1 font-semibold\">\n {{ $n(day.maxTemp, 'integer') }}°\n </span>\n <span>{{ $n(day.minTemp, 'integer') }}°</span>\n </div>\n </button>\n </VvAccordion>\n </transition>\n\n <!-- Air quality -->\n <div\n v-if=\"data.airQuality\"\n class=\"border-t border-surface-3 px-sm py-8 flex items-center gap-8 text-12\">\n <VvIcon name=\"ri:windy-line\" class=\"text-14 text-word-3\" />\n <span class=\"text-word-3\">{{ $t('weather.airQuality') }}</span>\n <span\n :class=\"[\n 'ml-auto px-8 py-2 text-11 font-semibold',\n aqiInfo(data.airQuality.aqi).class,\n ]\">\n {{ aqiInfo(data.airQuality.aqi).label }}\n ({{ data.airQuality.aqi }})\n </span>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuDI,IAAM,IAAQ,GAIR,EAAE,GAAG,GAAI,GAAG,GAAI,GAAG,MAAO,GAAQ,EAAE,UAAU,UAAU,CAAA,EAExD,IAAW,QACN,EAAM,KAChB,EAEK,IAAO,QACH,EAAS,MAAM,UAAU,EAAS,MAAM,SAAS,KAC3D,EAEM,IAAmB,EAAI,EAAC,EAExB,IAAY,EAAI,CAAC,EAAK,OAAO,QAAO;AAE1C,IAAM,IAAmB,MAAU;AAC/B,GAAI,IAAQ,MACR,EAAU,QAAQ;IAEzB;EAED,IAAM,IAAc,QACV,EAAK,OAAO,QAAQ,EAAiB,OAC/C,EAGM,IAAiB,QAAe;AAClC,OAAI,CAAC,EAAK,OAAO,QAAQ,UAAU,CAAC,EAAY,MAC5C,QAAO,EAAK,OAAO,UAAU,EAAC;GAElC,IAAM,IAAU,EAAY,MAAM;AAClC,UAAO,EAAK,MAAM,OAAO,QAAQ,MAAM,EAAE,KAAK,WAAW,EAAQ,CAAA;IACpE;EAMD,SAAS,EAAS,GAAqB;GAEnC,IAAM,IAAS,IAAI,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,EACA,EAAqC,QAArC,EAAqC;OACrC,EAKM,OALN,GAKM,CAJF,EAEO,QAFP,GAEO,EADA,EAAA,EAAE,CAAC,EAAI,SAAO,UAAA,CAAA,GAAe,MACpC,EAAA,EACA,EAAkD,QAAA,MAAA,EAAzC,EAAA,EAAE,CAAC,EAAI,SAAO,UAAA,CAAA,GAAe,KAAK,EAAA,CAAA,CAAA;;;;;;IAQjD,EAAA,MAAK,cAAA,GAAA,EADf,EAaM,OAbN,GAaM;KAVF,EAA2D,GAAA;MAAnD,MAAK;MAAgB,OAAM;;KACnC,EAA+D,QAA/D,GAA+D,EAAlC,EAAA,EAAE,CAAA,qBAAA,CAAA,EAAA,EAAA;KAC/B,EAOO,QAAA,EANF,OAAK,EAAA,CAAA,2CAAuF,EAAQ,EAAA,MAAK,WAAW,IAAG,CAAE,MAAA,CAAA,EAAA,EAAA,EAIvH,EAAQ,EAAA,MAAK,WAAW,IAAG,CAAE,MAAK,GAAG,OACvC,EAAG,EAAA,MAAK,WAAW,IAAG,GAAG,MAC9B,EAAA"}
|
|
@@ -99,15 +99,17 @@ function p() {
|
|
|
99
99
|
f = !0;
|
|
100
100
|
let e = document.createElement("style");
|
|
101
101
|
e.textContent = [
|
|
102
|
+
".pswp__counter { font-family: sans-serif; }",
|
|
102
103
|
".pswp { z-index: 2147483647 !important; }",
|
|
103
104
|
".pswp__icn { width: 20px; height: 20px; }",
|
|
104
|
-
".pswp__button { width: 40px; height: 40px; }",
|
|
105
|
+
".pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }",
|
|
105
106
|
".pswp__icn--zoom-out { display: none; }",
|
|
106
107
|
".pswp--zoomed-in .pswp__icn--zoom-in { display: none; }",
|
|
107
|
-
".pswp--zoomed-in .pswp__icn--zoom-out { display: block; }"
|
|
108
|
+
".pswp--zoomed-in .pswp__icn--zoom-out { display: block; }",
|
|
109
|
+
".pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }"
|
|
108
110
|
].join(" "), document.head.appendChild(e);
|
|
109
111
|
}
|
|
110
112
|
//#endregion
|
|
111
113
|
export { o as n, s as t };
|
|
112
114
|
|
|
113
|
-
//# sourceMappingURL=useLightbox-
|
|
115
|
+
//# sourceMappingURL=useLightbox-Cl8REkfc.js.map
|
package/{dist/_chunks/useLightbox-DL_oVBep.js.map → dist-vue/_chunks/useLightbox-Cl8REkfc.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLightbox-DL_oVBep.js","names":[],"sources":["../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["import {\n onBeforeUnmount,\n ref,\n shallowRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px — used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px — used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Ref<HTMLElement | undefined>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n\n const init = async () => {\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head — not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: 8,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: 'Open in new tab',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: 9,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: 'Download',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init }\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n undefined\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment` — no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`).\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;AAWA,IAAM,IACF,iEAEE,IAAqB;CAAE,OAAO;CAAM,QAAQ;CAAK;AAwCvD,SAAgB,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,OACf,GAEE,IAAW,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OAAO,EAAI;MACX,QAAQ,EAAI;MACf,CAAC;OAEN,EAAI,MAAM,EAAM;;;EAMN,UAFD,MAAgB,EAAM,MAAM,IAAI,EAAI,IAAI;EAE9B;;AAO/B,SAAS,EAAmB,GAAsC;AAC9D,QACI,EAAK,WAAW,MAAM,OACtB,EAAK,WAAW,MAAM,SAChB,cAAc,MAAM,EACpB,aAAa,MAAM,IACzB,KAAA;;AAeR,SAAS,EAAc,GAAmB;CACtC,IAAM,IAAc,EAAc,EAAI,EAEhC,IAAS,SAAS,cAAc,IAAI;AAS1C,CARA,EAAO,OAAO,GACd,EAAO,SAAS,UAChB,EAAO,MAAM,uBAGb,EAAO,WAAW,EAAmB,EAAI,EACzC,SAAS,KAAK,YAAY,EAAO,EACjC,EAAO,OAAO,EACd,SAAS,KAAK,YAAY,EAAO;;AAOrC,SAAS,EAAc,GAAqB;AACxC,QAAO,EAAI,QAAQ,gBAAgB,cAAc;;AAGrD,SAAS,EAAmB,GAAqB;AAC7C,KAAI;EAEA,IAAM,IADW,IAAI,IAAI,EAAI,CAAC,SACR,MAAM,IAAI,CAAC,KAAK;AACtC,SAAO,KAAQ,EAAK,SAAS,IAAI,GAAG,IAAO;SACvC;AACJ,SAAO;;;AAIf,IAAI,IAAoB;AAOxB,SAAS,IAAkC;AACvC,KAAI,EACA;AAEJ,KAAoB;CACpB,IAAM,IAAQ,SAAS,cAAc,QAAQ;AAS7C,CARA,EAAM,cAAc;EAChB;EACA;EACA;EACA;EACA;EACA;EACH,CAAC,KAAK,IAAI,EACX,SAAS,KAAK,YAAY,EAAM"}
|
|
1
|
+
{"version":3,"file":"useLightbox-Cl8REkfc.js","names":[],"sources":["../../../../packages/components/src/composables/useLightbox.ts"],"sourcesContent":["import {\n onBeforeUnmount,\n ref,\n shallowRef,\n type Ref,\n type ShallowRef,\n} from 'vue'\nimport type PhotoSwipeLightbox from 'photoswipe/lightbox'\nimport type PhotoSwipe from 'photoswipe'\nimport { loadCdnCss } from 'utils'\n\nconst PHOTOSWIPE_CSS =\n 'https://cdn.jsdelivr.net/npm/photoswipe@5/dist/photoswipe.css'\n\nconst DEFAULT_IMAGE_SIZE = { width: 1200, height: 800 }\n\nexport interface LightboxImage {\n url: string\n caption?: string\n alt?: string\n /** Natural width in px — used by PhotoSwipe for proper sizing. */\n width?: number\n /** Natural height in px — used by PhotoSwipe for proper sizing. */\n height?: number\n}\n\nexport interface LightboxOptions {\n /** Container element whose child anchors are the gallery items */\n gallery: Ref<HTMLElement | undefined>\n /** CSS selector for gallery items inside the container (default: `'a[data-pswp-src]'`) */\n children?: string\n loop?: boolean\n /** Show a download button in the lightbox toolbar */\n downloadable?: boolean\n /** Show an open-in-new-tab button in the lightbox toolbar */\n openInNewTab?: boolean\n}\n\nexport interface UseLightboxReturn {\n lightbox: ShallowRef<PhotoSwipeLightbox | null>\n /** Initialises PhotoSwipe. Call this inside `onMounted`. */\n init: () => Promise<void>\n}\n\n/**\n * Encapsulates PhotoSwipe 5 initialisation, toolbar customisation, and lifecycle cleanup.\n * CSS is injected into `document.head` so the overlay works in both regular DOM and Shadow DOM.\n *\n * Usage:\n * ```ts\n * const { init } = useLightbox({ gallery: galleryRef, downloadable: true })\n * onMounted(init)\n * ```\n */\nexport function useLightbox(options: LightboxOptions): UseLightboxReturn {\n const {\n gallery,\n children = 'a[data-pswp-src]',\n loop = true,\n downloadable = true,\n openInNewTab = true,\n } = options\n\n const lightbox = shallowRef<PhotoSwipeLightbox | null>(null)\n\n const init = async () => {\n if (!gallery.value) {\n return\n }\n\n // PhotoSwipe renders its overlay into document.body, so CSS must be in\n // document.head — not inside a shadow root.\n loadCdnCss(PHOTOSWIPE_CSS)\n injectPhotoSwipeOverrides()\n\n const { default: PhotoSwipeLightbox } =\n await import('photoswipe/lightbox')\n\n lightbox.value = new PhotoSwipeLightbox({\n gallery: gallery.value,\n children,\n pswpModule: () => import('photoswipe'),\n loop,\n arrowPrevSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m10.828 12l4.95 4.95l-1.414 1.415L8 12l6.364-6.364l1.414 1.414z\"/></svg>',\n arrowNextSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m13.172 12l-4.95-4.95l1.414-1.413L16 12l-6.364 6.364l-1.414-1.415z\"/></svg>',\n closeSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z\"/></svg>',\n zoomSVG:\n '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><g class=\"pswp__icn--zoom-in\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM10 10V7h2v3h3v2h-3v3h-2v-3H7v-2z\"/></g><g class=\"pswp__icn--zoom-out\"><path fill=\"#ffffff\" d=\"m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975zM7 10h8v2H7z\"/></g></svg>',\n })\n\n if (openInNewTab || downloadable) {\n lightbox.value.on('uiRegister', () => {\n const ui = lightbox.value!.pswp?.ui\n if (!ui) {\n return\n }\n\n if (openInNewTab) {\n ui.registerElement({\n name: 'open-in-new-tab-button',\n order: 8,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3z\"/></svg>',\n title: 'Open in new tab',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n window.open(\n url,\n '_blank',\n 'noopener,noreferrer',\n )\n }\n },\n })\n }\n\n if (downloadable) {\n ui.registerElement({\n name: 'download-button',\n order: 9,\n isButton: true,\n html: '<svg aria-hidden=\"true\" class=\"pswp__icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path fill=\"#ffffff\" d=\"M3 19h18v2H3zm10-5.828L19.071 7.1l1.414 1.414L12 17L3.515 8.515L4.929 7.1L11 13.173V2h2z\"/></svg>',\n title: 'Download',\n onClick: (_, __, pswp) => {\n const url = getCurrentSlideUrl(pswp)\n if (url) {\n downloadImage(url)\n }\n },\n })\n }\n })\n }\n\n lightbox.value.init()\n }\n\n onBeforeUnmount(() => {\n lightbox.value?.destroy()\n lightbox.value = null\n })\n\n return { lightbox, init }\n}\n\n// ---------------------------------------------------------------------------\n// Image size preloading\n// ---------------------------------------------------------------------------\n\nexport interface UseImageSizesReturn {\n preload: (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => void\n getSize: (url: string) => { width: number; height: number }\n}\n\n/**\n * Preloads natural image dimensions so PhotoSwipe can size its slides correctly.\n * When `width`/`height` are already provided they are used as-is;\n * otherwise the image is loaded in the background to read `naturalWidth`/`naturalHeight`.\n */\nexport function useImageSizes(): UseImageSizesReturn {\n const sizes = ref(new Map<string, { width: number; height: number }>())\n\n const preload = (\n images: Array<{ url: string; width?: number; height?: number }>,\n ) => {\n for (const image of images) {\n if (image.width && image.height) {\n sizes.value.set(image.url, {\n width: image.width,\n height: image.height,\n })\n continue\n }\n const img = new Image()\n img.onload = () => {\n sizes.value.set(image.url, {\n width: img.naturalWidth,\n height: img.naturalHeight,\n })\n }\n img.src = image.url\n }\n }\n\n const getSize = (url: string) => sizes.value.get(url) ?? DEFAULT_IMAGE_SIZE\n\n return { preload, getSize }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction getCurrentSlideUrl(pswp: PhotoSwipe): string | undefined {\n return (\n pswp.currSlide?.data?.src ??\n pswp.currSlide?.data?.element\n ?.querySelector('img')\n ?.getAttribute('src') ??\n undefined\n )\n}\n\n/**\n * Triggers a client-side download for an image URL.\n *\n * For backend media URLs (.../media/:file/view), navigates to the\n * corresponding /download endpoint which redirects to an Azure SAS URL\n * with `Content-Disposition: attachment` — no CORS issues.\n *\n * For blob: URLs (in-session uploads), uses the fetch → blob approach.\n *\n * Falls back to opening in a new tab for all other cases.\n */\nfunction downloadImage(url: string): void {\n const downloadUrl = toDownloadUrl(url)\n\n const anchor = document.createElement('a')\n anchor.href = downloadUrl\n anchor.target = '_blank'\n anchor.rel = 'noopener noreferrer'\n // `download` attribute works for same-origin and blob: URLs; for\n // cross-origin it is ignored but the browser still follows Content-Disposition.\n anchor.download = getFilenameFromUrl(url)\n document.body.appendChild(anchor)\n anchor.click()\n document.body.removeChild(anchor)\n}\n\n/**\n * Converts a `/view` media URL to its `/download` counterpart.\n * Leaves blob: and all other URLs untouched.\n */\nfunction toDownloadUrl(url: string): string {\n return url.replace(/\\/view(\\?|$)/, '/download$1')\n}\n\nfunction getFilenameFromUrl(url: string): string {\n try {\n const pathname = new URL(url).pathname\n const name = pathname.split('/').pop()\n return name && name.includes('.') ? name : 'image'\n } catch {\n return 'image'\n }\n}\n\nlet overridesInjected = false\n\n/**\n * Injects a one-time `<style>` into `document.head` that raises\n * PhotoSwipe's z-index above any host UI (e.g. floating chat widgets\n * that use `z-index: 2147483647`).\n */\nfunction injectPhotoSwipeOverrides(): void {\n if (overridesInjected) {\n return\n }\n overridesInjected = true\n const style = document.createElement('style')\n style.textContent = [\n '.pswp__counter { font-family: sans-serif; }',\n '.pswp { z-index: 2147483647 !important; }',\n '.pswp__icn { width: 20px; height: 20px; }',\n '.pswp__button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }',\n '.pswp__icn--zoom-out { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-in { display: none; }',\n '.pswp--zoomed-in .pswp__icn--zoom-out { display: block; }',\n '.pswp__button--arrow .pswp__icn {left: auto; right: auto; width: 40px; height: 40px; transform: none; margin-top: -20px; }',\n ].join(' ')\n document.head.appendChild(style)\n}\n"],"mappings":";;;AAWA,IAAM,IACF,iEAEE,IAAqB;CAAE,OAAO;CAAM,QAAQ;CAAK;AAwCvD,SAAgB,EAAY,GAA6C;CACrE,IAAM,EACF,YACA,cAAW,oBACX,UAAO,IACP,kBAAe,IACf,kBAAe,OACf,GAEE,IAAW,EAAsC,KAAK;AAmF5D,QALA,QAAsB;AAElB,EADA,EAAS,OAAO,SAAS,EACzB,EAAS,QAAQ;GACnB,EAEK;EAAE;EAAU,kBAjFM;AACrB,OAAI,CAAC,EAAQ,MACT;AAMJ,GADA,EAAW,EAAe,EAC1B,GAA2B;GAE3B,IAAM,EAAE,SAAS,MACb,MAAM,OAAO;AA8DjB,GA5DA,EAAS,QAAQ,IAAI,EAAmB;IACpC,SAAS,EAAQ;IACjB;IACA,kBAAkB,OAAO;IACzB;IACA,cACI;IACJ,cACI;IACJ,UACI;IACJ,SACI;IACP,CAAC,GAEE,KAAgB,MAChB,EAAS,MAAM,GAAG,oBAAoB;IAClC,I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AmB,EAAI,EACzC,SAAS,KAAK,YAAY,EAAO,EACjC,EAAO,OAAO,EACd,SAAS,KAAK,YAAY,EAAO;;AAOrC,SAAS,EAAc,GAAqB;AACxC,QAAO,EAAI,QAAQ,gBAAgB,cAAc;;AAGrD,SAAS,EAAmB,GAAqB;AAC7C,KAAI;EAEA,IAAM,IADW,IAAI,IAAI,EAAI,CAAC,SACR,MAAM,IAAI,CAAC,KAAK;AACtC,SAAO,KAAQ,EAAK,SAAS,IAAI,GAAG,IAAO;SACvC;AACJ,SAAO;;;AAIf,IAAI,IAAoB;AAOxB,SAAS,IAAkC;AACvC,KAAI,EACA;AAEJ,KAAoB;CACpB,IAAM,IAAQ,SAAS,cAAc,QAAQ;AAW7C,CAVA,EAAM,cAAc;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACH,CAAC,KAAK,IAAI,EACX,SAAS,KAAK,YAAY,EAAM"}
|
package/dist-vue/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { n as e } from "./_chunks/rolldown-runtime-D9KsE1-l.js";
|
|
|
2
2
|
import { a as t, c as n, i as r, n as i, o as a, r as o, s } from "./_chunks/createChatbotApiClient-CvDRMmDa.js";
|
|
3
3
|
import { C as c, S as l, _ as u, a as d, b as f, c as p, d as m, g as h, i as g, m as _, n as v, o as y, p as b, r as x, s as ee, u as S, v as C, y as w } from "./_chunks/schemas-Clx4oKCB.js";
|
|
4
4
|
import { o as T, r as te } from "./_chunks/Media-kK7BnZGr.js";
|
|
5
|
-
import { a as ne, i as re, r as ie, t as ae } from "./_chunks/PkToolShowSources-
|
|
5
|
+
import { a as ne, i as re, r as ie, t as ae } from "./_chunks/PkToolShowSources-7Xt3iK2Z.js";
|
|
6
6
|
import { t as oe } from "./_chunks/PkChatbotError-CvZxHGlI.js";
|
|
7
7
|
import { a as se, f as ce, i as le, l as ue, o as de, p as fe } from "./_chunks/src-EtGd6cRz.js";
|
|
8
8
|
import { a as E, i as pe, n as me, r as he } from "./_chunks/useChatbotStore-DMDbzuub.js";
|
|
@@ -13,21 +13,21 @@ import { $ as xe, A as Se, Ct as Ce, D as we, F as Te, G as Ee, H as De, J as Oe
|
|
|
13
13
|
import { n as ft } from "./_chunks/dist-DFvVVU0-.js";
|
|
14
14
|
import { n as pt } from "./_chunks/dist-CGNGkvWf.js";
|
|
15
15
|
import { t as mt } from "./_chunks/PkUrl-CGbSBfuP.js";
|
|
16
|
-
import { t as ht } from "./_chunks/PkStreamingMarkdown-
|
|
17
|
-
import { n as gt, t as _t } from "./_chunks/useLightbox-
|
|
18
|
-
import { r as vt, t as yt } from "./_chunks/PkToolShowArtifact-
|
|
16
|
+
import { t as ht } from "./_chunks/PkStreamingMarkdown-BBTAwHd_.js";
|
|
17
|
+
import { n as gt, t as _t } from "./_chunks/useLightbox-Cl8REkfc.js";
|
|
18
|
+
import { r as vt, t as yt } from "./_chunks/PkToolShowArtifact-CbqpjzCA.js";
|
|
19
19
|
import { n as bt, t as xt } from "./_chunks/PkChatbotViewProfile-CoT1JnMk.js";
|
|
20
20
|
import { t as St } from "./_chunks/PkChatbotFeedbackForm-lj9CHdhn.js";
|
|
21
|
-
import { t as Ct } from "./_chunks/PkChatbotFilePreview-
|
|
22
|
-
import { n as wt, t as Tt } from "./_chunks/PkChatbotMessages-
|
|
21
|
+
import { t as Ct } from "./_chunks/PkChatbotFilePreview-hRNtv2OJ.js";
|
|
22
|
+
import { n as wt, t as Tt } from "./_chunks/PkChatbotMessages-j3ALQmGG.js";
|
|
23
23
|
import { i as Et, t as Dt } from "./_chunks/utils-BegUBK7s.js";
|
|
24
|
-
import { t as Ot } from "./_chunks/PkChatbotInput-
|
|
24
|
+
import { t as Ot } from "./_chunks/PkChatbotInput-BbGLBVim.js";
|
|
25
25
|
import { t as kt } from "./_chunks/PkToolShowMultipleChoice-DZXfWtQp.js";
|
|
26
|
-
import { r as At, t as jt } from "./_chunks/PkToolShowContactForm-
|
|
26
|
+
import { r as At, t as jt } from "./_chunks/PkToolShowContactForm-BkgfSyw7.js";
|
|
27
27
|
import { t as Mt } from "./_chunks/PkToolShowSuggestedReply-30m9yWDL.js";
|
|
28
|
-
import { t as Nt } from "./_chunks/PkChatbotViewChat-
|
|
28
|
+
import { t as Nt } from "./_chunks/PkChatbotViewChat-Z05fqNFE.js";
|
|
29
29
|
import { t as Pt } from "./_chunks/PkToolShowLocation-DteWf0Cs.js";
|
|
30
|
-
import { t as Ft } from "./_chunks/PkChatbot-
|
|
30
|
+
import { t as Ft } from "./_chunks/PkChatbot-BEJTYq-D.js";
|
|
31
31
|
import { t as It } from "./_chunks/PkToolShowEmail-B7YiliCE.js";
|
|
32
32
|
import { t as Lt } from "./_chunks/PkToolShowMessage-ujP26Ae3.js";
|
|
33
33
|
import { t as Rt } from "./_chunks/PkToolShowWebPages-DZIdrdWs.js";
|
|
@@ -35,7 +35,7 @@ import { t as zt } from "./_chunks/PkToolShowProductList-CtqWK0x4.js";
|
|
|
35
35
|
import { t as Bt } from "./_chunks/PkToolShowCalendarEvent-DXRAzzKm.js";
|
|
36
36
|
import { t as Vt } from "./_chunks/PkToolShowComparison-CqN_pqBW.js";
|
|
37
37
|
import { t as Ht } from "./_chunks/PkToolShowQrCode-B4ex3m8i.js";
|
|
38
|
-
import { t as Ut } from "./_chunks/PkToolShowImageGallery-
|
|
38
|
+
import { t as Ut } from "./_chunks/PkToolShowImageGallery-Ckyxa0mx.js";
|
|
39
39
|
import { Fragment as A, Teleport as Wt, Transition as Gt, TransitionGroup as Kt, cloneVNode as qt, computed as j, createApp as Jt, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createSlots as Yt, createStaticVNode as Xt, createTextVNode as Zt, createVNode as I, defineComponent as L, effectScope as Qt, guardReactiveProps as $t, h as en, inject as R, isRef as tn, isVNode as nn, mergeModels as rn, mergeProps as an, nextTick as on, normalizeClass as sn, normalizeProps as cn, normalizeStyle as ln, onBeforeUnmount as un, onMounted as z, onUnmounted as dn, openBlock as B, provide as fn, reactive as pn, readonly as mn, ref as V, renderList as hn, renderSlot as gn, resolveComponent as _n, resolveDynamicComponent as vn, shallowRef as yn, toDisplayString as H, toRef as bn, toRefs as xn, toValue as Sn, unref as U, useId as Cn, useModel as W, useSlots as wn, useTemplateRef as Tn, vModelSelect as En, vModelText as Dn, vShow as On, watch as G, withCtx as K, withDirectives as kn, withModifiers as An } from "vue";
|
|
40
40
|
import { VvAccordion as jn, VvButton as Mn, VvButtonGroup as Nn, VvCheckbox as Pn, VvCombobox as Fn, VvDialog as In, VvIcon as Ln, VvInputFile as Rn, VvInputText as zn, VvRadio as Bn, VvRadioGroup as Vn, VvTab as Hn } from "@volverjs/ui-vue/components";
|
|
41
41
|
import { EditorContent as Un, useEditor as Wn } from "@tiptap/vue-3";
|
|
@@ -21,12 +21,12 @@ type __VLS_Props = {
|
|
|
21
21
|
feedbackSubmitted?: boolean;
|
|
22
22
|
feedbackError?: string;
|
|
23
23
|
};
|
|
24
|
-
declare var
|
|
24
|
+
declare var __VLS_7: {
|
|
25
25
|
message: UIChatMessage;
|
|
26
26
|
part: TextUIPart;
|
|
27
27
|
index: number;
|
|
28
28
|
isLoading: boolean;
|
|
29
|
-
},
|
|
29
|
+
}, __VLS_37: `tool-${string}`, __VLS_38: {
|
|
30
30
|
message: UIChatMessage;
|
|
31
31
|
part: ({
|
|
32
32
|
type: `tool-${string}`;
|
|
@@ -146,12 +146,11 @@ declare var __VLS_1: {
|
|
|
146
146
|
});
|
|
147
147
|
index: number;
|
|
148
148
|
isLoading: boolean;
|
|
149
|
-
key: string;
|
|
150
149
|
};
|
|
151
150
|
type __VLS_Slots = {} & {
|
|
152
|
-
[K in NonNullable<typeof
|
|
151
|
+
[K in NonNullable<typeof __VLS_37>]?: (props: typeof __VLS_38) => any;
|
|
153
152
|
} & {
|
|
154
|
-
text?: (props: typeof
|
|
153
|
+
text?: (props: typeof __VLS_7) => any;
|
|
155
154
|
};
|
|
156
155
|
declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
157
156
|
upvote: (message: UIChatMessage) => any;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
export type StreamingAnimation = 'fadeIn' | 'blurIn' | 'dropIn' | 'slideUp' | 'fadeAndScale' | null;
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
markdown?: string;
|
|
4
5
|
loading?: boolean;
|
|
6
|
+
animation?: StreamingAnimation;
|
|
7
|
+
animationDuration?: string;
|
|
5
8
|
};
|
|
6
|
-
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
loading: boolean;
|
|
11
|
+
markdown: string;
|
|
12
|
+
animation: StreamingAnimation;
|
|
13
|
+
animationDuration: string;
|
|
14
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
7
15
|
declare const _default: typeof __VLS_export;
|
|
8
16
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Ref, ShallowRef } from 'vue';
|
|
2
|
+
interface UseChatScrollOptions {
|
|
3
|
+
scrollEl: Readonly<ShallowRef<HTMLDivElement | null>> | Ref<HTMLDivElement | undefined>;
|
|
4
|
+
status: () => string | undefined;
|
|
5
|
+
messagesLength: () => number | undefined;
|
|
6
|
+
lastMessageRole: () => string | undefined;
|
|
7
|
+
onScrollUp?: () => void;
|
|
8
|
+
onScrollDown?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useChatScroll(options: UseChatScrollOptions): {
|
|
11
|
+
handleScroll: () => void;
|
|
12
|
+
scrollToBottom: (behavior?: ScrollBehavior) => void;
|
|
13
|
+
userScrolledUp: Ref<boolean, boolean>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|