fix: resolve TypeScript errors in frontend build

This commit is contained in:
Hiro
2026-03-30 23:16:07 +00:00
parent b733306773
commit 24925e1acb
2941 changed files with 418042 additions and 49 deletions

21
node_modules/@remirror/core-constants/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-2022, Remirror Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,431 @@
/**
* The css class added to a node that is selected.
*/
export declare const SELECTED_NODE_CLASS_NAME = "ProseMirror-selectednode";
/**
* The css selector for a selected node.
*/
export declare const SELECTED_NODE_CLASS_SELECTOR: string;
/**
* ProseMirror uses the Unicode Character 'OBJECT REPLACEMENT CHARACTER'
* (U+FFFC) as text representation for leaf nodes, i.e. nodes that don't have
* any content or text property (e.g. hardBreak, emoji, mention, rule) It was
* introduced because of https://github.com/ProseMirror/prosemirror/issues/262
* This can be used in an input rule regex to be able to include or exclude such
* nodes.
*/
export declare const LEAF_NODE_REPLACING_CHARACTER = "\uFFFC";
/**
* The null character.
*
* See {@link https://stackoverflow.com/a/6380172}
*/
export declare const NULL_CHARACTER = "\0";
/**
* Indicates that a state update was caused by an override and not via
* transactions or user commands.
*
* This is the case when `setContent` is called and for all `controlled` updates
* within a `react` editor instance.
*/
export declare const STATE_OVERRIDE = "__state_override__";
/**
* The global name for the module exported by the remirror webview bundle.
*/
export declare const REMIRROR_WEBVIEW_NAME = "$$__REMIRROR_WEBVIEW_BUNDLE__$$";
/**
* A character useful for separating inline nodes.
*
* @remarks
* Typically used in decorations as follows.
*
* ```ts
* document.createTextNode(ZERO_WIDTH_SPACE_CHAR);
* ```
*
* This produces the html entity '8203'
*/
export declare const ZERO_WIDTH_SPACE_CHAR = "\u200B";
/**
* The non breaking space character.
*/
export declare const NON_BREAKING_SPACE_CHAR = "\u00A0";
/**
* A default empty object node. Useful for resetting the content of a
* prosemirror document.
*/
export declare const EMPTY_PARAGRAPH_NODE: {
type: string;
content: {
type: string;
}[];
};
export declare const EMPTY_NODE: {
type: string;
content: never[];
};
/**
* The type for the extension tags..
*/
export type ExtensionTag = Remirror.ExtensionTags & typeof BaseExtensionTag;
/**
* A method for updating the extension tags.
*
* ```tsx
* import { ExtensionTag, mutateTag } from 'remirror';
*
* mutateTag((tag) => {
* tag.SuperCustom = 'superCustom';
* });
*
* declare global {
* namespace Remirror {
* interface ExtensionTag {
* SuperCustom: 'superCustom';
* }
* }
* }
*
*
* log(ExtensionTag.SuperCustom); // This is fine ✅
* log(ExtensionTag.NotDefined); // This will throw ❌
* ```
*/
export declare function mutateTag(mutator: (Tag: ExtensionTag) => void): void;
declare const BaseExtensionTag: {
/**
* Describes a node that can be used as the last node of a document and
* doesn't need to have anything else rendered after itself.
*
* @remarks
*
* e.g. `paragraph`
*/
readonly LastNodeCompatible: "lastNodeCompatible";
/**
* A mark that is used to change the formatting of the node it wraps.
*
* @remarks
*
* e.g. `bold`, `italic`
*/
readonly FormattingMark: "formattingMark";
/**
* A node that formats text in a non-standard way.
*
* @remarks
*
* e.g. `codeBlock`, `heading`, `blockquote`
*/
readonly FormattingNode: "formattingNode";
/**
* Identifies a node which has problems with cursor navigation.
*
* @remarks
*
* When this tag is added to an extension this will be picked up by
* behavioural extensions such as the NodeCursorExtension which makes hard to
* reach nodes reachable using keyboard arrows.
*/
readonly NodeCursor: "nodeCursor";
/**
* Mark group for font styling (e.g. bold, italic, underline, superscript).
*/
readonly FontStyle: "fontStyle";
/**
* Mark groups for links.
*/
readonly Link: "link";
/**
* Mark groups for colors (text-color, background-color, etc).
*/
readonly Color: "color";
/**
* Mark group for alignment.
*/
readonly Alignment: "alignment";
/**
* Mark group for indentation.
*/
readonly Indentation: "indentation";
/**
* Extension which affect the behaviour of the content. Can be nodes marks or
* plain.
*/
readonly Behavior: "behavior";
/**
* Marks and nodes which contain code.
*/
readonly Code: "code";
/**
* Whether this node is an inline node.
*
* - `text` is an inline node, but `paragraph` is a block node.
*/
readonly InlineNode: "inline";
/**
* This is a node that can contain list items.
*/
readonly ListContainerNode: "listContainer";
/**
* Tags the extension as a list item node which can be contained by
* [[`ExtensionTag.ListNode`]].
*/
readonly ListItemNode: "listItemNode";
/**
* Sets this as a block level node.
*/
readonly Block: "block";
/**
* @deprecate use `ExtensionTags.Block` instead.
*/
readonly BlockNode: "block";
/**
* Set this as a text block
*/
readonly TextBlock: "textBlock";
/**
* A tag that excludes this from input rules.
*/
readonly ExcludeInputRules: "excludeFromInputRules";
/**
* A mark or node that can't be exited when at the end and beginning of the
* document with an arrow key or backspace key.
*/
readonly PreventExits: "preventsExits";
/**
* Represents a media compatible node.
*/
readonly Media: "media";
};
/**
* These are the default supported tag strings which help categorize different
* behaviors that extensions can exhibit.
*
* @remarks
*
* Any extension can register itself with multiple such behaviors and these
* categorizations can be used by other extensions when running commands and
* updating the document.
*/
export declare const ExtensionTag: ExtensionTag;
/**
* The string values which can be used as extension tags.
*/
export type ExtensionTagType = ExtensionTag[keyof ExtensionTag];
/**
* The identifier key which is used to check objects for whether they are a
* certain type.
*
* @remarks
*
* Just pretend you don't know this exists.
*
* @internal
*/
export declare const __INTERNAL_REMIRROR_IDENTIFIER_KEY__: unique symbol;
/**
* These constants are stored on the `REMIRROR_IDENTIFIER_KEY` property of
* `remirror` related constructors and instances in order to identify them as
* being internal to Remirror.
*
* @remarks
*
* This helps to prevent issues around check types via `instanceof` which can
* lead to false negatives.
*
* @internal
*/
export declare enum RemirrorIdentifier {
/**
* Identifies `PlainExtension`s.
*/
PlainExtension = "RemirrorPlainExtension",
/**
* Identifies `NodeExtension`s.
*/
NodeExtension = "RemirrorNodeExtension",
/**
* Identifies `MarkExtension`s.
*/
MarkExtension = "RemirrorMarkExtension",
/**
* Identifies `PlainExtensionConstructor`s.
*/
PlainExtensionConstructor = "RemirrorPlainExtensionConstructor",
/**
* Identifies `NodeExtensionConstructor`s.
*/
NodeExtensionConstructor = "RemirrorNodeExtensionConstructor",
/**
* Identifies `MarkExtensionConstructor`s.
*/
MarkExtensionConstructor = "RemirrorMarkExtensionConstructor",
/**
* The string used to identify an instance of the `Manager`
*/
Manager = "RemirrorManager",
/**
* The preset type identifier.
*/
Preset = "RemirrorPreset",
/**
* The preset type identifier.
*/
PresetConstructor = "RemirrorPresetConstructor"
}
/**
* The priority of extension which determines what order it is loaded into the
* editor.
*
* @remarks
*
* Higher priority extension (higher numberic value) will ensure the extension
* has a higher preference in your editor. In the case where you load two
* identical extensions into your editor (same name, or same constructor), the
* extension with the higher priority is the one that will be loaded.
*
* The higher the numeric value the higher the priority. The priority can also
* be passed a number but naming things in this `enum` should help provide some
* context to the numbers.
*
* By default all extensions are created with a `ExtensionPriority.Default`.
*/
export declare enum ExtensionPriority {
/**
* Use this **never** 😉
*/
Critical = 1000000,
/**
* A, like super duper, high priority.
*/
Highest = 100000,
/**
* The highest priority level that should be used in a publicly shared
* extension (to allow some wiggle room for downstream users overriding
* priorities).
*/
High = 10000,
/**
* A medium priority extension. This is typically all you need to take
* priority over built in extensions.
*/
Medium = 1000,
/**
* This is the **default** priority for most extensions.
*/
Default = 100,
/**
* This is the **default** priority for builtin behavior changing extensions.
*/
Low = 10,
/**
* This is useful for extensions that exist to be overridden.
*/
Lowest = 0
}
/**
* Identifies the stage the extension manager is at.
*/
export declare enum ManagerPhase {
/**
* The initial value for the manager phase.
*/
None = 0,
/**
* When the extension manager is being created and the onCreate methods are
* being called.
*
* This happens within the RemirrorManager constructor.
*/
Create = 1,
/**
* When the view is being added and all `onView` lifecycle methods are being
* called. The view is typically added before the dom is ready for it.
*/
EditorView = 2,
/**
* The phases of creating this manager are completed and `onTransaction` is
* called every time the state updates.
*/
Runtime = 3,
/**
* The manager is being destroyed.
*/
Destroy = 4
}
/**
* The named shortcuts that can be used to update multiple commands.
*/
export declare enum NamedShortcut {
Undo = "_|undo|_",
Redo = "_|redo|_",
Bold = "_|bold|_",
Italic = "_|italic|_",
Underline = "_|underline|_",
Strike = "_|strike|_",
Code = "_|code|_",
Paragraph = "_|paragraph|_",
H1 = "_|h1|_",
H2 = "_|h2|_",
H3 = "_|h3|_",
H4 = "_|h4|_",
H5 = "_|h5|_",
H6 = "_|h6|_",
TaskList = "_|task|_",
BulletList = "_|bullet|_",
OrderedList = "_|number|_",
Quote = "_|quote|_",
Divider = "_|divider|_",
Codeblock = "_|codeblock|_",
ClearFormatting = "_|clear|_",
Superscript = "_|sup|_",
Subscript = "_|sub|_",
LeftAlignment = "_|left-align|_",
CenterAlignment = "_|center-align|_",
RightAlignment = "_|right-align|_",
JustifyAlignment = "_|justify-align|_",
InsertLink = "_|link|_",
/** @deprecated */
Find = "_|find|_",
/** @deprecated */
FindBackwards = "_|find-backwards|_",
/** @deprecated */
FindReplace = "_|find-replace|_",
AddFootnote = "_|footnote|_",
AddComment = "_|comment|_",
ContextMenu = "_|context-menu|_",
IncreaseFontSize = "_|inc-font-size|_",
DecreaseFontSize = "_|dec-font-size|_",
IncreaseIndent = "_|indent|_",
DecreaseIndent = "_|dedent|_",
Shortcuts = "_|shortcuts|_",
Copy = "_|copy|_",
Cut = "_|cut|_",
Paste = "_|paste|_",
PastePlain = "_|paste-plain|_",
SelectAll = "_|select-all|_",
/**
* A keyboard shortcut to trigger formatting the current block.
*
* @defaultValue 'Alt-Shift-F' (Mac) | 'Shift-Ctrl-F' (PC)
*/
Format = "_|format|_"
}
/**
* Helpful empty array for use when a default array value is needed.
*
* DO NOT MUTATE!
*/
export declare const EMPTY_ARRAY: never[];
declare global {
namespace Remirror {
/**
* This interface is for extending the default `ExtensionTag`'s in your
* codebase with full type checking support.
*/
interface ExtensionTags {
}
}
}
export {};

View File

@@ -0,0 +1,119 @@
/**
* The error codes for errors used throughout the codebase.
*
* @remarks
*
* They can be removed but should never be changed since they are also used to
* reference the errors within search engines.
*/
export declare enum ErrorConstant {
/** An error happened but we're not quite sure why. */
UNKNOWN = "RMR0001",
/** The arguments passed to the command method were invalid. */
INVALID_COMMAND_ARGUMENTS = "RMR0002",
/** This is a custom error possibly thrown by an external library. */
CUSTOM = "RMR0003",
/**
* An error occurred in a function called from the `@remirror/core-helpers`
* library.
*/
CORE_HELPERS = "RMR0004",
/** You have attempted to change a value that shouldn't be changed. */
MUTATION = "RMR0005",
/**
* This is an error which should not occur and is internal to the remirror
* codebase.
*/
INTERNAL = "RMR0006",
/** You're editor is missing a required extension. */
MISSING_REQUIRED_EXTENSION = "RMR0007",
/**
* Called a method event at the wrong time. Please make sure getter functions
* are only called with within the scope of the returned functions. They
* should not be called in the outer scope of your method.
*/
MANAGER_PHASE_ERROR = "RMR0008",
/**
* The user requested an invalid extension from the getExtensions method.
* Please check the `createExtensions` return method is returning an extension
* with the defined constructor.
*/
INVALID_GET_EXTENSION = "RMR0010",
/**
* Invalid value passed into `Manager constructor`. Only and
* `Extensions` are supported.
*/
INVALID_MANAGER_ARGUMENTS = "RMR0011",
/**
* There is a problem with the schema or you are trying to access a node /
* mark that doesn't exists.
*/
SCHEMA = "RMR0012",
/**
* The `helpers` method which is passed into the ``create*` method should only
* be called within returned method since it relies on an active view (not
* present in the outer scope).
*/
HELPERS_CALLED_IN_OUTER_SCOPE = "RMR0013",
/** The user requested an invalid extension from the manager. */
INVALID_MANAGER_EXTENSION = "RMR0014",
/** Command method names must be unique within the editor. */
DUPLICATE_COMMAND_NAMES = "RMR0016",
/** Helper method names must be unique within the editor. */
DUPLICATE_HELPER_NAMES = "RMR0017",
/** Attempted to chain a non chainable command. */
NON_CHAINABLE_COMMAND = "RMR0018",
/** The provided extension is invalid. */
INVALID_EXTENSION = "RMR0019",
/** The content provided to the editor is not supported. */
INVALID_CONTENT = "RMR0021",
/** An invalid name was used for the extension. */
INVALID_NAME = "RMR0050",
/** An error occurred within an extension. */
EXTENSION = "RMR0100",
/** The spec was defined without calling the `defaults`, `parse` or `dom` methods. */
EXTENSION_SPEC = "RMR0101",
/** Extra attributes must either be a string or an object. */
EXTENSION_EXTRA_ATTRIBUTES = "RMR0102",
/** A call to `extension.setOptions` was made with invalid keys. */
INVALID_SET_EXTENSION_OPTIONS = "RMR0103",
/**
* `useRemirror` was called outside of the remirror context. It can only be used
* within an active remirror context created by the `<Remirror />`.
*/
REACT_PROVIDER_CONTEXT = "RMR0200",
/**
* `getRootProps` has been called MULTIPLE times. It should only be called ONCE during render.
*/
REACT_GET_ROOT_PROPS = "RMR0201",
/**
* A problem occurred adding the editor view to the dom.
*/
REACT_EDITOR_VIEW = "RMR0202",
/**
* There is a problem with your controlled editor setup.
*/
REACT_CONTROLLED = "RMR0203",
/**
* Something went wrong with your custom ReactNodeView Component.
*/
REACT_NODE_VIEW = "RMR0204",
/**
* You attempted to call `getContext` provided by the `useRemirror` prop
* during the first render of the editor. This is not possible and should only
* be after the editor first mounts.
*/
REACT_GET_CONTEXT = "RMR0205",
/**
* An error occurred when rendering the react components.
*/
REACT_COMPONENTS = "RMR0206",
/**
* An error occurred within a remirror hook.
*/
REACT_HOOKS = "RMR0207",
/**
* There is something wrong with your i18n setup.
*/
I18N_CONTEXT = "RMR0300"
}

View File

@@ -0,0 +1,2 @@
export * from './core-constants';
export { ErrorConstant } from './error-constants';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,612 @@
/**
* The identifier key which is used to check objects for whether they are a
* certain type.
*
* @remarks
*
* Just pretend you don't know this exists.
*
* @internal
*/
declare const __INTERNAL_REMIRROR_IDENTIFIER_KEY__: unique symbol;
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY__ }
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY__ as __INTERNAL_REMIRROR_IDENTIFIER_KEY___alias_1 }
declare const BaseExtensionTag: {
/**
* Describes a node that can be used as the last node of a document and
* doesn't need to have anything else rendered after itself.
*
* @remarks
*
* e.g. `paragraph`
*/
readonly LastNodeCompatible: "lastNodeCompatible";
/**
* A mark that is used to change the formatting of the node it wraps.
*
* @remarks
*
* e.g. `bold`, `italic`
*/
readonly FormattingMark: "formattingMark";
/**
* A node that formats text in a non-standard way.
*
* @remarks
*
* e.g. `codeBlock`, `heading`, `blockquote`
*/
readonly FormattingNode: "formattingNode";
/**
* Identifies a node which has problems with cursor navigation.
*
* @remarks
*
* When this tag is added to an extension this will be picked up by
* behavioural extensions such as the NodeCursorExtension which makes hard to
* reach nodes reachable using keyboard arrows.
*/
readonly NodeCursor: "nodeCursor";
/**
* Mark group for font styling (e.g. bold, italic, underline, superscript).
*/
readonly FontStyle: "fontStyle";
/**
* Mark groups for links.
*/
readonly Link: "link";
/**
* Mark groups for colors (text-color, background-color, etc).
*/
readonly Color: "color";
/**
* Mark group for alignment.
*/
readonly Alignment: "alignment";
/**
* Mark group for indentation.
*/
readonly Indentation: "indentation";
/**
* Extension which affect the behaviour of the content. Can be nodes marks or
* plain.
*/
readonly Behavior: "behavior";
/**
* Marks and nodes which contain code.
*/
readonly Code: "code";
/**
* Whether this node is an inline node.
*
* - `text` is an inline node, but `paragraph` is a block node.
*/
readonly InlineNode: "inline";
/**
* This is a node that can contain list items.
*/
readonly ListContainerNode: "listContainer";
/**
* Tags the extension as a list item node which can be contained by
* [[`ExtensionTag.ListNode`]].
*/
readonly ListItemNode: "listItemNode";
/**
* Sets this as a block level node.
*/
readonly Block: "block";
/**
* @deprecate use `ExtensionTags.Block` instead.
*/
readonly BlockNode: "block";
/**
* Set this as a text block
*/
readonly TextBlock: "textBlock";
/**
* A tag that excludes this from input rules.
*/
readonly ExcludeInputRules: "excludeFromInputRules";
/**
* A mark or node that can't be exited when at the end and beginning of the
* document with an arrow key or backspace key.
*/
readonly PreventExits: "preventsExits";
/**
* Represents a media compatible node.
*/
readonly Media: "media";
};
/**
* Helpful empty array for use when a default array value is needed.
*
* DO NOT MUTATE!
*/
declare const EMPTY_ARRAY: never[];
export { EMPTY_ARRAY }
export { EMPTY_ARRAY as EMPTY_ARRAY_alias_1 }
declare const EMPTY_NODE: {
type: string;
content: never[];
};
export { EMPTY_NODE }
export { EMPTY_NODE as EMPTY_NODE_alias_1 }
/**
* A default empty object node. Useful for resetting the content of a
* prosemirror document.
*/
declare const EMPTY_PARAGRAPH_NODE: {
type: string;
content: {
type: string;
}[];
};
export { EMPTY_PARAGRAPH_NODE }
export { EMPTY_PARAGRAPH_NODE as EMPTY_PARAGRAPH_NODE_alias_1 }
/**
* The error codes for errors used throughout the codebase.
*
* @remarks
*
* They can be removed but should never be changed since they are also used to
* reference the errors within search engines.
*/
declare enum ErrorConstant {
/** An error happened but we're not quite sure why. */
UNKNOWN = "RMR0001",
/** The arguments passed to the command method were invalid. */
INVALID_COMMAND_ARGUMENTS = "RMR0002",
/** This is a custom error possibly thrown by an external library. */
CUSTOM = "RMR0003",
/**
* An error occurred in a function called from the `@remirror/core-helpers`
* library.
*/
CORE_HELPERS = "RMR0004",
/** You have attempted to change a value that shouldn't be changed. */
MUTATION = "RMR0005",
/**
* This is an error which should not occur and is internal to the remirror
* codebase.
*/
INTERNAL = "RMR0006",
/** You're editor is missing a required extension. */
MISSING_REQUIRED_EXTENSION = "RMR0007",
/**
* Called a method event at the wrong time. Please make sure getter functions
* are only called with within the scope of the returned functions. They
* should not be called in the outer scope of your method.
*/
MANAGER_PHASE_ERROR = "RMR0008",
/**
* The user requested an invalid extension from the getExtensions method.
* Please check the `createExtensions` return method is returning an extension
* with the defined constructor.
*/
INVALID_GET_EXTENSION = "RMR0010",
/**
* Invalid value passed into `Manager constructor`. Only and
* `Extensions` are supported.
*/
INVALID_MANAGER_ARGUMENTS = "RMR0011",
/**
* There is a problem with the schema or you are trying to access a node /
* mark that doesn't exists.
*/
SCHEMA = "RMR0012",
/**
* The `helpers` method which is passed into the ``create*` method should only
* be called within returned method since it relies on an active view (not
* present in the outer scope).
*/
HELPERS_CALLED_IN_OUTER_SCOPE = "RMR0013",
/** The user requested an invalid extension from the manager. */
INVALID_MANAGER_EXTENSION = "RMR0014",
/** Command method names must be unique within the editor. */
DUPLICATE_COMMAND_NAMES = "RMR0016",
/** Helper method names must be unique within the editor. */
DUPLICATE_HELPER_NAMES = "RMR0017",
/** Attempted to chain a non chainable command. */
NON_CHAINABLE_COMMAND = "RMR0018",
/** The provided extension is invalid. */
INVALID_EXTENSION = "RMR0019",
/** The content provided to the editor is not supported. */
INVALID_CONTENT = "RMR0021",
/** An invalid name was used for the extension. */
INVALID_NAME = "RMR0050",
/** An error occurred within an extension. */
EXTENSION = "RMR0100",
/** The spec was defined without calling the `defaults`, `parse` or `dom` methods. */
EXTENSION_SPEC = "RMR0101",
/** Extra attributes must either be a string or an object. */
EXTENSION_EXTRA_ATTRIBUTES = "RMR0102",
/** A call to `extension.setOptions` was made with invalid keys. */
INVALID_SET_EXTENSION_OPTIONS = "RMR0103",
/**
* `useRemirror` was called outside of the remirror context. It can only be used
* within an active remirror context created by the `<Remirror />`.
*/
REACT_PROVIDER_CONTEXT = "RMR0200",
/**
* `getRootProps` has been called MULTIPLE times. It should only be called ONCE during render.
*/
REACT_GET_ROOT_PROPS = "RMR0201",
/**
* A problem occurred adding the editor view to the dom.
*/
REACT_EDITOR_VIEW = "RMR0202",
/**
* There is a problem with your controlled editor setup.
*/
REACT_CONTROLLED = "RMR0203",
/**
* Something went wrong with your custom ReactNodeView Component.
*/
REACT_NODE_VIEW = "RMR0204",
/**
* You attempted to call `getContext` provided by the `useRemirror` prop
* during the first render of the editor. This is not possible and should only
* be after the editor first mounts.
*/
REACT_GET_CONTEXT = "RMR0205",
/**
* An error occurred when rendering the react components.
*/
REACT_COMPONENTS = "RMR0206",
/**
* An error occurred within a remirror hook.
*/
REACT_HOOKS = "RMR0207",
/**
* There is something wrong with your i18n setup.
*/
I18N_CONTEXT = "RMR0300"
}
export { ErrorConstant }
export { ErrorConstant as ErrorConstant_alias_1 }
/**
* The priority of extension which determines what order it is loaded into the
* editor.
*
* @remarks
*
* Higher priority extension (higher numberic value) will ensure the extension
* has a higher preference in your editor. In the case where you load two
* identical extensions into your editor (same name, or same constructor), the
* extension with the higher priority is the one that will be loaded.
*
* The higher the numeric value the higher the priority. The priority can also
* be passed a number but naming things in this `enum` should help provide some
* context to the numbers.
*
* By default all extensions are created with a `ExtensionPriority.Default`.
*/
declare enum ExtensionPriority {
/**
* Use this **never** 😉
*/
Critical = 1000000,
/**
* A, like super duper, high priority.
*/
Highest = 100000,
/**
* The highest priority level that should be used in a publicly shared
* extension (to allow some wiggle room for downstream users overriding
* priorities).
*/
High = 10000,
/**
* A medium priority extension. This is typically all you need to take
* priority over built in extensions.
*/
Medium = 1000,
/**
* This is the **default** priority for most extensions.
*/
Default = 100,
/**
* This is the **default** priority for builtin behavior changing extensions.
*/
Low = 10,
/**
* This is useful for extensions that exist to be overridden.
*/
Lowest = 0
}
export { ExtensionPriority }
export { ExtensionPriority as ExtensionPriority_alias_1 }
/**
* The type for the extension tags..
*/
declare type ExtensionTag = Remirror.ExtensionTags & typeof BaseExtensionTag;
/**
* These are the default supported tag strings which help categorize different
* behaviors that extensions can exhibit.
*
* @remarks
*
* Any extension can register itself with multiple such behaviors and these
* categorizations can be used by other extensions when running commands and
* updating the document.
*/
declare const ExtensionTag: ExtensionTag;
export { ExtensionTag }
export { ExtensionTag as ExtensionTag_alias_1 }
/**
* The string values which can be used as extension tags.
*/
declare type ExtensionTagType = ExtensionTag[keyof ExtensionTag];
export { ExtensionTagType }
export { ExtensionTagType as ExtensionTagType_alias_1 }
/**
* ProseMirror uses the Unicode Character 'OBJECT REPLACEMENT CHARACTER'
* (U+FFFC) as text representation for leaf nodes, i.e. nodes that don't have
* any content or text property (e.g. hardBreak, emoji, mention, rule) It was
* introduced because of https://github.com/ProseMirror/prosemirror/issues/262
* This can be used in an input rule regex to be able to include or exclude such
* nodes.
*/
declare const LEAF_NODE_REPLACING_CHARACTER = "\uFFFC";
export { LEAF_NODE_REPLACING_CHARACTER }
export { LEAF_NODE_REPLACING_CHARACTER as LEAF_NODE_REPLACING_CHARACTER_alias_1 }
/**
* Identifies the stage the extension manager is at.
*/
declare enum ManagerPhase {
/**
* The initial value for the manager phase.
*/
None = 0,
/**
* When the extension manager is being created and the onCreate methods are
* being called.
*
* This happens within the RemirrorManager constructor.
*/
Create = 1,
/**
* When the view is being added and all `onView` lifecycle methods are being
* called. The view is typically added before the dom is ready for it.
*/
EditorView = 2,
/**
* The phases of creating this manager are completed and `onTransaction` is
* called every time the state updates.
*/
Runtime = 3,
/**
* The manager is being destroyed.
*/
Destroy = 4
}
export { ManagerPhase }
export { ManagerPhase as ManagerPhase_alias_1 }
/**
* A method for updating the extension tags.
*
* ```tsx
* import { ExtensionTag, mutateTag } from 'remirror';
*
* mutateTag((tag) => {
* tag.SuperCustom = 'superCustom';
* });
*
* declare global {
* namespace Remirror {
* interface ExtensionTag {
* SuperCustom: 'superCustom';
* }
* }
* }
*
*
* log(ExtensionTag.SuperCustom); // This is fine ✅
* log(ExtensionTag.NotDefined); // This will throw ❌
* ```
*/
declare function mutateTag(mutator: (Tag: ExtensionTag) => void): void;
export { mutateTag }
export { mutateTag as mutateTag_alias_1 }
/**
* The named shortcuts that can be used to update multiple commands.
*/
declare enum NamedShortcut {
Undo = "_|undo|_",
Redo = "_|redo|_",
Bold = "_|bold|_",
Italic = "_|italic|_",
Underline = "_|underline|_",
Strike = "_|strike|_",
Code = "_|code|_",
Paragraph = "_|paragraph|_",
H1 = "_|h1|_",
H2 = "_|h2|_",
H3 = "_|h3|_",
H4 = "_|h4|_",
H5 = "_|h5|_",
H6 = "_|h6|_",
TaskList = "_|task|_",
BulletList = "_|bullet|_",
OrderedList = "_|number|_",
Quote = "_|quote|_",
Divider = "_|divider|_",
Codeblock = "_|codeblock|_",
ClearFormatting = "_|clear|_",
Superscript = "_|sup|_",
Subscript = "_|sub|_",
LeftAlignment = "_|left-align|_",
CenterAlignment = "_|center-align|_",
RightAlignment = "_|right-align|_",
JustifyAlignment = "_|justify-align|_",
InsertLink = "_|link|_",
/** @deprecated */
Find = "_|find|_",
/** @deprecated */
FindBackwards = "_|find-backwards|_",
/** @deprecated */
FindReplace = "_|find-replace|_",
AddFootnote = "_|footnote|_",
AddComment = "_|comment|_",
ContextMenu = "_|context-menu|_",
IncreaseFontSize = "_|inc-font-size|_",
DecreaseFontSize = "_|dec-font-size|_",
IncreaseIndent = "_|indent|_",
DecreaseIndent = "_|dedent|_",
Shortcuts = "_|shortcuts|_",
Copy = "_|copy|_",
Cut = "_|cut|_",
Paste = "_|paste|_",
PastePlain = "_|paste-plain|_",
SelectAll = "_|select-all|_",
/**
* A keyboard shortcut to trigger formatting the current block.
*
* @defaultValue 'Alt-Shift-F' (Mac) | 'Shift-Ctrl-F' (PC)
*/
Format = "_|format|_"
}
export { NamedShortcut }
export { NamedShortcut as NamedShortcut_alias_1 }
/**
* The non breaking space character.
*/
declare const NON_BREAKING_SPACE_CHAR = "\u00A0";
export { NON_BREAKING_SPACE_CHAR }
export { NON_BREAKING_SPACE_CHAR as NON_BREAKING_SPACE_CHAR_alias_1 }
/**
* The null character.
*
* See {@link https://stackoverflow.com/a/6380172}
*/
declare const NULL_CHARACTER = "\0";
export { NULL_CHARACTER }
export { NULL_CHARACTER as NULL_CHARACTER_alias_1 }
/**
* The global name for the module exported by the remirror webview bundle.
*/
declare const REMIRROR_WEBVIEW_NAME = "$$__REMIRROR_WEBVIEW_BUNDLE__$$";
export { REMIRROR_WEBVIEW_NAME }
export { REMIRROR_WEBVIEW_NAME as REMIRROR_WEBVIEW_NAME_alias_1 }
/**
* These constants are stored on the `REMIRROR_IDENTIFIER_KEY` property of
* `remirror` related constructors and instances in order to identify them as
* being internal to Remirror.
*
* @remarks
*
* This helps to prevent issues around check types via `instanceof` which can
* lead to false negatives.
*
* @internal
*/
declare enum RemirrorIdentifier {
/**
* Identifies `PlainExtension`s.
*/
PlainExtension = "RemirrorPlainExtension",
/**
* Identifies `NodeExtension`s.
*/
NodeExtension = "RemirrorNodeExtension",
/**
* Identifies `MarkExtension`s.
*/
MarkExtension = "RemirrorMarkExtension",
/**
* Identifies `PlainExtensionConstructor`s.
*/
PlainExtensionConstructor = "RemirrorPlainExtensionConstructor",
/**
* Identifies `NodeExtensionConstructor`s.
*/
NodeExtensionConstructor = "RemirrorNodeExtensionConstructor",
/**
* Identifies `MarkExtensionConstructor`s.
*/
MarkExtensionConstructor = "RemirrorMarkExtensionConstructor",
/**
* The string used to identify an instance of the `Manager`
*/
Manager = "RemirrorManager",
/**
* The preset type identifier.
*/
Preset = "RemirrorPreset",
/**
* The preset type identifier.
*/
PresetConstructor = "RemirrorPresetConstructor"
}
export { RemirrorIdentifier }
export { RemirrorIdentifier as RemirrorIdentifier_alias_1 }
/**
* The css class added to a node that is selected.
*/
declare const SELECTED_NODE_CLASS_NAME = "ProseMirror-selectednode";
export { SELECTED_NODE_CLASS_NAME }
export { SELECTED_NODE_CLASS_NAME as SELECTED_NODE_CLASS_NAME_alias_1 }
/**
* The css selector for a selected node.
*/
declare const SELECTED_NODE_CLASS_SELECTOR: string;
export { SELECTED_NODE_CLASS_SELECTOR }
export { SELECTED_NODE_CLASS_SELECTOR as SELECTED_NODE_CLASS_SELECTOR_alias_1 }
/**
* Indicates that a state update was caused by an override and not via
* transactions or user commands.
*
* This is the case when `setContent` is called and for all `controlled` updates
* within a `react` editor instance.
*/
declare const STATE_OVERRIDE = "__state_override__";
export { STATE_OVERRIDE }
export { STATE_OVERRIDE as STATE_OVERRIDE_alias_1 }
/**
* A character useful for separating inline nodes.
*
* @remarks
* Typically used in decorations as follows.
*
* ```ts
* document.createTextNode(ZERO_WIDTH_SPACE_CHAR);
* ```
*
* This produces the html entity '8203'
*/
declare const ZERO_WIDTH_SPACE_CHAR = "\u200B";
export { ZERO_WIDTH_SPACE_CHAR }
export { ZERO_WIDTH_SPACE_CHAR as ZERO_WIDTH_SPACE_CHAR_alias_1 }
export { }
declare global {
namespace Remirror {
/**
* This interface is for extending the default `ExtensionTag`'s in your
* codebase with full type checking support.
*/
interface ExtensionTags {}
}
}

View File

@@ -0,0 +1,612 @@
/**
* The identifier key which is used to check objects for whether they are a
* certain type.
*
* @remarks
*
* Just pretend you don't know this exists.
*
* @internal
*/
declare const __INTERNAL_REMIRROR_IDENTIFIER_KEY__: unique symbol;
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY__ }
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY__ as __INTERNAL_REMIRROR_IDENTIFIER_KEY___alias_1 }
declare const BaseExtensionTag: {
/**
* Describes a node that can be used as the last node of a document and
* doesn't need to have anything else rendered after itself.
*
* @remarks
*
* e.g. `paragraph`
*/
readonly LastNodeCompatible: "lastNodeCompatible";
/**
* A mark that is used to change the formatting of the node it wraps.
*
* @remarks
*
* e.g. `bold`, `italic`
*/
readonly FormattingMark: "formattingMark";
/**
* A node that formats text in a non-standard way.
*
* @remarks
*
* e.g. `codeBlock`, `heading`, `blockquote`
*/
readonly FormattingNode: "formattingNode";
/**
* Identifies a node which has problems with cursor navigation.
*
* @remarks
*
* When this tag is added to an extension this will be picked up by
* behavioural extensions such as the NodeCursorExtension which makes hard to
* reach nodes reachable using keyboard arrows.
*/
readonly NodeCursor: "nodeCursor";
/**
* Mark group for font styling (e.g. bold, italic, underline, superscript).
*/
readonly FontStyle: "fontStyle";
/**
* Mark groups for links.
*/
readonly Link: "link";
/**
* Mark groups for colors (text-color, background-color, etc).
*/
readonly Color: "color";
/**
* Mark group for alignment.
*/
readonly Alignment: "alignment";
/**
* Mark group for indentation.
*/
readonly Indentation: "indentation";
/**
* Extension which affect the behaviour of the content. Can be nodes marks or
* plain.
*/
readonly Behavior: "behavior";
/**
* Marks and nodes which contain code.
*/
readonly Code: "code";
/**
* Whether this node is an inline node.
*
* - `text` is an inline node, but `paragraph` is a block node.
*/
readonly InlineNode: "inline";
/**
* This is a node that can contain list items.
*/
readonly ListContainerNode: "listContainer";
/**
* Tags the extension as a list item node which can be contained by
* [[`ExtensionTag.ListNode`]].
*/
readonly ListItemNode: "listItemNode";
/**
* Sets this as a block level node.
*/
readonly Block: "block";
/**
* @deprecate use `ExtensionTags.Block` instead.
*/
readonly BlockNode: "block";
/**
* Set this as a text block
*/
readonly TextBlock: "textBlock";
/**
* A tag that excludes this from input rules.
*/
readonly ExcludeInputRules: "excludeFromInputRules";
/**
* A mark or node that can't be exited when at the end and beginning of the
* document with an arrow key or backspace key.
*/
readonly PreventExits: "preventsExits";
/**
* Represents a media compatible node.
*/
readonly Media: "media";
};
/**
* Helpful empty array for use when a default array value is needed.
*
* DO NOT MUTATE!
*/
declare const EMPTY_ARRAY: never[];
export { EMPTY_ARRAY }
export { EMPTY_ARRAY as EMPTY_ARRAY_alias_1 }
declare const EMPTY_NODE: {
type: string;
content: never[];
};
export { EMPTY_NODE }
export { EMPTY_NODE as EMPTY_NODE_alias_1 }
/**
* A default empty object node. Useful for resetting the content of a
* prosemirror document.
*/
declare const EMPTY_PARAGRAPH_NODE: {
type: string;
content: {
type: string;
}[];
};
export { EMPTY_PARAGRAPH_NODE }
export { EMPTY_PARAGRAPH_NODE as EMPTY_PARAGRAPH_NODE_alias_1 }
/**
* The error codes for errors used throughout the codebase.
*
* @remarks
*
* They can be removed but should never be changed since they are also used to
* reference the errors within search engines.
*/
declare enum ErrorConstant {
/** An error happened but we're not quite sure why. */
UNKNOWN = "RMR0001",
/** The arguments passed to the command method were invalid. */
INVALID_COMMAND_ARGUMENTS = "RMR0002",
/** This is a custom error possibly thrown by an external library. */
CUSTOM = "RMR0003",
/**
* An error occurred in a function called from the `@remirror/core-helpers`
* library.
*/
CORE_HELPERS = "RMR0004",
/** You have attempted to change a value that shouldn't be changed. */
MUTATION = "RMR0005",
/**
* This is an error which should not occur and is internal to the remirror
* codebase.
*/
INTERNAL = "RMR0006",
/** You're editor is missing a required extension. */
MISSING_REQUIRED_EXTENSION = "RMR0007",
/**
* Called a method event at the wrong time. Please make sure getter functions
* are only called with within the scope of the returned functions. They
* should not be called in the outer scope of your method.
*/
MANAGER_PHASE_ERROR = "RMR0008",
/**
* The user requested an invalid extension from the getExtensions method.
* Please check the `createExtensions` return method is returning an extension
* with the defined constructor.
*/
INVALID_GET_EXTENSION = "RMR0010",
/**
* Invalid value passed into `Manager constructor`. Only and
* `Extensions` are supported.
*/
INVALID_MANAGER_ARGUMENTS = "RMR0011",
/**
* There is a problem with the schema or you are trying to access a node /
* mark that doesn't exists.
*/
SCHEMA = "RMR0012",
/**
* The `helpers` method which is passed into the ``create*` method should only
* be called within returned method since it relies on an active view (not
* present in the outer scope).
*/
HELPERS_CALLED_IN_OUTER_SCOPE = "RMR0013",
/** The user requested an invalid extension from the manager. */
INVALID_MANAGER_EXTENSION = "RMR0014",
/** Command method names must be unique within the editor. */
DUPLICATE_COMMAND_NAMES = "RMR0016",
/** Helper method names must be unique within the editor. */
DUPLICATE_HELPER_NAMES = "RMR0017",
/** Attempted to chain a non chainable command. */
NON_CHAINABLE_COMMAND = "RMR0018",
/** The provided extension is invalid. */
INVALID_EXTENSION = "RMR0019",
/** The content provided to the editor is not supported. */
INVALID_CONTENT = "RMR0021",
/** An invalid name was used for the extension. */
INVALID_NAME = "RMR0050",
/** An error occurred within an extension. */
EXTENSION = "RMR0100",
/** The spec was defined without calling the `defaults`, `parse` or `dom` methods. */
EXTENSION_SPEC = "RMR0101",
/** Extra attributes must either be a string or an object. */
EXTENSION_EXTRA_ATTRIBUTES = "RMR0102",
/** A call to `extension.setOptions` was made with invalid keys. */
INVALID_SET_EXTENSION_OPTIONS = "RMR0103",
/**
* `useRemirror` was called outside of the remirror context. It can only be used
* within an active remirror context created by the `<Remirror />`.
*/
REACT_PROVIDER_CONTEXT = "RMR0200",
/**
* `getRootProps` has been called MULTIPLE times. It should only be called ONCE during render.
*/
REACT_GET_ROOT_PROPS = "RMR0201",
/**
* A problem occurred adding the editor view to the dom.
*/
REACT_EDITOR_VIEW = "RMR0202",
/**
* There is a problem with your controlled editor setup.
*/
REACT_CONTROLLED = "RMR0203",
/**
* Something went wrong with your custom ReactNodeView Component.
*/
REACT_NODE_VIEW = "RMR0204",
/**
* You attempted to call `getContext` provided by the `useRemirror` prop
* during the first render of the editor. This is not possible and should only
* be after the editor first mounts.
*/
REACT_GET_CONTEXT = "RMR0205",
/**
* An error occurred when rendering the react components.
*/
REACT_COMPONENTS = "RMR0206",
/**
* An error occurred within a remirror hook.
*/
REACT_HOOKS = "RMR0207",
/**
* There is something wrong with your i18n setup.
*/
I18N_CONTEXT = "RMR0300"
}
export { ErrorConstant }
export { ErrorConstant as ErrorConstant_alias_1 }
/**
* The priority of extension which determines what order it is loaded into the
* editor.
*
* @remarks
*
* Higher priority extension (higher numberic value) will ensure the extension
* has a higher preference in your editor. In the case where you load two
* identical extensions into your editor (same name, or same constructor), the
* extension with the higher priority is the one that will be loaded.
*
* The higher the numeric value the higher the priority. The priority can also
* be passed a number but naming things in this `enum` should help provide some
* context to the numbers.
*
* By default all extensions are created with a `ExtensionPriority.Default`.
*/
declare enum ExtensionPriority {
/**
* Use this **never** 😉
*/
Critical = 1000000,
/**
* A, like super duper, high priority.
*/
Highest = 100000,
/**
* The highest priority level that should be used in a publicly shared
* extension (to allow some wiggle room for downstream users overriding
* priorities).
*/
High = 10000,
/**
* A medium priority extension. This is typically all you need to take
* priority over built in extensions.
*/
Medium = 1000,
/**
* This is the **default** priority for most extensions.
*/
Default = 100,
/**
* This is the **default** priority for builtin behavior changing extensions.
*/
Low = 10,
/**
* This is useful for extensions that exist to be overridden.
*/
Lowest = 0
}
export { ExtensionPriority }
export { ExtensionPriority as ExtensionPriority_alias_1 }
/**
* The type for the extension tags..
*/
declare type ExtensionTag = Remirror.ExtensionTags & typeof BaseExtensionTag;
/**
* These are the default supported tag strings which help categorize different
* behaviors that extensions can exhibit.
*
* @remarks
*
* Any extension can register itself with multiple such behaviors and these
* categorizations can be used by other extensions when running commands and
* updating the document.
*/
declare const ExtensionTag: ExtensionTag;
export { ExtensionTag }
export { ExtensionTag as ExtensionTag_alias_1 }
/**
* The string values which can be used as extension tags.
*/
declare type ExtensionTagType = ExtensionTag[keyof ExtensionTag];
export { ExtensionTagType }
export { ExtensionTagType as ExtensionTagType_alias_1 }
/**
* ProseMirror uses the Unicode Character 'OBJECT REPLACEMENT CHARACTER'
* (U+FFFC) as text representation for leaf nodes, i.e. nodes that don't have
* any content or text property (e.g. hardBreak, emoji, mention, rule) It was
* introduced because of https://github.com/ProseMirror/prosemirror/issues/262
* This can be used in an input rule regex to be able to include or exclude such
* nodes.
*/
declare const LEAF_NODE_REPLACING_CHARACTER = "\uFFFC";
export { LEAF_NODE_REPLACING_CHARACTER }
export { LEAF_NODE_REPLACING_CHARACTER as LEAF_NODE_REPLACING_CHARACTER_alias_1 }
/**
* Identifies the stage the extension manager is at.
*/
declare enum ManagerPhase {
/**
* The initial value for the manager phase.
*/
None = 0,
/**
* When the extension manager is being created and the onCreate methods are
* being called.
*
* This happens within the RemirrorManager constructor.
*/
Create = 1,
/**
* When the view is being added and all `onView` lifecycle methods are being
* called. The view is typically added before the dom is ready for it.
*/
EditorView = 2,
/**
* The phases of creating this manager are completed and `onTransaction` is
* called every time the state updates.
*/
Runtime = 3,
/**
* The manager is being destroyed.
*/
Destroy = 4
}
export { ManagerPhase }
export { ManagerPhase as ManagerPhase_alias_1 }
/**
* A method for updating the extension tags.
*
* ```tsx
* import { ExtensionTag, mutateTag } from 'remirror';
*
* mutateTag((tag) => {
* tag.SuperCustom = 'superCustom';
* });
*
* declare global {
* namespace Remirror {
* interface ExtensionTag {
* SuperCustom: 'superCustom';
* }
* }
* }
*
*
* log(ExtensionTag.SuperCustom); // This is fine ✅
* log(ExtensionTag.NotDefined); // This will throw ❌
* ```
*/
declare function mutateTag(mutator: (Tag: ExtensionTag) => void): void;
export { mutateTag }
export { mutateTag as mutateTag_alias_1 }
/**
* The named shortcuts that can be used to update multiple commands.
*/
declare enum NamedShortcut {
Undo = "_|undo|_",
Redo = "_|redo|_",
Bold = "_|bold|_",
Italic = "_|italic|_",
Underline = "_|underline|_",
Strike = "_|strike|_",
Code = "_|code|_",
Paragraph = "_|paragraph|_",
H1 = "_|h1|_",
H2 = "_|h2|_",
H3 = "_|h3|_",
H4 = "_|h4|_",
H5 = "_|h5|_",
H6 = "_|h6|_",
TaskList = "_|task|_",
BulletList = "_|bullet|_",
OrderedList = "_|number|_",
Quote = "_|quote|_",
Divider = "_|divider|_",
Codeblock = "_|codeblock|_",
ClearFormatting = "_|clear|_",
Superscript = "_|sup|_",
Subscript = "_|sub|_",
LeftAlignment = "_|left-align|_",
CenterAlignment = "_|center-align|_",
RightAlignment = "_|right-align|_",
JustifyAlignment = "_|justify-align|_",
InsertLink = "_|link|_",
/** @deprecated */
Find = "_|find|_",
/** @deprecated */
FindBackwards = "_|find-backwards|_",
/** @deprecated */
FindReplace = "_|find-replace|_",
AddFootnote = "_|footnote|_",
AddComment = "_|comment|_",
ContextMenu = "_|context-menu|_",
IncreaseFontSize = "_|inc-font-size|_",
DecreaseFontSize = "_|dec-font-size|_",
IncreaseIndent = "_|indent|_",
DecreaseIndent = "_|dedent|_",
Shortcuts = "_|shortcuts|_",
Copy = "_|copy|_",
Cut = "_|cut|_",
Paste = "_|paste|_",
PastePlain = "_|paste-plain|_",
SelectAll = "_|select-all|_",
/**
* A keyboard shortcut to trigger formatting the current block.
*
* @defaultValue 'Alt-Shift-F' (Mac) | 'Shift-Ctrl-F' (PC)
*/
Format = "_|format|_"
}
export { NamedShortcut }
export { NamedShortcut as NamedShortcut_alias_1 }
/**
* The non breaking space character.
*/
declare const NON_BREAKING_SPACE_CHAR = "\u00A0";
export { NON_BREAKING_SPACE_CHAR }
export { NON_BREAKING_SPACE_CHAR as NON_BREAKING_SPACE_CHAR_alias_1 }
/**
* The null character.
*
* See {@link https://stackoverflow.com/a/6380172}
*/
declare const NULL_CHARACTER = "\0";
export { NULL_CHARACTER }
export { NULL_CHARACTER as NULL_CHARACTER_alias_1 }
/**
* The global name for the module exported by the remirror webview bundle.
*/
declare const REMIRROR_WEBVIEW_NAME = "$$__REMIRROR_WEBVIEW_BUNDLE__$$";
export { REMIRROR_WEBVIEW_NAME }
export { REMIRROR_WEBVIEW_NAME as REMIRROR_WEBVIEW_NAME_alias_1 }
/**
* These constants are stored on the `REMIRROR_IDENTIFIER_KEY` property of
* `remirror` related constructors and instances in order to identify them as
* being internal to Remirror.
*
* @remarks
*
* This helps to prevent issues around check types via `instanceof` which can
* lead to false negatives.
*
* @internal
*/
declare enum RemirrorIdentifier {
/**
* Identifies `PlainExtension`s.
*/
PlainExtension = "RemirrorPlainExtension",
/**
* Identifies `NodeExtension`s.
*/
NodeExtension = "RemirrorNodeExtension",
/**
* Identifies `MarkExtension`s.
*/
MarkExtension = "RemirrorMarkExtension",
/**
* Identifies `PlainExtensionConstructor`s.
*/
PlainExtensionConstructor = "RemirrorPlainExtensionConstructor",
/**
* Identifies `NodeExtensionConstructor`s.
*/
NodeExtensionConstructor = "RemirrorNodeExtensionConstructor",
/**
* Identifies `MarkExtensionConstructor`s.
*/
MarkExtensionConstructor = "RemirrorMarkExtensionConstructor",
/**
* The string used to identify an instance of the `Manager`
*/
Manager = "RemirrorManager",
/**
* The preset type identifier.
*/
Preset = "RemirrorPreset",
/**
* The preset type identifier.
*/
PresetConstructor = "RemirrorPresetConstructor"
}
export { RemirrorIdentifier }
export { RemirrorIdentifier as RemirrorIdentifier_alias_1 }
/**
* The css class added to a node that is selected.
*/
declare const SELECTED_NODE_CLASS_NAME = "ProseMirror-selectednode";
export { SELECTED_NODE_CLASS_NAME }
export { SELECTED_NODE_CLASS_NAME as SELECTED_NODE_CLASS_NAME_alias_1 }
/**
* The css selector for a selected node.
*/
declare const SELECTED_NODE_CLASS_SELECTOR: string;
export { SELECTED_NODE_CLASS_SELECTOR }
export { SELECTED_NODE_CLASS_SELECTOR as SELECTED_NODE_CLASS_SELECTOR_alias_1 }
/**
* Indicates that a state update was caused by an override and not via
* transactions or user commands.
*
* This is the case when `setContent` is called and for all `controlled` updates
* within a `react` editor instance.
*/
declare const STATE_OVERRIDE = "__state_override__";
export { STATE_OVERRIDE }
export { STATE_OVERRIDE as STATE_OVERRIDE_alias_1 }
/**
* A character useful for separating inline nodes.
*
* @remarks
* Typically used in decorations as follows.
*
* ```ts
* document.createTextNode(ZERO_WIDTH_SPACE_CHAR);
* ```
*
* This produces the html entity '8203'
*/
declare const ZERO_WIDTH_SPACE_CHAR = "\u200B";
export { ZERO_WIDTH_SPACE_CHAR }
export { ZERO_WIDTH_SPACE_CHAR as ZERO_WIDTH_SPACE_CHAR_alias_1 }
export { }
declare global {
namespace Remirror {
/**
* This interface is for extending the default `ExtensionTag`'s in your
* codebase with full type checking support.
*/
interface ExtensionTags {}
}
}

View File

@@ -0,0 +1,314 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
EMPTY_ARRAY: () => EMPTY_ARRAY,
EMPTY_NODE: () => EMPTY_NODE,
EMPTY_PARAGRAPH_NODE: () => EMPTY_PARAGRAPH_NODE,
ErrorConstant: () => ErrorConstant,
ExtensionPriority: () => ExtensionPriority,
ExtensionTag: () => ExtensionTag,
LEAF_NODE_REPLACING_CHARACTER: () => LEAF_NODE_REPLACING_CHARACTER,
ManagerPhase: () => ManagerPhase,
NON_BREAKING_SPACE_CHAR: () => NON_BREAKING_SPACE_CHAR,
NULL_CHARACTER: () => NULL_CHARACTER,
NamedShortcut: () => NamedShortcut,
REMIRROR_WEBVIEW_NAME: () => REMIRROR_WEBVIEW_NAME,
RemirrorIdentifier: () => RemirrorIdentifier,
SELECTED_NODE_CLASS_NAME: () => SELECTED_NODE_CLASS_NAME,
SELECTED_NODE_CLASS_SELECTOR: () => SELECTED_NODE_CLASS_SELECTOR,
STATE_OVERRIDE: () => STATE_OVERRIDE,
ZERO_WIDTH_SPACE_CHAR: () => ZERO_WIDTH_SPACE_CHAR,
__INTERNAL_REMIRROR_IDENTIFIER_KEY__: () => __INTERNAL_REMIRROR_IDENTIFIER_KEY__,
mutateTag: () => mutateTag
});
module.exports = __toCommonJS(src_exports);
// src/core-constants.ts
var SELECTED_NODE_CLASS_NAME = "ProseMirror-selectednode";
var SELECTED_NODE_CLASS_SELECTOR = ".".concat(SELECTED_NODE_CLASS_NAME);
var LEAF_NODE_REPLACING_CHARACTER = "\uFFFC";
var NULL_CHARACTER = "\0";
var STATE_OVERRIDE = "__state_override__";
var REMIRROR_WEBVIEW_NAME = "$$__REMIRROR_WEBVIEW_BUNDLE__$$";
var ZERO_WIDTH_SPACE_CHAR = "\u200B";
var NON_BREAKING_SPACE_CHAR = "\xA0";
var EMPTY_PARAGRAPH_NODE = {
type: "doc",
content: [
{
type: "paragraph"
}
]
};
var EMPTY_NODE = {
type: "doc",
content: []
};
function mutateTag(mutator) {
mutator(BaseExtensionTag);
}
var BaseExtensionTag = {
/**
* Describes a node that can be used as the last node of a document and
* doesn't need to have anything else rendered after itself.
*
* @remarks
*
* e.g. `paragraph`
*/
LastNodeCompatible: "lastNodeCompatible",
/**
* A mark that is used to change the formatting of the node it wraps.
*
* @remarks
*
* e.g. `bold`, `italic`
*/
FormattingMark: "formattingMark",
/**
* A node that formats text in a non-standard way.
*
* @remarks
*
* e.g. `codeBlock`, `heading`, `blockquote`
*/
FormattingNode: "formattingNode",
/**
* Identifies a node which has problems with cursor navigation.
*
* @remarks
*
* When this tag is added to an extension this will be picked up by
* behavioural extensions such as the NodeCursorExtension which makes hard to
* reach nodes reachable using keyboard arrows.
*/
NodeCursor: "nodeCursor",
/**
* Mark group for font styling (e.g. bold, italic, underline, superscript).
*/
FontStyle: "fontStyle",
/**
* Mark groups for links.
*/
Link: "link",
/**
* Mark groups for colors (text-color, background-color, etc).
*/
Color: "color",
/**
* Mark group for alignment.
*/
Alignment: "alignment",
/**
* Mark group for indentation.
*/
Indentation: "indentation",
/**
* Extension which affect the behaviour of the content. Can be nodes marks or
* plain.
*/
Behavior: "behavior",
/**
* Marks and nodes which contain code.
*/
Code: "code",
/**
* Whether this node is an inline node.
*
* - `text` is an inline node, but `paragraph` is a block node.
*/
InlineNode: "inline",
/**
* This is a node that can contain list items.
*/
ListContainerNode: "listContainer",
/**
* Tags the extension as a list item node which can be contained by
* [[`ExtensionTag.ListNode`]].
*/
ListItemNode: "listItemNode",
/**
* Sets this as a block level node.
*/
Block: "block",
/**
* @deprecate use `ExtensionTags.Block` instead.
*/
BlockNode: "block",
/**
* Set this as a text block
*/
TextBlock: "textBlock",
/**
* A tag that excludes this from input rules.
*/
ExcludeInputRules: "excludeFromInputRules",
/**
* A mark or node that can't be exited when at the end and beginning of the
* document with an arrow key or backspace key.
*/
PreventExits: "preventsExits",
/**
* Represents a media compatible node.
*/
Media: "media"
};
var ExtensionTag = BaseExtensionTag;
var __INTERNAL_REMIRROR_IDENTIFIER_KEY__ = Symbol.for("__remirror__");
var RemirrorIdentifier = /* @__PURE__ */ ((RemirrorIdentifier2) => {
RemirrorIdentifier2["PlainExtension"] = "RemirrorPlainExtension";
RemirrorIdentifier2["NodeExtension"] = "RemirrorNodeExtension";
RemirrorIdentifier2["MarkExtension"] = "RemirrorMarkExtension";
RemirrorIdentifier2["PlainExtensionConstructor"] = "RemirrorPlainExtensionConstructor";
RemirrorIdentifier2["NodeExtensionConstructor"] = "RemirrorNodeExtensionConstructor";
RemirrorIdentifier2["MarkExtensionConstructor"] = "RemirrorMarkExtensionConstructor";
RemirrorIdentifier2["Manager"] = "RemirrorManager";
RemirrorIdentifier2["Preset"] = "RemirrorPreset";
RemirrorIdentifier2["PresetConstructor"] = "RemirrorPresetConstructor";
return RemirrorIdentifier2;
})(RemirrorIdentifier || {});
var ExtensionPriority = /* @__PURE__ */ ((ExtensionPriority2) => {
ExtensionPriority2[ExtensionPriority2["Critical"] = 1e6] = "Critical";
ExtensionPriority2[ExtensionPriority2["Highest"] = 1e5] = "Highest";
ExtensionPriority2[ExtensionPriority2["High"] = 1e4] = "High";
ExtensionPriority2[ExtensionPriority2["Medium"] = 1e3] = "Medium";
ExtensionPriority2[ExtensionPriority2["Default"] = 100] = "Default";
ExtensionPriority2[ExtensionPriority2["Low"] = 10] = "Low";
ExtensionPriority2[ExtensionPriority2["Lowest"] = 0] = "Lowest";
return ExtensionPriority2;
})(ExtensionPriority || {});
var ManagerPhase = /* @__PURE__ */ ((ManagerPhase2) => {
ManagerPhase2[ManagerPhase2["None"] = 0] = "None";
ManagerPhase2[ManagerPhase2["Create"] = 1] = "Create";
ManagerPhase2[ManagerPhase2["EditorView"] = 2] = "EditorView";
ManagerPhase2[ManagerPhase2["Runtime"] = 3] = "Runtime";
ManagerPhase2[ManagerPhase2["Destroy"] = 4] = "Destroy";
return ManagerPhase2;
})(ManagerPhase || {});
var NamedShortcut = /* @__PURE__ */ ((NamedShortcut2) => {
NamedShortcut2["Undo"] = "_|undo|_";
NamedShortcut2["Redo"] = "_|redo|_";
NamedShortcut2["Bold"] = "_|bold|_";
NamedShortcut2["Italic"] = "_|italic|_";
NamedShortcut2["Underline"] = "_|underline|_";
NamedShortcut2["Strike"] = "_|strike|_";
NamedShortcut2["Code"] = "_|code|_";
NamedShortcut2["Paragraph"] = "_|paragraph|_";
NamedShortcut2["H1"] = "_|h1|_";
NamedShortcut2["H2"] = "_|h2|_";
NamedShortcut2["H3"] = "_|h3|_";
NamedShortcut2["H4"] = "_|h4|_";
NamedShortcut2["H5"] = "_|h5|_";
NamedShortcut2["H6"] = "_|h6|_";
NamedShortcut2["TaskList"] = "_|task|_";
NamedShortcut2["BulletList"] = "_|bullet|_";
NamedShortcut2["OrderedList"] = "_|number|_";
NamedShortcut2["Quote"] = "_|quote|_";
NamedShortcut2["Divider"] = "_|divider|_";
NamedShortcut2["Codeblock"] = "_|codeblock|_";
NamedShortcut2["ClearFormatting"] = "_|clear|_";
NamedShortcut2["Superscript"] = "_|sup|_";
NamedShortcut2["Subscript"] = "_|sub|_";
NamedShortcut2["LeftAlignment"] = "_|left-align|_";
NamedShortcut2["CenterAlignment"] = "_|center-align|_";
NamedShortcut2["RightAlignment"] = "_|right-align|_";
NamedShortcut2["JustifyAlignment"] = "_|justify-align|_";
NamedShortcut2["InsertLink"] = "_|link|_";
NamedShortcut2["Find"] = "_|find|_";
NamedShortcut2["FindBackwards"] = "_|find-backwards|_";
NamedShortcut2["FindReplace"] = "_|find-replace|_";
NamedShortcut2["AddFootnote"] = "_|footnote|_";
NamedShortcut2["AddComment"] = "_|comment|_";
NamedShortcut2["ContextMenu"] = "_|context-menu|_";
NamedShortcut2["IncreaseFontSize"] = "_|inc-font-size|_";
NamedShortcut2["DecreaseFontSize"] = "_|dec-font-size|_";
NamedShortcut2["IncreaseIndent"] = "_|indent|_";
NamedShortcut2["DecreaseIndent"] = "_|dedent|_";
NamedShortcut2["Shortcuts"] = "_|shortcuts|_";
NamedShortcut2["Copy"] = "_|copy|_";
NamedShortcut2["Cut"] = "_|cut|_";
NamedShortcut2["Paste"] = "_|paste|_";
NamedShortcut2["PastePlain"] = "_|paste-plain|_";
NamedShortcut2["SelectAll"] = "_|select-all|_";
NamedShortcut2["Format"] = "_|format|_";
return NamedShortcut2;
})(NamedShortcut || {});
var EMPTY_ARRAY = [];
// src/error-constants.ts
var ErrorConstant = /* @__PURE__ */ ((ErrorConstant2) => {
ErrorConstant2["UNKNOWN"] = "RMR0001";
ErrorConstant2["INVALID_COMMAND_ARGUMENTS"] = "RMR0002";
ErrorConstant2["CUSTOM"] = "RMR0003";
ErrorConstant2["CORE_HELPERS"] = "RMR0004";
ErrorConstant2["MUTATION"] = "RMR0005";
ErrorConstant2["INTERNAL"] = "RMR0006";
ErrorConstant2["MISSING_REQUIRED_EXTENSION"] = "RMR0007";
ErrorConstant2["MANAGER_PHASE_ERROR"] = "RMR0008";
ErrorConstant2["INVALID_GET_EXTENSION"] = "RMR0010";
ErrorConstant2["INVALID_MANAGER_ARGUMENTS"] = "RMR0011";
ErrorConstant2["SCHEMA"] = "RMR0012";
ErrorConstant2["HELPERS_CALLED_IN_OUTER_SCOPE"] = "RMR0013";
ErrorConstant2["INVALID_MANAGER_EXTENSION"] = "RMR0014";
ErrorConstant2["DUPLICATE_COMMAND_NAMES"] = "RMR0016";
ErrorConstant2["DUPLICATE_HELPER_NAMES"] = "RMR0017";
ErrorConstant2["NON_CHAINABLE_COMMAND"] = "RMR0018";
ErrorConstant2["INVALID_EXTENSION"] = "RMR0019";
ErrorConstant2["INVALID_CONTENT"] = "RMR0021";
ErrorConstant2["INVALID_NAME"] = "RMR0050";
ErrorConstant2["EXTENSION"] = "RMR0100";
ErrorConstant2["EXTENSION_SPEC"] = "RMR0101";
ErrorConstant2["EXTENSION_EXTRA_ATTRIBUTES"] = "RMR0102";
ErrorConstant2["INVALID_SET_EXTENSION_OPTIONS"] = "RMR0103";
ErrorConstant2["REACT_PROVIDER_CONTEXT"] = "RMR0200";
ErrorConstant2["REACT_GET_ROOT_PROPS"] = "RMR0201";
ErrorConstant2["REACT_EDITOR_VIEW"] = "RMR0202";
ErrorConstant2["REACT_CONTROLLED"] = "RMR0203";
ErrorConstant2["REACT_NODE_VIEW"] = "RMR0204";
ErrorConstant2["REACT_GET_CONTEXT"] = "RMR0205";
ErrorConstant2["REACT_COMPONENTS"] = "RMR0206";
ErrorConstant2["REACT_HOOKS"] = "RMR0207";
ErrorConstant2["I18N_CONTEXT"] = "RMR0300";
return ErrorConstant2;
})(ErrorConstant || {});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
EMPTY_ARRAY,
EMPTY_NODE,
EMPTY_PARAGRAPH_NODE,
ErrorConstant,
ExtensionPriority,
ExtensionTag,
LEAF_NODE_REPLACING_CHARACTER,
ManagerPhase,
NON_BREAKING_SPACE_CHAR,
NULL_CHARACTER,
NamedShortcut,
REMIRROR_WEBVIEW_NAME,
RemirrorIdentifier,
SELECTED_NODE_CLASS_NAME,
SELECTED_NODE_CLASS_SELECTOR,
STATE_OVERRIDE,
ZERO_WIDTH_SPACE_CHAR,
__INTERNAL_REMIRROR_IDENTIFIER_KEY__,
mutateTag
});

View File

@@ -0,0 +1,20 @@
export { ErrorConstant_alias_1 as ErrorConstant } from './_tsup-dts-rollup';
export { mutateTag_alias_1 as mutateTag } from './_tsup-dts-rollup';
export { SELECTED_NODE_CLASS_NAME_alias_1 as SELECTED_NODE_CLASS_NAME } from './_tsup-dts-rollup';
export { SELECTED_NODE_CLASS_SELECTOR_alias_1 as SELECTED_NODE_CLASS_SELECTOR } from './_tsup-dts-rollup';
export { LEAF_NODE_REPLACING_CHARACTER_alias_1 as LEAF_NODE_REPLACING_CHARACTER } from './_tsup-dts-rollup';
export { NULL_CHARACTER_alias_1 as NULL_CHARACTER } from './_tsup-dts-rollup';
export { STATE_OVERRIDE_alias_1 as STATE_OVERRIDE } from './_tsup-dts-rollup';
export { REMIRROR_WEBVIEW_NAME_alias_1 as REMIRROR_WEBVIEW_NAME } from './_tsup-dts-rollup';
export { ZERO_WIDTH_SPACE_CHAR_alias_1 as ZERO_WIDTH_SPACE_CHAR } from './_tsup-dts-rollup';
export { NON_BREAKING_SPACE_CHAR_alias_1 as NON_BREAKING_SPACE_CHAR } from './_tsup-dts-rollup';
export { EMPTY_PARAGRAPH_NODE_alias_1 as EMPTY_PARAGRAPH_NODE } from './_tsup-dts-rollup';
export { EMPTY_NODE_alias_1 as EMPTY_NODE } from './_tsup-dts-rollup';
export { ExtensionTag_alias_1 as ExtensionTag } from './_tsup-dts-rollup';
export { ExtensionTagType_alias_1 as ExtensionTagType } from './_tsup-dts-rollup';
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY___alias_1 as __INTERNAL_REMIRROR_IDENTIFIER_KEY__ } from './_tsup-dts-rollup';
export { RemirrorIdentifier_alias_1 as RemirrorIdentifier } from './_tsup-dts-rollup';
export { ExtensionPriority_alias_1 as ExtensionPriority } from './_tsup-dts-rollup';
export { ManagerPhase_alias_1 as ManagerPhase } from './_tsup-dts-rollup';
export { NamedShortcut_alias_1 as NamedShortcut } from './_tsup-dts-rollup';
export { EMPTY_ARRAY_alias_1 as EMPTY_ARRAY } from './_tsup-dts-rollup';

View File

@@ -0,0 +1,20 @@
export { ErrorConstant_alias_1 as ErrorConstant } from './_tsup-dts-rollup';
export { mutateTag_alias_1 as mutateTag } from './_tsup-dts-rollup';
export { SELECTED_NODE_CLASS_NAME_alias_1 as SELECTED_NODE_CLASS_NAME } from './_tsup-dts-rollup';
export { SELECTED_NODE_CLASS_SELECTOR_alias_1 as SELECTED_NODE_CLASS_SELECTOR } from './_tsup-dts-rollup';
export { LEAF_NODE_REPLACING_CHARACTER_alias_1 as LEAF_NODE_REPLACING_CHARACTER } from './_tsup-dts-rollup';
export { NULL_CHARACTER_alias_1 as NULL_CHARACTER } from './_tsup-dts-rollup';
export { STATE_OVERRIDE_alias_1 as STATE_OVERRIDE } from './_tsup-dts-rollup';
export { REMIRROR_WEBVIEW_NAME_alias_1 as REMIRROR_WEBVIEW_NAME } from './_tsup-dts-rollup';
export { ZERO_WIDTH_SPACE_CHAR_alias_1 as ZERO_WIDTH_SPACE_CHAR } from './_tsup-dts-rollup';
export { NON_BREAKING_SPACE_CHAR_alias_1 as NON_BREAKING_SPACE_CHAR } from './_tsup-dts-rollup';
export { EMPTY_PARAGRAPH_NODE_alias_1 as EMPTY_PARAGRAPH_NODE } from './_tsup-dts-rollup';
export { EMPTY_NODE_alias_1 as EMPTY_NODE } from './_tsup-dts-rollup';
export { ExtensionTag_alias_1 as ExtensionTag } from './_tsup-dts-rollup';
export { ExtensionTagType_alias_1 as ExtensionTagType } from './_tsup-dts-rollup';
export { __INTERNAL_REMIRROR_IDENTIFIER_KEY___alias_1 as __INTERNAL_REMIRROR_IDENTIFIER_KEY__ } from './_tsup-dts-rollup';
export { RemirrorIdentifier_alias_1 as RemirrorIdentifier } from './_tsup-dts-rollup';
export { ExtensionPriority_alias_1 as ExtensionPriority } from './_tsup-dts-rollup';
export { ManagerPhase_alias_1 as ManagerPhase } from './_tsup-dts-rollup';
export { NamedShortcut_alias_1 as NamedShortcut } from './_tsup-dts-rollup';
export { EMPTY_ARRAY_alias_1 as EMPTY_ARRAY } from './_tsup-dts-rollup';

View File

@@ -0,0 +1,269 @@
// src/core-constants.ts
var SELECTED_NODE_CLASS_NAME = "ProseMirror-selectednode";
var SELECTED_NODE_CLASS_SELECTOR = ".".concat(SELECTED_NODE_CLASS_NAME);
var LEAF_NODE_REPLACING_CHARACTER = "\uFFFC";
var NULL_CHARACTER = "\0";
var STATE_OVERRIDE = "__state_override__";
var REMIRROR_WEBVIEW_NAME = "$$__REMIRROR_WEBVIEW_BUNDLE__$$";
var ZERO_WIDTH_SPACE_CHAR = "\u200B";
var NON_BREAKING_SPACE_CHAR = "\xA0";
var EMPTY_PARAGRAPH_NODE = {
type: "doc",
content: [
{
type: "paragraph"
}
]
};
var EMPTY_NODE = {
type: "doc",
content: []
};
function mutateTag(mutator) {
mutator(BaseExtensionTag);
}
var BaseExtensionTag = {
/**
* Describes a node that can be used as the last node of a document and
* doesn't need to have anything else rendered after itself.
*
* @remarks
*
* e.g. `paragraph`
*/
LastNodeCompatible: "lastNodeCompatible",
/**
* A mark that is used to change the formatting of the node it wraps.
*
* @remarks
*
* e.g. `bold`, `italic`
*/
FormattingMark: "formattingMark",
/**
* A node that formats text in a non-standard way.
*
* @remarks
*
* e.g. `codeBlock`, `heading`, `blockquote`
*/
FormattingNode: "formattingNode",
/**
* Identifies a node which has problems with cursor navigation.
*
* @remarks
*
* When this tag is added to an extension this will be picked up by
* behavioural extensions such as the NodeCursorExtension which makes hard to
* reach nodes reachable using keyboard arrows.
*/
NodeCursor: "nodeCursor",
/**
* Mark group for font styling (e.g. bold, italic, underline, superscript).
*/
FontStyle: "fontStyle",
/**
* Mark groups for links.
*/
Link: "link",
/**
* Mark groups for colors (text-color, background-color, etc).
*/
Color: "color",
/**
* Mark group for alignment.
*/
Alignment: "alignment",
/**
* Mark group for indentation.
*/
Indentation: "indentation",
/**
* Extension which affect the behaviour of the content. Can be nodes marks or
* plain.
*/
Behavior: "behavior",
/**
* Marks and nodes which contain code.
*/
Code: "code",
/**
* Whether this node is an inline node.
*
* - `text` is an inline node, but `paragraph` is a block node.
*/
InlineNode: "inline",
/**
* This is a node that can contain list items.
*/
ListContainerNode: "listContainer",
/**
* Tags the extension as a list item node which can be contained by
* [[`ExtensionTag.ListNode`]].
*/
ListItemNode: "listItemNode",
/**
* Sets this as a block level node.
*/
Block: "block",
/**
* @deprecate use `ExtensionTags.Block` instead.
*/
BlockNode: "block",
/**
* Set this as a text block
*/
TextBlock: "textBlock",
/**
* A tag that excludes this from input rules.
*/
ExcludeInputRules: "excludeFromInputRules",
/**
* A mark or node that can't be exited when at the end and beginning of the
* document with an arrow key or backspace key.
*/
PreventExits: "preventsExits",
/**
* Represents a media compatible node.
*/
Media: "media"
};
var ExtensionTag = BaseExtensionTag;
var __INTERNAL_REMIRROR_IDENTIFIER_KEY__ = Symbol.for("__remirror__");
var RemirrorIdentifier = /* @__PURE__ */ ((RemirrorIdentifier2) => {
RemirrorIdentifier2["PlainExtension"] = "RemirrorPlainExtension";
RemirrorIdentifier2["NodeExtension"] = "RemirrorNodeExtension";
RemirrorIdentifier2["MarkExtension"] = "RemirrorMarkExtension";
RemirrorIdentifier2["PlainExtensionConstructor"] = "RemirrorPlainExtensionConstructor";
RemirrorIdentifier2["NodeExtensionConstructor"] = "RemirrorNodeExtensionConstructor";
RemirrorIdentifier2["MarkExtensionConstructor"] = "RemirrorMarkExtensionConstructor";
RemirrorIdentifier2["Manager"] = "RemirrorManager";
RemirrorIdentifier2["Preset"] = "RemirrorPreset";
RemirrorIdentifier2["PresetConstructor"] = "RemirrorPresetConstructor";
return RemirrorIdentifier2;
})(RemirrorIdentifier || {});
var ExtensionPriority = /* @__PURE__ */ ((ExtensionPriority2) => {
ExtensionPriority2[ExtensionPriority2["Critical"] = 1e6] = "Critical";
ExtensionPriority2[ExtensionPriority2["Highest"] = 1e5] = "Highest";
ExtensionPriority2[ExtensionPriority2["High"] = 1e4] = "High";
ExtensionPriority2[ExtensionPriority2["Medium"] = 1e3] = "Medium";
ExtensionPriority2[ExtensionPriority2["Default"] = 100] = "Default";
ExtensionPriority2[ExtensionPriority2["Low"] = 10] = "Low";
ExtensionPriority2[ExtensionPriority2["Lowest"] = 0] = "Lowest";
return ExtensionPriority2;
})(ExtensionPriority || {});
var ManagerPhase = /* @__PURE__ */ ((ManagerPhase2) => {
ManagerPhase2[ManagerPhase2["None"] = 0] = "None";
ManagerPhase2[ManagerPhase2["Create"] = 1] = "Create";
ManagerPhase2[ManagerPhase2["EditorView"] = 2] = "EditorView";
ManagerPhase2[ManagerPhase2["Runtime"] = 3] = "Runtime";
ManagerPhase2[ManagerPhase2["Destroy"] = 4] = "Destroy";
return ManagerPhase2;
})(ManagerPhase || {});
var NamedShortcut = /* @__PURE__ */ ((NamedShortcut2) => {
NamedShortcut2["Undo"] = "_|undo|_";
NamedShortcut2["Redo"] = "_|redo|_";
NamedShortcut2["Bold"] = "_|bold|_";
NamedShortcut2["Italic"] = "_|italic|_";
NamedShortcut2["Underline"] = "_|underline|_";
NamedShortcut2["Strike"] = "_|strike|_";
NamedShortcut2["Code"] = "_|code|_";
NamedShortcut2["Paragraph"] = "_|paragraph|_";
NamedShortcut2["H1"] = "_|h1|_";
NamedShortcut2["H2"] = "_|h2|_";
NamedShortcut2["H3"] = "_|h3|_";
NamedShortcut2["H4"] = "_|h4|_";
NamedShortcut2["H5"] = "_|h5|_";
NamedShortcut2["H6"] = "_|h6|_";
NamedShortcut2["TaskList"] = "_|task|_";
NamedShortcut2["BulletList"] = "_|bullet|_";
NamedShortcut2["OrderedList"] = "_|number|_";
NamedShortcut2["Quote"] = "_|quote|_";
NamedShortcut2["Divider"] = "_|divider|_";
NamedShortcut2["Codeblock"] = "_|codeblock|_";
NamedShortcut2["ClearFormatting"] = "_|clear|_";
NamedShortcut2["Superscript"] = "_|sup|_";
NamedShortcut2["Subscript"] = "_|sub|_";
NamedShortcut2["LeftAlignment"] = "_|left-align|_";
NamedShortcut2["CenterAlignment"] = "_|center-align|_";
NamedShortcut2["RightAlignment"] = "_|right-align|_";
NamedShortcut2["JustifyAlignment"] = "_|justify-align|_";
NamedShortcut2["InsertLink"] = "_|link|_";
NamedShortcut2["Find"] = "_|find|_";
NamedShortcut2["FindBackwards"] = "_|find-backwards|_";
NamedShortcut2["FindReplace"] = "_|find-replace|_";
NamedShortcut2["AddFootnote"] = "_|footnote|_";
NamedShortcut2["AddComment"] = "_|comment|_";
NamedShortcut2["ContextMenu"] = "_|context-menu|_";
NamedShortcut2["IncreaseFontSize"] = "_|inc-font-size|_";
NamedShortcut2["DecreaseFontSize"] = "_|dec-font-size|_";
NamedShortcut2["IncreaseIndent"] = "_|indent|_";
NamedShortcut2["DecreaseIndent"] = "_|dedent|_";
NamedShortcut2["Shortcuts"] = "_|shortcuts|_";
NamedShortcut2["Copy"] = "_|copy|_";
NamedShortcut2["Cut"] = "_|cut|_";
NamedShortcut2["Paste"] = "_|paste|_";
NamedShortcut2["PastePlain"] = "_|paste-plain|_";
NamedShortcut2["SelectAll"] = "_|select-all|_";
NamedShortcut2["Format"] = "_|format|_";
return NamedShortcut2;
})(NamedShortcut || {});
var EMPTY_ARRAY = [];
// src/error-constants.ts
var ErrorConstant = /* @__PURE__ */ ((ErrorConstant2) => {
ErrorConstant2["UNKNOWN"] = "RMR0001";
ErrorConstant2["INVALID_COMMAND_ARGUMENTS"] = "RMR0002";
ErrorConstant2["CUSTOM"] = "RMR0003";
ErrorConstant2["CORE_HELPERS"] = "RMR0004";
ErrorConstant2["MUTATION"] = "RMR0005";
ErrorConstant2["INTERNAL"] = "RMR0006";
ErrorConstant2["MISSING_REQUIRED_EXTENSION"] = "RMR0007";
ErrorConstant2["MANAGER_PHASE_ERROR"] = "RMR0008";
ErrorConstant2["INVALID_GET_EXTENSION"] = "RMR0010";
ErrorConstant2["INVALID_MANAGER_ARGUMENTS"] = "RMR0011";
ErrorConstant2["SCHEMA"] = "RMR0012";
ErrorConstant2["HELPERS_CALLED_IN_OUTER_SCOPE"] = "RMR0013";
ErrorConstant2["INVALID_MANAGER_EXTENSION"] = "RMR0014";
ErrorConstant2["DUPLICATE_COMMAND_NAMES"] = "RMR0016";
ErrorConstant2["DUPLICATE_HELPER_NAMES"] = "RMR0017";
ErrorConstant2["NON_CHAINABLE_COMMAND"] = "RMR0018";
ErrorConstant2["INVALID_EXTENSION"] = "RMR0019";
ErrorConstant2["INVALID_CONTENT"] = "RMR0021";
ErrorConstant2["INVALID_NAME"] = "RMR0050";
ErrorConstant2["EXTENSION"] = "RMR0100";
ErrorConstant2["EXTENSION_SPEC"] = "RMR0101";
ErrorConstant2["EXTENSION_EXTRA_ATTRIBUTES"] = "RMR0102";
ErrorConstant2["INVALID_SET_EXTENSION_OPTIONS"] = "RMR0103";
ErrorConstant2["REACT_PROVIDER_CONTEXT"] = "RMR0200";
ErrorConstant2["REACT_GET_ROOT_PROPS"] = "RMR0201";
ErrorConstant2["REACT_EDITOR_VIEW"] = "RMR0202";
ErrorConstant2["REACT_CONTROLLED"] = "RMR0203";
ErrorConstant2["REACT_NODE_VIEW"] = "RMR0204";
ErrorConstant2["REACT_GET_CONTEXT"] = "RMR0205";
ErrorConstant2["REACT_COMPONENTS"] = "RMR0206";
ErrorConstant2["REACT_HOOKS"] = "RMR0207";
ErrorConstant2["I18N_CONTEXT"] = "RMR0300";
return ErrorConstant2;
})(ErrorConstant || {});
export {
EMPTY_ARRAY,
EMPTY_NODE,
EMPTY_PARAGRAPH_NODE,
ErrorConstant,
ExtensionPriority,
ExtensionTag,
LEAF_NODE_REPLACING_CHARACTER,
ManagerPhase,
NON_BREAKING_SPACE_CHAR,
NULL_CHARACTER,
NamedShortcut,
REMIRROR_WEBVIEW_NAME,
RemirrorIdentifier,
SELECTED_NODE_CLASS_NAME,
SELECTED_NODE_CLASS_SELECTOR,
STATE_OVERRIDE,
ZERO_WIDTH_SPACE_CHAR,
__INTERNAL_REMIRROR_IDENTIFIER_KEY__,
mutateTag
};

45
node_modules/@remirror/core-constants/package.json generated vendored Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "@remirror/core-constants",
"version": "3.0.0",
"description": "The core constants used throughout the remirror codebase",
"homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/remirror__core-constants",
"repository": {
"type": "git",
"url": "https://github.com/remirror/remirror.git",
"directory": "packages/remirror__core-constants"
},
"license": "MIT",
"contributors": [
"Ifiok Jr. <ifiokotung@gmail.com>"
],
"sideEffects": false,
"type": "module",
"exports": {
".": {
"types": "./dist/remirror-core-constants.d.ts",
"import": "./dist/remirror-core-constants.js",
"require": "./dist/remirror-core-constants.cjs"
},
"./package.json": "./package.json"
},
"main": "./dist/remirror-core-constants.cjs",
"module": "./dist/remirror-core-constants.js",
"types": "./dist/remirror-core-constants.d.ts",
"files": [
"dist",
"dist-types"
],
"dependencies": {},
"devDependencies": {
"@remirror/cli": "1.1.0"
},
"publishConfig": {
"access": "public"
},
"@remirror": {
"sizeLimit": "2 KB"
},
"scripts": {
"build": "remirror-cli build"
}
}

17
node_modules/@remirror/core-constants/readme.md generated vendored Normal file
View File

@@ -0,0 +1,17 @@
# @remirror/core-constants
> core constants used throughout the `remirror` codebase.
[![Version][version]][npm] [![Weekly Downloads][downloads-badge]][npm] [![Bundled size][size-badge]][size] [![Typed Codebase][typescript]](#) [![MIT License][license]](#)
[version]: https://flat.badgen.net/npm/v/@remirror/core-constants
[npm]: https://npmjs.com/package/@remirror/core-constants
[license]: https://flat.badgen.net/badge/license/MIT/purple
[size]: https://bundlephobia.com/result?p=@remirror/core-constants
[size-badge]: https://flat.badgen.net/bundlephobia/minzip/@remirror/core-constants
[typescript]: https://flat.badgen.net/badge/icon/TypeScript?icon=typescript&label
[downloads-badge]: https://badgen.net/npm/dw/@remirror/core-constants/red?icon=npm
## Installation
This is included by default when you install the recommended `remirror` package. All exports are also available via `remirror/core/constants` and `remirror/core`.