@pagelines/sdk 1.0.662 → 1.0.663
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/AgentProvider.js +2782 -0
- package/dist/AgentProvider.js.map +1 -0
- package/dist/AgentWidgetInline.js +44 -32
- package/dist/AgentWidgetInline.js.map +1 -1
- package/dist/AgentWidgetModal.js +75 -64
- package/dist/AgentWidgetModal.js.map +1 -1
- package/dist/AgentWrap.js +5251 -0
- package/dist/AgentWrap.js.map +1 -0
- package/dist/FModal.js +165 -0
- package/dist/FModal.js.map +1 -0
- package/dist/agent.js +157 -186
- package/dist/agent.js.map +1 -1
- package/dist/constants.js +80 -0
- package/dist/constants.js.map +1 -0
- package/dist/contract.js +6271 -0
- package/dist/contract.js.map +1 -0
- package/dist/demo.js +242 -259
- package/dist/demo.js.map +1 -1
- package/dist/node_modules/.vue-global-types/vue_3.5_false.d.ts +4 -0
- package/dist/rolldown-runtime.js +14 -0
- package/dist/sdk.css +2 -1
- package/dist/sdk.js +4 -14
- package/dist/sdkClient.js +775 -867
- package/dist/sdkClient.js.map +1 -1
- package/dist/useWidgetState.js +21 -0
- package/dist/useWidgetState.js.map +1 -0
- package/dist/widget.js +721 -7
- package/dist/widget.js.map +1 -1
- package/package.json +12 -12
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js +0 -4208
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/AgentWidgetOnboard.js +0 -5
- package/dist/AgentWidgetOnboard.js.map +0 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +0 -5098
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/FModal.vue_vue_type_script_setup_true_lang.js +0 -181
- package/dist/FModal.vue_vue_type_script_setup_true_lang.js.map +0 -1
- package/dist/agent/test/AgentController.test.d.ts +0 -1
- package/dist/agent/test/ChatRichText.client.test.d.ts +0 -1
- package/dist/agent/test/ChatVisualBlock.client.test.d.ts +0 -1
- package/dist/agent/test/ElAgentChat.client.test.d.ts +0 -1
- package/dist/agent/test/ElAgentChatPreview.client.test.d.ts +0 -1
- package/dist/agent/test/VoiceRecorderController.unit.test.d.ts +0 -1
- package/dist/agent/test/auth-inputs.test.d.ts +0 -1
- package/dist/agent/test/chat-visual-format.unit.test.d.ts +0 -1
- package/dist/agent/test/utils.test.d.ts +0 -1
- package/dist/agent/test/webhook.test.d.ts +0 -1
- package/dist/contract/regenerate.d.ts +0 -2
- package/dist/contract/test/build.unit.test.d.ts +0 -1
- package/dist/contract/test/conversation-wire-shapes.unit.test.d.ts +0 -14
- package/dist/contract/test/snapshot.unit.test.d.ts +0 -1
- package/dist/index.js +0 -872
- package/dist/index.js.map +0 -1
- package/dist/sdk.js.map +0 -1
- package/dist/socialPlatforms.js +0 -82
- package/dist/socialPlatforms.js.map +0 -1
- package/dist/test/agent-client.test.d.ts +0 -4
- package/dist/test/api.test.d.ts +0 -1
- package/dist/test/billing-client.test.d.ts +0 -4
- package/dist/test/build.test.d.ts +0 -1
- package/dist/test/chat-authenticated.test.d.ts +0 -1
- package/dist/test/chat-issue-presentation.test.d.ts +0 -1
- package/dist/test/derive-mode.test.d.ts +0 -1
- package/dist/test/sdk-token-capture.test.d.ts +0 -13
- package/dist/vite.config.sdk.d.ts +0 -2
- package/dist/vitest.config.d.ts +0 -2
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sources":["../agent/ui/AgentModal.vue","../agent/ui/AgentWidget.vue","../agent/ui/ElAgentChatPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '@/ui/common/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"names":["emit","__emit","_createBlock","FModal","__props","_cache","val","_createElementVNode","_hoisted_1","_createVNode","AgentProvider","props","isOpen","ref","isAgentActive","toggle","__name","watch","newValue","nextTick","open","close","handleClose","__expose","AgentWrap","agent","resolvedSdk","_createElementBlock","_normalizeStyle","$event","_openBlock","_hoisted_2","_hoisted_4","AgentChat","_normalizeClass","_Fragment","_renderList","message","index","ChatRichText"],"mappings":";;;;;;;;;;;;;;;;;;;;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UE+B,GAAA;AAAA;cARA,OAAM;AAAA,cACL,KAAKP;AAAA,cACL,OAAAD;AAAA,cACA,SAASrB,EAAA;AAAA,cACT,iBAAeA,EAAA;AAAA,cACf,aAAW;AAAA,cACX,aAAWU,EAAA;AAAA,cACX,SAAOQ;AAAA,YAAA;;;;;;;;;;;;;;2BC1GhBK,EA2BM,OAAA;AAAA,MA1BJ,OAAKO,EAAA,CAAC,+CACE9B,EAAA,YAAO,SAAA,eAAA,gBAAA,CAAA;AAAA,MACf,aAAU;AAAA,IAAA;OAEV0B,EAAA,EAAA,GAAAH,EAqBMQ,GAAA,MAAAC,EApBuBhC,EAAA,UAAQ,CAA3BiC,GAASC,YADnBX,EAqBM,OAAA;AAAA,QAnBH,KAAG,GAAKU,EAAQ,MAAM,IAAIC,CAAK;AAAA,QAChC,OAAKJ,EAAA,CAAC,QACEG,EAAQ,WAAM,SAAA,gBAAA,eAAA,CAAA;AAAA,QACtB,aAAU;AAAA,QACT,eAAaA,EAAQ;AAAA,MAAA;QAEtB9B,EAYM,OAAA;AAAA,UAXJ,OAAK2B,EAAA,CAAC,oFACEG,EAAQ,WAAM,qCAA8DjC,EAAA,YAAO;;UAM3FK,EAGE8B,GAAA;AAAA,YAFC,MAAMF,EAAQ;AAAA,YACd,UAAUA,EAAQ,qBAAqBjC,EAAA,YAAO;AAAA,UAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"agent.js","names":[],"sources":["../agent/ui/AgentModal.vue","../agent/ui/AgentModal.vue","../agent/ui/AgentWidget.vue","../agent/ui/AgentWidget.vue","../agent/ui/ElAgentChatPreview.vue","../agent/ui/ElAgentChatPreview.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '@/ui/common/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport type { AgentConfig } from '../schema'\nimport FModal from '@/ui/common/FModal.vue'\nimport AgentProvider from './AgentProvider.vue'\n\ndefineOptions({ name: 'AgentModal' })\n\nconst {\n vis = false,\n sdk,\n agent,\n handle,\n context,\n firstMessage,\n} = defineProps<{\n vis?: boolean\n sdk?: PageLinesSDK\n agent?: AgentConfig\n handle?: string\n context?: string\n firstMessage?: string\n}>()\n\nconst emit = defineEmits<{\n 'update:vis': [value: boolean]\n}>()\n</script>\n\n<template>\n <FModal\n :vis=\"vis\"\n modal-class=\"max-w-4xl p-0\"\n style-class=\"bg-transparent shadow-2xl rounded-2xl\"\n :has-close=\"false\"\n @update:vis=\"(val) => emit('update:vis', val)\"\n >\n <div class=\"relative w-full h-[80vh] md:h-[600px]\">\n <AgentProvider\n :sdk=\"sdk\"\n :agent=\"agent\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n @close=\"emit('update:vis', false)\"\n />\n </div>\n </FModal>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport type { PageLinesSDK } from '../../sdkClient'\nimport { nextTick, ref, watch } from 'vue'\nimport AgentChat from './AgentChat.vue'\nimport AgentWrap from './AgentWrap.vue'\n\ninterface Props {\n sdk?: PageLinesSDK\n handle: string\n context?: string\n firstMessage?: string\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n}\n\nconst props = defineProps<Props>()\nconst isOpen = ref(false)\nconst isAgentActive = ref(false)\n\nfunction toggle() {\n isOpen.value = !isOpen.value\n}\n\n// Watch isOpen to delay agent activation for smooth transition\nwatch(isOpen, async (newValue) => {\n if (newValue) {\n // When opening, delay agent activation until transition starts\n await nextTick()\n setTimeout(() => {\n isAgentActive.value = true\n }, 400) // Delay to let container expand first\n } else {\n // When closing, immediately deactivate agent\n isAgentActive.value = false\n }\n})\n\nfunction open() {\n isOpen.value = true\n}\n\nfunction close() {\n isOpen.value = false\n}\n\nfunction handleClose() {\n close()\n}\n\ndefineExpose({\n toggle,\n open,\n close,\n})\n</script>\n\n<template>\n <AgentWrap\n v-slot=\"{ agent, sdk: resolvedSdk }\"\n :sdk=\"sdk\"\n :handle=\"handle\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n >\n <!-- Fixed Widget Wrapper -->\n <div\n v-if=\"agent\"\n class=\"fixed z-[999999] pointer-events-auto\"\n :class=\"[\n props.position === 'bottom-left' ? 'bottom-6 left-6'\n : props.position === 'top-right' ? 'top-6 right-6'\n : props.position === 'top-left' ? 'top-6 left-6'\n : 'bottom-6 right-6',\n ]\"\n >\n <!-- Widget Content with Transition -->\n <div\n class=\"transition-all duration-500 ease-[cubic-bezier(0.25,1,0.33,1)] transform-gpu\"\n :class=\"[\n isOpen\n ? 'widget-expanded w-96 h-[600px] max-w-[calc(100vw-48px)] max-h-[calc(100vh-48px)] rounded-3xl opacity-100 scale-100'\n : 'widget-button w-[80px] h-[80px] opacity-100 scale-100 flex items-center justify-center cursor-pointer',\n ]\"\n :style=\"{\n 'transform-origin':\n props.position === 'bottom-left' ? 'bottom left'\n : props.position === 'top-right' ? 'top right'\n : props.position === 'top-left' ? 'top left'\n : 'bottom right',\n }\"\n @click=\"!isOpen ? toggle() : undefined\"\n >\n <!-- Button Content (visible when closed) -->\n <div v-if=\"!isOpen\" class=\"relative h-full w-full\">\n <div class=\"group relative h-full w-full rounded-3xl overflow-hidden shadow-lg transition-all duration-300 ease-[cubic-bezier(0.25,1,0.33,1)] hover:shadow-2xl hover:translate-y-[-1px] hover:brightness-110 active:scale-[1.06] active:-translate-y-0.5 active:duration-100\">\n <img\n :src=\"agent.avatarUrl.value\"\n :alt=\"`${agent.displayName.value} assistant`\"\n class=\"h-full w-full object-cover pointer-events-none\"\n width=\"80\"\n height=\"80\"\n />\n <!-- Gradient overlay for contrast -->\n <div class=\"absolute inset-0 pointer-events-none bg-gradient-to-br from-transparent via-black/10 to-black/40 opacity-60 transition-opacity duration-300 group-hover:opacity-40\" />\n </div>\n <!-- Online indicator -->\n <div v-if=\"agent.state.value.lifecycle === 'running'\" class=\"absolute top-0.5 right-0.5\">\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping\" style=\"animation-duration: 3s;\" />\n <div class=\"size-3 bg-green-500 rounded-full ring-2 ring-white\" />\n </div>\n </div>\n\n <!-- Chat Content (visible when open) -->\n <AgentChat\n v-if=\"isOpen && agent\"\n class=\"rounded-3xl shadow-2xl border border-white/10\"\n :sdk=\"resolvedSdk\"\n :agent=\"agent\"\n :context=\"context\"\n :first-message=\"firstMessage\"\n :has-close=\"true\"\n :is-active=\"isAgentActive\"\n @close=\"handleClose\"\n />\n </div>\n </div>\n </AgentWrap>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport ChatRichText from './ChatRichText.vue'\n\nexport type ChatPreviewMessage = {\n sender: 'user' | 'agent'\n text: string\n}\n\ndefineProps<{\n messages: ChatPreviewMessage[]\n variant?: 'light' | 'dark'\n}>()\n</script>\n\n<template>\n <div\n class=\"@container/chat-preview flex flex-col gap-3\"\n :class=\"variant === 'dark' ? 'text-white' : 'text-slate-950'\"\n data-test=\"agent-chat-preview\"\n >\n <div\n v-for=\"(message, index) in messages\"\n :key=\"`${message.sender}-${index}`\"\n class=\"flex\"\n :class=\"message.sender === 'user' ? 'justify-end' : 'justify-start'\"\n data-test=\"agent-chat-preview-message\"\n :data-sender=\"message.sender\"\n >\n <div\n class=\"max-w-[88%] rounded-2xl px-4 py-3 text-sm shadow-sm @sm/chat-preview:max-w-[78%]\"\n :class=\"message.sender === 'user'\n ? 'bg-slate-950 text-white'\n : variant === 'dark'\n ? 'border border-white/10 bg-white/10 text-white'\n : 'border border-slate-200 bg-white text-slate-950'\"\n >\n <ChatRichText\n :text=\"message.text\"\n :inverted=\"message.sender === 'user' || variant === 'dark'\"\n />\n </div>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAwBA,IAAM,IAAO;yBAMX,EAkBS,GAAA;GAjBN,KAAK,EAAA;GACN,eAAY;GACZ,eAAY;GACX,aAAW;GACX,gBAAU,EAAA,OAAA,EAAA,MAAG,MAAQ,EAAI,cAAe,CAAG;;oBAYtC,CAVN,EAUM,OAVN,GAUM,CATJ,EAQE,GAAA;IAPC,KAAK,EAAA;IACL,OAAO,EAAA;IACP,QAAQ,EAAA;IACR,SAAS,EAAA;IACT,iB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rolldown-runtime.js";
|
|
2
|
+
//#region constants/socialPlatforms.ts
|
|
3
|
+
var e = {
|
|
4
|
+
linkedin: {
|
|
5
|
+
label: "LinkedIn",
|
|
6
|
+
icon: "i-simple-icons-linkedin",
|
|
7
|
+
placeholder: "john-smith",
|
|
8
|
+
getUrl: (e) => `https://linkedin.com/in/${e}`
|
|
9
|
+
},
|
|
10
|
+
x: {
|
|
11
|
+
label: "X",
|
|
12
|
+
icon: "i-simple-icons-x",
|
|
13
|
+
placeholder: "johnsmith",
|
|
14
|
+
getUrl: (e) => `https://x.com/${e}`
|
|
15
|
+
},
|
|
16
|
+
facebook: {
|
|
17
|
+
label: "Facebook",
|
|
18
|
+
icon: "i-simple-icons-facebook",
|
|
19
|
+
placeholder: "johnsmith",
|
|
20
|
+
getUrl: (e) => `https://facebook.com/${e}`
|
|
21
|
+
},
|
|
22
|
+
tiktok: {
|
|
23
|
+
label: "TikTok",
|
|
24
|
+
icon: "i-simple-icons-tiktok",
|
|
25
|
+
placeholder: "johnsmith",
|
|
26
|
+
getUrl: (e) => `https://tiktok.com/@${e}`
|
|
27
|
+
},
|
|
28
|
+
youtube: {
|
|
29
|
+
label: "YouTube",
|
|
30
|
+
icon: "i-tabler-brand-youtube",
|
|
31
|
+
placeholder: "johnsmith",
|
|
32
|
+
getUrl: (e) => `https://youtube.com/@${e}`
|
|
33
|
+
},
|
|
34
|
+
github: {
|
|
35
|
+
label: "GitHub",
|
|
36
|
+
icon: "i-tabler-brand-github",
|
|
37
|
+
placeholder: "johnsmith",
|
|
38
|
+
getUrl: (e) => `https://github.com/${e}`
|
|
39
|
+
},
|
|
40
|
+
instagram: {
|
|
41
|
+
label: "Instagram",
|
|
42
|
+
icon: "i-simple-icons-instagram",
|
|
43
|
+
placeholder: "johnsmith",
|
|
44
|
+
getUrl: (e) => `https://instagram.com/${e}`
|
|
45
|
+
},
|
|
46
|
+
threads: {
|
|
47
|
+
label: "Threads",
|
|
48
|
+
icon: "i-simple-icons-threads",
|
|
49
|
+
placeholder: "johnsmith",
|
|
50
|
+
getUrl: (e) => `https://threads.net/@${e}`
|
|
51
|
+
},
|
|
52
|
+
email: {
|
|
53
|
+
label: "Email",
|
|
54
|
+
icon: "i-tabler-mail",
|
|
55
|
+
placeholder: "hello@example.com",
|
|
56
|
+
getUrl: (e) => `mailto:${e}`
|
|
57
|
+
},
|
|
58
|
+
phone: {
|
|
59
|
+
label: "Phone",
|
|
60
|
+
icon: "i-tabler-phone",
|
|
61
|
+
placeholder: "+1-555-123-4567",
|
|
62
|
+
getUrl: (e) => `tel:${e.replace(/[^0-9+]/g, "")}`
|
|
63
|
+
},
|
|
64
|
+
website: {
|
|
65
|
+
label: "Website",
|
|
66
|
+
icon: "i-tabler-world",
|
|
67
|
+
placeholder: "https://example.com",
|
|
68
|
+
getUrl: (e) => e
|
|
69
|
+
},
|
|
70
|
+
calendar: {
|
|
71
|
+
label: "Calendar",
|
|
72
|
+
icon: "i-tabler-calendar",
|
|
73
|
+
placeholder: "https://cal.com/username",
|
|
74
|
+
getUrl: (e) => e
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
export { e as SOCIAL_PLATFORMS };
|
|
79
|
+
|
|
80
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../constants/socialPlatforms.ts"],"sourcesContent":["import type { SocialAccount } from '@pagelines/core'\n\n// Extract platform type from schema to ensure type safety\ntype Platform = SocialAccount['platform']\n\n// Platform metadata for URL generation and display\n// TypeScript enforces completeness - must include all platforms from schema\nexport const SOCIAL_PLATFORMS: Record<Platform, {\n label: string\n icon: string\n placeholder: string\n getUrl: (handle: string) => string\n}> = {\n linkedin: {\n label: 'LinkedIn',\n icon: 'i-simple-icons-linkedin',\n placeholder: 'john-smith',\n getUrl: (handle: string) => `https://linkedin.com/in/${handle}`,\n },\n x: {\n label: 'X',\n icon: 'i-simple-icons-x',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://x.com/${handle}`,\n },\n facebook: {\n label: 'Facebook',\n icon: 'i-simple-icons-facebook',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://facebook.com/${handle}`,\n },\n tiktok: {\n label: 'TikTok',\n icon: 'i-simple-icons-tiktok',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://tiktok.com/@${handle}`,\n },\n youtube: {\n label: 'YouTube',\n icon: 'i-tabler-brand-youtube',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://youtube.com/@${handle}`,\n },\n github: {\n label: 'GitHub',\n icon: 'i-tabler-brand-github',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://github.com/${handle}`,\n },\n instagram: {\n label: 'Instagram',\n icon: 'i-simple-icons-instagram',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://instagram.com/${handle}`,\n },\n threads: {\n label: 'Threads',\n icon: 'i-simple-icons-threads',\n placeholder: 'johnsmith',\n getUrl: (handle: string) => `https://threads.net/@${handle}`,\n },\n email: {\n label: 'Email',\n icon: 'i-tabler-mail',\n placeholder: 'hello@example.com',\n getUrl: (handle: string) => `mailto:${handle}`,\n },\n phone: {\n label: 'Phone',\n icon: 'i-tabler-phone',\n placeholder: '+1-555-123-4567',\n getUrl: (handle: string) => `tel:${handle.replace(/[^0-9+]/g, '')}`,\n },\n website: {\n label: 'Website',\n icon: 'i-tabler-world',\n placeholder: 'https://example.com',\n getUrl: (handle: string) => handle, // handle IS the URL\n },\n calendar: {\n label: 'Calendar',\n icon: 'i-tabler-calendar',\n placeholder: 'https://cal.com/username',\n getUrl: (handle: string) => handle, // handle IS the URL (e.g., Cal.com link)\n },\n} as const\n\nexport type SocialPlatform = keyof typeof SOCIAL_PLATFORMS\n"],"mappings":";;AAOA,IAAa,IAKR;CACH,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,2BAA2B;CACzD;CACA,GAAG;EACD,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,iBAAiB;CAC/C;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,uBAAuB;CACrD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,QAAQ;EACN,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,sBAAsB;CACpD;CACA,WAAW;EACT,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,yBAAyB;CACvD;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,wBAAwB;CACtD;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,UAAU;CACxC;CACA,OAAO;EACL,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB,OAAO,EAAO,QAAQ,YAAY,EAAE;CAClE;CACA,SAAS;EACP,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;CACA,UAAU;EACR,OAAO;EACP,MAAM;EACN,aAAa;EACb,SAAS,MAAmB;CAC9B;AACF"}
|