ai-design-system 0.1.13 → 0.1.15
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/components/composites/AdjustableLayout/AdjustableLayout.tsx +23 -20
- package/components/composites/DocumentTabBar/DocumentTabBar.stories.tsx +122 -0
- package/components/composites/DocumentTabBar/DocumentTabBar.tsx +137 -0
- package/components/composites/DocumentTabBar/index.ts +2 -0
- package/components/composites/index.ts +4 -0
- package/components/features/AIDocEditor/AIDocEditor.behaviors.stories.tsx +208 -3
- package/components/features/AIDocEditor/AIDocEditor.mocks.ts +49 -0
- package/components/features/AIDocEditor/AIDocEditor.stories.tsx +45 -94
- package/components/features/AIDocEditor/AIDocEditor.tsx +156 -28
- package/components/features/AIDocEditor/README.md +176 -24
- package/components/features/AIDocEditor/index.ts +17 -1
- package/components/features/AIDocEditor/useAIDocEditor.d.ts +85 -2
- package/components/features/AIDocEditor/useAIDocEditor.mock.ts +179 -30
- package/dist/index.cjs +176 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +69 -0
- package/dist/index.d.ts +90 -22
- package/dist/index.js +177 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -484,6 +484,9 @@
|
|
|
484
484
|
.mt-auto {
|
|
485
485
|
margin-top: auto;
|
|
486
486
|
}
|
|
487
|
+
.mr-0\.5 {
|
|
488
|
+
margin-right: calc(var(--spacing) * 0.5);
|
|
489
|
+
}
|
|
487
490
|
.mr-2 {
|
|
488
491
|
margin-right: calc(var(--spacing) * 2);
|
|
489
492
|
}
|
|
@@ -915,6 +918,9 @@
|
|
|
915
918
|
.max-w-\[180px\] {
|
|
916
919
|
max-width: 180px;
|
|
917
920
|
}
|
|
921
|
+
.max-w-\[200px\] {
|
|
922
|
+
max-width: 200px;
|
|
923
|
+
}
|
|
918
924
|
.max-w-\[calc\(100\%-2rem\)\] {
|
|
919
925
|
max-width: calc(100% - 2rem);
|
|
920
926
|
}
|
|
@@ -1365,10 +1371,18 @@
|
|
|
1365
1371
|
border-top-style: var(--tw-border-style);
|
|
1366
1372
|
border-top-width: 1px;
|
|
1367
1373
|
}
|
|
1374
|
+
.border-r {
|
|
1375
|
+
border-right-style: var(--tw-border-style);
|
|
1376
|
+
border-right-width: 1px;
|
|
1377
|
+
}
|
|
1368
1378
|
.border-b {
|
|
1369
1379
|
border-bottom-style: var(--tw-border-style);
|
|
1370
1380
|
border-bottom-width: 1px;
|
|
1371
1381
|
}
|
|
1382
|
+
.border-b-2 {
|
|
1383
|
+
border-bottom-style: var(--tw-border-style);
|
|
1384
|
+
border-bottom-width: 2px;
|
|
1385
|
+
}
|
|
1372
1386
|
.border-l {
|
|
1373
1387
|
border-left-style: var(--tw-border-style);
|
|
1374
1388
|
border-left-width: 1px;
|
|
@@ -1614,6 +1628,9 @@
|
|
|
1614
1628
|
.fill-foreground {
|
|
1615
1629
|
fill: var(--foreground);
|
|
1616
1630
|
}
|
|
1631
|
+
.fill-primary {
|
|
1632
|
+
fill: var(--primary);
|
|
1633
|
+
}
|
|
1617
1634
|
.stroke-ring {
|
|
1618
1635
|
stroke: var(--ring);
|
|
1619
1636
|
}
|
|
@@ -2607,6 +2624,12 @@
|
|
|
2607
2624
|
inset: calc(var(--spacing) * -2);
|
|
2608
2625
|
}
|
|
2609
2626
|
}
|
|
2627
|
+
.last\:border-r-0 {
|
|
2628
|
+
&:last-child {
|
|
2629
|
+
border-right-style: var(--tw-border-style);
|
|
2630
|
+
border-right-width: 0px;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2610
2633
|
.last\:border-b-0 {
|
|
2611
2634
|
&:last-child {
|
|
2612
2635
|
border-bottom-style: var(--tw-border-style);
|
|
@@ -2674,6 +2697,16 @@
|
|
|
2674
2697
|
}
|
|
2675
2698
|
}
|
|
2676
2699
|
}
|
|
2700
|
+
.hover\:bg-destructive\/10 {
|
|
2701
|
+
&:hover {
|
|
2702
|
+
@media (hover: hover) {
|
|
2703
|
+
background-color: var(--destructive);
|
|
2704
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2705
|
+
background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
}
|
|
2677
2710
|
.hover\:bg-destructive\/90 {
|
|
2678
2711
|
&:hover {
|
|
2679
2712
|
@media (hover: hover) {
|
|
@@ -2755,6 +2788,13 @@
|
|
|
2755
2788
|
}
|
|
2756
2789
|
}
|
|
2757
2790
|
}
|
|
2791
|
+
.hover\:text-destructive {
|
|
2792
|
+
&:hover {
|
|
2793
|
+
@media (hover: hover) {
|
|
2794
|
+
color: var(--destructive);
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2758
2798
|
.hover\:text-foreground {
|
|
2759
2799
|
&:hover {
|
|
2760
2800
|
@media (hover: hover) {
|
|
@@ -2882,6 +2922,11 @@
|
|
|
2882
2922
|
}
|
|
2883
2923
|
}
|
|
2884
2924
|
}
|
|
2925
|
+
.focus-visible\:ring-ring {
|
|
2926
|
+
&:focus-visible {
|
|
2927
|
+
--tw-ring-color: var(--ring);
|
|
2928
|
+
}
|
|
2929
|
+
}
|
|
2885
2930
|
.focus-visible\:ring-ring\/50 {
|
|
2886
2931
|
&:focus-visible {
|
|
2887
2932
|
--tw-ring-color: var(--ring);
|
|
@@ -2890,6 +2935,12 @@
|
|
|
2890
2935
|
}
|
|
2891
2936
|
}
|
|
2892
2937
|
}
|
|
2938
|
+
.focus-visible\:ring-offset-0 {
|
|
2939
|
+
&:focus-visible {
|
|
2940
|
+
--tw-ring-offset-width: 0px;
|
|
2941
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2893
2944
|
.focus-visible\:outline-1 {
|
|
2894
2945
|
&:focus-visible {
|
|
2895
2946
|
outline-style: var(--tw-outline-style);
|
|
@@ -3266,6 +3317,11 @@
|
|
|
3266
3317
|
}
|
|
3267
3318
|
}
|
|
3268
3319
|
}
|
|
3320
|
+
.data-\[state\=active\]\:border-primary {
|
|
3321
|
+
&[data-state="active"] {
|
|
3322
|
+
border-color: var(--primary);
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3269
3325
|
.data-\[state\=active\]\:bg-background {
|
|
3270
3326
|
&[data-state="active"] {
|
|
3271
3327
|
background-color: var(--background);
|
|
@@ -3292,6 +3348,19 @@
|
|
|
3292
3348
|
color: var(--primary-foreground);
|
|
3293
3349
|
}
|
|
3294
3350
|
}
|
|
3351
|
+
.data-\[state\=inactive\]\:bg-muted\/20 {
|
|
3352
|
+
&[data-state="inactive"] {
|
|
3353
|
+
background-color: var(--muted);
|
|
3354
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3355
|
+
background-color: color-mix(in oklab, var(--muted) 20%, transparent);
|
|
3356
|
+
}
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
.data-\[state\=inactive\]\:text-muted-foreground {
|
|
3360
|
+
&[data-state="inactive"] {
|
|
3361
|
+
color: var(--muted-foreground);
|
|
3362
|
+
}
|
|
3363
|
+
}
|
|
3295
3364
|
.data-\[state\=on\]\:bg-accent {
|
|
3296
3365
|
&[data-state="on"] {
|
|
3297
3366
|
background-color: var(--accent);
|
package/dist/index.d.ts
CHANGED
|
@@ -200,6 +200,67 @@ export interface UseAIDocEditorReturn {
|
|
|
200
200
|
loading: boolean
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
export interface UseAIMultiTabDocEditorReturn {
|
|
204
|
+
/**
|
|
205
|
+
* Array of open documents
|
|
206
|
+
*/
|
|
207
|
+
documents: DocumentWithAnnotations[]
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* ID of currently active document
|
|
211
|
+
*/
|
|
212
|
+
activeDocumentId?: string
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Add a new document tab
|
|
216
|
+
* @param file - Document metadata
|
|
217
|
+
* @param content - Initial document content
|
|
218
|
+
*/
|
|
219
|
+
addDocument: (file: DocumentFile, content: JSONContent | string) => void,
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Close a document tab
|
|
223
|
+
* @param documentId - ID of the document to close
|
|
224
|
+
*/
|
|
225
|
+
closeDocument: (documentId: string) => void
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Switch to a different document tab
|
|
229
|
+
* @param documentId - ID of the document to switch to
|
|
230
|
+
*/
|
|
231
|
+
switchDocument: (documentId: string) => void
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Add annotation to the currently active document
|
|
235
|
+
* @param annotation - The annotation to add
|
|
236
|
+
*/
|
|
237
|
+
addAnnotation: (annotation: Annotation) => Promise<void> | void
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Update annotation in the currently active document
|
|
241
|
+
* @param annotation - The updated annotation
|
|
242
|
+
*/
|
|
243
|
+
updateAnnotation: (annotation: Annotation) => Promise<void> | void
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Delete annotation from the currently active document
|
|
247
|
+
* @param annotationId - ID of the annotation to delete
|
|
248
|
+
*/
|
|
249
|
+
deleteAnnotation: (annotationId: string) => Promise<void> | void
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Mark document as dirty
|
|
253
|
+
* @param documentId - ID of the document
|
|
254
|
+
* @param isDirty - Whether document has unsaved changes
|
|
255
|
+
*/
|
|
256
|
+
setDocumentDirty: (documentId: string, isDirty: boolean) => void
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Loading state for async operations
|
|
260
|
+
*/
|
|
261
|
+
loading: boolean
|
|
262
|
+
}
|
|
263
|
+
|
|
203
264
|
// From components/features/PageLayout/usePageLayout.d.ts
|
|
204
265
|
export interface UsePageLayoutReturn {
|
|
205
266
|
/** Whether the sidebar is currently open */
|
|
@@ -481,7 +542,7 @@ export interface PageLayoutProps {
|
|
|
481
542
|
export const PageLayout: React.FC<PageLayoutProps>;
|
|
482
543
|
|
|
483
544
|
// From AIDocEditor.tsx
|
|
484
|
-
export interface
|
|
545
|
+
export interface AIDocEditorSingleProps {
|
|
485
546
|
/**
|
|
486
547
|
* Document content - can be either:
|
|
487
548
|
* - JSONContent: Tiptap's JSON format (default)
|
|
@@ -500,29 +561,36 @@ export interface AIDocEditorProps {
|
|
|
500
561
|
annotations: Annotation[]
|
|
501
562
|
/** ID of currently selected annotation */
|
|
502
563
|
selectedAnnotationId?: string
|
|
503
|
-
/**
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
564
|
+
/** Multi-document array (not provided in single-doc mode) */
|
|
565
|
+
documents?: never
|
|
566
|
+
/** Active document ID (not provided in single-doc mode) */
|
|
567
|
+
activeDocumentId?: never
|
|
568
|
+
/** Tab selection callback (not provided in single-doc mode) */
|
|
569
|
+
onTabSelect?: never
|
|
570
|
+
/** Tab close callback (not provided in single-doc mode) */
|
|
571
|
+
onTabClose?: never
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export interface AIDocEditorMultiTabProps {
|
|
575
|
+
/** Array of open documents with their content and annotations */
|
|
576
|
+
documents: DocumentWithAnnotations[]
|
|
577
|
+
/** ID of currently active document */
|
|
578
|
+
activeDocumentId?: string
|
|
579
|
+
/** Content prop (not provided in multi-tab mode) */
|
|
580
|
+
content?: never
|
|
581
|
+
/** Format prop (not provided in multi-tab mode) */
|
|
582
|
+
format?: never
|
|
583
|
+
/** Annotations prop (not provided in multi-tab mode) */
|
|
584
|
+
annotations?: never
|
|
585
|
+
/** Selected annotation ID (not provided in multi-tab mode) */
|
|
586
|
+
selectedAnnotationId?: never
|
|
587
|
+
/** Callback when tab is selected */
|
|
588
|
+
onTabSelect?: (documentId: string) => void
|
|
589
|
+
/** Callback when tab close button is clicked */
|
|
590
|
+
onTabClose?: (documentId: string) => void
|
|
523
591
|
}
|
|
524
592
|
|
|
525
|
-
export const AIDocEditor: React.FC<
|
|
593
|
+
export const AIDocEditor: React.FC<any>;
|
|
526
594
|
|
|
527
595
|
|
|
528
596
|
// ============================================================================
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React33 from 'react';
|
|
2
2
|
import React33__default, { createContext, memo, useEffect, useState, useCallback, useMemo, isValidElement, useRef, useContext } from 'react';
|
|
3
3
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
4
|
-
import { Send, EyeOff, Zap, Check, XCircle, GitBranch, CheckIcon, SearchIcon, ChevronDownIcon, ChevronUpIcon, WrenchIcon, ChevronsUpDownIcon, ArrowDownIcon, XIcon, XCircleIcon, CheckCircleIcon, ClockIcon, CircleIcon, SendIcon, ArrowLeft, ArrowRight, ChevronRightIcon, Loader2Icon, SquareIcon, Loader2, ChevronDown, Undo2, Redo2, Save } from 'lucide-react';
|
|
4
|
+
import { Send, Circle, X, EyeOff, Zap, Check, XCircle, GitBranch, CheckIcon, SearchIcon, ChevronDownIcon, ChevronUpIcon, WrenchIcon, ChevronsUpDownIcon, ArrowDownIcon, XIcon, XCircleIcon, CheckCircleIcon, ClockIcon, CircleIcon, SendIcon, ArrowLeft, ArrowRight, ChevronRightIcon, Loader2Icon, SquareIcon, Loader2, ChevronDown, Undo2, Redo2, Save } from 'lucide-react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -6435,6 +6435,85 @@ var ModeToggle = React33.memo(({ className }) => {
|
|
|
6435
6435
|
] });
|
|
6436
6436
|
});
|
|
6437
6437
|
ModeToggle.displayName = "ModeToggle";
|
|
6438
|
+
var DocumentTabBar = React33__default.memo(
|
|
6439
|
+
({ tabs, activeTabId, onTabSelect, onTabClose, className }) => {
|
|
6440
|
+
var _a;
|
|
6441
|
+
if (tabs.length === 0) {
|
|
6442
|
+
return null;
|
|
6443
|
+
}
|
|
6444
|
+
return /* @__PURE__ */ jsx(
|
|
6445
|
+
"div",
|
|
6446
|
+
{
|
|
6447
|
+
className: cn(
|
|
6448
|
+
"flex items-center border-b border-border bg-background",
|
|
6449
|
+
className
|
|
6450
|
+
),
|
|
6451
|
+
"data-slot": "document-tab-bar",
|
|
6452
|
+
children: /* @__PURE__ */ jsx(ScrollArea2, { orientation: "horizontal", className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
6453
|
+
Tabs2,
|
|
6454
|
+
{
|
|
6455
|
+
value: activeTabId || ((_a = tabs[0]) == null ? void 0 : _a.id),
|
|
6456
|
+
onValueChange: onTabSelect,
|
|
6457
|
+
className: "h-auto flex-1",
|
|
6458
|
+
children: /* @__PURE__ */ jsx(TabsList, { className: "h-10 rounded-none border-none bg-transparent p-0 w-full justify-start gap-0", children: tabs.map((tab) => /* @__PURE__ */ jsxs(
|
|
6459
|
+
"div",
|
|
6460
|
+
{
|
|
6461
|
+
className: "flex items-center border-r border-border/50 last:border-r-0",
|
|
6462
|
+
children: [
|
|
6463
|
+
/* @__PURE__ */ jsx(
|
|
6464
|
+
TabsTrigger,
|
|
6465
|
+
{
|
|
6466
|
+
value: tab.id,
|
|
6467
|
+
className: cn(
|
|
6468
|
+
"data-[state=inactive]:bg-muted/20 data-[state=inactive]:text-muted-foreground",
|
|
6469
|
+
"rounded-none border-b-2 border-transparent data-[state=active]:border-primary",
|
|
6470
|
+
"px-3 py-2 text-sm font-medium whitespace-nowrap",
|
|
6471
|
+
"flex items-center gap-2 h-10",
|
|
6472
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0",
|
|
6473
|
+
"transition-colors"
|
|
6474
|
+
),
|
|
6475
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
6476
|
+
tab.isDirty && /* @__PURE__ */ jsx(
|
|
6477
|
+
Circle,
|
|
6478
|
+
{
|
|
6479
|
+
className: "size-2 fill-primary text-primary flex-shrink-0",
|
|
6480
|
+
"aria-label": "unsaved changes"
|
|
6481
|
+
}
|
|
6482
|
+
),
|
|
6483
|
+
/* @__PURE__ */ jsx("span", { className: "truncate max-w-[200px]", children: tab.name })
|
|
6484
|
+
] })
|
|
6485
|
+
}
|
|
6486
|
+
),
|
|
6487
|
+
/* @__PURE__ */ jsx(
|
|
6488
|
+
Button2,
|
|
6489
|
+
{
|
|
6490
|
+
variant: "ghost",
|
|
6491
|
+
size: "icon-sm",
|
|
6492
|
+
onClick: (e) => {
|
|
6493
|
+
e.stopPropagation();
|
|
6494
|
+
onTabClose == null ? void 0 : onTabClose(tab.id);
|
|
6495
|
+
},
|
|
6496
|
+
className: cn(
|
|
6497
|
+
"h-8 w-8 mr-0.5",
|
|
6498
|
+
"hover:bg-destructive/10 hover:text-destructive",
|
|
6499
|
+
"focus-visible:ring-2 focus-visible:ring-ring",
|
|
6500
|
+
"transition-colors"
|
|
6501
|
+
),
|
|
6502
|
+
"aria-label": `Close ${tab.name}`,
|
|
6503
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3" })
|
|
6504
|
+
}
|
|
6505
|
+
)
|
|
6506
|
+
]
|
|
6507
|
+
},
|
|
6508
|
+
tab.id
|
|
6509
|
+
)) })
|
|
6510
|
+
}
|
|
6511
|
+
) })
|
|
6512
|
+
}
|
|
6513
|
+
);
|
|
6514
|
+
}
|
|
6515
|
+
);
|
|
6516
|
+
DocumentTabBar.displayName = "DocumentTabBar";
|
|
6438
6517
|
var ThemeSelector = React33.memo(
|
|
6439
6518
|
({ themes, value, onValueChange, placeholder = "Select theme", className }) => {
|
|
6440
6519
|
return /* @__PURE__ */ jsxs(Select2, { value, onValueChange, children: [
|
|
@@ -6753,25 +6832,27 @@ var AdjustableLayout = React33.memo(
|
|
|
6753
6832
|
muted: "group-hover:bg-muted/30"
|
|
6754
6833
|
};
|
|
6755
6834
|
const containerRef = React33.useRef(null);
|
|
6756
|
-
const
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6835
|
+
const defaultSizes = React33.useMemo(() => {
|
|
6836
|
+
const raw = sections.map((section) => {
|
|
6837
|
+
var _a2;
|
|
6838
|
+
return (_a2 = section.defaultSize) != null ? _a2 : 100 / sections.length;
|
|
6839
|
+
});
|
|
6840
|
+
const total = raw.reduce((sum, size) => sum + size, 0);
|
|
6841
|
+
return raw.map((size) => size / total * 100);
|
|
6842
|
+
}, [sections]);
|
|
6843
|
+
const [sizes, setSizes] = React33.useState(defaultSizes);
|
|
6844
|
+
React33.useEffect(() => {
|
|
6845
|
+
if (!storageKey) return;
|
|
6846
|
+
const saved = localStorage.getItem(storageKey);
|
|
6847
|
+
if (!saved) return;
|
|
6848
|
+
try {
|
|
6849
|
+
const parsed = JSON.parse(saved);
|
|
6850
|
+
if (Array.isArray(parsed) && parsed.length === sections.length) {
|
|
6851
|
+
setSizes(parsed);
|
|
6764
6852
|
}
|
|
6853
|
+
} catch (e) {
|
|
6765
6854
|
}
|
|
6766
|
-
|
|
6767
|
-
(section) => {
|
|
6768
|
-
var _a2;
|
|
6769
|
-
return (_a2 = section.defaultSize) != null ? _a2 : 100 / sections.length;
|
|
6770
|
-
}
|
|
6771
|
-
);
|
|
6772
|
-
const total = defaultSizes.reduce((sum, size) => sum + size, 0);
|
|
6773
|
-
return defaultSizes.map((size) => size / total * 100);
|
|
6774
|
-
});
|
|
6855
|
+
}, [storageKey]);
|
|
6775
6856
|
const [draggingIndex, setDraggingIndex] = React33.useState(null);
|
|
6776
6857
|
const [startX, setStartX] = React33.useState(0);
|
|
6777
6858
|
const [startSizes, setStartSizes] = React33.useState([]);
|
|
@@ -8021,18 +8102,28 @@ var SpecNavigator = React33.memo(
|
|
|
8021
8102
|
}
|
|
8022
8103
|
);
|
|
8023
8104
|
SpecNavigator.displayName = "SpecNavigator";
|
|
8105
|
+
function isMultiTabMode(props) {
|
|
8106
|
+
return "documents" in props && props.documents !== void 0;
|
|
8107
|
+
}
|
|
8024
8108
|
var AIDocEditor = React33__default.memo(
|
|
8025
|
-
({
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8109
|
+
(props) => {
|
|
8110
|
+
var _a, _b;
|
|
8111
|
+
const {
|
|
8112
|
+
currentUser: currentUser2,
|
|
8113
|
+
mode,
|
|
8114
|
+
onAnnotationAdd,
|
|
8115
|
+
onAnnotationUpdate,
|
|
8116
|
+
onAnnotationDelete: _onAnnotationDelete,
|
|
8117
|
+
// Callback for consumers; passed through on demand
|
|
8118
|
+
className
|
|
8119
|
+
} = props;
|
|
8120
|
+
const isMultiTab = isMultiTabMode(props);
|
|
8121
|
+
const currentDocument = useMemo(() => {
|
|
8122
|
+
if (isMultiTab && props.documents) {
|
|
8123
|
+
return props.documents.find((doc) => doc.file.id === props.activeDocumentId) || props.documents[0];
|
|
8124
|
+
}
|
|
8125
|
+
return null;
|
|
8126
|
+
}, [isMultiTab, props]);
|
|
8036
8127
|
const handleAnnotationAdd = useCallback(
|
|
8037
8128
|
(annotation) => {
|
|
8038
8129
|
onAnnotationAdd == null ? void 0 : onAnnotationAdd(annotation);
|
|
@@ -8045,21 +8136,62 @@ var AIDocEditor = React33__default.memo(
|
|
|
8045
8136
|
},
|
|
8046
8137
|
[onAnnotationUpdate]
|
|
8047
8138
|
);
|
|
8048
|
-
|
|
8049
|
-
|
|
8050
|
-
|
|
8051
|
-
|
|
8052
|
-
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
|
|
8057
|
-
|
|
8058
|
-
|
|
8059
|
-
|
|
8060
|
-
|
|
8061
|
-
|
|
8062
|
-
|
|
8139
|
+
if (!isMultiTab) {
|
|
8140
|
+
return /* @__PURE__ */ jsx(
|
|
8141
|
+
DocumentEditorWithComments,
|
|
8142
|
+
{
|
|
8143
|
+
content: props.content,
|
|
8144
|
+
format: props.format,
|
|
8145
|
+
annotations: props.annotations,
|
|
8146
|
+
selectedAnnotationId: props.selectedAnnotationId,
|
|
8147
|
+
currentUserId: currentUser2.id,
|
|
8148
|
+
currentUserName: currentUser2.name,
|
|
8149
|
+
readOnly: mode === "readonly",
|
|
8150
|
+
onAnnotationAdd: handleAnnotationAdd,
|
|
8151
|
+
onAnnotationUpdate: handleAnnotationUpdate,
|
|
8152
|
+
className: cn("ai-doc-editor p-6", className)
|
|
8153
|
+
}
|
|
8154
|
+
);
|
|
8155
|
+
}
|
|
8156
|
+
if (!currentDocument) {
|
|
8157
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ai-doc-editor flex flex-col h-full", className), children: [
|
|
8158
|
+
/* @__PURE__ */ jsx(
|
|
8159
|
+
DocumentTabBar,
|
|
8160
|
+
{
|
|
8161
|
+
tabs: ((_a = props.documents) == null ? void 0 : _a.map((doc) => doc.file)) || [],
|
|
8162
|
+
activeTabId: props.activeDocumentId,
|
|
8163
|
+
onTabSelect: props.onTabSelect,
|
|
8164
|
+
onTabClose: props.onTabClose
|
|
8165
|
+
}
|
|
8166
|
+
),
|
|
8167
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 flex items-center justify-center p-6 text-muted-foreground", children: "No documents open" })
|
|
8168
|
+
] });
|
|
8169
|
+
}
|
|
8170
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ai-doc-editor flex flex-col h-full", className), children: [
|
|
8171
|
+
/* @__PURE__ */ jsx(
|
|
8172
|
+
DocumentTabBar,
|
|
8173
|
+
{
|
|
8174
|
+
tabs: ((_b = props.documents) == null ? void 0 : _b.map((doc) => doc.file)) || [],
|
|
8175
|
+
activeTabId: props.activeDocumentId,
|
|
8176
|
+
onTabSelect: props.onTabSelect,
|
|
8177
|
+
onTabClose: props.onTabClose
|
|
8178
|
+
}
|
|
8179
|
+
),
|
|
8180
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ jsx(
|
|
8181
|
+
DocumentEditorWithComments,
|
|
8182
|
+
{
|
|
8183
|
+
content: currentDocument.content,
|
|
8184
|
+
format: currentDocument.file.format,
|
|
8185
|
+
annotations: currentDocument.annotations,
|
|
8186
|
+
currentUserId: currentUser2.id,
|
|
8187
|
+
currentUserName: currentUser2.name,
|
|
8188
|
+
readOnly: mode === "readonly",
|
|
8189
|
+
onAnnotationAdd: handleAnnotationAdd,
|
|
8190
|
+
onAnnotationUpdate: handleAnnotationUpdate,
|
|
8191
|
+
className: "p-6"
|
|
8192
|
+
}
|
|
8193
|
+
) })
|
|
8194
|
+
] });
|
|
8063
8195
|
}
|
|
8064
8196
|
);
|
|
8065
8197
|
AIDocEditor.displayName = "AIDocEditor";
|
|
@@ -8124,6 +8256,6 @@ function WorkflowBuilder({
|
|
|
8124
8256
|
) });
|
|
8125
8257
|
}
|
|
8126
8258
|
|
|
8127
|
-
export { AIConversation, AIDocEditor, Accordion2 as Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdjustableLayout, AgentIndicator, Alert2 as Alert, AlertDescription2 as AlertDescription, AlertDialog2 as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle2 as AlertTitle, AppHeader, AppSidebar, Avatar2 as Avatar, AvatarFallback2 as AvatarFallback, AvatarImage2 as AvatarImage, Badge2 as Badge, Button2 as Button, ButtonGroup, Card2 as Card, CardAction2 as CardAction, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, Carousel2 as Carousel, CarouselContent2 as CarouselContent, CarouselItem2 as CarouselItem, CarouselNext2 as CarouselNext, CarouselPrevious2 as CarouselPrevious, ChartContainer2 as ChartContainer, ChartLegend2 as ChartLegend, ChartLegendContent2 as ChartLegendContent, ChartStyle2 as ChartStyle, ChartTooltip2 as ChartTooltip, ChartTooltipContent2 as ChartTooltipContent, Checkbox2 as Checkbox, Collapsible2 as Collapsible, CollapsibleContent3 as CollapsibleContent, CollapsibleTrigger3 as CollapsibleTrigger, Command2 as Command, CommandDialog2 as CommandDialog, CommandEmpty2 as CommandEmpty, CommandGroup2 as CommandGroup, CommandInput2 as CommandInput, CommandItem2 as CommandItem, CommandList2 as CommandList, CommandSeparator2 as CommandSeparator, CommandShortcut2 as CommandShortcut, CommentBox, Confirmation2 as Confirmation, DataTable, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocumentEditor, DocumentEditorWithComments, Drawer2 as Drawer, DrawerClose2 as DrawerClose, DrawerContent2 as DrawerContent, DrawerDescription2 as DrawerDescription, DrawerFooter2 as DrawerFooter, DrawerHeader2 as DrawerHeader, DrawerOverlay2 as DrawerOverlay, DrawerPortal2 as DrawerPortal, DrawerTitle2 as DrawerTitle, DrawerTrigger2 as DrawerTrigger, DropdownMenu2 as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileChangeQueue, FileQueue, FileStatusBadge, HoverCard2 as HoverCard, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, Icon, Input2 as Input, InputGroup2 as InputGroup, InputGroupAddon2 as InputGroupAddon, InputGroupButton2 as InputGroupButton, InputGroupInput2 as InputGroupInput, InputGroupText2 as InputGroupText, InputGroupTextarea2 as InputGroupTextarea, InteractiveChart, Label3 as Label, LayoutProvider, ModeToggle, NavUser, NavigationList, OrchestratorMessage, PageContainer, PageLayout, Popover2 as Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress2 as Progress, PromptInput2 as PromptInput, RefinementPanel, ScrollArea2 as ScrollArea, ScrollBar2 as ScrollBar, SectionLayout, Select2 as Select, SelectContent2 as SelectContent, SelectGroup2 as SelectGroup, SelectItem2 as SelectItem, SelectLabel2 as SelectLabel, SelectScrollDownButton2 as SelectScrollDownButton, SelectScrollUpButton2 as SelectScrollUpButton, SelectSeparator2 as SelectSeparator, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator4 as Separator, Sidebar2 as Sidebar, SidebarContent2 as SidebarContent, SidebarFooter2 as SidebarFooter, SidebarGroup2 as SidebarGroup, SidebarGroupAction2 as SidebarGroupAction, SidebarGroupContent2 as SidebarGroupContent, SidebarGroupLabel2 as SidebarGroupLabel, SidebarHeader2 as SidebarHeader, SidebarInset2 as SidebarInset, SidebarMenu2 as SidebarMenu, SidebarMenuButton2 as SidebarMenuButton, SidebarMenuItem2 as SidebarMenuItem, SidebarProvider2 as SidebarProvider, SidebarSeparator2 as SidebarSeparator, SidebarTrigger2 as SidebarTrigger, SpecNavigator, SpecialistMessage, StateNode, StatsCard, Table2 as Table, TableBody2 as TableBody, TableCaption2 as TableCaption, TableCell2 as TableCell, TableFooter2 as TableFooter, TableHead2 as TableHead, TableHeader2 as TableHeader, TablePagination, TableRow2 as TableRow, TableToolbar, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Textarea2 as Textarea, ThemeSelector, ToggleGroup2 as ToggleGroup, ToggleGroupItem, ToolCallDisplay, Tooltip3 as Tooltip, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, TransitionNode, UserMessage, WorkflowBuilder, WorkflowCanvas, WorkflowToolbar, WorkflowToolbarActions, badgeVariants, buttonGroupVariants, buttonVariants, cardVariants, cn, inputVariants, textareaVariants, useSidebar };
|
|
8259
|
+
export { AIConversation, AIDocEditor, Accordion2 as Accordion, AccordionContent, AccordionItem, AccordionTrigger, AdjustableLayout, AgentIndicator, Alert2 as Alert, AlertDescription2 as AlertDescription, AlertDialog2 as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle2 as AlertTitle, AppHeader, AppSidebar, Avatar2 as Avatar, AvatarFallback2 as AvatarFallback, AvatarImage2 as AvatarImage, Badge2 as Badge, Button2 as Button, ButtonGroup, Card2 as Card, CardAction2 as CardAction, CardContent2 as CardContent, CardDescription2 as CardDescription, CardFooter2 as CardFooter, CardHeader2 as CardHeader, CardTitle2 as CardTitle, Carousel2 as Carousel, CarouselContent2 as CarouselContent, CarouselItem2 as CarouselItem, CarouselNext2 as CarouselNext, CarouselPrevious2 as CarouselPrevious, ChartContainer2 as ChartContainer, ChartLegend2 as ChartLegend, ChartLegendContent2 as ChartLegendContent, ChartStyle2 as ChartStyle, ChartTooltip2 as ChartTooltip, ChartTooltipContent2 as ChartTooltipContent, Checkbox2 as Checkbox, Collapsible2 as Collapsible, CollapsibleContent3 as CollapsibleContent, CollapsibleTrigger3 as CollapsibleTrigger, Command2 as Command, CommandDialog2 as CommandDialog, CommandEmpty2 as CommandEmpty, CommandGroup2 as CommandGroup, CommandInput2 as CommandInput, CommandItem2 as CommandItem, CommandList2 as CommandList, CommandSeparator2 as CommandSeparator, CommandShortcut2 as CommandShortcut, CommentBox, Confirmation2 as Confirmation, DataTable, Dialog2 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocumentEditor, DocumentEditorWithComments, DocumentTabBar, Drawer2 as Drawer, DrawerClose2 as DrawerClose, DrawerContent2 as DrawerContent, DrawerDescription2 as DrawerDescription, DrawerFooter2 as DrawerFooter, DrawerHeader2 as DrawerHeader, DrawerOverlay2 as DrawerOverlay, DrawerPortal2 as DrawerPortal, DrawerTitle2 as DrawerTitle, DrawerTrigger2 as DrawerTrigger, DropdownMenu2 as DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileChangeQueue, FileQueue, FileStatusBadge, HoverCard2 as HoverCard, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, Icon, Input2 as Input, InputGroup2 as InputGroup, InputGroupAddon2 as InputGroupAddon, InputGroupButton2 as InputGroupButton, InputGroupInput2 as InputGroupInput, InputGroupText2 as InputGroupText, InputGroupTextarea2 as InputGroupTextarea, InteractiveChart, Label3 as Label, LayoutProvider, ModeToggle, NavUser, NavigationList, OrchestratorMessage, PageContainer, PageLayout, Popover2 as Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress2 as Progress, PromptInput2 as PromptInput, RefinementPanel, ScrollArea2 as ScrollArea, ScrollBar2 as ScrollBar, SectionLayout, Select2 as Select, SelectContent2 as SelectContent, SelectGroup2 as SelectGroup, SelectItem2 as SelectItem, SelectLabel2 as SelectLabel, SelectScrollDownButton2 as SelectScrollDownButton, SelectScrollUpButton2 as SelectScrollUpButton, SelectSeparator2 as SelectSeparator, SelectTrigger2 as SelectTrigger, SelectValue2 as SelectValue, Separator4 as Separator, Sidebar2 as Sidebar, SidebarContent2 as SidebarContent, SidebarFooter2 as SidebarFooter, SidebarGroup2 as SidebarGroup, SidebarGroupAction2 as SidebarGroupAction, SidebarGroupContent2 as SidebarGroupContent, SidebarGroupLabel2 as SidebarGroupLabel, SidebarHeader2 as SidebarHeader, SidebarInset2 as SidebarInset, SidebarMenu2 as SidebarMenu, SidebarMenuButton2 as SidebarMenuButton, SidebarMenuItem2 as SidebarMenuItem, SidebarProvider2 as SidebarProvider, SidebarSeparator2 as SidebarSeparator, SidebarTrigger2 as SidebarTrigger, SpecNavigator, SpecialistMessage, StateNode, StatsCard, Table2 as Table, TableBody2 as TableBody, TableCaption2 as TableCaption, TableCell2 as TableCell, TableFooter2 as TableFooter, TableHead2 as TableHead, TableHeader2 as TableHeader, TablePagination, TableRow2 as TableRow, TableToolbar, Tabs2 as Tabs, TabsContent, TabsList, TabsTrigger, Textarea2 as Textarea, ThemeSelector, ToggleGroup2 as ToggleGroup, ToggleGroupItem, ToolCallDisplay, Tooltip3 as Tooltip, TooltipContent2 as TooltipContent, TooltipProvider2 as TooltipProvider, TooltipTrigger2 as TooltipTrigger, TransitionNode, UserMessage, WorkflowBuilder, WorkflowCanvas, WorkflowToolbar, WorkflowToolbarActions, badgeVariants, buttonGroupVariants, buttonVariants, cardVariants, cn, inputVariants, textareaVariants, useSidebar };
|
|
8128
8260
|
//# sourceMappingURL=index.js.map
|
|
8129
8261
|
//# sourceMappingURL=index.js.map
|