New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

slate-react

Package Overview
Dependencies
Maintainers
1
Versions
835
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-react - npm Package Compare versions

Comparing version 0.10.15 to 0.10.16

7

lib/utils/find-dom-node.js

@@ -13,6 +13,9 @@ 'use strict';

* @param {String|Node} key
* @param {Window} win (optional)
* @return {Element}
*/
function findDOMNode(key, window) {
function findDOMNode(key) {
var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
if (_slate.Node.isNode(key)) {

@@ -22,3 +25,3 @@ key = key.key;

var el = window.document.querySelector('[data-key="' + key + '"]');
var el = win.document.querySelector('[data-key="' + key + '"]');

@@ -25,0 +28,0 @@ if (!el) {

@@ -16,10 +16,12 @@ 'use strict';

*
* @param {Element} root
* @param {String} key
* @param {Number} offset
* @return {Object}
* @param {Window} win (optional)
* @return {Object|Null}
*/
function findDOMPoint(key, offset, window) {
var el = (0, _findDomNode2.default)(key, window);
function findDOMPoint(key, offset) {
var win = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window;
var el = (0, _findDomNode2.default)(key, win);
var start = 0;

@@ -30,3 +32,3 @@ var n = void 0;

// pass in all four even though the last two are defaults. (2017/10/25)
var iterator = window.document.createNodeIterator(el, NodeFilter.SHOW_TEXT, function () {
var iterator = win.document.createNodeIterator(el, NodeFilter.SHOW_TEXT, function () {
return NodeFilter.FILTER_ACCEPT;

@@ -33,0 +35,0 @@ }, false);

@@ -17,6 +17,8 @@ 'use strict';

* @param {Range} range
* @param {Window} win (optional)
* @return {Object|Null}
*/
function findDOMRange(range, window) {
function findDOMRange(range) {
var win = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
var anchorKey = range.anchorKey,

@@ -29,7 +31,7 @@ anchorOffset = range.anchorOffset,

var anchor = (0, _findDomPoint2.default)(anchorKey, anchorOffset, window);
var focus = isCollapsed ? anchor : (0, _findDomPoint2.default)(focusKey, focusOffset, window);
var anchor = (0, _findDomPoint2.default)(anchorKey, anchorOffset, win);
var focus = isCollapsed ? anchor : (0, _findDomPoint2.default)(focusKey, focusOffset, win);
if (!anchor || !focus) return null;
var r = window.document.createRange();
var r = win.document.createRange();
var start = isBackward ? focus : anchor;

@@ -36,0 +38,0 @@ var end = isBackward ? anchor : focus;

{
"name": "slate-react",
"description": "A set of React components for building completely customizable rich-text editors.",
"version": "0.10.15",
"version": "0.10.16",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "git://github.com/ianstormtaylor/slate.git",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc