update more typescript errors for vercel
This commit is contained in:
parent
4815fa4a23
commit
38d1f28e35
|
|
@ -119,7 +119,7 @@ export function applyAutomergePatchesToTLStore(
|
||||||
|
|
||||||
// Create new object with correct typeName if it changed
|
// Create new object with correct typeName if it changed
|
||||||
if (correctTypeName !== record.typeName) {
|
if (correctTypeName !== record.typeName) {
|
||||||
record = { ...record, typeName: correctTypeName }
|
record = { ...record, typeName: correctTypeName } as TLRecord
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -157,6 +157,7 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
||||||
private workerUrl: string
|
private workerUrl: string
|
||||||
private websocket: WebSocket | null = null
|
private websocket: WebSocket | null = null
|
||||||
private roomId: string | null = null
|
private roomId: string | null = null
|
||||||
|
private peerId: PeerId | null = null
|
||||||
private readyPromise: Promise<void>
|
private readyPromise: Promise<void>
|
||||||
private readyResolve: (() => void) | null = null
|
private readyResolve: (() => void) | null = null
|
||||||
private keepAliveInterval: NodeJS.Timeout | null = null
|
private keepAliveInterval: NodeJS.Timeout | null = null
|
||||||
|
|
@ -189,6 +190,9 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Store peerId
|
||||||
|
this.peerId = peerId
|
||||||
|
|
||||||
// Clean up existing connection
|
// Clean up existing connection
|
||||||
this.cleanup()
|
this.cleanup()
|
||||||
|
|
||||||
|
|
@ -223,16 +227,20 @@ export class CloudflareNetworkAdapter extends NetworkAdapter {
|
||||||
// Automerge Repo expects binary sync messages as Uint8Array
|
// Automerge Repo expects binary sync messages as Uint8Array
|
||||||
this.emit('message', {
|
this.emit('message', {
|
||||||
type: 'sync',
|
type: 'sync',
|
||||||
data: new Uint8Array(event.data)
|
data: new Uint8Array(event.data),
|
||||||
})
|
senderId: this.peerId || 'unknown' as PeerId,
|
||||||
|
targetId: this.peerId || 'unknown' as PeerId
|
||||||
|
} as Message)
|
||||||
} else if (event.data instanceof Blob) {
|
} else if (event.data instanceof Blob) {
|
||||||
// Handle Blob messages (convert to Uint8Array)
|
// Handle Blob messages (convert to Uint8Array)
|
||||||
event.data.arrayBuffer().then((buffer) => {
|
event.data.arrayBuffer().then((buffer) => {
|
||||||
console.log('🔌 CloudflareAdapter: Received Blob message, converted to Uint8Array')
|
console.log('🔌 CloudflareAdapter: Received Blob message, converted to Uint8Array')
|
||||||
this.emit('message', {
|
this.emit('message', {
|
||||||
type: 'sync',
|
type: 'sync',
|
||||||
data: new Uint8Array(buffer)
|
data: new Uint8Array(buffer),
|
||||||
})
|
senderId: this.peerId || 'unknown' as PeerId,
|
||||||
|
targetId: this.peerId || 'unknown' as PeerId
|
||||||
|
} as Message)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Handle text messages (our custom protocol for backward compatibility)
|
// Handle text messages (our custom protocol for backward compatibility)
|
||||||
|
|
|
||||||
|
|
@ -140,10 +140,18 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
||||||
// Get the store with status
|
// Get the store with status
|
||||||
const storeWithStatus = useMemo((): TLStoreWithStatus => {
|
const storeWithStatus = useMemo((): TLStoreWithStatus => {
|
||||||
if (!store) {
|
if (!store) {
|
||||||
return {
|
if (isLoading) {
|
||||||
status: isLoading ? 'loading' : 'not-synced',
|
return {
|
||||||
connectionStatus: 'offline',
|
status: 'loading' as const,
|
||||||
store: undefined
|
connectionStatus: 'offline' as const,
|
||||||
|
store: undefined
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
status: 'not-synced' as const,
|
||||||
|
connectionStatus: 'offline' as const,
|
||||||
|
store: undefined
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,7 +166,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
||||||
const presence = useAutomergePresence({
|
const presence = useAutomergePresence({
|
||||||
handle: handle || null,
|
handle: handle || null,
|
||||||
store: store || null,
|
store: store || null,
|
||||||
userMetadata: user || { userId: 'anonymous', name: 'Anonymous', color: '#000000' }
|
userMetadata: user && 'userId' in user ? user : { userId: user?.id || 'anonymous', name: user?.name || 'Anonymous', color: '#000000' }
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ export const useWebSpeechTranscription = ({
|
||||||
const speakerChangeThreshold = 0.3 // Threshold for detecting speaker changes
|
const speakerChangeThreshold = 0.3 // Threshold for detecting speaker changes
|
||||||
|
|
||||||
// Function to add line breaks after pauses and improve punctuation
|
// Function to add line breaks after pauses and improve punctuation
|
||||||
const processTranscript = useCallback((text: string, isFinal: boolean = false, confidence?: number) => {
|
const processTranscript = useCallback((text: string, isFinal: boolean = false, _confidence?: number) => {
|
||||||
if (!text.trim()) return text
|
if (!text.trim()) return text
|
||||||
|
|
||||||
let processedText = text.trim()
|
let processedText = text.trim()
|
||||||
|
|
|
||||||
|
|
@ -185,14 +185,14 @@ export class HoloSphereService {
|
||||||
})
|
})
|
||||||
// Handle Promise if subscribe returns one
|
// Handle Promise if subscribe returns one
|
||||||
if (subscribeResult instanceof Promise) {
|
if (subscribeResult instanceof Promise) {
|
||||||
subscribeResult.then((result) => {
|
subscribeResult.then((result: any) => {
|
||||||
unsubscribe = result?.unsubscribe || undefined
|
unsubscribe = result?.unsubscribe || undefined
|
||||||
console.log(`✅ Subscribe called successfully for ${lens}`)
|
console.log(`✅ Subscribe called successfully for ${lens}`)
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
console.error(`❌ Error in subscribe promise for ${lens}:`, err)
|
console.error(`❌ Error in subscribe promise for ${lens}:`, err)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
unsubscribe = subscribeResult?.unsubscribe || undefined
|
unsubscribe = (subscribeResult as any)?.unsubscribe || undefined
|
||||||
console.log(`✅ Subscribe called successfully for ${lens}`)
|
console.log(`✅ Subscribe called successfully for ${lens}`)
|
||||||
}
|
}
|
||||||
} catch (subError) {
|
} catch (subError) {
|
||||||
|
|
|
||||||
|
|
@ -201,18 +201,6 @@ export class FathomTranscriptShape extends BaseBoxShapeUtil<IFathomTranscript> {
|
||||||
gap: '12px',
|
gap: '12px',
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonStyle: React.CSSProperties = {
|
|
||||||
padding: '4px 8px',
|
|
||||||
fontSize: '10px',
|
|
||||||
border: '1px solid #ccc',
|
|
||||||
borderRadius: '4px',
|
|
||||||
backgroundColor: 'white',
|
|
||||||
cursor: 'pointer',
|
|
||||||
zIndex: 1000,
|
|
||||||
position: 'relative',
|
|
||||||
pointerEvents: 'auto',
|
|
||||||
}
|
|
||||||
|
|
||||||
const transcriptEntryStyle: React.CSSProperties = {
|
const transcriptEntryStyle: React.CSSProperties = {
|
||||||
marginBottom: '8px',
|
marginBottom: '8px',
|
||||||
padding: '8px',
|
padding: '8px',
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export function resolveOverlaps(editor: Editor, shapeId: string): void {
|
||||||
'Embed', 'Slide', 'Markdown', 'SharedPiano', 'MycrozineTemplate', 'ChatBox'
|
'Embed', 'Slide', 'Markdown', 'SharedPiano', 'MycrozineTemplate', 'ChatBox'
|
||||||
]
|
]
|
||||||
|
|
||||||
const shape = editor.getShape(shapeId)
|
const shape = editor.getShape(shapeId as TLShapeId)
|
||||||
if (!shape || !customShapeTypes.includes(shape.type)) return
|
if (!shape || !customShapeTypes.includes(shape.type)) return
|
||||||
|
|
||||||
const shapeBounds = getShapeBounds(editor, shape)
|
const shapeBounds = getShapeBounds(editor, shape)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue