@tangle-network/sandbox-ui 0.2.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 +68 -0
- package/dist/auth.d.ts +57 -0
- package/dist/auth.js +14 -0
- package/dist/branding-DCi5VEik.d.ts +13 -0
- package/dist/button-BidTtuRS.d.ts +15 -0
- package/dist/chat.d.ts +121 -0
- package/dist/chat.js +25 -0
- package/dist/chunk-2UHPE5T7.js +201 -0
- package/dist/chunk-4EIWPJMJ.js +545 -0
- package/dist/chunk-6MQIDUPA.js +502 -0
- package/dist/chunk-B26TQ7SA.js +47 -0
- package/dist/chunk-E6FS7R4X.js +109 -0
- package/dist/chunk-GRYHFH5O.js +110 -0
- package/dist/chunk-HMND7JPA.js +868 -0
- package/dist/chunk-HRMUF35V.js +19 -0
- package/dist/chunk-HYEAX3DC.js +822 -0
- package/dist/chunk-KMXV7DDX.js +174 -0
- package/dist/chunk-KYY2X6LY.js +318 -0
- package/dist/chunk-L6ZDH5F4.js +334 -0
- package/dist/chunk-LTFK464G.js +103 -0
- package/dist/chunk-M34OA6PQ.js +233 -0
- package/dist/chunk-M6VLC32S.js +219 -0
- package/dist/chunk-MCGKDCOR.js +173 -0
- package/dist/chunk-NI2EI43H.js +294 -0
- package/dist/chunk-OU4TRNQZ.js +173 -0
- package/dist/chunk-QD4QE5P5.js +40 -0
- package/dist/chunk-QSQBDR3N.js +180 -0
- package/dist/chunk-RQHJBTEU.js +10 -0
- package/dist/chunk-U62G5TS7.js +472 -0
- package/dist/chunk-ZOL2TR5M.js +475 -0
- package/dist/dashboard.d.ts +111 -0
- package/dist/dashboard.js +26 -0
- package/dist/editor.d.ts +196 -0
- package/dist/editor.js +713 -0
- package/dist/expanded-tool-detail-OkXGqTHe.d.ts +52 -0
- package/dist/files.d.ts +66 -0
- package/dist/files.js +11 -0
- package/dist/hooks.d.ts +22 -0
- package/dist/hooks.js +107 -0
- package/dist/index.d.ts +107 -0
- package/dist/index.js +551 -0
- package/dist/markdown.d.ts +55 -0
- package/dist/markdown.js +17 -0
- package/dist/pages.d.ts +89 -0
- package/dist/pages.js +1181 -0
- package/dist/parts-CyGkM6Fp.d.ts +50 -0
- package/dist/primitives.d.ts +189 -0
- package/dist/primitives.js +161 -0
- package/dist/run-CtFZ6s-D.d.ts +41 -0
- package/dist/run.d.ts +14 -0
- package/dist/run.js +29 -0
- package/dist/sidecar-CFU2W9j1.d.ts +8 -0
- package/dist/stores.d.ts +28 -0
- package/dist/stores.js +49 -0
- package/dist/terminal.d.ts +44 -0
- package/dist/terminal.js +160 -0
- package/dist/tool-call-feed-D5Ume-Pt.d.ts +66 -0
- package/dist/tool-display-BvsVW_Ur.d.ts +32 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.js +0 -0
- package/dist/usage-chart-DINgSVL5.d.ts +60 -0
- package/dist/use-sidecar-auth-Bb0-w3lX.d.ts +339 -0
- package/dist/utils.d.ts +28 -0
- package/dist/utils.js +28 -0
- package/dist/workspace.d.ts +113 -0
- package/dist/workspace.js +15 -0
- package/package.json +174 -0
- package/src/styles/globals.css +230 -0
- package/src/styles/tokens.css +73 -0
- package/tailwind.config.cjs +99 -0
package/dist/editor.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { HocuspocusProvider } from '@hocuspocus/provider';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import * as Y from 'yjs';
|
|
5
|
+
import { Editor } from '@tiptap/react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Connection state for the Hocuspocus provider.
|
|
9
|
+
*/
|
|
10
|
+
type ConnectionState = "disconnected" | "connecting" | "connected" | "synced";
|
|
11
|
+
/**
|
|
12
|
+
* Collaborator information from awareness.
|
|
13
|
+
*/
|
|
14
|
+
interface Collaborator {
|
|
15
|
+
clientId: number;
|
|
16
|
+
user: {
|
|
17
|
+
name: string;
|
|
18
|
+
color: string;
|
|
19
|
+
userId?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Editor context value exposed to children.
|
|
24
|
+
*/
|
|
25
|
+
interface EditorContextValue {
|
|
26
|
+
/** The Y.Doc instance for collaboration */
|
|
27
|
+
doc: Y.Doc;
|
|
28
|
+
/** The Hocuspocus provider instance */
|
|
29
|
+
provider: HocuspocusProvider | null;
|
|
30
|
+
/** Current connection state */
|
|
31
|
+
connectionState: ConnectionState;
|
|
32
|
+
/** List of active collaborators */
|
|
33
|
+
collaborators: Collaborator[];
|
|
34
|
+
/** Whether the document is synced with the server */
|
|
35
|
+
isSynced: boolean;
|
|
36
|
+
/** Connect to the collaboration server */
|
|
37
|
+
connect: () => void;
|
|
38
|
+
/** Disconnect from the collaboration server */
|
|
39
|
+
disconnect: () => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* User information for presence/awareness.
|
|
43
|
+
*/
|
|
44
|
+
interface EditorUser {
|
|
45
|
+
name: string;
|
|
46
|
+
color?: string;
|
|
47
|
+
userId?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Props for EditorProvider.
|
|
51
|
+
*/
|
|
52
|
+
interface EditorProviderProps {
|
|
53
|
+
/** WebSocket URL for the Hocuspocus server */
|
|
54
|
+
websocketUrl: string;
|
|
55
|
+
/** Document name (e.g., "doc:my-document") */
|
|
56
|
+
documentName: string;
|
|
57
|
+
/** JWT token for authentication */
|
|
58
|
+
token: string;
|
|
59
|
+
/** Current user information for awareness */
|
|
60
|
+
user: EditorUser;
|
|
61
|
+
/** Auto-connect on mount (default: true) */
|
|
62
|
+
autoConnect?: boolean;
|
|
63
|
+
/** Reconnect on disconnect (default: true) */
|
|
64
|
+
autoReconnect?: boolean;
|
|
65
|
+
/** Max reconnect attempts (default: 5) */
|
|
66
|
+
maxReconnectAttempts?: number;
|
|
67
|
+
/** Callback when connection state changes */
|
|
68
|
+
onConnectionChange?: (state: ConnectionState) => void;
|
|
69
|
+
/** Callback when sync completes */
|
|
70
|
+
onSync?: () => void;
|
|
71
|
+
/** Callback on authentication error */
|
|
72
|
+
onAuthError?: (error: Error) => void;
|
|
73
|
+
/** Children components */
|
|
74
|
+
children: ReactNode;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* EditorProvider wraps children with Hocuspocus collaboration context.
|
|
78
|
+
* Manages WebSocket connection, Y.Doc, and awareness state.
|
|
79
|
+
*/
|
|
80
|
+
declare function EditorProvider({ websocketUrl, documentName, token, user, autoConnect, autoReconnect, maxReconnectAttempts, onConnectionChange, onSync, onAuthError, children, }: EditorProviderProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* Hook to access the editor context.
|
|
83
|
+
* Must be used within an EditorProvider.
|
|
84
|
+
*/
|
|
85
|
+
declare function useEditorContext(): EditorContextValue;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Props for TiptapEditor component.
|
|
89
|
+
*/
|
|
90
|
+
interface TiptapEditorProps {
|
|
91
|
+
/** Initial content for new documents (markdown string) */
|
|
92
|
+
initialContent?: string;
|
|
93
|
+
/** Placeholder text when editor is empty */
|
|
94
|
+
placeholder?: string;
|
|
95
|
+
/** Whether the editor is read-only */
|
|
96
|
+
readOnly?: boolean;
|
|
97
|
+
/** Whether to auto-focus on mount */
|
|
98
|
+
autoFocus?: boolean;
|
|
99
|
+
/** Custom className for the editor wrapper */
|
|
100
|
+
className?: string;
|
|
101
|
+
/** Custom className for the editor content area */
|
|
102
|
+
contentClassName?: string;
|
|
103
|
+
/** Callback when content changes */
|
|
104
|
+
onUpdate?: (editor: Editor) => void;
|
|
105
|
+
/** Callback when selection changes */
|
|
106
|
+
onSelectionUpdate?: (editor: Editor) => void;
|
|
107
|
+
/** Callback when editor is ready */
|
|
108
|
+
onReady?: (editor: Editor) => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* TiptapEditor - Collaborative markdown editor with Y.js sync.
|
|
112
|
+
* Must be used within an EditorProvider.
|
|
113
|
+
*/
|
|
114
|
+
declare function TiptapEditor({ initialContent, placeholder, readOnly, autoFocus, className, contentClassName, onUpdate, onSelectionUpdate, onReady, }: TiptapEditorProps): react_jsx_runtime.JSX.Element;
|
|
115
|
+
/**
|
|
116
|
+
* Collaborators list component.
|
|
117
|
+
* Shows active users in the document.
|
|
118
|
+
*/
|
|
119
|
+
declare function CollaboratorsList({ collaborators, className, }: {
|
|
120
|
+
collaborators: Collaborator[];
|
|
121
|
+
className?: string;
|
|
122
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
123
|
+
/**
|
|
124
|
+
* Editor toolbar component.
|
|
125
|
+
* Provides basic formatting controls.
|
|
126
|
+
*/
|
|
127
|
+
declare function EditorToolbar({ editor, className, }: {
|
|
128
|
+
editor: Editor | null;
|
|
129
|
+
className?: string;
|
|
130
|
+
}): react_jsx_runtime.JSX.Element | null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Hook to get the current connection state and helpers.
|
|
134
|
+
*/
|
|
135
|
+
declare function useEditorConnection(): {
|
|
136
|
+
/** Current connection state string */
|
|
137
|
+
state: ConnectionState;
|
|
138
|
+
/** Whether connected to the server (connected or synced) */
|
|
139
|
+
isConnected: boolean;
|
|
140
|
+
/** Whether currently attempting to connect */
|
|
141
|
+
isConnecting: boolean;
|
|
142
|
+
/** Whether disconnected from the server */
|
|
143
|
+
isDisconnected: boolean;
|
|
144
|
+
/** Whether the document is synced with the server */
|
|
145
|
+
isSynced: boolean;
|
|
146
|
+
/** Connect to the collaboration server */
|
|
147
|
+
connect: () => void;
|
|
148
|
+
/** Disconnect from the collaboration server */
|
|
149
|
+
disconnect: () => void;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Hook to get the list of active collaborators.
|
|
153
|
+
*/
|
|
154
|
+
declare function useCollaborators(): {
|
|
155
|
+
/** List of active collaborators (excluding self) */
|
|
156
|
+
collaborators: Collaborator[];
|
|
157
|
+
/** Number of other collaborators */
|
|
158
|
+
count: number;
|
|
159
|
+
/** Whether there are other collaborators present */
|
|
160
|
+
hasOthers: boolean;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Hook to track a specific collaborator's presence.
|
|
164
|
+
*/
|
|
165
|
+
declare function useCollaboratorPresence(userId: string): Collaborator | null;
|
|
166
|
+
/**
|
|
167
|
+
* Hook to sync local state with the Y.Doc.
|
|
168
|
+
* Useful for persisting editor metadata.
|
|
169
|
+
*/
|
|
170
|
+
declare function useYjsState<T>(key: string, initialValue: T): [T, (value: T) => void];
|
|
171
|
+
/**
|
|
172
|
+
* Hook to track document changes.
|
|
173
|
+
* Returns true if there are unsaved changes since the last save.
|
|
174
|
+
*/
|
|
175
|
+
declare function useDocumentChanges(onSave?: () => Promise<void>): {
|
|
176
|
+
/** Whether there are unsaved changes */
|
|
177
|
+
isDirty: boolean;
|
|
178
|
+
/** Whether save is in progress */
|
|
179
|
+
isSaving: boolean;
|
|
180
|
+
/** When the document was last saved */
|
|
181
|
+
lastSaved: Date | null;
|
|
182
|
+
/** Save the document */
|
|
183
|
+
save: () => Promise<void>;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Hook to get awareness state for presence features.
|
|
187
|
+
* Provides lower-level access to the Hocuspocus awareness.
|
|
188
|
+
*/
|
|
189
|
+
declare function useAwareness(): {
|
|
190
|
+
localState: Record<string, unknown>;
|
|
191
|
+
setLocalState: (state: Record<string, unknown>) => void;
|
|
192
|
+
setLocalStateField: (field: string, value: unknown) => void;
|
|
193
|
+
awareness: HocuspocusProvider["awareness"] | undefined;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export { type Collaborator, CollaboratorsList, type ConnectionState, type EditorContextValue, EditorProvider, type EditorProviderProps, EditorToolbar, type EditorUser, TiptapEditor, type TiptapEditorProps, useAwareness, useCollaboratorPresence, useCollaborators, useDocumentChanges, useEditorConnection, useEditorContext, useYjsState };
|