mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 21:35:10 +00:00
feat: add shortcut to create todo in documents (#5827)
Signed-off-by: Danilo Gacevic <gacevic.danilo@gmail.com>
This commit is contained in:
parent
dfaddb86f7
commit
27454ca707
@ -50,6 +50,7 @@
|
||||
"Height": "Height",
|
||||
"Unset": "Unset",
|
||||
"Image": "Image",
|
||||
"SeparatorLine": "Separator line"
|
||||
"SeparatorLine": "Separator line",
|
||||
"TodoList": "Todo list"
|
||||
}
|
||||
}
|
||||
|
@ -308,7 +308,8 @@
|
||||
...(canEmbedImages ? [{ id: 'image', label: textEditorPlugin.string.Image, icon: view.icon.Image }] : []),
|
||||
{ id: 'table', label: textEditorPlugin.string.Table, icon: view.icon.Table2 },
|
||||
{ id: 'code-block', label: textEditorPlugin.string.CodeBlock, icon: view.icon.CodeBlock },
|
||||
{ id: 'separator-line', label: textEditorPlugin.string.SeparatorLine, icon: view.icon.SeparatorLine }
|
||||
{ id: 'separator-line', label: textEditorPlugin.string.SeparatorLine, icon: view.icon.SeparatorLine },
|
||||
{ id: 'todo-list', label: textEditorPlugin.string.TodoList, icon: view.icon.TodoList }
|
||||
],
|
||||
handleSelect: handleLeftMenuClick
|
||||
})
|
||||
@ -402,6 +403,9 @@
|
||||
)
|
||||
editor.commands.focus(pos, { scrollIntoView: false })
|
||||
break
|
||||
case 'todo-list':
|
||||
editor.commands.toggleTaskList()
|
||||
break
|
||||
case 'separator-line':
|
||||
editor.commands.setHorizontalRule()
|
||||
break
|
||||
|
@ -129,7 +129,7 @@ export const completionConfig: Partial<CompletionOptions> = {
|
||||
}
|
||||
}
|
||||
|
||||
const inlineCommandsIds = ['image', 'table', 'code-block', 'separator-line'] as const
|
||||
const inlineCommandsIds = ['image', 'table', 'code-block', 'separator-line', 'todo-list'] as const
|
||||
export type InlineCommandId = (typeof inlineCommandsIds)[number]
|
||||
|
||||
/**
|
||||
@ -146,7 +146,8 @@ export function inlineCommandsConfig (
|
||||
{ id: 'image', label: plugin.string.Image, icon: view.icon.Image },
|
||||
{ id: 'table', label: plugin.string.Table, icon: view.icon.Table2 },
|
||||
{ id: 'code-block', label: plugin.string.CodeBlock, icon: view.icon.CodeBlock },
|
||||
{ id: 'separator-line', label: plugin.string.SeparatorLine, icon: view.icon.SeparatorLine }
|
||||
{ id: 'separator-line', label: plugin.string.SeparatorLine, icon: view.icon.SeparatorLine },
|
||||
{ id: 'todo-list', label: plugin.string.TodoList, icon: view.icon.TodoList }
|
||||
].filter(({ id }) => !excludedCommands.includes(id as InlineCommandId))
|
||||
},
|
||||
command: ({ editor, range, props }: { editor: Editor, range: Range, props: any }) => {
|
||||
|
@ -81,6 +81,7 @@ export default plugin(textEditorId, {
|
||||
Height: '' as IntlString,
|
||||
Unset: '' as IntlString,
|
||||
Image: '' as IntlString,
|
||||
SeparatorLine: '' as IntlString
|
||||
SeparatorLine: '' as IntlString,
|
||||
TodoList: '' as IntlString
|
||||
}
|
||||
})
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 44 KiB |
@ -51,6 +51,7 @@ loadMetadata(view.icon, {
|
||||
Table2: `${icons}#table2`,
|
||||
CodeBlock: `${icons}#code-block`,
|
||||
SeparatorLine: `${icons}#separator-line`,
|
||||
TodoList: `${icons}#todo-list`,
|
||||
Circle: `${icons}#circle`,
|
||||
Join: `${icons}#join`,
|
||||
Leave: `${icons}#leave`,
|
||||
|
@ -248,7 +248,8 @@ const view = plugin(viewId, {
|
||||
Circle: '' as Asset,
|
||||
Join: '' as Asset,
|
||||
Leave: '' as Asset,
|
||||
Copy: '' as Asset
|
||||
Copy: '' as Asset,
|
||||
TodoList: '' as Asset
|
||||
},
|
||||
category: {
|
||||
General: '' as Ref<ActionCategory>,
|
||||
|
Loading…
Reference in New Issue
Block a user