diff --git a/src/commands/addMark.ts b/src/commands/addMark.ts index c51d529..acdb78b 100644 --- a/src/commands/addMark.ts +++ b/src/commands/addMark.ts @@ -3,6 +3,9 @@ import { EditorState, Transaction } from "prosemirror-state" import { MarkType } from "prosemirror-model" /** Wrap the users current selection in the given Mark type */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const addMark: CommandFactory = (type: MarkType, attrs?: Record) => (state: EditorState, dispatch?: (tx: Transaction) => void) => { diff --git a/src/commands/getMarkAttrs.ts b/src/commands/getMarkAttrs.ts index e11c1c8..4680b28 100644 --- a/src/commands/getMarkAttrs.ts +++ b/src/commands/getMarkAttrs.ts @@ -5,6 +5,9 @@ import { Mark, MarkType } from "prosemirror-model" ** Filters through the states Marks and returns the attributes ** of the Mark found, else returns and empty object */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function getMarkAttrs( state: EditorState, type: MarkType diff --git a/src/commands/getMarkRange.ts b/src/commands/getMarkRange.ts index 7e59d0f..a014a87 100644 --- a/src/commands/getMarkRange.ts +++ b/src/commands/getMarkRange.ts @@ -4,6 +4,9 @@ import { MarkType, ResolvedPos } from "prosemirror-model" // Note: this doesn't handle selections _across_ nodes. // At the time of writing the implication of this is on links: they cannot span across multiple nodes. // There's no impact on the other marks like bold, italics and underline. +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function getMarkRange( $pos: ResolvedPos | null = null, type: MarkType | null = null diff --git a/src/commands/listIsActive.ts b/src/commands/listIsActive.ts index 00174e1..a1b7fc8 100644 --- a/src/commands/listIsActive.ts +++ b/src/commands/listIsActive.ts @@ -2,6 +2,9 @@ import { EditorState } from "prosemirror-state" import { NodeType } from "prosemirror-model" import { findParentNodeOfTypeClosestToPos } from "prosemirror-utils" +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function listIsActive( state: EditorState, type: NodeType, diff --git a/src/commands/markContainsSelection.ts b/src/commands/markContainsSelection.ts index d1054c5..56f608d 100644 --- a/src/commands/markContainsSelection.ts +++ b/src/commands/markContainsSelection.ts @@ -4,6 +4,9 @@ import { getMarkRange } from "./getMarkRange" import { markIsActive } from "./markIsActive" /** Check the current PM Selection against the Mark Type provided */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function markContainsSelection( state: EditorState, markType: MarkType diff --git a/src/commands/markIsActive.ts b/src/commands/markIsActive.ts index ebaa874..a36375f 100644 --- a/src/commands/markIsActive.ts +++ b/src/commands/markIsActive.ts @@ -1,6 +1,9 @@ import { EditorState } from "prosemirror-state" import { MarkType } from "prosemirror-model" +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function markIsActive(state: EditorState, type: MarkType) { const { from, $from, to, empty } = state.selection diff --git a/src/commands/removeMark.ts b/src/commands/removeMark.ts index 5b046ff..ab509ad 100644 --- a/src/commands/removeMark.ts +++ b/src/commands/removeMark.ts @@ -4,6 +4,9 @@ import { MarkType } from "prosemirror-model" import { getMarkRange } from "./getMarkRange" /** Remove part or all of the Mark from the current selection */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const removeMark: CommandFactory = ( type: MarkType, diff --git a/src/commands/updateMark.ts b/src/commands/updateMark.ts index 1f08a4b..956a82f 100644 --- a/src/commands/updateMark.ts +++ b/src/commands/updateMark.ts @@ -4,6 +4,9 @@ import { MarkType } from "prosemirror-model" import { getMarkRange } from "./getMarkRange" /** Update Mark attributes, create nested Marks or split Marks of the same type */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const updateMark: CommandFactory = ( type: MarkType, diff --git a/src/commands/validateAndRemoveMarks.ts b/src/commands/validateAndRemoveMarks.ts index 42dbf2d..1423aa9 100644 --- a/src/commands/validateAndRemoveMarks.ts +++ b/src/commands/validateAndRemoveMarks.ts @@ -16,6 +16,9 @@ export type AttrsValidator = ( // This is a variation on the removeMark transform in // https://github.com/ProseMirror/prosemirror-transform/blob/master/src/mark.js#L44 /** This will walk the full doc and remove the Marks that fail the validator method */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function validateAndRemoveMarks( markType: MarkType, validator: AttrsValidator diff --git a/src/core/create.ts b/src/core/create.ts index a218548..a4fc128 100644 --- a/src/core/create.ts +++ b/src/core/create.ts @@ -24,6 +24,9 @@ type EditorArgs = { * createRichTextEditor * Initialize a ProseMirror EditorView */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function createRichTextEditor({ initialEditorState, node, diff --git a/src/core/hooks/useRichTextEditor.ts b/src/core/hooks/useRichTextEditor.ts index 4000c29..0b849c2 100644 --- a/src/core/hooks/useRichTextEditor.ts +++ b/src/core/hooks/useRichTextEditor.ts @@ -24,6 +24,9 @@ type UseRichTextEditorReturnValue = [ * @param {initialEditorState} ProseMirror state * @returns {Array} */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function useRichTextEditor( initialEditorState: EditorState, /* diff --git a/src/core/inputrules.ts b/src/core/inputrules.ts index 4272c1a..162a6db 100644 --- a/src/core/inputrules.ts +++ b/src/core/inputrules.ts @@ -4,6 +4,9 @@ import { wrappingInputRule } from "prosemirror-inputrules" // Given a list node type, returns an input rule that turns a number // followed by a dot at the start of a textblock into an ordered list. // Copied from https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/inputrules.js +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function orderedListRule(nodeType: NodeType) { return wrappingInputRule( /^(\d+)\.\s$/, @@ -17,6 +20,9 @@ export function orderedListRule(nodeType: NodeType) { // (dash, plush, or asterisk) at the start of a textblock into a // bullet list. // Copied from https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/inputrules.js +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function bulletListRule(nodeType: NodeType) { return wrappingInputRule(/^\s*([-+*])\s$/, nodeType) } diff --git a/src/core/state.ts b/src/core/state.ts index 3fb31c5..241dac0 100644 --- a/src/core/state.ts +++ b/src/core/state.ts @@ -7,6 +7,9 @@ import { Node, Schema } from "prosemirror-model" * Create a ProseMirror EditorState. Wrapper for EditorState.create to make the * API obvious to consumers */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function createEditorState( schema: Schema, doc: Node | undefined, @@ -23,6 +26,9 @@ export function createEditorState( * Create a ProseMirror doc node from the combination of a schema and the object * representation of a document */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function createDocNode(schema: Schema, docObject: Doc) { return Node.fromJSON(schema, docObject) } @@ -31,6 +37,9 @@ export function createDocNode(schema: Schema, docObject: Doc) { * Create a ProseMirror doc node from the combination of a schema and the doc’s * content array (rather than the top-level doc node). */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function createDocNodeFromContent( schema: Schema, docContent: DocContent diff --git a/src/plugins/LinkManager/LinkManager.tsx b/src/plugins/LinkManager/LinkManager.tsx index 2385e7a..3dbe225 100644 --- a/src/plugins/LinkManager/LinkManager.tsx +++ b/src/plugins/LinkManager/LinkManager.tsx @@ -20,7 +20,9 @@ import { MarkType } from "prosemirror-model" import { SelectionPosition } from "./types.d" import { createReactTooltipWrapper } from "./createReactTooltipWrapper" import debounce from "lodash.debounce" - +/** + * @deprecated Please use the same component from `@kaizen/components` + */ class LinkManager { editorComponent: ComponentType linkActive: (state: EditorState) => boolean diff --git a/src/plugins/LinkManager/components/LinkEditor/LinkEditor.tsx b/src/plugins/LinkManager/components/LinkEditor/LinkEditor.tsx index 187e721..001b7fa 100644 --- a/src/plugins/LinkManager/components/LinkEditor/LinkEditor.tsx +++ b/src/plugins/LinkManager/components/LinkEditor/LinkEditor.tsx @@ -16,6 +16,9 @@ export type LinkEditorProps = { focusEditor: () => void } +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function LinkEditor({ attrs, removeMark, diff --git a/src/plugins/LinkManager/components/LinkModal/LinkModal.tsx b/src/plugins/LinkManager/components/LinkModal/LinkModal.tsx index 57985ad..e4007c4 100644 --- a/src/plugins/LinkManager/components/LinkModal/LinkModal.tsx +++ b/src/plugins/LinkManager/components/LinkModal/LinkModal.tsx @@ -11,6 +11,9 @@ interface LinkModalProps { defaultHref?: string } +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const LinkModal: React.VFC = props => { const { onSubmit, onDismiss, onAfterLeave, isOpen, defaultHref } = props const [href, setHref] = useState(defaultHref || "") diff --git a/src/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx b/src/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx index e6fa793..3f94a3e 100644 --- a/src/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx +++ b/src/plugins/LinkManager/components/LinkPopover/LinkPopover.tsx @@ -17,6 +17,9 @@ export interface LinkPopoverProps { selectionPosition: SelectionPosition } +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const LinkPopover: React.VFC = props => { const { href, onRemove, onEdit, selectionPosition } = props const [ElementRef, Popover] = usePopover() diff --git a/src/plugins/LinkManager/createReactTooltipWrapper.tsx b/src/plugins/LinkManager/createReactTooltipWrapper.tsx index c501d19..30d5727 100644 --- a/src/plugins/LinkManager/createReactTooltipWrapper.tsx +++ b/src/plugins/LinkManager/createReactTooltipWrapper.tsx @@ -33,6 +33,9 @@ function Wrapper({ * Create a wrapping connector for rendering a React element into a separate * part of the DOM while being able to update it without remounting. */ +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export function createReactTooltipWrapper( parentNode: HTMLElement, Component: ElementType, diff --git a/src/schema/marks.ts b/src/schema/marks.ts index afe6049..ebd99cc 100644 --- a/src/schema/marks.ts +++ b/src/schema/marks.ts @@ -2,6 +2,9 @@ import { MarkSpec, Node } from "prosemirror-model" import { marks as proseMarks } from "prosemirror-schema-basic" import { validateLink } from "../plugins/LinkManager/validation" +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const marks: MarkSpec = { ...proseMarks, diff --git a/src/schema/nodes.ts b/src/schema/nodes.ts index 7b7646b..d19c57a 100644 --- a/src/schema/nodes.ts +++ b/src/schema/nodes.ts @@ -13,6 +13,9 @@ const proseNodesWithCamelCase = { codeBlock: proseNodes.code_block, } +/** + * @deprecated Please use the same component from `@kaizen/components` + */ export const nodes: NodeSpec = { ...proseNodesWithCamelCase, orderedList: {