5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 07:21:43 +00:00

editor: chore: estilo

This commit is contained in:
void 2021-03-27 18:45:46 +00:00
parent b11346074a
commit f25e93ad4b
2 changed files with 8 additions and 2 deletions

View file

@ -1,5 +1,8 @@
import { storeContent, restoreContent, forgetContent } from 'editor/storage' import { storeContent, restoreContent, forgetContent } from 'editor/storage'
import { isDirectChild, moveChildren, safeGetSelection, safeGetRangeAt, setAuxiliaryToolbar, parentBlockNames, clearSelected } from 'editor/utils' import {
isDirectChild, moveChildren, safeGetSelection, safeGetRangeAt,
setAuxiliaryToolbar, parentBlockNames, clearSelected,
} from 'editor/utils'
import { types, getValidChildren, getType } from 'editor/types' import { types, getValidChildren, getType } from 'editor/types'
import { setupButtons as setupMarksButtons } from 'editor/types/marks' import { setupButtons as setupMarksButtons } from 'editor/types/marks'
import { setupButtons as setupBlocksButtons } from 'editor/types/blocks' import { setupButtons as setupBlocksButtons } from 'editor/types/blocks'

View file

@ -51,8 +51,11 @@ export const types: { [propName: string]: EditorNode } = {
export function getType (node: Element): { typeName: string, type: EditorNode } | null { export function getType (node: Element): { typeName: string, type: EditorNode } | null {
for (let [typeName, type] of Object.entries(types)) { for (let [typeName, type] of Object.entries(types)) {
if (node.matches(type.selector)) return { typeName, type } if (node.matches(type.selector)) {
return { typeName, type }
} }
}
return null return null
} }