@dilipod/ui 0.4.34 → 0.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/file-preview.d.ts +1 -0
- package/dist/components/file-preview.d.ts.map +1 -1
- package/dist/components/flowchart-diagram.d.ts.map +1 -1
- package/dist/components/sidebar.d.ts +2 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/index.js +369 -164
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +370 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/file-preview.tsx +29 -15
- package/src/components/flowchart-diagram.tsx +446 -216
- package/src/components/sidebar.tsx +24 -10
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ export interface UploadedFile {
|
|
|
22
22
|
type: string
|
|
23
23
|
size: number
|
|
24
24
|
url?: string
|
|
25
|
+
processing?: boolean
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface FilePreviewProps {
|
|
@@ -157,11 +158,12 @@ export function FilePreview({
|
|
|
157
158
|
const FileIcon = getFileIcon(file.type)
|
|
158
159
|
const typeLabel = getTypeLabel(file.type)
|
|
159
160
|
const sizeLabel = formatSize(file.size)
|
|
160
|
-
const
|
|
161
|
+
const isProcessing = file.processing === true
|
|
162
|
+
const isPreviewable = !isProcessing && canPreview(file)
|
|
161
163
|
const previewType = getPreviewType(file)
|
|
162
|
-
|
|
164
|
+
|
|
163
165
|
return (
|
|
164
|
-
<div
|
|
166
|
+
<div
|
|
165
167
|
key={i}
|
|
166
168
|
className={`flex items-center justify-between p-3 rounded-md bg-gray-50 transition-colors ${
|
|
167
169
|
isPreviewable ? 'hover:bg-gray-100 cursor-pointer' : ''
|
|
@@ -171,29 +173,41 @@ export function FilePreview({
|
|
|
171
173
|
<div className="flex items-center gap-3 min-w-0">
|
|
172
174
|
<div className="relative shrink-0">
|
|
173
175
|
<div className="w-10 h-10 rounded-sm bg-white border border-gray-200 flex items-center justify-center">
|
|
174
|
-
|
|
176
|
+
{isProcessing ? (
|
|
177
|
+
<CircleNotch className="w-5 h-5 text-[var(--cyan)] animate-spin" />
|
|
178
|
+
) : (
|
|
179
|
+
<FileIcon className="w-5 h-5 text-[var(--cyan)]" weight="fill" />
|
|
180
|
+
)}
|
|
175
181
|
</div>
|
|
176
|
-
{previewType === 'video' && (
|
|
182
|
+
{!isProcessing && previewType === 'video' && (
|
|
177
183
|
<Play className="absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 text-[var(--cyan)] bg-white rounded-full" weight="fill" />
|
|
178
184
|
)}
|
|
179
185
|
</div>
|
|
180
186
|
<div className="min-w-0">
|
|
181
187
|
<p className="text-sm font-medium text-[var(--black)] truncate">{file.filename}</p>
|
|
182
188
|
<p className="text-xs text-muted-foreground">
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
189
|
+
{isProcessing ? (
|
|
190
|
+
<span className="text-amber-600">Processing video — this takes about a minute</span>
|
|
191
|
+
) : (
|
|
192
|
+
<>
|
|
193
|
+
{typeLabel} · {sizeLabel}
|
|
194
|
+
{isPreviewable && (
|
|
195
|
+
<span className="text-[var(--cyan)] ml-1">· Click to preview</span>
|
|
196
|
+
)}
|
|
197
|
+
</>
|
|
186
198
|
)}
|
|
187
199
|
</p>
|
|
188
200
|
</div>
|
|
189
201
|
</div>
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
{!isProcessing && (
|
|
203
|
+
<button
|
|
204
|
+
onClick={(e) => handleDownload(e, file)}
|
|
205
|
+
className="p-2 rounded-sm hover:bg-gray-200 transition-colors shrink-0"
|
|
206
|
+
title="Download"
|
|
207
|
+
>
|
|
208
|
+
<Download className="w-4 h-4 text-muted-foreground" />
|
|
209
|
+
</button>
|
|
210
|
+
)}
|
|
197
211
|
</div>
|
|
198
212
|
)
|
|
199
213
|
})}
|