Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

slate-react-placeholder

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-react-placeholder - npm Package Compare versions

Comparing version 0.1.15 to 0.1.16

58

dist/slate-react-placeholder.js

@@ -23,2 +23,50 @@ (function (global, factory) {

var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var toConsumableArray = function (arr) {

@@ -57,3 +105,5 @@ if (Array.isArray(arr)) {

var placeholder = options.placeholder,
when = options.when;
when = options.when,
_options$style = options.style,
style = _options$style === undefined ? {} : _options$style;

@@ -106,3 +156,3 @@

if (mark.type === 'placeholder' && mark.data.get('key') === instanceId) {
var style = {
var placeHolderStyle = _extends({
pointerEvents: 'none',

@@ -114,3 +164,3 @@ display: 'inline-block',

opacity: '0.333'
};
}, style);

@@ -122,3 +172,3 @@ return React.createElement(

'span',
{ contentEditable: false, style: style },
{ contentEditable: false, style: placeHolderStyle },
placeholder

@@ -125,0 +175,0 @@ ),

2

dist/slate-react-placeholder.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.SlateReactPlaceholder={},e.React)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(e,t){if(!e)throw new Error("Invariant failed")},n=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},a=0;e.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=a++,l={type:"placeholder",data:{key:o}},i=e.placeholder,c=e.when;return r(i,"You must pass `SlateReactPlaceholder` an `options.placeholder` string."),r(c,"You must pass `SlateReactPlaceholder` an `options.when` query."),{decorateNode:function(e,t,r){if(!t.query(c,e))return r();var a=r(),o=e.getFirstText(),i=e.getLastText(),d={anchor:{key:o.key,offset:0},focus:{key:i.key,offset:i.text.length},mark:l};return[].concat(n(a),[d])},renderMark:function(e,r,n){var a=e.children,l=e.mark;return"placeholder"===l.type&&l.data.get("key")===o?t.createElement("span",null,t.createElement("span",{contentEditable:!1,style:{pointerEvents:"none",display:"inline-block",width:"0",maxWidth:"100%",whiteSpace:"nowrap",opacity:"0.333"}},i),a):n()}}},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t(e.SlateReactPlaceholder={},e.React)}(this,function(e,t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var r=function(e,t){if(!e)throw new Error("Invariant failed")},n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)},o=0;e.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=o++,l={type:"placeholder",data:{key:i}},c=e.placeholder,f=e.when,u=e.style,d=void 0===u?{}:u;return r(c,"You must pass `SlateReactPlaceholder` an `options.placeholder` string."),r(f,"You must pass `SlateReactPlaceholder` an `options.when` query."),{decorateNode:function(e,t,r){if(!t.query(f,e))return r();var n=r(),o=e.getFirstText(),i=e.getLastText(),c={anchor:{key:o.key,offset:0},focus:{key:i.key,offset:i.text.length},mark:l};return[].concat(a(n),[c])},renderMark:function(e,r,a){var o=e.children,l=e.mark;if("placeholder"===l.type&&l.data.get("key")===i){var f=n({pointerEvents:"none",display:"inline-block",width:"0",maxWidth:"100%",whiteSpace:"nowrap",opacity:"0.333"},d);return t.createElement("span",null,t.createElement("span",{contentEditable:!1,style:f},c),o)}return a()}}},Object.defineProperty(e,"__esModule",{value:!0})});

@@ -17,2 +17,50 @@ import React from 'react';

var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var toConsumableArray = function (arr) {

@@ -51,3 +99,5 @@ if (Array.isArray(arr)) {

var placeholder = options.placeholder,
when = options.when;
when = options.when,
_options$style = options.style,
style = _options$style === undefined ? {} : _options$style;

@@ -100,3 +150,3 @@

if (mark.type === 'placeholder' && mark.data.get('key') === instanceId) {
var style = {
var placeHolderStyle = _extends({
pointerEvents: 'none',

@@ -108,3 +158,3 @@ display: 'inline-block',

opacity: '0.333'
};
}, style);

@@ -116,3 +166,3 @@ return React.createElement(

'span',
{ contentEditable: false, style: style },
{ contentEditable: false, style: placeHolderStyle },
placeholder

@@ -119,0 +169,0 @@ ),

@@ -23,2 +23,50 @@ 'use strict';

var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
var toConsumableArray = function (arr) {

@@ -57,3 +105,5 @@ if (Array.isArray(arr)) {

var placeholder = options.placeholder,
when = options.when;
when = options.when,
_options$style = options.style,
style = _options$style === undefined ? {} : _options$style;

@@ -106,3 +156,3 @@

if (mark.type === 'placeholder' && mark.data.get('key') === instanceId) {
var style = {
var placeHolderStyle = _extends({
pointerEvents: 'none',

@@ -114,3 +164,3 @@ display: 'inline-block',

opacity: '0.333'
};
}, style);

@@ -122,3 +172,3 @@ return React.createElement(

'span',
{ contentEditable: false, style: style },
{ contentEditable: false, style: placeHolderStyle },
placeholder

@@ -125,0 +175,0 @@ ),

{
"name": "slate-react-placeholder",
"description": "A Slate plugin to render a placeholder with React.",
"version": "0.1.15",
"version": "0.1.16",
"license": "MIT",

@@ -21,3 +21,3 @@ "repository": "git://github.com/ianstormtaylor/slate.git",

"mocha": "^2.5.3",
"slate": "^0.44.12",
"slate": "^0.44.13",
"tiny-invariant": "^1.0.1"

@@ -24,0 +24,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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