mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 12:35:02 +02:00
Support for embedding links and references in text editor (#9003)
Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@ import {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
import type { EditorKitOptions } from '@hcengineering/text-editor-resources/src/kits/editor-kit'
|
||||
import textEditor from './plugin'
|
||||
import view from '@hcengineering/view'
|
||||
|
||||
export { textEditorOperation } from './migration'
|
||||
export { default } from './plugin'
|
||||
@@ -462,4 +463,36 @@ export function createModel (builder: Builder): void {
|
||||
category: 110,
|
||||
index: 10
|
||||
})
|
||||
|
||||
builder.createDoc(textEditor.class.TextEditorAction, core.space.Model, {
|
||||
kind: 'preview',
|
||||
action: textEditor.function.CopyPreviewLinkAction,
|
||||
icon: view.icon.Copy,
|
||||
visibilityTester: textEditor.function.ShouldShowCopyPreviewLinkAction,
|
||||
label: view.string.CopyToClipboard,
|
||||
category: 115,
|
||||
index: 10
|
||||
})
|
||||
|
||||
builder.createDoc(textEditor.class.TextEditorAction, core.space.Model, {
|
||||
kind: 'preview',
|
||||
action: textEditor.function.ConvertToLinkPreviewAction,
|
||||
icon: textEditor.icon.LinkPreview,
|
||||
visibilityTester: textEditor.function.ShouldShowConvertToLinkPreviewAction,
|
||||
isActive: textEditor.function.ConvertToLinkPreviewActionIsActive,
|
||||
label: textEditor.string.ConvertToLinkPreview,
|
||||
category: 120,
|
||||
index: 10
|
||||
})
|
||||
|
||||
builder.createDoc(textEditor.class.TextEditorAction, core.space.Model, {
|
||||
kind: 'preview',
|
||||
action: textEditor.function.ConvertToEmbedPreviewAction,
|
||||
icon: textEditor.icon.EmbedPreview,
|
||||
visibilityTester: textEditor.function.ShouldShowConvertToEmbedPreviewAction,
|
||||
isActive: textEditor.function.ConvertToEmbedPreviewActionIsActive,
|
||||
label: textEditor.string.ConvertToEmbedPreview,
|
||||
category: 120,
|
||||
index: 20
|
||||
})
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
import { mergeIds, type Resource } from '@hcengineering/platform'
|
||||
import textEditor, {
|
||||
type TextActionActiveFunction,
|
||||
type TextActionFunction,
|
||||
type TextActionVisibleFunction,
|
||||
textEditorId
|
||||
@@ -40,8 +41,20 @@ export default mergeIds(textEditorId, textEditor, {
|
||||
IsHeadingVisible: '' as Resource<TextActionVisibleFunction>,
|
||||
|
||||
CreateInlineComment: '' as Resource<TextActionFunction>,
|
||||
|
||||
ShouldShowCreateInlineCommentAction: '' as Resource<TextActionVisibleFunction>,
|
||||
|
||||
ShouldShowConvertToLinkPreviewAction: '' as Resource<TextActionVisibleFunction>,
|
||||
ConvertToLinkPreviewActionIsActive: '' as Resource<TextActionActiveFunction>,
|
||||
ConvertToLinkPreviewAction: '' as Resource<TextActionFunction>,
|
||||
|
||||
ShouldShowConvertToEmbedPreviewAction: '' as Resource<TextActionVisibleFunction>,
|
||||
ConvertToEmbedPreviewActionIsActive: '' as Resource<TextActionActiveFunction>,
|
||||
ConvertToEmbedPreviewAction: '' as Resource<TextActionFunction>,
|
||||
|
||||
ShouldShowCopyPreviewLinkAction: '' as Resource<TextActionVisibleFunction>,
|
||||
CopyPreviewLinkAction: '' as Resource<TextActionFunction>,
|
||||
|
||||
SetBackgroundColor: '' as Resource<TextActionFunction>,
|
||||
SetTextColor: '' as Resource<TextActionFunction>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user