split helpers and utilities
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { TextSelection } from 'prosemirror-state'
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
import getMarkRange from '../utils/getMarkRange'
|
||||
import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkRange from '../helpers/getMarkRange'
|
||||
|
||||
/**
|
||||
* Extends the text selection to the current mark.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EditorState, TextSelection } from 'prosemirror-state'
|
||||
import { Command, FocusPosition } from '../types'
|
||||
import minMax from '../utils/minMax'
|
||||
import minMax from '../utilities/minMax'
|
||||
|
||||
function resolveSelection(state: EditorState, position: FocusPosition = null) {
|
||||
if (!position) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { DOMParser } from 'prosemirror-model'
|
||||
import { Selection, Transaction } from 'prosemirror-state'
|
||||
import { ReplaceStep, ReplaceAroundStep } from 'prosemirror-transform'
|
||||
import elementFromString from '../utils/elementFromString'
|
||||
import elementFromString from '../utilities/elementFromString'
|
||||
import { Command } from '../types'
|
||||
|
||||
// TODO: move to utils
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { lift as originalLift } from 'prosemirror-commands'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import nodeIsActive from '../helpers/nodeIsActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Removes an existing wrap.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { liftListItem as originalLiftListItem } from 'prosemirror-schema-list'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Lift the list item into a wrapping list.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import deleteProps from '../utils/deleteProps'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
import deleteProps from '../utilities/deleteProps'
|
||||
import { Command } from '../types'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
import getMarkAttributes from '../utils/getMarkAttributes'
|
||||
import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkAttributes from '../helpers/getMarkAttributes'
|
||||
|
||||
/**
|
||||
* Add a mark with new attributes.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { setBlockType } from 'prosemirror-commands'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Replace a given range with a node.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { sinkListItem as originalSinkListItem } from 'prosemirror-schema-list'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Sink the list item down into an inner list.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { splitListItem as originalSplitListItem } from 'prosemirror-schema-list'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Splits one list item into two list items.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { findParentNode } from 'prosemirror-utils'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import isList from '../utils/isList'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
import isList from '../helpers/isList'
|
||||
|
||||
/**
|
||||
* Toggle between different list types.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { toggleMark as originalToggleMark } from 'prosemirror-commands'
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
import markIsActive from '../utils/markIsActive'
|
||||
import getMarkType from '../helpers/getMarkType'
|
||||
import markIsActive from '../helpers/markIsActive'
|
||||
|
||||
/**
|
||||
* Toggle a mark on and off.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import nodeIsActive from '../helpers/nodeIsActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Toggle a node with another node.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { wrapIn, lift } from 'prosemirror-commands'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import nodeIsActive from '../helpers/nodeIsActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Wraps nodes in another node, or removes an existing wrap.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
import getMarkRange from '../utils/getMarkRange'
|
||||
import getMarkType from '../helpers/getMarkType'
|
||||
import getMarkRange from '../helpers/getMarkRange'
|
||||
|
||||
/**
|
||||
* Remove all marks in the current selection.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
import { Command } from '../types'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { wrapIn as originalWrapIn } from 'prosemirror-commands'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import nodeIsActive from '../utils/nodeIsActive'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import nodeIsActive from '../helpers/nodeIsActive'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Wraps nodes in another node.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { wrapInList as originalWrapInList } from 'prosemirror-schema-list'
|
||||
import { NodeType } from 'prosemirror-model'
|
||||
import { Command } from '../types'
|
||||
import getNodeType from '../utils/getNodeType'
|
||||
import getNodeType from '../helpers/getNodeType'
|
||||
|
||||
/**
|
||||
* Wrap a node in a list.
|
||||
|
||||
Reference in New Issue
Block a user