Skip to content

Commit

Permalink
refac: melhorias de codigo.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelino.braga committed Sep 20, 2024
1 parent 5d083ca commit 4d101a3
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 1,976 deletions.
31 changes: 31 additions & 0 deletions src/assets/icons/Editor/generative.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/extensions/image/imageView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ 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 ExitusEditor from '@src/ExitusEditor'
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'

import { convertToBase64 } from './image'
import ResizableImage from './ResizableImage'
Expand Down
12 changes: 6 additions & 6 deletions src/extensions/table/TableCellBalloon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import textDl from '@icons/align-top.svg'
import textDm from '@icons/align-vertically.svg'
import Pickr from '@simonwep/pickr'
import '@simonwep/pickr/dist/themes/nano.min.css'
import { type Editor } from '@tiptap/core'
import type ExitusEditor from '@src/ExitusEditor'
import { type Attrs, type ResolvedPos } from '@tiptap/pm/model'

const createPickrInstance = (selector: string, onCancel: () => void): Pickr => {
Expand Down Expand Up @@ -46,10 +46,10 @@ const createPickrInstance = (selector: string, onCancel: () => void): Pickr => {

export class TableCellBalloon {
balloon: Balloon
editor: Editor
editor: ExitusEditor
itenModal!: ItensModalCell

constructor(editor: Editor) {
constructor(editor: ExitusEditor) {
this.editor = editor
this.balloon = new Balloon(editor, {
position: 'float'
Expand Down Expand Up @@ -87,7 +87,7 @@ export class TableCellBalloon {
}

export class ItensModalCell {
private editor: Editor
private editor: ExitusEditor
private cellBorderStyles: HTMLSelectElement
private cellBorderColorPickr: Pickr | null
private cellBorderWidth: HTMLInputElement
Expand All @@ -97,7 +97,7 @@ export class ItensModalCell {
selectedCell!: ResolvedPos
balloon: TableCellBalloon

constructor(editor: Editor, balloon: TableCellBalloon) {
constructor(editor: ExitusEditor, balloon: TableCellBalloon) {
this.editor = editor
this.balloon = balloon

Expand Down Expand Up @@ -422,7 +422,7 @@ function createInput(type: string, placeholder: string) {
return input
}

function createButton(editor: Editor, icone: string, onClick: () => void) {
function createButton(editor: ExitusEditor, icone: string, onClick: () => void) {
const button = new Button(editor, {
icon: icone
})
Expand Down
4 changes: 2 additions & 2 deletions src/extensions/table/TableView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import starredCell from '@icons/starred-cell.svg'
import starredTable from '@icons/starred-table.svg'
import tableColumns from '@icons/table-columns.svg'
import tableRow from '@icons/table-lines.svg'
import type ExitusEditor from '@src/ExitusEditor'
import { type Editor } from '@tiptap/core'
import { type Node as ProseMirrorNode } from '@tiptap/pm/model'
import { type NodeView } from '@tiptap/pm/view'
import type ExitusEditor from 'src/ExitusEditor'

import { ItensModalTable } from './itensModalTable'
import { updateColumnsOnResize } from './prosemirror-tables/src'
Expand Down Expand Up @@ -104,7 +104,7 @@ export class TableView implements NodeView {

new TableFocus(this, this.editor as ExitusEditor)
new UpDownTable(this, this.editor as ExitusEditor)
this.tableCellBalloon = new TableCellBalloon(editor)
this.tableCellBalloon = new TableCellBalloon(editor as ExitusEditor)

const toolbar = new Toolbar(editor as ExitusEditor, ['colTable', 'rowTable', 'cellTable', 'tableProperties', 'cellProperties'])

Expand Down
2 changes: 1 addition & 1 deletion src/extensions/table/itensModalTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import textDl from '@icons/image-left.svg'
import textDm from '@icons/image-middle.svg'
import textDr from '@icons/image-right.svg'
import Pickr from '@simonwep/pickr'
import type ExitusEditor from 'src/ExitusEditor'
import type ExitusEditor from '@src/ExitusEditor'
import '@simonwep/pickr/dist/themes/nano.min.css'

const createPickrInstance = (selector: string, onCancel: () => void): Pickr => {
Expand Down
108 changes: 0 additions & 108 deletions src/extensions/table/prosemirror-tables/demo/demo.ts

This file was deleted.

65 changes: 0 additions & 65 deletions src/extensions/table/prosemirror-tables/demo/index.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function handleMouseMove(
view: EditorView,
event: MouseEvent,
handleWidth: number,
cellMinWidth: number,
_cellMinWidth: number,
lastColumnResizable: boolean,
): void {
const pluginState = columnResizingPluginKey.getState(view.state);
Expand Down
81 changes: 0 additions & 81 deletions src/extensions/table/prosemirror-tables/test/build.ts

This file was deleted.

Loading

0 comments on commit 4d101a3

Please sign in to comment.