@convertkit/editor-videos
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -6,2 +6,3 @@ 'use strict'; | ||
var React = _interopDefault(require('react')); | ||
var slate = require('slate'); | ||
var slateReact = require('slate-react'); | ||
@@ -35,2 +36,19 @@ | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
return obj; | ||
} | ||
var defineProperty = _defineProperty; | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -121,2 +139,6 @@ if (source == null) return {}; | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
var handledTransferType = function handledTransferType(type) { | ||
@@ -144,7 +166,7 @@ return type == "text" || type == "html"; | ||
type: "video", | ||
isVoid: true, | ||
data: { | ||
data: _objectSpread({ | ||
href: href, | ||
videoId: videoId | ||
} | ||
}, attributes), | ||
nodes: [slate.Text.create("")] | ||
}); | ||
@@ -165,3 +187,2 @@ } | ||
var attributes = props.attributes, | ||
children = props.children, | ||
node = props.node; | ||
@@ -168,0 +189,0 @@ |
{ | ||
"name": "@convertkit/editor-videos", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "A plugin for embedding videos in the ConvertKit Editor", | ||
@@ -32,3 +32,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "77dd3c3566caf1ced62c566c9a650299b1a0a1a0" | ||
"gitHead": "2da6ab7d01165f9c24cb0d714e0cd790aaf692a0" | ||
} |
import React from "react"; | ||
import isUrl from "is-url"; | ||
import { Text } from "slate"; | ||
import { getEventTransfer } from "slate-react"; | ||
@@ -23,4 +24,4 @@ import "./play-button.css"; | ||
type: "video", | ||
isVoid: true, | ||
data: { href, videoId } | ||
data: { href, videoId, ...attributes }, | ||
nodes: [Text.create("")] | ||
}); | ||
@@ -41,3 +42,3 @@ } | ||
renderNode(props, editor, next) { | ||
const { attributes, children, node } = props; | ||
const { attributes, node } = props; | ||
switch (node.type) { | ||
@@ -44,0 +45,0 @@ case "video": |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
8944
5
255
1