From 257c19f7130bd78728f69efb0407a69904e44fb1 Mon Sep 17 00:00:00 2001 From: "marcelino.braga" Date: Wed, 5 Jun 2024 17:34:42 -0300 Subject: [PATCH 1/6] =?UTF-8?q?refact:=20melhorias=20na=20apar=C3=AAncia?= =?UTF-8?q?=20do=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/public/index.html | 3 ++- src/public/style.css | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/public/index.html b/src/public/index.html index e8e090b..051dfed 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -40,7 +40,7 @@
-
+
@@ -71,6 +71,7 @@ }) window.editor = exitusEditor + window.editor2 = exitusEditor2 diff --git a/src/public/style.css b/src/public/style.css index 0307526..9bd8f9a 100644 --- a/src/public/style.css +++ b/src/public/style.css @@ -30,6 +30,7 @@ .tiptap { box-sizing: border-box; + border: 1px hsl(0, 0%, 82.7%) solid; } .tiptap { @@ -147,6 +148,7 @@ outline-color: transparent; outline-style: solid; outline-width: 3px; + user-select: auto; /* transition: outline-color 200ms ease; */ } @@ -897,6 +899,10 @@ } } +.tiptap-widget > table { + cursor: text +} + .ex-bolinha-cima { top: 0; transform: translate(215%,-86%); From bd3c5b2dd1a58947b498d7d5164f73ca9f48d356 Mon Sep 17 00:00:00 2001 From: "marcelino.braga" Date: Wed, 5 Jun 2024 17:35:04 -0300 Subject: [PATCH 2/6] refact: melhoria de codigo --- src/extensions/image/image.ts | 2 -- src/extensions/image/imageView.ts | 3 +-- src/extensions/mathtype/mathtype.ts | 5 ----- src/extensions/table/TableView.ts | 2 -- 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/extensions/image/image.ts b/src/extensions/image/image.ts index 50ee884..9e4bdb2 100644 --- a/src/extensions/image/image.ts +++ b/src/extensions/image/image.ts @@ -244,7 +244,6 @@ export const Image = Node.create({ .map(item => item.getAsFile()) if (images.length !== 0) event.preventDefault() images.forEach(image => parseImagesToBase64(image as File, self.editor)) - console.log(images) }, handleDOMEvents: { drop: (view, event) => { @@ -256,7 +255,6 @@ export const Image = Node.create({ if (images.length === 0) { return false } - console.log(images) images.forEach(image => parseImagesToBase64(image, self.editor)) event.preventDefault() diff --git a/src/extensions/image/imageView.ts b/src/extensions/image/imageView.ts index a3afd08..f098907 100644 --- a/src/extensions/image/imageView.ts +++ b/src/extensions/image/imageView.ts @@ -1,13 +1,13 @@ import { Toolbar } from '@editor/toolbar' import { Button, type ButtonEventProps, Dropdown, type DropDownEventProps } from '@editor/ui' import { Balloon, BalloonPosition } from '@editor/ui/Balloon' -import { type Node as ProseMirrorNode } from '@tiptap/pm/model' import arrowDropDown from '@icons/arrow-drop-down-line.svg' import textDl from '@icons/image-left.svg' import textDm from '@icons/image-middle.svg' import textDr from '@icons/image-right.svg' import imgSize from '@icons/image-size.svg' import { type Editor } from '@tiptap/core' +import { type Node as ProseMirrorNode } from '@tiptap/pm/model' import { type Node } from '@tiptap/pm/model' import { type NodeView } from '@tiptap/pm/view' import type ExitusEditor from 'src/ExitusEditor' @@ -223,7 +223,6 @@ export class ImageView implements NodeView { this.setImageAttributes(this.image, node) const imageUrlRegex = /(https?:\/\/.*\.(?:png|jpg|jpeg|gif|bmp|webp|svg))/i - //console.log(imageUrlRegex.test(node.attrs.src)) if (imageUrlRegex.test(node.attrs.src)) { this.urlToBase64() diff --git a/src/extensions/mathtype/mathtype.ts b/src/extensions/mathtype/mathtype.ts index 3ad045c..6f1f00f 100644 --- a/src/extensions/mathtype/mathtype.ts +++ b/src/extensions/mathtype/mathtype.ts @@ -225,10 +225,5 @@ export const MathType = Node.create({ onDestroy() { this.storage.currentInstances.get(this.editor.editorInstance).destroy() this.storage.currentInstances.delete(this.editor.editorInstance) - }, - addOptions() { - return { - currentInstance: null - } } }) diff --git a/src/extensions/table/TableView.ts b/src/extensions/table/TableView.ts index f0df526..6db3115 100644 --- a/src/extensions/table/TableView.ts +++ b/src/extensions/table/TableView.ts @@ -248,7 +248,5 @@ export class TableView implements NodeView { function updateTableStyle(tableView: TableView) { const { table, tableWrapperStyle, tableWrapper, tableStyle } = tableView table.setAttribute('style', objParaCss(tableStyle)) - console.log(tableWrapperStyle, objParaCss(tableWrapperStyle)) - tableWrapper.setAttribute('style', objParaCss(tableWrapperStyle)) } From 4be8fd3bb630bc54a69bf20428e8038349ece14d Mon Sep 17 00:00:00 2001 From: "marcelino.braga" Date: Fri, 7 Jun 2024 16:40:02 -0300 Subject: [PATCH 3/6] =?UTF-8?q?refact:=20atualiza=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/utils.ts | 41 +++++++++++++++++++++++++++--- src/extensions/katex/katexView.ts | 3 ++- src/extensions/table/TableView.ts | 4 +-- src/extensions/table/tableFocus.ts | 23 ++++++++--------- 4 files changed, 53 insertions(+), 18 deletions(-) diff --git a/src/editor/utils.ts b/src/editor/utils.ts index d01ca18..cf60de7 100644 --- a/src/editor/utils.ts +++ b/src/editor/utils.ts @@ -1,6 +1,7 @@ import { type ChainedCommands, type Editor } from '@tiptap/core' import { type Node } from '@tiptap/pm/model' import { TextSelection } from '@tiptap/pm/state' +import { Fragment } from 'prosemirror-model' export function createHTMLElement(tagName: string, attributes: { [x: string]: string }, childrens?: Element[]): T { // Create the element @@ -23,9 +24,42 @@ export function createHTMLElement(tagName: string, attributes: { [x return element as T } -export function setCaretAfterNode(editor: Editor, targetNode: Node) { - const { state, view } = editor - const { doc, tr } = state +export function insertParagraph(editor: Editor, position: number, before = false) { + const { view } = editor + const { tr, schema } = view.state + + const paragraph = schema.nodes.paragraph.create() + + const insertPos = before ? position : position + 1 + + tr.insert(insertPos, Fragment.from(paragraph)) + + const newPos = before ? insertPos : insertPos + 1 + + // Set selection to new paragraph + const transaction = tr.setSelection(TextSelection.create(tr.doc, newPos)) + + view.dispatch(transaction) +} + +export function findNodePosition(editor: Editor, targetNode: Node) { + const { doc } = editor.view.state + let position = -1 + + doc.descendants((node, pos) => { + if (node === targetNode) { + position = pos + return false // Stop traversing + } + return true + }) + + return position +} + +export function setSelectionAfter(editor: Editor, targetNode: Node) { + const { view } = editor + const { doc, tr } = view.state // Find the position of the target node let targetPos = null @@ -41,6 +75,7 @@ export function setCaretAfterNode(editor: Editor, targetNode: Node) { const selection = TextSelection.create(doc, targetPos) const transaction = tr.setSelection(selection) view.dispatch(transaction) + view.focus() } else { console.error('Node not found in the document') } diff --git a/src/extensions/katex/katexView.ts b/src/extensions/katex/katexView.ts index 15fede8..3cd63d3 100644 --- a/src/extensions/katex/katexView.ts +++ b/src/extensions/katex/katexView.ts @@ -1,5 +1,5 @@ import { BalloonPosition } from '@editor/ui/Balloon' -import { createHTMLElement } from '@editor/utils' +import { createHTMLElement, setSelectionAfter } from '@editor/utils' import { type Editor } from '@tiptap/core' import { type Node as ProseMirrorNode } from '@tiptap/pm/model' import { type NodeView } from '@tiptap/pm/view' @@ -52,6 +52,7 @@ export class KatexView implements NodeView { latexFormula: input.value, display: checkboxDisplay.checked }) + setSelectionAfter(this.editor, this.node) } function cancelBalloon(this: KatexView) { diff --git a/src/extensions/table/TableView.ts b/src/extensions/table/TableView.ts index 6db3115..2203efd 100644 --- a/src/extensions/table/TableView.ts +++ b/src/extensions/table/TableView.ts @@ -129,8 +129,8 @@ export class TableView implements NodeView { updateColumns(node, this.colgroup, this.table, this.cellMinWidth) this.contentDOM = this.table.appendChild(document.createElement('tbody')) - new TableFocus(this) - new UpDownTable(this) + new TableFocus(this, this.editor) + new UpDownTable(this, this.editor) const configStorage = { celumnsTable: { diff --git a/src/extensions/table/tableFocus.ts b/src/extensions/table/tableFocus.ts index 3e46a0b..4d2afe8 100644 --- a/src/extensions/table/tableFocus.ts +++ b/src/extensions/table/tableFocus.ts @@ -1,4 +1,5 @@ import { Button } from '@editor/ui' +import { insertParagraph } from '@editor/utils' import setaCima from '@icons/corner-down-left-line.svg' import setaBaixo from '@icons/corner-down-right-line.svg' import selecionaIcon from '@icons/select-all.svg' @@ -11,9 +12,11 @@ export class UpDownTable { tableView: TableView FocarCima!: HTMLElement FocarBaixo!: HTMLElement + editor: ExitusEditor constructor(tableView: TableView, editor: ExitusEditor) { this.tableView = tableView + this.editor = editor this.focaTabela(editor) } @@ -22,28 +25,24 @@ export class UpDownTable { element.style.position = 'relative' const botaoCima = this.createButton(editor, setaCima, () => { - this.moveAlvoParaCima() + if (typeof this.tableView.getPos == 'function') { + const pos = this.tableView.getPos() + insertParagraph(this.editor, pos, true) + } }) this.FocarCima = element.appendChild(botaoCima) this.FocarCima.classList.add('ex-bolinha', 'ex-bolinha-cima') const botaoBaixo = this.createButton(editor, setaBaixo, () => { - this.moveAlvoParaBaixo() + if (typeof this.tableView.getPos == 'function') { + const pos = this.tableView.getPos() as number + insertParagraph(this.editor, pos + this.tableView.node.nodeSize) + } }) this.FocarBaixo = element.appendChild(botaoBaixo) this.FocarBaixo.classList.add('ex-bolinha', 'ex-bolinha-baixo') } - private moveAlvoParaCima() { - const paragrafo = '

' - this.tableView.dom.insertAdjacentHTML('beforebegin', paragrafo) - } - - private moveAlvoParaBaixo() { - const paragrafo = '

' - this.tableView.dom.insertAdjacentHTML('afterend', paragrafo) - } - private createButton(editor: ExitusEditor, icone: string, onClick: () => void): HTMLElement { const button = new Button(editor, { icon: icone, From 1d9ce21614153f1fc1973701fb7cf761b2cefd17 Mon Sep 17 00:00:00 2001 From: "marcelino.braga" Date: Sat, 8 Jun 2024 00:56:09 -0300 Subject: [PATCH 4/6] refact: table-cell command --- .../extension-table-cell/src/table-cell.ts | 10 +++++----- src/extensions/table/itensModalCell.ts | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/extensions/extension-table-cell/src/table-cell.ts b/src/extensions/extension-table-cell/src/table-cell.ts index c0e7010..451b4bf 100644 --- a/src/extensions/extension-table-cell/src/table-cell.ts +++ b/src/extensions/extension-table-cell/src/table-cell.ts @@ -1,4 +1,3 @@ -//@ts-nocheck import { objParaCss } from '@extensions/table' import { mergeAttributes, Node } from '@tiptap/core' import { type DOMOutputSpec } from '@tiptap/pm/model' @@ -37,10 +36,11 @@ export function cssParaObj(cssString: string): { [key: string]: string } { return styles } + declare module '@tiptap/core' { interface Commands { tableCell: { - setCellAttribute: (attributes: { [key: string]: any }) => ReturnType + setCellAttributes: (attributes: { [key: string]: any }) => ReturnType } } } @@ -100,8 +100,7 @@ export const TableCell = Node.create({ }, addCommands() { return { - ...this.parent?.(), - setCellAttribute: + setCellAttributes: (attributes: { [key: string]: any }) => ({ state, dispatch, tr }) => { const { nodeAfter, pos } = selectionCell(state) @@ -116,9 +115,10 @@ export const TableCell = Node.create({ if (dispatch) { tr.setNodeMarkup(pos, undefined, attrs) dispatch(tr) + return true } - return true + return false } } } diff --git a/src/extensions/table/itensModalCell.ts b/src/extensions/table/itensModalCell.ts index dd53880..07a85a7 100644 --- a/src/extensions/table/itensModalCell.ts +++ b/src/extensions/table/itensModalCell.ts @@ -230,19 +230,19 @@ export class ItensModalCell { bloco8.className = 'ex-bloco8' const TableEsquerda = createButton(this.editor, textDl, () => { - ;(this.editor.commands as any).setCellAttribute({ + this.editor.commands.setCellAttributes({ 'vertical-align': 'top' }) }) const TableMeio = createButton(this.editor, textDm, () => { - ;(this.editor.commands as any).setCellAttribute({ + this.editor.commands.setCellAttributes({ 'vertical-align': 'middle' }) }) const TableDireito = createButton(this.editor, textDr, () => { - ;(this.editor.commands as any).setCellAttribute({ + this.editor.commands.setCellAttributes({ 'vertical-align': 'bottom' }) }) @@ -278,7 +278,7 @@ export class ItensModalCell { // Botão de cancelar const botaoCancela = createButton(this.editor, 'Cancelar', () => { - this.editor.commands.setCellAttribute({ + this.editor.commands.setCellAttributes({ height: '', width: '', background: '', @@ -303,7 +303,7 @@ export class ItensModalCell { const largura = this.larguraBloco1.value if (selectedValue && cor && largura) { - this.editor.commands.setCellAttribute({ + this.editor.commands.setCellAttributes({ border: `${largura}px ${selectedValue} ${cor}` }) } @@ -313,7 +313,7 @@ export class ItensModalCell { const cor2 = this.inputBackgroundColor2.value if (cor2) { - this.editor.commands.setCellAttribute({ + this.editor.commands.setCellAttributes({ background: cor2 }) } @@ -323,7 +323,7 @@ export class ItensModalCell { const altura = this.inputAltura.value const largura = this.inputLargura.value if (altura && largura) { - this.editor.commands.setCellAttribute({ + this.editor.commands.setCellAttributes({ height: `${altura}em`, width: `${largura}em` }) From 1ab385c546c1648519760eeedd16bd1ffed6af4f Mon Sep 17 00:00:00 2001 From: "marcelino.braga" Date: Sat, 8 Jun 2024 00:57:32 -0300 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20corre=C3=A7=C3=A3o=20dos=20dropdowns?= =?UTF-8?q?=20n=C3=A3o=20estarem=20sendo=20fechados=20perder=20focus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/ui/Dropdown.ts | 4 ++-- src/extensions/listitem/listItem.ts | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/editor/ui/Dropdown.ts b/src/editor/ui/Dropdown.ts index c8c4b0e..7952f68 100644 --- a/src/editor/ui/Dropdown.ts +++ b/src/editor/ui/Dropdown.ts @@ -69,13 +69,13 @@ export class Dropdown implements Tool { this.dropdownContentContainer.style.display = 'none' } - render() { + render() { this.button.bind('click', ({ editor, event, button }) => { this.config.events['open']({ editor, event, button, dropdown: this }) const close = (event: Event) => { const target = event.target as HTMLElement - if (target.closest('.dropdown')) { + if (!target.closest('.dropdown')) { this.off() window.removeEventListener('click', close) } diff --git a/src/extensions/listitem/listItem.ts b/src/extensions/listitem/listItem.ts index a51efac..475612c 100644 --- a/src/extensions/listitem/listItem.ts +++ b/src/extensions/listitem/listItem.ts @@ -1,4 +1,4 @@ -import { Button, Dropdown } from '@editor/ui' +import { Button, DropDownEventProps, Dropdown } from '@editor/ui' import arrowDropDown from '@icons/arrow-drop-down-line.svg' import listFullIcon from '@icons/list-check.svg' import listOrederedIcon from '@icons/list-ordered-2.svg' @@ -46,7 +46,7 @@ function createDropDownContent(editor: ExitusEditor, dropdown: Dropdown) { return dropdownContent } -function showDropdown({ event, dropdown }: any) { +function showDropdown({ event, dropdown }: DropDownEventProps) { event.stopPropagation() if (dropdown.isOpen) { dropdown.off() @@ -65,13 +65,6 @@ function listItemDropDown({ editor }: any) { dropdown.setDropDownContent(createDropDownContent(editor, dropdown)) - window.addEventListener('click', function (event: Event) { - const target = event.target as HTMLElement - if (!target.matches('.dropdown')) { - dropdown.off() - } - }) - return dropdown } From 3d60156d614ce1597a372e092e10ff915882e549 Mon Sep 17 00:00:00 2001 From: marcelinombb Date: Sun, 9 Jun 2024 15:06:54 -0300 Subject: [PATCH 6/6] =?UTF-8?q?refact:=20corre=C3=A7=C3=B5es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 458 ++++++++---------- src/editor/ui/Balloon.ts | 4 +- src/editor/ui/Dropdown.ts | 4 +- src/editor/utils.ts | 2 +- .../extension-table-cell/src/table-cell.ts | 11 +- src/extensions/image/imageView.ts | 4 +- src/extensions/katex/katex.ts | 4 +- src/extensions/katex/katexBalloon.ts | 4 +- src/extensions/katex/katexView.ts | 3 +- src/extensions/table/TableView.ts | 35 +- src/extensions/table/index.ts | 1 + src/extensions/table/itensModalCell.ts | 41 +- src/extensions/table/itensModalTable.ts | 2 +- 13 files changed, 255 insertions(+), 318 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c7b434..16b85d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,12 +66,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.6.tgz", - "integrity": "sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.24.6", + "@babel/highlight": "^7.24.7", "picocolors": "^1.0.0" }, "engines": { @@ -79,21 +79,21 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", - "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.6.tgz", - "integrity": "sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.6", + "@babel/helper-validator-identifier": "^7.24.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -198,9 +198,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", - "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", + "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -1000,9 +1000,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.1.tgz", - "integrity": "sha512-ej0phymbFLoCB26dbbq5PGScsf2JAJ4IJHjG10LalgUV36XKTmA4GdA+PVllKvRk0sEKt64X8975qFnkSi0hqA==", + "version": "4.19.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.3.tgz", + "integrity": "sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==", "dev": true, "dependencies": { "@types/node": "*", @@ -1051,9 +1051,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", - "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1630,9 +1630,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", - "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", @@ -2080,9 +2080,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001624", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001624.tgz", - "integrity": "sha512-0dWnQG87UevOCPYaOR49CBcLBwoZLpws+k6W37nLjWUhumP1Isusj0p2u+3KhjNloRWK9OKMgjBBzPujQHw4nA==", + "version": "1.0.30001629", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001629.tgz", + "integrity": "sha512-c3dl911slnQhmxUIT4HhYzT7wnBK/XYpGnYLOj4nJBaRiw52Ibe7YxlDaAeRECvA786zCuExhxIUJ2K7nHMrBw==", "dev": true, "funding": [ { @@ -2152,9 +2152,9 @@ } }, "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", "dev": true, "engines": { "node": ">=6.0" @@ -2332,34 +2332,6 @@ "webpack": "^5.1.0" } }, - "node_modules/copy-webpack-plugin/node_modules/ajv": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", - "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/copy-webpack-plugin/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, "node_modules/copy-webpack-plugin/node_modules/globby": { "version": "14.0.1", "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", @@ -2380,12 +2352,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/copy-webpack-plugin/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/copy-webpack-plugin/node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -2398,25 +2364,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/copy-webpack-plugin/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/copy-webpack-plugin/node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", @@ -2579,9 +2526,9 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -2766,9 +2713,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.783", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.783.tgz", - "integrity": "sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ==", + "version": "1.4.796", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.796.tgz", + "integrity": "sha512-NglN/xprcM+SHD2XCli4oC6bWe6kHoytcyLKCWXmRL854F0qhPhaYgUswUsglnPxYaNQIg2uMY4BvaomIf3kLA==", "dev": true }, "node_modules/emoji-regex": { @@ -2796,9 +2743,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.16.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.16.1.tgz", - "integrity": "sha512-4U5pNsuDl0EhuZpq46M5xPslstkviJuhrdobaRDBk2Jy2KO37FDAJl4lb2KlNabxT0m4MTK2UHNrsAcphE8nyw==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", + "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -4846,9 +4793,9 @@ } }, "node_modules/jackspeak": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.1.2.tgz", - "integrity": "sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", + "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -4893,9 +4840,9 @@ } }, "node_modules/jiti": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz", - "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==", + "version": "1.21.3", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.3.tgz", + "integrity": "sha512-uy2bNX5zQ+tESe+TiC7ilGRz8AtRGmnJH55NC5S0nSUjvvvM2hJHmefHErugGXN4pNv4Qx7vLsnNw9qJ9mtIsw==", "dev": true, "bin": { "jiti": "bin/jiti.js" @@ -4944,15 +4891,15 @@ "dev": true }, "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.0" - }, "bin": { "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/katex": { @@ -5034,6 +4981,20 @@ "node": ">=6.11.5" } }, + "node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5916,9 +5877,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.1.tgz", + "integrity": "sha512-7CAwy5dRsxs8PHXT3twixW9/OEll8MLE0VRPCJyl7CkS6VHGPSlsVaWTiASPTyGyYRyApxlaWTzwUxVNrhcwDg==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -6045,9 +6006,9 @@ } }, "node_modules/prosemirror-model": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.21.0.tgz", - "integrity": "sha512-zLpS1mVCZLA7VTp82P+BfMiYVPcX1/z0Mf3gsjKZtzMWubwn2pN7CceMV0DycjlgE5JeXPR7UF4hJPbBV98oWA==", + "version": "1.21.1", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.21.1.tgz", + "integrity": "sha512-IVBAuMqOfltTr7yPypwpfdGT+6rGAteVOw2FO6GEvCGGa1ZwxLseqC1Eax/EChDvG/xGquB2d/hLdgh3THpsYg==", "dependencies": { "orderedmap": "^2.0.0" } @@ -6125,9 +6086,9 @@ } }, "node_modules/prosemirror-view": { - "version": "1.33.6", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.6.tgz", - "integrity": "sha512-zRLUNgLIQfd8IfGprsXxWTjdA8xEAFJe8cDNrOptj6Mop9sj+BMeVbJvceyAYCm5G2dOdT2prctH7K9dfnpIMw==", + "version": "1.33.7", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.7.tgz", + "integrity": "sha512-jo6eMQCtPRwcrA2jISBCnm0Dd2B+szS08BU1Ay+XGiozHo5EZMHfLQE8R5nO4vb1spTH2RW1woZIYXRiQsuP8g==", "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", @@ -6270,30 +6231,22 @@ "webpack": "^4.0.0 || ^5.0.0" } }, - "node_modules/raw-loader/node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/raw-loader/node_modules/loader-utils": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", - "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "node_modules/raw-loader/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dev": true, "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^2.1.2" + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" }, "engines": { - "node": ">=8.9.0" + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, "node_modules/readable-stream": { @@ -6577,23 +6530,58 @@ "dev": true }, "node_modules/schema-utils": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", - "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", + "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.8", - "ajv": "^6.12.5", - "ajv-keywords": "^3.5.2" + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" }, "engines": { - "node": ">= 10.13.0" + "node": ">= 12.13.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/webpack" } }, + "node_modules/schema-utils/node_modules/ajv": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", + "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.4.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/schema-utils/node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/schema-utils/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/select-hose": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", @@ -6916,12 +6904,12 @@ } }, "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/source-map-js": { @@ -6943,6 +6931,15 @@ "source-map": "^0.6.0" } }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/spdy": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", @@ -7226,9 +7223,9 @@ } }, "node_modules/terser": { - "version": "5.31.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", - "integrity": "sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==", + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", + "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -7277,6 +7274,24 @@ } } }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/terser/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -7376,15 +7391,6 @@ "webpack": "^5.0.0" } }, - "node_modules/ts-loader/node_modules/source-map": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", - "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/tsconfig-paths": { "version": "3.15.0", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", @@ -7397,10 +7403,22 @@ "strip-bom": "^3.0.0" } }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true }, "node_modules/type-check": { @@ -7810,59 +7828,6 @@ } } }, - "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", - "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-middleware/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, - "node_modules/webpack-dev-middleware/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, - "node_modules/webpack-dev-middleware/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/webpack-dev-server": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.4.tgz", @@ -7922,34 +7887,6 @@ } } }, - "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.14.0.tgz", - "integrity": "sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/webpack-dev-server/node_modules/ajv-keywords": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", - "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3" - }, - "peerDependencies": { - "ajv": "^8.8.2" - } - }, "node_modules/webpack-dev-server/node_modules/glob": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", @@ -7972,12 +7909,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/webpack-dev-server/node_modules/json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true - }, "node_modules/webpack-dev-server/node_modules/minimatch": { "version": "9.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", @@ -8011,25 +7942,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/webpack-dev-server/node_modules/schema-utils": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.2.0.tgz", - "integrity": "sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "ajv": "^8.9.0", - "ajv-formats": "^2.1.1", - "ajv-keywords": "^5.1.0" - }, - "engines": { - "node": ">= 12.13.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/webpack-merge": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", @@ -8075,6 +7987,24 @@ "node": ">=4.0" } }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, "node_modules/websocket-driver": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", diff --git a/src/editor/ui/Balloon.ts b/src/editor/ui/Balloon.ts index 262ec9b..e67bf47 100644 --- a/src/editor/ui/Balloon.ts +++ b/src/editor/ui/Balloon.ts @@ -13,7 +13,7 @@ export enum BalloonPosition { } export interface BalloonOptions { - position: BalloonPosition + position: 'top' | 'bottom' | 'float' } export class Balloon { @@ -21,7 +21,7 @@ export class Balloon { ballonPanel!: HTMLDivElement editor: Editor options: BalloonOptions = { - position: BalloonPosition.BOTTOM + position: 'bottom' } constructor(editor: Editor, options?: BalloonOptions) { this.editor = editor diff --git a/src/editor/ui/Dropdown.ts b/src/editor/ui/Dropdown.ts index 7952f68..c8bb5a1 100644 --- a/src/editor/ui/Dropdown.ts +++ b/src/editor/ui/Dropdown.ts @@ -69,13 +69,13 @@ export class Dropdown implements Tool { this.dropdownContentContainer.style.display = 'none' } - render() { + render() { this.button.bind('click', ({ editor, event, button }) => { this.config.events['open']({ editor, event, button, dropdown: this }) const close = (event: Event) => { const target = event.target as HTMLElement - if (!target.closest('.dropdown')) { + if (!target.closest('.ex-dropdown')) { this.off() window.removeEventListener('click', close) } diff --git a/src/editor/utils.ts b/src/editor/utils.ts index cf60de7..1c3a9d6 100644 --- a/src/editor/utils.ts +++ b/src/editor/utils.ts @@ -82,7 +82,7 @@ export function setSelectionAfter(editor: Editor, targetNode: Node) { } export function getNodeFromSelection(editor: Editor): Node | null { - const { state } = editor + const { state } = editor.view const { from } = state.selection const node = state.doc.nodeAt(from) return node diff --git a/src/extensions/extension-table-cell/src/table-cell.ts b/src/extensions/extension-table-cell/src/table-cell.ts index 451b4bf..2524377 100644 --- a/src/extensions/extension-table-cell/src/table-cell.ts +++ b/src/extensions/extension-table-cell/src/table-cell.ts @@ -1,7 +1,6 @@ import { objParaCss } from '@extensions/table' import { mergeAttributes, Node } from '@tiptap/core' -import { type DOMOutputSpec } from '@tiptap/pm/model' -import { selectionCell } from '@tiptap/pm/tables' +import { type DOMOutputSpec, type ResolvedPos } from '@tiptap/pm/model' export interface TableCellOptions { /** @@ -40,7 +39,7 @@ export function cssParaObj(cssString: string): { [key: string]: string } { declare module '@tiptap/core' { interface Commands { tableCell: { - setCellAttributes: (attributes: { [key: string]: any }) => ReturnType + setCellAttributes: (resPos: ResolvedPos, attributes: { [key: string]: any }) => ReturnType } } } @@ -101,9 +100,9 @@ export const TableCell = Node.create({ addCommands() { return { setCellAttributes: - (attributes: { [key: string]: any }) => - ({ state, dispatch, tr }) => { - const { nodeAfter, pos } = selectionCell(state) + (resPos: ResolvedPos, attributes: { [key: string]: any }) => + ({ dispatch, tr }) => { + const { nodeAfter, pos } = resPos const attrs = { ...nodeAfter?.attrs, diff --git a/src/extensions/image/imageView.ts b/src/extensions/image/imageView.ts index f098907..de04cb6 100644 --- a/src/extensions/image/imageView.ts +++ b/src/extensions/image/imageView.ts @@ -1,6 +1,6 @@ import { Toolbar } from '@editor/toolbar' import { Button, type ButtonEventProps, Dropdown, type DropDownEventProps } from '@editor/ui' -import { Balloon, BalloonPosition } from '@editor/ui/Balloon' +import { Balloon } from '@editor/ui/Balloon' import arrowDropDown from '@icons/arrow-drop-down-line.svg' import textDl from '@icons/image-left.svg' import textDm from '@icons/image-middle.svg' @@ -274,7 +274,7 @@ export class ImageView implements NodeView { }) this.balloon = new Balloon(editor, { - position: BalloonPosition.TOP + position: 'top' }) this.balloon.ballonPanel.appendChild(toolbar.createToolbar()) diff --git a/src/extensions/katex/katex.ts b/src/extensions/katex/katex.ts index 3a5abfa..c3e71cc 100644 --- a/src/extensions/katex/katex.ts +++ b/src/extensions/katex/katex.ts @@ -1,4 +1,4 @@ -import { BalloonPosition, type ButtonEventProps } from '@editor/ui' +import { type ButtonEventProps } from '@editor/ui' import formula from '@icons/formula.svg' import { Node } from '@tiptap/core' // eslint-disable-next-line import-helpers/order-imports @@ -45,7 +45,7 @@ function click({ editor, button }: ButtonEventProps) { }, confirmButtonCallback, cancelButtonCallback, - BalloonPosition.FLOAT + 'float' ) const focus = () => { diff --git a/src/extensions/katex/katexBalloon.ts b/src/extensions/katex/katexBalloon.ts index 6faf3d1..0738b6a 100644 --- a/src/extensions/katex/katexBalloon.ts +++ b/src/extensions/katex/katexBalloon.ts @@ -1,4 +1,4 @@ -import { Balloon, type BalloonPosition, Button } from '@editor/ui' +import { Balloon, type BalloonOptions, Button } from '@editor/ui' import { createHTMLElement } from '@editor/utils' import check from '@icons/check-line.svg' import close from '@icons/close-line.svg' @@ -18,7 +18,7 @@ export class KatexBalloon { latexConfig: any, confirmCallback: (katexBalloon: KatexBalloon) => void, cancelCallback: (katexBalloon: KatexBalloon) => void, - position: BalloonPosition + position: BalloonOptions['position'] ) { const { display, latexFormula } = latexConfig this.editor = editor diff --git a/src/extensions/katex/katexView.ts b/src/extensions/katex/katexView.ts index 3cd63d3..f5cda10 100644 --- a/src/extensions/katex/katexView.ts +++ b/src/extensions/katex/katexView.ts @@ -1,4 +1,3 @@ -import { BalloonPosition } from '@editor/ui/Balloon' import { createHTMLElement, setSelectionAfter } from '@editor/utils' import { type Editor } from '@tiptap/core' import { type Node as ProseMirrorNode } from '@tiptap/pm/model' @@ -67,7 +66,7 @@ export class KatexView implements NodeView { }, confirmBalloon.bind(this), cancelBalloon.bind(this), - BalloonPosition.BOTTOM + 'bottom' ) this.renderedLatex = document.createElement('span') diff --git a/src/extensions/table/TableView.ts b/src/extensions/table/TableView.ts index 2203efd..9ebcf0f 100644 --- a/src/extensions/table/TableView.ts +++ b/src/extensions/table/TableView.ts @@ -10,35 +10,35 @@ import starredTable from '@icons/starred-table.svg' import tableColumns from '@icons/table-columns.svg' import tableRow from '@icons/table-lines.svg' import { type Editor } from '@tiptap/core' -import { type Node as ProseMirrorNode } from '@tiptap/pm/model' +import { type Node as ProseMirrorNode, type ResolvedPos } from '@tiptap/pm/model' +import { selectionCell } from '@tiptap/pm/tables' import { type NodeView } from '@tiptap/pm/view' import type ExitusEditor from 'src/ExitusEditor' -// eslint-disable-next-line @typescript-eslint/no-unused-vars - import { criaCellModal } from './itensModalCell' import { criaTabelaModal } from './itensModalTable' import { objParaCss } from './table' import TableFocus, { UpDownTable } from './tableFocus' import { criaDropCell, criaDropColuna, criaDropLinhas } from './tableToolbarItens' -function clickHandler(table: TableView) { - table.tableWrapper.addEventListener('click', event => { - if (!table.balloon.isOpen()) { - table.balloon.show() +function clickHandler(tableView: TableView) { + tableView.table.addEventListener('click', event => { + if (!tableView.balloon.isOpen()) { + tableView.balloon.show() } + tableView.updateSelectedCell() function clickOutside(event) { const target = event.target as HTMLElement if (target.closest('.tableWrapper') == null) { - table.balloon.hide() - table.tableWrapper.classList.remove('ex-selected') - window.removeEventListener('click', clickOutside) + tableView.balloon.hide() + tableView.tableWrapper.classList.remove('ex-selected') + document.removeEventListener('click', clickOutside) } } - window.addEventListener('click', clickOutside) + document.addEventListener('click', clickOutside) }) } @@ -109,6 +109,7 @@ export class TableView implements NodeView { getPos: boolean | (() => number) tableStyle: { [key: string]: string } tableWrapperStyle: { [key: string]: string } + selectedCell: ResolvedPos constructor(node: ProseMirrorNode, editor: Editor, getPos: boolean | (() => number)) { this.node = node @@ -151,7 +152,7 @@ export class TableView implements NodeView { toolbarButtonConfig: { icon: tableCell + arrowDropDown, title: 'mesclar células', - dropdown: criaDropCell(node.attrs.style) + dropdown: criaDropCell() } }, tableStarred: { @@ -165,7 +166,7 @@ export class TableView implements NodeView { toolbarButtonConfig: { icon: starredCell + arrowDropDown, title: 'editar celula', - dropdown: criaCellModal() + dropdown: criaCellModal(this) } } } @@ -207,6 +208,14 @@ export class TableView implements NodeView { } } + updateSelectedCell() { + this.selectedCell = selectionCell(this.editor.view.state) + } + + getSelectedCell() { + return this.selectedCell + } + update(node: ProseMirrorNode) { if (node.type !== this.node.type) { return false diff --git a/src/extensions/table/index.ts b/src/extensions/table/index.ts index 302847a..47e1b81 100644 --- a/src/extensions/table/index.ts +++ b/src/extensions/table/index.ts @@ -1 +1,2 @@ export * from './table' +export * from './TableView' diff --git a/src/extensions/table/itensModalCell.ts b/src/extensions/table/itensModalCell.ts index 07a85a7..a319e71 100644 --- a/src/extensions/table/itensModalCell.ts +++ b/src/extensions/table/itensModalCell.ts @@ -1,5 +1,6 @@ //@ts-nocheck import { Button, Dropdown, type DropDownEventProps } from '@editor/ui' +import { type TableView } from '@extensions/table' import textDr from '@icons/align-bottom.svg' import textDl from '@icons/align-top.svg' import textDm from '@icons/align-vertically.svg' @@ -39,11 +40,11 @@ function saveSizeValue({ dropdown, editor }: DropDownEventProps) { if (nodeAfter && nodeAfter?.attrs.style) { const style = nodeAfter?.attrs.style - const alturaInput = dropdown.dropdownContent.querySelector('.ex-inputDimensoes') - const larguraInput = dropdown.dropdownContent.querySelector('.ex-inputDimensoesLargura') + const alturaInput = dropdown.dropdownContent.querySelector('input[placeholder="Altura"]') + const larguraInput = dropdown.dropdownContent.querySelector('input[placeholder="Largura"]') - alturaInput.value = style?.altura.replace('px', '') - larguraInput.value = style?.largura.replace('px', '') + alturaInput.value = style?.altura?.replace('px', '') + larguraInput.value = style?.largura?.replace('px', '') } } @@ -59,7 +60,7 @@ function showDropdown(dropDownEvent: DropDownEventProps) { } } -export function criaCellModal() { +export function criaCellModal(tableView: TableView) { return ({ editor }: any) => { const dropdown = new Dropdown(editor, { events: { @@ -68,7 +69,7 @@ export function criaCellModal() { classes: ['ex-dropdown-balloonModal'] }) - dropdown.setDropDownContent(new ItensModalCell(editor).render()) + dropdown.setDropDownContent(new ItensModalCell(tableView).render()) return dropdown } } @@ -80,17 +81,19 @@ export class ItensModalCell { private inputBackgroundColor2: HTMLInputElement private inputAltura: HTMLInputElement private inputLargura: HTMLInputElement + private tableView: TableView - constructor(editor: ExitusEditor) { - this.editor = editor - + constructor(tableView: TableView) { + this.editor = tableView.editor + this.tableView = tableView this.selectInput = document.createElement('select') this.selectInput.style.width = '80px' this.selectInput.className = 'ex-selectInput' const borderStyles = { 'sem borda': 'none', - sólida: 'solid', + // eslint-disable-next-line prettier/prettier + 'sólida': 'solid', pontilhada: 'dotted', tracejada: 'dashed', dupla: 'double', @@ -133,10 +136,6 @@ export class ItensModalCell { dropdownContent.className = '.ex-dropdownList-content' dropdownContent.contentEditable = 'false' - /* dropdownContent.addEventListener('click', event => { - event.stopPropagation() - }) */ - const propriedadesLabel = document.createElement('strong') propriedadesLabel.textContent = 'Propriedades da Tabela' dropdownContent.appendChild(propriedadesLabel) @@ -230,19 +229,19 @@ export class ItensModalCell { bloco8.className = 'ex-bloco8' const TableEsquerda = createButton(this.editor, textDl, () => { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { 'vertical-align': 'top' }) }) const TableMeio = createButton(this.editor, textDm, () => { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { 'vertical-align': 'middle' }) }) const TableDireito = createButton(this.editor, textDr, () => { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { 'vertical-align': 'bottom' }) }) @@ -278,7 +277,7 @@ export class ItensModalCell { // Botão de cancelar const botaoCancela = createButton(this.editor, 'Cancelar', () => { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { height: '', width: '', background: '', @@ -303,7 +302,7 @@ export class ItensModalCell { const largura = this.larguraBloco1.value if (selectedValue && cor && largura) { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { border: `${largura}px ${selectedValue} ${cor}` }) } @@ -313,7 +312,7 @@ export class ItensModalCell { const cor2 = this.inputBackgroundColor2.value if (cor2) { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { background: cor2 }) } @@ -323,7 +322,7 @@ export class ItensModalCell { const altura = this.inputAltura.value const largura = this.inputLargura.value if (altura && largura) { - this.editor.commands.setCellAttributes({ + this.editor.commands.setCellAttributes(this.tableView.selectedCell, { height: `${altura}em`, width: `${largura}em` }) diff --git a/src/extensions/table/itensModalTable.ts b/src/extensions/table/itensModalTable.ts index 7551913..0af942d 100644 --- a/src/extensions/table/itensModalTable.ts +++ b/src/extensions/table/itensModalTable.ts @@ -20,7 +20,7 @@ function showDropdown({ dropdown }: any) { } export function criaTabelaModal(style: any) { - return ({ editor }: { editor: ExitusEditor }) => { + return ({ editor }) => { const dropdown = new Dropdown(editor, { events: { open: showDropdown