mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-01-03 23:42:28 +03:00
Lexical: Split helpers to utils, refactored files
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {el} from "../../../helpers";
|
||||
import {EditorUiElement} from "../core";
|
||||
import {$getSelection} from "lexical";
|
||||
import {$patchStyleText} from "@lexical/selection";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
const colorChoices = [
|
||||
'#000000',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {el} from "../../../helpers";
|
||||
import {handleDropdown} from "../helpers/dropdowns";
|
||||
import {EditorContainerUiElement, EditorUiElement} from "../core";
|
||||
import {EditorBasicButtonDefinition, EditorButton} from "../buttons";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
export type EditorDropdownButtonOptions = {
|
||||
showOnHover?: boolean;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {el} from "../../../helpers";
|
||||
import {EditorUiStateUpdate, EditorContainerUiElement} from "../core";
|
||||
import {EditorButton} from "../buttons";
|
||||
import {handleDropdown} from "../helpers/dropdowns";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
export class EditorFormatMenu extends EditorContainerUiElement {
|
||||
buildDOM(): HTMLElement {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {el} from "../../../helpers";
|
||||
import {EditorButton, EditorButtonDefinition} from "../buttons";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
export class FormatPreviewButton extends EditorButton {
|
||||
protected previewSampleElement: HTMLElement;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {EditorContainerUiElement, EditorUiElement} from "../core";
|
||||
import {el} from "../../../helpers";
|
||||
import {EditorDropdownButton} from "./dropdown-button";
|
||||
import moreHorizontal from "@icons/editor/more-horizontal.svg"
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
|
||||
export class EditorOverflowContainer extends EditorContainerUiElement {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {el, $insertNewBlockNodeAtSelection} from "../../../helpers";
|
||||
import {EditorUiElement} from "../core";
|
||||
import {$createTableNodeWithDimensions} from "@lexical/table";
|
||||
import {CustomTableNode} from "../../../nodes/custom-table";
|
||||
import {$insertNewBlockNodeAtSelection} from "../../../utils/selection";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
|
||||
export class EditorTableCreator extends EditorUiElement {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {BaseSelection} from "lexical";
|
||||
import {EditorUiContext, EditorUiElement, EditorUiStateUpdate} from "./core";
|
||||
import {el} from "../../helpers";
|
||||
|
||||
import {el} from "../../utils/dom";
|
||||
|
||||
export interface EditorBasicButtonDefinition {
|
||||
label: string;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {BaseSelection, LexicalEditor} from "lexical";
|
||||
import {EditorUIManager} from "./manager";
|
||||
import {el} from "../../helpers";
|
||||
|
||||
import {el} from "../../utils/dom";
|
||||
|
||||
export type EditorUiStateUpdate = {
|
||||
editor: LexicalEditor;
|
||||
|
||||
@@ -5,8 +5,8 @@ import {
|
||||
EditorUiBuilderDefinition,
|
||||
isUiBuilderDefinition
|
||||
} from "./core";
|
||||
import {el} from "../../helpers";
|
||||
import {uniqueId} from "../../../services/util";
|
||||
import {el} from "../../utils/dom";
|
||||
|
||||
export interface EditorFormFieldDefinition {
|
||||
label: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {$getNearestNodeFromDOMNode, LexicalEditor} from "lexical";
|
||||
import {el} from "../../../helpers";
|
||||
import {MouseDragTracker, MouseDragTrackerDistance} from "./mouse-drag-tracker";
|
||||
import {$getTableColumnWidth, $setTableColumnWidth, CustomTableNode} from "../../../nodes/custom-table";
|
||||
import {TableRowNode} from "@lexical/table";
|
||||
import {el} from "../../../utils/dom";
|
||||
|
||||
type MarkerDomRecord = {x: HTMLElement, y: HTMLElement};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {EditorForm, EditorFormDefinition} from "./forms";
|
||||
import {el} from "../../helpers";
|
||||
import {EditorContainerUiElement} from "./core";
|
||||
import closeIcon from "@icons/close.svg";
|
||||
import {el} from "../../utils/dom";
|
||||
|
||||
export interface EditorModalDefinition {
|
||||
title: string;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {EditorContainerUiElement, EditorUiElement} from "./core";
|
||||
import {el} from "../../helpers";
|
||||
|
||||
import {el} from "../../utils/dom";
|
||||
|
||||
export type EditorContextToolbarDefinition = {
|
||||
selector: string;
|
||||
|
||||
Reference in New Issue
Block a user