@8wave/ai-elements 0.122.0-beta.2 → 0.122.0-beta.3
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 +2 -2
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/_chunks/PkAvatar-DwtZWSW4.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotViewChat-C_dLjNVo.js.map +1 -1
- package/dist-vue/index.js +1 -1
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PkAvatar-DwtZWSW4.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createBlock","_withCtx","_createElementBlock","_unref","_Fragment","_createTextVNode","_toDisplayString","_createCommentVNode","_sfc_main","useImageFallback","_hoisted_1","PkAvatar_default","defineComponent","props","__props","hasImage","computed","canShowImage","avatarModifiers","initials","word","_component_VvIcon","VvIcon","_component_VvAvatar","VvAvatar","openBlock","createBlock","withCtx","createElementBlock","_cache","unref","onImageError","Fragment","createTextVNode","toDisplayString","createCommentVNode"],"sources":["../../../../packages/components/src/chat/PkAvatar.vue","../../../../packages/components/src/chat/PkAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useImageFallback } from 'composables'\n\n /**\n * Every avatar is a tile, a rounded square with its own colors: a person,\n * an organization and an agent alike (DESIGN.md, principle 13). `modifiers`\n * carries a size (`md`, `lg`) or `word`, the dark ground that marks the\n * signed-in user; the tile paints every other ground itself.\n */\n const props = withDefaults(\n defineProps<{\n name?: string\n imgSrc?: string | null\n modifiers?: string\n /** Shown when there is no image (or it is broken) and no name. */\n fallbackIcon?: string\n }>(),\n {\n name: undefined,\n imgSrc: undefined,\n modifiers: undefined,\n fallbackIcon: 'ri:user-line',\n },\n )\n\n // OAuth avatar urls expire and uploaded logos get deleted: without this the\n // browser paints its broken-image glyph inside the tile. Keying by url\n // also means a new/refreshed src is retried instead of staying broken.\n const { canShowImage, onImageError } = useImageFallback()\n const hasImage = computed(() => canShowImage(props.imgSrc))\n\n // `transparent` only under an image, so the initials always get a ground\n const avatarModifiers = computed(() =>\n hasImage.value ? 'transparent' : props.modifiers,\n )\n\n const initials = computed(() => {\n if (!props.name) {\n return ''\n }\n // Only words that start with a letter or a digit: \"[bench] S1\" gave\n // \"[S\" and \"CAI - Marche\" gave \"C-\"\n return props.name\n .split(/\\s+/)\n .filter((word) => /^[\\p{L}\\p{N}]/u.test(word))\n .slice(0, 2)\n .map((word) => word.charAt(0).toUpperCase())\n .join('')\n })\n</script>\n\n<template>\n <VvAvatar\n class=\"pk-avatar\"\n :img-src=\"hasImage ? (imgSrc as string) : undefined\"\n :modifiers=\"avatarModifiers\">\n <template #default>\n <img\n v-if=\"hasImage\"\n :src=\"imgSrc as string\"\n alt=\"avatar\"\n @error=\"onImageError(imgSrc)\" />\n <template v-else-if=\"initials\">{{ initials }}</template>\n <VvIcon v-else-if=\"fallbackIcon\" :name=\"fallbackIcon\" />\n </template>\n </VvAvatar>\n</template>\n\n<style lang=\"scss\">\n .pk-avatar {\n // Users can upload any image shape: always crop it to the tile\n // (the inner img inherits object-fit from the avatar root)\n object-fit: cover;\n overflow: hidden;\n // The corner grows with the tile, a fifth of its side: 6px on the\n // 28px of a list, 8px at 40, 13px on the 64px logo of the catalog\n // page. A fixed corner made a large tile read as a square and a\n // small one as a circle.
|
|
1
|
+
{"version":3,"file":"PkAvatar-DwtZWSW4.js","names":["__unplugin_components_0","__unplugin_components_1","_openBlock","_createBlock","_withCtx","_createElementBlock","_unref","_Fragment","_createTextVNode","_toDisplayString","_createCommentVNode","_sfc_main","useImageFallback","_hoisted_1","PkAvatar_default","defineComponent","props","__props","hasImage","computed","canShowImage","avatarModifiers","initials","word","_component_VvIcon","VvIcon","_component_VvAvatar","VvAvatar","openBlock","createBlock","withCtx","createElementBlock","_cache","unref","onImageError","Fragment","createTextVNode","toDisplayString","createCommentVNode"],"sources":["../../../../packages/components/src/chat/PkAvatar.vue","../../../../packages/components/src/chat/PkAvatar.vue"],"sourcesContent":["<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useImageFallback } from 'composables'\n\n /**\n * Every avatar is a tile, a rounded square with its own colors: a person,\n * an organization and an agent alike (DESIGN.md, principle 13). `modifiers`\n * carries a size (`md`, `lg`) or `word`, the dark ground that marks the\n * signed-in user; the tile paints every other ground itself.\n */\n const props = withDefaults(\n defineProps<{\n name?: string\n imgSrc?: string | null\n modifiers?: string\n /** Shown when there is no image (or it is broken) and no name. */\n fallbackIcon?: string\n }>(),\n {\n name: undefined,\n imgSrc: undefined,\n modifiers: undefined,\n fallbackIcon: 'ri:user-line',\n },\n )\n\n // OAuth avatar urls expire and uploaded logos get deleted: without this the\n // browser paints its broken-image glyph inside the tile. Keying by url\n // also means a new/refreshed src is retried instead of staying broken.\n const { canShowImage, onImageError } = useImageFallback()\n const hasImage = computed(() => canShowImage(props.imgSrc))\n\n // `transparent` only under an image, so the initials always get a ground\n const avatarModifiers = computed(() =>\n hasImage.value ? 'transparent' : props.modifiers,\n )\n\n const initials = computed(() => {\n if (!props.name) {\n return ''\n }\n // Only words that start with a letter or a digit: \"[bench] S1\" gave\n // \"[S\" and \"CAI - Marche\" gave \"C-\"\n return props.name\n .split(/\\s+/)\n .filter((word) => /^[\\p{L}\\p{N}]/u.test(word))\n .slice(0, 2)\n .map((word) => word.charAt(0).toUpperCase())\n .join('')\n })\n</script>\n\n<template>\n <VvAvatar\n class=\"pk-avatar\"\n :img-src=\"hasImage ? (imgSrc as string) : undefined\"\n :modifiers=\"avatarModifiers\">\n <template #default>\n <img\n v-if=\"hasImage\"\n :src=\"imgSrc as string\"\n alt=\"avatar\"\n @error=\"onImageError(imgSrc)\" />\n <template v-else-if=\"initials\">{{ initials }}</template>\n <VvIcon v-else-if=\"fallbackIcon\" :name=\"fallbackIcon\" />\n </template>\n </VvAvatar>\n</template>\n\n<style lang=\"scss\">\n .pk-avatar {\n // Users can upload any image shape: always crop it to the tile\n // (the inner img inherits object-fit from the avatar root)\n object-fit: cover;\n overflow: hidden;\n\n // The corner grows with the tile, a fifth of its side: 6px on the\n // 28px of a list, 8px at 40, 13px on the 64px logo of the catalog\n // page. A fixed corner made a large tile read as a square and a\n // small one as a circle. It keeps it inside a field too: the 2px\n // that ran parallel to the field's corner read as a square.\n &,\n > img {\n border-radius: 20%;\n }\n\n // The placeholder icon should fill the tile like the initials it\n // replaces, not sit in it as a tiny glyph\n > .vv-icon {\n font-size: 1.4em;\n }\n\n // Initials sit on a filled tile framed by a hairline, in bold: an\n // outline in the text color reads as a placeholder. An image goes\n // without the hairline: drawn around a logo it read as a second\n // shape, a square around a round mark.\n &:not(.vv-avatar--transparent, .vv-avatar--word) {\n background-color: var(--color-surface-3);\n color: var(--color-word-2);\n }\n\n &:not(.vv-avatar--transparent) {\n box-shadow: 0 0 0 var(--spacing-px) var(--color-surface-4);\n font-weight: var(--font-bold);\n }\n }\n</style>\n","<script setup lang=\"ts\">\n import { computed } from 'vue'\n import { useImageFallback } from 'composables'\n\n /**\n * Every avatar is a tile, a rounded square with its own colors: a person,\n * an organization and an agent alike (DESIGN.md, principle 13). `modifiers`\n * carries a size (`md`, `lg`) or `word`, the dark ground that marks the\n * signed-in user; the tile paints every other ground itself.\n */\n const props = withDefaults(\n defineProps<{\n name?: string\n imgSrc?: string | null\n modifiers?: string\n /** Shown when there is no image (or it is broken) and no name. */\n fallbackIcon?: string\n }>(),\n {\n name: undefined,\n imgSrc: undefined,\n modifiers: undefined,\n fallbackIcon: 'ri:user-line',\n },\n )\n\n // OAuth avatar urls expire and uploaded logos get deleted: without this the\n // browser paints its broken-image glyph inside the tile. Keying by url\n // also means a new/refreshed src is retried instead of staying broken.\n const { canShowImage, onImageError } = useImageFallback()\n const hasImage = computed(() => canShowImage(props.imgSrc))\n\n // `transparent` only under an image, so the initials always get a ground\n const avatarModifiers = computed(() =>\n hasImage.value ? 'transparent' : props.modifiers,\n )\n\n const initials = computed(() => {\n if (!props.name) {\n return ''\n }\n // Only words that start with a letter or a digit: \"[bench] S1\" gave\n // \"[S\" and \"CAI - Marche\" gave \"C-\"\n return props.name\n .split(/\\s+/)\n .filter((word) => /^[\\p{L}\\p{N}]/u.test(word))\n .slice(0, 2)\n .map((word) => word.charAt(0).toUpperCase())\n .join('')\n })\n</script>\n\n<template>\n <VvAvatar\n class=\"pk-avatar\"\n :img-src=\"hasImage ? (imgSrc as string) : undefined\"\n :modifiers=\"avatarModifiers\">\n <template #default>\n <img\n v-if=\"hasImage\"\n :src=\"imgSrc as string\"\n alt=\"avatar\"\n @error=\"onImageError(imgSrc)\" />\n <template v-else-if=\"initials\">{{ initials }}</template>\n <VvIcon v-else-if=\"fallbackIcon\" :name=\"fallbackIcon\" />\n </template>\n </VvAvatar>\n</template>\n\n<style lang=\"scss\">\n .pk-avatar {\n // Users can upload any image shape: always crop it to the tile\n // (the inner img inherits object-fit from the avatar root)\n object-fit: cover;\n overflow: hidden;\n\n // The corner grows with the tile, a fifth of its side: 6px on the\n // 28px of a list, 8px at 40, 13px on the 64px logo of the catalog\n // page. A fixed corner made a large tile read as a square and a\n // small one as a circle. It keeps it inside a field too: the 2px\n // that ran parallel to the field's corner read as a square.\n &,\n > img {\n border-radius: 20%;\n }\n\n // The placeholder icon should fill the tile like the initials it\n // replaces, not sit in it as a tiny glyph\n > .vv-icon {\n font-size: 1.4em;\n }\n\n // Initials sit on a filled tile framed by a hairline, in bold: an\n // outline in the text color reads as a placeholder. An image goes\n // without the hairline: drawn around a logo it read as a second\n // shape, a square around a round mark.\n &:not(.vv-avatar--transparent, .vv-avatar--word) {\n background-color: var(--color-surface-3);\n color: var(--color-word-2);\n }\n\n &:not(.vv-avatar--transparent) {\n box-shadow: 0 0 0 var(--spacing-px) var(--color-surface-4);\n font-weight: var(--font-bold);\n }\n }\n</style>\n"],"mappings":";;;;;;;;;;;;;EAUI,IAAMgB,IAAQC,GAmBR,EAAE,iBAAc,oBAAiBL,EAAiB,GAClDM,IAAWC,QAAeC,EAAaJ,EAAM,MAAM,CAAC,GAGpDK,IAAkBF,QACpBD,EAAS,QAAQ,gBAAgBF,EAAM,SAC3C,GAEMM,IAAWH,QACRH,EAAM,OAKJA,EAAM,KACR,MAAM,KAAK,CAAA,CACX,QAAQ,MAAS,iBAAiB,KAAKO,CAAI,CAAC,CAAA,CAC5C,MAAM,GAAG,CAAC,CAAA,CACV,KAAK,MAASA,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA,CAC1C,KAAK,EAAE,IATD,EAUd;;;GAID,OAAArB,EAAA,GAAAC,EAaWuB,GAAA;IAZP,OAAM;IACL,WAASR,EAAA,QAAYD,EAAA,SAAoB,KAAA;IACzC,WAAWI,EAAA;;IACD,SAAOjB,QAKsB,CAH1Bc,EAAA,SADVhB,EAAA,GAAAG,EAIoC,OAAA;;KAF/B,KAAKY,EAAA;KACN,KAAI;KACH,SAAK,AAAAe,EAAA,QAAA,MAAE1B,EAAA4B,CAAA,CAAY,CAACjB,EAAA,MAAM;I,mBACVK,EAAA,SAArBpB,EAAA,GAAAG,EAAwDE,GAAA,EAAA,KAAA,EAAA,GAAA,CAAtBC,EAAAC,EAAAa,EAAA,KAAQ,GAAA,CAAA,C,UACvBL,EAAA,gBAAnBf,EAAA,GAAAC,EAAwDqB,GAAA;;KAAtB,MAAMP,EAAA"}
|