@bangle.dev/core
Advanced tools
Comparing version 0.20.0 to 0.21.0
@@ -0,7 +1,6 @@ | ||
import { isTestEnv } from '@bangle.dev/js-utils'; | ||
import { toHTMLString } from '@bangle.dev/pm-utils'; | ||
import { DirectEditorProps, EditorView } from 'prosemirror-view'; | ||
import { BangleEditorState } from './bangle-editor-state'; | ||
import { isTestEnv } from './utils/environment'; | ||
import { toHTMLString } from './utils/pm-utils'; | ||
type PMViewOpts = Omit< | ||
@@ -8,0 +7,0 @@ DirectEditorProps, |
@@ -6,8 +6,7 @@ /** | ||
/** @jsx psx */ | ||
import { SpecRegistry } from '@bangle.dev/core/index'; | ||
import { components } from '@bangle.dev/core'; | ||
import { components, SpecRegistry } from '@bangle.dev/core'; | ||
import { | ||
createPSXFragment, | ||
psx, | ||
renderTestEditor, | ||
createPSXFragment, | ||
} from '@bangle.dev/core/test-helpers/test-helpers'; | ||
@@ -14,0 +13,0 @@ import { toggleHeadingCollapse, uncollapseAllHeadings } from '../heading'; |
@@ -14,3 +14,3 @@ /** | ||
import { sleep } from '../../utils/js-utils'; | ||
import { sleep } from '@bangle.dev/js-utils'; | ||
@@ -17,0 +17,0 @@ const testEditor = renderTestEditor({}); |
@@ -0,10 +1,13 @@ | ||
import { | ||
filter, | ||
findParentNodeOfType, | ||
insertEmpty, | ||
} from '@bangle.dev/pm-utils'; | ||
import { Command, wrapIn } from 'prosemirror-commands'; | ||
import { wrappingInputRule } from 'prosemirror-inputrules'; | ||
import { wrapIn, Command } from 'prosemirror-commands'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { Schema, Node } from 'prosemirror-model'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
import { copyEmptyCommand, cutEmptyCommand, moveNode } from '../core-commands'; | ||
import { insertEmpty, filter, findParentNodeOfType } from '../utils/pm-utils'; | ||
@@ -11,0 +14,0 @@ export const spec = specFactory; |
@@ -7,3 +7,3 @@ import { toggleMark, Command } from 'prosemirror-commands'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
@@ -10,0 +10,0 @@ export const spec = specFactory; |
@@ -1,11 +0,14 @@ | ||
import { keymap } from 'prosemirror-keymap'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import { setBlockType } from 'prosemirror-commands'; | ||
import { textblockTypeInputRule } from 'prosemirror-inputrules'; | ||
import { Node } from 'prosemirror-model'; | ||
import { filter, insertEmpty, findParentNodeOfType } from '../utils/pm-utils'; | ||
import { moveNode } from '../core-commands'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Schema } from 'prosemirror-model'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import { moveNode } from '../core-commands'; | ||
import { | ||
filter, | ||
findParentNodeOfType, | ||
insertEmpty, | ||
} from '@bangle.dev/pm-utils'; | ||
@@ -12,0 +15,0 @@ export const spec = specFactory; |
import { Command, toggleMark } from 'prosemirror-commands'; | ||
import { markInputRule } from '../utils/mark-input-rule'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { isMarkActiveInSelection, filter } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection, filter } from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
@@ -6,0 +6,0 @@ import { EditorState, Selection, TextSelection } from 'prosemirror-state'; |
@@ -1,2 +0,3 @@ | ||
import { Plugin, PluginKey, PluginGroup } from '../plugin'; | ||
import { Plugin, PluginKey } from 'prosemirror-state'; | ||
import { PluginGroup } from '../plugin'; | ||
@@ -3,0 +4,0 @@ const name = 'editorStateCounter'; |
@@ -7,3 +7,3 @@ import { Command, setBlockType } from 'prosemirror-commands'; | ||
import { keymap } from '../utils/keymap'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { | ||
@@ -16,3 +16,7 @@ copyEmptyCommand, | ||
} from '../core-commands'; | ||
import { filter, findParentNodeOfType, insertEmpty } from '../utils/pm-utils'; | ||
import { | ||
filter, | ||
findParentNodeOfType, | ||
insertEmpty, | ||
} from '@bangle.dev/pm-utils'; | ||
import browser from '../utils/browser'; | ||
@@ -19,0 +23,0 @@ import type { MarkdownSerializerState } from 'prosemirror-markdown'; |
import * as pmHistory from 'prosemirror-history'; | ||
import { keymap } from '../utils/keymap'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { PluginGroup } from '../plugin'; | ||
@@ -12,3 +12,4 @@ | ||
undo: 'Mod-z', | ||
redo: 'Mod-y Shift-Mod-z', | ||
redo: 'Mod-y', | ||
redoAlt: 'Shift-Mod-z', | ||
}; | ||
@@ -26,2 +27,3 @@ | ||
[keybindings.redo]: redo(), | ||
[keybindings.redoAlt]: redo(), | ||
}), | ||
@@ -28,0 +30,0 @@ ]); |
@@ -1,2 +0,2 @@ | ||
import { safeInsert } from '../utils/pm-utils'; | ||
import { safeInsert } from '@bangle.dev/pm-utils'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
@@ -3,0 +3,0 @@ import { Schema, Node } from 'prosemirror-model'; |
import { markInputRule } from '../utils/mark-input-rule'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { toggleMark, Command } from 'prosemirror-commands'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
@@ -6,0 +6,0 @@ import { Schema } from 'prosemirror-model'; |
@@ -0,9 +1,9 @@ | ||
import { matchAllPlus } from '@bangle.dev/js-utils'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import { Command } from 'prosemirror-commands'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Mark, MarkType, Node, Schema } from 'prosemirror-model'; | ||
import { EditorState, Plugin } from 'prosemirror-state'; | ||
import { matchAllPlus } from '../utils/js-utils'; | ||
import { filter, getMarkAttrs, mapSlice } from '../utils/pm-utils'; | ||
import { Mark, MarkType, Node, Schema } from 'prosemirror-model'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import { Command } from 'prosemirror-commands'; | ||
import { filter, getMarkAttrs, mapSlice } from '@bangle.dev/pm-utils'; | ||
@@ -10,0 +10,0 @@ export const spec = specFactory; |
@@ -31,3 +31,4 @@ import { liftTarget, ReplaceAroundStep } from 'prosemirror-transform'; | ||
import { MoveDirection } from '../../types'; | ||
import { compose } from '../../utils/js-utils'; | ||
import { compose } from '@bangle.dev/js-utils'; | ||
import { | ||
@@ -45,4 +46,5 @@ hasVisibleContent, | ||
extendDispatch, | ||
} from '../../utils/pm-utils'; | ||
import { GapCursorSelection } from '../../gap-cursor'; | ||
GapCursorSelection, | ||
} from '@bangle.dev/pm-utils'; | ||
import { liftSelectionList, liftFollowingList } from './transforms'; | ||
@@ -49,0 +51,0 @@ import { isNodeTodo, removeTodoCheckedAttr, setTodoCheckedAttr } from './todo'; |
@@ -18,3 +18,3 @@ import { chainCommands, Command } from 'prosemirror-commands'; | ||
} from '../../core-commands'; | ||
import { filter, insertEmpty } from '../../utils/pm-utils'; | ||
import { filter, insertEmpty } from '@bangle.dev/pm-utils'; | ||
import { domSerializationHelpers } from '../../utils/dom-serialization-helpers'; | ||
@@ -21,0 +21,0 @@ import browser from '../../utils/browser'; |
@@ -1,2 +0,2 @@ | ||
import { createElement } from '../../utils/js-utils'; | ||
import { createElement } from '../../create-element'; | ||
import { NodeView, UpdateAttrsFunction } from '../../node-view'; | ||
@@ -3,0 +3,0 @@ import { EditorState } from 'prosemirror-state'; |
import { canJoin, findWrapping } from 'prosemirror-transform'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
import { filter } from '../../utils/pm-utils'; | ||
import { filter } from '@bangle.dev/pm-utils'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
@@ -5,0 +5,0 @@ import { EditorState, Transaction } from 'prosemirror-state'; |
@@ -17,3 +17,3 @@ import { | ||
import { autoJoin } from 'prosemirror-commands'; | ||
import { getListLiftTarget, mapChildren, mapSlice } from '../../utils/pm-utils'; | ||
import { getListLiftTarget, mapChildren, mapSlice } from '@bangle.dev/pm-utils'; | ||
@@ -20,0 +20,0 @@ function liftListItem( |
import { Command, setBlockType } from 'prosemirror-commands'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
import { filter, insertEmpty, findParentNodeOfType } from '../utils/pm-utils'; | ||
import { keymap } from '../utils/keymap'; | ||
import { | ||
filter, | ||
insertEmpty, | ||
findParentNodeOfType, | ||
} from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { | ||
parentHasDirectParentOfType, | ||
@@ -7,0 +11,0 @@ copyEmptyCommand, |
@@ -5,3 +5,3 @@ import { markInputRule } from '../utils/mark-input-rule'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
import { EditorState } from 'prosemirror-state'; | ||
@@ -8,0 +8,0 @@ import { Schema } from 'prosemirror-model'; |
@@ -7,3 +7,3 @@ import { markInputRule } from '../utils/mark-input-rule'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
@@ -10,0 +10,0 @@ export const spec = specFactory; |
@@ -1,2 +0,3 @@ | ||
import { findParentNodeOfType } from 'prosemirror-utils'; | ||
import { Command } from 'prosemirror-commands'; | ||
import { Fragment, Node, NodeType, Slice } from 'prosemirror-model'; | ||
import { | ||
@@ -8,9 +9,6 @@ EditorState, | ||
} from 'prosemirror-state'; | ||
import { arrayify } from './utils/js-utils'; | ||
import { Node, NodeType } from 'prosemirror-model'; | ||
import { mapChildren } from './utils/pm-utils'; | ||
import { Fragment, Slice } from 'prosemirror-model'; | ||
import { Command } from 'prosemirror-commands'; | ||
import { ReplaceStep } from 'prosemirror-transform'; | ||
import { findParentNodeOfType } from 'prosemirror-utils'; | ||
import { MoveDirection } from './types'; | ||
import { mapChildren } from '@bangle.dev/pm-utils'; | ||
@@ -88,3 +86,5 @@ function getParentTextSelection(state: EditorState, currentDepth: number) { | ||
): (state: EditorState) => boolean { | ||
parentsParentType = arrayify(parentsParentType); | ||
parentsParentType = Array.isArray(parentsParentType) | ||
? parentsParentType | ||
: [parentsParentType]; | ||
@@ -91,0 +91,0 @@ return (state) => { |
@@ -0,5 +1,5 @@ | ||
import { isTestEnv } from '@bangle.dev/js-utils'; | ||
import { toHTMLString } from '@bangle.dev/pm-utils'; | ||
import { EditorView } from 'prosemirror-view'; | ||
import { BangleEditorState } from './bangle-editor-state'; | ||
import { isTestEnv } from './utils/environment'; | ||
import { toHTMLString } from './utils/pm-utils'; | ||
export class BangleEditor { | ||
@@ -6,0 +6,0 @@ constructor(element, { focusOnInit = true, state, pmViewOpts = {} }) { |
import { Command } from 'prosemirror-commands'; | ||
import { Schema, Node } from 'prosemirror-model'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
@@ -5,0 +5,0 @@ export declare const spec: typeof specFactory; |
@@ -0,6 +1,6 @@ | ||
import { filter, findParentNodeOfType, insertEmpty, } from '@bangle.dev/pm-utils'; | ||
import { wrapIn } from 'prosemirror-commands'; | ||
import { wrappingInputRule } from 'prosemirror-inputrules'; | ||
import { wrapIn } from 'prosemirror-commands'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { copyEmptyCommand, cutEmptyCommand, moveNode } from '../core-commands'; | ||
import { insertEmpty, filter, findParentNodeOfType } from '../utils/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -7,0 +7,0 @@ export const plugins = pluginsFactory; |
@@ -53,3 +53,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<any>)[]; | ||
export declare function toggleBold(): Command; | ||
@@ -56,0 +56,0 @@ export declare function queryIsBoldActive(): (state: EditorState) => boolean; |
@@ -5,3 +5,3 @@ import { toggleMark } from 'prosemirror-commands'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -8,0 +8,0 @@ export const plugins = pluginsFactory; |
@@ -53,3 +53,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<Schema<any, any>>)[]; | ||
export declare function toggleBulletList(): Command; | ||
@@ -56,0 +56,0 @@ export declare function toggleTodoList(): Command; |
@@ -1,6 +0,5 @@ | ||
import { Node } from 'prosemirror-model'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Schema } from 'prosemirror-model'; | ||
import { Node, Schema } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
import type Token from 'markdown-it/lib/token'; | ||
export declare const spec: typeof specFactory; | ||
@@ -7,0 +6,0 @@ export declare const plugins: typeof pluginsFactory; |
@@ -1,6 +0,6 @@ | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { setBlockType } from 'prosemirror-commands'; | ||
import { textblockTypeInputRule } from 'prosemirror-inputrules'; | ||
import { filter, insertEmpty, findParentNodeOfType } from '../utils/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { moveNode } from '../core-commands'; | ||
import { filter, findParentNodeOfType, insertEmpty, } from '@bangle.dev/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -7,0 +7,0 @@ export const plugins = pluginsFactory; |
@@ -45,3 +45,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<any>)[]; | ||
export declare function toggleCode(): Command; | ||
@@ -48,0 +48,0 @@ export declare function queryIsCodeActive(): (state: EditorState) => boolean; |
import { toggleMark } from 'prosemirror-commands'; | ||
import { markInputRule } from '../utils/mark-input-rule'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { isMarkActiveInSelection, filter } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection, filter } from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
@@ -6,0 +6,0 @@ import { Selection } from 'prosemirror-state'; |
@@ -1,2 +0,3 @@ | ||
import { PluginKey, PluginGroup } from '../plugin'; | ||
import { PluginKey } from 'prosemirror-state'; | ||
import { PluginGroup } from '../plugin'; | ||
export declare const plugins: typeof pluginsFactory; | ||
@@ -3,0 +4,0 @@ export declare const docChangedKey: PluginKey<any, any>; |
@@ -1,2 +0,3 @@ | ||
import { Plugin, PluginKey, PluginGroup } from '../plugin'; | ||
import { Plugin, PluginKey } from 'prosemirror-state'; | ||
import { PluginGroup } from '../plugin'; | ||
const name = 'editorStateCounter'; | ||
@@ -3,0 +4,0 @@ export const plugins = pluginsFactory; |
@@ -6,5 +6,5 @@ import { setBlockType } from 'prosemirror-commands'; | ||
import { TextSelection } from 'prosemirror-state'; | ||
import { keymap } from '../utils/keymap'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { copyEmptyCommand, cutEmptyCommand, moveNode, jumpToStartOfNode, jumpToEndOfNode, } from '../core-commands'; | ||
import { filter, findParentNodeOfType, insertEmpty } from '../utils/pm-utils'; | ||
import { filter, findParentNodeOfType, insertEmpty, } from '@bangle.dev/pm-utils'; | ||
import browser from '../utils/browser'; | ||
@@ -11,0 +11,0 @@ export const spec = specFactory; |
@@ -11,2 +11,3 @@ import * as pmHistory from 'prosemirror-history'; | ||
redo: string; | ||
redoAlt: string; | ||
}; | ||
@@ -18,2 +19,3 @@ declare function pluginsFactory({ historyOpts, keybindings }?: { | ||
redo: string; | ||
redoAlt: string; | ||
} | undefined; | ||
@@ -20,0 +22,0 @@ }): () => PluginGroup; |
import * as pmHistory from 'prosemirror-history'; | ||
import { keymap } from '../utils/keymap'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { PluginGroup } from '../plugin'; | ||
@@ -11,3 +11,4 @@ export const plugins = pluginsFactory; | ||
undo: 'Mod-z', | ||
redo: 'Mod-y Shift-Mod-z', | ||
redo: 'Mod-y', | ||
redoAlt: 'Shift-Mod-z', | ||
}; | ||
@@ -23,2 +24,3 @@ const name = 'history'; | ||
[keybindings.redo]: redo(), | ||
[keybindings.redoAlt]: redo(), | ||
}), | ||
@@ -25,0 +27,0 @@ ]); |
@@ -1,2 +0,2 @@ | ||
import { safeInsert } from '../utils/pm-utils'; | ||
import { safeInsert } from '@bangle.dev/pm-utils'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
@@ -3,0 +3,0 @@ export const spec = specFactory; |
@@ -59,5 +59,5 @@ import { InputRule } from 'prosemirror-inputrules'; | ||
schema: Schema; | ||
}) => (InputRule<any> | Plugin<any, any>)[]; | ||
}) => (Plugin<any, any> | InputRule<any>)[]; | ||
export declare const updateImageNodeAttribute: (attr?: Node['attrs']) => Command; | ||
export {}; | ||
//# sourceMappingURL=image.d.ts.map |
@@ -46,3 +46,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<any>)[]; | ||
export declare function toggleItalic(): Command; | ||
@@ -49,0 +49,0 @@ export declare function queryIsItalicActive(): (state: EditorState) => boolean; |
import { markInputRule } from '../utils/mark-input-rule'; | ||
import { markPasteRule } from '../utils/mark-paste-rule'; | ||
import { toggleMark } from 'prosemirror-commands'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
@@ -6,0 +6,0 @@ export const spec = specFactory; |
@@ -1,6 +0,6 @@ | ||
import { EditorState } from 'prosemirror-state'; | ||
import { Mark, Node, Schema } from 'prosemirror-model'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import type Token from 'markdown-it/lib/token'; | ||
import { Command } from 'prosemirror-commands'; | ||
import type { MarkdownSerializerState } from 'prosemirror-markdown'; | ||
import { Mark, Node, Schema } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
export declare const spec: typeof specFactory; | ||
@@ -40,3 +40,3 @@ export declare const plugins: typeof pluginsFactory; | ||
toMarkdown: { | ||
open(_state: MarkdownSerializerState, mark: Mark, parent: Node, index: number): "[" | "<"; | ||
open(_state: MarkdownSerializerState, mark: Mark, parent: Node, index: number): "<" | "["; | ||
close(state: MarkdownSerializerState, mark: Mark, parent: Node, index: number): string; | ||
@@ -43,0 +43,0 @@ }; |
@@ -0,5 +1,5 @@ | ||
import { matchAllPlus } from '@bangle.dev/js-utils'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
import { Plugin } from 'prosemirror-state'; | ||
import { matchAllPlus } from '../utils/js-utils'; | ||
import { filter, getMarkAttrs, mapSlice } from '../utils/pm-utils'; | ||
import { filter, getMarkAttrs, mapSlice } from '@bangle.dev/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -6,0 +6,0 @@ export const plugins = pluginsFactory; |
@@ -7,5 +7,4 @@ import { liftTarget, ReplaceAroundStep } from 'prosemirror-transform'; | ||
import { Selection, NodeSelection, TextSelection, } from 'prosemirror-state'; | ||
import { compose } from '../../utils/js-utils'; | ||
import { hasVisibleContent, isNodeEmpty, filter, findCutBefore, isFirstChildOfParent, isRangeOfType, isEmptySelectionAtStart, sanitiseSelectionMarksForWrapping, validPos, validListParent, extendDispatch, } from '../../utils/pm-utils'; | ||
import { GapCursorSelection } from '../../gap-cursor'; | ||
import { compose } from '@bangle.dev/js-utils'; | ||
import { hasVisibleContent, isNodeEmpty, filter, findCutBefore, isFirstChildOfParent, isRangeOfType, isEmptySelectionAtStart, sanitiseSelectionMarksForWrapping, validPos, validListParent, extendDispatch, GapCursorSelection, } from '@bangle.dev/pm-utils'; | ||
import { liftSelectionList, liftFollowingList } from './transforms'; | ||
@@ -12,0 +11,0 @@ import { isNodeTodo, removeTodoCheckedAttr, setTodoCheckedAttr } from './todo'; |
@@ -5,3 +5,3 @@ import { chainCommands } from 'prosemirror-commands'; | ||
import { cutEmptyCommand, copyEmptyCommand, parentHasDirectParentOfType, moveNode, } from '../../core-commands'; | ||
import { filter, insertEmpty } from '../../utils/pm-utils'; | ||
import { filter, insertEmpty } from '@bangle.dev/pm-utils'; | ||
import { domSerializationHelpers } from '../../utils/dom-serialization-helpers'; | ||
@@ -8,0 +8,0 @@ import browser from '../../utils/browser'; |
@@ -1,2 +0,2 @@ | ||
import { createElement } from '../../utils/js-utils'; | ||
import { createElement } from '../../create-element'; | ||
import { NodeView } from '../../node-view'; | ||
@@ -3,0 +3,0 @@ const LOG = false; |
import { canJoin, findWrapping } from 'prosemirror-transform'; | ||
import { InputRule } from 'prosemirror-inputrules'; | ||
import { filter } from '../../utils/pm-utils'; | ||
import { filter } from '@bangle.dev/pm-utils'; | ||
export const isNodeTodo = (node, schema) => { | ||
@@ -5,0 +5,0 @@ return (node.type === schema.nodes.listItem && |
@@ -5,3 +5,3 @@ import { Fragment, NodeRange, Slice, } from 'prosemirror-model'; | ||
import { autoJoin } from 'prosemirror-commands'; | ||
import { getListLiftTarget, mapChildren, mapSlice } from '../../utils/pm-utils'; | ||
import { getListLiftTarget, mapChildren, mapSlice } from '@bangle.dev/pm-utils'; | ||
function liftListItem(type, state, selection, tr) { | ||
@@ -8,0 +8,0 @@ let { $from, $to } = selection; |
import { setBlockType } from 'prosemirror-commands'; | ||
import { filter, insertEmpty, findParentNodeOfType } from '../utils/pm-utils'; | ||
import { keymap } from '../utils/keymap'; | ||
import { filter, insertEmpty, findParentNodeOfType, } from '@bangle.dev/pm-utils'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { parentHasDirectParentOfType, copyEmptyCommand, cutEmptyCommand, moveNode, jumpToStartOfNode, jumpToEndOfNode, } from '../core-commands'; | ||
@@ -5,0 +5,0 @@ import browser from '../utils/browser'; |
@@ -48,3 +48,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<any>)[]; | ||
export declare function toggleStrike(): Command; | ||
@@ -51,0 +51,0 @@ export declare function queryIsStrikeActive(): (state: EditorState) => boolean; |
@@ -5,3 +5,3 @@ import { markInputRule } from '../utils/mark-input-rule'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -8,0 +8,0 @@ export const plugins = pluginsFactory; |
@@ -43,3 +43,3 @@ import { Command } from 'prosemirror-commands'; | ||
schema: Schema; | ||
}) => (import("prosemirror-inputrules").InputRule<any> | import("prosemirror-state").Plugin<any, any>)[]; | ||
}) => (import("prosemirror-state").Plugin<any, any> | import("prosemirror-inputrules").InputRule<any>)[]; | ||
export declare function toggleUnderline(): Command; | ||
@@ -46,0 +46,0 @@ export declare function queryIsUnderlineActive(): (state: EditorState) => boolean; |
@@ -5,3 +5,3 @@ import { markInputRule } from '../utils/mark-input-rule'; | ||
import { keymap } from 'prosemirror-keymap'; | ||
import { isMarkActiveInSelection } from '../utils/pm-utils'; | ||
import { isMarkActiveInSelection } from '@bangle.dev/pm-utils'; | ||
export const spec = specFactory; | ||
@@ -8,0 +8,0 @@ export const plugins = pluginsFactory; |
@@ -0,4 +1,4 @@ | ||
import { Command } from 'prosemirror-commands'; | ||
import { Node, NodeType } from 'prosemirror-model'; | ||
import { EditorState } from 'prosemirror-state'; | ||
import { Node, NodeType } from 'prosemirror-model'; | ||
import { Command } from 'prosemirror-commands'; | ||
import { MoveDirection } from './types'; | ||
@@ -5,0 +5,0 @@ export declare function copyEmptyCommand(type: NodeType): Command; |
@@ -1,7 +0,6 @@ | ||
import { findParentNodeOfType } from 'prosemirror-utils'; | ||
import { Fragment, Slice } from 'prosemirror-model'; | ||
import { NodeSelection, Selection, TextSelection, } from 'prosemirror-state'; | ||
import { arrayify } from './utils/js-utils'; | ||
import { mapChildren } from './utils/pm-utils'; | ||
import { Fragment, Slice } from 'prosemirror-model'; | ||
import { ReplaceStep } from 'prosemirror-transform'; | ||
import { findParentNodeOfType } from 'prosemirror-utils'; | ||
import { mapChildren } from '@bangle.dev/pm-utils'; | ||
function getParentTextSelection(state, currentDepth) { | ||
@@ -56,3 +55,5 @@ const { $from } = state.selection; | ||
export function parentHasDirectParentOfType(parentType, parentsParentType) { | ||
parentsParentType = arrayify(parentsParentType); | ||
parentsParentType = Array.isArray(parentsParentType) | ||
? parentsParentType | ||
: [parentsParentType]; | ||
return (state) => { | ||
@@ -59,0 +60,0 @@ const currentResolved = findParentNodeOfType(parentType)(state.selection); |
@@ -1,4 +0,1 @@ | ||
import { Selection } from 'prosemirror-state'; | ||
export declare class GapCursorSelection extends Selection { | ||
} | ||
//# sourceMappingURL=gap-cursor.d.ts.map |
@@ -1,3 +0,1 @@ | ||
import { Selection } from 'prosemirror-state'; | ||
export class GapCursorSelection extends Selection { | ||
} | ||
"use strict"; |
@@ -5,2 +5,3 @@ import * as logging from './utils/logging'; | ||
import * as components from './components/components'; | ||
export * from './components/components'; | ||
export * from './bangle-editor'; | ||
@@ -11,4 +12,8 @@ export * from './bangle-editor-state'; | ||
export * from './plugin'; | ||
export * from './create-element'; | ||
export * from './utils/dom-serialization-helpers'; | ||
export * from './utils/plugin-key-store'; | ||
export * from './utils/core-components'; | ||
declare const isChromeWithSelectionBug: boolean; | ||
export { components, utils, logging, browser, isChromeWithSelectionBug }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,2 +5,3 @@ import * as logging from './utils/logging'; | ||
import * as components from './components/components'; | ||
export * from './components/components'; | ||
export * from './bangle-editor'; | ||
@@ -11,3 +12,7 @@ export * from './bangle-editor-state'; | ||
export * from './plugin'; | ||
export * from './create-element'; | ||
export * from './utils/dom-serialization-helpers'; | ||
export * from './utils/plugin-key-store'; | ||
export * from './utils/core-components'; | ||
const isChromeWithSelectionBug = browser.chrome && !browser.android && browser.chrome_version >= 58; | ||
export { components, utils, logging, browser, isChromeWithSelectionBug }; |
@@ -1,4 +0,4 @@ | ||
import { Node, DOMOutputSpec } from 'prosemirror-model'; | ||
import { EditorView, Decoration } from 'prosemirror-view'; | ||
import { DOMOutputSpec, Node } from 'prosemirror-model'; | ||
import { Plugin } from 'prosemirror-state'; | ||
import { Decoration, EditorView } from 'prosemirror-view'; | ||
declare type GetPosFunction = () => number; | ||
@@ -5,0 +5,0 @@ export declare type UpdateAttrsFunction = (attrs: Node['attrs']) => void; |
@@ -0,3 +1,4 @@ | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { createElement } from './create-element'; | ||
import { Plugin, PluginKey } from 'prosemirror-state'; | ||
import { bangleWarn, createElement } from './utils/js-utils'; | ||
const LOG = false; | ||
@@ -4,0 +5,0 @@ let log = LOG ? console.log.bind(console, 'node-view') : () => { }; |
import { Schema } from 'prosemirror-model'; | ||
import { doc, paragraph, text } from './components/components'; | ||
import { bangleWarn } from './utils/js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
const LOG = false; | ||
@@ -5,0 +5,0 @@ let log = LOG ? console.log.bind(console, 'SpecRegistry') : () => { }; |
@@ -5,56 +5,2 @@ export function defaultSpecs(opts?: {}): (false | { | ||
schema: { | ||
group: string; | ||
}; | ||
markdown: { | ||
toMarkdown(state: any, node: import("prosemirror-model").Node<any>): void; | ||
}; | ||
} | { | ||
type: string; | ||
topNode: boolean; | ||
name: string; | ||
schema: { | ||
content: string; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
attrs: { | ||
href: { | ||
default: null; | ||
}; | ||
}; | ||
inclusive: boolean; | ||
parseDOM: { | ||
tag: string; | ||
getAttrs: (dom: HTMLElement) => { | ||
href: string | null; | ||
}; | ||
}[]; | ||
toDOM: (node: import("prosemirror-model").Node<any>) => (string | number | { | ||
rel: string; | ||
})[]; | ||
}; | ||
markdown: { | ||
toMarkdown: { | ||
open(_state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): "[" | "<"; | ||
close(state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): string; | ||
}; | ||
parseMarkdown: { | ||
link: { | ||
mark: string; | ||
getAttrs: (tok: import("markdown-it/lib/token")) => { | ||
href: string | null; | ||
title: string | null; | ||
}; | ||
}; | ||
}; | ||
}; | ||
options: { | ||
openOnClick: boolean; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
parseDOM: ({ | ||
@@ -141,2 +87,40 @@ tag: string; | ||
schema: { | ||
attrs: { | ||
href: { | ||
default: null; | ||
}; | ||
}; | ||
inclusive: boolean; | ||
parseDOM: { | ||
tag: string; | ||
getAttrs: (dom: HTMLElement) => { | ||
href: string | null; | ||
}; | ||
}[]; | ||
toDOM: (node: import("prosemirror-model").Node<any>) => (string | number | { | ||
rel: string; | ||
})[]; | ||
}; | ||
markdown: { | ||
toMarkdown: { | ||
open(_state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): "<" | "["; | ||
close(state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): string; | ||
}; | ||
parseMarkdown: { | ||
link: { | ||
mark: string; | ||
getAttrs: (tok: import("markdown-it/lib/token")) => { | ||
href: string | null; | ||
title: string | null; | ||
}; | ||
}; | ||
}; | ||
}; | ||
options: { | ||
openOnClick: boolean; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
parseDOM: ({ | ||
@@ -163,4 +147,20 @@ tag: string; | ||
type: string; | ||
topNode: boolean; | ||
name: string; | ||
schema: { | ||
content: string; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
group: string; | ||
}; | ||
markdown: { | ||
toMarkdown(state: any, node: import("prosemirror-model").Node<any>): void; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
inline: boolean; | ||
@@ -213,6 +213,6 @@ group: string; | ||
})[]; | ||
export function defaultPlugins(opts?: {}): (false | (() => import("..").PluginGroup) | (({ schema, specRegistry }: { | ||
export function defaultPlugins(opts?: {}): (false | (({ schema, specRegistry }: { | ||
schema: import("prosemirror-model").Schema<any, any>; | ||
specRegistry: any; | ||
}) => any[]))[]; | ||
}) => any[]) | (() => import("..").PluginGroup))[]; | ||
//# sourceMappingURL=default-components.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { matchAllPlus, objectMapValues, safeMergeObject, weakCache, } from '../utils/js-utils'; | ||
import { matchAllPlus, objectMapValues, weakCache } from '@bangle.dev/js-utils'; | ||
const nodeAlias = { | ||
@@ -122,1 +122,14 @@ para: 'paragraph', | ||
} | ||
function safeMergeObject(obj1 = {}, obj2 = {}) { | ||
const culpritKey = Object.keys(obj1).find((key) => hasOwnProperty(obj2, key)); | ||
if (culpritKey) { | ||
throw new Error(`Key ${culpritKey} already exists `); | ||
} | ||
return { | ||
...obj1, | ||
...obj2, | ||
}; | ||
} | ||
function hasOwnProperty(obj, property) { | ||
return Object.prototype.hasOwnProperty.call(obj, property); | ||
} |
@@ -22,40 +22,2 @@ /// <reference types="prosemirror-model" /> | ||
schema: { | ||
attrs: { | ||
href: { | ||
default: null; | ||
}; | ||
}; | ||
inclusive: boolean; | ||
parseDOM: { | ||
tag: string; | ||
getAttrs: (dom: HTMLElement) => { | ||
href: string | null; | ||
}; | ||
}[]; | ||
toDOM: (node: import("prosemirror-model").Node<any>) => (string | number | { | ||
rel: string; | ||
})[]; | ||
}; | ||
markdown: { | ||
toMarkdown: { | ||
open(_state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): "[" | "<"; | ||
close(state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): string; | ||
}; | ||
parseMarkdown: { | ||
link: { | ||
mark: string; | ||
getAttrs: (tok: import("markdown-it/lib/token")) => { | ||
href: string | null; | ||
title: string | null; | ||
}; | ||
}; | ||
}; | ||
}; | ||
options: { | ||
openOnClick: boolean; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
parseDOM: ({ | ||
@@ -116,2 +78,22 @@ tag: string; | ||
schema: { | ||
inline: boolean; | ||
group: string; | ||
selectable: boolean; | ||
parseDOM: { | ||
tag: string; | ||
}[]; | ||
toDOM: () => string[]; | ||
}; | ||
markdown: { | ||
toMarkdown(state: any, node: import("prosemirror-model").Node<any>, parent: import("prosemirror-model").Node<any>, index: number): void; | ||
parseMarkdown: { | ||
hardbreak: { | ||
node: string; | ||
}; | ||
}; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
parseDOM: ({ | ||
@@ -143,2 +125,40 @@ tag: string; | ||
schema: { | ||
attrs: { | ||
href: { | ||
default: null; | ||
}; | ||
}; | ||
inclusive: boolean; | ||
parseDOM: { | ||
tag: string; | ||
getAttrs: (dom: HTMLElement) => { | ||
href: string | null; | ||
}; | ||
}[]; | ||
toDOM: (node: import("prosemirror-model").Node<any>) => (string | number | { | ||
rel: string; | ||
})[]; | ||
}; | ||
markdown: { | ||
toMarkdown: { | ||
open(_state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): "<" | "["; | ||
close(state: import("prosemirror-markdown").MarkdownSerializerState<any>, mark: import("prosemirror-model").Mark<any>, parent: import("prosemirror-model").Node<any>, index: number): string; | ||
}; | ||
parseMarkdown: { | ||
link: { | ||
mark: string; | ||
getAttrs: (tok: import("markdown-it/lib/token")) => { | ||
href: string | null; | ||
title: string | null; | ||
}; | ||
}; | ||
}; | ||
}; | ||
options: { | ||
openOnClick: boolean; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
parseDOM: ({ | ||
@@ -167,22 +187,2 @@ tag: string; | ||
schema: { | ||
inline: boolean; | ||
group: string; | ||
selectable: boolean; | ||
parseDOM: { | ||
tag: string; | ||
}[]; | ||
toDOM: () => string[]; | ||
}; | ||
markdown: { | ||
toMarkdown(state: any, node: import("prosemirror-model").Node<any>, parent: import("prosemirror-model").Node<any>, index: number): void; | ||
parseMarkdown: { | ||
hardbreak: { | ||
node: string; | ||
}; | ||
}; | ||
}; | ||
} | { | ||
type: string; | ||
name: string; | ||
schema: { | ||
content: string; | ||
@@ -215,6 +215,6 @@ defining: boolean; | ||
})[]; | ||
export declare function corePlugins(): ((() => import("..").PluginGroup) | (({ schema, specRegistry }: { | ||
export declare function corePlugins(): ((({ schema, specRegistry }: { | ||
schema: import("prosemirror-model").Schema<any, any>; | ||
specRegistry: any; | ||
}) => any[]))[]; | ||
}) => any[]) | (() => import("..").PluginGroup))[]; | ||
//# sourceMappingURL=core-components.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Node, DOMOutputSpec } from 'prosemirror-model'; | ||
import { DOMOutputSpec, Node } from 'prosemirror-model'; | ||
export declare function domSerializationHelpers(name: string, { tag, content, ignoreAttrs, parsingPriority, }?: { | ||
@@ -3,0 +3,0 @@ tag?: string; |
@@ -1,2 +0,2 @@ | ||
import { objectFilter } from './js-utils'; | ||
import { objectFilter } from '@bangle.dev/js-utils'; | ||
export function domSerializationHelpers(name, { tag = 'div', content, ignoreAttrs = [], parsingPriority = 51, } = {}) { | ||
@@ -3,0 +3,0 @@ const serializer = (node) => JSON.stringify(objectFilter(node.attrs || {}, (_value, key) => !ignoreAttrs.includes(key))); |
import { DOMOutputSpec } from 'prosemirror-model'; | ||
import type { Command } from 'prosemirror-commands'; | ||
import type { EditorView } from 'prosemirror-view'; | ||
export declare function classNames(obj: any): string; | ||
@@ -31,3 +29,2 @@ export declare function weakCache(fn: Function): (arg: any) => any; | ||
export declare function objectFilter(obj: AnyObject, cb: (value: any, key: any) => boolean): AnyObject; | ||
export declare function safeMergeObject(obj1?: {}, obj2?: {}): {}; | ||
export declare function hasOwnProperty(obj: any, property: string): boolean; | ||
@@ -56,4 +53,3 @@ export declare function serialExecuteQueue(): { | ||
export declare function complement(func: Function): (...args: any[]) => boolean; | ||
export declare function rafCommandExec(view: EditorView, command: Command): void; | ||
export {}; | ||
//# sourceMappingURL=js-utils.d.ts.map |
@@ -139,12 +139,2 @@ import { DOMSerializer } from 'prosemirror-model'; | ||
} | ||
export function safeMergeObject(obj1 = {}, obj2 = {}) { | ||
const culpritKey = Object.keys(obj1).find((key) => hasOwnProperty(obj2, key)); | ||
if (culpritKey) { | ||
throw new Error(`Key ${culpritKey} already exists `); | ||
} | ||
return { | ||
...obj1, | ||
...obj2, | ||
}; | ||
} | ||
export function hasOwnProperty(obj, property) { | ||
@@ -266,6 +256,1 @@ return Object.prototype.hasOwnProperty.call(obj, property); | ||
} | ||
export function rafCommandExec(view, command) { | ||
requestAnimationFrame(() => { | ||
command(view.state, view.dispatch, view); | ||
}); | ||
} |
@@ -1,2 +0,2 @@ | ||
import { bangleWarn } from './js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { PluginKey } from 'prosemirror-state'; | ||
@@ -3,0 +3,0 @@ export function pluginKeyStore() { |
@@ -6,3 +6,3 @@ import { InputRule, inputRules as pmInputRules, undoInputRule as pmUndoInputRule, } from 'prosemirror-inputrules'; | ||
import { dropCursor as pmDropCursor } from 'prosemirror-dropcursor'; | ||
import { bangleWarn } from './js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { Plugin } from 'prosemirror-state'; | ||
@@ -9,0 +9,0 @@ import { PluginGroup } from '../plugin'; |
import { DOMSerializer, Fragment, Slice, } from 'prosemirror-model'; | ||
import { Plugin } from 'prosemirror-state'; | ||
import { findParentNode, findParentNodeOfType as _findParentNodeOfType, findSelectedNodeOfType, removeSelectedNode as _removeSelectedNode, safeInsert as _safeInsert, } from 'prosemirror-utils'; | ||
import { GapCursorSelection } from '../gap-cursor'; | ||
import { GapCursorSelection } from '@bangle.dev/pm-utils'; | ||
export function safeInsert(content, position, tryToReplace) { | ||
@@ -6,0 +6,0 @@ return _safeInsert(content, position, tryToReplace); |
export { default as browser } from './browser'; | ||
export * from './core-components'; | ||
export * from './dom-serialization-helpers'; | ||
export * from './environment'; | ||
export * from './js-utils'; | ||
export * from './keymap'; | ||
export * from './logging'; | ||
export * from './mark-input-rule'; | ||
export * from './mark-paste-rule'; | ||
export * from './object-uid'; | ||
export * from './plugin-key-store'; | ||
export * from './plugin-loader'; | ||
export * from './pm-utils'; | ||
//# sourceMappingURL=utils.d.ts.map |
export { default as browser } from './browser'; | ||
export * from './core-components'; | ||
export * from './dom-serialization-helpers'; | ||
export * from './environment'; | ||
export * from './js-utils'; | ||
export * from './keymap'; | ||
export * from './logging'; | ||
export * from './mark-input-rule'; | ||
export * from './mark-paste-rule'; | ||
export * from './object-uid'; | ||
export * from './plugin-key-store'; | ||
export * from './plugin-loader'; | ||
export * from './pm-utils'; |
@@ -6,2 +6,3 @@ import * as logging from './utils/logging'; | ||
export * from './components/components'; | ||
export * from './bangle-editor'; | ||
@@ -12,2 +13,6 @@ export * from './bangle-editor-state'; | ||
export * from './plugin'; | ||
export * from './create-element'; | ||
export * from './utils/dom-serialization-helpers'; | ||
export * from './utils/plugin-key-store'; | ||
export * from './utils/core-components'; | ||
@@ -14,0 +19,0 @@ const isChromeWithSelectionBug = |
@@ -1,5 +0,6 @@ | ||
import { Node, DOMOutputSpec } from 'prosemirror-model'; | ||
import { EditorView, Decoration } from 'prosemirror-view'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { createElement } from './create-element'; | ||
import { DOMOutputSpec, Node } from 'prosemirror-model'; | ||
import { Plugin, PluginKey, Transaction } from 'prosemirror-state'; | ||
import { bangleWarn, createElement } from './utils/js-utils'; | ||
import { Decoration, EditorView } from 'prosemirror-view'; | ||
@@ -6,0 +7,0 @@ const LOG = false; |
{ | ||
"name": "@bangle.dev/core", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"homepage": "https://bangle.dev", | ||
@@ -31,2 +31,4 @@ "authors": [ | ||
"dependencies": { | ||
"@bangle.dev/js-utils": "0.21.0", | ||
"@bangle.dev/pm-utils": "0.21.0", | ||
"prosemirror-commands": "^1.1.9", | ||
@@ -33,0 +35,0 @@ "prosemirror-dropcursor": "^1.3.5", |
import { Plugin, PluginKey } from 'prosemirror-state'; | ||
export { Plugin, PluginKey }; | ||
export class PluginGroup { | ||
constructor(public name: string, public plugins: Plugin[]) {} | ||
} |
import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model'; | ||
import { doc, paragraph, text } from './components/components'; | ||
import { bangleWarn } from './utils/js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
@@ -5,0 +5,0 @@ const LOG = false; |
@@ -1,7 +0,2 @@ | ||
import { | ||
matchAllPlus, | ||
objectMapValues, | ||
safeMergeObject, | ||
weakCache, | ||
} from '../utils/js-utils'; | ||
import { matchAllPlus, objectMapValues, weakCache } from '@bangle.dev/js-utils'; | ||
@@ -210,1 +205,17 @@ // Short hand to allow for smaller jsx syntax | ||
} | ||
function safeMergeObject(obj1 = {}, obj2 = {}) { | ||
const culpritKey = Object.keys(obj1).find((key) => hasOwnProperty(obj2, key)); | ||
if (culpritKey) { | ||
throw new Error(`Key ${culpritKey} already exists `); | ||
} | ||
return { | ||
...obj1, | ||
...obj2, | ||
}; | ||
} | ||
function hasOwnProperty(obj, property) { | ||
return Object.prototype.hasOwnProperty.call(obj, property); | ||
} |
@@ -7,3 +7,3 @@ { | ||
"outDir": "./dist", | ||
"rootDir": "." | ||
"rootDir": "../" | ||
}, | ||
@@ -20,3 +20,11 @@ "include": [ | ||
"dist" | ||
], | ||
"references": [ | ||
{ | ||
"path": "../contrib/js-utils/tsconfig.json" | ||
}, | ||
{ | ||
"path": "../contrib/pm-utils/tsconfig.json" | ||
}, | ||
] | ||
} | ||
} |
@@ -11,3 +11,3 @@ /** | ||
raceTimeout, | ||
} from '../js-utils'; | ||
} from '@bangle.dev/js-utils'; | ||
@@ -14,0 +14,0 @@ const setTimeoutBackup = window.setTimeout; |
@@ -7,3 +7,3 @@ /** | ||
import { isFirstChildOfParent, findCutBefore } from '../pm-utils'; | ||
import { isFirstChildOfParent, findCutBefore } from '@bangle.dev/pm-utils'; | ||
@@ -10,0 +10,0 @@ const testEditor = renderTestEditor(); |
@@ -1,3 +0,3 @@ | ||
import { objectFilter } from './js-utils'; | ||
import { Node, DOMOutputSpec } from 'prosemirror-model'; | ||
import { objectFilter } from '@bangle.dev/js-utils'; | ||
import { DOMOutputSpec, Node } from 'prosemirror-model'; | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import { bangleWarn } from './js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { PluginKey } from 'prosemirror-state'; | ||
@@ -3,0 +3,0 @@ |
@@ -12,3 +12,3 @@ import { | ||
import type { EditorProps } from 'prosemirror-view'; | ||
import { bangleWarn } from './js-utils'; | ||
import { bangleWarn } from '@bangle.dev/js-utils'; | ||
import { Schema } from 'prosemirror-model'; | ||
@@ -15,0 +15,0 @@ import { Plugin } from 'prosemirror-state'; |
export { default as browser } from './browser'; | ||
export * from './core-components'; | ||
export * from './dom-serialization-helpers'; | ||
export * from './environment'; | ||
export * from './js-utils'; | ||
export * from './keymap'; | ||
export * from './logging'; | ||
export * from './mark-input-rule'; | ||
export * from './mark-paste-rule'; | ||
export * from './object-uid'; | ||
export * from './plugin-key-store'; | ||
export * from './plugin-loader'; | ||
export * from './pm-utils'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1442289
513
33364
15
+ Added@bangle.dev/js-utils@0.21.0
+ Added@bangle.dev/pm-utils@0.21.0
+ Added@bangle.dev/js-utils@0.21.0(transitive)
+ Added@bangle.dev/pm-utils@0.21.0(transitive)