@ct-player/embed 1.1.3 → 1.1.8
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/index.cjs +72 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +276 -33
- package/dist/index.d.ts +276 -33
- package/dist/index.js +72 -49
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import Hls from 'hls.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* All possible event types in the .ct format
|
|
13
13
|
*/
|
|
14
|
-
type CTEventType = 'init' | 'code' | 'code_edit' | 'language' | 'terminal' | 'terminal_input' | 'stroke_start' | 'whiteboard_points' | 'stroke_end' | 'whiteboard_stroke' | 'whiteboard_clear' | 'whiteboard_undo' | 'whiteboard' | 'whiteboard_point' | 'excalidraw_scene' | 'excalidraw_clear' | 'document_load' | 'document_page' | 'document_zoom' | 'document_scroll' | 'document_clear' | 'file_create' | 'file_update' | 'file_delete' | 'file_rename' | 'file_switch' | 'file_select' | 'file_change' | 'file_creation_start' | 'file_creation_input' | 'file_creation_cancel' | 'cursor_move' | 'cursor_click' | 'cursor_enter' | 'cursor_leave' | 'tool_switch' | 'tool' | 'marker';
|
|
14
|
+
type CTEventType = 'init' | 'code' | 'code_edit' | 'language' | 'terminal' | 'terminal_input' | 'stroke_start' | 'whiteboard_points' | 'stroke_end' | 'whiteboard_stroke' | 'whiteboard_clear' | 'whiteboard_undo' | 'whiteboard' | 'whiteboard_point' | 'excalidraw_scene' | 'excalidraw_clear' | 'document_load' | 'document_page' | 'document_zoom' | 'document_scroll' | 'document_clear' | 'file_create' | 'file_update' | 'file_delete' | 'file_rename' | 'file_switch' | 'folder_create' | 'folder_delete' | 'file_select' | 'file_change' | 'file_creation_start' | 'file_creation_input' | 'file_creation_cancel' | 'file_rename_start' | 'file_rename_input' | 'file_rename_cancel' | 'folder_toggle' | 'cursor_move' | 'cursor_click' | 'cursor_enter' | 'cursor_leave' | 'file_hover' | 'text_select' | 'editor_cursor' | 'tool_switch' | 'tool' | 'marker';
|
|
15
15
|
/**
|
|
16
16
|
* Base event structure with generic type parameter
|
|
17
17
|
*/
|
|
@@ -27,7 +27,7 @@ interface CTEventBase<T extends CTEventType = CTEventType> {
|
|
|
27
27
|
* Discriminated union of all event types.
|
|
28
28
|
* This enables proper type narrowing in switch statements.
|
|
29
29
|
*/
|
|
30
|
-
type CTEvent = CTEventBase<'init'> | CTEventBase<'code'> | CTEventBase<'code_edit'> | CTEventBase<'language'> | CTEventBase<'terminal'> | CTEventBase<'terminal_input'> | CTEventBase<'stroke_start'> | CTEventBase<'whiteboard_points'> | CTEventBase<'stroke_end'> | CTEventBase<'whiteboard_stroke'> | CTEventBase<'whiteboard_clear'> | CTEventBase<'whiteboard_undo'> | CTEventBase<'whiteboard'> | CTEventBase<'whiteboard_point'> | CTEventBase<'excalidraw_scene'> | CTEventBase<'excalidraw_clear'> | CTEventBase<'document_load'> | CTEventBase<'document_page'> | CTEventBase<'document_zoom'> | CTEventBase<'document_scroll'> | CTEventBase<'document_clear'> | CTEventBase<'file_create'> | CTEventBase<'file_update'> | CTEventBase<'file_delete'> | CTEventBase<'file_rename'> | CTEventBase<'file_switch'> | CTEventBase<'file_select'> | CTEventBase<'file_change'> | CTEventBase<'file_creation_start'> | CTEventBase<'file_creation_input'> | CTEventBase<'file_creation_cancel'> | CTEventBase<'cursor_move'> | CTEventBase<'cursor_click'> | CTEventBase<'cursor_enter'> | CTEventBase<'cursor_leave'> | CTEventBase<'tool_switch'> | CTEventBase<'tool'> | CTEventBase<'marker'>;
|
|
30
|
+
type CTEvent = CTEventBase<'init'> | CTEventBase<'code'> | CTEventBase<'code_edit'> | CTEventBase<'language'> | CTEventBase<'terminal'> | CTEventBase<'terminal_input'> | CTEventBase<'stroke_start'> | CTEventBase<'whiteboard_points'> | CTEventBase<'stroke_end'> | CTEventBase<'whiteboard_stroke'> | CTEventBase<'whiteboard_clear'> | CTEventBase<'whiteboard_undo'> | CTEventBase<'whiteboard'> | CTEventBase<'whiteboard_point'> | CTEventBase<'excalidraw_scene'> | CTEventBase<'excalidraw_clear'> | CTEventBase<'document_load'> | CTEventBase<'document_page'> | CTEventBase<'document_zoom'> | CTEventBase<'document_scroll'> | CTEventBase<'document_clear'> | CTEventBase<'file_create'> | CTEventBase<'file_update'> | CTEventBase<'file_delete'> | CTEventBase<'file_rename'> | CTEventBase<'file_switch'> | CTEventBase<'folder_create'> | CTEventBase<'folder_delete'> | CTEventBase<'file_select'> | CTEventBase<'file_change'> | CTEventBase<'file_creation_start'> | CTEventBase<'file_creation_input'> | CTEventBase<'file_creation_cancel'> | CTEventBase<'file_rename_start'> | CTEventBase<'file_rename_input'> | CTEventBase<'file_rename_cancel'> | CTEventBase<'folder_toggle'> | CTEventBase<'cursor_move'> | CTEventBase<'cursor_click'> | CTEventBase<'cursor_enter'> | CTEventBase<'cursor_leave'> | CTEventBase<'file_hover'> | CTEventBase<'text_select'> | CTEventBase<'editor_cursor'> | CTEventBase<'tool_switch'> | CTEventBase<'tool'> | CTEventBase<'marker'>;
|
|
31
31
|
/**
|
|
32
32
|
* Mapping of event types to their data structures
|
|
33
33
|
*/
|
|
@@ -56,13 +56,22 @@ interface CTEventDataMap {
|
|
|
56
56
|
file_delete: FileDeleteEventData;
|
|
57
57
|
file_rename: FileRenameEventData;
|
|
58
58
|
file_switch: FileSwitchEventData;
|
|
59
|
+
folder_create: FolderCreateEventData;
|
|
60
|
+
folder_delete: FolderDeleteEventData;
|
|
59
61
|
file_creation_start: FileCreationStartEventData;
|
|
60
62
|
file_creation_input: FileCreationInputEventData;
|
|
61
63
|
file_creation_cancel: FileCreationCancelEventData;
|
|
64
|
+
file_rename_start: FileRenameStartEventData;
|
|
65
|
+
file_rename_input: FileRenameInputEventData;
|
|
66
|
+
file_rename_cancel: FileRenameCancelEventData;
|
|
67
|
+
folder_toggle: FolderToggleEventData;
|
|
62
68
|
cursor_move: CursorMoveEventData;
|
|
63
69
|
cursor_click: CursorClickEventData;
|
|
64
70
|
cursor_enter: CursorEnterEventData;
|
|
65
71
|
cursor_leave: CursorLeaveEventData;
|
|
72
|
+
file_hover: FileHoverEventData;
|
|
73
|
+
text_select: TextSelectEventData;
|
|
74
|
+
editor_cursor: EditorCursorEventData;
|
|
66
75
|
tool_switch: ToolSwitchEventData;
|
|
67
76
|
marker: MarkerEventData;
|
|
68
77
|
tool: ToolEventData;
|
|
@@ -440,6 +449,18 @@ interface FileRenameEventData {
|
|
|
440
449
|
interface FileSwitchEventData {
|
|
441
450
|
path: string;
|
|
442
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Create an empty folder
|
|
454
|
+
*/
|
|
455
|
+
interface FolderCreateEventData {
|
|
456
|
+
path: string;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Delete a folder and all its contents
|
|
460
|
+
*/
|
|
461
|
+
interface FolderDeleteEventData {
|
|
462
|
+
path: string;
|
|
463
|
+
}
|
|
443
464
|
/**
|
|
444
465
|
* File/folder creation UI started - shows the inline input
|
|
445
466
|
*/
|
|
@@ -463,6 +484,38 @@ interface FileCreationCancelEventData {
|
|
|
463
484
|
/** Reason for cancellation (optional) */
|
|
464
485
|
reason?: 'escape' | 'blur' | 'other';
|
|
465
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* File/folder rename UI started - shows the inline input
|
|
489
|
+
*/
|
|
490
|
+
interface FileRenameStartEventData {
|
|
491
|
+
/** Path of the file/folder being renamed */
|
|
492
|
+
path: string;
|
|
493
|
+
/** Current name of the item */
|
|
494
|
+
currentName: string;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* File/folder rename input changed - for typing animation
|
|
498
|
+
*/
|
|
499
|
+
interface FileRenameInputEventData {
|
|
500
|
+
/** Current value of the input field */
|
|
501
|
+
value: string;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* File/folder rename cancelled - hides the inline input
|
|
505
|
+
*/
|
|
506
|
+
interface FileRenameCancelEventData {
|
|
507
|
+
/** Reason for cancellation (optional) */
|
|
508
|
+
reason?: 'escape' | 'blur' | 'other';
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Folder expanded or collapsed
|
|
512
|
+
*/
|
|
513
|
+
interface FolderToggleEventData {
|
|
514
|
+
/** Path of the folder */
|
|
515
|
+
path: string;
|
|
516
|
+
/** Whether the folder is now expanded */
|
|
517
|
+
expanded: boolean;
|
|
518
|
+
}
|
|
466
519
|
/**
|
|
467
520
|
* Cursor position update
|
|
468
521
|
*/
|
|
@@ -491,6 +544,37 @@ interface CursorEnterEventData {
|
|
|
491
544
|
interface CursorLeaveEventData {
|
|
492
545
|
area: string;
|
|
493
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* File/folder hover in file explorer — highlights the hovered item during playback
|
|
549
|
+
*/
|
|
550
|
+
interface FileHoverEventData {
|
|
551
|
+
/** Path of the hovered file/folder, or null when hover ends */
|
|
552
|
+
path: string | null;
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Text selection in IDE editor or terminal
|
|
556
|
+
*/
|
|
557
|
+
interface TextSelectEventData {
|
|
558
|
+
/** Where the selection occurred */
|
|
559
|
+
source: 'editor' | 'terminal';
|
|
560
|
+
/** Selected text (empty string means selection cleared) */
|
|
561
|
+
text: string;
|
|
562
|
+
/** Start position (for editor selections) */
|
|
563
|
+
startLine?: number;
|
|
564
|
+
startColumn?: number;
|
|
565
|
+
/** End position (for editor selections) */
|
|
566
|
+
endLine?: number;
|
|
567
|
+
endColumn?: number;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Editor typing cursor (caret) position
|
|
571
|
+
*/
|
|
572
|
+
interface EditorCursorEventData {
|
|
573
|
+
/** Line number (1-based) */
|
|
574
|
+
line: number;
|
|
575
|
+
/** Column number (1-based) */
|
|
576
|
+
column: number;
|
|
577
|
+
}
|
|
494
578
|
/**
|
|
495
579
|
* Switch active tool
|
|
496
580
|
*/
|
|
@@ -567,6 +651,8 @@ interface PlaybackState$1 {
|
|
|
567
651
|
currentFile: string | null;
|
|
568
652
|
/** Virtual file system (path → content) */
|
|
569
653
|
fileSystem: Record<string, string>;
|
|
654
|
+
/** Explicitly created empty folders (folders with no files) */
|
|
655
|
+
folders: Set<string>;
|
|
570
656
|
/** Currently loaded document */
|
|
571
657
|
documentData: DocumentData | null;
|
|
572
658
|
/** Current document page number */
|
|
@@ -583,9 +669,20 @@ interface PlaybackState$1 {
|
|
|
583
669
|
x: number;
|
|
584
670
|
y: number;
|
|
585
671
|
visible: boolean;
|
|
672
|
+
clicking?: boolean;
|
|
586
673
|
};
|
|
587
674
|
/** File creation UI state - for showing inline input during playback */
|
|
588
675
|
fileCreation: FileCreationState | null;
|
|
676
|
+
/** File renaming UI state - for showing inline input during playback */
|
|
677
|
+
fileRenaming: FileRenamingState | null;
|
|
678
|
+
/** Expanded folders in the file explorer during playback */
|
|
679
|
+
expandedFolders: Set<string>;
|
|
680
|
+
/** Currently hovered file/folder path in file explorer (null = no hover) */
|
|
681
|
+
hoveredFile: string | null;
|
|
682
|
+
/** Current text selection state */
|
|
683
|
+
textSelection: TextSelectionState | null;
|
|
684
|
+
/** Editor typing cursor (caret) position */
|
|
685
|
+
editorCursor: EditorCursorState | null;
|
|
589
686
|
}
|
|
590
687
|
/**
|
|
591
688
|
* State for file/folder creation UI display during playback
|
|
@@ -598,6 +695,41 @@ interface FileCreationState {
|
|
|
598
695
|
/** Current input value (filename being typed) */
|
|
599
696
|
inputValue: string;
|
|
600
697
|
}
|
|
698
|
+
/**
|
|
699
|
+
* State for file/folder rename UI display during playback
|
|
700
|
+
*/
|
|
701
|
+
interface FileRenamingState {
|
|
702
|
+
/** Path of the file/folder being renamed */
|
|
703
|
+
path: string;
|
|
704
|
+
/** Current name of the item */
|
|
705
|
+
currentName: string;
|
|
706
|
+
/** Current input value (new name being typed) */
|
|
707
|
+
inputValue: string;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Text selection state for playback overlay
|
|
711
|
+
*/
|
|
712
|
+
interface TextSelectionState {
|
|
713
|
+
/** Where the selection is */
|
|
714
|
+
source: 'editor' | 'terminal';
|
|
715
|
+
/** Selected text */
|
|
716
|
+
text: string;
|
|
717
|
+
/** Start position (editor) */
|
|
718
|
+
startLine?: number;
|
|
719
|
+
startColumn?: number;
|
|
720
|
+
/** End position (editor) */
|
|
721
|
+
endLine?: number;
|
|
722
|
+
endColumn?: number;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Editor cursor (typing caret) state for playback
|
|
726
|
+
*/
|
|
727
|
+
interface EditorCursorState {
|
|
728
|
+
/** Line number (1-based) */
|
|
729
|
+
line: number;
|
|
730
|
+
/** Column number (1-based) */
|
|
731
|
+
column: number;
|
|
732
|
+
}
|
|
601
733
|
|
|
602
734
|
/**
|
|
603
735
|
* CT Format Chunked Events Types
|
|
@@ -1224,12 +1356,20 @@ interface ValidationResult$1 {
|
|
|
1224
1356
|
* Validate a complete CT recording
|
|
1225
1357
|
*/
|
|
1226
1358
|
declare function validateCTFile(recording: CTRecording): ValidationResult$1;
|
|
1359
|
+
interface FileTreeNode {
|
|
1360
|
+
name: string;
|
|
1361
|
+
type: 'file' | 'directory';
|
|
1362
|
+
path: string;
|
|
1363
|
+
language?: string;
|
|
1364
|
+
children?: FileTreeNode[];
|
|
1365
|
+
}
|
|
1227
1366
|
|
|
1228
1367
|
/**
|
|
1229
1368
|
* CT-Courses UI Types
|
|
1230
1369
|
*
|
|
1231
1370
|
* Shared type definitions for all UI components.
|
|
1232
1371
|
*/
|
|
1372
|
+
|
|
1233
1373
|
/**
|
|
1234
1374
|
* Component operation mode
|
|
1235
1375
|
*/
|
|
@@ -1290,6 +1430,10 @@ interface IDEPanelProps extends BasePanelProps {
|
|
|
1290
1430
|
terminalLines?: TerminalLineData[];
|
|
1291
1431
|
/** Current terminal input */
|
|
1292
1432
|
terminalInput?: string;
|
|
1433
|
+
/** Pre-built file tree — when provided, IDEPanel skips internal tree building from VFS */
|
|
1434
|
+
tree?: FileTreeNode;
|
|
1435
|
+
/** Flat file map (path → content) for reading file contents in playback mode */
|
|
1436
|
+
files?: Record<string, string>;
|
|
1293
1437
|
/** Called when code changes */
|
|
1294
1438
|
onCodeChange?: (code: string, language: string) => void;
|
|
1295
1439
|
/** Called when cursor moves */
|
|
@@ -1306,6 +1450,10 @@ interface IDEPanelProps extends BasePanelProps {
|
|
|
1306
1450
|
onFileDelete?: (path: string) => void;
|
|
1307
1451
|
/** Called when a file is renamed */
|
|
1308
1452
|
onFileRename?: (oldPath: string, newPath: string) => void;
|
|
1453
|
+
/** Called when a folder is created */
|
|
1454
|
+
onFolderCreate?: (path: string) => void;
|
|
1455
|
+
/** Called when a folder is deleted */
|
|
1456
|
+
onFolderDelete?: (path: string) => void;
|
|
1309
1457
|
/**
|
|
1310
1458
|
* File creation state during playback - shows inline input for typing animation.
|
|
1311
1459
|
* When set, displays the file creation UI with the inputValue.
|
|
@@ -1321,6 +1469,28 @@ interface IDEPanelProps extends BasePanelProps {
|
|
|
1321
1469
|
onFileCreationInput?: (value: string) => void;
|
|
1322
1470
|
/** Called when file creation is cancelled */
|
|
1323
1471
|
onFileCreationCancel?: (reason?: string) => void;
|
|
1472
|
+
/**
|
|
1473
|
+
* File renaming state during playback - shows inline input for typing animation.
|
|
1474
|
+
* When set, displays the file rename UI with the inputValue.
|
|
1475
|
+
*/
|
|
1476
|
+
fileRenamingState?: {
|
|
1477
|
+
path: string;
|
|
1478
|
+
currentName: string;
|
|
1479
|
+
inputValue: string;
|
|
1480
|
+
} | null;
|
|
1481
|
+
/** Called when file rename starts (user clicks Rename button) */
|
|
1482
|
+
onFileRenameStart?: (path: string, currentName: string) => void;
|
|
1483
|
+
/** Called when file rename input changes (user types in the rename input) */
|
|
1484
|
+
onFileRenameInput?: (value: string) => void;
|
|
1485
|
+
/** Called when file rename is cancelled */
|
|
1486
|
+
onFileRenameCancel?: (reason?: string) => void;
|
|
1487
|
+
/**
|
|
1488
|
+
* Expanded folders state during playback - controls which folders are expanded.
|
|
1489
|
+
* When set, uses this instead of local state for folder expansion.
|
|
1490
|
+
*/
|
|
1491
|
+
expandedFoldersState?: Set<string> | null;
|
|
1492
|
+
/** Called when a folder is expanded or collapsed */
|
|
1493
|
+
onFolderToggle?: (path: string, expanded: boolean) => void;
|
|
1324
1494
|
/** Called when terminal input changes */
|
|
1325
1495
|
onTerminalInputChange?: (input: string) => void;
|
|
1326
1496
|
/** Called when a command is executed */
|
|
@@ -1349,6 +1519,38 @@ interface IDEPanelProps extends BasePanelProps {
|
|
|
1349
1519
|
onExecute?: (path: string, language: string) => Promise<TerminalLineData[] | undefined>;
|
|
1350
1520
|
/** Execute terminal command handler (uses TerminalService for full command support) */
|
|
1351
1521
|
onTerminalExecute?: (command: string) => Promise<TerminalLineData[]>;
|
|
1522
|
+
/** Currently hovered file path in file explorer (playback display) */
|
|
1523
|
+
hoveredFile?: string | null;
|
|
1524
|
+
/** File hover callback (recording) */
|
|
1525
|
+
onFileHover?: (path: string | null) => void;
|
|
1526
|
+
/** Text selection state (playback display) */
|
|
1527
|
+
textSelection?: {
|
|
1528
|
+
source: 'editor' | 'terminal';
|
|
1529
|
+
text: string;
|
|
1530
|
+
startLine?: number;
|
|
1531
|
+
startColumn?: number;
|
|
1532
|
+
endLine?: number;
|
|
1533
|
+
endColumn?: number;
|
|
1534
|
+
} | null;
|
|
1535
|
+
/** Text selection callback (recording) */
|
|
1536
|
+
onTextSelect?: (selection: {
|
|
1537
|
+
source: 'editor' | 'terminal';
|
|
1538
|
+
text: string;
|
|
1539
|
+
startLine?: number;
|
|
1540
|
+
startColumn?: number;
|
|
1541
|
+
endLine?: number;
|
|
1542
|
+
endColumn?: number;
|
|
1543
|
+
}) => void;
|
|
1544
|
+
/** Editor cursor (typing caret) position (playback display) */
|
|
1545
|
+
editorCursor?: {
|
|
1546
|
+
line: number;
|
|
1547
|
+
column: number;
|
|
1548
|
+
} | null;
|
|
1549
|
+
/** Editor cursor change callback (recording) */
|
|
1550
|
+
onEditorCursorChange?: (position: {
|
|
1551
|
+
line: number;
|
|
1552
|
+
column: number;
|
|
1553
|
+
}) => void;
|
|
1352
1554
|
}
|
|
1353
1555
|
/**
|
|
1354
1556
|
* Excalidraw scene structure (simplified)
|
|
@@ -1481,36 +1683,67 @@ interface TerminalRef {
|
|
|
1481
1683
|
scrollToBottom: () => void;
|
|
1482
1684
|
}
|
|
1483
1685
|
/**
|
|
1484
|
-
* File Explorer props
|
|
1686
|
+
* File Explorer props — fully props-driven, VS Code-like component.
|
|
1687
|
+
*
|
|
1688
|
+
* Key design decisions:
|
|
1689
|
+
* - No internal VFS subscription. The tree is passed as a pre-built prop.
|
|
1690
|
+
* - `expandedFolders` is always controlled from the parent.
|
|
1691
|
+
* - `mode` + `isPlaying` replace the old ambiguous `readOnly` flag.
|
|
1692
|
+
* - Interaction is allowed when:
|
|
1693
|
+
* mode === 'recording' || mode === 'interactive' ||
|
|
1694
|
+
* (mode === 'playback' && !isPlaying)
|
|
1485
1695
|
*/
|
|
1486
1696
|
interface FileExplorerProps {
|
|
1487
|
-
/**
|
|
1488
|
-
|
|
1489
|
-
/**
|
|
1490
|
-
|
|
1491
|
-
/**
|
|
1697
|
+
/** Pre-built tree from buildFileTree() */
|
|
1698
|
+
tree: FileTreeNode;
|
|
1699
|
+
/** Currently active / selected file path */
|
|
1700
|
+
selectedFile: string | null;
|
|
1701
|
+
/** Which folders are expanded — controlled from parent */
|
|
1702
|
+
expandedFolders: Set<string>;
|
|
1703
|
+
/** Playback file creation state — shows inline typing input */
|
|
1704
|
+
fileCreation?: {
|
|
1705
|
+
type: 'file' | 'folder';
|
|
1706
|
+
parentPath: string;
|
|
1707
|
+
inputValue: string;
|
|
1708
|
+
} | null;
|
|
1709
|
+
/** Playback file rename state — shows inline rename input */
|
|
1710
|
+
fileRenaming?: {
|
|
1711
|
+
path: string;
|
|
1712
|
+
currentName: string;
|
|
1713
|
+
inputValue: string;
|
|
1714
|
+
} | null;
|
|
1715
|
+
/** Current operation mode */
|
|
1716
|
+
mode: 'recording' | 'playback' | 'interactive';
|
|
1717
|
+
/** True when playback is actively running (blocks user interaction) */
|
|
1718
|
+
isPlaying?: boolean;
|
|
1719
|
+
/** Called when a file is clicked */
|
|
1720
|
+
onFileSelect?: (path: string) => void;
|
|
1721
|
+
/** Called when a new file is created */
|
|
1492
1722
|
onFileCreate?: (path: string, content: string) => void;
|
|
1493
|
-
/** Called when folder is created */
|
|
1723
|
+
/** Called when a new folder is created */
|
|
1494
1724
|
onFolderCreate?: (path: string) => void;
|
|
1495
|
-
/** Called when file is deleted */
|
|
1725
|
+
/** Called when a file/folder is deleted */
|
|
1496
1726
|
onFileDelete?: (path: string) => void;
|
|
1497
|
-
/** Called when file is renamed */
|
|
1727
|
+
/** Called when a file/folder is renamed */
|
|
1498
1728
|
onFileRename?: (oldPath: string, newPath: string) => void;
|
|
1499
|
-
/** Called when
|
|
1729
|
+
/** Called when a folder is toggled (expand/collapse) */
|
|
1730
|
+
onFolderToggle?: (path: string, expanded: boolean) => void;
|
|
1731
|
+
/** Called when user clicks New File/Folder button */
|
|
1500
1732
|
onFileCreationStart?: (type: 'file' | 'folder', parentPath: string) => void;
|
|
1501
|
-
/** Called when user types in
|
|
1733
|
+
/** Called when user types in file creation input */
|
|
1502
1734
|
onFileCreationInput?: (value: string) => void;
|
|
1503
|
-
/** Called when user cancels file creation
|
|
1735
|
+
/** Called when user cancels file creation */
|
|
1504
1736
|
onFileCreationCancel?: (reason?: string) => void;
|
|
1505
|
-
/**
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1737
|
+
/** Called when user starts renaming */
|
|
1738
|
+
onFileRenameStart?: (path: string, currentName: string) => void;
|
|
1739
|
+
/** Called when user types in rename input */
|
|
1740
|
+
onFileRenameInput?: (value: string) => void;
|
|
1741
|
+
/** Called when user cancels rename */
|
|
1742
|
+
onFileRenameCancel?: (reason?: string) => void;
|
|
1743
|
+
/** Currently hovered file/folder path during playback */
|
|
1744
|
+
hoveredFile?: string | null;
|
|
1745
|
+
/** Called when user hovers over a file/folder (recording) */
|
|
1746
|
+
onFileHover?: (path: string | null) => void;
|
|
1514
1747
|
/** Additional CSS classes */
|
|
1515
1748
|
className?: string;
|
|
1516
1749
|
}
|
|
@@ -1542,22 +1775,20 @@ interface VirtualFileSystem {
|
|
|
1542
1775
|
getFileTree: () => FileSystemEntry;
|
|
1543
1776
|
subscribe: (callback: () => void) => () => void;
|
|
1544
1777
|
writeFile: (path: string, content: string) => void;
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1778
|
+
deleteFile?: (path: string) => boolean;
|
|
1779
|
+
deleteDirectory?: (path: string) => boolean;
|
|
1780
|
+
exists?: (path: string) => boolean;
|
|
1781
|
+
directoryExists?: (path: string) => boolean;
|
|
1548
1782
|
readFile?: (path: string) => string;
|
|
1549
|
-
/** Optional: Get all files as a record */
|
|
1550
1783
|
getFiles?: () => Record<string, string>;
|
|
1551
|
-
/** Optional: Notify subscribers of changes (call after batch VFS operations) */
|
|
1552
1784
|
notifyChanged?: () => void;
|
|
1785
|
+
mkdir?: (path: string) => void;
|
|
1553
1786
|
}
|
|
1554
|
-
declare function
|
|
1555
|
-
fileSystem
|
|
1787
|
+
declare function IDEPanel({ fileSystem, tree: externalTree, files: externalFiles, code: externalCode, language: externalLanguage, currentFile: externalCurrentFile, onCodeChange, onFileChange, onFileCreate, onFileDelete, onFileRename, onFileSelect, onFolderCreate, onFolderDelete, onTerminalCommand, onTerminalClear, onTerminalAddLines, fileCreationState, onFileCreationStart, onFileCreationInput, onFileCreationCancel, fileRenamingState, onFileRenameStart, onFileRenameInput, onFileRenameCancel, expandedFoldersState, onFolderToggle, terminalLines: externalTerminalLines, terminalInput: externalTerminalInput, onTerminalInputChange, onExecute, onTerminalExecute, mode, isPlaying, defaultShowExplorer, defaultShowTerminal, showRunButton, interactiveLabel, initialFiles, initialActiveFile, hoveredFile, onFileHover, textSelection, onTextSelect, editorCursor, onEditorCursorChange }: IDEPanelProps & {
|
|
1788
|
+
fileSystem?: VirtualFileSystem;
|
|
1556
1789
|
}): react_jsx_runtime.JSX.Element;
|
|
1557
1790
|
|
|
1558
|
-
declare function
|
|
1559
|
-
fileSystem: VirtualFileSystem;
|
|
1560
|
-
}): react_jsx_runtime.JSX.Element;
|
|
1791
|
+
declare function FileExplorer({ tree, selectedFile, expandedFolders, fileCreation, fileRenaming, mode, isPlaying, hoveredFile, onFileHover, onFileSelect, onFileCreate, onFolderCreate, onFileDelete, onFileRename, onFolderToggle, onFileCreationStart, onFileCreationInput, onFileCreationCancel, onFileRenameStart, onFileRenameInput, onFileRenameCancel, className, }: FileExplorerProps): react_jsx_runtime.JSX.Element;
|
|
1561
1792
|
|
|
1562
1793
|
declare const Terminal: react.ForwardRefExoticComponent<TerminalProps & react.RefAttributes<TerminalRef>>;
|
|
1563
1794
|
|
|
@@ -1903,6 +2134,16 @@ interface StreamingCoursePlayerProps {
|
|
|
1903
2134
|
onBuffering?: (isBuffering: boolean) => void;
|
|
1904
2135
|
/** Called when tool changes */
|
|
1905
2136
|
onToolChange?: (tool: string) => void;
|
|
2137
|
+
/** Go-Judge server URL */
|
|
2138
|
+
goJudgeUrl?: string;
|
|
2139
|
+
/** Go-Judge API key */
|
|
2140
|
+
goJudgeApiKey?: string;
|
|
2141
|
+
/** Show chapter markers */
|
|
2142
|
+
showChapters?: boolean;
|
|
2143
|
+
/** Called when entering interactive mode */
|
|
2144
|
+
onInteractionStart?: () => void;
|
|
2145
|
+
/** Called when exiting interactive mode */
|
|
2146
|
+
onInteractionEnd?: (code: string) => void;
|
|
1906
2147
|
}
|
|
1907
2148
|
/**
|
|
1908
2149
|
* Imperative handle for StreamingCoursePlayer
|
|
@@ -1915,6 +2156,8 @@ interface StreamingCoursePlayerRef {
|
|
|
1915
2156
|
getCurrentTime(): number;
|
|
1916
2157
|
getDuration(): number;
|
|
1917
2158
|
getState(): PlaybackState$1;
|
|
2159
|
+
enterInteractiveMode(): void;
|
|
2160
|
+
exitInteractiveMode(): void;
|
|
1918
2161
|
setActiveTool(tool: ActiveTool): void;
|
|
1919
2162
|
getManifest(): StreamingManifest | null;
|
|
1920
2163
|
getBufferHealth(): RemoteBufferHealth;
|