Skip to content

Commit

Permalink
UBERF-7579: Text editor actions (#6103)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Zinoviev <[email protected]>
  • Loading branch information
lexiv0re authored Jul 25, 2024
1 parent 1448782 commit fba1469
Show file tree
Hide file tree
Showing 48 changed files with 1,517 additions and 1,110 deletions.
23 changes: 11 additions & 12 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion models/controlled-documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"@hcengineering/training": "^0.1.0",
"@hcengineering/notification": "^0.6.23",
"@hcengineering/model-notification": "^0.6.0",
"@hcengineering/chunter": "^0.6.20"
"@hcengineering/chunter": "^0.6.20",
"@hcengineering/text-editor": "^0.6.0"
}
}
14 changes: 14 additions & 0 deletions models/controlled-documents/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import notification from '@hcengineering/notification'
import setting from '@hcengineering/setting'
import tags from '@hcengineering/tags'
import print from '@hcengineering/model-print'
import textEditor from '@hcengineering/text-editor'

import documents from './plugin'
import { definePermissions } from './permissions'
Expand Down Expand Up @@ -866,6 +867,7 @@ export function createModel (builder: Builder): void {
definePermissions(builder)
defineNotifications(builder)
defineSearch(builder)
defineTextActions(builder)
}

export function defineNotifications (builder: Builder): void {
Expand Down Expand Up @@ -1018,5 +1020,17 @@ export function defineSearch (builder: Builder): void {
)
}

export function defineTextActions (builder: Builder): void {
// Comment category
builder.createDoc(textEditor.class.TextEditorAction, core.space.Model, {
action: documents.function.Comment,
icon: chunter.icon.Chunter,
visibilityTester: documents.function.IsCommentVisible,
label: chunter.string.Message,
category: 100,
index: 5
})
}

export { documentsOperation } from './migration'
export { documents as default }
7 changes: 6 additions & 1 deletion models/controlled-documents/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { type TagCategory } from '@hcengineering/tags'
import { type AnyComponent } from '@hcengineering/ui'
import { type ActionCategory, type ViewAction } from '@hcengineering/view'
import { type NotificationType, type NotificationGroup } from '@hcengineering/notification'
import { type TextActionVisibleFunction, type TextActionFunction } from '@hcengineering/text-editor'

export default mergeIds(documentsId, documents, {
component: {
Expand Down Expand Up @@ -55,7 +56,11 @@ export default mergeIds(documentsId, documents, {
OtherTemplate: '' as Ref<TagCategory>
},
function: {
DocumentIdentifierProvider: '' as Resource<<T extends Doc>(client: Client, ref: Ref<T>, doc?: T) => Promise<string>>
DocumentIdentifierProvider: '' as Resource<
<T extends Doc>(client: Client, ref: Ref<T>, doc?: T) => Promise<string>
>,
Comment: '' as Resource<TextActionFunction>,
IsCommentVisible: '' as Resource<TextActionVisibleFunction>
},
actionImpl: {
AddCollaborativeSectionAbove: '' as ViewAction,
Expand Down
3 changes: 2 additions & 1 deletion models/text-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"@typescript-eslint/parser": "^6.11.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"prettier": "^3.1.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"@hcengineering/text-editor-resources": "^0.6.0"
},
"dependencies": {
"@hcengineering/core": "^0.6.32",
Expand Down
Loading

0 comments on commit fba1469

Please sign in to comment.