UBER-394: Update tiptap plugins (#3368)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-06-07 01:49:04 +07:00 committed by GitHub
parent 05496d8727
commit 5c9c672038
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 419 additions and 376 deletions

File diff suppressed because it is too large Load Diff

View File

@ -80,7 +80,7 @@
$PanelScrollTop[window.location.href] = 0
lastHref = window.location.href
}
}, 1)
}, 50)
}
afterUpdate(() => {

View File

@ -37,43 +37,44 @@
"@hcengineering/core": "^0.6.25",
"@hcengineering/ui": "^0.6.8",
"svelte": "3.55.1",
"@tiptap/core": "^2.0.2",
"@tiptap/pm": "^2.0.2",
"@tiptap/starter-kit": "^2.0.2",
"@tiptap/extension-highlight": "^2.0.2",
"@tiptap/extension-placeholder": "^2.0.2",
"@tiptap/extension-mention": "^2.0.2",
"@tiptap/extension-typography": "^2.0.2",
"@tiptap/extension-link": "^2.0.2",
"@tiptap/suggestion": "^2.0.2",
"@tiptap/extension-task-list": "^2.0.2",
"@tiptap/extension-task-item": "^2.0.2",
"@tiptap/extension-collaboration": "^2.0.2",
"@tiptap/extension-collaboration-cursor": "^2.0.2",
"@tiptap/prosemirror-tables": "^1.1.4",
"prosemirror-gapcursor": "^1.3.1",
"prosemirror-dropcursor": "^1.8.0",
"prosemirror-collab": "^1.3.0",
"prosemirror-state": "^1.4.2",
"prosemirror-transform": "^1.7.1",
"prosemirror-schema-list": "^1.2.2",
"prosemirror-commands": "^1.5.1",
"@tiptap/core": "^2.0.3",
"@tiptap/pm": "^2.0.3",
"@tiptap/starter-kit": "^2.0.3",
"@tiptap/extension-highlight": "^2.0.3",
"@tiptap/extension-placeholder": "^2.0.3",
"@tiptap/extension-mention": "^2.0.3",
"@tiptap/extension-typography": "^2.0.3",
"@tiptap/extension-link": "^2.0.3",
"@tiptap/suggestion": "^2.0.3",
"@tiptap/extension-task-list": "^2.0.3",
"@tiptap/extension-task-item": "^2.0.3",
"@tiptap/extension-collaboration": "^2.0.3",
"@tiptap/extension-collaboration-cursor": "^2.0.3",
"@tiptap/prosemirror-tables": "^1.1.4",
"prosemirror-gapcursor": "^1.3.2",
"prosemirror-dropcursor": "^1.8.1",
"prosemirror-collab": "^1.3.1",
"prosemirror-state": "^1.4.3",
"prosemirror-transform": "^1.7.3",
"prosemirror-schema-list": "^1.3.0",
"prosemirror-commands": "^1.5.2",
"yjs": "^13.5.52",
"y-websocket": "^1.5.0",
"y-prosemirror": "^1.2.1",
"prosemirror-changeset": "^2.2.0",
"prosemirror-model": "^1.19.0",
"prosemirror-view": "^1.30.2",
"prosemirror-history": "^1.3.0",
"prosemirror-keymap": "^1.2.1",
"prosemirror-changeset": "^2.2.1",
"prosemirror-model": "^1.19.2",
"prosemirror-view": "^1.31.4",
"prosemirror-history": "^1.3.2",
"prosemirror-keymap": "^1.2.2",
"rfc6902": "^5.0.1",
"diff": "^5.1.0",
"@tiptap/extension-code-block": "^2.0.2",
"@tiptap/extension-gapcursor": "^2.0.2",
"@tiptap/extension-heading": "^2.0.2",
"@tiptap/extension-table": "^2.0.2",
"@tiptap/extension-table-cell": "^2.0.2",
"@tiptap/extension-table-header": "^2.0.2",
"@tiptap/extension-table-row": "^2.0.2"
"@tiptap/extension-code-block": "^2.0.3",
"@tiptap/extension-gapcursor": "^2.0.3",
"@tiptap/extension-heading": "^2.0.3",
"@tiptap/extension-table": "^2.0.3",
"@tiptap/extension-table-cell": "^2.0.3",
"@tiptap/extension-table-header": "^2.0.3",
"@tiptap/extension-table-row": "^2.0.3",
"@tiptap/extension-code": "^2.0.3"
}
}

View File

@ -196,6 +196,9 @@
}
function updateFormattingState () {
if (textEditor?.checkIsActive === undefined) {
return
}
activeModes = new Set(FORMAT_MODES.filter(textEditor.checkIsActive))
isSelectionEmpty = textEditor.checkIsSelectionEmpty()
}

View File

@ -231,6 +231,9 @@
})
function updateFormattingState () {
if (textEditor?.checkIsActive === undefined) {
return
}
activeModes = new Set(FORMAT_MODES.filter(textEditor.checkIsActive))
for (const l of headingLevels) {
if (textEditor.checkIsActive('heading', { level: l })) {

View File

@ -18,7 +18,6 @@
import type { FocusPosition } from '@tiptap/core'
import { AnyExtension, Editor, Extension, HTMLContent } from '@tiptap/core'
// import Typography from '@tiptap/extension-typography'
import { Level } from '@tiptap/extension-heading'
import Placeholder from '@tiptap/extension-placeholder'
import { createEventDispatcher, onDestroy, onMount } from 'svelte'
@ -244,6 +243,7 @@
<style lang="scss" global>
.ProseMirror {
overflow-y: auto;
font: inherit;
min-height: inherit !important;
max-height: inherit !important;
outline: none;

View File

@ -11,6 +11,7 @@ import Highlight from '@tiptap/extension-highlight'
import StarterKit from '@tiptap/starter-kit'
import TipTapCodeBlock from '@tiptap/extension-code-block'
import Code from '@tiptap/extension-code'
import Gapcursor from '@tiptap/extension-gapcursor'
import Link from '@tiptap/extension-link'
@ -18,6 +19,8 @@ import { CompletionOptions } from '../Completion'
import MentionList from './MentionList.svelte'
import { SvelteRenderer } from './SvelteRenderer'
import { ImageRef } from './imageExt'
import Typography from '@tiptap/extension-typography'
import { AnyExtension } from '@tiptap/core'
export const tableExtensions = [
Table.configure({
@ -43,7 +46,7 @@ export const taskListExtensions = [
export const headingLevels: Level[] = [1, 2, 3, 4, 5, 6]
export const defaultExtensions = [
export const defaultExtensions: AnyExtension[] = [
StarterKit,
Highlight.configure({
multicolor: false
@ -56,6 +59,12 @@ export const defaultExtensions = [
class: 'code-block'
}
}),
Code.configure({
HTMLAttributes: {
class: 'proseCode'
}
}),
Typography.configure({}),
Gapcursor,
Heading.configure({
levels: headingLevels

View File

@ -45,3 +45,27 @@ table.proseTable {
margin: 0;
}
}
.theme-dark .proseCode {
padding: 0px 4px;
color: #EB7861;
/* Button/Theme Dark/Default */
background: rgba(255, 255, 255, 0.02);
/* Button/Theme Dark/Stroke */
border: 1px solid rgba(255, 255, 255, 0.09);
border-radius: 4px;
}
.theme-light .proseCode {
padding: 0px 4px;
color: #377AE6;
/* Button/Theme Light/Default */
background: rgba(0, 0, 0, 0.02);
/* Button/Theme Light/Stroke */
border: 1px solid rgba(0, 0, 0, 0.09);
border-radius: 4px;
}

View File

@ -84,6 +84,7 @@
enableBackReferences={true}
bind:this={descriptionBox}
useAttachmentPreview={false}
isScrollable={false}
objectId={object._id}
_class={object._class}
space={object.space}

View File

@ -44,6 +44,7 @@
export let focusIndex: number | undefined = -1
export let enableAttachments: boolean = true
export let enableBackReferences: boolean = false
export let isScrollable = true
let draftKey = objectId ? `${objectId}_attachments` : undefined
$: draftKey = objectId ? `${objectId}_attachments` : undefined
@ -356,6 +357,7 @@
{focusable}
{kind}
{enableBackReferences}
{isScrollable}
on:changeSize
on:changeContent
on:blur

View File

@ -93,7 +93,7 @@ const shutdown = start(url, {
port: serverPort,
serverFactory,
indexParallel: 2,
indexProcessing: 500,
indexProcessing: 50,
productId: '',
enableCompression
})