@recogito/recogito-client-core
Advanced tools
Comparing version 1.3.0 to 1.3.1
{ | ||
"name": "@recogito/recogito-client-core", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Core functions, classes and components for RecogitoJS", | ||
@@ -31,2 +31,3 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@babel/polyfill": "^7.10.4", | ||
"downshift": "^6.1.3", | ||
@@ -33,0 +34,0 @@ "fast-deep-equal": "^3.1.3", |
@@ -8,7 +8,2 @@ import React, { Component } from 'react'; | ||
/** Shorthand **/ | ||
const toArray = body => | ||
Array.isArray(body) ? body : [ body ]; | ||
/** | ||
@@ -217,2 +212,5 @@ * The popup editor component. | ||
onRemoveAndAppend = (bodyOrBodiesToRemove, bodyOrBodiesToAppend, saveImmediately) => { | ||
// Shorthand | ||
const toArray = body => Array.isArray(body) ? body : [ body ]; | ||
const toRemove = toArray(bodyOrBodiesToRemove); | ||
@@ -219,0 +217,0 @@ const toAppend = toArray(bodyOrBodiesToAppend).map(b => |
@@ -22,3 +22,3 @@ import React, { Component, createRef } from 'react'; | ||
if (this.props.focus) | ||
this.element.current.querySelector('input').focus(); | ||
this.element.current.querySelector('input').focus({ preventScroll: true }); | ||
} | ||
@@ -25,0 +25,0 @@ } |
@@ -24,3 +24,3 @@ import React, { Component, createRef } from 'react'; | ||
if (this.props.focus && this.element.current) | ||
this.element.current.focus(); | ||
this.element.current.focus({ preventScroll: true }); | ||
} | ||
@@ -27,0 +27,0 @@ |
import I18n from '../i18n'; | ||
/** | ||
* Adds DOM polyfills that babel polyfill doesn't include | ||
*/ | ||
export const addPolyfills = () => { | ||
if (!Element.prototype.matches) { | ||
Element.prototype.matches = Element.prototype.msMatchesSelector || | ||
Element.prototype.webkitMatchesSelector; | ||
} | ||
if (!Element.prototype.closest) { | ||
Element.prototype.closest = function(s) { | ||
let el = this; | ||
do { | ||
if (Element.prototype.matches.call(el, s)) return el; | ||
el = el.parentElement || el.parentNode; | ||
} while (el !== null && el.nodeType === 1); | ||
return null; | ||
}; | ||
} | ||
} | ||
/** | ||
* Helper to init the i18n class with a pre-defined or auto-detected locale. | ||
@@ -29,0 +5,0 @@ */ |
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
67877
49
10
1407
+ Added@babel/polyfill@^7.10.4
+ Added@babel/polyfill@7.12.1(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedregenerator-runtime@0.13.11(transitive)