tiptap-utils
Advanced tools
Comparing version 1.7.0 to 1.8.0
/*! | ||
* tiptap-utils v1.6.1 | ||
* tiptap-utils v1.7.0 | ||
* (c) 2019 Scrumpy UG (limited liability) | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* tiptap-utils v1.6.1 | ||
* tiptap-utils v1.7.0 | ||
* (c) 2019 Scrumpy UG (limited liability) | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* tiptap-utils v1.6.1 | ||
* tiptap-utils v1.7.0 | ||
* (c) 2019 Scrumpy UG (limited liability) | ||
@@ -5,0 +5,0 @@ * @license MIT |
/*! | ||
* tiptap-utils v1.6.1 | ||
* tiptap-utils v1.7.0 | ||
* (c) 2019 Scrumpy UG (limited liability) | ||
@@ -9,2 +9,2 @@ * @license MIT | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prosemirror-utils")):"function"==typeof define&&define.amd?define(["exports","prosemirror-utils"],t):t((e=e||self).tiptapUtils={},e.prosemirrorUtils)}(this,function(e,t){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}e.getMarkAttrs=function(e,t){var n=e.selection,o=n.from,i=n.to,a=[];e.doc.nodesBetween(o,i,function(e){a=[].concat(r(a),r(e.marks))});var f=a.find(function(e){return e.type.name===t.name});return f?f.attrs:{}},e.getMarkRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var r=e.parent.childAfter(e.parentOffset);if(!r.node)return!1;var n=r.node.marks.find(function(e){return e.type===t});if(!n)return!1;for(var o=e.index(),i=e.start()+r.offset,a=o+1,f=i+r.node.nodeSize;o>0&&n.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&n.isInSet(e.parent.child(a).marks);)f+=e.parent.child(a).nodeSize,a+=1;return{from:i,to:f}},e.markIsActive=function(e,t){var r=e.selection,n=r.from,o=r.$from,i=r.to;return r.empty?!!t.isInSet(e.storedMarks||o.marks()):!!e.doc.rangeHasMark(n,i,t)},e.nodeEqualsType=function(e){var t=e.types,r=e.node;return Array.isArray(t)&&t.includes(r.type)||r.type===t},e.nodeIsActive=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.findSelectedNodeOfType(r)(e.selection)||t.findParentNode(function(e){return e.type===r})(e.selection);return Object.keys(n).length&&o?o.node.hasMarkup(r,n):!!o},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("prosemirror-utils")):"function"==typeof define&&define.amd?define(["exports","prosemirror-utils"],t):t((e=e||self).tiptapUtils={},e.prosemirrorUtils)}(this,(function(e,t){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}e.getMarkAttrs=function(e,t){var n=e.selection,o=n.from,i=n.to,a=[];e.doc.nodesBetween(o,i,(function(e){a=[].concat(r(a),r(e.marks))}));var f=a.find((function(e){return e.type.name===t.name}));return f?f.attrs:{}},e.getMarkRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e||!t)return!1;var r=e.parent.childAfter(e.parentOffset);if(!r.node)return!1;var n=r.node.marks.find((function(e){return e.type===t}));if(!n)return!1;for(var o=e.index(),i=e.start()+r.offset,a=o+1,f=i+r.node.nodeSize;o>0&&n.isInSet(e.parent.child(o-1).marks);)o-=1,i-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&n.isInSet(e.parent.child(a).marks);)f+=e.parent.child(a).nodeSize,a+=1;return{from:i,to:f}},e.markIsActive=function(e,t){var r=e.selection,n=r.from,o=r.$from,i=r.to;return r.empty?!!t.isInSet(e.storedMarks||o.marks()):!!e.doc.rangeHasMark(n,i,t)},e.nodeEqualsType=function(e){var t=e.types,r=e.node;return Array.isArray(t)&&t.includes(r.type)||r.type===t},e.nodeIsActive=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.findSelectedNodeOfType(r)(e.selection)||t.findParentNode((function(e){return e.type===r}))(e.selection);return Object.keys(n).length&&o?o.node.hasMarkup(r,n):!!o},Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "tiptap-utils", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Utility functions for tiptap", | ||
@@ -23,8 +23,8 @@ "homepage": "https://tiptap.scrumpy.io", | ||
"dependencies": { | ||
"prosemirror-model": "^1.7.1", | ||
"prosemirror-model": "^1.7.2", | ||
"prosemirror-state": "^1.2.4", | ||
"prosemirror-tables": "^0.9.1", | ||
"prosemirror-tables": "^0.9.5", | ||
"prosemirror-utils": "^0.9.6" | ||
}, | ||
"gitHead": "2f5c50297b170e5e363ee24a3824cd4573c09837" | ||
"gitHead": "01493e825b2a7c511621f0d914ec571b93861934" | ||
} |
17598
Updatedprosemirror-model@^1.7.2
Updatedprosemirror-tables@^0.9.5