@8wave/ai-elements 0.112.0-beta.10 → 0.112.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/_chunks/{PkToolShowVideo-Djr8Ofsz.js → PkToolShowVideo-p6Y9j3-B.js} +3 -3
  2. package/dist/_chunks/PkToolShowVideo-p6Y9j3-B.js.map +1 -0
  3. package/dist/_chunks/{browser-B0Xnbqi7.js → browser-Ct5TRDgj.js} +521 -518
  4. package/dist/_chunks/{browser-B0Xnbqi7.js.map → browser-Ct5TRDgj.js.map} +1 -1
  5. package/dist/_chunks/markdown-BRD-hDrH.js.map +1 -1
  6. package/dist/_chunks/{web-Dzr6HJ14.js → web-CEmtEYdH.js} +89 -65
  7. package/dist/_chunks/web-CEmtEYdH.js.map +1 -0
  8. package/dist/ai-elements.es.js +2816 -3038
  9. package/dist/ai-elements.es.js.map +1 -1
  10. package/dist-vue/PkChatbot.js +1 -1
  11. package/dist-vue/PkChatbotAuth.js +1 -1
  12. package/dist-vue/PkChatbotMessages.js +1 -1
  13. package/dist-vue/PkChatbotViewChat.js +1 -1
  14. package/dist-vue/PkChatbotViewConversations.js +1 -1
  15. package/dist-vue/PkChatbotViewFiles.js +1 -1
  16. package/dist-vue/PkChatbotViewProfile.js +1 -1
  17. package/dist-vue/_chunks/{Document-B6RpxFr9.js → Document-2X01-F4Z.js} +2 -2
  18. package/dist-vue/_chunks/Document-2X01-F4Z.js.map +1 -0
  19. package/dist-vue/_chunks/{PkChatbot-CI9ucJ2M.js → PkChatbot-C11EVHnI.js} +6 -6
  20. package/dist-vue/_chunks/{PkChatbot-CI9ucJ2M.js.map → PkChatbot-C11EVHnI.js.map} +1 -1
  21. package/dist-vue/_chunks/{PkChatbotAuth-AxAOI9t2.js → PkChatbotAuth-Bi508F1u.js} +57 -57
  22. package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +1 -0
  23. package/dist-vue/_chunks/{PkChatbotMessages-BsT48S-h.js → PkChatbotMessages-BD-vUak6.js} +4 -4
  24. package/dist-vue/_chunks/{PkChatbotMessages-BsT48S-h.js.map → PkChatbotMessages-BD-vUak6.js.map} +1 -1
  25. package/dist-vue/_chunks/{PkChatbotViewChat-jEBBPmSo.js → PkChatbotViewChat-DJnjuhjt.js} +5 -5
  26. package/dist-vue/_chunks/{PkChatbotViewChat-jEBBPmSo.js.map → PkChatbotViewChat-DJnjuhjt.js.map} +1 -1
  27. package/dist-vue/_chunks/{PkChatbotViewConversations-CWSrP36z.js → PkChatbotViewConversations-BCdolW0R.js} +2 -2
  28. package/dist-vue/_chunks/{PkChatbotViewConversations-CWSrP36z.js.map → PkChatbotViewConversations-BCdolW0R.js.map} +1 -1
  29. package/dist-vue/_chunks/{PkChatbotViewFiles-DzLp1WfU.js → PkChatbotViewFiles-Cudao8ew.js} +3 -3
  30. package/dist-vue/_chunks/{PkChatbotViewFiles-DzLp1WfU.js.map → PkChatbotViewFiles-Cudao8ew.js.map} +1 -1
  31. package/dist-vue/_chunks/{PkChatbotViewProfile-CHbn3W6F.js → PkChatbotViewProfile-DDsKOkcC.js} +2 -2
  32. package/dist-vue/_chunks/{PkChatbotViewProfile-CHbn3W6F.js.map → PkChatbotViewProfile-DDsKOkcC.js.map} +1 -1
  33. package/dist-vue/_chunks/{PkToolShowDiagram-CjJcLvWs.js → PkToolShowDiagram-RtkI_sKL.js} +2 -2
  34. package/dist-vue/_chunks/{PkToolShowDiagram-CjJcLvWs.js.map → PkToolShowDiagram-RtkI_sKL.js.map} +1 -1
  35. package/dist-vue/_chunks/{PkToolShowSources-Cc26LzRd.js → PkToolShowSources-gI947JOm.js} +2 -2
  36. package/dist-vue/_chunks/{PkToolShowSources-Cc26LzRd.js.map → PkToolShowSources-gI947JOm.js.map} +1 -1
  37. package/dist-vue/_chunks/{PkToolShowVideo-Bv9kMd88.js → PkToolShowVideo-BZOTu2Qe.js} +3 -3
  38. package/dist-vue/_chunks/PkToolShowVideo-BZOTu2Qe.js.map +1 -0
  39. package/dist-vue/_chunks/{useChatbotStore-CMS2zFht.js → useChatbotStore-BwrBZJCq.js} +944 -1259
  40. package/dist-vue/_chunks/useChatbotStore-BwrBZJCq.js.map +1 -0
  41. package/dist-vue/_chunks/{web-Dzr6HJ14.js → web-CEmtEYdH.js} +89 -65
  42. package/dist-vue/_chunks/web-CEmtEYdH.js.map +1 -0
  43. package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +0 -1
  44. package/dist-vue/composables.js +2807 -80
  45. package/dist-vue/composables.js.map +1 -1
  46. package/dist-vue/index.js +14 -14
  47. package/dist-vue/index.js.map +1 -1
  48. package/dist-vue/packages/models/src/schema/Organization.d.ts +3 -3
  49. package/dist-vue/packages/models/src/schema/User.d.ts +10 -0
  50. package/dist-vue/packages/models/src/schema/constants.d.ts +1 -1
  51. package/package.json +3 -3
  52. package/dist/_chunks/PkToolShowVideo-Djr8Ofsz.js.map +0 -1
  53. package/dist/_chunks/web-Dzr6HJ14.js.map +0 -1
  54. package/dist-vue/_chunks/Document-B6RpxFr9.js.map +0 -1
  55. package/dist-vue/_chunks/PkChatbotAuth-AxAOI9t2.js.map +0 -1
  56. package/dist-vue/_chunks/PkToolShowVideo-Bv9kMd88.js.map +0 -1
  57. package/dist-vue/_chunks/useChatbotStore-CMS2zFht.js.map +0 -1
  58. package/dist-vue/_chunks/web-Dzr6HJ14.js.map +0 -1
@@ -6,7 +6,7 @@ var p = (e) => e.replace(/[^a-zA-Z0-9_-]/g, ""), m = (e, t) => e === t || e.ends
6
6
  if (e.hostname.endsWith("youtu.be")) return p(e.pathname.split("/")[1] ?? "") || null;
7
7
  let t = e.searchParams.get("v");
8
8
  if (t) return p(t) || null;
9
- let n = e.pathname.match(/^\/(?:shorts|embed|v)\/([^/?#]+)/);
9
+ let n = e.pathname.match(/^\/(?:shorts|live|embed|v)\/([^/?#]+)/);
10
10
  return n && p(n[1]) || null;
11
11
  }, g = (e) => {
12
12
  let t = e.pathname.match(/(?:^|\/)(\d+)(?:$|[/?#])/);
@@ -40,7 +40,7 @@ function _(e, t) {
40
40
  provider: "vimeo",
41
41
  url: e,
42
42
  videoId: t,
43
- embedUrl: `https://player.vimeo.com/video/${t}`
43
+ embedUrl: `https://player.vimeo.com/video/${t}?dnt=1`
44
44
  };
45
45
  }
46
46
  return t && t !== "file" ? {
@@ -118,4 +118,4 @@ var v = {
118
118
  //#endregion
119
119
  export { k as default };
120
120
 
121
- //# sourceMappingURL=PkToolShowVideo-Djr8Ofsz.js.map
121
+ //# sourceMappingURL=PkToolShowVideo-p6Y9j3-B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PkToolShowVideo-p6Y9j3-B.js","names":["$t"],"sources":["../../../../packages/utils/src/video-source.ts","../../../../packages/components/src/chat/PkToolShowVideo.vue","../../../../packages/components/src/chat/PkToolShowVideo.vue"],"sourcesContent":["/**\n * Video source parsing shared by the backend platform renderer and the frontend\n * player component, so both classify a video URL the same way.\n *\n * A URL is either a known provider (YouTube/Vimeo), which plays through the\n * provider's iframe embed, or a direct media file (`file`), which plays in a\n * native `<video>` element. Detection is by URL shape; an explicit `hint` is\n * used only as a fallback when the URL alone is inconclusive.\n */\n\nexport type VideoProvider = 'youtube' | 'vimeo' | 'file'\n\nexport interface ParsedVideoSource {\n provider: VideoProvider\n /** The original URL, unchanged. */\n url: string\n /**\n * The URL to actually load: the provider iframe embed URL for\n * YouTube/Vimeo, or the direct file URL for `file`.\n */\n embedUrl: string\n /** The provider video id (providers only). */\n videoId?: string\n /**\n * A preview image URL derived from the provider, when one is available\n * without an extra API call (currently YouTube only). Lets a link-only\n * surface (e.g. a Teams card) show a thumbnail instead of a bare link.\n */\n thumbnailUrl?: string\n}\n\n/** Keep only characters that are legal in a provider video id. */\nconst sanitizeId = (raw: string): string => raw.replace(/[^a-zA-Z0-9_-]/g, '')\n\n/**\n * True when `host` is exactly `domain` or a subdomain of it. Guards against\n * lookalike hosts (e.g. `notyoutube.com`) that a bare substring check would\n * misclassify.\n */\nconst hostMatches = (host: string, domain: string): boolean =>\n host === domain || host.endsWith(`.${domain}`)\n\n/** Extract the YouTube video id from any of its URL shapes, or null. */\nconst youtubeId = (u: URL): string | null => {\n // youtu.be/<id>\n if (u.hostname.endsWith('youtu.be')) {\n return sanitizeId(u.pathname.split('/')[1] ?? '') || null\n }\n // youtube.com/watch?v=<id>\n const v = u.searchParams.get('v')\n if (v) {\n return sanitizeId(v) || null\n }\n // youtube.com/shorts/<id>, /live/<id>, /embed/<id>, /v/<id>\n const m = u.pathname.match(/^\\/(?:shorts|live|embed|v)\\/([^/?#]+)/)\n return m ? sanitizeId(m[1]) || null : null\n}\n\n/** Extract the Vimeo (numeric) video id, or null. */\nconst vimeoId = (u: URL): string | null => {\n // player.vimeo.com/video/<id> or vimeo.com/<id>\n const m = u.pathname.match(/(?:^|\\/)(\\d+)(?:$|[/?#])/)\n return m ? m[1] : null\n}\n\n/**\n * Classify a video URL into a provider + a loadable embed/file URL.\n * Falls back to `file` (native `<video>`) for anything not recognized as a\n * supported provider, or when a provider is matched but no id can be extracted.\n */\nexport function parseVideoSource(\n url: string,\n hint?: VideoProvider,\n): ParsedVideoSource {\n let u: URL | undefined\n try {\n u = new URL(url)\n } catch {\n // Not an absolute URL: treat as a direct file reference.\n return { provider: 'file', url, embedUrl: url }\n }\n\n const host = u.hostname.toLowerCase()\n\n const isYouTube =\n hostMatches(host, 'youtube.com') ||\n hostMatches(host, 'youtu.be') ||\n hostMatches(host, 'youtube-nocookie.com')\n if (isYouTube) {\n const id = youtubeId(u)\n if (id) {\n return {\n provider: 'youtube',\n url,\n videoId: id,\n embedUrl: `https://www.youtube-nocookie.com/embed/${id}`,\n thumbnailUrl: `https://img.youtube.com/vi/${id}/hqdefault.jpg`,\n }\n }\n }\n\n if (hostMatches(host, 'vimeo.com')) {\n const id = vimeoId(u)\n if (id) {\n return {\n provider: 'vimeo',\n url,\n videoId: id,\n // `dnt=1`: the player sets no cookies and records no session\n // data, the Vimeo counterpart of youtube-nocookie above.\n embedUrl: `https://player.vimeo.com/video/${id}?dnt=1`,\n }\n }\n }\n\n // Honor an explicit provider hint only if we could not extract an id from a\n // provider URL (so a caller-tagged provider link still routes to an iframe\n // via its original URL rather than a broken native <video>).\n if (hint && hint !== 'file') {\n return { provider: hint, url, embedUrl: url }\n }\n\n return { provider: 'file', url, embedUrl: url }\n}\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => ({\n ...video,\n source: parseVideoSource(video.url, video.provider),\n }))\n })\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\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:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <video\n v-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { parseVideoSource, type VideoProvider } from 'utils'\n\n const props = defineProps<{\n part: unknown\n }>()\n\n interface VideoInput {\n url: string\n title?: string\n description?: string\n poster?: string\n provider?: VideoProvider\n }\n\n // Permissions granted to provider embeds (YouTube/Vimeo players).\n const IFRAME_ALLOW =\n 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share'\n\n const videos = computed(() => {\n const part = props.part as { input?: { videos?: VideoInput[] } }\n return (part.input?.videos ?? []).map((video) => ({\n ...video,\n source: parseVideoSource(video.url, video.provider),\n }))\n })\n</script>\n\n<template>\n <div\n v-if=\"videos.length\"\n class=\"border border-surface-3 rounded-xl w-full overflow-hidden bg-surface\">\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:film-line\" class=\"text-16\" />\n <strong class=\"font-bold\">\n {{ $t('label.video') }}\n </strong>\n </div>\n <div class=\"p-sm flex flex-col gap-16\">\n <div v-for=\"video in videos\" :key=\"video.url\" class=\"flex flex-col\">\n <strong v-if=\"video.title\" class=\"font-bold text-14 mb-sm\">\n {{ video.title }}\n </strong>\n <!-- Direct file: native player. Handles MP4/WebM/OGG and works\n inside the widget's Shadow DOM without any extra CSS. -->\n <video\n v-if=\"video.source.provider === 'file'\"\n :src=\"video.source.embedUrl\"\n :poster=\"video.poster\"\n controls\n preload=\"metadata\"\n playsinline\n class=\"w-full rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9; max-height: 480px\">\n <a\n :href=\"video.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\">\n {{ video.title ?? video.url }}\n </a>\n </video>\n <!-- Provider (YouTube/Vimeo): iframe embed, 16:9 responsive. -->\n <div\n v-else\n class=\"relative w-full overflow-hidden rounded-xl bg-word-1\"\n style=\"aspect-ratio: 16 / 9\">\n <iframe\n :src=\"video.source.embedUrl\"\n :title=\"video.title ?? video.url\"\n loading=\"lazy\"\n referrerpolicy=\"strict-origin-when-cross-origin\"\n :allow=\"IFRAME_ALLOW\"\n allowfullscreen\n class=\"absolute inset-0 w-full h-full border-0\"></iframe>\n </div>\n <span\n v-if=\"video.description\"\n class=\"text-12 text-word-3 mt-sm\">\n {{ video.description }}\n </span>\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;AAgCA,IAAM,KAAc,MAAwB,EAAI,QAAQ,mBAAmB,EAAE,GAOvE,KAAe,GAAc,MAC/B,MAAS,KAAU,EAAK,SAAS,IAAI,GAAQ,GAG3C,KAAa,MAA0B;CAEzC,IAAI,EAAE,SAAS,SAAS,UAAU,GAC9B,OAAO,EAAW,EAAE,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK;CAGzD,IAAM,IAAI,EAAE,aAAa,IAAI,GAAG;CAChC,IAAI,GACA,OAAO,EAAW,CAAC,KAAK;CAG5B,IAAM,IAAI,EAAE,SAAS,MAAM,uCAAuC;CAClE,OAAO,KAAI,EAAW,EAAE,EAAE,KAAY;AAC1C,GAGM,KAAW,MAA0B;CAEvC,IAAM,IAAI,EAAE,SAAS,MAAM,0BAA0B;CACrD,OAAO,IAAI,EAAE,KA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