@usecrow/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +202 -0
- package/dist/index.cjs +638 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +166 -0
- package/dist/index.d.ts +166 -0
- package/dist/index.js +624 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +3 -0
- package/package.json +70 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/CrowProvider.tsx","../src/hooks/useChat.ts","../src/components/ChatBubble.tsx","../src/components/WidgetHeader.tsx","../src/components/MessageBubble.tsx","../src/components/MessageList.tsx","../src/components/PromptInput.tsx","../src/CrowWidget.tsx","../src/CrowCopilot.tsx","../src/hooks/useIdentity.ts","../src/hooks/useConversations.ts"],"names":["useRef","useEffect","jsx","clsx","jsxs","useState","useCallback","CrowClient"],"mappings":";;;;;AAWA,IAAM,WAAA,GAAc,cAAuC,IAAI,CAAA;AASxD,SAAS,YAAA,CAAa;AAAA,EAC3B,QAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAsB;AAEpB,EAAA,MAAM,SAAA,GAAY,OAA0B,IAAI,CAAA;AAEhD,EAAA,IAAI,CAAC,UAAU,OAAA,EAAS;AACtB,IAAA,SAAA,CAAU,UAAU,IAAI,UAAA,CAAW,EAAE,SAAA,EAAW,MAAA,EAAQ,OAAO,CAAA;AAAA,EACjE;AAEA,EAAA,MAAM,SAAS,SAAA,CAAU,OAAA;AAGzB,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,MAAM;AACX,MAAA,MAAA,CAAO,OAAA,EAAQ;AAAA,IACjB,CAAA;AAAA,EACF,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAA,MAAM,KAAA,GAAQ,QAAQ,OAAO,EAAE,QAAO,CAAA,EAAI,CAAC,MAAM,CAAC,CAAA;AAElD,EAAA,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AAAA,IACF,CAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AAEA,EAAA,MAAM,kBAAA,GAAqBA,WAAAA;AAAA,IACzB,OAAO,cAAA,KAA2B;AAChC,MAAA,mBAAA,CAAoB,IAAI,CAAA;AACxB,MAAA,IAAI;AACF,QAAA,MAAM,MAAA,CAAO,mBAAmB,cAAc,CAAA;AAAA,MAChD,CAAA,SAAE;AACA,QAAA,mBAAA,CAAoB,KAAK,CAAA;AAAA,MAC3B;AAAA,IACF,CAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AAEA,EAAA,MAAM,oBAAA,GAAuBA,YAAY,MAAM;AAC7C,IAAA,MAAA,CAAO,aAAA,EAAc;AAAA,EACvB,CAAA,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,sBAAA;AAAA,IACA,gBAAA;AAAA,IACA,uBAAuB,MAAA,CAAO,cAAA;AAAA,IAC9B,iBAAA;AAAA,IACA,WAAA;AAAA,IACA,kBAAA;AAAA,IACA;AAAA,GACF;AACF","file":"index.js","sourcesContent":["/**\n * CrowProvider - React context provider for sharing CrowClient\n */\n\nimport { createContext, useContext, useMemo, useEffect, useRef } from 'react';\nimport { CrowClient, type CrowClientConfig } from '@usecrow/client';\n\ninterface CrowContextValue {\n client: CrowClient;\n}\n\nconst CrowContext = createContext<CrowContextValue | null>(null);\n\nexport interface CrowProviderProps extends CrowClientConfig {\n children: React.ReactNode;\n}\n\n/**\n * Provider component that creates and shares a CrowClient instance\n */\nexport function CrowProvider({\n children,\n productId,\n apiUrl,\n model,\n}: CrowProviderProps) {\n // Create client once and keep it stable\n const clientRef = useRef<CrowClient | null>(null);\n\n if (!clientRef.current) {\n clientRef.current = new CrowClient({ productId, apiUrl, model });\n }\n\n const client = clientRef.current;\n\n // Clean up on unmount\n useEffect(() => {\n return () => {\n client.destroy();\n };\n }, [client]);\n\n const value = useMemo(() => ({ client }), [client]);\n\n return <CrowContext.Provider value={value}>{children}</CrowContext.Provider>;\n}\n\n/**\n * Hook to access the CrowClient from context\n */\nexport function useCrowClient(): CrowClient {\n const context = useContext(CrowContext);\n if (!context) {\n throw new Error('useCrowClient must be used within a CrowProvider');\n }\n return context.client;\n}\n\n/**\n * Hook to optionally access the CrowClient (returns null if not in provider)\n */\nexport function useCrowClientOptional(): CrowClient | null {\n const context = useContext(CrowContext);\n return context?.client ?? null;\n}\n\n","/**\n * useChat - React hook for chat functionality\n */\n\nimport { useState, useCallback, useEffect, useRef } from 'react';\nimport { CrowClient, type Message, type StreamEvent } from '@usecrow/client';\n\ninterface UseChatOptions {\n client: CrowClient;\n onStreamEvent?: (event: StreamEvent) => void;\n}\n\ninterface UseChatReturn {\n messages: Message[];\n isLoading: boolean;\n sendMessage: (content: string) => Promise<void>;\n stop: () => void;\n clearMessages: () => void;\n}\n\n/**\n * React hook that wraps CrowClient chat functionality\n */\nexport function useChat({ client, onStreamEvent }: UseChatOptions): UseChatReturn {\n const [messages, setMessages] = useState<Message[]>(client.messages);\n const [isLoading, setIsLoading] = useState(client.isLoading);\n const onStreamEventRef = useRef(onStreamEvent);\n\n // Keep ref updated\n useEffect(() => {\n onStreamEventRef.current = onStreamEvent;\n });\n\n // Subscribe to client state changes\n useEffect(() => {\n const unsubMessages = client.onMessages(setMessages);\n const unsubLoading = client.onLoading(setIsLoading);\n\n // Sync initial state\n setMessages(client.messages);\n setIsLoading(client.isLoading);\n\n return () => {\n unsubMessages();\n unsubLoading();\n };\n }, [client]);\n\n const sendMessage = useCallback(\n async (content: string) => {\n for await (const event of client.sendMessage(content)) {\n onStreamEventRef.current?.(event);\n }\n },\n [client]\n );\n\n const stop = useCallback(() => {\n client.stop();\n }, [client]);\n\n const clearMessages = useCallback(() => {\n client.clearMessages();\n }, [client]);\n\n return {\n messages,\n isLoading,\n sendMessage,\n stop,\n clearMessages,\n };\n}\n\n","/**\n * ChatBubble - Floating action button to open/close widget\n */\n\nimport { clsx } from 'clsx';\n\ninterface ChatBubbleProps {\n isOpen: boolean;\n onClick: () => void;\n className?: string;\n}\n\nexport function ChatBubble({ isOpen, onClick, className }: ChatBubbleProps) {\n return (\n <button\n onClick={onClick}\n className={clsx(\n 'crow-fixed crow-z-[999999] crow-rounded-full',\n 'crow-w-14 crow-h-14 crow-flex crow-items-center crow-justify-center',\n 'crow-bg-crow-primary hover:crow-bg-crow-primary-dark',\n 'crow-shadow-lg hover:crow-shadow-xl crow-transition-all crow-duration-300',\n 'hover:crow-scale-110',\n className\n )}\n style={{\n right: '20px',\n bottom: '20px',\n }}\n aria-label={isOpen ? 'Close chat' : 'Open chat'}\n >\n {isOpen ? (\n <svg\n className=\"crow-w-6 crow-h-6 crow-text-white\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M19 9l-7 7-7-7\"\n />\n </svg>\n ) : (\n <svg\n className=\"crow-w-6 crow-h-6 crow-text-white\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z\"\n />\n </svg>\n )}\n </button>\n );\n}\n\n","/**\n * WidgetHeader - Header bar for widget/copilot\n */\n\nimport { clsx } from 'clsx';\n\ninterface WidgetHeaderProps {\n title?: string;\n onNewChat?: () => void;\n onClose?: () => void;\n showNewChat?: boolean;\n showClose?: boolean;\n className?: string;\n}\n\nexport function WidgetHeader({\n title = 'Chat',\n onNewChat,\n onClose,\n showNewChat = true,\n showClose = false,\n className,\n}: WidgetHeaderProps) {\n return (\n <div\n className={clsx(\n 'crow-flex crow-items-center crow-justify-between crow-px-4 crow-py-3',\n 'crow-border-b crow-border-gray-200 crow-bg-white',\n className\n )}\n >\n <h2 className=\"crow-font-semibold crow-text-gray-900\">{title}</h2>\n\n <div className=\"crow-flex crow-items-center crow-gap-2\">\n {showNewChat && onNewChat && (\n <button\n onClick={onNewChat}\n className=\"crow-p-1.5 crow-rounded-lg crow-text-gray-500 hover:crow-bg-gray-100 hover:crow-text-gray-700 crow-transition-colors\"\n aria-label=\"New chat\"\n >\n <svg\n className=\"crow-w-5 crow-h-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M12 4v16m8-8H4\"\n />\n </svg>\n </button>\n )}\n\n {showClose && onClose && (\n <button\n onClick={onClose}\n className=\"crow-p-1.5 crow-rounded-lg crow-text-gray-500 hover:crow-bg-gray-100 hover:crow-text-gray-700 crow-transition-colors\"\n aria-label=\"Close\"\n >\n <svg\n className=\"crow-w-5 crow-h-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n )}\n </div>\n </div>\n );\n}\n\n","/**\n * MessageBubble - Single message display component\n */\n\nimport type { Message } from '@usecrow/client';\nimport { clsx } from 'clsx';\n\ninterface MessageBubbleProps {\n message: Message;\n isStreaming?: boolean;\n}\n\nfunction formatTime(date: Date): string {\n return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });\n}\n\nexport function MessageBubble({ message, isStreaming = false }: MessageBubbleProps) {\n const isUser = message.role === 'user';\n const isWaiting = !message.content && !isUser;\n\n return (\n <div\n className={clsx(\n 'crow-flex crow-flex-col',\n isUser ? 'crow-items-end' : 'crow-items-start'\n )}\n >\n {/* Thinking indicator */}\n {message.thinking && (\n <div className=\"crow-mb-2 crow-text-xs crow-text-gray-500 crow-bg-gray-100 crow-rounded-lg crow-px-3 crow-py-2 crow-max-w-[80%]\">\n <details open={!message.thinkingComplete}>\n <summary className=\"crow-cursor-pointer crow-font-medium\">\n {message.thinkingComplete ? 'Reasoning' : 'Thinking...'}\n </summary>\n <div className=\"crow-mt-1 crow-text-gray-600 crow-whitespace-pre-wrap\">\n {message.thinking}\n </div>\n </details>\n </div>\n )}\n\n {/* Waiting indicator */}\n {isWaiting && (\n <div className=\"crow-flex crow-items-center crow-gap-1 crow-text-gray-500 crow-text-sm crow-px-3 crow-py-2\">\n <span className=\"crow-animate-pulse\">●</span>\n <span className=\"crow-animate-pulse crow-animation-delay-100\">●</span>\n <span className=\"crow-animate-pulse crow-animation-delay-200\">●</span>\n </div>\n )}\n\n {/* Message content */}\n {message.content && (\n <div\n className={clsx(\n 'crow-max-w-[80%] crow-rounded-2xl crow-px-4 crow-py-2 crow-transition-all',\n isUser\n ? 'crow-bg-crow-primary crow-text-white'\n : 'crow-bg-gray-100 crow-text-gray-900'\n )}\n >\n <div className=\"crow-text-sm crow-whitespace-pre-wrap\">\n {message.content}\n {isStreaming && (\n <span className=\"crow-inline-block crow-w-1 crow-h-4 crow-ml-0.5 crow-bg-current crow-animate-pulse\" />\n )}\n </div>\n <div className=\"crow-text-xs crow-opacity-60 crow-mt-1\">\n {formatTime(message.timestamp)}\n </div>\n </div>\n )}\n\n {/* Citations */}\n {message.citations && message.citations.length > 0 && (\n <div className=\"crow-mt-1 crow-flex crow-flex-wrap crow-gap-1\">\n {message.citations.map((citation, idx) => (\n <span\n key={idx}\n className=\"crow-text-xs crow-bg-blue-100 crow-text-blue-700 crow-px-2 crow-py-0.5 crow-rounded\"\n >\n {citation.filename}\n </span>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n","/**\n * MessageList - Scrollable list of messages\n */\n\nimport { useRef, useEffect } from 'react';\nimport type { Message } from '@usecrow/client';\nimport { MessageBubble } from './MessageBubble';\n\ninterface MessageListProps {\n messages: Message[];\n isLoading?: boolean;\n className?: string;\n}\n\nexport function MessageList({ messages, isLoading = false, className }: MessageListProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Auto-scroll to bottom when new messages arrive\n useEffect(() => {\n if (containerRef.current) {\n containerRef.current.scrollTop = containerRef.current.scrollHeight;\n }\n }, [messages]);\n\n return (\n <div\n ref={containerRef}\n className={`crow-flex-1 crow-overflow-y-auto crow-px-4 crow-py-4 crow-space-y-3 ${className || ''}`}\n >\n {messages.map((message, index) => {\n const isLastBotMessage =\n message.role === 'assistant' && index === messages.length - 1;\n return (\n <MessageBubble\n key={message.id}\n message={message}\n isStreaming={isLastBotMessage && isLoading}\n />\n );\n })}\n </div>\n );\n}\n\n","/**\n * PromptInput - Chat input component with send/stop button\n */\n\nimport { useState, useRef, useEffect, useCallback } from 'react';\nimport { clsx } from 'clsx';\n\ninterface PromptInputProps {\n onSend: (message: string) => void;\n onStop?: () => void;\n isLoading?: boolean;\n placeholder?: string;\n disabled?: boolean;\n className?: string;\n}\n\nexport function PromptInput({\n onSend,\n onStop,\n isLoading = false,\n placeholder = 'Type your message...',\n disabled = false,\n className,\n}: PromptInputProps) {\n const [value, setValue] = useState('');\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n\n // Auto-resize textarea\n useEffect(() => {\n const textarea = textareaRef.current;\n if (textarea) {\n textarea.style.height = 'auto';\n textarea.style.height = `${Math.min(textarea.scrollHeight, 200)}px`;\n }\n }, [value]);\n\n const handleSubmit = useCallback(() => {\n if (value.trim() && !isLoading) {\n onSend(value.trim());\n setValue('');\n }\n }, [value, isLoading, onSend]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSubmit();\n }\n },\n [handleSubmit]\n );\n\n const hasContent = value.trim().length > 0;\n\n return (\n <div\n className={clsx(\n 'crow-flex crow-items-end crow-gap-2 crow-p-3 crow-border-t crow-border-gray-200 crow-bg-white',\n className\n )}\n >\n <textarea\n ref={textareaRef}\n value={value}\n onChange={(e) => setValue(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled || isLoading}\n rows={1}\n className={clsx(\n 'crow-flex-1 crow-resize-none crow-border crow-border-gray-300 crow-rounded-xl crow-px-4 crow-py-2',\n 'crow-text-sm crow-text-gray-900 crow-placeholder-gray-500',\n 'focus:crow-outline-none focus:crow-ring-2 focus:crow-ring-crow-primary focus:crow-border-transparent',\n 'disabled:crow-bg-gray-50 disabled:crow-cursor-not-allowed'\n )}\n />\n\n <button\n onClick={isLoading ? onStop : handleSubmit}\n disabled={!isLoading && !hasContent}\n className={clsx(\n 'crow-flex-shrink-0 crow-w-10 crow-h-10 crow-rounded-full crow-flex crow-items-center crow-justify-center',\n 'crow-transition-all crow-duration-200',\n isLoading\n ? 'crow-bg-red-500 hover:crow-bg-red-600 crow-text-white'\n : hasContent\n ? 'crow-bg-crow-primary hover:crow-bg-crow-primary-dark crow-text-white'\n : 'crow-bg-gray-200 crow-text-gray-400 crow-cursor-not-allowed'\n )}\n aria-label={isLoading ? 'Stop generation' : 'Send message'}\n >\n {isLoading ? (\n <svg className=\"crow-w-4 crow-h-4\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\n <rect width=\"10\" height=\"10\" x=\"3\" y=\"3\" rx=\"1\" />\n </svg>\n ) : (\n <svg className=\"crow-w-4 crow-h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 12h14M12 5l7 7-7 7\" />\n </svg>\n )}\n </button>\n </div>\n );\n}\n\n","/**\n * CrowWidget - Floating chat widget (bottom-right bubble)\n *\n * This component can work standalone (creates its own client) or\n * be used within a CrowProvider (shares client with other components).\n */\n\nimport { useState, useRef, useEffect } from 'react';\nimport { CrowClient, type CrowClientConfig, type IdentifyOptions, type ToolHandlers } from '@usecrow/client';\nimport { useCrowClientOptional } from './CrowProvider';\nimport { useChat } from './hooks/useChat';\nimport { ChatBubble } from './components/ChatBubble';\nimport { WidgetHeader } from './components/WidgetHeader';\nimport { MessageList } from './components/MessageList';\nimport { PromptInput } from './components/PromptInput';\nimport { clsx } from 'clsx';\n\nexport interface CrowWidgetProps extends CrowClientConfig {\n /** Agent name shown in header */\n agentName?: string;\n /** Initial collapsed state */\n defaultCollapsed?: boolean;\n /** Callback when user needs to be identified */\n onIdentify?: (identify: (options: IdentifyOptions) => void) => void;\n /** Client-side tool handlers */\n tools?: ToolHandlers;\n /** Custom class name for the widget container */\n className?: string;\n /** Z-index for the widget (default: 999999) */\n zIndex?: number;\n}\n\nexport function CrowWidget({\n productId,\n apiUrl,\n model,\n agentName = 'Assistant',\n defaultCollapsed = true,\n onIdentify,\n tools,\n className,\n zIndex = 999999,\n}: CrowWidgetProps) {\n // Try to get client from context, or create standalone\n const contextClient = useCrowClientOptional();\n const standaloneClientRef = useRef<CrowClient | null>(null);\n\n // Create standalone client if not in provider\n if (!contextClient && !standaloneClientRef.current) {\n standaloneClientRef.current = new CrowClient({ productId, apiUrl, model });\n }\n\n const client = contextClient || standaloneClientRef.current!;\n\n // Clean up standalone client on unmount\n useEffect(() => {\n return () => {\n if (standaloneClientRef.current) {\n standaloneClientRef.current.destroy();\n }\n };\n }, []);\n\n // Register tools\n useEffect(() => {\n if (tools) {\n client.registerTools(tools);\n }\n }, [client, tools]);\n\n // Provide identify callback\n useEffect(() => {\n if (onIdentify) {\n onIdentify((options) => client.identify(options));\n }\n }, [client, onIdentify]);\n\n // UI state\n const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);\n\n // Chat hook\n const { messages, isLoading, sendMessage, stop, clearMessages } = useChat({\n client,\n });\n\n return (\n <>\n {/* Floating bubble button */}\n <ChatBubble isOpen={!isCollapsed} onClick={() => setIsCollapsed(!isCollapsed)} />\n\n {/* Widget panel */}\n {!isCollapsed && (\n <div\n className={clsx(\n 'crow-fixed crow-flex crow-flex-col',\n 'crow-bg-white crow-rounded-2xl crow-shadow-2xl',\n 'crow-border crow-border-gray-200',\n 'crow-overflow-hidden crow-animate-fade-in',\n className\n )}\n style={{\n zIndex,\n right: '20px',\n bottom: '90px',\n width: '380px',\n height: '550px',\n maxHeight: 'calc(100vh - 120px)',\n }}\n >\n {/* Header */}\n <WidgetHeader\n title={agentName}\n onNewChat={clearMessages}\n showNewChat={true}\n />\n\n {/* Messages */}\n <MessageList\n messages={messages}\n isLoading={isLoading}\n className=\"crow-flex-1\"\n />\n\n {/* Input */}\n <PromptInput\n onSend={sendMessage}\n onStop={stop}\n isLoading={isLoading}\n placeholder=\"Type your message...\"\n />\n </div>\n )}\n </>\n );\n}\n\n","/**\n * CrowCopilot - Sidebar chat panel\n *\n * Unlike CrowWidget, this component is designed to be mounted into\n * a user-provided container and works best with CrowProvider.\n */\n\nimport { useRef, useEffect } from 'react';\nimport { CrowClient, type CrowClientConfig, type IdentifyOptions, type ToolHandlers } from '@usecrow/client';\nimport { useCrowClientOptional } from './CrowProvider';\nimport { useChat } from './hooks/useChat';\nimport { WidgetHeader } from './components/WidgetHeader';\nimport { MessageList } from './components/MessageList';\nimport { PromptInput } from './components/PromptInput';\nimport { clsx } from 'clsx';\n\nexport interface CrowCopilotProps extends Partial<CrowClientConfig> {\n /** Title shown in header */\n title?: string;\n /** Position of the sidebar */\n position?: 'left' | 'right';\n /** Width of the sidebar */\n width?: number | string;\n /** Show close button */\n showClose?: boolean;\n /** Callback when close is clicked */\n onClose?: () => void;\n /** Callback when user needs to be identified */\n onIdentify?: (identify: (options: IdentifyOptions) => void) => void;\n /** Client-side tool handlers */\n tools?: ToolHandlers;\n /** Custom class name */\n className?: string;\n}\n\nexport function CrowCopilot({\n productId,\n apiUrl,\n model,\n title = 'Copilot',\n position = 'right',\n width = 400,\n showClose = false,\n onClose,\n onIdentify,\n tools,\n className,\n}: CrowCopilotProps) {\n // Try to get client from context, or create standalone if config provided\n const contextClient = useCrowClientOptional();\n const standaloneClientRef = useRef<CrowClient | null>(null);\n\n // Create standalone client if not in provider AND productId is provided\n if (!contextClient && !standaloneClientRef.current && productId) {\n standaloneClientRef.current = new CrowClient({ productId, apiUrl, model });\n }\n\n const client = contextClient || standaloneClientRef.current;\n\n if (!client) {\n console.error(\n '[CrowCopilot] No client available. Either wrap in CrowProvider or provide productId prop.'\n );\n return null;\n }\n\n // Clean up standalone client on unmount\n useEffect(() => {\n return () => {\n if (standaloneClientRef.current) {\n standaloneClientRef.current.destroy();\n }\n };\n }, []);\n\n // Register tools\n useEffect(() => {\n if (tools) {\n client.registerTools(tools);\n }\n }, [client, tools]);\n\n // Provide identify callback\n useEffect(() => {\n if (onIdentify) {\n onIdentify((options) => client.identify(options));\n }\n }, [client, onIdentify]);\n\n // Chat hook\n const { messages, isLoading, sendMessage, stop, clearMessages } = useChat({\n client,\n });\n\n const widthStyle = typeof width === 'number' ? `${width}px` : width;\n\n return (\n <div\n className={clsx(\n 'crow-flex crow-flex-col crow-h-full',\n 'crow-bg-white crow-border-gray-200',\n position === 'left' ? 'crow-border-r' : 'crow-border-l',\n className\n )}\n style={{ width: widthStyle }}\n >\n {/* Header */}\n <WidgetHeader\n title={title}\n onNewChat={clearMessages}\n onClose={onClose}\n showNewChat={true}\n showClose={showClose}\n />\n\n {/* Messages */}\n <MessageList\n messages={messages}\n isLoading={isLoading}\n className=\"crow-flex-1\"\n />\n\n {/* Input */}\n <PromptInput\n onSend={sendMessage}\n onStop={stop}\n isLoading={isLoading}\n placeholder=\"Ask anything...\"\n />\n </div>\n );\n}\n\n","/**\n * useIdentity - React hook for identity management\n */\n\nimport { useState, useCallback, useEffect } from 'react';\nimport { CrowClient, type IdentifyOptions } from '@usecrow/client';\n\ninterface UseIdentityOptions {\n client: CrowClient;\n}\n\ninterface UseIdentityReturn {\n isIdentified: boolean;\n isVerified: boolean;\n identify: (options: IdentifyOptions) => void;\n resetUser: () => void;\n}\n\n/**\n * React hook for managing user identity\n */\nexport function useIdentity({ client }: UseIdentityOptions): UseIdentityReturn {\n const [isIdentified, setIsIdentified] = useState(client.isIdentified());\n const [isVerified, setIsVerified] = useState(client.isVerified());\n\n useEffect(() => {\n // Set up callback for verification status\n client.on({\n onVerificationStatus: (verified) => {\n setIsVerified(verified);\n },\n });\n\n // Sync initial state\n setIsIdentified(client.isIdentified());\n setIsVerified(client.isVerified());\n }, [client]);\n\n const identify = useCallback(\n (options: IdentifyOptions) => {\n client.identify(options);\n setIsIdentified(true);\n },\n [client]\n );\n\n const resetUser = useCallback(() => {\n client.resetUser();\n setIsIdentified(false);\n setIsVerified(false);\n }, [client]);\n\n return {\n isIdentified,\n isVerified,\n identify,\n resetUser,\n };\n}\n\n","/**\n * useConversations - React hook for conversation management\n */\n\nimport { useState, useCallback } from 'react';\nimport { CrowClient, type Conversation, type Message } from '@usecrow/client';\n\ninterface UseConversationsOptions {\n client: CrowClient;\n}\n\ninterface UseConversationsReturn {\n conversations: Conversation[];\n isLoadingConversations: boolean;\n isLoadingHistory: boolean;\n currentConversationId: string | null;\n loadConversations: () => Promise<void>;\n loadHistory: (conversationId: string) => Promise<Message[]>;\n switchConversation: (conversationId: string) => Promise<void>;\n startNewConversation: () => void;\n}\n\n/**\n * React hook for managing conversations\n */\nexport function useConversations({\n client,\n}: UseConversationsOptions): UseConversationsReturn {\n const [conversations, setConversations] = useState<Conversation[]>([]);\n const [isLoadingConversations, setIsLoadingConversations] = useState(false);\n const [isLoadingHistory, setIsLoadingHistory] = useState(false);\n\n const loadConversations = useCallback(async () => {\n setIsLoadingConversations(true);\n try {\n const convs = await client.getConversations();\n setConversations(convs);\n } finally {\n setIsLoadingConversations(false);\n }\n }, [client]);\n\n const loadHistory = useCallback(\n async (conversationId: string): Promise<Message[]> => {\n setIsLoadingHistory(true);\n try {\n return await client.loadHistory(conversationId);\n } finally {\n setIsLoadingHistory(false);\n }\n },\n [client]\n );\n\n const switchConversation = useCallback(\n async (conversationId: string) => {\n setIsLoadingHistory(true);\n try {\n await client.switchConversation(conversationId);\n } finally {\n setIsLoadingHistory(false);\n }\n },\n [client]\n );\n\n const startNewConversation = useCallback(() => {\n client.clearMessages();\n }, [client]);\n\n return {\n conversations,\n isLoadingConversations,\n isLoadingHistory,\n currentConversationId: client.conversationId,\n loadConversations,\n loadHistory,\n switchConversation,\n startNewConversation,\n };\n}\n\n"]}
|
package/dist/styles.css
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
|
|
2
|
+
|
|
3
|
+
/*! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.crow-fixed{position:fixed}.crow-z-\[999999\]{z-index:999999}.crow-mb-2{margin-bottom:.5rem}.crow-ml-0\.5{margin-left:.125rem}.crow-mt-1{margin-top:.25rem}.crow-inline-block{display:inline-block}.crow-flex{display:flex}.crow-h-10{height:2.5rem}.crow-h-14{height:3.5rem}.crow-h-4{height:1rem}.crow-h-5{height:1.25rem}.crow-h-6{height:1.5rem}.crow-h-full{height:100%}.crow-w-1{width:.25rem}.crow-w-10{width:2.5rem}.crow-w-14{width:3.5rem}.crow-w-4{width:1rem}.crow-w-5{width:1.25rem}.crow-w-6{width:1.5rem}.crow-max-w-\[80\%\]{max-width:80%}.crow-flex-1{flex:1 1 0%}.crow-flex-shrink-0{flex-shrink:0}.crow-animate-fade-in{animation:crow-fadeIn .2s ease-out}.crow-animate-pulse{animation:crow-pulse 2s cubic-bezier(.4,0,.6,1) infinite}.crow-cursor-not-allowed{cursor:not-allowed}.crow-cursor-pointer{cursor:pointer}.crow-resize-none{resize:none}.crow-flex-col{flex-direction:column}.crow-flex-wrap{flex-wrap:wrap}.crow-items-start{align-items:flex-start}.crow-items-end{align-items:flex-end}.crow-items-center{align-items:center}.crow-justify-center{justify-content:center}.crow-justify-between{justify-content:space-between}.crow-gap-1{gap:.25rem}.crow-gap-2{gap:.5rem}.crow-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem*var(--tw-space-y-reverse))}.crow-overflow-hidden{overflow:hidden}.crow-overflow-y-auto{overflow-y:auto}.crow-whitespace-pre-wrap{white-space:pre-wrap}.crow-rounded{border-radius:.25rem}.crow-rounded-2xl{border-radius:1rem}.crow-rounded-full{border-radius:9999px}.crow-rounded-lg{border-radius:.5rem}.crow-rounded-xl{border-radius:.75rem}.crow-border{border-width:1px}.crow-border-b{border-bottom-width:1px}.crow-border-l{border-left-width:1px}.crow-border-r{border-right-width:1px}.crow-border-t{border-top-width:1px}.crow-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.crow-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.crow-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.crow-bg-crow-primary{--tw-bg-opacity:1;background-color:rgb(99 102 241/var(--tw-bg-opacity,1))}.crow-bg-current{background-color:currentColor}.crow-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.crow-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.crow-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.crow-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.crow-p-1\.5{padding:.375rem}.crow-p-3{padding:.75rem}.crow-px-2{padding-left:.5rem;padding-right:.5rem}.crow-px-3{padding-left:.75rem;padding-right:.75rem}.crow-px-4{padding-left:1rem;padding-right:1rem}.crow-py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.crow-py-2{padding-top:.5rem;padding-bottom:.5rem}.crow-py-3{padding-top:.75rem;padding-bottom:.75rem}.crow-py-4{padding-top:1rem;padding-bottom:1rem}.crow-text-sm{font-size:.875rem;line-height:1.25rem}.crow-text-xs{font-size:.75rem;line-height:1rem}.crow-font-medium{font-weight:500}.crow-font-semibold{font-weight:600}.crow-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.crow-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.crow-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.crow-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.crow-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.crow-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.crow-placeholder-gray-500::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}.crow-placeholder-gray-500::placeholder{--tw-placeholder-opacity:1;color:rgb(107 114 128/var(--tw-placeholder-opacity,1))}.crow-opacity-60{opacity:.6}.crow-shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.crow-shadow-2xl,.crow-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.crow-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.crow-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.crow-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.crow-duration-200{transition-duration:.2s}.crow-duration-300{transition-duration:.3s}.crow-animate-fade-in{animation:crow-fadeIn .2s ease-out}.crow-animate-slide-up{animation:crow-slideUp .3s ease-out}.crow-animate-pulse{animation:crow-pulse 1.5s ease-in-out infinite}.crow-animation-delay-100{animation-delay:.1s}.crow-animation-delay-200{animation-delay:.2s}@keyframes crow-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes crow-slideUp{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes crow-pulse{0%,to{opacity:1}50%{opacity:.4}}.crow-overflow-y-auto::-webkit-scrollbar{width:6px}.crow-overflow-y-auto::-webkit-scrollbar-track{background:transparent}.crow-overflow-y-auto::-webkit-scrollbar-thumb{background-color:#d1d5db;border-radius:3px}.crow-overflow-y-auto::-webkit-scrollbar-thumb:hover{background-color:#9ca3af}.crow-focus-visible\:crow-outline-none:focus-visible{outline:none}.crow-focus-visible\:crow-ring-2:focus-visible{box-shadow:0 0 0 2px var(--crow-primary,#6366f1)}:root{--crow-primary:#6366f1;--crow-primary-dark:#4f46e5;--crow-secondary:#f1f5f9;--crow-accent:#10b981}@media (prefers-color-scheme:dark){:root{--crow-primary:#818cf8;--crow-primary-dark:#6366f1}}.hover\:crow-scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:crow-bg-crow-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(79 70 229/var(--tw-bg-opacity,1))}.hover\:crow-bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.hover\:crow-bg-red-600:hover{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.hover\:crow-text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.hover\:crow-shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:crow-border-transparent:focus{border-color:transparent}.focus\:crow-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:crow-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:crow-ring-crow-primary:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.disabled\:crow-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:crow-bg-gray-50:disabled{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@usecrow/ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React components for Crow AI agents - Widget, Copilot",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./styles.css": "./dist/styles.css"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"crow",
|
|
27
|
+
"ai",
|
|
28
|
+
"chatbot",
|
|
29
|
+
"widget",
|
|
30
|
+
"copilot",
|
|
31
|
+
"react",
|
|
32
|
+
"sdk"
|
|
33
|
+
],
|
|
34
|
+
"author": "Crow AI",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/usecrow/sdk.git",
|
|
39
|
+
"directory": "packages/ui"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://usecrow.ai",
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
44
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@usecrow/client": "^0.1.0",
|
|
48
|
+
"clsx": "^2.1.0",
|
|
49
|
+
"framer-motion": "^11.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/react": "^18.2.48",
|
|
53
|
+
"@types/react-dom": "^18.2.18",
|
|
54
|
+
"autoprefixer": "^10.4.17",
|
|
55
|
+
"postcss": "^8.4.33",
|
|
56
|
+
"react": "^18.2.0",
|
|
57
|
+
"react-dom": "^18.2.0",
|
|
58
|
+
"tailwindcss": "^3.4.1",
|
|
59
|
+
"tsup": "^8.0.1",
|
|
60
|
+
"typescript": "^5.3.3"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup && pnpm build:css",
|
|
64
|
+
"build:css": "tailwindcss -i ./src/styles/widget.css -o ./dist/styles.css --minify",
|
|
65
|
+
"dev": "tsup --watch",
|
|
66
|
+
"clean": "rm -rf dist",
|
|
67
|
+
"typecheck": "tsc --noEmit",
|
|
68
|
+
"lint": "eslint src/"
|
|
69
|
+
}
|
|
70
|
+
}
|