mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-22 01:25:00 +02:00
Cloud collaborator refactoring (#6424)
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
import { type Class, type Ref } from '@hcengineering/core'
|
||||
import { type Asset, type IntlString, type Metadata, type Plugin, plugin } from '@hcengineering/platform'
|
||||
|
||||
import { type TextEditorExtensionFactory, type RefInputActionItem, TextEditorAction } from './types'
|
||||
import { type TextEditorExtensionFactory, type RefInputActionItem, TextEditorAction, CollaboratorType } from './types'
|
||||
|
||||
/**
|
||||
* @public
|
||||
@@ -31,7 +31,7 @@ export default plugin(textEditorId, {
|
||||
TextEditorAction: '' as Ref<Class<TextEditorAction>>
|
||||
},
|
||||
metadata: {
|
||||
CollaboratorUrl: '' as Metadata<string>
|
||||
Collaborator: '' as Metadata<CollaboratorType>
|
||||
},
|
||||
string: {
|
||||
TableOfContents: '' as IntlString,
|
||||
|
||||
@@ -6,6 +6,12 @@ import { type AnyExtension, type Content, type Editor, type SingleCommands } fro
|
||||
import { type ParseOptions } from '@tiptap/pm/model'
|
||||
|
||||
export type { AnyExtension, Editor } from '@tiptap/core'
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export type CollaboratorType = 'local' | 'cloud'
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
@@ -122,8 +128,7 @@ export interface CollaborationUser {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface CollaborationUserState {
|
||||
clientId: number
|
||||
export interface AwarenessState {
|
||||
user: CollaborationUser
|
||||
cursor?: {
|
||||
anchor: RelativePosition
|
||||
@@ -133,9 +138,10 @@ export interface CollaborationUserState {
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export interface AwarenessChangeEvent {
|
||||
states: CollaborationUserState[]
|
||||
}
|
||||
export type AwarenessClientId = number
|
||||
|
||||
/** @public */
|
||||
export type AwarenessStateMap = Map<AwarenessClientId, AwarenessState>
|
||||
|
||||
export type TextEditorMode = 'full' | 'compact'
|
||||
export type ExtensionCreator = (mode: TextEditorMode, ctx: any) => AnyExtension
|
||||
|
||||
Reference in New Issue
Block a user