@remirror/core-utils
Advanced tools
Comparing version 1.0.0-next.31 to 1.0.0-next.32
# @remirror/core-utils | ||
## 1.0.0-next.32 | ||
> 2020-09-05 | ||
### Minor Changes | ||
- [`e7b0bb0f`](https://github.com/remirror/remirror/commit/e7b0bb0ffdb7e2d6ac6be38baadde4a4dd402847) [#641](https://github.com/remirror/remirror/pull/641) Thanks [@ifiokjr](https://github.com/ifiokjr)! - Move `isEmptyBlockNode` function from `@remirror/extension-positioner` to `@remirror/core-utils`. Re-export to prevent breaking change. | ||
* [`aa27e968`](https://github.com/remirror/remirror/commit/aa27e96853aaaa701409a04e9b5135c94c371044) [#635](https://github.com/remirror/remirror/pull/635) Thanks [@ifiokjr](https://github.com/ifiokjr)! - Add `onError` and `stringHandler` methods to the `Remirror.ManagerSettings`. | ||
### Patch Changes | ||
- Updated dependencies [[`a830c70f`](https://github.com/remirror/remirror/commit/a830c70f76a5021c955e9cbba26b86e2db0333e3), [`a830c70f`](https://github.com/remirror/remirror/commit/a830c70f76a5021c955e9cbba26b86e2db0333e3)]: | ||
- @remirror/core-constants@1.0.0-next.32 | ||
- @remirror/core-helpers@1.0.0-next.32 | ||
- @remirror/core-types@1.0.0-next.32 | ||
- @remirror/pm@1.0.0-next.32 | ||
## 1.0.0-next.31 | ||
@@ -20,3 +38,3 @@ | ||
// Automatically remove all invalid nodes and marks. | ||
return transformer.remove(json, invalidContent); | ||
return transformers.remove(json, invalidContent); | ||
}, []); | ||
@@ -23,0 +41,0 @@ |
@@ -196,2 +196,6 @@ "use strict"; | ||
function isEmptyBlockNode(node) { | ||
return coreHelpers.bool(node) && node.type.isBlock && !node.textContent && !node.childCount; | ||
} | ||
function getMarkAttributes(trState, type) { | ||
@@ -1333,5 +1337,6 @@ var _trState$selection = trState.selection, from = _trState$selection.from, to = _trState$selection.to, marks = []; | ||
exports.isEditorSchema = isEditorSchema, exports.isEditorState = isEditorState, | ||
exports.isElementDomNode = isElementDomNode, exports.isMarkActive = isMarkActive, | ||
exports.isMarkType = isMarkType, exports.isNodeActive = isNodeActive, exports.isNodeOfType = isNodeOfType, | ||
exports.isNodeSelection = isNodeSelection, exports.isNodeType = isNodeType, exports.isProsemirrorMark = isProsemirrorMark, | ||
exports.isElementDomNode = isElementDomNode, exports.isEmptyBlockNode = isEmptyBlockNode, | ||
exports.isMarkActive = isMarkActive, exports.isMarkType = isMarkType, exports.isNodeActive = isNodeActive, | ||
exports.isNodeOfType = isNodeOfType, exports.isNodeSelection = isNodeSelection, | ||
exports.isNodeType = isNodeType, exports.isProsemirrorMark = isProsemirrorMark, | ||
exports.isProsemirrorNode = isProsemirrorNode, exports.isRemirrorJSON = isRemirrorJSON, | ||
@@ -1338,0 +1343,0 @@ exports.isResolvedPos = isResolvedPos, exports.isSelection = isSelection, exports.isSelectionEmpty = isSelectionEmpty, |
@@ -55,4 +55,2 @@ import type { AttributesParameter, CommandFunction, CommandFunctionParameter, MarkType, MarkTypeParameter, NodeType, NodeTypeParameter, ProsemirrorAttributes, ProsemirrorCommandFunction, RangeParameter } from '@remirror/core-types'; | ||
* @param itemType - the list item type (must be in the schema) | ||
* | ||
* @public | ||
*/ | ||
@@ -59,0 +57,0 @@ export declare function toggleList(type: NodeType, itemType: NodeType): CommandFunction; |
@@ -99,2 +99,8 @@ import type { EditorSchema, EditorState, FromToParameter, MarkAttributes, MarkTypeParameter, PrimitiveSelection, ProsemirrorNode, ProsemirrorNodeParameter, RemirrorContentType, RemirrorJSON, RenderEnvironment, ResolvedPos, SchemaParameter, Selection, Transaction, TrStateParameter } from '@remirror/core-types'; | ||
/** | ||
* Checks if the current node is a block node and empty. | ||
* | ||
* @param node - the prosemirror node | ||
*/ | ||
export declare function isEmptyBlockNode(node: ProsemirrorNode | null | undefined): boolean; | ||
/** | ||
* Retrieve the attributes for a mark. | ||
@@ -247,3 +253,3 @@ * | ||
/** | ||
* The fallback object node to use if unable to convert the value correctly | ||
* The error handler which is called when the JSON passed is invalid. | ||
*/ | ||
@@ -273,2 +279,6 @@ onError?: InvalidContentHandler; | ||
export declare function getTextSelection(selection: PrimitiveSelection, doc: ProsemirrorNode): TextSelection; | ||
/** | ||
* A function that converts a string into a `ProsemirrorNode`. | ||
*/ | ||
export declare type StringHandler = (params: FromStringParameter) => ProsemirrorNode; | ||
export interface StringHandlerParameter { | ||
@@ -282,5 +292,5 @@ /** | ||
* | ||
* See {@link fromHTML} for an example of how this could work. | ||
* See [[`fromHTML`]] for an example of how this could work. | ||
*/ | ||
stringHandler?: (params: FromStringParameter) => ProsemirrorNode; | ||
stringHandler?: StringHandler; | ||
} | ||
@@ -287,0 +297,0 @@ /** |
export { emptyCommandFunction, isChrome, lift, removeMark, replaceText, setBlockType, toggleBlockItem, toggleList, toggleWrap, updateMark, wrapIn, } from './command-utils'; | ||
export type { CreateDocumentNodeParameter, InvalidContentHandler, InvalidContentHandlerParameter, StringHandlerParameter, } from './core-utils'; | ||
export { areSchemasCompatible, atDocEnd, atDocStart, canInsertNode, closestElement, createDocumentNode, endPositionOfParent, fromHtml, getCursor, getDocument, getInvalidContent, getMarkAttributes, getMarkRange, getMatchString, getNearestNonTextElement, getRemirrorJSON, getSelectedGroup, getSelectedWord, getTextContentFromSlice, getTextSelection, isAllSelection, isDocNode, isDocNodeEmpty, isDomNode, isEditorSchema, isEditorState, isElementDomNode, isMarkActive, isMarkType, isNodeSelection, isNodeType, isProsemirrorMark, isProsemirrorNode, isRemirrorJSON, isResolvedPos, isSelection, areStatesEqual, isTextDomNode, isTextSelection, isTransaction, shouldUseDomEnvironment, startPositionOfParent, toDom, toHtml, } from './core-utils'; | ||
export type { CreateDocumentNodeParameter, InvalidContentBlock, InvalidContentHandler, InvalidContentHandlerParameter, StringHandler, StringHandlerParameter, } from './core-utils'; | ||
export { areSchemasCompatible, isEmptyBlockNode, atDocEnd, atDocStart, canInsertNode, closestElement, createDocumentNode, endPositionOfParent, fromHtml, getCursor, getDocument, getInvalidContent, getMarkAttributes, getMarkRange, getMatchString, getNearestNonTextElement, getRemirrorJSON, getSelectedGroup, getSelectedWord, getTextContentFromSlice, getTextSelection, isAllSelection, isDocNode, isDocNodeEmpty, isDomNode, isEditorSchema, isEditorState, isElementDomNode, isMarkActive, isMarkType, isNodeSelection, isNodeType, isProsemirrorMark, isProsemirrorNode, isRemirrorJSON, isResolvedPos, isSelection, areStatesEqual, isTextDomNode, isTextSelection, isTransaction, shouldUseDomEnvironment, startPositionOfParent, toDom, toHtml, } from './core-utils'; | ||
export { environment } from './environment'; | ||
@@ -5,0 +5,0 @@ export type { ModifierKeys } from './keyboard-utils'; |
{ | ||
"name": "@remirror/core-utils", | ||
"version": "1.0.0-next.31", | ||
"version": "1.0.0-next.32", | ||
"description": "Core utilities for dealing with the dom and prosemirror within remirror", | ||
@@ -24,5 +24,5 @@ "homepage": "https://github.com/remirror/remirror/tree/HEAD/packages/@remirror/core-utils", | ||
"@babel/runtime": "^7.11.0", | ||
"@remirror/core-constants": "1.0.0-next.26", | ||
"@remirror/core-helpers": "1.0.0-next.31", | ||
"@remirror/core-types": "1.0.0-next.28", | ||
"@remirror/core-constants": "1.0.0-next.32", | ||
"@remirror/core-helpers": "1.0.0-next.32", | ||
"@remirror/core-types": "1.0.0-next.32", | ||
"@types/min-document": "^2.19.0", | ||
@@ -32,3 +32,3 @@ "min-document": "^2.19.0" | ||
"devDependencies": { | ||
"@remirror/pm": "1.0.0-next.28", | ||
"@remirror/pm": "1.0.0-next.32", | ||
"@types/node": "^14.6.1", | ||
@@ -38,3 +38,3 @@ "domino": "^2.1.6" | ||
"peerDependencies": { | ||
"@remirror/pm": "1.0.0-next.28", | ||
"@remirror/pm": "1.0.0-next.32", | ||
"@types/node": "*" | ||
@@ -41,0 +41,0 @@ }, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
470812
12494
+ Added@remirror/core-constants@1.0.0-next.32(transitive)
+ Added@remirror/core-helpers@1.0.0-next.32(transitive)
+ Added@remirror/core-types@1.0.0-next.32(transitive)
+ Added@remirror/pm@1.0.0-next.32(transitive)
- Removed@remirror/core-constants@1.0.0-next.26(transitive)
- Removed@remirror/core-helpers@1.0.0-next.31(transitive)
- Removed@remirror/core-types@1.0.0-next.28(transitive)
- Removed@remirror/pm@1.0.0-next.28(transitive)