Files
huly-platform/plugins/text-editor/src/plugin.ts
T
2d26c74874 feat(text-editor): add highlight, subscript, superscript and mathematics toolbar actions (#10627)
* feat(text-editor): add highlight action

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* feat(text-editor): add subscript and superscript actions

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* feat(text-editor): add mathematics inline and block actions

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* chore(text-editor): add mathematics and katex dependencies

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* fix(text-editor): fix eslint strict-boolean-expressions in mathematics extension

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* fix(text-editor): change max-width of toolbar to display all icons correctly

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* chore(text-editor): add subscript and superscript as direct dependencies

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* chore(text-editor): add missing locale keys for new text editor actions [temp, AI-generated]

Adds placeholder translations (English fallback) for Highlight, Subscript,  Superscript, Mathematics, and MathematicsBlock to all non-English locale files. Translations are not reviewed and should be replaced by a native speaker.

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

* fix(text-editor): fix subscript/superscript serialization and extension placement

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>

---------

Signed-off-by: ComputerCrack <github.compacter838@simplelogin.com>
Co-authored-by: ComputerCrack <github.compacter838@simplelogin.com>
2026-03-19 09:51:24 +07:00

171 lines
5.4 KiB
TypeScript

//
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2022, 2023, 2024 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
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, CollaboratorType } from './types'
/**
* @public
*/
export const textEditorId = 'text-editor' as Plugin
export default plugin(textEditorId, {
class: {
RefInputActionItem: '' as Ref<Class<RefInputActionItem>>,
TextEditorExtensionFactory: '' as Ref<Class<TextEditorExtensionFactory>>,
TextEditorAction: '' as Ref<Class<TextEditorAction>>
},
metadata: {
Collaborator: '' as Metadata<CollaboratorType>
},
string: {
TableOfContents: '' as IntlString,
Suggested: '' as IntlString,
NoItems: '' as IntlString,
Attach: '' as IntlString,
TextStyle: '' as IntlString,
Emoji: '' as IntlString,
GIF: '' as IntlString,
Mention: '' as IntlString,
Underlined: '' as IntlString,
Highlight: '' as IntlString,
Subscript: '' as IntlString,
Superscript: '' as IntlString,
Mathematics: '' as IntlString,
MathematicsBlock: '' as IntlString,
EditorPlaceholder: '' as IntlString,
Edit: '' as IntlString,
Bold: '' as IntlString,
Italic: '' as IntlString,
Strikethrough: '' as IntlString,
Link: '' as IntlString,
Save: '' as IntlString,
OrderedList: '' as IntlString,
BulletedList: '' as IntlString,
Blockquote: '' as IntlString,
Code: '' as IntlString,
CodeBlock: '' as IntlString,
Note: '' as IntlString,
ConfigureNote: '' as IntlString,
Comment: '' as IntlString,
AddComment: '' as IntlString,
AddCommentPlaceholder: '' as IntlString,
Set: '' as IntlString,
Update: '' as IntlString,
Remove: '' as IntlString,
NotePlaceholder: '' as IntlString,
SampleText: '' as IntlString,
Send: '' as IntlString,
FullDescription: '' as IntlString,
NoFullDescription: '' as IntlString,
EnableDiffMode: '' as IntlString,
AlignCenter: '' as IntlString,
AlignLeft: '' as IntlString,
AlignRight: '' as IntlString,
ViewImage: '' as IntlString,
ViewOriginal: '' as IntlString,
Download: '' as IntlString,
MoreActions: '' as IntlString,
InsertTable: '' as IntlString,
AddColumnBefore: '' as IntlString,
AddColumnAfter: '' as IntlString,
DeleteColumn: '' as IntlString,
AddRowBefore: '' as IntlString,
AddRowAfter: '' as IntlString,
MergeCells: '' as IntlString,
SplitCells: '' as IntlString,
DeleteRow: '' as IntlString,
DeleteTable: '' as IntlString,
Duplicate: '' as IntlString,
CategoryRow: '' as IntlString,
CategoryColumn: '' as IntlString,
CategoryCell: '' as IntlString,
Table: '' as IntlString,
Width: '' as IntlString,
Height: '' as IntlString,
Unset: '' as IntlString,
Image: '' as IntlString,
SeparatorLine: '' as IntlString,
TodoList: '' as IntlString,
TodoItem: '' as IntlString,
DrawingBoard: '' as IntlString,
MermaidDiargram: '' as IntlString,
TableOptions: '' as IntlString,
SelectTable: '' as IntlString,
SetCellHighlightColor: '' as IntlString,
SetTextColor: '' as IntlString,
RefreshTable: '' as IntlString,
ShowDiff: '' as IntlString,
SeeOriginalData: '' as IntlString,
CategoryVersioning: '' as IntlString,
TableDiffLabel: '' as IntlString,
TableRefreshConfirmationLabel: '' as IntlString,
ConvertToLinkPreview: '' as IntlString,
ConvertToEmbedPreview: '' as IntlString,
UnableToLoadEmbeddedContent: '' as IntlString,
SourceURL: '' as IntlString,
SelectedDocuments: '' as IntlString<{ count: number }>
},
icon: {
Header1: '' as Asset,
Header2: '' as Asset,
Header3: '' as Asset,
Underline: '' as Asset,
Strikethrough: '' as Asset,
Bold: '' as Asset,
Italic: '' as Asset,
Link: '' as Asset,
ListNumber: '' as Asset,
ListBullet: '' as Asset,
ListTodo: '' as Asset,
Quote: '' as Asset,
Code: '' as Asset,
CodeBlock: '' as Asset,
TableProps: '' as Asset,
AlignLeft: '' as Asset,
AlignCenter: '' as Asset,
AlignRight: '' as Asset,
MoreH: '' as Asset,
Expand: '' as Asset,
ScaleOut: '' as Asset,
Download: '' as Asset,
Note: '' as Asset,
Comment: '' as Asset,
SelectTable: '' as Asset,
MergeCells: '' as Asset,
SplitCells: '' as Asset,
Brush: '' as Asset,
Highlight: '' as Asset,
Subscript: '' as Asset,
Superscript: '' as Asset,
Mathematics: '' as Asset,
MathematicsBlock: '' as Asset,
TextStyle: '' as Asset,
LinkPreview: '' as Asset,
Refresh: '' as Asset,
ShowDiff: '' as Asset,
SeeOriginalData: '' as Asset,
EmbedPreview: '' as Asset
}
})