UBERF-6068 Show collaborators in collaborative editors (#5335)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2024-04-15 18:11:47 +07:00
committed by GitHub
parent 07ff2a9d3c
commit 2220d7e19e
24 changed files with 296 additions and 69 deletions
@@ -15,8 +15,9 @@
//
-->
<script lang="ts">
import { Extensions, FocusPosition } from '@tiptap/core'
import contact from '@hcengineering/contact'
import { Document } from '@hcengineering/document'
import { getResource } from '@hcengineering/platform'
import {
CollaboratorEditor,
HeadingsExtension,
@@ -25,6 +26,9 @@
TodoItemExtension,
TodoListExtension
} from '@hcengineering/text-editor'
import { AnySvelteComponent } from '@hcengineering/ui'
import { getCollaborationUser } from '@hcengineering/view-resources'
import { Extensions, FocusPosition } from '@tiptap/core'
import { createEventDispatcher } from 'svelte'
import ToDoItemNodeView from './node-view/ToDoItemNodeView.svelte'
@@ -38,6 +42,12 @@
export let overflow: 'auto' | 'none' = 'none'
export let editorAttributes: Record<string, string> = {}
const user = getCollaborationUser()
let userComponent: AnySvelteComponent | undefined
void getResource(contact.component.CollaborationUserAvatar).then((component) => {
userComponent = component
})
let collabEditor: CollaboratorEditor
export function focus (position?: FocusPosition): void {
@@ -83,6 +93,8 @@
objectClass={object._class}
objectId={object._id}
objectAttr="content"
{user}
{userComponent}
{focusIndex}
{readonly}
{attachFile}