Skip to content

Commit 3ab1f21

Browse files
committed
feat: emcn, editor
1 parent ee3efb3 commit 3ab1f21

File tree

263 files changed

+5982
-5053
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+5982
-5053
lines changed

apps/sim/.cursorrules

Lines changed: 735 additions & 0 deletions
Large diffs are not rendered by default.

apps/sim/.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ sim-standalone.tar.gz
4242
*.tsbuildinfo
4343
next-env.d.ts
4444

45-
# cursorrules
46-
.cursorrules
47-
4845
# Uploads
4946
/uploads
5047

apps/sim/app/chat/components/input/input.tsx

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type React from 'react'
44
import { useEffect, useRef, useState } from 'react'
55
import { motion } from 'framer-motion'
66
import { AlertCircle, Paperclip, Send, Square, X } from 'lucide-react'
7-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
7+
import { Tooltip } from '@/components/emcn'
88
import { VoiceInput } from '@/app/chat/components/input/voice-input'
99

1010
const PLACEHOLDER_MOBILE = 'Enter a message'
@@ -190,18 +190,16 @@ export const ChatInput: React.FC<{
190190
<div className='flex items-center justify-center'>
191191
{/* Voice Input Only */}
192192
{isSttAvailable && (
193-
<TooltipProvider>
194-
<Tooltip>
195-
<TooltipTrigger asChild>
196-
<div>
197-
<VoiceInput onVoiceStart={handleVoiceStart} disabled={isStreaming} large={true} />
198-
</div>
199-
</TooltipTrigger>
200-
<TooltipContent side='top'>
201-
<p>Start voice conversation</p>
202-
</TooltipContent>
203-
</Tooltip>
204-
</TooltipProvider>
193+
<Tooltip.Root>
194+
<Tooltip.Trigger asChild>
195+
<div>
196+
<VoiceInput onVoiceStart={handleVoiceStart} disabled={isStreaming} large={true} />
197+
</div>
198+
</Tooltip.Trigger>
199+
<Tooltip.Content side='top'>
200+
<p>Start voice conversation</p>
201+
</Tooltip.Content>
202+
</Tooltip.Root>
205203
)}
206204
</div>
207205
)
@@ -334,9 +332,8 @@ export const ChatInput: React.FC<{
334332

335333
<div className='flex items-center gap-2 p-3 md:p-4'>
336334
{/* Paperclip Button */}
337-
<TooltipProvider>
338-
<Tooltip>
339-
<TooltipTrigger asChild>
335+
<Tooltip.Root>
336+
<Tooltip.Trigger asChild>
340337
<button
341338
type='button'
342339
onClick={() => fileInputRef.current?.click()}
@@ -345,12 +342,11 @@ export const ChatInput: React.FC<{
345342
>
346343
<Paperclip size={16} className='md:h-5 md:w-5' />
347344
</button>
348-
</TooltipTrigger>
349-
<TooltipContent side='top'>
345+
</Tooltip.Trigger>
346+
<Tooltip.Content side='top'>
350347
<p>Attach files</p>
351-
</TooltipContent>
352-
</Tooltip>
353-
</TooltipProvider>
348+
</Tooltip.Content>
349+
</Tooltip.Root>
354350

355351
{/* Hidden file input */}
356352
<input
@@ -416,22 +412,16 @@ export const ChatInput: React.FC<{
416412

417413
{/* Voice Input */}
418414
{isSttAvailable && (
419-
<TooltipProvider>
420-
<Tooltip>
421-
<TooltipTrigger asChild>
422-
<div>
423-
<VoiceInput
424-
onVoiceStart={handleVoiceStart}
425-
disabled={isStreaming}
426-
minimal
427-
/>
428-
</div>
429-
</TooltipTrigger>
430-
<TooltipContent side='top'>
431-
<p>Start voice conversation</p>
432-
</TooltipContent>
433-
</Tooltip>
434-
</TooltipProvider>
415+
<Tooltip.Root>
416+
<Tooltip.Trigger asChild>
417+
<div>
418+
<VoiceInput onVoiceStart={handleVoiceStart} disabled={isStreaming} minimal />
419+
</div>
420+
</Tooltip.Trigger>
421+
<Tooltip.Content side='top'>
422+
<p>Start voice conversation</p>
423+
</Tooltip.Content>
424+
</Tooltip.Root>
435425
)}
436426

437427
{/* Send Button */}

apps/sim/app/chat/components/message/components/markdown-renderer.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React, { type HTMLAttributes, type ReactNode } from 'react'
22
import ReactMarkdown from 'react-markdown'
33
import remarkGfm from 'remark-gfm'
4-
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
4+
import { Tooltip } from '@/components/emcn'
55

66
export function LinkWithPreview({ href, children }: { href: string; children: React.ReactNode }) {
77
return (
8-
<Tooltip delayDuration={300}>
9-
<TooltipTrigger asChild>
8+
<Tooltip.Root delayDuration={300}>
9+
<Tooltip.Trigger asChild>
1010
<a
1111
href={href}
1212
className='text-blue-600 hover:underline dark:text-blue-400'
@@ -15,11 +15,11 @@ export function LinkWithPreview({ href, children }: { href: string; children: Re
1515
>
1616
{children}
1717
</a>
18-
</TooltipTrigger>
19-
<TooltipContent side='top' align='center' sideOffset={5} className='max-w-sm p-3'>
18+
</Tooltip.Trigger>
19+
<Tooltip.Content side='top' align='center' sideOffset={5} className='max-w-sm p-3'>
2020
<span className='truncate font-medium text-xs'>{href}</span>
21-
</TooltipContent>
22-
</Tooltip>
21+
</Tooltip.Content>
22+
</Tooltip.Root>
2323
)
2424
}
2525

apps/sim/app/chat/components/message/message.tsx

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import { memo, useMemo, useState } from 'react'
44
import { Check, Copy, File as FileIcon, FileText, Image as ImageIcon } from 'lucide-react'
5-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
5+
import { Tooltip } from '@/components/emcn'
66
import MarkdownRenderer from './components/markdown-renderer'
77

88
export interface ChatAttachment {
@@ -24,11 +24,7 @@ export interface ChatMessage {
2424
}
2525

2626
function EnhancedMarkdownRenderer({ content }: { content: string }) {
27-
return (
28-
<TooltipProvider>
29-
<MarkdownRenderer content={content} />
30-
</TooltipProvider>
31-
)
27+
return <MarkdownRenderer content={content} />
3228
}
3329

3430
export const ClientChatMessage = memo(
@@ -190,33 +186,31 @@ export const ClientChatMessage = memo(
190186
<div className='flex items-center justify-start space-x-2'>
191187
{/* Copy Button - Only show when not streaming */}
192188
{!message.isStreaming && (
193-
<TooltipProvider>
194-
<Tooltip delayDuration={300}>
195-
<TooltipTrigger asChild>
196-
<button
197-
className='text-muted-foreground transition-colors hover:bg-muted'
198-
onClick={() => {
199-
const contentToCopy =
200-
typeof cleanTextContent === 'string'
201-
? cleanTextContent
202-
: JSON.stringify(cleanTextContent, null, 2)
203-
navigator.clipboard.writeText(contentToCopy)
204-
setIsCopied(true)
205-
setTimeout(() => setIsCopied(false), 2000)
206-
}}
207-
>
208-
{isCopied ? (
209-
<Check className='h-3 w-3' strokeWidth={2} />
210-
) : (
211-
<Copy className='h-3 w-3' strokeWidth={2} />
212-
)}
213-
</button>
214-
</TooltipTrigger>
215-
<TooltipContent side='top' align='center' sideOffset={5}>
216-
{isCopied ? 'Copied!' : 'Copy to clipboard'}
217-
</TooltipContent>
218-
</Tooltip>
219-
</TooltipProvider>
189+
<Tooltip.Root delayDuration={300}>
190+
<Tooltip.Trigger asChild>
191+
<button
192+
className='text-muted-foreground transition-colors hover:bg-muted'
193+
onClick={() => {
194+
const contentToCopy =
195+
typeof cleanTextContent === 'string'
196+
? cleanTextContent
197+
: JSON.stringify(cleanTextContent, null, 2)
198+
navigator.clipboard.writeText(contentToCopy)
199+
setIsCopied(true)
200+
setTimeout(() => setIsCopied(false), 2000)
201+
}}
202+
>
203+
{isCopied ? (
204+
<Check className='h-3 w-3' strokeWidth={2} />
205+
) : (
206+
<Copy className='h-3 w-3' strokeWidth={2} />
207+
)}
208+
</button>
209+
</Tooltip.Trigger>
210+
<Tooltip.Content side='top' align='center' sideOffset={5}>
211+
{isCopied ? 'Copied!' : 'Copy to clipboard'}
212+
</Tooltip.Content>
213+
</Tooltip.Root>
220214
)}
221215
</div>
222216
)}

apps/sim/app/globals.css

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@
8080
z-index: 60 !important;
8181
}
8282

83+
/* Workflow canvas background */
84+
.workflow-container,
85+
.workflow-container .react-flow__pane,
86+
.workflow-container .react-flow__renderer {
87+
background-color: #e4e4e4 !important;
88+
}
89+
90+
.dark .workflow-container,
91+
.dark .workflow-container .react-flow__pane,
92+
.dark .workflow-container .react-flow__renderer {
93+
background-color: #1b1b1b !important;
94+
}
95+
8396
/* ==========================================================================
8497
LANDING LOOP ANIMATION
8598
========================================================================== */
@@ -146,6 +159,7 @@
146159
/* Border & Input Colors */
147160
--border: 0 0% 89.8%;
148161
--input: 0 0% 89.8%;
162+
--input-background: 0 0% 79.22%;
149163
--ring: 0 0% 3.9%;
150164

151165
/* Border Radius */
@@ -185,7 +199,7 @@
185199
/* Dark Mode Theme */
186200
.dark {
187201
/* Core Colors */
188-
--background: 0 0% 10.6%;
202+
--background: 0 0% 10.59%;
189203
--foreground: 0 0% 98%;
190204

191205
/* Card Colors */
@@ -219,6 +233,7 @@
219233
/* Border & Input Colors */
220234
--border: 0 0% 16.1%;
221235
--input: 0 0% 16.1%;
236+
--input-background: 0 0% 20.78%;
222237
--ring: 0 0% 83.9%;
223238

224239
/* Scrollbar Properties */
@@ -227,7 +242,7 @@
227242
--scrollbar-thumb-hover: 0 0% 40%;
228243

229244
/* Workflow Properties */
230-
--workflow-background: 0 0% 10.6%;
245+
--workflow-background: 0 0% 10.59%;
231246
--card-background: 0 0% 9.0%;
232247
--card-border: 0 0% 22.7%;
233248
--card-text: 0 0% 98%;
@@ -456,6 +471,11 @@ input[type="search"]::-ms-clear {
456471
background-clip: text;
457472
}
458473

474+
/* Input Background Utility */
475+
.bg-input-background {
476+
background-color: hsl(var(--input-background));
477+
}
478+
459479
/* Brand Color Utilities */
460480
.bg-brand-primary {
461481
background-color: var(--brand-primary-hex);

apps/sim/app/workspace/[workspaceId]/knowledge/[id]/[documentId]/components/edit-chunk-modal/edit-chunk-modal.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { useEffect, useState } from 'react'
44
import { AlertCircle, ChevronDown, ChevronUp, Loader2, X } from 'lucide-react'
5+
import { Tooltip } from '@/components/emcn'
56
import {
67
AlertDialog,
78
AlertDialogAction,
@@ -16,7 +17,6 @@ import { Button } from '@/components/ui/button'
1617
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog'
1718
import { Label } from '@/components/ui/label'
1819
import { Textarea } from '@/components/ui/textarea'
19-
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
2020
import { createLogger } from '@/lib/logs/console/logger'
2121
import { useUserPermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
2222
import type { ChunkData, DocumentData } from '@/stores/knowledge/store'
@@ -193,8 +193,8 @@ export function EditChunkModal({
193193

194194
{/* Navigation Controls */}
195195
<div className='flex items-center gap-1'>
196-
<Tooltip>
197-
<TooltipTrigger
196+
<Tooltip.Root>
197+
<Tooltip.Trigger
198198
asChild
199199
onFocus={(e) => e.preventDefault()}
200200
onBlur={(e) => e.preventDefault()}
@@ -208,15 +208,15 @@ export function EditChunkModal({
208208
>
209209
<ChevronUp className='h-4 w-4' />
210210
</Button>
211-
</TooltipTrigger>
212-
<TooltipContent side='bottom'>
211+
</Tooltip.Trigger>
212+
<Tooltip.Content side='bottom'>
213213
Previous chunk{' '}
214214
{currentPage > 1 && currentChunkIndex === 0 ? '(previous page)' : ''}
215-
</TooltipContent>
216-
</Tooltip>
215+
</Tooltip.Content>
216+
</Tooltip.Root>
217217

218-
<Tooltip>
219-
<TooltipTrigger
218+
<Tooltip.Root>
219+
<Tooltip.Trigger
220220
asChild
221221
onFocus={(e) => e.preventDefault()}
222222
onBlur={(e) => e.preventDefault()}
@@ -230,14 +230,14 @@ export function EditChunkModal({
230230
>
231231
<ChevronDown className='h-4 w-4' />
232232
</Button>
233-
</TooltipTrigger>
234-
<TooltipContent side='bottom'>
233+
</Tooltip.Trigger>
234+
<Tooltip.Content side='bottom'>
235235
Next chunk{' '}
236236
{currentPage < totalPages && currentChunkIndex === allChunks.length - 1
237237
? '(next page)'
238238
: ''}
239-
</TooltipContent>
240-
</Tooltip>
239+
</Tooltip.Content>
240+
</Tooltip.Root>
241241
</div>
242242
</div>
243243

0 commit comments

Comments
 (0)