@kilichat/vue 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +91 -2
- package/dist/KiliChat.vue.d.ts +4 -0
- package/dist/KiliChatBootstrap.vue.d.ts +3 -0
- package/dist/components/ui/Button.vue.d.ts +20 -0
- package/dist/components/ui/Textarea.vue.d.ts +12 -0
- package/dist/components/ui/button.d.ts +19 -0
- package/dist/components/ui/slot.d.ts +9 -0
- package/dist/components/widget/ChatHome.vue.d.ts +13 -0
- package/dist/components/widget/ChatThread.vue.d.ts +21 -0
- package/dist/components/widget/ChatWidget.vue.d.ts +3 -0
- package/dist/components/widget/InitialsAvatar.vue.d.ts +13 -0
- package/dist/composables/use-mobile.d.ts +2 -0
- package/dist/context/AppStateProvider.vue.d.ts +15 -0
- package/dist/context/SocketProvider.vue.d.ts +15 -0
- package/dist/context/socket.d.ts +5 -0
- package/dist/context/state.d.ts +22 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +790 -0
- package/dist/index.js.map +1 -0
- package/dist/kili-chat.d.ts +4 -0
- package/dist/lib/config.d.ts +21 -0
- package/dist/lib/http.d.ts +2 -0
- package/dist/lib/socket-events.d.ts +29 -0
- package/dist/lib/storage-keys.d.ts +9 -0
- package/dist/lib/types.d.ts +67 -0
- package/dist/lib/utils.d.ts +4 -0
- package/dist/lib/widget-data.d.ts +35 -0
- package/dist/lib/widget-format.d.ts +3 -0
- package/dist/services/chat.service.d.ts +8 -0
- package/dist/services/core.service.d.ts +6 -0
- package/dist/styles.css +2 -0
- package/package.json +75 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_renderSlot","_openBlock","_createElementBlock","_normalizeClass","_unref","_toDisplayString","_openBlock","_createBlock","_unref","_normalizeClass","_withCtx","_renderSlot","_createElementBlock","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_unref","_createVNode","_Fragment","_renderList","InitialsAvatar","Button","_withCtx","_createTextVNode","_openBlock","_createElementBlock","_normalizeClass","_unref","_hoisted_1","_openBlock","_createElementBlock","_createElementVNode","_createVNode","Button","_withCtx","_unref","InitialsAvatar","_toDisplayString","_Fragment","_renderList","_normalizeStyle","Textarea","_unref","_openBlock","_createElementBlock","_createBlock","ChatThread","ChatHome","_openBlock","_createBlock","ChatWidget","_openBlock","_createBlock","AppStateProvider","_withCtx","_createVNode","KiliChatBootstrap","_renderSlot","axios","randomName","LocalStorageKeys","SessionStorageKeys","AppStateContext","createAppState","state","reactive","dedup","p","msg","at","chat","chats","msgs","rt","usr","provideAppState","provide","useApp","ctx","inject","AppStateProvider_default","defineComponent","renderSlot","_ctx","cn","inputs","twMerge","clsx","getInitialsFromFullName","fullname","fname","lname","firstInitial","lastInitial","getInitialsFromNames","InitialsAvatar_default","props","__props","openBlock","createElementBlock","normalizeClass","unref","toDisplayString","buttonVariants","cva","firstRenderable","node","nodes","Comment","Fragment","inner","Slot","child","slots","\"default\"","cloneVNode","attrs","Button_default","classes","computed","createBlock","withCtx","brand","customer","agents","hoursAgo","h","daysAgo","d","seedConversations","cannedReplies","replyIndex","nextCannedReply","reply","agentById","a","id","clockTime","iso","dayLabel","date","today","yesterday","sameDay","b","relativeTime","diff","minutes","hours","days","_hoisted_1$3","_hoisted_2$1","_hoisted_3$1","_hoisted_4$1","_hoisted_5$1","_hoisted_6$1","_hoisted_7$1","_hoisted_8$1","_hoisted_9$1","_hoisted_10$1","_hoisted_11$1","_hoisted_12$1","_hoisted_13$1","_hoisted_14$1","_hoisted_15$1","_hoisted_16$1","_hoisted_17$1","_hoisted_18$1","_hoisted_19$1","_hoisted_20$1","ChatHome_default","__emit","emit","chatTitle","chatPreview","last","createElementVNode","_cache","createVNode","MessageSquarePlus","ChevronRight","renderList","createCommentVNode","createTextVNode","_hoisted_1$2","Textarea_default","$event","currentConfig","configureKili","config","getKiliConfig","getSocketBaseUrl","http","token","\"Authorization\"","req","chatService","userId","chatId","_hoisted_1$1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","ChatThread_default","bottomRef","ref","agentInitials","customerInitials","agentFirstName","loadChatHistory","messages","scrollToBottom","watch","onMounted","showDay","m","i","prev","randomKey","onKeydown","dotDelays","ArrowLeft","delay","normalizeStyle","Send","Paperclip","Smile","SocketEvent","_hoisted_1","ChatWidget_default","draft","typing","timers","activeChat","socketRef","appendMessage","chatJson","handleChatAction","action","handleChatStarted","user","persistActiveChat","updateChat","acJson","ac","c","onBeforeUnmount","socket","io","err","sendMessage","startChat","onBack","onTextFieldBlur","onTextfieldFocus","onOpen","coreService","res","data","hmac","KiliChatBootstrap_default","onMount","auth","KiliChat_default","SocketContext","useSocket","SocketProvider_default","shallowRef","socketClient","roomId","MOBILE_BREAKPOINT","useIsMobile","isMobile","mql","onChange"],"sources":["../src/lib/storage-keys.ts","../src/context/state.ts","../src/context/AppStateProvider.vue","../src/lib/utils.ts","../src/components/widget/InitialsAvatar.vue","../src/components/ui/button.ts","../src/components/ui/slot.ts","../src/components/ui/Button.vue","../src/lib/widget-data.ts","../src/lib/widget-format.ts","../src/components/widget/ChatHome.vue","../src/components/ui/Textarea.vue","../src/lib/config.ts","../src/lib/http.ts","../src/services/chat.service.ts","../src/components/widget/ChatThread.vue","../src/lib/socket-events.ts","../src/components/widget/ChatWidget.vue","../src/services/core.service.ts","../src/KiliChatBootstrap.vue","../src/KiliChat.vue","../src/context/socket.ts","../src/context/SocketProvider.vue","../src/composables/use-mobile.ts"],"sourcesContent":["export const LocalStorageKeys = {\n AccessTokenExp: 'atexp',\n JwtAccessToken: 'at',\n JwtRefreshToken: 'rt',\n User: 'u',\n}\n\nexport const SessionStorageKeys = {\n ActiveChat: 'ac',\n}","import { LocalStorageKeys } from '@/lib/storage-keys';\nimport { Chat, Message } from '@/lib/types';\nimport { inject, provide, reactive, type InjectionKey } from 'vue';\n\nexport type AppState = {\n accessToken: string | null;\n setAccessToken: (at: string) => void;\n chats: Chat[];\n setChats: (chats: Chat[]) => void;\n updateChat: (chat: Chat) => void;\n messages: Message[];\n setMessages: (msgs: Message[]) => void;\n appendMessage: (msg: Message) => void;\n refreshToken: string | null;\n setRefreshToken: (rt: string) => void;\n user: any | null;\n setUser: (usr: object) => void;\n}\n\nexport const AppStateContext: InjectionKey<AppState> = Symbol('KiliAppState');\n\n/** Creates the reactive app state. AppStateProvider calls this and provides it. */\nexport function createAppState(): AppState {\n const state: AppState = reactive({\n accessToken: null as string | null,\n chats: [] as Chat[],\n messages: [] as Message[],\n refreshToken: null as string | null,\n user: null as object | null,\n\n appendMessage(msg: Message) {\n const dedup = state.messages.filter(p => String(p.id) !== String(msg.id));\n state.messages = [...dedup, msg];\n },\n\n setAccessToken(at: string) {\n localStorage.setItem(LocalStorageKeys.JwtAccessToken, at);\n state.accessToken = at;\n },\n\n updateChat(chat: Chat) {\n state.chats = state.chats.map(p => String(p.id) === String(chat.id) ? chat : p);\n },\n\n setChats(chats: Chat[]) {\n state.chats = chats;\n },\n\n setMessages(msgs: Message[]) {\n state.messages = msgs;\n },\n\n setRefreshToken(rt: string) {\n localStorage.setItem(LocalStorageKeys.JwtRefreshToken, rt);\n state.refreshToken = rt;\n },\n\n setUser(usr: object) {\n localStorage.setItem(LocalStorageKeys.User, JSON.stringify(usr));\n state.user = usr;\n },\n });\n\n return state;\n}\n\n/** Creates the app state and provides it to every descendant component. */\nexport function provideAppState(): AppState {\n const state = createAppState();\n provide(AppStateContext, state);\n return state;\n}\n\nexport const useApp = (): AppState => {\n const ctx = inject(AppStateContext, null);\n if (!ctx) throw new Error('useApp can only be called from inside AppStateProvider');\n return ctx;\n}\n","<script setup lang=\"ts\">\nimport { provideAppState } from './state';\n\nprovideAppState();\n</script>\n\n<template>\n <slot />\n</template>\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function getInitialsFromFullName(fullname?: string): string {\n if (!fullname) return 'CS';\n const [fname, lname] = fullname.split(' ');\n const firstInitial = fname?.substring(0,1) ?? '';\n const lastInitial = lname?.substring(0,1) ?? '';\n if (firstInitial === '' && lastInitial === '') return 'CS';\n return `${firstInitial.toUpperCase()}${lastInitial.toUpperCase()}`;\n}\n\nexport function getInitialsFromNames(fname?: string, lname?: string): string {\n const firstInitial = fname?.substring(0,1) ?? '';\n const lastInitial = lname?.substring(0,1) ?? '';\n if (firstInitial === '' && lastInitial === '') return 'CS';\n return `${firstInitial.toUpperCase()}${lastInitial.toUpperCase()}`;\n}","<script setup lang=\"ts\">\nimport type { HTMLAttributes } from \"vue\";\nimport { cn } from \"@/lib/utils\";\n\ndefineOptions({ name: \"InitialsAvatar\" });\n\nconst props = withDefaults(\n defineProps<{\n initials: string;\n size?: \"sm\" | \"md\" | \"lg\";\n tone?: \"brand\" | \"muted\" | \"sage\";\n class?: HTMLAttributes[\"class\"];\n }>(),\n { size: \"md\", tone: \"brand\" },\n);\n</script>\n\n<template>\n <span\n :class=\"\n cn(\n 'inline-flex shrink-0 items-center justify-center rounded-full font-heading font-semibold tracking-tight',\n props.size === 'sm' && 'size-7 text-[11px]',\n props.size === 'md' && 'size-9 text-xs',\n props.size === 'lg' && 'size-12 text-sm',\n props.tone === 'brand' && 'bg-primary/15 text-primary',\n props.tone === 'sage' && 'bg-sage/20 text-forest',\n props.tone === 'muted' && 'bg-muted text-muted-foreground',\n props.class,\n )\n \"\n >\n {{ props.initials }}\n </span>\n</template>\n","import { cva, type VariantProps } from \"class-variance-authority\";\nimport type { HTMLAttributes } from \"vue\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\ntype ButtonVariants = VariantProps<typeof buttonVariants>;\n\n/**\n * Button props. Any other attribute or listener (type, disabled, aria-label,\n * onClick, ...) falls through to the rendered element.\n */\nexport interface ButtonProps {\n variant?: ButtonVariants[\"variant\"];\n size?: ButtonVariants[\"size\"];\n /** Render the single slot child instead of a <button>, merging the classes onto it. */\n asChild?: boolean;\n class?: HTMLAttributes[\"class\"];\n}\n\nexport { buttonVariants };\n","import { cloneVNode, Comment, defineComponent, Fragment, type VNode } from \"vue\";\n\nfunction firstRenderable(nodes: VNode[]): VNode | null {\n for (const node of nodes) {\n if (node.type === Comment) continue;\n if (node.type === Fragment && Array.isArray(node.children)) {\n const inner = firstRenderable(node.children as VNode[]);\n if (inner) return inner;\n continue;\n }\n return node;\n }\n return null;\n}\n\n/**\n * Vue equivalent of @radix-ui/react-slot: renders its single child and merges\n * its own attributes (class, listeners, aria-*) onto it. Used by Button's\n * `asChild` prop.\n */\nexport const Slot = defineComponent({\n name: \"Slot\",\n inheritAttrs: false,\n setup(_, { slots, attrs }) {\n return () => {\n const child = firstRenderable(slots[\"default\"]?.() ?? []);\n if (!child) return null;\n return cloneVNode(child, attrs, true);\n };\n },\n});\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { cn } from \"@/lib/utils\";\nimport { buttonVariants, type ButtonProps } from \"./button\";\nimport { Slot } from \"./slot\";\n\ndefineOptions({ name: \"Button\" });\n\nconst props = withDefaults(defineProps<ButtonProps>(), { asChild: false });\n\nconst classes = computed(() =>\n cn(buttonVariants({ variant: props.variant, size: props.size, className: props.class })),\n);\n</script>\n\n<template>\n <!-- Not <component :is=\"'button'\">: Vue would resolve that string to this\n component itself (self-name \"Button\") and recurse forever. -->\n <Slot v-if=\"props.asChild\" :class=\"classes\">\n <slot />\n </Slot>\n <button v-else :class=\"classes\">\n <slot />\n </button>\n</template>\n","export type MessageKind = \"customer\" | \"agent\";\n\nexport type WidgetMessage = {\n id: string;\n kind: MessageKind;\n body: string;\n at: string; // ISO timestamp\n authorId?: string;\n};\n\nexport type Agent = {\n id: string;\n name: string;\n initials: string;\n role: string;\n};\n\nexport type WidgetConversation = {\n id: string;\n subject: string;\n agentId: string;\n messages: WidgetMessage[];\n closed?: boolean;\n};\n\nexport const brand = {\n name: \"Kili\",\n greeting: \"Hi there\",\n subline: \"Ask us anything, or share your feedback. We usually reply in a few minutes.\",\n replyTime: \"Typically replies in a few minutes\",\n};\n\nexport const customer = {\n name: \"You\",\n initials: \"YO\",\n};\n\nexport const agents: Agent[] = [\n { id: \"a-mara\", name: \"Mara Okafor\", initials: \"MO\", role: \"Customer Support\" },\n { id: \"a-devon\", name: \"Devon Reyes\", initials: \"DR\", role: \"Billing Specialist\" },\n { id: \"a-bot\", name: \"Kili Team\", initials: \"KT\", role: \"Support Team\" },\n];\n\nconst hoursAgo = (h: number) => new Date(Date.now() - h * 3600_000).toISOString();\nconst daysAgo = (d: number, h = 0) => new Date(Date.now() - d * 86_400_000 - h * 3600_000).toISOString();\n\nexport const seedConversations: WidgetConversation[] = [\n {\n id: \"c-1\",\n subject: \"Trouble syncing my orders\",\n agentId: \"a-mara\",\n messages: [\n {\n id: \"m-1\",\n kind: \"customer\",\n body: \"Hey — my orders stopped syncing this morning. Nothing new has come through since about 8am.\",\n at: hoursAgo(5),\n },\n {\n id: \"m-2\",\n kind: \"agent\",\n authorId: \"a-mara\",\n body: \"Thanks for flagging that! I can see the sync queue backed up on our side. I've re-queued your account now.\",\n at: hoursAgo(4.6),\n },\n {\n id: \"m-3\",\n kind: \"customer\",\n body: \"Great, I can see a few coming in now. How long until it catches up fully?\",\n at: hoursAgo(4.2),\n },\n {\n id: \"m-4\",\n kind: \"agent\",\n authorId: \"a-mara\",\n body: \"Should be fully caught up within the hour. I'll keep an eye on it and let you know if anything stalls again.\",\n at: hoursAgo(4),\n },\n ],\n },\n {\n id: \"c-2\",\n subject: \"Invoice for August\",\n agentId: \"a-devon\",\n messages: [\n {\n id: \"m-5\",\n kind: \"customer\",\n body: \"Could you resend the August invoice? I can't find it in my inbox.\",\n at: daysAgo(3, 2),\n },\n {\n id: \"m-6\",\n kind: \"agent\",\n authorId: \"a-devon\",\n body: \"Just sent it over to the billing email on file. Let me know if it doesn't land in the next few minutes.\",\n at: daysAgo(3, 1),\n },\n {\n id: \"m-7\",\n kind: \"customer\",\n body: \"Got it, thank you!\",\n at: daysAgo(3),\n },\n ],\n closed: true,\n },\n];\n\nconst cannedReplies = [\n \"Thanks for reaching out! Let me take a look at that for you.\",\n \"Good question — I'm checking with the team and will come right back to you.\",\n \"I've made a note of this on your account. Anything else I can help with?\",\n \"That should be sorted now. Give it a refresh and let me know how it looks.\",\n];\n\nlet replyIndex = 0;\nexport function nextCannedReply(): string {\n const reply = cannedReplies[replyIndex % cannedReplies.length] as string;\n replyIndex += 1;\n return reply;\n}\n\nexport function agentById(id: string): Agent {\n return agents.find((a) => a.id === id) ?? (agents[2] as Agent);\n}\n","export function clockTime(iso?: string) {\n if (!iso) return new Date().toLocaleTimeString([], { hour: \"numeric\", minute: \"2-digit\" });\n return new Date(iso).toLocaleTimeString([], { hour: \"numeric\", minute: \"2-digit\" });\n}\n\nexport function dayLabel(iso?: string) {\n if (!iso) return (new Date().toLocaleDateString([], { weekday: \"long\", month: \"short\", day: \"numeric\" }));\n const date = new Date(iso);\n const today = new Date();\n const yesterday = new Date(Date.now() - 86_400_000);\n const sameDay = (a: Date, b: Date) => a.toDateString() === b.toDateString();\n if (sameDay(date, today)) return \"Today\";\n if (sameDay(date, yesterday)) return \"Yesterday\";\n return date.toLocaleDateString([], { weekday: \"long\", month: \"short\", day: \"numeric\" });\n}\n\nexport function relativeTime(iso: string) {\n const diff = Date.now() - new Date(iso).getTime();\n const minutes = Math.round(diff / 60_000);\n if (minutes < 1) return \"just now\";\n if (minutes < 60) return `${minutes}m ago`;\n const hours = Math.round(minutes / 60);\n if (hours < 24) return `${hours}h ago`;\n const days = Math.round(hours / 24);\n if (days < 7) return `${days}d ago`;\n return new Date(iso).toLocaleDateString([], { month: \"short\", day: \"numeric\" });\n}\n","<script setup lang=\"ts\">\nimport { ChevronRight, MessageSquarePlus } from \"@lucide/vue\";\nimport InitialsAvatar from \"@/components/widget/InitialsAvatar.vue\";\nimport Button from \"@/components/ui/Button.vue\";\nimport { brand } from \"@/lib/widget-data\";\nimport { relativeTime } from \"@/lib/widget-format\";\nimport { Chat } from \"@/lib/types\";\nimport { getInitialsFromFullName } from \"@/lib/utils\";\n\ndefineOptions({ name: \"ChatHome\" });\n\ndefineProps<{\n chats: Chat[];\n}>();\n\nconst emit = defineEmits<{\n open: [chat: Chat];\n startNew: [];\n}>();\n\nfunction chatTitle(chat: Chat) {\n return chat.title ?? chat.summary ?? chat.lastMessagePreview?.substring(0, 30) ?? 'Open conversation';\n}\n\nfunction chatPreview(chat: Chat) {\n // const agent = agentById(conversation.assignedStaffId);\n const last = chat.lastMessagePreview;\n return last\n ? `${chat.lastMessageSenderAccountType === \"staff\" ? (chat.assignedStaffFullName?.split(\" \")[0] ?? 'CS') : \"You\"}: ${last}`\n : \"No messages yet\";\n}\n</script>\n\n<template>\n <div class=\"flex min-h-0 flex-1 flex-col\">\n <header class=\"bg-brand-gradient px-6 pt-10 pb-12 text-primary-foreground sm:px-10 sm:pt-14\">\n <div class=\"mx-auto w-full max-w-2xl\">\n <p class=\"font-heading text-sm font-semibold tracking-wide opacity-90\">{{ brand.name }}</p>\n <h1 class=\"mt-4 font-heading text-3xl font-semibold sm:text-4xl\">{{ brand.greeting }}</h1>\n <p class=\"mt-2 max-w-md text-sm opacity-90 sm:text-base\">{{ brand.subline }}</p>\n </div>\n </header>\n\n <div class=\"min-h-0 flex-1 overflow-y-auto scrollbar-thin px-4 pt-6 pb-10 sm:px-10\">\n <div class=\"mx-auto w-full max-w-2xl space-y-3\">\n <button\n type=\"button\"\n class=\"flex w-full items-center gap-3 rounded-2xl border border-border bg-card p-4 text-left shadow-soft transition-colors hover:bg-accent/40\"\n @click=\"emit('startNew')\"\n >\n <span class=\"grid size-10 shrink-0 place-items-center rounded-full bg-primary/15 text-primary\">\n <MessageSquarePlus class=\"size-5\" />\n </span>\n <span class=\"min-w-0 flex-1\">\n <span class=\"block font-heading text-sm font-semibold\">Start a conversation</span>\n <span class=\"block text-xs text-muted-foreground\">{{ brand.replyTime }}</span>\n </span>\n <ChevronRight class=\"size-4 shrink-0 text-muted-foreground\" />\n </button>\n\n <template v-if=\"chats.length > 0\">\n <p class=\"px-1 pt-4 text-xs font-medium tracking-wide text-muted-foreground uppercase\">\n Your conversations\n </p>\n <ul class=\"space-y-2\">\n <li v-for=\"chat in chats\" :key=\"chat.id\">\n <button\n type=\"button\"\n class=\"flex w-full items-start gap-3 rounded-2xl border border-border bg-card p-4 text-left transition-colors hover:bg-accent/40\"\n @click=\"emit('open', chat)\"\n >\n <InitialsAvatar :initials=\"getInitialsFromFullName(chat.assignedStaffFullName ?? '')\" size=\"md\" tone=\"sage\" />\n <span class=\"min-w-0 flex-1\">\n <span class=\"flex items-center justify-between gap-2\">\n <span class=\"truncate font-heading text-sm font-semibold\">\n {{ chatTitle(chat) }}\n </span>\n <span class=\"shrink-0 text-[11px] text-muted-foreground\">\n {{ chat.lastMessagePreview ? relativeTime(chat.lastMessageSentAt ?? chat.updatedAt) : \"\" }}\n </span>\n </span>\n <span class=\"mt-0.5 block truncate text-xs text-muted-foreground\">\n {{ chatPreview(chat) }}\n </span>\n <span\n v-if=\"chat.closedAt\"\n class=\"mt-2 inline-flex rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground\"\n >\n Closed\n </span>\n </span>\n </button>\n </li>\n </ul>\n </template>\n\n <div class=\"pt-6 text-center\">\n <!-- onClick was a no-op in the original (onStartNew commented out) -->\n <Button variant=\"ghost\" size=\"sm\" class=\"text-xs text-muted-foreground\" @click=\"() => {}\">\n Can't find what you need? Message us\n </Button>\n </div>\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport type { HTMLAttributes } from \"vue\";\nimport { cn } from \"@/lib/utils\";\n\ndefineOptions({ name: \"Textarea\" });\n\n// Other attributes and listeners (placeholder, aria-label, onKeydown, onFocus,\n// onBlur, ...) fall through to the <textarea>.\nconst props = defineProps<{\n modelValue?: string;\n class?: HTMLAttributes[\"class\"];\n}>();\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n}>();\n</script>\n\n<template>\n <textarea\n :class=\"\n cn(\n 'flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n props.class,\n )\n \"\n :value=\"props.modelValue\"\n @input=\"emit('update:modelValue', ($event.target as HTMLTextAreaElement).value)\"\n />\n</template>\n","/**\n * Runtime configuration for the SDK.\n *\n * In the original web app these values came from VITE_* environment variables\n * (VITE_API_BASE_URL, VITE_SOCKET_BASE_URL, VITE_API_KEY, VITE_API_SECRET).\n * As a library they are supplied by the host app, either through the\n * <KiliChat :config=\"...\" /> prop or by calling configureKili() directly.\n */\nexport type KiliConfig = {\n /** Base URL of the Kili REST API, e.g. \"https://api.kili.africa\" */\n apiBaseUrl: string;\n /** Base URL of the Kili socket server. Defaults to apiBaseUrl. */\n socketBaseUrl?: string;\n /** Organisation API key */\n apiKey: string;\n /** Organisation API secret */\n apiSecret: string;\n};\n\nlet currentConfig: KiliConfig | null = null;\n\nexport function configureKili(config: KiliConfig) {\n currentConfig = config;\n}\n\nexport function getKiliConfig(): KiliConfig {\n if (!currentConfig) {\n throw new Error(\n \"Kili SDK is not configured. Render <KiliChat :config=\\\"...\\\" /> or call configureKili() first.\",\n );\n }\n return currentConfig;\n}\n\nexport function getSocketBaseUrl(): string {\n const config = getKiliConfig();\n return config.socketBaseUrl ?? config.apiBaseUrl;\n}\n\n","import axios from 'axios';\nimport { LocalStorageKeys } from './storage-keys';\nimport { getKiliConfig } from './config';\n\nconst http = axios.create();\n\nhttp.interceptors.request.use((req) => {\n const config = getKiliConfig();\n req.baseURL = config.apiBaseUrl;\n req.headers['Api-Key'] = config.apiKey;\n req.headers['Api-Secret'] = config.apiSecret;\n\n const token = localStorage.getItem(LocalStorageKeys.JwtAccessToken);\n if (token) req.headers['Authorization'] = `Bearer ${token}`;\n return req;\n});\n\nexport default http;\n","import http from '@/lib/http';\n\nconst chatService = {\n async getAllChats(userId: number) {\n const res = await http.get(`/chats?customerId=${userId}`);\n return res.data.data;\n },\n\n async getChatMessages(chatId: number) {\n const res = await http.get(`/chats/${chatId}/messages`);\n return res.data.data;\n },\n\n async startChat() {\n const res = await http.post('/chats', { initiationChannel: 'web_widget' });\n return res.data.data;\n },\n\n async sendMessage() {},\n\n async markMessageAsRead() {}\n}\n\nexport default chatService;","<script setup lang=\"ts\">\nimport { computed, onMounted, ref, watch } from \"vue\";\nimport { ArrowLeft, Paperclip, Send, Smile } from \"@lucide/vue\";\n\nimport InitialsAvatar from \"@/components/widget/InitialsAvatar.vue\";\nimport Button from \"@/components/ui/Button.vue\";\nimport Textarea from \"@/components/ui/Textarea.vue\";\nimport { brand } from \"@/lib/widget-data\";\nimport { clockTime, dayLabel } from \"@/lib/widget-format\";\nimport { Chat } from \"@/lib/types\";\nimport { useApp } from \"@/context/state\";\nimport { getInitialsFromFullName, getInitialsFromNames } from \"@/lib/utils\";\nimport chatService from \"@/services/chat.service\";\n\ndefineOptions({ name: \"ChatThread\" });\n\nconst props = defineProps<{\n chat: Chat;\n draft: string;\n typing: boolean;\n}>();\n\nconst emit = defineEmits<{\n \"update:draft\": [value: string];\n send: [];\n back: [];\n textfieldFocus: [];\n textfieldBlur: [];\n}>();\n\nconst bottomRef = ref<HTMLDivElement | null>(null);\nconst state = useApp();\n\nconst agentInitials = computed(() => getInitialsFromFullName(props.chat.assignedStaffFullName));\nconst customerInitials = computed(() => getInitialsFromFullName(props.chat.customerFullName));\nconst agentFirstName = computed(() => props.chat.assignedStaffFullName?.split(\" \")[0]);\n\nconst loadChatHistory = async () => {\n const messages = await chatService.getChatMessages(props.chat.id);\n state.setMessages(messages.data);\n}\n\nconst scrollToBottom = () => {\n bottomRef.value?.scrollIntoView({ behavior: \"smooth\", block: \"end\" });\n};\n\nwatch(() => [state.messages.length, props.typing], scrollToBottom, { flush: \"post\" });\n\nonMounted(() => {\n scrollToBottom();\n loadChatHistory();\n});\n\nfunction showDay(i: number) {\n const m = state.messages[i];\n const prev = state.messages[i - 1];\n return !prev || dayLabel(prev.sentAt) !== dayLabel(m?.sentAt);\n}\n\n// The original keyed every message row with a fresh UUID on each render.\nconst randomKey = () => crypto.randomUUID();\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n emit(\"send\");\n }\n}\n\nconst dotDelays = [\"0ms\", \"150ms\", \"300ms\"];\n</script>\n\n<template>\n <div class=\"flex min-h-0 flex-1 flex-col bg-surface\">\n <header class=\"border-b border-border bg-card px-4 py-3 sm:px-6\">\n <div class=\"mx-auto flex w-full max-w-2xl items-center gap-3\">\n <Button variant=\"ghost\" size=\"icon\" class=\"size-8 shrink-0\" aria-label=\"Back\" @click=\"emit('back')\">\n <ArrowLeft class=\"size-4\" />\n </Button>\n <InitialsAvatar :initials=\"agentInitials\" size=\"md\" tone=\"sage\" />\n <div class=\"min-w-0 flex-1\">\n <p class=\"truncate font-heading text-sm font-semibold\">{{ props.chat.assignedStaffFullName }}</p>\n <p class=\"truncate text-xs text-muted-foreground\">\n {{ props.typing ? `${agentFirstName} is typing…` : brand.replyTime }}\n </p>\n </div>\n </div>\n </header>\n\n <div class=\"min-h-0 flex-1 overflow-y-auto scrollbar-thin px-4 py-6 sm:px-6\">\n <div class=\"mx-auto w-full max-w-2xl space-y-4\">\n <div\n v-if=\"!!state.messages.length\"\n class=\"rounded-2xl border border-dashed border-border bg-card/60 p-6 text-center\"\n >\n <InitialsAvatar\n :initials=\"getInitialsFromFullName(props.chat.assignedStaffFullName)\"\n size=\"lg\"\n tone=\"sage\"\n class=\"mx-auto\"\n />\n <p class=\"mt-3 font-heading text-sm font-semibold\">Say hello to {{ agentFirstName }}</p>\n <p class=\"mt-1 text-xs text-muted-foreground\">\n Describe what you need help with and we'll take it from there.\n </p>\n </div>\n\n <div v-for=\"(m, i) in state.messages\" :key=\"randomKey()\" class=\"space-y-4\">\n <div v-if=\"showDay(i)\" class=\"flex items-center gap-3\">\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-[11px] text-muted-foreground\">{{ dayLabel(m.sentAt) }}</span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n\n <div v-if=\"m.senderAccountType === 'staff'\" class=\"flex max-w-[80%] items-end gap-2\">\n <InitialsAvatar :initials=\"getInitialsFromNames(m.senderFirstName, m.senderLastName)\" size=\"sm\" tone=\"sage\" />\n <div class=\"rounded-2xl rounded-bl-sm border border-border bg-card px-4 py-2.5\">\n <p class=\"text-sm whitespace-pre-wrap\">{{ m.content }}</p>\n <p class=\"mt-1 text-[11px] text-muted-foreground\">\n {{ m.senderFirstName }} · {{ clockTime(m.sentAt) }}\n </p>\n </div>\n </div>\n <div v-else class=\"ml-auto flex max-w-[80%] flex-row-reverse items-end gap-2\">\n <InitialsAvatar :initials=\"customerInitials\" size=\"sm\" tone=\"muted\" />\n <div class=\"rounded-2xl rounded-br-sm bg-primary px-4 py-2.5 text-primary-foreground\">\n <p class=\"text-sm whitespace-pre-wrap\">{{ m.content }}</p>\n <p class=\"mt-1 text-[11px] opacity-80\">{{ clockTime(m.sentAt) }} · Sent</p>\n </div>\n </div>\n </div>\n\n <div v-if=\"props.typing\" class=\"flex max-w-[80%] items-end gap-2\">\n <InitialsAvatar :initials=\"agentInitials\" size=\"sm\" tone=\"sage\" />\n <div class=\"flex items-center gap-1 rounded-2xl rounded-bl-sm border border-border bg-card px-4 py-3\">\n <span\n v-for=\"delay in dotDelays\"\n :key=\"delay\"\n class=\"size-1.5 animate-bounce rounded-full bg-muted-foreground/60\"\n :style=\"{ animationDelay: delay }\"\n />\n </div>\n </div>\n\n <div ref=\"bottomRef\" />\n </div>\n </div>\n\n <div class=\"border-t border-border bg-card px-4 py-3 sm:px-6\">\n <div class=\"mx-auto w-full max-w-2xl\">\n <div class=\"flex items-end gap-2\">\n <Textarea\n :model-value=\"props.draft\"\n placeholder=\"Write a message…\"\n aria-label=\"Write a message\"\n class=\"max-h-40 min-h-[44px] flex-1 resize-none bg-background text-sm\"\n @update:model-value=\"emit('update:draft', $event)\"\n @keydown=\"onKeydown\"\n @focus=\"emit('textfieldFocus')\"\n @blur=\"emit('textfieldBlur')\"\n />\n <Button\n size=\"icon\"\n class=\"size-10 shrink-0\"\n :disabled=\"!props.draft.trim()\"\n aria-label=\"Send\"\n @click=\"emit('send')\"\n >\n <Send class=\"size-4\" />\n </Button>\n </div>\n <div class=\"mt-2 flex items-center gap-2 text-muted-foreground\">\n <Paperclip class=\"size-4\" aria-hidden=\"true\" />\n <Smile class=\"size-4\" aria-hidden=\"true\" />\n <span class=\"ml-auto text-[11px]\">Enter to send · Shift + Enter for a new line</span>\n </div>\n </div>\n </div>\n </div>\n</template>\n","export const SocketEvent = Object.freeze({\n Connection: 'connection',\n Disconnect: 'disconnect',\n Error: 'error',\n\n AssignChat: 'assign_chat',\n ChatAction: 'chat_action',\n ChatAssigned: 'chat_assigned',\n ChatDeassigned: 'chat_deassigned',\n ChatStarted: 'chat_started',\n ChatUpdated: 'chat_updated',\n ChatWindowClosed: 'chat_window_closed',\n ChatWindowOpened: 'chat_window_opened',\n CloseChat: 'close_chat',\n InternalNote: 'internal_note',\n JoinAllUnclosedChatRooms: 'join_all_unclosed_chat_rooms',\n JoinChatRoom: 'join_chat_room',\n JoinedChatRoom: 'joined_chat_room',\n LeaveRoom: 'leave_room',\n MarkMsgAsRead: 'mark_msg_as_read',\n Message: 'message',\n MessageDelivered: 'message_delivered',\n NewMention: 'new_mention',\n PrioritizeChat: 'prioritize_chat',\n RefetchChats: 'refetch_chats',\n ReopenChat: 'reopen_chat',\n RefetchChatCounts: 'refetch_chat_counts',\n SnoozeChat: 'snooze_chat',\n StartChat: 'start_chat',\n});","<script setup lang=\"ts\">\nimport { onBeforeUnmount, ref, watch } from \"vue\";\nimport ChatHome from \"@/components/widget/ChatHome.vue\";\nimport ChatThread from \"@/components/widget/ChatThread.vue\";\nimport chatService from \"@/services/chat.service\";\nimport { SocketEvent } from \"@/lib/socket-events\";\nimport { getKiliConfig, getSocketBaseUrl } from \"@/lib/config\";\nimport { LocalStorageKeys, SessionStorageKeys } from \"@/lib/storage-keys\";\nimport { Chat, ChatAction, Customer, Message } from \"@/lib/types\";\nimport { Socket, io } from \"socket.io-client\";\nimport { useApp } from \"@/context/state\";\n\ndefineOptions({ name: \"ChatWidget\" });\n\nconst draft = ref(\"\");\nconst typing = ref(false);\nconst timers: ReturnType<typeof setTimeout>[] = [];\nconst state = useApp();\nconst activeChat = ref<Chat | null>(null);\n// Plain (non-reactive) holder, like React's useRef.\nconst socketRef: { current: Socket | null } = { current: null };\n\nconst appendMessage = (msg: Message) => {\n const chatJson = sessionStorage.getItem(SessionStorageKeys.ActiveChat);\n if (!chatJson) return;\n const chat = JSON.parse(chatJson);\n if (msg.chatId == chat.id) {\n state?.appendMessage(msg);\n }\n};\n\nconst handleChatAction = (action: { action: ChatAction, chatId: number }) => {\n switch (action.action) {\n case 'typing.started':\n typing.value = true;\n break;\n case 'typing.stopped':\n typing.value = false;\n break;\n case 'uploading_file.started':\n case 'uploading_file.stopped':\n default:\n break;\n }\n}\n\nconst handleChatStarted = async (chat: Chat) => {\n const user = JSON.parse(localStorage.getItem(LocalStorageKeys.User)!);\n if (chat.customerId != user.id) {\n console.log('chat created by a different cstomer');\n return;\n }\n\n socketRef.current?.emit(SocketEvent.JoinChatRoom, chat.id);\n\n const chats = await chatService.getAllChats(user.id);\n state?.setChats(chats.data);\n\n persistActiveChat(chat);\n}\n\nconst updateChat = (chat: Chat) => {\n const acJson = sessionStorage.getItem(SessionStorageKeys.ActiveChat);\n if (!acJson) return;\n const ac: Chat = JSON.parse(acJson);\n if (ac && ac.id === chat.id) {\n activeChat.value = chat;\n }\n}\n\nconst persistActiveChat = (c: Chat | null) => {\n activeChat.value = c;\n if (!c) {\n sessionStorage.removeItem(SessionStorageKeys.ActiveChat);\n } else {\n sessionStorage.setItem(SessionStorageKeys.ActiveChat, JSON.stringify(c));\n }\n}\n\nonBeforeUnmount(() => {\n timers.forEach(clearTimeout);\n});\n\nwatch(\n () => [state.user, state.accessToken],\n () => {\n if (!state || !state.user || !state.accessToken) return;\n if (socketRef.current) return;\n const socket = io(getSocketBaseUrl(), {\n extraHeaders: {\n 'Api-Key': getKiliConfig().apiKey,\n 'Api-Secret': getKiliConfig().apiSecret,\n 'Authorization': `Bearer ${state.accessToken}`\n },\n });\n\n socket.on('connect', () => {\n console.log('socket connected');\n socket.emit(SocketEvent.JoinAllUnclosedChatRooms);\n socket.on(SocketEvent.ChatAction, handleChatAction);\n socket.on(SocketEvent.ChatStarted, handleChatStarted);\n socket.on(SocketEvent.ChatUpdated, updateChat);\n socket.on(SocketEvent.MessageDelivered, appendMessage);\n });\n socket.on(SocketEvent.Disconnect, () => {\n console.log('socket disconnected');\n });\n socket.on(SocketEvent.Error, (err) => {\n console.log(socket.id, 'has an error', err);\n });\n socketRef.current = socket;\n },\n { immediate: true },\n);\n\nconst sendMessage = () => {\n if (!activeChat.value) return;\n const user: Customer = state?.user ?? JSON.parse(localStorage.getItem(LocalStorageKeys.User)!);\n const msg: Partial<Message> = {\n chatId: Number(activeChat.value.id),\n content: draft.value.trim(),\n senderEmail: user.email!,\n senderId: user.id,\n sentAt: new Date().toISOString(),\n senderAccountType: 'CUSTOMER',\n senderFirstName: user.firstName!,\n senderLastName: user.lastName!,\n type: 'TEXT',\n };\n socketRef.current!.emit(SocketEvent.ChatAction, {\n action: 'typing.stopped',\n chatId: activeChat.value.id,\n });\n socketRef.current!.emit(SocketEvent.Message, msg);\n draft.value = '';\n};\n\nconst startChatOld = async () => {\n const chat = await chatService.startChat();\n socketRef.current?.emit(SocketEvent.JoinChatRoom, { chatId: chat.id });\n\n const user = JSON.parse(localStorage.getItem(LocalStorageKeys.User)!);\n const chats = await chatService.getAllChats(user.id);\n state?.setChats(chats.data);\n\n persistActiveChat(chat);\n draft.value = \"\";\n};\n\nconst startChat = () => {\n socketRef?.current?.emit(SocketEvent.StartChat, { initiationChannel: 'web_widget' });\n draft.value = \"\";\n};\n\nconst onBack = () => {\n persistActiveChat(null);\n typing.value = false;\n};\n\nconst onTextFieldBlur = () => {\n socketRef.current?.emit(SocketEvent.ChatAction, {\n action: 'typing.stopped',\n chatId: activeChat.value?.id,\n });\n};\n\nconst onTextfieldFocus = () => {\n socketRef.current?.emit(SocketEvent.ChatAction, {\n action: 'typing.started',\n chatId: activeChat.value?.id,\n });\n};\n\nconst onOpen = (c: Chat) => {\n persistActiveChat(c);\n draft.value = \"\";\n};\n</script>\n\n<template>\n <div v-if=\"state\" class=\"kili-root flex h-dvh w-full flex-col overflow-hidden bg-background\">\n <ChatThread\n v-if=\"activeChat\"\n v-model:draft=\"draft\"\n :chat=\"activeChat\"\n :typing=\"typing\"\n @send=\"sendMessage\"\n @back=\"onBack\"\n @textfield-blur=\"onTextFieldBlur\"\n @textfield-focus=\"onTextfieldFocus\"\n />\n <ChatHome v-else :chats=\"state.chats\" @open=\"onOpen\" @start-new=\"startChat\" />\n </div>\n</template>\n","import { LocalStorageKeys } from '@/lib/storage-keys';\nimport randomName from '@scaleway/random-name';\nimport http from '@/lib/http';\n\nconst coreService = {\n async createCustomer() {\n let user = localStorage.getItem(LocalStorageKeys.User);\n if (user) return JSON.parse(user);\n\n const [fname, lname] = randomName('', ' ').split(' ');\n const res = await http.post('/customers', {\n city: 'Denver',\n country: 'united states',\n device: 'iPhone 17 pro',\n email: `${fname}.${lname}@kili.africa`,\n firstName: fname,\n id: crypto.randomUUID(),\n lastName: lname,\n phoneCountryCode: '1',\n phoneNumberSuffix: '1234567',\n state: 'Colorado',\n });\n console.dir({ createdCustomer: res.data }, { depth: null });\n localStorage.setItem(LocalStorageKeys.User, JSON.stringify(res.data.data));\n return res.data.data;\n },\n\n async registerCustomer() {\n const data = localStorage.getItem(LocalStorageKeys.User);\n const user = JSON.parse(data!);\n const res = await http.put('/customers', {\n id: user.userId,\n email: user.email,\n });\n localStorage.setItem(LocalStorageKeys.JwtAccessToken, res.data.data.accessToken)\n localStorage.setItem(LocalStorageKeys.AccessTokenExp, res.data.data.expiresAt );\n return res.data.data;\n },\n\n async setCustomerHmac() {\n /**\n * check if there is a user\n * if no user, create user and save\n * get existing user\n * use the user id to set hmac\n */\n const data = localStorage.getItem(LocalStorageKeys.User);\n const user = JSON.parse(data!);\n const hmac = crypto.randomUUID();\n await http.patch(`/customers/${user.userId}/hmac`, { hmac });\n },\n}\n\nexport default coreService;","<script setup lang=\"ts\">\nimport { onMounted } from \"vue\";\nimport ChatWidget from \"@/components/widget/ChatWidget.vue\";\nimport coreService from \"@/services/core.service\";\nimport chatService from \"@/services/chat.service\";\nimport { useApp } from \"@/context/state\";\n\ndefineOptions({ name: \"KiliChatBootstrap\" });\n\nconst state = useApp();\n\nconst onMount = async () => {\n const customer = await coreService.createCustomer();\n await coreService.setCustomerHmac();\n const auth = await coreService.registerCustomer();\n\n state?.setUser(customer);\n state?.setAccessToken(auth.accessToken);\n\n const chats = await chatService.getAllChats(customer.id);\n state?.setChats(chats.data);\n}\n\nonMounted(() => {\n onMount();\n});\n</script>\n\n<template>\n <ChatWidget />\n</template>\n","<script setup lang=\"ts\">\nimport { watch } from \"vue\";\nimport AppStateProvider from \"@/context/AppStateProvider.vue\";\nimport KiliChatBootstrap from \"./KiliChatBootstrap.vue\";\nimport { configureKili } from \"@/lib/config\";\nimport type { KiliChatProps } from \"./kili-chat\";\n\n/**\n * Drop-in Kili support chat. This is the library equivalent of the\n * kili-customer-fe \"/\" route: it wraps the widget in the app state provider\n * and bootstraps the customer session on mount.\n */\ndefineOptions({ name: \"KiliChat\" });\n\nconst props = defineProps<KiliChatProps>();\n\n// Configure synchronously during setup so the config is in place before any\n// child runs (e.g. the socket connection in ChatWidget), and again whenever\n// the host app passes a new config.\nconfigureKili(props.config);\nwatch(() => props.config, (config) => configureKili(config), { deep: true });\n</script>\n\n<template>\n <AppStateProvider>\n <KiliChatBootstrap />\n </AppStateProvider>\n</template>\n","import type { Socket } from 'socket.io-client';\nimport { inject, type InjectionKey, type ShallowRef } from 'vue';\n\nexport const SocketContext: InjectionKey<ShallowRef<Socket | null>> = Symbol('KiliSocket');\n\n/** Returns the socket provided by SocketProvider (null until it connects). */\nexport function useSocket(): ShallowRef<Socket | null> | null {\n return inject(SocketContext, null);\n}\n","<script setup lang=\"ts\">\nimport { io, Socket } from 'socket.io-client';\nimport { inject, provide, shallowRef, watch } from 'vue';\nimport { AppStateContext } from './state';\nimport { SocketContext } from './socket';\nimport { SocketEvent } from '@/lib/socket-events';\nimport { getKiliConfig, getSocketBaseUrl } from '@/lib/config';\n\nconst socket = shallowRef<Socket | null>(null);\nconst state = inject(AppStateContext, null);\n\nwatch(\n () => [state?.user, state?.accessToken],\n () => {\n if (!state || !state.user || !state.accessToken) return;\n if (socket.value) return;\n const socketClient = io(getSocketBaseUrl(), {\n extraHeaders: {\n 'Api-Key': getKiliConfig().apiKey,\n 'Api-Secret': getKiliConfig().apiSecret,\n 'Authorization': `Bearer ${state.accessToken}`\n },\n });\n\n socketClient.on('connect', () => {\n console.log(socketClient.id, 'connected to the socket');\n socketClient.emit(SocketEvent.JoinAllUnclosedChatRooms);\n socketClient.on(SocketEvent.JoinedChatRoom, (roomId) => console.log('joined chat room', roomId));\n });\n socketClient.on(SocketEvent.Disconnect, () => {\n console.log(socketClient.id, 'has disconnected from the socket');\n });\n socketClient.on(SocketEvent.Error, (err) => {\n console.log(socketClient.id, 'has an error', err);\n });\n socket.value = socketClient;\n },\n { immediate: true },\n);\n\nprovide(SocketContext, socket);\n</script>\n\n<template>\n <slot />\n</template>\n","import { computed, onBeforeUnmount, onMounted, ref, type ComputedRef } from \"vue\";\n\nconst MOBILE_BREAKPOINT = 768;\n\nexport function useIsMobile(): ComputedRef<boolean> {\n const isMobile = ref<boolean | undefined>(undefined);\n let mql: MediaQueryList | null = null;\n\n const onChange = () => {\n isMobile.value = window.innerWidth < MOBILE_BREAKPOINT;\n };\n\n onMounted(() => {\n mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);\n mql.addEventListener(\"change\", onChange);\n isMobile.value = window.innerWidth < MOBILE_BREAKPOINT;\n });\n\n onBeforeUnmount(() => mql?.removeEventListener(\"change\", onChange));\n\n return computed(() => !!isMobile.value);\n}\n"],"mappings":";;;;;;;;;AAAA,IAAag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AAQ,OAAO,aAAaJ;CACvC;CAUA,OARAzD,QAAgB;EAGd,AAFA,IAAM,OAAO,WAAW,oBAAyC,GACjE4D,EAAI,iBAAiB,UAAUC,CAAQ,GACvC,EAAS,QAAQ,OAAO,aAAaJ;CACvC,CAAC,GAEDxB,QAAsB2B,GAAK,oBAAoB,UAAUC,CAAQ,CAAC,GAE3DjL,QAAe,CAAC,CAAC+K,EAAS,KAAK;AACxC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime configuration for the SDK.
|
|
3
|
+
*
|
|
4
|
+
* In the original web app these values came from VITE_* environment variables
|
|
5
|
+
* (VITE_API_BASE_URL, VITE_SOCKET_BASE_URL, VITE_API_KEY, VITE_API_SECRET).
|
|
6
|
+
* As a library they are supplied by the host app, either through the
|
|
7
|
+
* <KiliChat :config="..." /> prop or by calling configureKili() directly.
|
|
8
|
+
*/
|
|
9
|
+
export type KiliConfig = {
|
|
10
|
+
/** Base URL of the Kili REST API, e.g. "https://api.kili.africa" */
|
|
11
|
+
apiBaseUrl: string;
|
|
12
|
+
/** Base URL of the Kili socket server. Defaults to apiBaseUrl. */
|
|
13
|
+
socketBaseUrl?: string;
|
|
14
|
+
/** Organisation API key */
|
|
15
|
+
apiKey: string;
|
|
16
|
+
/** Organisation API secret */
|
|
17
|
+
apiSecret: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function configureKili(config: KiliConfig): void;
|
|
20
|
+
export declare function getKiliConfig(): KiliConfig;
|
|
21
|
+
export declare function getSocketBaseUrl(): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const SocketEvent: Readonly<{
|
|
2
|
+
Connection: "connection";
|
|
3
|
+
Disconnect: "disconnect";
|
|
4
|
+
Error: "error";
|
|
5
|
+
AssignChat: "assign_chat";
|
|
6
|
+
ChatAction: "chat_action";
|
|
7
|
+
ChatAssigned: "chat_assigned";
|
|
8
|
+
ChatDeassigned: "chat_deassigned";
|
|
9
|
+
ChatStarted: "chat_started";
|
|
10
|
+
ChatUpdated: "chat_updated";
|
|
11
|
+
ChatWindowClosed: "chat_window_closed";
|
|
12
|
+
ChatWindowOpened: "chat_window_opened";
|
|
13
|
+
CloseChat: "close_chat";
|
|
14
|
+
InternalNote: "internal_note";
|
|
15
|
+
JoinAllUnclosedChatRooms: "join_all_unclosed_chat_rooms";
|
|
16
|
+
JoinChatRoom: "join_chat_room";
|
|
17
|
+
JoinedChatRoom: "joined_chat_room";
|
|
18
|
+
LeaveRoom: "leave_room";
|
|
19
|
+
MarkMsgAsRead: "mark_msg_as_read";
|
|
20
|
+
Message: "message";
|
|
21
|
+
MessageDelivered: "message_delivered";
|
|
22
|
+
NewMention: "new_mention";
|
|
23
|
+
PrioritizeChat: "prioritize_chat";
|
|
24
|
+
RefetchChats: "refetch_chats";
|
|
25
|
+
ReopenChat: "reopen_chat";
|
|
26
|
+
RefetchChatCounts: "refetch_chat_counts";
|
|
27
|
+
SnoozeChat: "snooze_chat";
|
|
28
|
+
StartChat: "start_chat";
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type Chat = {
|
|
2
|
+
id: number;
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
updatedAt: string;
|
|
5
|
+
assignedStaffEmail?: string;
|
|
6
|
+
assignedStaffFullName?: string;
|
|
7
|
+
assignedStaffId?: number;
|
|
8
|
+
assignmentStatus: string;
|
|
9
|
+
closedAt?: Date;
|
|
10
|
+
customerEmail?: string;
|
|
11
|
+
customerFullName?: string;
|
|
12
|
+
customerId?: number;
|
|
13
|
+
initiationChannel?: string;
|
|
14
|
+
lastMessageSentAt?: string;
|
|
15
|
+
lastMessagePreview?: string;
|
|
16
|
+
lastMessageSenderAccountType?: 'customer' | 'staff';
|
|
17
|
+
priority: string;
|
|
18
|
+
snoozedAt?: string;
|
|
19
|
+
snoozedByStaffEmail?: string;
|
|
20
|
+
snoozedUntil?: string;
|
|
21
|
+
staffMemberEmailsMentioned?: string;
|
|
22
|
+
status: string;
|
|
23
|
+
summary?: string;
|
|
24
|
+
tags: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
};
|
|
27
|
+
export type ChatAction = 'typing.started' | 'typing.stopped' | 'uploading_file.started' | 'uploading_file.stopped';
|
|
28
|
+
export type Customer = {
|
|
29
|
+
id: number;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
32
|
+
city?: string;
|
|
33
|
+
country?: string;
|
|
34
|
+
device?: string;
|
|
35
|
+
email?: string;
|
|
36
|
+
firstName?: string;
|
|
37
|
+
identifier?: string;
|
|
38
|
+
lastName?: string;
|
|
39
|
+
middleName?: string;
|
|
40
|
+
orgId?: number;
|
|
41
|
+
phoneCountryCode?: string;
|
|
42
|
+
phoneNumberSuffix?: string;
|
|
43
|
+
state?: string;
|
|
44
|
+
username?: string;
|
|
45
|
+
};
|
|
46
|
+
export type Message = {
|
|
47
|
+
id: number;
|
|
48
|
+
createdAt: Date;
|
|
49
|
+
updatedAt: Date;
|
|
50
|
+
attachmentPath?: string;
|
|
51
|
+
attachmentType?: string;
|
|
52
|
+
attachmentUrl?: string;
|
|
53
|
+
deliveredAt?: Date;
|
|
54
|
+
chatId?: number;
|
|
55
|
+
content?: string;
|
|
56
|
+
extraData?: string;
|
|
57
|
+
openedByReceiverAt?: Date;
|
|
58
|
+
orgId?: number;
|
|
59
|
+
senderEmail?: string;
|
|
60
|
+
senderId?: number;
|
|
61
|
+
sentAt?: string;
|
|
62
|
+
senderAccountType?: string;
|
|
63
|
+
senderFirstName?: string;
|
|
64
|
+
senderLastName?: string;
|
|
65
|
+
mentionedStaffEmails?: string;
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type MessageKind = "customer" | "agent";
|
|
2
|
+
export type WidgetMessage = {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: MessageKind;
|
|
5
|
+
body: string;
|
|
6
|
+
at: string;
|
|
7
|
+
authorId?: string;
|
|
8
|
+
};
|
|
9
|
+
export type Agent = {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
initials: string;
|
|
13
|
+
role: string;
|
|
14
|
+
};
|
|
15
|
+
export type WidgetConversation = {
|
|
16
|
+
id: string;
|
|
17
|
+
subject: string;
|
|
18
|
+
agentId: string;
|
|
19
|
+
messages: WidgetMessage[];
|
|
20
|
+
closed?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare const brand: {
|
|
23
|
+
name: string;
|
|
24
|
+
greeting: string;
|
|
25
|
+
subline: string;
|
|
26
|
+
replyTime: string;
|
|
27
|
+
};
|
|
28
|
+
export declare const customer: {
|
|
29
|
+
name: string;
|
|
30
|
+
initials: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const agents: Agent[];
|
|
33
|
+
export declare const seedConversations: WidgetConversation[];
|
|
34
|
+
export declare function nextCannedReply(): string;
|
|
35
|
+
export declare function agentById(id: string): Agent;
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@import "https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Space+Grotesk:wght@400;500;600;700&display=swap";@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme;@layer base{.kili-root,.kili-root *,.kili-root :after,.kili-root :before,.kili-root ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}.kili-root ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}.kili-root{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;line-height:1.5}.kili-root hr{height:0;color:inherit;border-top-width:1px}.kili-root :is(h1,h2,h3,h4,h5,h6){font-size:inherit;font-weight:inherit}.kili-root a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}.kili-root :is(b,strong){font-weight:bolder}.kili-root :is(code,kbd,samp,pre){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.kili-root small{font-size:80%}.kili-root table{text-indent:0;border-color:inherit;border-collapse:collapse}.kili-root :is(ol,ul,menu){list-style:none}.kili-root :is(img,svg,video,canvas,audio,iframe,embed,object){vertical-align:middle;display:block}.kili-root :is(img,video){max-width:100%;height:auto}.kili-root :is(button,input,select,optgroup,textarea){font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.kili-root ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.kili-root ::placeholder{opacity:1;color:currentColor}@supports (color:color-mix(in lab, red, red)){.kili-root ::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}.kili-root textarea{resize:vertical}.kili-root :is(button,input:where([type=button],[type=reset],[type=submit])){appearance:button}.kili-root ::file-selector-button{appearance:button}.kili-root [hidden]:where(:not([hidden=until-found])){display:none!important}.kili-root{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:DM Sans,sans-serif}.kili-root *,.kili-root :after,.kili-root :before{border-color:var(--border)}.kili-root :is(h1,h2,h3,h4,h5,h6){font-family:Space Grotesk,sans-serif}}@layer components;@layer utilities{.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.m-4{margin:1rem}.m-5{margin:1.25rem}.m-6{margin:1.5rem}.m-7{margin:1.75rem}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.size-1\.5{width:.375rem;height:.375rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-7{width:1.75rem;height:1.75rem}.size-8{width:2rem;height:2rem}.size-9{width:2.25rem;height:2.25rem}.size-10{width:2.5rem;height:2.5rem}.size-12{width:3rem;height:3rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-10{height:2.5rem}.h-dvh{height:100dvh}.h-px{height:1px}.max-h-40{max-height:10rem}.min-h-0{min-height:0}.min-h-\[44px\]{min-height:44px}.min-h-\[60px\]{min-height:60px}.w-9{width:2.25rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-\[80\%\]{max-width:80%}.max-w-md{max-width:28rem}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.animate-bounce{animation:1s infinite bounce}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.scrollbar-thin{scrollbar-color:var(--border) transparent;scrollbar-width:thin}.flex-col{flex-direction:column}.flex-row-reverse{flex-direction:row-reverse}.place-items-center{place-items:center}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(.25rem * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(.25rem * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(.25rem * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(.25rem * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(.25rem * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(.25rem * 4) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-2xl{border-radius:calc(var(--radius) + 8px)}.rounded-full{border-radius:2147483647px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-br-sm{border-bottom-right-radius:calc(var(--radius) - 4px)}.rounded-bl-sm{border-bottom-left-radius:calc(var(--radius) - 4px)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border{border-color:var(--border)}.border-input{border-color:var(--input)}.bg-background{background-color:var(--background)}.bg-border{background-color:var(--border)}.bg-card,.bg-card\/60{background-color:var(--card)}@supports (color:color-mix(in lab, red, red)){.bg-card\/60{background-color:color-mix(in oklab, var(--card) 60%, transparent)}}.bg-destructive{background-color:var(--destructive)}.bg-muted{background-color:var(--muted)}.bg-muted-foreground\/60{background-color:var(--muted-foreground)}@supports (color:color-mix(in lab, red, red)){.bg-muted-foreground\/60{background-color:color-mix(in oklab, var(--muted-foreground) 60%, transparent)}}.bg-primary,.bg-primary\/15{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/15{background-color:color-mix(in oklab, var(--primary) 15%, transparent)}}.bg-sage\/20{background-color:var(--sage)}@supports (color:color-mix(in lab, red, red)){.bg-sage\/20{background-color:color-mix(in oklab, var(--sage) 20%, transparent)}}.bg-secondary{background-color:var(--secondary)}.bg-surface{background-color:var(--surface)}.bg-transparent{background-color:#0000}.bg-brand-gradient{background-image:var(--gradient-brand)}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-inline:.25rem}.px-2{padding-inline:.5rem}.px-3{padding-inline:.75rem}.px-4{padding-inline:1rem}.px-6{padding-inline:1.5rem}.px-8{padding-inline:2rem}.py-0\.5{padding-block:.125rem}.py-2{padding-block:.5rem}.py-2\.5{padding-block:.625rem}.py-3{padding-block:.75rem}.py-6{padding-block:1.5rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.pt-10{padding-top:2.5rem}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.text-center{text-align:center}.text-left{text-align:left}.font-heading{font-family:Space Grotesk,sans-serif}.text-3xl{font-size:1.875rem;line-height:var(--tw-leading,calc(2.25 / 1.875))}.text-base{font-size:1rem;line-height:var(--tw-leading,calc(1.5 / 1))}.text-sm{font-size:.875rem;line-height:var(--tw-leading,calc(1.25 / .875))}.text-xs{font-size:.75rem;line-height:var(--tw-leading,calc(1 / .75))}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:500;font-weight:500}.font-semibold{--tw-font-weight:600;font-weight:600}.tracking-tight{--tw-tracking:-.025em;letter-spacing:-.025em}.tracking-wide{--tw-tracking:.025em;letter-spacing:.025em}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-destructive-foreground{color:var(--destructive-foreground)}.text-forest{color:var(--forest)}.text-muted-foreground{color:var(--muted-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.uppercase{text-transform:uppercase}.underline-offset-4{text-underline-offset:4px}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.shadow,.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-soft{box-shadow:var(--shadow-soft)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,cubic-bezier(.4, 0, .2, 1));transition-duration:var(--tw-duration,.15s)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}@media (hover:hover){.hover\:bg-accent:hover,.hover\:bg-accent\/40:hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent\/40:hover{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\:underline:hover{text-decoration-line:underline}}.focus-visible\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:var(--ring)}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (min-width:40rem){.sm\:px-6{padding-inline:1.5rem}.sm\:px-10{padding-inline:2.5rem}.sm\:pt-14{padding-top:3.5rem}.sm\:text-4xl{font-size:2.25rem;line-height:var(--tw-leading,calc(2.5 / 2.25))}.sm\:text-base{font-size:1rem;line-height:var(--tw-leading,calc(1.5 / 1))}}@media (min-width:48rem){.md\:text-sm{font-size:.875rem;line-height:var(--tw-leading,calc(1.25 / .875))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}.kili-root{--radius:.875rem;--background:oklch(98% .004 78.2);--foreground:oklch(29.7% 0 263.3);--surface:oklch(96.2% .008 79);--surface-foreground:oklch(29.7% 0 263.3);--card:oklch(100% 0 0);--card-foreground:oklch(29.7% 0 263.3);--popover:oklch(100% 0 0);--popover-foreground:oklch(29.7% 0 263.3);--primary:oklch(61.3% .128 36.7);--primary-foreground:oklch(100% 0 0);--secondary:oklch(94.2% .012 79.8);--secondary-foreground:oklch(35% .03 60);--muted:oklch(94.2% .012 79.8);--muted-foreground:oklch(52% .02 70);--accent:oklch(92% .03 60);--accent-foreground:oklch(35% .05 45);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(98.4% .003 247.858);--border:oklch(88% .02 79.8);--input:oklch(88% .02 79.8);--ring:oklch(61.3% .128 36.7);--terracotta:oklch(61.3% .128 36.7);--sage:oklch(69.4% .077 136.1);--forest:oklch(48% .068 138.5);--peach:oklch(78.2% .096 55.3);--violet:oklch(58% .16 300);--success:oklch(60% .13 150);--warning:oklch(75% .14 75);--info:oklch(60% .11 240);--sidebar:oklch(96.2% .008 79);--sidebar-foreground:oklch(29.7% 0 263.3);--sidebar-primary:oklch(61.3% .128 36.7);--sidebar-primary-foreground:oklch(100% 0 0);--sidebar-accent:oklch(92% .02 79.8);--sidebar-accent-foreground:oklch(29.7% 0 263.3);--sidebar-border:oklch(88% .02 79.8);--sidebar-ring:oklch(61.3% .128 36.7);--chart-1:oklch(61.3% .128 36.7);--chart-2:oklch(69.4% .077 136.1);--chart-3:oklch(78.2% .096 55.3);--chart-4:oklch(58% .16 300);--chart-5:oklch(60% .11 240);--shadow-soft:0 1px 2px oklch(29.7% 0 263.3/.06), 0 8px 24px -12px oklch(29.7% 0 263.3/.18);--gradient-brand:linear-gradient(135deg, var(--terracotta), var(--peach))}.dark .kili-root,.kili-root.dark{--background:oklch(21% .012 60);--foreground:oklch(95% .006 80);--surface:oklch(25% .014 60);--surface-foreground:oklch(95% .006 80);--card:oklch(25% .014 60);--card-foreground:oklch(95% .006 80);--popover:oklch(25% .014 60);--popover-foreground:oklch(95% .006 80);--primary:oklch(68% .135 38);--primary-foreground:oklch(20% .02 40);--secondary:oklch(30% .016 60);--secondary-foreground:oklch(95% .006 80);--muted:oklch(30% .016 60);--muted-foreground:oklch(72% .015 75);--accent:oklch(33% .03 45);--accent-foreground:oklch(95% .006 80);--destructive:oklch(65% .2 27);--destructive-foreground:oklch(98% .003 248);--border:oklch(100% 0 0/.12);--input:oklch(100% 0 0/.16);--ring:oklch(68% .135 38);--terracotta:oklch(68% .135 38);--sage:oklch(72% .08 136);--forest:oklch(60% .08 138);--peach:oklch(80% .1 55);--violet:oklch(70% .14 300);--success:oklch(70% .13 150);--warning:oklch(80% .13 75);--info:oklch(70% .1 240);--sidebar:oklch(24% .014 60);--sidebar-foreground:oklch(95% .006 80);--sidebar-primary:oklch(68% .135 38);--sidebar-primary-foreground:oklch(20% .02 40);--sidebar-accent:oklch(31% .018 60);--sidebar-accent-foreground:oklch(95% .006 80);--sidebar-border:oklch(100% 0 0/.12);--sidebar-ring:oklch(68% .135 38);--shadow-soft:0 1px 2px oklch(0% 0 0/.4), 0 10px 30px -14px oklch(0% 0 0/.6)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kilichat/vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Vue SDK for the Kili customer support chat widget",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"kili",
|
|
8
|
+
"chat",
|
|
9
|
+
"support",
|
|
10
|
+
"widget",
|
|
11
|
+
"vue"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"**/*.css"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.cjs",
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.cjs"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"./styles.css": "./dist/styles.css",
|
|
32
|
+
"./package.json": "./package.json"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "npm run build:js && npm run build:css",
|
|
41
|
+
"build:js": "vite build",
|
|
42
|
+
"build:css": "tailwindcss -i ./src/styles.css -o ./dist/styles.css --minify",
|
|
43
|
+
"dev": "concurrently \"vite build --watch\" \"tailwindcss -i ./src/styles.css -o ./dist/styles.css --watch\"",
|
|
44
|
+
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p playground",
|
|
45
|
+
"prepublishOnly": "npm run typecheck && npm run build",
|
|
46
|
+
"playground": "vite --config playground/vite.config.ts"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"vue": "^3.3.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@lucide/vue": "^1.75.0",
|
|
53
|
+
"@scaleway/random-name": "^6.0.2",
|
|
54
|
+
"axios": "^1.20.0",
|
|
55
|
+
"class-variance-authority": "^0.7.1",
|
|
56
|
+
"clsx": "^2.1.1",
|
|
57
|
+
"socket.io-client": "^4.8.3",
|
|
58
|
+
"tailwind-merge": "^3.5.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@tailwindcss/cli": "^4.2.1",
|
|
62
|
+
"@tailwindcss/vite": "^4.3.5",
|
|
63
|
+
"@types/node": "^22.0.0",
|
|
64
|
+
"@vitejs/plugin-vue": "^6.0.11",
|
|
65
|
+
"concurrently": "^9.1.2",
|
|
66
|
+
"tailwindcss": "^4.2.1",
|
|
67
|
+
"tw-animate-css": "^1.3.4",
|
|
68
|
+
"typescript": "^5.8.3",
|
|
69
|
+
"vite": "^8.3.8",
|
|
70
|
+
"vite-plugin-dts": "^5.1.2",
|
|
71
|
+
"vue": "^3.5.0",
|
|
72
|
+
"vue-tsc": "^3.3.14"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"access": "public"
|
|
76
|
+
}
|
|
77
|
+
}
|