@8wave/ai-elements 0.101.0-beta.1 → 0.101.0-beta.2
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-elements.es.js +590 -559
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/_chunks/PkChatbot-OT6Vj9xn.js +264 -0
- package/dist-vue/_chunks/PkChatbot-OT6Vj9xn.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-Cj974POl.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-BhwV8BzI.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-Dmv8R7EN.js → PkChatbotViewConversations-EuLSiakV.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-Dmv8R7EN.js.map → PkChatbotViewConversations-EuLSiakV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DKuu-7Hw.js → PkChatbotViewFiles-CIr-0xpK.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-DKuu-7Hw.js.map → PkChatbotViewFiles-CIr-0xpK.js.map} +1 -1
- package/dist-vue/_chunks/{useDialogConfirm-DaoekZdk.js → useDialogConfirm-CMTIKoWn.js} +12 -11
- package/dist-vue/_chunks/useDialogConfirm-CMTIKoWn.js.map +1 -0
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +3 -3
- package/dist-vue/apps/web-component/src/lib.d.ts +3 -1
- package/dist-vue/index.js +6 -6
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +9 -9
- package/dist-vue/packages/components/src/chat/PkChatbotViewChat.d.ts +2 -2
- package/dist-vue/packages/composable/src/useDialog.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +7 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbot-BraWzebX.js +0 -236
- package/dist-vue/_chunks/PkChatbot-BraWzebX.js.map +0 -1
- package/dist-vue/_chunks/useDialogConfirm-DaoekZdk.js.map +0 -1
package/dist-vue/_chunks/{PkChatbotViewFiles-DKuu-7Hw.js.map → PkChatbotViewFiles-CIr-0xpK.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkChatbotViewFiles-DKuu-7Hw.js","names":[],"sources":["../../../../packages/composable/src/useFileRow.ts","../../../../packages/components/src/chat/PkChatbotViewFiles.vue","../../../../packages/components/src/chat/PkChatbotViewFiles.vue"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport { isImageMime, isInlineViewable } from 'models'\nimport { useImageFallback } from './useImageFallback'\n\n/** Minimal shape a file-list row needs for the shared display helpers. */\nexport interface FileRowLike {\n documentId: string\n mimeType: string | null\n}\n\n/**\n * Shared display logic for the user-files list rows, used by both the in-app\n * table (PjUserFilesTable) and the embedded widget (PkChatbotViewFiles). The two\n * surfaces differ only in how they build URLs (authenticated store vs widget API\n * client), so the URL builders are injected.\n *\n * - `view(id, inline)` → opens/downloads the original file.\n * - `preview(id)` → small resized blob for the row thumbnail.\n */\nexport function useFileRow(urls: {\n view: (documentId: string, inline: boolean) => string\n preview: (documentId: string) => string\n}) {\n const { locale } = useI18n({ useScope: 'global' })\n\n // Image rows show a thumbnail; if it fails to load (auth/redirect, or the\n // preview isn't generated yet) we fall back to the file-type icon.\n const { canShowImage, onImageError } = useImageFallback()\n const thumbUrl = (file: FileRowLike): string =>\n urls.preview(file.documentId)\n const showThumb = (file: FileRowLike): boolean =>\n isImageMime(file.mimeType) && canShowImage(thumbUrl(file))\n const onThumbError = (file: FileRowLike): void => {\n onImageError(thumbUrl(file))\n }\n\n // Name click previews images/PDF inline; an explicit download forces an\n // attachment (inline=false → download SAS).\n const openFile = (file: FileRowLike, download = false): void => {\n const inline = !download && isInlineViewable(file.mimeType)\n window.open(urls.view(file.documentId, inline), '_blank', 'noopener')\n }\n\n const formatDate = (iso: string): string =>\n new Date(iso).toLocaleDateString(locale.value, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n\n return { showThumb, thumbUrl, onThumbError, openFile, formatDate }\n}\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm({\n title: $t('userFiles.excludeTitle'),\n questionLabel: $t('userFiles.excludeConfirm'),\n })\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"flex flex-col gap-8 p-16 vv-skeleton\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-skeleton__item rounded-md h-56\" />\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <ul v-else class=\"pk-chatbot-files\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"pk-chatbot-files__item\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon v-else :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <button\n type=\"button\"\n class=\"pk-chatbot-files__main\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__name\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"pk-chatbot-files__date\">\n {{ formatDate(file.createdAt) }}\n </span>\n </button>\n <div class=\"pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet xs\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-danger xs\"\n icon=\"ri:delete-bin-line\"\n :title=\"$t('userFiles.exclude')\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-files {\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: var(--spacing-8);\n overflow-y: auto;\n\n &__item {\n display: flex;\n align-items: center;\n gap: var(--spacing-10);\n padding: var(--spacing-8) var(--spacing-10);\n border-radius: var(--rounded-md);\n transition: var(--transition-colors);\n\n // Separator between files\n & + & {\n border-top: 1px solid var(--color-surface-3);\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n background-color: var(--color-surface-1);\n color: var(--color-word-3);\n overflow: hidden;\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__main {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: 1;\n text-align: left;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n }\n\n &__name {\n font-size: var(--text-14);\n color: var(--color-word-1);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &__date {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__actions {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n flex-shrink: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm({\n title: $t('userFiles.excludeTitle'),\n questionLabel: $t('userFiles.excludeConfirm'),\n })\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"flex flex-col gap-8 p-16 vv-skeleton\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-skeleton__item rounded-md h-56\" />\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <ul v-else class=\"pk-chatbot-files\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"pk-chatbot-files__item\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon v-else :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <button\n type=\"button\"\n class=\"pk-chatbot-files__main\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__name\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"pk-chatbot-files__date\">\n {{ formatDate(file.createdAt) }}\n </span>\n </button>\n <div class=\"pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet xs\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-danger xs\"\n icon=\"ri:delete-bin-line\"\n :title=\"$t('userFiles.exclude')\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-files {\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: var(--spacing-8);\n overflow-y: auto;\n\n &__item {\n display: flex;\n align-items: center;\n gap: var(--spacing-10);\n padding: var(--spacing-8) var(--spacing-10);\n border-radius: var(--rounded-md);\n transition: var(--transition-colors);\n\n // Separator between files\n & + & {\n border-top: 1px solid var(--color-surface-3);\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n background-color: var(--color-surface-1);\n color: var(--color-word-3);\n overflow: hidden;\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__main {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: 1;\n text-align: left;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n }\n\n &__name {\n font-size: var(--text-14);\n color: var(--color-word-1);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &__date {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__actions {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n flex-shrink: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,EAAW,GAGxB;CACC,IAAM,EAAE,cAAW,EAAQ,EAAE,UAAU,SAAS,CAAC,GAI3C,EAAE,iBAAc,oBAAiB,EAAiB,GAClD,KAAY,MACd,EAAK,QAAQ,EAAK,UAAU;CAqBhC,OAAO;EAAE,YApBU,MACf,EAAY,EAAK,QAAQ,KAAK,EAAa,EAAS,CAAI,CAAC;EAmBzC;EAAU,eAlBR,MAA4B;GAC9C,EAAa,EAAS,CAAI,CAAC;EAC/B;EAgB4C,WAZ1B,GAAmB,IAAW,OAAgB;GAC5D,IAAM,IAAS,CAAC,KAAY,EAAiB,EAAK,QAAQ;GAC1D,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;KAC7B,UAAU,EAAA,UAAe,EAAK;KAC9B,UAAK,MAAE,EAAc,CAAI"}
|
|
1
|
+
{"version":3,"file":"PkChatbotViewFiles-CIr-0xpK.js","names":[],"sources":["../../../../packages/composable/src/useFileRow.ts","../../../../packages/components/src/chat/PkChatbotViewFiles.vue","../../../../packages/components/src/chat/PkChatbotViewFiles.vue"],"sourcesContent":["import { useI18n } from 'vue-i18n'\nimport { isImageMime, isInlineViewable } from 'models'\nimport { useImageFallback } from './useImageFallback'\n\n/** Minimal shape a file-list row needs for the shared display helpers. */\nexport interface FileRowLike {\n documentId: string\n mimeType: string | null\n}\n\n/**\n * Shared display logic for the user-files list rows, used by both the in-app\n * table (PjUserFilesTable) and the embedded widget (PkChatbotViewFiles). The two\n * surfaces differ only in how they build URLs (authenticated store vs widget API\n * client), so the URL builders are injected.\n *\n * - `view(id, inline)` → opens/downloads the original file.\n * - `preview(id)` → small resized blob for the row thumbnail.\n */\nexport function useFileRow(urls: {\n view: (documentId: string, inline: boolean) => string\n preview: (documentId: string) => string\n}) {\n const { locale } = useI18n({ useScope: 'global' })\n\n // Image rows show a thumbnail; if it fails to load (auth/redirect, or the\n // preview isn't generated yet) we fall back to the file-type icon.\n const { canShowImage, onImageError } = useImageFallback()\n const thumbUrl = (file: FileRowLike): string =>\n urls.preview(file.documentId)\n const showThumb = (file: FileRowLike): boolean =>\n isImageMime(file.mimeType) && canShowImage(thumbUrl(file))\n const onThumbError = (file: FileRowLike): void => {\n onImageError(thumbUrl(file))\n }\n\n // Name click previews images/PDF inline; an explicit download forces an\n // attachment (inline=false → download SAS).\n const openFile = (file: FileRowLike, download = false): void => {\n const inline = !download && isInlineViewable(file.mimeType)\n window.open(urls.view(file.documentId, inline), '_blank', 'noopener')\n }\n\n const formatDate = (iso: string): string =>\n new Date(iso).toLocaleDateString(locale.value, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n })\n\n return { showThumb, thumbUrl, onThumbError, openFile, formatDate }\n}\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm({\n title: $t('userFiles.excludeTitle'),\n questionLabel: $t('userFiles.excludeConfirm'),\n })\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"flex flex-col gap-8 p-16 vv-skeleton\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-skeleton__item rounded-md h-56\" />\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <ul v-else class=\"pk-chatbot-files\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"pk-chatbot-files__item\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon v-else :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <button\n type=\"button\"\n class=\"pk-chatbot-files__main\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__name\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"pk-chatbot-files__date\">\n {{ formatDate(file.createdAt) }}\n </span>\n </button>\n <div class=\"pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet xs\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-danger xs\"\n icon=\"ri:delete-bin-line\"\n :title=\"$t('userFiles.exclude')\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-files {\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: var(--spacing-8);\n overflow-y: auto;\n\n &__item {\n display: flex;\n align-items: center;\n gap: var(--spacing-10);\n padding: var(--spacing-8) var(--spacing-10);\n border-radius: var(--rounded-md);\n transition: var(--transition-colors);\n\n // Separator between files\n & + & {\n border-top: 1px solid var(--color-surface-3);\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n background-color: var(--color-surface-1);\n color: var(--color-word-3);\n overflow: hidden;\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__main {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: 1;\n text-align: left;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n }\n\n &__name {\n font-size: var(--text-14);\n color: var(--color-word-1);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &__date {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__actions {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n flex-shrink: 0;\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { ref } from 'vue'\n import { storeToRefs } from 'pinia'\n import { useI18n } from 'vue-i18n'\n import { fileIconForMime } from 'models'\n import {\n useChatbotStore,\n useDialogConfirm,\n useFileRow,\n type ChatbotFile,\n } from 'composables'\n\n const props = defineProps<{ agentId: string }>()\n\n const { t: $t } = useI18n({ useScope: 'global' })\n const { openDialogConfirm } = useDialogConfirm()\n\n const store = useChatbotStore(props.agentId)\n const { chatFiles, isLoadingChatFiles } = storeToRefs(store)\n const { showThumb, thumbUrl, onThumbError, openFile, formatDate } =\n useFileRow({\n view: store.getChatFileUrl,\n preview: store.getChatFilePreviewUrl,\n })\n\n const deletingId = ref<string | null>(null)\n\n const handleExclude = async (file: ChatbotFile) => {\n const proceed = await openDialogConfirm({\n title: $t('userFiles.excludeTitle'),\n questionLabel: $t('userFiles.excludeConfirm'),\n })\n if (!proceed) {\n return\n }\n deletingId.value = file.documentId\n try {\n await store.deleteChatFile(file.documentId)\n } catch {\n // surfaced by the host's error handling\n } finally {\n deletingId.value = null\n }\n }\n</script>\n\n<template>\n <div class=\"flex flex-col flex-1 min-h-0 relative\">\n <!-- Loading skeleton -->\n <div\n v-if=\"isLoadingChatFiles && chatFiles.length === 0\"\n class=\"flex flex-col gap-8 p-16 vv-skeleton\">\n <div\n v-for=\"i in 4\"\n :key=\"i\"\n class=\"vv-skeleton__item rounded-md h-56\" />\n </div>\n\n <!-- Empty state -->\n <div\n v-else-if=\"chatFiles.length === 0\"\n class=\"flex flex-col flex-1 items-center justify-center gap-12 p-24 text-center\">\n <div\n class=\"w-64 h-64 rounded-full bg-surface-1 border border-surface-3 flex items-center justify-center\">\n <VvIcon\n name=\"ri:folder-open-line\"\n class=\"w-28 h-28 text-word-4\" />\n </div>\n <span class=\"text-14 text-word-3 leading-relaxed\">\n {{ $t('userFiles.chatFilesEmpty') }}\n </span>\n </div>\n\n <!-- File list -->\n <ul v-else class=\"pk-chatbot-files\">\n <li\n v-for=\"file in chatFiles\"\n :key=\"file.documentId\"\n class=\"pk-chatbot-files__item\">\n <span class=\"pk-chatbot-files__icon\">\n <img\n v-if=\"showThumb(file)\"\n :src=\"thumbUrl(file)\"\n loading=\"lazy\"\n decoding=\"async\"\n alt=\"\"\n class=\"pk-chatbot-files__thumb\"\n @error=\"onThumbError(file)\" />\n <VvIcon v-else :name=\"fileIconForMime(file.mimeType)\" />\n </span>\n <button\n type=\"button\"\n class=\"pk-chatbot-files__main\"\n :title=\"$t('userFiles.open')\"\n @click=\"openFile(file)\">\n <span class=\"pk-chatbot-files__name\">\n {{ file.name || $t('userFiles.untitled') }}\n </span>\n <span class=\"pk-chatbot-files__date\">\n {{ formatDate(file.createdAt) }}\n </span>\n </button>\n <div class=\"pk-chatbot-files__actions\">\n <VvButton\n modifiers=\"action-quiet xs\"\n icon=\"ri:download-line\"\n :title=\"$t('action.download')\"\n @click=\"openFile(file, true)\" />\n <VvButton\n modifiers=\"action-quiet-danger xs\"\n icon=\"ri:delete-bin-line\"\n :title=\"$t('userFiles.exclude')\"\n :loading=\"deletingId === file.documentId\"\n :disabled=\"deletingId === file.documentId\"\n @click=\"handleExclude(file)\" />\n </div>\n </li>\n </ul>\n </div>\n</template>\n\n<style lang=\"scss\">\n .pk-chatbot-files {\n display: flex;\n flex-direction: column;\n list-style: none;\n margin: 0;\n padding: var(--spacing-8);\n overflow-y: auto;\n\n &__item {\n display: flex;\n align-items: center;\n gap: var(--spacing-10);\n padding: var(--spacing-8) var(--spacing-10);\n border-radius: var(--rounded-md);\n transition: var(--transition-colors);\n\n // Separator between files\n & + & {\n border-top: 1px solid var(--color-surface-3);\n }\n\n &:hover {\n background-color: var(--color-surface-2);\n }\n }\n\n &__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--spacing-36);\n height: var(--spacing-36);\n flex-shrink: 0;\n border-radius: var(--rounded-md);\n background-color: var(--color-surface-1);\n color: var(--color-word-3);\n overflow: hidden;\n }\n\n &__thumb {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n &__main {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: 1;\n text-align: left;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n }\n\n &__name {\n font-size: var(--text-14);\n color: var(--color-word-1);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &__date {\n font-size: var(--text-12);\n color: var(--color-word-3);\n }\n\n &__actions {\n display: flex;\n align-items: center;\n gap: var(--spacing-2);\n flex-shrink: 0;\n }\n }\n</style>\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,EAAW,GAGxB;CACC,IAAM,EAAE,cAAW,EAAQ,EAAE,UAAU,SAAS,CAAC,GAI3C,EAAE,iBAAc,oBAAiB,EAAiB,GAClD,KAAY,MACd,EAAK,QAAQ,EAAK,UAAU;CAqBhC,OAAO;EAAE,YApBU,MACf,EAAY,EAAK,QAAQ,KAAK,EAAa,EAAS,CAAI,CAAC;EAmBzC;EAAU,eAlBR,MAA4B;GAC9C,EAAa,EAAS,CAAI,CAAC;EAC/B;EAgB4C,WAZ1B,GAAmB,IAAW,OAAgB;GAC5D,IAAM,IAAS,CAAC,KAAY,EAAiB,EAAK,QAAQ;GAC1D,OAAO,KAAK,EAAK,KAAK,EAAK,YAAY,CAAM,GAAG,UAAU,UAAU;EACxE;EASsD,aAPlC,MAChB,IAAI,KAAK,CAAG,CAAC,CAAC,mBAAmB,EAAO,OAAO;GAC3C,MAAM;GACN,OAAO;GACP,KAAK;EACT,CAAC;CAE4D;AACrE;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3
3
|
import { useI18n as c } from "vue-i18n";
|
|
4
4
|
//#region ../../packages/composable/src/useDialog.ts
|
|
5
|
-
var l = s(!1), u = s(), d = s(), f = s(), p = s(
|
|
5
|
+
var l = s(!1), u = s(), d = s(), f = s(), p = s(), m = s(!1), h = s(), g = s(), _ = () => {
|
|
6
6
|
let e = (e) => {
|
|
7
7
|
l.value = e;
|
|
8
8
|
}, t = () => {
|
|
9
|
-
u.value = void 0, d.value = void 0, f.value = void 0, p.value = void 0, m.value = void 0, h.value = void 0;
|
|
9
|
+
u.value = void 0, d.value = void 0, f.value = void 0, p.value = void 0, m.value = void 0, h.value = void 0, g.value = void 0;
|
|
10
10
|
};
|
|
11
11
|
return {
|
|
12
12
|
PkGlobalDialog: i({
|
|
@@ -15,20 +15,21 @@ var l = s(!1), u = s(), d = s(), f = s(), p = s(!1), m = s(), h = s(), g = () =>
|
|
|
15
15
|
modelValue: l.value,
|
|
16
16
|
title: u.value,
|
|
17
17
|
transition: d.value,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
modifiers: f.value,
|
|
19
|
+
size: p.value,
|
|
20
|
+
keepOpen: m.value,
|
|
21
|
+
role: h.value,
|
|
21
22
|
"onUpdate:modelValue": e,
|
|
22
23
|
onAfterLeave: t
|
|
23
|
-
},
|
|
24
|
+
}, g.value)
|
|
24
25
|
}),
|
|
25
|
-
openDialog: (e, t) => (u.value = e?.title, d.value = e?.transition, f.value = e?.
|
|
26
|
+
openDialog: (e, t) => (u.value = e?.title, d.value = e?.transition, f.value = e?.modifiers, p.value = e?.size, m.value = e?.keepOpen ?? !1, h.value = e?.role, g.value = t, o(() => {
|
|
26
27
|
l.value = !0;
|
|
27
28
|
}), l),
|
|
28
29
|
isOpen: l
|
|
29
30
|
};
|
|
30
|
-
},
|
|
31
|
-
let { openDialog: n } =
|
|
31
|
+
}, v = () => {
|
|
32
|
+
let { openDialog: n } = _(), { t: i } = c({ useScope: "global" });
|
|
32
33
|
return { openDialogConfirm: ({ emitReject: o = !1, confirmLabel: c, cancelLabel: l, questionLabel: u, onlyConfirm: d = !1, passphrase: f, passphraseLabel: p, passphraseHint: m, title: h } = {}) => new Promise((g, _) => {
|
|
33
34
|
let v = s(), y = n({
|
|
34
35
|
role: "alertdialog",
|
|
@@ -71,6 +72,6 @@ var l = s(!1), u = s(), d = s(), f = s(), p = s(!1), m = s(), h = s(), g = () =>
|
|
|
71
72
|
}) };
|
|
72
73
|
};
|
|
73
74
|
//#endregion
|
|
74
|
-
export {
|
|
75
|
+
export { v as t };
|
|
75
76
|
|
|
76
|
-
//# sourceMappingURL=useDialogConfirm-
|
|
77
|
+
//# sourceMappingURL=useDialogConfirm-CMTIKoWn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDialogConfirm-CMTIKoWn.js","names":[],"sources":["../../../../packages/composable/src/useDialog.ts","../../../../packages/composable/src/useDialogConfirm.ts"],"sourcesContent":["import { VvDialog } from '@volverjs/ui-vue/components'\nimport { defineComponent, h, nextTick, ref, type VNode } from 'vue'\n\ntype DialogProps = {\n title?: string\n transition?: string\n modifiers?: string | string[]\n /** @deprecated use modifiers instead */\n size?: 'small' | 'standard' | 'fullscreen'\n role?: 'alert' | 'alertdialog'\n keepOpen?: boolean\n}\n\ntype DialogSlots = {\n footer?: () => VNode | string\n header?: () => VNode | string\n default?: () => VNode | string | VNode[] | string[]\n}\n\nconst isOpen = ref(false)\nconst title = ref<DialogProps['title']>()\nconst transition = ref<DialogProps['transition']>()\nconst modifiers = ref<DialogProps['modifiers']>()\nconst size = ref<DialogProps['size']>()\nconst keepOpen = ref<DialogProps['keepOpen']>(false)\nconst role = ref<DialogProps['role']>()\nconst slots = ref<DialogSlots>()\n\nexport const useDialog = () => {\n const onUpdateModelValue = (value: boolean) => {\n isOpen.value = value\n }\n\n const onAfterLeave = () => {\n title.value = undefined\n transition.value = undefined\n modifiers.value = undefined\n size.value = undefined\n keepOpen.value = undefined\n role.value = undefined\n slots.value = undefined\n }\n\n const PkGlobalDialog = defineComponent({\n name: 'PkGlobalDialog',\n render: () =>\n h(\n VvDialog,\n {\n modelValue: isOpen.value,\n title: title.value,\n transition: transition.value,\n modifiers: modifiers.value,\n size: size.value,\n keepOpen: keepOpen.value,\n role: role.value,\n 'onUpdate:modelValue': onUpdateModelValue,\n onAfterLeave: onAfterLeave,\n },\n slots.value,\n ),\n })\n\n const openDialog = (newProps: DialogProps, newSlots?: DialogSlots) => {\n title.value = newProps?.title\n transition.value = newProps?.transition\n modifiers.value = newProps?.modifiers\n size.value = newProps?.size\n keepOpen.value = newProps?.keepOpen ?? false\n role.value = newProps?.role\n slots.value = newSlots\n nextTick(() => {\n isOpen.value = true\n })\n return isOpen\n }\n\n return { PkGlobalDialog, openDialog, isOpen }\n}\n","import { h, ref, VNode } from 'vue'\nimport { useI18n } from 'vue-i18n'\nimport {\n VvButton,\n VvButtonGroup,\n VvInputText,\n} from '@volverjs/ui-vue/components'\nimport { useDialog } from './useDialog'\n\nexport const useDialogConfirm = () => {\n const { openDialog } = useDialog()\n const { t: $t } = useI18n({\n useScope: 'global',\n })\n\n const openDialogConfirm = ({\n emitReject = false,\n confirmLabel,\n cancelLabel,\n questionLabel,\n onlyConfirm = false,\n passphrase,\n passphraseLabel,\n passphraseHint,\n title,\n }: {\n emitReject?: boolean\n confirmLabel?: string\n cancelLabel?: string\n questionLabel?: string\n onlyConfirm?: boolean\n passphrase?: string\n passphraseLabel?: string\n passphraseHint?: string\n title?: string\n } = {}) => {\n return new Promise<boolean>((resolve, reject) => {\n const passphraseText = ref<string>()\n const isOpen = openDialog(\n {\n role: 'alertdialog',\n size: 'small',\n keepOpen: true,\n title,\n },\n {\n default: () =>\n h('div', [\n h(\n 'div',\n {\n class: 'mb-sm',\n style: 'white-space: pre-line',\n },\n questionLabel ?? $t('message.confirm'),\n ),\n passphrase\n ? h(VvInputText, {\n modelValue: passphraseText.value,\n 'onUpdate:modelValue': (\n value: string,\n ) => {\n passphraseText.value = value\n },\n type: 'text',\n name: 'passphrase',\n class: 'mb-0',\n floating: true,\n label:\n passphraseLabel ??\n $t('label.passphrase'),\n hintLabel:\n passphraseHint ??\n $t('hint.passphrase', { passphrase }),\n })\n : undefined,\n ]),\n footer: () =>\n h(VvButtonGroup, () => {\n const toReturn: VNode[] = []\n if (!onlyConfirm) {\n toReturn.push(\n h(VvButton, {\n label:\n cancelLabel ?? $t('action.cancel'),\n modifiers: 'ghost',\n onClick: () => {\n if (emitReject) {\n reject()\n }\n resolve(false)\n isOpen.value = false\n },\n }),\n )\n }\n toReturn.push(\n h(VvButton, {\n label: confirmLabel ?? $t('action.proceed'),\n disabled: passphrase\n ? passphrase !== passphraseText.value\n : false,\n onClick: () => {\n resolve(true)\n isOpen.value = false\n },\n }),\n )\n return toReturn\n }),\n },\n )\n })\n }\n\n return { openDialogConfirm }\n}\n"],"mappings":";;;;AAmBA,IAAM,IAAS,EAAI,EAAK,GAClB,IAAQ,EAA0B,GAClC,IAAa,EAA+B,GAC5C,IAAY,EAA8B,GAC1C,IAAO,EAAyB,GAChC,IAAW,EAA6B,EAAK,GAC7C,IAAO,EAAyB,GAChC,IAAQ,EAAiB,GAElB,UAAkB;CAC3B,IAAM,KAAsB,MAAmB;EAC3C,EAAO,QAAQ;CACnB,GAEM,UAAqB;EAOvB,AANA,EAAM,QAAQ,KAAA,GACd,EAAW,QAAQ,KAAA,GACnB,EAAU,QAAQ,KAAA,GAClB,EAAK,QAAQ,KAAA,GACb,EAAS,QAAQ,KAAA,GACjB,EAAK,QAAQ,KAAA,GACb,EAAM,QAAQ,KAAA;CAClB;CAoCA,OAAO;EAAE,gBAlCc,EAAgB;GACnC,MAAM;GACN,cACI,EACI,GACA;IACI,YAAY,EAAO;IACnB,OAAO,EAAM;IACb,YAAY,EAAW;IACvB,WAAW,EAAU;IACrB,MAAM,EAAK;IACX,UAAU,EAAS;IACnB,MAAM,EAAK;IACX,uBAAuB;IACT;GAClB,GACA,EAAM,KACV;EACR,CAgBS;EAAg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,EAAe,QAC9B;KACN,eAAe;MAEX,AADA,EAAQ,EAAI,GACZ,EAAO,QAAQ;KACnB;IACJ,CAAC,CACL,GACO;GACX,CAAC;EACT,CACJ;CACJ,CAAC,EAGsB;AAC/B"}
|
|
@@ -18,8 +18,8 @@ type __VLS_Props = {
|
|
|
18
18
|
appinsightsConnectionString?: string;
|
|
19
19
|
/** Override the session/anonymous cookie name (defaults to 'eight-wave-ai'). */
|
|
20
20
|
cookieName?: string;
|
|
21
|
-
/** Layout mode: `widget` (default, contained with header)
|
|
22
|
-
displayMode?: 'widget' | 'fullscreen';
|
|
21
|
+
/** Layout mode: `widget` (default, contained with header), `fullscreen` (full-page app layout) or `panel` (compact chrome for a docked side panel; the host owns background, border and open/close). */
|
|
22
|
+
displayMode?: 'widget' | 'fullscreen' | 'panel';
|
|
23
23
|
/**
|
|
24
24
|
* Force the chat color scheme instead of following the OS
|
|
25
25
|
* `prefers-color-scheme`. Let a host app hand down its own theme.
|
|
@@ -50,7 +50,7 @@ declare const __VLS_base: DefineComponent<__VLS_Props, {
|
|
|
50
50
|
forwardedSlots: string;
|
|
51
51
|
appinsightsConnectionString: string;
|
|
52
52
|
cookieName: string;
|
|
53
|
-
displayMode: "widget" | "fullscreen";
|
|
53
|
+
displayMode: "widget" | "fullscreen" | "panel";
|
|
54
54
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
55
55
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
56
56
|
declare const _default: typeof __VLS_export;
|
|
@@ -25,7 +25,7 @@ export declare const EmbeddedChatWidgetCe: VueElementConstructor<{
|
|
|
25
25
|
customCss?: string;
|
|
26
26
|
appinsightsConnectionString?: string;
|
|
27
27
|
cookieName?: string;
|
|
28
|
-
displayMode?: "widget" | "fullscreen";
|
|
28
|
+
displayMode?: "widget" | "fullscreen" | "panel";
|
|
29
29
|
systemTheme?: "light" | "dark";
|
|
30
30
|
}>;
|
|
31
31
|
declare module 'vue' {
|
|
@@ -65,6 +65,8 @@ export interface EmbeddedChatWidgetElement extends HTMLElement {
|
|
|
65
65
|
awaitExternalToken?: boolean;
|
|
66
66
|
/** Host-session mode: use the host platform's better-auth session from the cookie (no widget sign-in). */
|
|
67
67
|
useHostSession?: boolean;
|
|
68
|
+
/** Layout mode: `widget` (default), `fullscreen` (full-page app layout) or `panel` (compact chrome for a docked side panel; the host owns background, border and open/close). */
|
|
69
|
+
displayMode?: 'widget' | 'fullscreen' | 'panel';
|
|
68
70
|
forwardedSlots?: string;
|
|
69
71
|
customCss?: string;
|
|
70
72
|
appinsightsConnectionString?: string;
|
package/dist-vue/index.js
CHANGED
|
@@ -13,8 +13,8 @@ import "./_chunks/src-8QXYVWIx.js";
|
|
|
13
13
|
import { c as ue, i as de, s as fe } from "./_chunks/message-RohfrdWS.js";
|
|
14
14
|
import { n as pe, r as me, t as he } from "./_chunks/text-CeT0hpJK.js";
|
|
15
15
|
import { t as ge } from "./_chunks/useSafeLocalStorage-BGbMO01p.js";
|
|
16
|
-
import { t as _e } from "./_chunks/useDialogConfirm-
|
|
17
|
-
import { n as ve, r as ye, t as be } from "./_chunks/PkChatbotViewConversations-
|
|
16
|
+
import { t as _e } from "./_chunks/useDialogConfirm-CMTIKoWn.js";
|
|
17
|
+
import { n as ve, r as ye, t as be } from "./_chunks/PkChatbotViewConversations-EuLSiakV.js";
|
|
18
18
|
import { n as xe, t as Se } from "./_chunks/PkChatbotViewChat-BhwV8BzI.js";
|
|
19
19
|
import { t as Ce } from "./_chunks/useImageFallback-5vQIO0pC.js";
|
|
20
20
|
import { t as we } from "./_chunks/useLocalizedString-PfaKjIQY.js";
|
|
@@ -37,7 +37,7 @@ import { t as Ft } from "./_chunks/PkChatbotStepToolDetail-BkbRw7gv.js";
|
|
|
37
37
|
import { t as It } from "./_chunks/PkChatbotInput-CTOD4NvY.js";
|
|
38
38
|
import { t as Lt } from "./_chunks/PkChatbotEmptyState-BIwl8t4L.js";
|
|
39
39
|
import { t as Rt } from "./_chunks/PkChatbotViewProfile-CIO0mBFM.js";
|
|
40
|
-
import { t as zt } from "./_chunks/PkChatbot-
|
|
40
|
+
import { t as zt } from "./_chunks/PkChatbot-OT6Vj9xn.js";
|
|
41
41
|
import { i as Bt, r as Vt, t as Ht } from "./_chunks/PkToolShowSources-pzxvqAyh.js";
|
|
42
42
|
import { t as Ut } from "./_chunks/PkToolShowEmail-C591LR5N.js";
|
|
43
43
|
import { t as Wt } from "./_chunks/PkToolShowMessage-CbXERPHI.js";
|
|
@@ -414,7 +414,7 @@ var Gr = Ur, Kr = { class: "flex items-center gap-4 mb-4" }, qr = { class: "font
|
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
416
|
//#endregion
|
|
417
|
-
//#region virtual:intlify-i18n-
|
|
417
|
+
//#region virtual:intlify-i18n-4
|
|
418
418
|
function $r(e) {
|
|
419
419
|
let t = e;
|
|
420
420
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
@@ -14409,7 +14409,7 @@ var jy = /*#__PURE__*/ Oy(ky, [["render", Ay]]), My = {
|
|
|
14409
14409
|
}
|
|
14410
14410
|
});
|
|
14411
14411
|
//#endregion
|
|
14412
|
-
//#region virtual:intlify-i18n-
|
|
14412
|
+
//#region virtual:intlify-i18n-2
|
|
14413
14413
|
function Vy(e) {
|
|
14414
14414
|
let t = e;
|
|
14415
14415
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
@@ -14596,7 +14596,7 @@ var Hy = By, Uy = { class: "block text-smaller mt-4" }, Wy = { class: "block tex
|
|
|
14596
14596
|
}
|
|
14597
14597
|
});
|
|
14598
14598
|
//#endregion
|
|
14599
|
-
//#region virtual:intlify-i18n-
|
|
14599
|
+
//#region virtual:intlify-i18n-3
|
|
14600
14600
|
function Jy(e) {
|
|
14601
14601
|
let t = e;
|
|
14602
14602
|
t.__i18n = t.__i18n || [], t.__i18n.push({
|
|
@@ -20,8 +20,8 @@ type __VLS_Props = {
|
|
|
20
20
|
fallbackModels?: string[];
|
|
21
21
|
gatewayOptions?: Partial<AgentGatewayOptions>;
|
|
22
22
|
externalContext?: Record<string, unknown>;
|
|
23
|
-
/** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome) */
|
|
24
|
-
modifier?: 'widget' | 'fullscreen';
|
|
23
|
+
/** Layout modifier: `widget` (default) keeps the contained layout with header, `fullscreen` removes header/background for full-page usage (the page provides the chrome), `panel` keeps the header but slims it down for a docked side panel (the host provides background and border) */
|
|
24
|
+
modifier?: 'widget' | 'fullscreen' | 'panel';
|
|
25
25
|
/** Display name of the current user, used for the `{name}` placeholder in the fullscreen greeting */
|
|
26
26
|
userName?: string;
|
|
27
27
|
/** Show the "Files in this chat" menu for hosts that don't provide the
|
|
@@ -39,25 +39,25 @@ declare var __VLS_24: {
|
|
|
39
39
|
contrastColor: "white" | "black";
|
|
40
40
|
startNewChat: () => Promise<string>;
|
|
41
41
|
stopGeneration: () => Promise<void>;
|
|
42
|
-
},
|
|
42
|
+
}, __VLS_117: {
|
|
43
43
|
mainColor: string | undefined;
|
|
44
44
|
useColorsForAgentHeader: boolean | undefined;
|
|
45
45
|
contrastColor: "white" | "black";
|
|
46
46
|
startNewChat: () => Promise<string>;
|
|
47
47
|
stopGeneration: () => Promise<void>;
|
|
48
|
-
},
|
|
48
|
+
}, __VLS_141: string, __VLS_142: any, __VLS_152: string, __VLS_153: any, __VLS_160: {}, __VLS_170: string, __VLS_171: any;
|
|
49
49
|
type __VLS_Slots = {} & {
|
|
50
|
-
[K in NonNullable<typeof
|
|
50
|
+
[K in NonNullable<typeof __VLS_141>]?: (props: typeof __VLS_142) => any;
|
|
51
51
|
} & {
|
|
52
|
-
[K in NonNullable<typeof
|
|
52
|
+
[K in NonNullable<typeof __VLS_152>]?: (props: typeof __VLS_153) => any;
|
|
53
53
|
} & {
|
|
54
|
-
[K in NonNullable<typeof
|
|
54
|
+
[K in NonNullable<typeof __VLS_170>]?: (props: typeof __VLS_171) => any;
|
|
55
55
|
} & {
|
|
56
56
|
'header-actions'?: (props: typeof __VLS_24) => any;
|
|
57
57
|
} & {
|
|
58
|
-
actions?: (props: typeof
|
|
58
|
+
actions?: (props: typeof __VLS_117) => any;
|
|
59
59
|
} & {
|
|
60
|
-
'view-auth'?: (props: typeof
|
|
60
|
+
'view-auth'?: (props: typeof __VLS_160) => any;
|
|
61
61
|
};
|
|
62
62
|
declare const __VLS_base: DefineComponent<__VLS_PublicProps, {
|
|
63
63
|
startNewChat: () => Promise<string>;
|
|
@@ -2,8 +2,8 @@ import { UIChatMessage } from '../../../models/src';
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
agentId: string;
|
|
5
|
-
/** Mirrors the PkChatbot `modifier` prop: `fullscreen` shows a centered empty state (greeting) instead of the welcome message */
|
|
6
|
-
modifier?: 'widget' | 'fullscreen';
|
|
5
|
+
/** Mirrors the PkChatbot `modifier` prop: `fullscreen` shows a centered empty state (greeting) instead of the welcome message, `panel` behaves like `widget` */
|
|
6
|
+
modifier?: 'widget' | 'fullscreen' | 'panel';
|
|
7
7
|
/** Display name of the current user, used for the `{name}` greeting placeholder */
|
|
8
8
|
userName?: string;
|
|
9
9
|
};
|
|
@@ -2,6 +2,8 @@ import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentPr
|
|
|
2
2
|
type DialogProps = {
|
|
3
3
|
title?: string;
|
|
4
4
|
transition?: string;
|
|
5
|
+
modifiers?: string | string[];
|
|
6
|
+
/** @deprecated use modifiers instead */
|
|
5
7
|
size?: 'small' | 'standard' | 'fullscreen';
|
|
6
8
|
role?: 'alert' | 'alertdialog';
|
|
7
9
|
keepOpen?: boolean;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Display name stored when an external token carries no usable name claim and
|
|
4
|
+
* none can be derived from the other claims. It means "unknown", not "this is
|
|
5
|
+
* the user's name": consumers must never surface it (greeting someone with
|
|
6
|
+
* "Hi External User" is a visible defect).
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXTERNAL_USER_PLACEHOLDER_NAME = "External User";
|
|
2
9
|
export declare const OrganizationExternalAuthSchema: z.ZodObject<{
|
|
3
10
|
id: z.ZodString;
|
|
4
11
|
organizationId: z.ZodString;
|