From 85c98ead17cd7728c09ac23ad39d01b7daff8b38 Mon Sep 17 00:00:00 2001 From: Alexander Onnikov Date: Mon, 8 Jan 2024 21:20:28 +0700 Subject: [PATCH] EZQMS-495 Hide styling buttons in readonly mode (#4321) Signed-off-by: Alexander Onnikov --- .../src/components/CollaboratorEditor.svelte | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/text-editor/src/components/CollaboratorEditor.svelte b/packages/text-editor/src/components/CollaboratorEditor.svelte index 73d53a27aa..48ad9af70d 100644 --- a/packages/text-editor/src/components/CollaboratorEditor.svelte +++ b/packages/text-editor/src/components/CollaboratorEditor.svelte @@ -22,7 +22,7 @@ import textEditorPlugin from '../plugin' import { DocumentId } from '../provider' - import { TextEditorCommandHandler, TextNodeAction } from '../types' + import { TextEditorCommandHandler, TextFormatCategory, TextNodeAction } from '../types' import CollaborativeTextEditor from './CollaborativeTextEditor.svelte' import { FileAttachFunction } from './extension/imageExt' @@ -171,6 +171,17 @@ {overflow} {boundary} {attachFile} + textFormatCategories={readonly + ? [] + : [ + TextFormatCategory.Heading, + TextFormatCategory.TextDecoration, + TextFormatCategory.Link, + TextFormatCategory.List, + TextFormatCategory.Quote, + TextFormatCategory.Code, + TextFormatCategory.Table + ]} extensions={[...onExtensions()]} {textNodeActions} {canShowPopups}