@cossistant/react 0.0.3 → 0.0.5
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/README.md +74 -0
- package/_virtual/rolldown_runtime.js +19 -0
- package/conversation.d.ts +26 -3
- package/conversation.d.ts.map +1 -1
- package/hooks/index.d.ts +5 -3
- package/hooks/index.js +7 -5
- package/hooks/private/store/use-conversations-store.d.ts +8 -0
- package/hooks/private/store/use-conversations-store.d.ts.map +1 -1
- package/hooks/private/store/use-conversations-store.js +8 -0
- package/hooks/private/store/use-conversations-store.js.map +1 -1
- package/hooks/private/store/use-store-selector.d.ts +4 -0
- package/hooks/private/store/use-store-selector.d.ts.map +1 -1
- package/hooks/private/store/use-store-selector.js +5 -2
- package/hooks/private/store/use-store-selector.js.map +1 -1
- package/hooks/private/store/use-website-store.d.ts +4 -0
- package/hooks/private/store/use-website-store.d.ts.map +1 -1
- package/hooks/private/store/use-website-store.js +6 -3
- package/hooks/private/store/use-website-store.js.map +1 -1
- package/hooks/private/typing.d.ts +35 -0
- package/hooks/private/typing.d.ts.map +1 -0
- package/hooks/private/typing.js +49 -0
- package/hooks/private/typing.js.map +1 -0
- package/hooks/private/use-client-query.d.ts +5 -0
- package/hooks/private/use-client-query.d.ts.map +1 -1
- package/hooks/private/use-client-query.js +5 -0
- package/hooks/private/use-client-query.js.map +1 -1
- package/hooks/private/use-grouped-messages.d.ts +10 -4
- package/hooks/private/use-grouped-messages.d.ts.map +1 -1
- package/hooks/private/use-grouped-messages.js +24 -4
- package/hooks/private/use-grouped-messages.js.map +1 -1
- package/hooks/private/use-multimodal-input.d.ts.map +1 -1
- package/hooks/private/use-rest-client.d.ts.map +1 -1
- package/hooks/private/use-visitor-typing-reporter.d.ts +6 -0
- package/hooks/private/use-visitor-typing-reporter.d.ts.map +1 -1
- package/hooks/private/use-visitor-typing-reporter.js +6 -0
- package/hooks/private/use-visitor-typing-reporter.js.map +1 -1
- package/hooks/use-composer-refocus.d.ts.map +1 -1
- package/hooks/use-conversation-auto-seen.d.ts +9 -0
- package/hooks/use-conversation-auto-seen.d.ts.map +1 -1
- package/hooks/use-conversation-auto-seen.js +44 -3
- package/hooks/use-conversation-auto-seen.js.map +1 -1
- package/hooks/use-conversation-history-page.d.ts.map +1 -1
- package/hooks/use-conversation-history-page.js +16 -18
- package/hooks/use-conversation-history-page.js.map +1 -1
- package/hooks/use-conversation-lifecycle.d.ts.map +1 -1
- package/hooks/use-conversation-lifecycle.js +2 -4
- package/hooks/use-conversation-lifecycle.js.map +1 -1
- package/hooks/use-conversation-page.d.ts +6 -0
- package/hooks/use-conversation-page.d.ts.map +1 -1
- package/hooks/use-conversation-page.js +41 -3
- package/hooks/use-conversation-page.js.map +1 -1
- package/hooks/use-conversation-preview.d.ts +61 -0
- package/hooks/use-conversation-preview.d.ts.map +1 -0
- package/hooks/use-conversation-preview.js +173 -0
- package/hooks/use-conversation-preview.js.map +1 -0
- package/hooks/use-conversation-seen.d.ts +4 -0
- package/hooks/use-conversation-seen.d.ts.map +1 -1
- package/hooks/use-conversation-seen.js +4 -0
- package/hooks/use-conversation-seen.js.map +1 -1
- package/hooks/use-conversation-timeline-items.d.ts +4 -0
- package/hooks/use-conversation-timeline-items.d.ts.map +1 -1
- package/hooks/use-conversation-timeline-items.js +4 -0
- package/hooks/use-conversation-timeline-items.js.map +1 -1
- package/hooks/use-conversation-timeline.d.ts +32 -0
- package/hooks/use-conversation-timeline.d.ts.map +1 -0
- package/hooks/use-conversation-timeline.js +41 -0
- package/hooks/use-conversation-timeline.js.map +1 -0
- package/hooks/use-conversation-typing.d.ts +4 -0
- package/hooks/use-conversation-typing.d.ts.map +1 -1
- package/hooks/use-conversation-typing.js +4 -0
- package/hooks/use-conversation-typing.js.map +1 -1
- package/hooks/use-conversation.d.ts +11 -0
- package/hooks/use-conversation.d.ts.map +1 -1
- package/hooks/use-conversation.js +11 -0
- package/hooks/use-conversation.js.map +1 -1
- package/hooks/use-conversations.d.ts +12 -0
- package/hooks/use-conversations.d.ts.map +1 -1
- package/hooks/use-conversations.js +12 -0
- package/hooks/use-conversations.js.map +1 -1
- package/hooks/use-create-conversation.d.ts +5 -0
- package/hooks/use-create-conversation.d.ts.map +1 -1
- package/hooks/use-create-conversation.js +12 -9
- package/hooks/use-create-conversation.js.map +1 -1
- package/hooks/use-home-page.d.ts.map +1 -1
- package/hooks/use-home-page.js +6 -4
- package/hooks/use-home-page.js.map +1 -1
- package/hooks/use-message-composer.d.ts.map +1 -1
- package/hooks/use-realtime-support.d.ts.map +1 -1
- package/hooks/use-send-message.d.ts +9 -0
- package/hooks/use-send-message.d.ts.map +1 -1
- package/hooks/use-send-message.js +15 -13
- package/hooks/use-send-message.js.map +1 -1
- package/hooks/use-visitor.d.ts.map +1 -1
- package/hooks/use-visitor.js +28 -30
- package/hooks/use-visitor.js.map +1 -1
- package/hooks/use-window-visibility-focus.d.ts +4 -0
- package/hooks/use-window-visibility-focus.d.ts.map +1 -1
- package/hooks/use-window-visibility-focus.js +5 -2
- package/hooks/use-window-visibility-focus.js.map +1 -1
- package/identify-visitor.d.ts +12 -3
- package/identify-visitor.d.ts.map +1 -1
- package/identify-visitor.js +58 -9
- package/identify-visitor.js.map +1 -1
- package/index.d.ts +10 -7
- package/index.js +10 -9
- package/package.json +14 -17
- package/primitives/avatar/avatar.d.ts.map +1 -1
- package/primitives/avatar/fallback.d.ts.map +1 -1
- package/primitives/avatar/fallback.js +1 -3
- package/primitives/avatar/fallback.js.map +1 -1
- package/primitives/avatar/image.d.ts.map +1 -1
- package/primitives/avatar/index.d.ts +1 -0
- package/primitives/bubble.d.ts +2 -0
- package/primitives/bubble.d.ts.map +1 -1
- package/primitives/bubble.js +8 -2
- package/primitives/bubble.js.map +1 -1
- package/primitives/button.d.ts.map +1 -1
- package/primitives/conversation-timeline.d.ts.map +1 -1
- package/primitives/conversation-timeline.js +58 -5
- package/primitives/conversation-timeline.js.map +1 -1
- package/primitives/index.d.ts +1 -0
- package/primitives/index.parts.d.ts +1 -0
- package/primitives/multimodal-input.d.ts.map +1 -1
- package/primitives/timeline-item-group.d.ts +7 -7
- package/primitives/timeline-item-group.d.ts.map +1 -1
- package/primitives/timeline-item-group.js.map +1 -1
- package/primitives/timeline-item.d.ts +1 -1
- package/primitives/timeline-item.d.ts.map +1 -1
- package/primitives/timeline-item.js +7 -1
- package/primitives/timeline-item.js.map +1 -1
- package/primitives/window.d.ts +1 -1
- package/primitives/window.d.ts.map +1 -1
- package/primitives/window.js +4 -4
- package/primitives/window.js.map +1 -1
- package/provider.d.ts +23 -43
- package/provider.d.ts.map +1 -1
- package/provider.js +152 -49
- package/provider.js.map +1 -1
- package/realtime/event-filter.d.ts +4 -0
- package/realtime/event-filter.d.ts.map +1 -1
- package/realtime/event-filter.js +4 -0
- package/realtime/event-filter.js.map +1 -1
- package/realtime/index.js +1 -1
- package/realtime/provider.d.ts +7 -2
- package/realtime/provider.d.ts.map +1 -1
- package/realtime/provider.js +23 -1
- package/realtime/provider.js.map +1 -1
- package/realtime/seen-store.d.ts +13 -0
- package/realtime/seen-store.d.ts.map +1 -1
- package/realtime/seen-store.js +14 -2
- package/realtime/seen-store.js.map +1 -1
- package/realtime/support-provider.d.ts +1 -2
- package/realtime/support-provider.d.ts.map +1 -1
- package/realtime/support-provider.js +19 -20
- package/realtime/support-provider.js.map +1 -1
- package/realtime/typing-store.d.ts +18 -0
- package/realtime/typing-store.d.ts.map +1 -1
- package/realtime/typing-store.js +19 -2
- package/realtime/typing-store.js.map +1 -1
- package/realtime/use-realtime.d.ts +8 -4
- package/realtime/use-realtime.d.ts.map +1 -1
- package/realtime/use-realtime.js +4 -0
- package/realtime/use-realtime.js.map +1 -1
- package/realtime-events.d.ts +17 -3
- package/realtime-events.d.ts.map +1 -1
- package/schemas.d.ts +7 -1
- package/schemas.d.ts.map +1 -1
- package/support/components/avatar-stack.d.ts +8 -4
- package/support/components/avatar-stack.d.ts.map +1 -1
- package/support/components/avatar-stack.js +4 -0
- package/support/components/avatar-stack.js.map +1 -1
- package/support/components/avatar.d.ts +11 -6
- package/support/components/avatar.d.ts.map +1 -1
- package/support/components/avatar.js +4 -0
- package/support/components/avatar.js.map +1 -1
- package/support/components/bubble.d.ts.map +1 -1
- package/support/components/bubble.js +29 -6
- package/support/components/bubble.js.map +1 -1
- package/support/components/button.d.ts +8 -5
- package/support/components/button.d.ts.map +1 -1
- package/support/components/button.js +5 -1
- package/support/components/button.js.map +1 -1
- package/support/components/container.d.ts +0 -1
- package/support/components/container.d.ts.map +1 -1
- package/support/components/container.js +2 -8
- package/support/components/container.js.map +1 -1
- package/support/components/conversation-button-link.d.ts +8 -21
- package/support/components/conversation-button-link.d.ts.map +1 -1
- package/support/components/conversation-button-link.js +62 -178
- package/support/components/conversation-button-link.js.map +1 -1
- package/support/components/conversation-event.d.ts.map +1 -1
- package/support/components/conversation-event.js +4 -0
- package/support/components/conversation-event.js.map +1 -1
- package/support/components/conversation-timeline.d.ts +10 -1
- package/support/components/conversation-timeline.d.ts.map +1 -1
- package/support/components/conversation-timeline.js +63 -57
- package/support/components/conversation-timeline.js.map +1 -1
- package/support/components/cossistant-branding.d.ts +5 -2
- package/support/components/cossistant-branding.d.ts.map +1 -1
- package/support/components/cossistant-branding.js +3 -0
- package/support/components/cossistant-branding.js.map +1 -1
- package/support/components/header.d.ts.map +1 -1
- package/support/components/header.js +2 -2
- package/support/components/header.js.map +1 -1
- package/support/components/icons.d.ts.map +1 -1
- package/support/components/multimodal-input.d.ts.map +1 -1
- package/support/components/multimodal-input.js +5 -24
- package/support/components/multimodal-input.js.map +1 -1
- package/support/components/navigation-tab.d.ts +7 -2
- package/support/components/navigation-tab.d.ts.map +1 -1
- package/support/components/navigation-tab.js +4 -0
- package/support/components/navigation-tab.js.map +1 -1
- package/support/components/support-content.d.ts +1 -1
- package/support/components/support-content.d.ts.map +1 -1
- package/support/components/support-content.js +7 -10
- package/support/components/support-content.js.map +1 -1
- package/support/components/text-effect.d.ts +5 -2
- package/support/components/text-effect.d.ts.map +1 -1
- package/support/components/text-effect.js +4 -0
- package/support/components/text-effect.js.map +1 -1
- package/support/components/timeline-identification-tool.d.ts +7 -0
- package/support/components/timeline-identification-tool.d.ts.map +1 -0
- package/support/components/timeline-identification-tool.js +139 -0
- package/support/components/timeline-identification-tool.js.map +1 -0
- package/support/components/timeline-message-group.d.ts +2 -1
- package/support/components/timeline-message-group.d.ts.map +1 -1
- package/support/components/timeline-message-group.js +4 -19
- package/support/components/timeline-message-group.js.map +1 -1
- package/support/components/timeline-message-item.d.ts +6 -2
- package/support/components/timeline-message-item.d.ts.map +1 -1
- package/support/components/timeline-message-item.js +8 -4
- package/support/components/timeline-message-item.js.map +1 -1
- package/support/components/typing-indicator.d.ts +5 -2
- package/support/components/typing-indicator.d.ts.map +1 -1
- package/support/components/typing-indicator.js +4 -4
- package/support/components/typing-indicator.js.map +1 -1
- package/support/components/watermark.d.ts.map +1 -1
- package/support/context/websocket.d.ts +8 -0
- package/support/context/websocket.d.ts.map +1 -1
- package/support/context/websocket.js +12 -6
- package/support/context/websocket.js.map +1 -1
- package/support/index.d.ts +8 -8
- package/support/index.d.ts.map +1 -1
- package/support/index.js +18 -18
- package/support/index.js.map +1 -1
- package/support/pages/conversation-history.js +46 -54
- package/support/pages/conversation-history.js.map +1 -1
- package/support/pages/conversation.d.ts +3 -6
- package/support/pages/conversation.d.ts.map +1 -1
- package/support/pages/conversation.js +19 -9
- package/support/pages/conversation.js.map +1 -1
- package/support/pages/home.d.ts +2 -2
- package/support/pages/home.d.ts.map +1 -1
- package/support/pages/home.js +64 -77
- package/support/pages/home.js.map +1 -1
- package/support/store/support-store.d.ts +18 -2
- package/support/store/support-store.d.ts.map +1 -1
- package/support/store/support-store.js +20 -5
- package/support/store/support-store.js.map +1 -1
- package/support/{support-CMoDLQoC.css → support-Ck4jy29i.css} +1 -2
- package/support/support-Ck4jy29i.css.map +1 -0
- package/support/text/index.d.ts +15 -2
- package/support/text/index.d.ts.map +1 -1
- package/support/text/index.js +15 -2
- package/support/text/index.js.map +1 -1
- package/support/text/locales/en.js +22 -4
- package/support/text/locales/en.js.map +1 -1
- package/support/text/locales/es.js +18 -0
- package/support/text/locales/es.js.map +1 -1
- package/support/text/locales/fr.js +18 -0
- package/support/text/locales/fr.js.map +1 -1
- package/support/text/locales/keys.d.ts +69 -9
- package/support/text/locales/keys.d.ts.map +1 -1
- package/support/text/locales/keys.js +18 -0
- package/support/text/locales/keys.js.map +1 -1
- package/support/text/runtime.d.ts +21 -0
- package/support/text/runtime.d.ts.map +1 -1
- package/support/text/runtime.js +21 -0
- package/support/text/runtime.js.map +1 -1
- package/support/utils/index.d.ts +4 -0
- package/support/utils/index.d.ts.map +1 -1
- package/support/utils/index.js +4 -1
- package/support/utils/index.js.map +1 -1
- package/support/utils/time.d.ts +3 -0
- package/support/utils/time.d.ts.map +1 -1
- package/support/utils/time.js +3 -0
- package/support/utils/time.js.map +1 -1
- package/support-config.d.ts +2 -1
- package/support-config.d.ts.map +1 -1
- package/support-config.js.map +1 -1
- package/support.css +2 -2
- package/timeline-item.d.ts +10 -0
- package/timeline-item.d.ts.map +1 -1
- package/utils/conversation.d.ts +7 -0
- package/utils/conversation.d.ts.map +1 -0
- package/utils/conversation.js +18 -0
- package/utils/conversation.js.map +1 -0
- package/utils/id.d.ts +3 -0
- package/utils/id.d.ts.map +1 -1
- package/utils/id.js +3 -0
- package/utils/id.js.map +1 -1
- package/utils/index.d.ts +2 -1
- package/utils/index.js +2 -1
- package/utils/metadata-hash.d.ts +12 -0
- package/utils/metadata-hash.d.ts.map +1 -0
- package/utils/metadata-hash.js +26 -0
- package/utils/metadata-hash.js.map +1 -0
- package/utils/text.d.ts +3 -0
- package/utils/text.d.ts.map +1 -1
- package/utils/text.js +3 -0
- package/utils/text.js.map +1 -1
- package/utils/use-render-element.d.ts +3 -0
- package/utils/use-render-element.d.ts.map +1 -1
- package/utils/use-render-element.js +3 -0
- package/utils/use-render-element.js.map +1 -1
- package/support/context/config.d.ts +0 -32
- package/support/context/config.d.ts.map +0 -1
- package/support/context/config.js +0 -27
- package/support/context/config.js.map +0 -1
- package/support/support-CMoDLQoC.css.map +0 -1
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/support/components/cossistant-branding.d.ts
|
|
4
4
|
type CossistantLogoProps = {
|
|
5
5
|
className?: string;
|
|
6
6
|
};
|
|
7
|
+
/**
|
|
8
|
+
* Inline SVG of the Cossistant logomark.
|
|
9
|
+
*/
|
|
7
10
|
declare function CossistantLogo({
|
|
8
11
|
className
|
|
9
|
-
}: CossistantLogoProps):
|
|
12
|
+
}: CossistantLogoProps): ReactElement;
|
|
10
13
|
//#endregion
|
|
11
14
|
export { CossistantLogo };
|
|
12
15
|
//# sourceMappingURL=cossistant-branding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cossistant-branding.d.ts","names":[],"sources":["../../../src/support/components/cossistant-branding.tsx"],"sourcesContent":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cossistant-branding.d.ts","names":[],"sources":["../../../src/support/components/cossistant-branding.tsx"],"sourcesContent":[],"mappings":";;;KAIK,mBAAA;;AAJqC,CAAA;AAW1C;;;AAEyB,iBAFT,cAAA,CAES;EAAA;AAAA,CAAA,EAAtB,mBAAsB,CAAA,EAAA,YAAA"}
|
|
@@ -2,6 +2,9 @@ import { cn } from "../utils/index.js";
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/support/components/cossistant-branding.tsx
|
|
5
|
+
/**
|
|
6
|
+
* Inline SVG of the Cossistant logomark.
|
|
7
|
+
*/
|
|
5
8
|
function CossistantLogo({ className }) {
|
|
6
9
|
return /* @__PURE__ */ jsxs("svg", {
|
|
7
10
|
className: cn("h-5 w-5", className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cossistant-branding.js","names":[],"sources":["../../../src/support/components/cossistant-branding.tsx"],"sourcesContent":["import { cn } from \"../utils\";\n\ntype CossistantLogoProps = {\n\tclassName?: string;\n};\n\nexport function CossistantLogo({
|
|
1
|
+
{"version":3,"file":"cossistant-branding.js","names":[],"sources":["../../../src/support/components/cossistant-branding.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\n\nimport { cn } from \"../utils\";\n\ntype CossistantLogoProps = {\n\tclassName?: string;\n};\n\n/**\n * Inline SVG of the Cossistant logomark.\n */\nexport function CossistantLogo({\n\tclassName,\n}: CossistantLogoProps): ReactElement {\n\treturn (\n\t\t<svg\n\t\t\tclassName={cn(\"h-5 w-5\", className)}\n\t\t\tfill=\"none\"\n\t\t\tviewBox=\"0 0 350 286\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<title>Cossistant Logo</title>\n\t\t\t<path\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M349.071 60.9512V286H65.5293L.508789 225.719V60.9512L65.5293 0H284.051l65.02 60.9512Zm-267.9558 37.33c-3.8102.0002-7.4549 1.5574-10.0888 4.3108l-11.2569 11.767c-2.5097 2.624-3.8991 6.122-3.873 9.752l.1826 25.368H81.043l-.2237-13.446c0-9.826 2.3423-11.681 12.751-11.681h22.8487c10.409 0 11.96 1.855 11.96 12.457v12.67h25.218v-25.373c0-3.627-1.412-7.112-3.937-9.717l-11.497-11.863c-2.63-2.7131-6.247-4.2447-10.026-4.2448H81.1152Zm125.6658 0c-3.81 0-7.455 1.5571-10.09 4.3108l-11.256 11.767c-2.51 2.624-3.9 6.122-3.873 9.752l.182 25.368h24.965l-.224-13.446c0-9.826 2.343-11.681 12.751-11.681h22.849c10.408 0 11.959 1.855 11.959 12.457v12.67h25.219v-25.373c0-3.627-1.413-7.112-3.938-9.717l-11.497-11.863c-2.63-2.713-6.247-4.2448-10.026-4.2448h-47.021Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"],"mappings":";;;;;;;AAWA,SAAgB,eAAe,EAC9B,aACqC;AACrC,QACC,qBAAC;EACA,WAAW,GAAG,WAAW,UAAU;EACnC,MAAK;EACL,SAAQ;EACR,OAAM;aAEN,oBAAC,qBAAM,oBAAuB,EAC9B,oBAAC;GACA,UAAS;GACT,GAAE;GACF,MAAK;GACL,UAAS;IACR;GACG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","names":[],"sources":["../../../src/support/components/header.tsx"],"sourcesContent":[],"mappings":";KAKY,WAAA;EAAA,SAAA,CAAA,EAAA,MAAW;
|
|
1
|
+
{"version":3,"file":"header.d.ts","names":[],"sources":["../../../src/support/components/header.tsx"],"sourcesContent":[],"mappings":";KAKY,WAAA;EAAA,SAAA,CAAA,EAAA,MAAW;EAOV,QAAA,CA+BZ,EApCW,KAAA,CAAM,SAKY;YAJnB,KAAA,CAAM;;;cAIJ,QAAQ,KAAA,CAAM,GAAG"}
|
|
@@ -6,7 +6,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
//#region src/support/components/header.tsx
|
|
8
8
|
const Header = ({ className, children, actions, onGoBack }) => {
|
|
9
|
-
const { close
|
|
9
|
+
const { close } = useSupportConfig();
|
|
10
10
|
return /* @__PURE__ */ jsx("div", {
|
|
11
11
|
className: cn("absolute inset-x-0 top-0 z-10 h-18", className),
|
|
12
12
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -26,7 +26,7 @@ const Header = ({ className, children, actions, onGoBack }) => {
|
|
|
26
26
|
className: "flex items-center gap-2",
|
|
27
27
|
children: actions
|
|
28
28
|
}),
|
|
29
|
-
|
|
29
|
+
/* @__PURE__ */ jsx(Button, {
|
|
30
30
|
onClick: close,
|
|
31
31
|
size: "icon",
|
|
32
32
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","names":["Header: React.FC<HeaderProps>","Icon"],"sources":["../../../src/support/components/header.tsx"],"sourcesContent":["import { useSupportConfig } from \"../store\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport Icon from \"./icons\";\n\nexport type HeaderProps = {\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tactions?: React.ReactNode;\n\tonGoBack?: () => void;\n};\n\nexport const Header: React.FC<HeaderProps> = ({\n\tclassName,\n\tchildren,\n\tactions,\n\tonGoBack,\n}) => {\n\tconst { close
|
|
1
|
+
{"version":3,"file":"header.js","names":["Header: React.FC<HeaderProps>","Icon"],"sources":["../../../src/support/components/header.tsx"],"sourcesContent":["import { useSupportConfig } from \"../store\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./button\";\nimport Icon from \"./icons\";\n\nexport type HeaderProps = {\n\tclassName?: string;\n\tchildren?: React.ReactNode;\n\tactions?: React.ReactNode;\n\tonGoBack?: () => void;\n};\n\nexport const Header: React.FC<HeaderProps> = ({\n\tclassName,\n\tchildren,\n\tactions,\n\tonGoBack,\n}) => {\n\tconst { close } = useSupportConfig();\n\n\treturn (\n\t\t<div className={cn(\"absolute inset-x-0 top-0 z-10 h-18\", className)}>\n\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-between gap-3 px-4\">\n\t\t\t\t<div className=\"flex flex-1 items-center gap-3\">\n\t\t\t\t\t{onGoBack && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tonClick={onGoBack}\n\t\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon name=\"arrow-left\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t\t{actions && <div className=\"flex items-center gap-2\">{actions}</div>}\n\t\t\t\t<Button onClick={close} size=\"icon\" type=\"button\" variant=\"ghost\">\n\t\t\t\t\t<Icon name=\"close\" />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"],"mappings":";;;;;;;AAYA,MAAaA,UAAiC,EAC7C,WACA,UACA,SACA,eACK;CACL,MAAM,EAAE,UAAU,kBAAkB;AAEpC,QACC,oBAAC;EAAI,WAAW,GAAG,sCAAsC,UAAU;YAClE,qBAAC;GAAI,WAAU;;IACd,qBAAC;KAAI,WAAU;gBACb,YACA,oBAAC;MACA,SAAS;MACT,MAAK;MACL,MAAK;MACL,SAAQ;gBAER,oBAACC,iBAAK,MAAK,eAAe;OAClB,EAET;MACI;IACL,WAAW,oBAAC;KAAI,WAAU;eAA2B;MAAc;IACpE,oBAAC;KAAO,SAAS;KAAO,MAAK;KAAO,MAAK;KAAS,SAAQ;eACzD,oBAACA,iBAAK,MAAK,UAAU;MACb;;IACJ;GACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","names":[],"sources":["../../../src/support/components/icons.tsx"],"sourcesContent":[],"mappings":";;;KAGY,WAAA;KAEA,QAAA;AAFA,KAmBA,SAAA,GAnBW;EAEX,IAAA,EAkBL,QAlBa;EAiBR,OAAA,CAAA,EAED,WAFU;
|
|
1
|
+
{"version":3,"file":"icons.d.ts","names":[],"sources":["../../../src/support/components/icons.tsx"],"sourcesContent":[],"mappings":";;;KAGY,WAAA;KAEA,QAAA;AAFA,KAmBA,SAAA,GAnBW;EAEX,IAAA,EAkBL,QAlBa;EAiBR,OAAA,CAAA,EAED,WAFU;EA+FR,SAmGZ,CAAA,EAAA,MAAA;EAEW,aAAA,CAAA,EAAA,OAAkB;;cArGjB,MAAM,KAAA,CAAM,GAAG;KAqGhB,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multimodal-input.d.ts","names":[],"sources":["../../../src/support/components/multimodal-input.tsx"],"sourcesContent":[],"mappings":";;;KAWY,oBAAA;;EAAA,KAAA,EAAA,MAAA;
|
|
1
|
+
{"version":3,"file":"multimodal-input.d.ts","names":[],"sources":["../../../src/support/components/multimodal-input.tsx"],"sourcesContent":[],"mappings":";;;KAWY,oBAAA;;EAAA,KAAA,EAAA,MAAA;EAKY,QAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAIf,QAAA,EAAA,GAAA,GAAA,IAAA;EACA,YAAA,CAAA,EAAA,CAAA,KAAA,EALe,IAKf,EAAA,EAAA,GAAA,IAAA;EAAI,WAAA,CAAA,EAAA,MAAA;EAOA,QAAA,CAAA,EAAA,OA8JZ;EAEW,YAAA,CAAA,EAAA,OAAe;EAKd,KAAA,CAAA,EA7KJ,KA2LR,GAAA,IAAA;UA1LQ;;;;;;cAOI,iBAAiB,KAAA,CAAM,GAAG;KAgK3B,eAAA;;;;cAKC,YAAY,KAAA,CAAM,GAAG"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
import { cn } from "../utils/index.js";
|
|
5
5
|
import { Button } from "../../primitives/button.js";
|
|
6
|
-
import {
|
|
6
|
+
import { MultimodalInput as MultimodalInput$1 } from "../../primitives/multimodal-input.js";
|
|
7
7
|
import icons_default from "./icons.js";
|
|
8
8
|
import { useSupportText } from "../text/index.js";
|
|
9
9
|
import { useComposerRefocus } from "../../hooks/use-composer-refocus.js";
|
|
10
10
|
import { Watermark } from "./watermark.js";
|
|
11
11
|
import { useRef } from "react";
|
|
12
|
-
import {
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
|
|
14
14
|
//#region src/support/components/multimodal-input.tsx
|
|
15
15
|
const MultimodalInput = ({ className, value, onChange, onSubmit, onFileSelect, placeholder, disabled = false, isSubmitting = false, error, files = [], onRemoveFile, maxFiles = 5, maxFileSize = 10 * 1024 * 1024, allowedFileTypes = [
|
|
@@ -17,7 +17,7 @@ const MultimodalInput = ({ className, value, onChange, onSubmit, onFileSelect, p
|
|
|
17
17
|
"application/pdf",
|
|
18
18
|
"text/*"
|
|
19
19
|
] }) => {
|
|
20
|
-
|
|
20
|
+
useRef(null);
|
|
21
21
|
const hasContent = value.trim().length > 0 || files.length > 0;
|
|
22
22
|
const { focusComposer, inputRef } = useComposerRefocus({
|
|
23
23
|
disabled,
|
|
@@ -36,9 +36,6 @@ const MultimodalInput = ({ className, value, onChange, onSubmit, onFileSelect, p
|
|
|
36
36
|
e.preventDefault();
|
|
37
37
|
handleSubmit();
|
|
38
38
|
};
|
|
39
|
-
const handleAttachClick = () => {
|
|
40
|
-
if (files.length < maxFiles) fileInputRef.current?.click();
|
|
41
|
-
};
|
|
42
39
|
const formatFileSize = (bytes) => {
|
|
43
40
|
if (bytes < 1024) return `${bytes} B`;
|
|
44
41
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
@@ -97,25 +94,9 @@ const MultimodalInput = ({ className, value, onChange, onSubmit, onFileSelect, p
|
|
|
97
94
|
value
|
|
98
95
|
}), /* @__PURE__ */ jsxs("div", {
|
|
99
96
|
className: "flex items-center justify-between py-1 pr-1 pl-3",
|
|
100
|
-
children: [/* @__PURE__ */ jsx(Watermark, {}), /* @__PURE__ */
|
|
97
|
+
children: [/* @__PURE__ */ jsx(Watermark, {}), /* @__PURE__ */ jsx("div", {
|
|
101
98
|
className: "flex items-center gap-0.5",
|
|
102
|
-
children:
|
|
103
|
-
"aria-label": text("common.actions.attachFiles"),
|
|
104
|
-
className: cn("group flex h-8 w-8 items-center justify-center rounded-md text-co-muted-foreground hover:bg-co-muted hover:text-co-foreground disabled:cursor-not-allowed disabled:opacity-50", files.length >= maxFiles && "opacity-50"),
|
|
105
|
-
disabled: disabled || isSubmitting || files.length >= maxFiles,
|
|
106
|
-
onClick: handleAttachClick,
|
|
107
|
-
type: "button",
|
|
108
|
-
children: /* @__PURE__ */ jsx(icons_default, {
|
|
109
|
-
className: "h-4 w-4",
|
|
110
|
-
name: "attachment"
|
|
111
|
-
})
|
|
112
|
-
}), /* @__PURE__ */ jsx(FileInput, {
|
|
113
|
-
accept: allowedFileTypes.join(","),
|
|
114
|
-
className: "hidden",
|
|
115
|
-
disabled: disabled || isSubmitting || files.length >= maxFiles,
|
|
116
|
-
onFileSelect,
|
|
117
|
-
ref: fileInputRef
|
|
118
|
-
})] }), /* @__PURE__ */ jsx(SendButton, { disabled: !canSubmit })]
|
|
99
|
+
children: /* @__PURE__ */ jsx(SendButton, { disabled: !canSubmit })
|
|
119
100
|
})]
|
|
120
101
|
})]
|
|
121
102
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multimodal-input.js","names":["MultimodalInput: React.FC<MultimodalInputProps>","Icon","Primitive.MultimodalInput","
|
|
1
|
+
{"version":3,"file":"multimodal-input.js","names":["MultimodalInput: React.FC<MultimodalInputProps>","Icon","Primitive.MultimodalInput","SendButton: React.FC<SendButtonProps>","Primitive.Button"],"sources":["../../../src/support/components/multimodal-input.tsx"],"sourcesContent":["\"use client\";\n\nimport type React from \"react\";\nimport { useRef } from \"react\";\nimport { useComposerRefocus } from \"../../hooks/use-composer-refocus\";\nimport * as Primitive from \"../../primitives\";\nimport { useSupportText } from \"../text\";\nimport { cn } from \"../utils\";\nimport Icon from \"./icons\";\nimport { Watermark } from \"./watermark\";\n\nexport type MultimodalInputProps = {\n\tclassName?: string;\n\tvalue: string;\n\tonChange: (value: string) => void;\n\tonSubmit: () => void;\n\tonFileSelect?: (files: File[]) => void;\n\tplaceholder?: string;\n\tdisabled?: boolean;\n\tisSubmitting?: boolean;\n\terror?: Error | null;\n\tfiles?: File[];\n\tonRemoveFile?: (index: number) => void;\n\tmaxFiles?: number;\n\tmaxFileSize?: number;\n\tallowedFileTypes?: string[];\n};\n\nexport const MultimodalInput: React.FC<MultimodalInputProps> = ({\n\tclassName,\n\tvalue,\n\tonChange,\n\tonSubmit,\n\tonFileSelect,\n\tplaceholder,\n\tdisabled = false,\n\tisSubmitting = false,\n\terror,\n\tfiles = [],\n\tonRemoveFile,\n\tmaxFiles = 5,\n\tmaxFileSize = 10 * 1024 * 1024, // 10MB\n\tallowedFileTypes = [\"image/*\", \"application/pdf\", \"text/*\"],\n}) => {\n\tconst fileInputRef = useRef<HTMLInputElement>(null);\n\tconst hasContent = value.trim().length > 0 || files.length > 0;\n\tconst { focusComposer, inputRef } = useComposerRefocus({\n\t\tdisabled,\n\t\thasContent,\n\t\tisSubmitting,\n\t});\n\tconst canSubmit = !(disabled || isSubmitting) && hasContent;\n\tconst text = useSupportText();\n\tconst resolvedPlaceholder =\n\t\tplaceholder ?? text(\"component.multimodalInput.placeholder\");\n\n\tconst handleSubmit = () => {\n\t\tif (!canSubmit) {\n\t\t\treturn;\n\t\t}\n\n\t\tonSubmit();\n\t\tfocusComposer();\n\t};\n\n\tconst handleFormSubmit = (e: React.FormEvent) => {\n\t\te.preventDefault();\n\t\thandleSubmit();\n\t};\n\n\tconst handleAttachClick = () => {\n\t\tif (files.length < maxFiles) {\n\t\t\tfileInputRef.current?.click();\n\t\t}\n\t};\n\n\tconst formatFileSize = (bytes: number) => {\n\t\tif (bytes < 1024) {\n\t\t\treturn `${bytes} B`;\n\t\t}\n\t\tif (bytes < 1024 * 1024) {\n\t\t\treturn `${(bytes / 1024).toFixed(1)} KB`;\n\t\t}\n\t\treturn `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n\t};\n\n\treturn (\n\t\t<form className=\"flex flex-col gap-2\" onSubmit={handleFormSubmit}>\n\t\t\t{/* Error message */}\n\t\t\t{error && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"rounded-md bg-co-destructive-muted p-2 text-co-destructive text-xs\"\n\t\t\t\t\tid=\"multimodal-input-error\"\n\t\t\t\t>\n\t\t\t\t\t{error.message}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* File attachments */}\n\t\t\t{files.length > 0 && (\n\t\t\t\t<div className=\"flex flex-wrap gap-2 p-2\">\n\t\t\t\t\t{files.map((file, index) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"flex items-center gap-2 rounded-md bg-co-muted px-2 py-1 text-xs\"\n\t\t\t\t\t\t\tkey={`${file.name}-${index}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon className=\"h-3 w-3\" name=\"attachment\" />\n\t\t\t\t\t\t\t<span className=\"max-w-[150px] truncate\">{file.name}</span>\n\t\t\t\t\t\t\t<span className=\"text-co-muted-foreground\">\n\t\t\t\t\t\t\t\t{formatFileSize(file.size)}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{onRemoveFile && (\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\taria-label={text(\"common.actions.removeFile\", {\n\t\t\t\t\t\t\t\t\t\tfileName: file.name,\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\tclassName=\"ml-1 hover:text-co-destructive\"\n\t\t\t\t\t\t\t\t\tonClick={() => onRemoveFile(index)}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon className=\"h-3 w-3\" name=\"close\" />\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Input area */}\n\t\t\t<div className=\"flex flex-col rounded border border-co-border/50 bg-co-background-100 dark:bg-co-background-200\">\n\t\t\t\t<Primitive.MultimodalInput\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"flex-1 resize-none overflow-hidden p-3 text-co-foreground text-sm placeholder:text-primary/40 focus-visible:outline-none\",\n\t\t\t\t\t\tclassName\n\t\t\t\t\t)}\n\t\t\t\t\tdisabled={disabled || isSubmitting}\n\t\t\t\t\terror={error}\n\t\t\t\t\tonChange={onChange}\n\t\t\t\t\tonFileSelect={onFileSelect}\n\t\t\t\t\tonSubmit={handleSubmit}\n\t\t\t\t\tplaceholder={resolvedPlaceholder}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tvalue={value}\n\t\t\t\t/>\n\n\t\t\t\t<div className=\"flex items-center justify-between py-1 pr-1 pl-3\">\n\t\t\t\t\t<Watermark />\n\n\t\t\t\t\t<div className=\"flex items-center gap-0.5\">\n\t\t\t\t\t\t{/* File attachment button */}\n\t\t\t\t\t\t{/* {onFileSelect && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\taria-label={text(\"common.actions.attachFiles\")}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\"group flex h-8 w-8 items-center justify-center rounded-md text-co-muted-foreground hover:bg-co-muted hover:text-co-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\t\t\t\t\t\t\tfiles.length >= maxFiles && \"opacity-50\"\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\tdisabled || isSubmitting || files.length >= maxFiles\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={handleAttachClick}\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon className=\"h-4 w-4\" name=\"attachment\" />\n\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t<Primitive.FileInput\n\t\t\t\t\t\t\t\t\taccept={allowedFileTypes.join(\",\")}\n\t\t\t\t\t\t\t\t\tclassName=\"hidden\"\n\t\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\t\tdisabled || isSubmitting || files.length >= maxFiles\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonFileSelect={onFileSelect}\n\t\t\t\t\t\t\t\t\tref={fileInputRef}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)} */}\n\n\t\t\t\t\t\t{/* Send button */}\n\t\t\t\t\t\t<SendButton disabled={!canSubmit} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\t);\n};\n\nexport type SendButtonProps = {\n\tclassName?: string;\n\tdisabled?: boolean;\n};\n\nexport const SendButton: React.FC<SendButtonProps> = ({\n\tclassName,\n\tdisabled = false,\n}) => (\n\t<Primitive.Button\n\t\tclassName={cn(\n\t\t\t\"group flex h-8 w-8 items-center justify-center rounded-md text-co-primary hover:bg-co-muted disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\tclassName\n\t\t)}\n\t\tdisabled={disabled}\n\t\ttype=\"submit\"\n\t>\n\t\t<Icon className=\"h-4 w-4\" filledOnHover name=\"send\" />\n\t</Primitive.Button>\n);\n"],"mappings":";;;;;;;;;;;;;;AA4BA,MAAaA,mBAAmD,EAC/D,WACA,OACA,UACA,UACA,cACA,aACA,WAAW,OACX,eAAe,OACf,OACA,QAAQ,EAAE,EACV,cACA,WAAW,GACX,cAAc,KAAK,OAAO,MAC1B,mBAAmB;CAAC;CAAW;CAAmB;CAAS,OACtD;AACgB,QAAyB,KAAK;CACnD,MAAM,aAAa,MAAM,MAAM,CAAC,SAAS,KAAK,MAAM,SAAS;CAC7D,MAAM,EAAE,eAAe,aAAa,mBAAmB;EACtD;EACA;EACA;EACA,CAAC;CACF,MAAM,YAAY,EAAE,YAAY,iBAAiB;CACjD,MAAM,OAAO,gBAAgB;CAC7B,MAAM,sBACL,eAAe,KAAK,wCAAwC;CAE7D,MAAM,qBAAqB;AAC1B,MAAI,CAAC,UACJ;AAGD,YAAU;AACV,iBAAe;;CAGhB,MAAM,oBAAoB,MAAuB;AAChD,IAAE,gBAAgB;AAClB,gBAAc;;CASf,MAAM,kBAAkB,UAAkB;AACzC,MAAI,QAAQ,KACX,QAAO,GAAG,MAAM;AAEjB,MAAI,QAAQ,OAAO,KAClB,QAAO,IAAI,QAAQ,MAAM,QAAQ,EAAE,CAAC;AAErC,SAAO,IAAI,SAAS,OAAO,OAAO,QAAQ,EAAE,CAAC;;AAG9C,QACC,qBAAC;EAAK,WAAU;EAAsB,UAAU;;GAE9C,SACA,oBAAC;IACA,WAAU;IACV,IAAG;cAEF,MAAM;KACF;GAIN,MAAM,SAAS,KACf,oBAAC;IAAI,WAAU;cACb,MAAM,KAAK,MAAM,UACjB,qBAAC;KACA,WAAU;;MAGV,oBAACC;OAAK,WAAU;OAAU,MAAK;QAAe;MAC9C,oBAAC;OAAK,WAAU;iBAA0B,KAAK;QAAY;MAC3D,oBAAC;OAAK,WAAU;iBACd,eAAe,KAAK,KAAK;QACpB;MACN,gBACA,oBAAC;OACA,cAAY,KAAK,6BAA6B,EAC7C,UAAU,KAAK,MACf,CAAC;OACF,WAAU;OACV,eAAe,aAAa,MAAM;OAClC,MAAK;iBAEL,oBAACA;QAAK,WAAU;QAAU,MAAK;SAAU;QACjC;;OAjBL,GAAG,KAAK,KAAK,GAAG,QAmBhB,CACL;KACG;GAIP,qBAAC;IAAI,WAAU;eACd,oBAACC;KACA,WAAW,GACV,4HACA,UACA;KACD,UAAU,YAAY;KACf;KACG;KACI;KACd,UAAU;KACV,aAAa;KACb,KAAK;KACE;MACN,EAEF,qBAAC;KAAI,WAAU;gBACd,oBAAC,cAAY,EAEb,oBAAC;MAAI,WAAU;gBAgCd,oBAAC,cAAW,UAAU,CAAC,YAAa;OAC/B;MACD;KACD;;GACA;;AAST,MAAaC,cAAyC,EACrD,WACA,WAAW,YAEX,oBAACC;CACA,WAAW,GACV,+IACA,UACA;CACS;CACV,MAAK;WAEL,oBAACH;EAAK,WAAU;EAAU;EAAc,MAAK;GAAS;EACpC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/support/components/navigation-tab.d.ts
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Tab bar used inside the widget header to switch between home and knowledge
|
|
7
|
+
* base views.
|
|
8
|
+
*/
|
|
9
|
+
declare function NavigationTab(): ReactElement;
|
|
5
10
|
//#endregion
|
|
6
11
|
export { NavigationTab };
|
|
7
12
|
//# sourceMappingURL=navigation-tab.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-tab.d.ts","names":[],"sources":["../../../src/support/components/navigation-tab.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-tab.d.ts","names":[],"sources":["../../../src/support/components/navigation-tab.tsx"],"sourcesContent":[],"mappings":";;;;;;AAWA;;iBAAgB,aAAA,CAAA,GAAiB"}
|
|
@@ -5,6 +5,10 @@ import { Text } from "../text/index.js";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
|
7
7
|
//#region src/support/components/navigation-tab.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Tab bar used inside the widget header to switch between home and knowledge
|
|
10
|
+
* base views.
|
|
11
|
+
*/
|
|
8
12
|
function NavigationTab() {
|
|
9
13
|
const { current, navigate } = useSupportNavigation();
|
|
10
14
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-tab.js","names":["Icon"],"sources":["../../../src/support/components/navigation-tab.tsx"],"sourcesContent":["import { useSupportNavigation } from \"../store\";\nimport { Text } from \"../text\";\nimport { Button } from \"./button\";\nimport Icon from \"./icons\";\n\nexport function NavigationTab() {\n\tconst { current, navigate } = useSupportNavigation();\n\n\treturn (\n\t\t<div className=\"flex w-full items-center justify-center gap-2\">\n\t\t\t<Button\n\t\t\t\tonClick={() => navigate({ page: \"HOME\" })}\n\t\t\t\tvariant={current.page === \"HOME\" ? \"tab-selected\" : \"tab\"}\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tfilledOnHover\n\t\t\t\t\tname=\"home\"\n\t\t\t\t\tvariant={current.page === \"HOME\" ? \"filled\" : \"default\"}\n\t\t\t\t/>\n\t\t\t\t<Text as=\"span\" textKey=\"component.navigation.home\" />\n\t\t\t</Button>\n\t\t\t<Button\n\t\t\t\tonClick={() => navigate({ page: \"ARTICLES\" })}\n\t\t\t\tvariant={current.page === \"ARTICLES\" ? \"tab-selected\" : \"tab\"}\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tfilledOnHover\n\t\t\t\t\tname=\"articles\"\n\t\t\t\t\tvariant={current.page === \"ARTICLES\" ? \"filled\" : \"default\"}\n\t\t\t\t/>\n\t\t\t\t<Text as=\"span\" textKey=\"component.navigation.articles\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"navigation-tab.js","names":["Icon"],"sources":["../../../src/support/components/navigation-tab.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\n\nimport { useSupportNavigation } from \"../store\";\nimport { Text } from \"../text\";\nimport { Button } from \"./button\";\nimport Icon from \"./icons\";\n\n/**\n * Tab bar used inside the widget header to switch between home and knowledge\n * base views.\n */\nexport function NavigationTab(): ReactElement {\n\tconst { current, navigate } = useSupportNavigation();\n\n\treturn (\n\t\t<div className=\"flex w-full items-center justify-center gap-2\">\n\t\t\t<Button\n\t\t\t\tonClick={() => navigate({ page: \"HOME\" })}\n\t\t\t\tvariant={current.page === \"HOME\" ? \"tab-selected\" : \"tab\"}\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tfilledOnHover\n\t\t\t\t\tname=\"home\"\n\t\t\t\t\tvariant={current.page === \"HOME\" ? \"filled\" : \"default\"}\n\t\t\t\t/>\n\t\t\t\t<Text as=\"span\" textKey=\"component.navigation.home\" />\n\t\t\t</Button>\n\t\t\t<Button\n\t\t\t\tonClick={() => navigate({ page: \"ARTICLES\" })}\n\t\t\t\tvariant={current.page === \"ARTICLES\" ? \"tab-selected\" : \"tab\"}\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tfilledOnHover\n\t\t\t\t\tname=\"articles\"\n\t\t\t\t\tvariant={current.page === \"ARTICLES\" ? \"filled\" : \"default\"}\n\t\t\t\t/>\n\t\t\t\t<Text as=\"span\" textKey=\"component.navigation.articles\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,gBAA8B;CAC7C,MAAM,EAAE,SAAS,aAAa,sBAAsB;AAEpD,QACC,qBAAC;EAAI,WAAU;aACd,qBAAC;GACA,eAAe,SAAS,EAAE,MAAM,QAAQ,CAAC;GACzC,SAAS,QAAQ,SAAS,SAAS,iBAAiB;cAEpD,oBAACA;IACA;IACA,MAAK;IACL,SAAS,QAAQ,SAAS,SAAS,WAAW;KAC7C,EACF,oBAAC;IAAK,IAAG;IAAO,SAAQ;KAA8B;IAC9C,EACT,qBAAC;GACA,eAAe,SAAS,EAAE,MAAM,YAAY,CAAC;GAC7C,SAAS,QAAQ,SAAS,aAAa,iBAAiB;cAExD,oBAACA;IACA;IACA,MAAK;IACL,SAAS,QAAQ,SAAS,aAAa,WAAW;KACjD,EACF,oBAAC;IAAK,IAAG;IAAO,SAAQ;KAAkC;IAClD;GACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-content.d.ts","names":[],"sources":["../../../src/support/components/support-content.tsx"],"sourcesContent":[],"mappings":";;;KAUK,mBAAA;;EAAA,QAAA,CAAA,EAAA,KAAA,GAAA,QAAmB;EAgBX,KAAA,CAAA,EAAA,OAAA,
|
|
1
|
+
{"version":3,"file":"support-content.d.ts","names":[],"sources":["../../../src/support/components/support-content.tsx"],"sourcesContent":[],"mappings":";;;KAUK,mBAAA;;EAAA,QAAA,CAAA,EAAA,KAAA,GAAA,QAAmB;EAgBX,KAAA,CAAA,EAAA,OAAA,GAmCZ,MAAA;;;;;;;;;;;;cAnCY,gBAAgB,KAAA,CAAM,GAAG"}
|
|
@@ -18,14 +18,12 @@ import { motion } from "motion/react";
|
|
|
18
18
|
* Each page (e.g., conversation, home) manages its own state internally,
|
|
19
19
|
* so this component is purely presentational.
|
|
20
20
|
*/
|
|
21
|
-
const SupportContent = ({ className, position = "bottom", align = "right",
|
|
22
|
-
const containerClasses = cn("cossistant", {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"left-4": mode === "floating" && align === "left",
|
|
28
|
-
"relative h-full w-full": mode === "responsive"
|
|
21
|
+
const SupportContent = ({ className, position = "bottom", align = "right", positioning = "fixed" }) => {
|
|
22
|
+
const containerClasses = cn("cossistant z-[9999]", positioning === "fixed" ? "fixed" : "absolute", {
|
|
23
|
+
"bottom-4": position === "bottom",
|
|
24
|
+
"top-4": position === "top",
|
|
25
|
+
"right-4": align === "right",
|
|
26
|
+
"left-4": align === "left"
|
|
29
27
|
}, className);
|
|
30
28
|
return /* @__PURE__ */ jsxs(motion.div, {
|
|
31
29
|
animate: { opacity: 1 },
|
|
@@ -36,9 +34,8 @@ const SupportContent = ({ className, position = "bottom", align = "right", mode
|
|
|
36
34
|
default: { ease: "anticipate" },
|
|
37
35
|
layout: { duration: .3 }
|
|
38
36
|
},
|
|
39
|
-
children: [
|
|
37
|
+
children: [/* @__PURE__ */ jsx(Bubble, { className: "z-[1000] md:z-[9999]" }), /* @__PURE__ */ jsx(Container, {
|
|
40
38
|
align,
|
|
41
|
-
mode,
|
|
42
39
|
position,
|
|
43
40
|
children: /* @__PURE__ */ jsx(SupportRouter, {})
|
|
44
41
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"support-content.js","names":["SupportContent: React.FC<SupportContentProps>"],"sources":["../../../src/support/components/support-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { motion } from \"motion/react\";\nimport type React from \"react\";\n\nimport { SupportRouter } from \"../router\";\nimport { cn } from \"../utils\";\nimport { Bubble } from \"./bubble\";\nimport { Container } from \"./container\";\n\ntype SupportContentProps = {\n\tclassName?: string;\n\tposition?: \"top\" | \"bottom\";\n\talign?: \"right\" | \"left\";\n\
|
|
1
|
+
{"version":3,"file":"support-content.js","names":["SupportContent: React.FC<SupportContentProps>"],"sources":["../../../src/support/components/support-content.tsx"],"sourcesContent":["\"use client\";\n\nimport { motion } from \"motion/react\";\nimport type React from \"react\";\n\nimport { SupportRouter } from \"../router\";\nimport { cn } from \"../utils\";\nimport { Bubble } from \"./bubble\";\nimport { Container } from \"./container\";\n\ntype SupportContentProps = {\n\tclassName?: string;\n\tposition?: \"top\" | \"bottom\";\n\talign?: \"right\" | \"left\";\n\tpositioning?: \"fixed\" | \"absolute\";\n};\n\n/**\n * Main support widget content container.\n *\n * Handles the layout and positioning of the support widget,\n * and renders the appropriate page via SupportRouter.\n *\n * Each page (e.g., conversation, home) manages its own state internally,\n * so this component is purely presentational.\n */\nexport const SupportContent: React.FC<SupportContentProps> = ({\n\tclassName,\n\tposition = \"bottom\",\n\talign = \"right\",\n\tpositioning = \"fixed\",\n}) => {\n\tconst containerClasses = cn(\n\t\t\"cossistant z-[9999]\",\n\t\tpositioning === \"fixed\" ? \"fixed\" : \"absolute\",\n\t\t{\n\t\t\t\"bottom-4\": position === \"bottom\",\n\t\t\t\"top-4\": position === \"top\",\n\t\t\t\"right-4\": align === \"right\",\n\t\t\t\"left-4\": align === \"left\",\n\t\t},\n\t\tclassName\n\t);\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={{ opacity: 1 }}\n\t\t\tclassName={containerClasses}\n\t\t\tinitial={{ opacity: 0 }}\n\t\t\tlayout=\"position\"\n\t\t\ttransition={{\n\t\t\t\tdefault: { ease: \"anticipate\" },\n\t\t\t\tlayout: { duration: 0.3 },\n\t\t\t}}\n\t\t>\n\t\t\t<Bubble className=\"z-[1000] md:z-[9999]\" />\n\t\t\t<Container align={align} position={position}>\n\t\t\t\t<SupportRouter />\n\t\t\t</Container>\n\t\t</motion.div>\n\t);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA0BA,MAAaA,kBAAiD,EAC7D,WACA,WAAW,UACX,QAAQ,SACR,cAAc,cACT;CACL,MAAM,mBAAmB,GACxB,uBACA,gBAAgB,UAAU,UAAU,YACpC;EACC,YAAY,aAAa;EACzB,SAAS,aAAa;EACtB,WAAW,UAAU;EACrB,UAAU,UAAU;EACpB,EACD,UACA;AAED,QACC,qBAAC,OAAO;EACP,SAAS,EAAE,SAAS,GAAG;EACvB,WAAW;EACX,SAAS,EAAE,SAAS,GAAG;EACvB,QAAO;EACP,YAAY;GACX,SAAS,EAAE,MAAM,cAAc;GAC/B,QAAQ,EAAE,UAAU,IAAK;GACzB;aAED,oBAAC,UAAO,WAAU,yBAAyB,EAC3C,oBAAC;GAAiB;GAAiB;aAClC,oBAAC,kBAAgB;IACN;GACA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import * as react_jsx_runtime7 from "react/jsx-runtime";
|
|
3
2
|
import { Transition, Variants } from "motion/react";
|
|
4
3
|
|
|
5
4
|
//#region src/support/components/text-effect.d.ts
|
|
@@ -26,6 +25,10 @@ type TextEffectProps = {
|
|
|
26
25
|
segmentTransition?: Transition;
|
|
27
26
|
style?: React.CSSProperties;
|
|
28
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Animated typography helper that reveals text word-by-word or letter-by-letter
|
|
30
|
+
* with configurable motion presets.
|
|
31
|
+
*/
|
|
29
32
|
declare function TextEffect({
|
|
30
33
|
children,
|
|
31
34
|
per,
|
|
@@ -43,7 +46,7 @@ declare function TextEffect({
|
|
|
43
46
|
containerTransition,
|
|
44
47
|
segmentTransition,
|
|
45
48
|
style
|
|
46
|
-
}: TextEffectProps):
|
|
49
|
+
}: TextEffectProps): React.ReactElement;
|
|
47
50
|
//#endregion
|
|
48
51
|
export { PerType, PresetType, TextEffect, TextEffectProps };
|
|
49
52
|
//# sourceMappingURL=text-effect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-effect.d.ts","names":[],"sources":["../../../src/support/components/text-effect.tsx"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text-effect.d.ts","names":[],"sources":["../../../src/support/components/text-effect.tsx"],"sourcesContent":[],"mappings":";;;;KAWY,UAAA;KAEA,OAAA;AAFA,KAMA,eAAA,GANU;EAEV,QAAA,EAAO,MAAA,GAAA,MAAA,EAAA;EAIP,GAAA,CAAA,EAEL,OAFK;EAEL,EAAA,CAAA,EAAA,MACK,KAAA,CAAM,GAAA,CAAI,iBADf;EACK,QAAU,CAAA,EAAA;IAER,SAAA,CAAA,EAAA,QAAA;IACL,IAAA,CAAA,EAAA,QAAA;EAGC,CAAA;EAQa,SAAA,CAAA,EAAA,MAAA;EACF,MAAA,CAAA,EATX,UASW;EACZ,KAAM,CAAA,EAAA,MAAA;EAAa,WAAA,CAAA,EAAA,MAAA;EAmLZ,YAAA,CAAU,EAAA,MAAA;EACzB,OAAA,CAAA,EAAA,OAAA;EACA,mBAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACA,gBAAA,CAAA,EAAA,GAAA,GAAA,IAAA;EACA,uBAAA,CAAA,EAAA,MAAA;EACA,mBAAA,CAAA,EA1LsB,UA0LtB;EACA,iBAAA,CAAA,EA1LoB,UA0LpB;EACA,KAAA,CAAA,EA1LQ,KAAA,CAAM,aA0Ld;CACA;;;;;AAKA,iBAbe,UAAA,CAaf;EAAA,QAAA;EAAA,GAAA;EAAA,EAAA;EAAA,QAAA;EAAA,SAAA;EAAA,MAAA;EAAA,KAAA;EAAA,WAAA;EAAA,YAAA;EAAA,OAAA;EAAA,mBAAA;EAAA,gBAAA;EAAA,uBAAA;EAAA,mBAAA;EAAA,iBAAA;EAAA;AAAA,CAAA,EAIE,eAJF,CAAA,EAIoB,KAAA,CAAM,YAJ1B"}
|
|
@@ -166,6 +166,10 @@ const createVariantsWithTransition = (baseVariants, transition) => {
|
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
|
+
/**
|
|
170
|
+
* Animated typography helper that reveals text word-by-word or letter-by-letter
|
|
171
|
+
* with configurable motion presets.
|
|
172
|
+
*/
|
|
169
173
|
function TextEffect({ children, per = "word", as = "p", variants, className, preset = "fade", delay = 0, speedReveal = 1, speedSegment = 1, trigger = true, onAnimationComplete, onAnimationStart, segmentWrapperClassName, containerTransition, segmentTransition, style }) {
|
|
170
174
|
const segments = splitText(Array.isArray(children) ? children.join("") : children, per);
|
|
171
175
|
const MotionTag = motion[as];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-effect.js","names":["defaultStaggerTimes: Record<PerType, number>","defaultContainerVariants: Variants","defaultItemVariants: Variants","presetVariants: Record<\n\tPresetType,\n\t{ container: Variants; item: Variants }\n>","AnimationComponent: React.FC<{\n\tsegment: string;\n\tvariants: Variants;\n\tper: \"line\" | \"word\" | \"char\";\n\tsegmentWrapperClassName?: string;\n}>"],"sources":["../../../src/support/components/text-effect.tsx"],"sourcesContent":["\"use client\";\nimport type {\n\tTargetAndTransition,\n\tTransition,\n\tVariant,\n\tVariants,\n} from \"motion/react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport React from \"react\";\nimport { cn } from \"../utils\";\n\nexport type PresetType = \"blur\" | \"fade-in-blur\" | \"scale\" | \"fade\" | \"slide\";\n\nexport type PerType = \"word\" | \"char\" | \"line\";\n\nconst SPACE_REGEX = /(\\s+)/;\n\nexport type TextEffectProps = {\n\tchildren: string | string[];\n\tper?: PerType;\n\tas?: keyof React.JSX.IntrinsicElements;\n\tvariants?: {\n\t\tcontainer?: Variants;\n\t\titem?: Variants;\n\t};\n\tclassName?: string;\n\tpreset?: PresetType;\n\tdelay?: number;\n\tspeedReveal?: number;\n\tspeedSegment?: number;\n\ttrigger?: boolean;\n\tonAnimationComplete?: () => void;\n\tonAnimationStart?: () => void;\n\tsegmentWrapperClassName?: string;\n\tcontainerTransition?: Transition;\n\tsegmentTransition?: Transition;\n\tstyle?: React.CSSProperties;\n};\n\nconst defaultStaggerTimes: Record<PerType, number> = {\n\tchar: 0.03,\n\tword: 0.05,\n\tline: 0.1,\n};\n\nconst defaultContainerVariants: Variants = {\n\thidden: { opacity: 0 },\n\tvisible: {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tstaggerChildren: 0.05,\n\t\t},\n\t},\n\texit: {\n\t\ttransition: { staggerChildren: 0.05, staggerDirection: -1 },\n\t},\n};\n\nconst defaultItemVariants: Variants = {\n\thidden: { opacity: 0 },\n\tvisible: {\n\t\topacity: 1,\n\t},\n\texit: { opacity: 0 },\n};\n\nconst presetVariants: Record<\n\tPresetType,\n\t{ container: Variants; item: Variants }\n> = {\n\tblur: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, filter: \"blur(12px)\" },\n\t\t\tvisible: { opacity: 1, filter: \"blur(0px)\" },\n\t\t\texit: { opacity: 0, filter: \"blur(12px)\" },\n\t\t},\n\t},\n\t\"fade-in-blur\": {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, y: 20, filter: \"blur(12px)\" },\n\t\t\tvisible: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n\t\t\texit: { opacity: 0, y: 20, filter: \"blur(12px)\" },\n\t\t},\n\t},\n\tscale: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, scale: 0 },\n\t\t\tvisible: { opacity: 1, scale: 1 },\n\t\t\texit: { opacity: 0, scale: 0 },\n\t\t},\n\t},\n\tfade: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0 },\n\t\t\tvisible: { opacity: 1 },\n\t\t\texit: { opacity: 0 },\n\t\t},\n\t},\n\tslide: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, y: 20 },\n\t\t\tvisible: { opacity: 1, y: 0 },\n\t\t\texit: { opacity: 0, y: 20 },\n\t\t},\n\t},\n};\n\nconst AnimationComponent: React.FC<{\n\tsegment: string;\n\tvariants: Variants;\n\tper: \"line\" | \"word\" | \"char\";\n\tsegmentWrapperClassName?: string;\n}> = React.memo(({ segment, variants, per, segmentWrapperClassName }) => {\n\tconst content =\n\t\tper === \"line\" ? (\n\t\t\t<motion.span className=\"block\" variants={variants}>\n\t\t\t\t{segment}\n\t\t\t</motion.span>\n\t\t) : per === \"word\" ? (\n\t\t\t<motion.span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName=\"inline-block whitespace-pre\"\n\t\t\t\tvariants={variants}\n\t\t\t>\n\t\t\t\t{segment}\n\t\t\t</motion.span>\n\t\t) : (\n\t\t\t<motion.span className=\"inline-block whitespace-pre\">\n\t\t\t\t{segment.split(\"\").map((char, charIndex) => (\n\t\t\t\t\t<motion.span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName=\"inline-block whitespace-pre\"\n\t\t\t\t\t\tkey={`char-${charIndex}`}\n\t\t\t\t\t\tvariants={variants}\n\t\t\t\t\t>\n\t\t\t\t\t\t{char}\n\t\t\t\t\t</motion.span>\n\t\t\t\t))}\n\t\t\t</motion.span>\n\t\t);\n\n\tif (!segmentWrapperClassName) {\n\t\treturn content;\n\t}\n\n\tconst defaultWrapperClassName = per === \"line\" ? \"block\" : \"inline-block\";\n\n\treturn (\n\t\t<span className={cn(defaultWrapperClassName, segmentWrapperClassName)}>\n\t\t\t{content}\n\t\t</span>\n\t);\n});\n\nAnimationComponent.displayName = \"AnimationComponent\";\n\nconst splitText = (text: string, per: PerType) => {\n\tif (per === \"line\") {\n\t\treturn text.split(\"\\n\");\n\t}\n\treturn text.split(SPACE_REGEX);\n};\n\nconst hasTransition = (\n\tvariant?: Variant\n): variant is TargetAndTransition & { transition?: Transition } => {\n\tif (!variant) {\n\t\treturn false;\n\t}\n\treturn typeof variant === \"object\" && \"transition\" in variant;\n};\n\nconst createVariantsWithTransition = (\n\tbaseVariants: Variants,\n\ttransition?: Transition & { exit?: Transition }\n): Variants => {\n\tif (!transition) {\n\t\treturn baseVariants;\n\t}\n\n\tconst { exit: _, ...mainTransition } = transition;\n\n\treturn {\n\t\t...baseVariants,\n\t\tvisible: {\n\t\t\t...baseVariants.visible,\n\t\t\ttransition: {\n\t\t\t\t...(hasTransition(baseVariants.visible)\n\t\t\t\t\t? baseVariants.visible.transition\n\t\t\t\t\t: {}),\n\t\t\t\t...mainTransition,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\t...baseVariants.exit,\n\t\t\ttransition: {\n\t\t\t\t...(hasTransition(baseVariants.exit)\n\t\t\t\t\t? baseVariants.exit.transition\n\t\t\t\t\t: {}),\n\t\t\t\t...mainTransition,\n\t\t\t\tstaggerDirection: -1,\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport function TextEffect({\n\tchildren,\n\tper = \"word\",\n\tas = \"p\",\n\tvariants,\n\tclassName,\n\tpreset = \"fade\",\n\tdelay = 0,\n\tspeedReveal = 1,\n\tspeedSegment = 1,\n\ttrigger = true,\n\tonAnimationComplete,\n\tonAnimationStart,\n\tsegmentWrapperClassName,\n\tcontainerTransition,\n\tsegmentTransition,\n\tstyle,\n}: TextEffectProps) {\n\tconst segments = splitText(\n\t\tArray.isArray(children) ? children.join(\"\") : children,\n\t\tper\n\t);\n\tconst MotionTag = motion[as as keyof typeof motion] as typeof motion.div;\n\n\tconst baseVariants = preset\n\t\t? presetVariants[preset]\n\t\t: { container: defaultContainerVariants, item: defaultItemVariants };\n\n\tconst stagger = defaultStaggerTimes[per] / speedReveal;\n\n\tconst baseDuration = 0.3 / speedSegment;\n\n\tconst customStagger = hasTransition(variants?.container?.visible ?? {})\n\t\t? (variants?.container?.visible as TargetAndTransition).transition\n\t\t\t\t?.staggerChildren\n\t\t: undefined;\n\n\tconst customDelay = hasTransition(variants?.container?.visible ?? {})\n\t\t? (variants?.container?.visible as TargetAndTransition).transition\n\t\t\t\t?.delayChildren\n\t\t: undefined;\n\n\tconst computedVariants = {\n\t\tcontainer: createVariantsWithTransition(\n\t\t\tvariants?.container || baseVariants.container,\n\t\t\t{\n\t\t\t\tstaggerChildren: customStagger ?? stagger,\n\t\t\t\tdelayChildren: customDelay ?? delay,\n\t\t\t\t...containerTransition,\n\t\t\t\texit: {\n\t\t\t\t\tstaggerChildren: customStagger ?? stagger,\n\t\t\t\t\tstaggerDirection: -1,\n\t\t\t\t},\n\t\t\t}\n\t\t),\n\t\titem: createVariantsWithTransition(variants?.item || baseVariants.item, {\n\t\t\tduration: baseDuration,\n\t\t\t...segmentTransition,\n\t\t}),\n\t};\n\n\treturn (\n\t\t<AnimatePresence mode=\"popLayout\">\n\t\t\t{trigger && (\n\t\t\t\t<MotionTag\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tclassName={className}\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tonAnimationComplete={onAnimationComplete}\n\t\t\t\t\tonAnimationStart={onAnimationStart}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tvariants={computedVariants.container}\n\t\t\t\t>\n\t\t\t\t\t{per !== \"line\" ? <span className=\"sr-only\">{children}</span> : null}\n\t\t\t\t\t{segments.map((segment, index) => (\n\t\t\t\t\t\t<AnimationComponent\n\t\t\t\t\t\t\tkey={`${per}-${index}-${segment}`}\n\t\t\t\t\t\t\tper={per}\n\t\t\t\t\t\t\tsegment={segment}\n\t\t\t\t\t\t\tsegmentWrapperClassName={segmentWrapperClassName}\n\t\t\t\t\t\t\tvariants={computedVariants.item}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</MotionTag>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"text-effect.js","names":["defaultStaggerTimes: Record<PerType, number>","defaultContainerVariants: Variants","defaultItemVariants: Variants","presetVariants: Record<\n\tPresetType,\n\t{ container: Variants; item: Variants }\n>","AnimationComponent: React.FC<{\n\tsegment: string;\n\tvariants: Variants;\n\tper: \"line\" | \"word\" | \"char\";\n\tsegmentWrapperClassName?: string;\n}>"],"sources":["../../../src/support/components/text-effect.tsx"],"sourcesContent":["\"use client\";\nimport type {\n\tTargetAndTransition,\n\tTransition,\n\tVariant,\n\tVariants,\n} from \"motion/react\";\nimport { AnimatePresence, motion } from \"motion/react\";\nimport React from \"react\";\nimport { cn } from \"../utils\";\n\nexport type PresetType = \"blur\" | \"fade-in-blur\" | \"scale\" | \"fade\" | \"slide\";\n\nexport type PerType = \"word\" | \"char\" | \"line\";\n\nconst SPACE_REGEX = /(\\s+)/;\n\nexport type TextEffectProps = {\n\tchildren: string | string[];\n\tper?: PerType;\n\tas?: keyof React.JSX.IntrinsicElements;\n\tvariants?: {\n\t\tcontainer?: Variants;\n\t\titem?: Variants;\n\t};\n\tclassName?: string;\n\tpreset?: PresetType;\n\tdelay?: number;\n\tspeedReveal?: number;\n\tspeedSegment?: number;\n\ttrigger?: boolean;\n\tonAnimationComplete?: () => void;\n\tonAnimationStart?: () => void;\n\tsegmentWrapperClassName?: string;\n\tcontainerTransition?: Transition;\n\tsegmentTransition?: Transition;\n\tstyle?: React.CSSProperties;\n};\n\nconst defaultStaggerTimes: Record<PerType, number> = {\n\tchar: 0.03,\n\tword: 0.05,\n\tline: 0.1,\n};\n\nconst defaultContainerVariants: Variants = {\n\thidden: { opacity: 0 },\n\tvisible: {\n\t\topacity: 1,\n\t\ttransition: {\n\t\t\tstaggerChildren: 0.05,\n\t\t},\n\t},\n\texit: {\n\t\ttransition: { staggerChildren: 0.05, staggerDirection: -1 },\n\t},\n};\n\nconst defaultItemVariants: Variants = {\n\thidden: { opacity: 0 },\n\tvisible: {\n\t\topacity: 1,\n\t},\n\texit: { opacity: 0 },\n};\n\nconst presetVariants: Record<\n\tPresetType,\n\t{ container: Variants; item: Variants }\n> = {\n\tblur: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, filter: \"blur(12px)\" },\n\t\t\tvisible: { opacity: 1, filter: \"blur(0px)\" },\n\t\t\texit: { opacity: 0, filter: \"blur(12px)\" },\n\t\t},\n\t},\n\t\"fade-in-blur\": {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, y: 20, filter: \"blur(12px)\" },\n\t\t\tvisible: { opacity: 1, y: 0, filter: \"blur(0px)\" },\n\t\t\texit: { opacity: 0, y: 20, filter: \"blur(12px)\" },\n\t\t},\n\t},\n\tscale: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, scale: 0 },\n\t\t\tvisible: { opacity: 1, scale: 1 },\n\t\t\texit: { opacity: 0, scale: 0 },\n\t\t},\n\t},\n\tfade: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0 },\n\t\t\tvisible: { opacity: 1 },\n\t\t\texit: { opacity: 0 },\n\t\t},\n\t},\n\tslide: {\n\t\tcontainer: defaultContainerVariants,\n\t\titem: {\n\t\t\thidden: { opacity: 0, y: 20 },\n\t\t\tvisible: { opacity: 1, y: 0 },\n\t\t\texit: { opacity: 0, y: 20 },\n\t\t},\n\t},\n};\n\nconst AnimationComponent: React.FC<{\n\tsegment: string;\n\tvariants: Variants;\n\tper: \"line\" | \"word\" | \"char\";\n\tsegmentWrapperClassName?: string;\n}> = React.memo(({ segment, variants, per, segmentWrapperClassName }) => {\n\tconst content =\n\t\tper === \"line\" ? (\n\t\t\t<motion.span className=\"block\" variants={variants}>\n\t\t\t\t{segment}\n\t\t\t</motion.span>\n\t\t) : per === \"word\" ? (\n\t\t\t<motion.span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName=\"inline-block whitespace-pre\"\n\t\t\t\tvariants={variants}\n\t\t\t>\n\t\t\t\t{segment}\n\t\t\t</motion.span>\n\t\t) : (\n\t\t\t<motion.span className=\"inline-block whitespace-pre\">\n\t\t\t\t{segment.split(\"\").map((char, charIndex) => (\n\t\t\t\t\t<motion.span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName=\"inline-block whitespace-pre\"\n\t\t\t\t\t\tkey={`char-${charIndex}`}\n\t\t\t\t\t\tvariants={variants}\n\t\t\t\t\t>\n\t\t\t\t\t\t{char}\n\t\t\t\t\t</motion.span>\n\t\t\t\t))}\n\t\t\t</motion.span>\n\t\t);\n\n\tif (!segmentWrapperClassName) {\n\t\treturn content;\n\t}\n\n\tconst defaultWrapperClassName = per === \"line\" ? \"block\" : \"inline-block\";\n\n\treturn (\n\t\t<span className={cn(defaultWrapperClassName, segmentWrapperClassName)}>\n\t\t\t{content}\n\t\t</span>\n\t);\n});\n\nAnimationComponent.displayName = \"AnimationComponent\";\n\nconst splitText = (text: string, per: PerType) => {\n\tif (per === \"line\") {\n\t\treturn text.split(\"\\n\");\n\t}\n\treturn text.split(SPACE_REGEX);\n};\n\nconst hasTransition = (\n\tvariant?: Variant\n): variant is TargetAndTransition & { transition?: Transition } => {\n\tif (!variant) {\n\t\treturn false;\n\t}\n\treturn typeof variant === \"object\" && \"transition\" in variant;\n};\n\nconst createVariantsWithTransition = (\n\tbaseVariants: Variants,\n\ttransition?: Transition & { exit?: Transition }\n): Variants => {\n\tif (!transition) {\n\t\treturn baseVariants;\n\t}\n\n\tconst { exit: _, ...mainTransition } = transition;\n\n\treturn {\n\t\t...baseVariants,\n\t\tvisible: {\n\t\t\t...baseVariants.visible,\n\t\t\ttransition: {\n\t\t\t\t...(hasTransition(baseVariants.visible)\n\t\t\t\t\t? baseVariants.visible.transition\n\t\t\t\t\t: {}),\n\t\t\t\t...mainTransition,\n\t\t\t},\n\t\t},\n\t\texit: {\n\t\t\t...baseVariants.exit,\n\t\t\ttransition: {\n\t\t\t\t...(hasTransition(baseVariants.exit)\n\t\t\t\t\t? baseVariants.exit.transition\n\t\t\t\t\t: {}),\n\t\t\t\t...mainTransition,\n\t\t\t\tstaggerDirection: -1,\n\t\t\t},\n\t\t},\n\t};\n};\n\n/**\n * Animated typography helper that reveals text word-by-word or letter-by-letter\n * with configurable motion presets.\n */\nexport function TextEffect({\n\tchildren,\n\tper = \"word\",\n\tas = \"p\",\n\tvariants,\n\tclassName,\n\tpreset = \"fade\",\n\tdelay = 0,\n\tspeedReveal = 1,\n\tspeedSegment = 1,\n\ttrigger = true,\n\tonAnimationComplete,\n\tonAnimationStart,\n\tsegmentWrapperClassName,\n\tcontainerTransition,\n\tsegmentTransition,\n\tstyle,\n}: TextEffectProps): React.ReactElement {\n\tconst segments = splitText(\n\t\tArray.isArray(children) ? children.join(\"\") : children,\n\t\tper\n\t);\n\tconst MotionTag = motion[as as keyof typeof motion] as typeof motion.div;\n\n\tconst baseVariants = preset\n\t\t? presetVariants[preset]\n\t\t: { container: defaultContainerVariants, item: defaultItemVariants };\n\n\tconst stagger = defaultStaggerTimes[per] / speedReveal;\n\n\tconst baseDuration = 0.3 / speedSegment;\n\n\tconst customStagger = hasTransition(variants?.container?.visible ?? {})\n\t\t? (variants?.container?.visible as TargetAndTransition).transition\n\t\t\t\t?.staggerChildren\n\t\t: undefined;\n\n\tconst customDelay = hasTransition(variants?.container?.visible ?? {})\n\t\t? (variants?.container?.visible as TargetAndTransition).transition\n\t\t\t\t?.delayChildren\n\t\t: undefined;\n\n\tconst computedVariants = {\n\t\tcontainer: createVariantsWithTransition(\n\t\t\tvariants?.container || baseVariants.container,\n\t\t\t{\n\t\t\t\tstaggerChildren: customStagger ?? stagger,\n\t\t\t\tdelayChildren: customDelay ?? delay,\n\t\t\t\t...containerTransition,\n\t\t\t\texit: {\n\t\t\t\t\tstaggerChildren: customStagger ?? stagger,\n\t\t\t\t\tstaggerDirection: -1,\n\t\t\t\t},\n\t\t\t}\n\t\t),\n\t\titem: createVariantsWithTransition(variants?.item || baseVariants.item, {\n\t\t\tduration: baseDuration,\n\t\t\t...segmentTransition,\n\t\t}),\n\t};\n\n\treturn (\n\t\t<AnimatePresence mode=\"popLayout\">\n\t\t\t{trigger && (\n\t\t\t\t<MotionTag\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tclassName={className}\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tonAnimationComplete={onAnimationComplete}\n\t\t\t\t\tonAnimationStart={onAnimationStart}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\tvariants={computedVariants.container}\n\t\t\t\t>\n\t\t\t\t\t{per !== \"line\" ? <span className=\"sr-only\">{children}</span> : null}\n\t\t\t\t\t{segments.map((segment, index) => (\n\t\t\t\t\t\t<AnimationComponent\n\t\t\t\t\t\t\tkey={`${per}-${index}-${segment}`}\n\t\t\t\t\t\t\tper={per}\n\t\t\t\t\t\t\tsegment={segment}\n\t\t\t\t\t\t\tsegmentWrapperClassName={segmentWrapperClassName}\n\t\t\t\t\t\t\tvariants={computedVariants.item}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</MotionTag>\n\t\t\t)}\n\t\t</AnimatePresence>\n\t);\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ConversationTimelineToolProps } from "./conversation-timeline.js";
|
|
2
|
+
|
|
3
|
+
//#region src/support/components/timeline-identification-tool.d.ts
|
|
4
|
+
declare const IdentificationTimelineTool: React.FC<ConversationTimelineToolProps>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { IdentificationTimelineTool };
|
|
7
|
+
//# sourceMappingURL=timeline-identification-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-identification-tool.d.ts","names":[],"sources":["../../../src/support/components/timeline-identification-tool.tsx"],"sourcesContent":[],"mappings":";;;cAca,4BAA4B,KAAA,CAAM,GAC9C"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { useSupportText } from "../text/index.js";
|
|
3
|
+
import { useVisitor } from "../../hooks/use-visitor.js";
|
|
4
|
+
import { useSupport } from "../../provider.js";
|
|
5
|
+
import { useCallback, useMemo, useState } from "react";
|
|
6
|
+
import { ConversationEventType, ConversationTimelineType, TimelineItemVisibility } from "@cossistant/types/enums";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/support/components/timeline-identification-tool.tsx
|
|
10
|
+
const IdentificationTimelineTool = ({ conversationId }) => {
|
|
11
|
+
const text = useSupportText();
|
|
12
|
+
const { identify, visitor } = useVisitor();
|
|
13
|
+
const { client } = useSupport();
|
|
14
|
+
const [email, setEmail] = useState("");
|
|
15
|
+
const [status, setStatus] = useState("idle");
|
|
16
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
17
|
+
const isAlreadyIdentified = Boolean(visitor?.contact);
|
|
18
|
+
const hasSucceeded = status === "success" || isAlreadyIdentified;
|
|
19
|
+
const ctaLabel = text("component.identificationTool.cta");
|
|
20
|
+
const successLabel = text("component.identificationTool.success");
|
|
21
|
+
const description = text("component.identificationTool.description");
|
|
22
|
+
const title = text("component.identificationTool.title");
|
|
23
|
+
const submitDisabled = hasSucceeded || status === "submitting";
|
|
24
|
+
const handleSubmit = useCallback(async (event) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
if (submitDisabled) return;
|
|
27
|
+
const trimmedEmail = email.trim();
|
|
28
|
+
if (!trimmedEmail) {
|
|
29
|
+
setErrorMessage(text("component.identificationTool.validation"));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
setStatus("submitting");
|
|
33
|
+
setErrorMessage(null);
|
|
34
|
+
try {
|
|
35
|
+
const identifyResult = await identify({ email: trimmedEmail });
|
|
36
|
+
if (!identifyResult) {
|
|
37
|
+
setStatus("error");
|
|
38
|
+
setErrorMessage(text("component.identificationTool.error"));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const payload = {
|
|
42
|
+
conversationId,
|
|
43
|
+
item: {
|
|
44
|
+
type: ConversationTimelineType.EVENT,
|
|
45
|
+
text: text("component.identificationTool.eventLog"),
|
|
46
|
+
tool: null,
|
|
47
|
+
parts: [{
|
|
48
|
+
type: "event",
|
|
49
|
+
eventType: ConversationEventType.VISITOR_IDENTIFIED,
|
|
50
|
+
actorUserId: null,
|
|
51
|
+
actorAiAgentId: null,
|
|
52
|
+
targetUserId: null,
|
|
53
|
+
targetAiAgentId: null,
|
|
54
|
+
message: text("component.identificationTool.eventLog")
|
|
55
|
+
}],
|
|
56
|
+
visitorId: identifyResult.visitorId,
|
|
57
|
+
visibility: TimelineItemVisibility.PUBLIC
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
await client.sendMessage(payload);
|
|
61
|
+
setStatus("success");
|
|
62
|
+
setEmail("");
|
|
63
|
+
client.fetchWebsite({ force: true }).catch(() => {});
|
|
64
|
+
} catch {
|
|
65
|
+
setStatus("error");
|
|
66
|
+
setErrorMessage(text("component.identificationTool.error"));
|
|
67
|
+
}
|
|
68
|
+
}, [
|
|
69
|
+
conversationId,
|
|
70
|
+
email,
|
|
71
|
+
identify,
|
|
72
|
+
client,
|
|
73
|
+
submitDisabled,
|
|
74
|
+
text
|
|
75
|
+
]);
|
|
76
|
+
const helperMessage = useMemo(() => {
|
|
77
|
+
if (errorMessage) return /* @__PURE__ */ jsx("p", {
|
|
78
|
+
className: "text-destructive text-xs",
|
|
79
|
+
role: "alert",
|
|
80
|
+
children: errorMessage
|
|
81
|
+
});
|
|
82
|
+
if (hasSucceeded) return /* @__PURE__ */ jsx("p", {
|
|
83
|
+
className: "text-primary text-xs",
|
|
84
|
+
children: successLabel
|
|
85
|
+
});
|
|
86
|
+
return null;
|
|
87
|
+
}, [
|
|
88
|
+
errorMessage,
|
|
89
|
+
hasSucceeded,
|
|
90
|
+
successLabel
|
|
91
|
+
]);
|
|
92
|
+
return /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "rounded border border-co-border/60 bg-co-background-100 p-4 shadow-sm",
|
|
94
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
95
|
+
className: "flex flex-col gap-3",
|
|
96
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
97
|
+
className: "flex flex-col gap-1",
|
|
98
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
99
|
+
className: "font-semibold text-sm",
|
|
100
|
+
children: title
|
|
101
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
102
|
+
className: "text-muted-foreground text-xs",
|
|
103
|
+
children: description
|
|
104
|
+
})]
|
|
105
|
+
}), hasSucceeded ? /* @__PURE__ */ jsx("div", {
|
|
106
|
+
className: "rounded-md bg-co-primary/10 px-3 py-2 text-primary text-sm",
|
|
107
|
+
children: successLabel
|
|
108
|
+
}) : /* @__PURE__ */ jsxs("form", {
|
|
109
|
+
className: "flex gap-2",
|
|
110
|
+
onSubmit: handleSubmit,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsx("input", {
|
|
113
|
+
"aria-label": text("component.identificationTool.inputLabel"),
|
|
114
|
+
autoComplete: "email",
|
|
115
|
+
className: "h-10 w-full rounded border border-co-border/60 bg-transparent px-3 py-2 text-sm outline-none focus:border-co-primary focus:ring-2 focus:ring-co-primary/20",
|
|
116
|
+
disabled: submitDisabled,
|
|
117
|
+
inputMode: "email",
|
|
118
|
+
onChange: (event) => setEmail(event.target.value),
|
|
119
|
+
placeholder: text("component.identificationTool.inputPlaceholder"),
|
|
120
|
+
type: "email",
|
|
121
|
+
value: email
|
|
122
|
+
}),
|
|
123
|
+
helperMessage,
|
|
124
|
+
/* @__PURE__ */ jsx(Button, {
|
|
125
|
+
className: "h-10",
|
|
126
|
+
disabled: submitDisabled,
|
|
127
|
+
type: "submit",
|
|
128
|
+
children: status === "submitting" ? text("component.identificationTool.loading") : ctaLabel
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
IdentificationTimelineTool.displayName = "IdentificationTimelineTool";
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { IdentificationTimelineTool };
|
|
139
|
+
//# sourceMappingURL=timeline-identification-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-identification-tool.js","names":["IdentificationTimelineTool: React.FC<\n\tConversationTimelineToolProps\n>","payload: SendTimelineItemRequest"],"sources":["../../../src/support/components/timeline-identification-tool.tsx"],"sourcesContent":["import type { SendTimelineItemRequest } from \"@cossistant/types/api/timeline-item\";\nimport {\n\tConversationEventType,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"@cossistant/types/enums\";\nimport { type FormEventHandler, useCallback, useMemo, useState } from \"react\";\n\nimport { useVisitor } from \"../../hooks/use-visitor\";\nimport { useSupport } from \"../../provider\";\nimport { useSupportText } from \"../text\";\nimport { Button } from \"./button\";\nimport type { ConversationTimelineToolProps } from \"./conversation-timeline\";\n\nexport const IdentificationTimelineTool: React.FC<\n\tConversationTimelineToolProps\n> = ({ conversationId }) => {\n\tconst text = useSupportText();\n\tconst { identify, visitor } = useVisitor();\n\tconst { client } = useSupport();\n\tconst [email, setEmail] = useState(\"\");\n\tconst [status, setStatus] = useState<\n\t\t\"idle\" | \"submitting\" | \"success\" | \"error\"\n\t>(\"idle\");\n\tconst [errorMessage, setErrorMessage] = useState<string | null>(null);\n\n\tconst isAlreadyIdentified = Boolean(visitor?.contact);\n\tconst hasSucceeded = status === \"success\" || isAlreadyIdentified;\n\n\tconst ctaLabel = text(\"component.identificationTool.cta\");\n\tconst successLabel = text(\"component.identificationTool.success\");\n\tconst description = text(\"component.identificationTool.description\");\n\tconst title = text(\"component.identificationTool.title\");\n\n\tconst submitDisabled = hasSucceeded || status === \"submitting\";\n\n\tconst handleSubmit = useCallback<FormEventHandler<HTMLFormElement>>(\n\t\tasync (event) => {\n\t\t\tevent.preventDefault();\n\n\t\t\tif (submitDisabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst trimmedEmail = email.trim();\n\t\t\tif (!trimmedEmail) {\n\t\t\t\tsetErrorMessage(text(\"component.identificationTool.validation\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetStatus(\"submitting\");\n\t\t\tsetErrorMessage(null);\n\n\t\t\ttry {\n\t\t\t\tconst identifyResult = await identify({ email: trimmedEmail });\n\n\t\t\t\tif (!identifyResult) {\n\t\t\t\t\tsetStatus(\"error\");\n\t\t\t\t\tsetErrorMessage(text(\"component.identificationTool.error\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst payload: SendTimelineItemRequest = {\n\t\t\t\t\tconversationId,\n\t\t\t\t\titem: {\n\t\t\t\t\t\ttype: ConversationTimelineType.EVENT,\n\t\t\t\t\t\ttext: text(\"component.identificationTool.eventLog\"),\n\t\t\t\t\t\ttool: null,\n\t\t\t\t\t\tparts: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: \"event\" as const,\n\t\t\t\t\t\t\t\teventType: ConversationEventType.VISITOR_IDENTIFIED,\n\t\t\t\t\t\t\t\tactorUserId: null,\n\t\t\t\t\t\t\t\tactorAiAgentId: null,\n\t\t\t\t\t\t\t\ttargetUserId: null,\n\t\t\t\t\t\t\t\ttargetAiAgentId: null,\n\t\t\t\t\t\t\t\tmessage: text(\"component.identificationTool.eventLog\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tvisitorId: identifyResult.visitorId,\n\t\t\t\t\t\tvisibility: TimelineItemVisibility.PUBLIC,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tawait client.sendMessage(payload);\n\n\t\t\t\tsetStatus(\"success\");\n\t\t\t\tsetEmail(\"\");\n\n\t\t\t\tvoid client.fetchWebsite({ force: true }).catch(() => {});\n\t\t\t} catch {\n\t\t\t\tsetStatus(\"error\");\n\t\t\t\tsetErrorMessage(text(\"component.identificationTool.error\"));\n\t\t\t}\n\t\t},\n\t\t[conversationId, email, identify, client, submitDisabled, text]\n\t);\n\n\tconst helperMessage = useMemo(() => {\n\t\tif (errorMessage) {\n\t\t\treturn (\n\t\t\t\t<p className=\"text-destructive text-xs\" role=\"alert\">\n\t\t\t\t\t{errorMessage}\n\t\t\t\t</p>\n\t\t\t);\n\t\t}\n\n\t\tif (hasSucceeded) {\n\t\t\treturn <p className=\"text-primary text-xs\">{successLabel}</p>;\n\t\t}\n\n\t\treturn null;\n\t}, [errorMessage, hasSucceeded, successLabel]);\n\n\treturn (\n\t\t<div className=\"rounded border border-co-border/60 bg-co-background-100 p-4 shadow-sm\">\n\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t<h3 className=\"font-semibold text-sm\">{title}</h3>\n\t\t\t\t\t<p className=\"text-muted-foreground text-xs\">{description}</p>\n\t\t\t\t</div>\n\t\t\t\t{hasSucceeded ? (\n\t\t\t\t\t<div className=\"rounded-md bg-co-primary/10 px-3 py-2 text-primary text-sm\">\n\t\t\t\t\t\t{successLabel}\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<form className=\"flex gap-2\" onSubmit={handleSubmit}>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\taria-label={text(\"component.identificationTool.inputLabel\")}\n\t\t\t\t\t\t\tautoComplete=\"email\"\n\t\t\t\t\t\t\tclassName=\"h-10 w-full rounded border border-co-border/60 bg-transparent px-3 py-2 text-sm outline-none focus:border-co-primary focus:ring-2 focus:ring-co-primary/20\"\n\t\t\t\t\t\t\tdisabled={submitDisabled}\n\t\t\t\t\t\t\tinputMode=\"email\"\n\t\t\t\t\t\t\tonChange={(event) => setEmail(event.target.value)}\n\t\t\t\t\t\t\tplaceholder={text(\n\t\t\t\t\t\t\t\t\"component.identificationTool.inputPlaceholder\"\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\ttype=\"email\"\n\t\t\t\t\t\t\tvalue={email}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{helperMessage}\n\t\t\t\t\t\t<Button className=\"h-10\" disabled={submitDisabled} type=\"submit\">\n\t\t\t\t\t\t\t{status === \"submitting\"\n\t\t\t\t\t\t\t\t? text(\"component.identificationTool.loading\")\n\t\t\t\t\t\t\t\t: ctaLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nIdentificationTimelineTool.displayName = \"IdentificationTimelineTool\";\n"],"mappings":";;;;;;;;;AAcA,MAAaA,8BAER,EAAE,qBAAqB;CAC3B,MAAM,OAAO,gBAAgB;CAC7B,MAAM,EAAE,UAAU,YAAY,YAAY;CAC1C,MAAM,EAAE,WAAW,YAAY;CAC/B,MAAM,CAAC,OAAO,YAAY,SAAS,GAAG;CACtC,MAAM,CAAC,QAAQ,aAAa,SAE1B,OAAO;CACT,MAAM,CAAC,cAAc,mBAAmB,SAAwB,KAAK;CAErE,MAAM,sBAAsB,QAAQ,SAAS,QAAQ;CACrD,MAAM,eAAe,WAAW,aAAa;CAE7C,MAAM,WAAW,KAAK,mCAAmC;CACzD,MAAM,eAAe,KAAK,uCAAuC;CACjE,MAAM,cAAc,KAAK,2CAA2C;CACpE,MAAM,QAAQ,KAAK,qCAAqC;CAExD,MAAM,iBAAiB,gBAAgB,WAAW;CAElD,MAAM,eAAe,YACpB,OAAO,UAAU;AAChB,QAAM,gBAAgB;AAEtB,MAAI,eACH;EAGD,MAAM,eAAe,MAAM,MAAM;AACjC,MAAI,CAAC,cAAc;AAClB,mBAAgB,KAAK,0CAA0C,CAAC;AAChE;;AAGD,YAAU,aAAa;AACvB,kBAAgB,KAAK;AAErB,MAAI;GACH,MAAM,iBAAiB,MAAM,SAAS,EAAE,OAAO,cAAc,CAAC;AAE9D,OAAI,CAAC,gBAAgB;AACpB,cAAU,QAAQ;AAClB,oBAAgB,KAAK,qCAAqC,CAAC;AAC3D;;GAGD,MAAMC,UAAmC;IACxC;IACA,MAAM;KACL,MAAM,yBAAyB;KAC/B,MAAM,KAAK,wCAAwC;KACnD,MAAM;KACN,OAAO,CACN;MACC,MAAM;MACN,WAAW,sBAAsB;MACjC,aAAa;MACb,gBAAgB;MAChB,cAAc;MACd,iBAAiB;MACjB,SAAS,KAAK,wCAAwC;MACtD,CACD;KACD,WAAW,eAAe;KAC1B,YAAY,uBAAuB;KACnC;IACD;AAED,SAAM,OAAO,YAAY,QAAQ;AAEjC,aAAU,UAAU;AACpB,YAAS,GAAG;AAEZ,GAAK,OAAO,aAAa,EAAE,OAAO,MAAM,CAAC,CAAC,YAAY,GAAG;UAClD;AACP,aAAU,QAAQ;AAClB,mBAAgB,KAAK,qCAAqC,CAAC;;IAG7D;EAAC;EAAgB;EAAO;EAAU;EAAQ;EAAgB;EAAK,CAC/D;CAED,MAAM,gBAAgB,cAAc;AACnC,MAAI,aACH,QACC,oBAAC;GAAE,WAAU;GAA2B,MAAK;aAC3C;IACE;AAIN,MAAI,aACH,QAAO,oBAAC;GAAE,WAAU;aAAwB;IAAiB;AAG9D,SAAO;IACL;EAAC;EAAc;EAAc;EAAa,CAAC;AAE9C,QACC,oBAAC;EAAI,WAAU;YACd,qBAAC;GAAI,WAAU;cACd,qBAAC;IAAI,WAAU;eACd,oBAAC;KAAG,WAAU;eAAyB;MAAW,EAClD,oBAAC;KAAE,WAAU;eAAiC;MAAgB;KACzD,EACL,eACA,oBAAC;IAAI,WAAU;cACb;KACI,GAEN,qBAAC;IAAK,WAAU;IAAa,UAAU;;KACtC,oBAAC;MACA,cAAY,KAAK,0CAA0C;MAC3D,cAAa;MACb,WAAU;MACV,UAAU;MACV,WAAU;MACV,WAAW,UAAU,SAAS,MAAM,OAAO,MAAM;MACjD,aAAa,KACZ,gDACA;MACD,MAAK;MACL,OAAO;OACN;KACD;KACD,oBAAC;MAAO,WAAU;MAAO,UAAU;MAAgB,MAAK;gBACtD,WAAW,eACT,KAAK,uCAAuC,GAC5C;OACK;;KACH;IAEH;GACD;;AAIR,2BAA2B,cAAc"}
|
|
@@ -8,7 +8,8 @@ type TimelineMessageGroupProps = {
|
|
|
8
8
|
availableAIAgents: AvailableAIAgent[];
|
|
9
9
|
availableHumanAgents: AvailableHumanAgent[];
|
|
10
10
|
currentVisitorId?: string;
|
|
11
|
-
seenByIds?: string[];
|
|
11
|
+
seenByIds?: readonly string[];
|
|
12
|
+
seenByNames?: readonly string[];
|
|
12
13
|
};
|
|
13
14
|
declare const TimelineMessageGroup: React.FC<TimelineMessageGroupProps>;
|
|
14
15
|
//#endregion
|