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

slate-hyperscript

Package Overview
Dependencies
Maintainers
5
Versions
393
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-hyperscript - npm Package Compare versions

Comparing version 0.82.0-2022622233410 to 0.100.0-20231020154238

0

dist/creators.d.ts

@@ -0,0 +0,0 @@ import { Element, Descendant, Range, Text, Editor } from 'slate';

19

dist/hyperscript.d.ts

@@ -6,3 +6,3 @@ import { createAnchor, createCursor, createElement, createFocus, createFragment, createSelection, createText } from './creators';

*/
declare type HyperscriptCreators<T = any> = Record<string, (tagName: string, attributes: {
type HyperscriptCreators<T = any> = Record<string, (tagName: string, attributes: {
[key: string]: any;

@@ -15,3 +15,3 @@ }, children: any[]) => T>;

*/
declare type HyperscriptShorthands = Record<string, Record<string, any>>;
type HyperscriptShorthands = Record<string, Record<string, any>>;
/**

@@ -23,3 +23,3 @@ * Create a Slate hyperscript function with `options`.

elements?: HyperscriptShorthands;
}) => <S extends "element" | "anchor" | "cursor" | "editor" | "focus" | "fragment" | "selection" | "text">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<({
}) => <S extends "anchor" | "cursor" | "editor" | "element" | "focus" | "fragment" | "selection" | "text">(tagName: S, attributes?: Object, ...children: any[]) => ReturnType<{
anchor: typeof createAnchor;

@@ -35,15 +35,4 @@ cursor: typeof createCursor;

text: typeof createText;
} | {
anchor: typeof createAnchor;
cursor: typeof createCursor;
editor: (tagName: string, attributes: {
[key: string]: any;
}, children: any[]) => import("slate").BaseEditor;
element: typeof createElement;
focus: typeof createFocus;
fragment: typeof createFragment;
selection: typeof createSelection;
text: typeof createText;
})[S]>;
}[S]>;
export { createHyperscript, HyperscriptCreators, HyperscriptShorthands };
//# sourceMappingURL=hyperscript.d.ts.map

@@ -6,3 +6,3 @@ import { createHyperscript, HyperscriptCreators, HyperscriptShorthands } from './hyperscript';

*/
declare const jsx: <S extends "anchor" | "cursor" | "editor" | "element" | "focus" | "fragment" | "selection" | "text">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<({
declare const jsx: <S extends "anchor" | "cursor" | "editor" | "element" | "focus" | "fragment" | "selection" | "text">(tagName: S, attributes?: Object | undefined, ...children: any[]) => ReturnType<{
anchor: typeof import("./creators").createAnchor;

@@ -18,15 +18,4 @@ cursor: typeof import("./creators").createCursor;

text: typeof createText;
} | {
anchor: typeof import("./creators").createAnchor;
cursor: typeof import("./creators").createCursor;
editor: (tagName: string, attributes: {
[key: string]: any;
}, children: any[]) => import("slate").BaseEditor;
element: typeof import("./creators").createElement;
focus: typeof import("./creators").createFocus;
fragment: typeof import("./creators").createFragment;
selection: typeof import("./creators").createSelection;
text: typeof createText;
})[S]>;
}[S]>;
export { jsx, createHyperscript, createEditor, createText, HyperscriptCreators, HyperscriptShorthands, };
//# sourceMappingURL=index.d.ts.map
import { isPlainObject } from 'is-plain-object';
import { Text, Range, Node, Element, createEditor as createEditor$1 } from 'slate';
function _typeof(o) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, _typeof(o);
}
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
function _defineProperty(obj, key, value) {
key = _toPropertyKey(key);
if (key in obj) {

@@ -15,3 +42,2 @@ Object.defineProperty(obj, key, {

}
return obj;

@@ -27,3 +53,2 @@ }

*/
var FOCUS = new WeakMap();

@@ -33,3 +58,2 @@ /**

*/
class Token {}

@@ -39,3 +63,2 @@ /**

*/
class AnchorToken extends Token {

@@ -45,2 +68,4 @@ constructor() {

super();
_defineProperty(this, "offset", void 0);
_defineProperty(this, "path", void 0);
var {

@@ -53,3 +78,2 @@ offset,

}
}

@@ -59,3 +83,2 @@ /**

*/
class FocusToken extends Token {

@@ -65,2 +88,4 @@ constructor() {

super();
_defineProperty(this, "offset", void 0);
_defineProperty(this, "path", void 0);
var {

@@ -73,3 +98,2 @@ offset,

}
}

@@ -79,3 +103,2 @@ /**

*/
var addAnchorToken = (text, token) => {

@@ -88,3 +111,2 @@ var offset = text.text.length;

*/
var getAnchorOffset = text => {

@@ -96,3 +118,2 @@ return ANCHOR.get(text);

*/
var addFocusToken = (text, token) => {

@@ -105,3 +126,2 @@ var offset = text.text.length;

*/
var getFocusOffset = text => {

@@ -111,5 +131,4 @@ return FOCUS.get(text);

function ownKeys$1(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$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/**

@@ -119,8 +138,5 @@ * Resolve the descedants of a node by normalizing the children that can be

*/
var STRINGS = new WeakSet();
var resolveDescendants = children => {
var nodes = [];
var addChild = child => {

@@ -130,5 +146,3 @@ if (child == null) {

}
var prev = nodes[nodes.length - 1];
if (typeof child === 'string') {

@@ -141,6 +155,4 @@ var text = {

}
if (Text.isText(child)) {
var c = child; // HACK: fix typescript complaining
if (Text.isText(prev) && STRINGS.has(prev) && STRINGS.has(c) && Text.equals(prev, c, {

@@ -157,3 +169,2 @@ loose: true

var n = nodes[nodes.length - 1];
if (!Text.isText(n)) {

@@ -163,3 +174,2 @@ addChild('');

}
if (child instanceof AnchorToken) {

@@ -174,7 +184,5 @@ addAnchorToken(n, child);

};
for (var child of children.flat(Infinity)) {
addChild(child);
}
return nodes;

@@ -185,4 +193,2 @@ };

*/
function createAnchor(tagName, attributes, children) {

@@ -194,3 +200,2 @@ return new AnchorToken(attributes);

*/
function createCursor(tagName, attributes, children) {

@@ -202,3 +207,2 @@ return [new AnchorToken(attributes), new FocusToken(attributes)];

*/
function createElement(tagName, attributes, children) {

@@ -212,3 +216,2 @@ return _objectSpread$1(_objectSpread$1({}, attributes), {}, {

*/
function createFocus(tagName, attributes, children) {

@@ -220,3 +223,2 @@ return new FocusToken(attributes);

*/
function createFragment(tagName, attributes, children) {

@@ -228,15 +230,11 @@ return resolveDescendants(children);

*/
function createSelection(tagName, attributes, children) {
var anchor = children.find(c => c instanceof AnchorToken);
var focus = children.find(c => c instanceof FocusToken);
if (!anchor || anchor.offset == null || anchor.path == null) {
throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");
}
if (!focus || focus.offset == null || focus.path == null) {
throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");
}
return _objectSpread$1({

@@ -256,12 +254,8 @@ anchor: {

*/
function createText(tagName, attributes, children) {
var nodes = resolveDescendants(children);
if (nodes.length > 1) {
throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");
}
var [node] = nodes;
if (node == null) {

@@ -272,9 +266,7 @@ node = {

}
if (!Text.isText(node)) {
throw new Error("\n The <text> hyperscript tag can only contain text content as children.");
} // COMPAT: If they used the <text> tag we want to guarantee that it won't be
}
// COMPAT: If they used the <text> tag we want to guarantee that it won't be
// merge with other string children.
STRINGS.delete(node);

@@ -287,7 +279,5 @@ Object.assign(node, attributes);

*/
var createEditor = makeEditor => (tagName, attributes, children) => {
var otherChildren = [];
var selectionChild;
for (var child of children) {

@@ -300,3 +290,2 @@ if (Range.isRange(child)) {

}
var descendants = resolveDescendants(otherChildren);

@@ -306,9 +295,8 @@ var selection = {};

Object.assign(editor, attributes);
editor.children = descendants; // Search the document's texts to see if any of them have tokens associated
editor.children = descendants;
// Search the document's texts to see if any of them have tokens associated
// that need incorporated into the selection.
for (var [node, path] of Node.texts(editor)) {
var anchor = getAnchorOffset(node);
var focus = getFocusOffset(node);
if (anchor != null) {

@@ -321,3 +309,2 @@ var [offset] = anchor;

}
if (focus != null) {

@@ -331,11 +318,8 @@ var [_offset] = focus;

}
if (selection.anchor && !selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");
}
if (!selection.anchor && selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");
}
if (selectionChild != null) {

@@ -346,13 +330,10 @@ editor.selection = selectionChild;

}
return editor;
};
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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/**
* The default creators for Slate objects.
*/
var DEFAULT_CREATORS = {

@@ -371,3 +352,2 @@ anchor: createAnchor,

*/
var createHyperscript = function createHyperscript() {

@@ -379,5 +359,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

var elementCreators = normalizeElements(elements);
var creators = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CREATORS), elementCreators), options.creators);
var jsx = createFactory(creators);

@@ -389,4 +367,2 @@ return jsx;

*/
var createFactory = creators => {

@@ -397,13 +373,9 @@ var jsx = function jsx(tagName, attributes) {

}
var creator = creators[tagName];
if (!creator) {
throw new Error("No hyperscript creator found for tag: <".concat(tagName, ">"));
}
if (attributes == null) {
attributes = {};
}
if (!isPlainObject(attributes)) {

@@ -413,3 +385,2 @@ children = [attributes].concat(children);

}
children = children.filter(child => Boolean(child)).flat();

@@ -419,3 +390,2 @@ var ret = creator(tagName, attributes, children);

};
return jsx;

@@ -426,14 +396,9 @@ };

*/
var normalizeElements = elements => {
var creators = {};
var _loop = function _loop(tagName) {
var _loop = function _loop() {
var props = elements[tagName];
if (typeof props !== 'object') {
throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(tagName, "> tag you passed: ").concat(props));
}
creators[tagName] = (tagName, attributes, children) => {

@@ -443,7 +408,5 @@ return createElement('element', _objectSpread(_objectSpread({}, props), attributes), children);

};
for (var tagName in elements) {
_loop(tagName);
_loop();
}
return creators;

@@ -455,3 +418,2 @@ };

*/
var jsx = createHyperscript();

@@ -458,0 +420,0 @@

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var isPlainObject = require('is-plain-object');

@@ -17,30 +15,48 @@ var slate = require('slate');

var _typeof_1 = createCommonjsModule(function (module) {
function _typeof(obj) {
function _typeof(o) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var _typeof = unwrapExports(_typeof_1);
module.exports["default"] = module.exports, module.exports.__esModule = true;
var toPrimitive = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
return _typeof(obj);
unwrapExports(toPrimitive);
var toPropertyKey = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _typeof = unwrapExports(_typeof_1);
unwrapExports(toPropertyKey);
var defineProperty = createCommonjsModule(function (module) {
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {

@@ -56,8 +72,5 @@ Object.defineProperty(obj, key, {

}
return obj;
}
module.exports = _defineProperty;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -71,5 +84,3 @@

}
module.exports = _arrayWithHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -80,34 +91,30 @@

var iterableToArrayLimit = createCommonjsModule(function (module) {
function _iterableToArrayLimit(arr, i) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (!_n && _i["return"] != null) _i["return"]();
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
if (_d) throw _e;
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
return _arr;
}
module.exports = _iterableToArrayLimit;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -120,12 +127,6 @@

if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
module.exports = _arrayLikeToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -144,5 +145,3 @@

}
module.exports = _unsupportedIterableToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -156,5 +155,3 @@

}
module.exports = _nonIterableRest;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -168,5 +165,3 @@

}
module.exports = _slicedToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -176,15 +171,23 @@

var assertThisInitialized = createCommonjsModule(function (module) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _assertThisInitialized = unwrapExports(assertThisInitialized);
var setPrototypeOf = createCommonjsModule(function (module) {
function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _setPrototypeOf(o, p);
}
module.exports = _setPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -199,3 +202,2 @@

}
subClass.prototype = Object.create(superClass && superClass.prototype, {

@@ -208,7 +210,8 @@ constructor: {

});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) setPrototypeOf(subClass, superClass);
}
module.exports = _inherits;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -218,22 +221,5 @@

var assertThisInitialized = createCommonjsModule(function (module) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
unwrapExports(assertThisInitialized);
var possibleConstructorReturn = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _possibleConstructorReturn(self, call) {

@@ -245,8 +231,5 @@ if (call && (_typeof(call) === "object" || typeof call === "function")) {

}
return assertThisInitialized(self);
}
module.exports = _possibleConstructorReturn;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -258,11 +241,8 @@

function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _getPrototypeOf(o);
}
module.exports = _getPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -272,2 +252,25 @@

var createClass = createCommonjsModule(function (module) {
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _createClass = unwrapExports(createClass);
var classCallCheck = createCommonjsModule(function (module) {

@@ -279,5 +282,3 @@ function _classCallCheck(instance, Constructor) {

}
module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -288,5 +289,3 @@

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
/**

@@ -299,3 +298,2 @@ * A weak map to hold anchor tokens.

*/
var FOCUS = new WeakMap();

@@ -305,25 +303,20 @@ /**

*/
var Token = function Token() {
var Token = /*#__PURE__*/_createClass(function Token() {
_classCallCheck(this, Token);
};
});
/**
* Anchor tokens represent the selection's anchor point.
*/
var AnchorToken = /*#__PURE__*/function (_Token) {
_inherits(AnchorToken, _Token);
var _super = _createSuper(AnchorToken);
function AnchorToken() {
var _this;
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, AnchorToken);
_this = _super.call(this);
_defineProperty(_assertThisInitialized(_this), "offset", void 0);
_defineProperty(_assertThisInitialized(_this), "path", void 0);
var offset = props.offset,
path = props.path;
path = props.path;
_this.offset = offset;

@@ -333,4 +326,3 @@ _this.path = path;

}
return AnchorToken;
return _createClass(AnchorToken);
}(Token);

@@ -340,18 +332,14 @@ /**

*/
var FocusToken = /*#__PURE__*/function (_Token2) {
_inherits(FocusToken, _Token2);
var _super2 = _createSuper(FocusToken);
function FocusToken() {
var _this2;
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, FocusToken);
_this2 = _super2.call(this);
_defineProperty(_assertThisInitialized(_this2), "offset", void 0);
_defineProperty(_assertThisInitialized(_this2), "path", void 0);
var offset = props.offset,
path = props.path;
path = props.path;
_this2.offset = offset;

@@ -361,4 +349,3 @@ _this2.path = path;

}
return FocusToken;
return _createClass(FocusToken);
}(Token);

@@ -368,3 +355,2 @@ /**

*/
var addAnchorToken = function addAnchorToken(text, token) {

@@ -377,3 +363,2 @@ var offset = text.text.length;

*/
var getAnchorOffset = function getAnchorOffset(text) {

@@ -385,3 +370,2 @@ return ANCHOR.get(text);

*/
var addFocusToken = function addFocusToken(text, token) {

@@ -394,3 +378,2 @@ var offset = text.text.length;

*/
var getFocusOffset = function getFocusOffset(text) {

@@ -400,11 +383,7 @@ return FOCUS.get(text);

function ownKeys$1(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$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/**

@@ -414,8 +393,5 @@ * Resolve the descedants of a node by normalizing the children that can be

*/
var STRINGS = new WeakSet();
var resolveDescendants = function resolveDescendants(children) {
var nodes = [];
var addChild = function addChild(child) {

@@ -425,5 +401,3 @@ if (child == null) {

}
var prev = nodes[nodes.length - 1];
if (typeof child === 'string') {

@@ -436,6 +410,4 @@ var text = {

}
if (slate.Text.isText(child)) {
var c = child; // HACK: fix typescript complaining
if (slate.Text.isText(prev) && STRINGS.has(prev) && STRINGS.has(c) && slate.Text.equals(prev, c, {

@@ -452,3 +424,2 @@ loose: true

var n = nodes[nodes.length - 1];
if (!slate.Text.isText(n)) {

@@ -458,3 +429,2 @@ addChild('');

}
if (child instanceof AnchorToken) {

@@ -469,6 +439,4 @@ addAnchorToken(n, child);

};
var _iterator = _createForOfIteratorHelper(children.flat(Infinity)),
_step;
_step;
try {

@@ -484,3 +452,2 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return nodes;

@@ -491,4 +458,2 @@ };

*/
function createAnchor(tagName, attributes, children) {

@@ -500,3 +465,2 @@ return new AnchorToken(attributes);

*/
function createCursor(tagName, attributes, children) {

@@ -508,3 +472,2 @@ return [new AnchorToken(attributes), new FocusToken(attributes)];

*/
function createElement(tagName, attributes, children) {

@@ -518,3 +481,2 @@ return _objectSpread$1(_objectSpread$1({}, attributes), {}, {

*/
function createFocus(tagName, attributes, children) {

@@ -526,3 +488,2 @@ return new FocusToken(attributes);

*/
function createFragment(tagName, attributes, children) {

@@ -534,3 +495,2 @@ return resolveDescendants(children);

*/
function createSelection(tagName, attributes, children) {

@@ -543,11 +503,8 @@ var anchor = children.find(function (c) {

});
if (!anchor || anchor.offset == null || anchor.path == null) {
throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");
}
if (!focus || focus.offset == null || focus.path == null) {
throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");
}
return _objectSpread$1({

@@ -567,13 +524,9 @@ anchor: {

*/
function createText(tagName, attributes, children) {
var nodes = resolveDescendants(children);
if (nodes.length > 1) {
throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");
}
var _nodes = _slicedToArray(nodes, 1),
node = _nodes[0];
node = _nodes[0];
if (node == null) {

@@ -584,9 +537,7 @@ node = {

}
if (!slate.Text.isText(node)) {
throw new Error("\n The <text> hyperscript tag can only contain text content as children.");
} // COMPAT: If they used the <text> tag we want to guarantee that it won't be
}
// COMPAT: If they used the <text> tag we want to guarantee that it won't be
// merge with other string children.
STRINGS["delete"](node);

@@ -599,3 +550,2 @@ Object.assign(node, attributes);

*/
var createEditor = function createEditor(makeEditor) {

@@ -605,10 +555,7 @@ return function (tagName, attributes, children) {

var selectionChild;
var _iterator2 = _createForOfIteratorHelper(children),
_step2;
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var child = _step2.value;
if (slate.Range.isRange(child)) {

@@ -625,3 +572,2 @@ selectionChild = child;

}
var descendants = resolveDescendants(otherChildren);

@@ -631,21 +577,17 @@ var selection = {};

Object.assign(editor, attributes);
editor.children = descendants; // Search the document's texts to see if any of them have tokens associated
editor.children = descendants;
// Search the document's texts to see if any of them have tokens associated
// that need incorporated into the selection.
var _iterator3 = _createForOfIteratorHelper(slate.Node.texts(editor)),
_step3;
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var _step3$value = _slicedToArray(_step3.value, 2),
node = _step3$value[0],
path = _step3$value[1];
node = _step3$value[0],
path = _step3$value[1];
var anchor = getAnchorOffset(node);
var focus = getFocusOffset(node);
if (anchor != null) {
var _anchor = _slicedToArray(anchor, 1),
offset = _anchor[0];
offset = _anchor[0];
selection.anchor = {

@@ -656,7 +598,5 @@ path: path,

}
if (focus != null) {
var _focus = _slicedToArray(focus, 1),
_offset = _focus[0];
_offset = _focus[0];
selection.focus = {

@@ -673,11 +613,8 @@ path: path,

}
if (selection.anchor && !selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");
}
if (!selection.anchor && selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");
}
if (selectionChild != null) {

@@ -688,3 +625,2 @@ editor.selection = selectionChild;

}
return editor;

@@ -694,9 +630,7 @@ };

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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/**
* The default creators for Slate objects.
*/
var DEFAULT_CREATORS = {

@@ -715,11 +649,8 @@ anchor: createAnchor,

*/
var createHyperscript = function createHyperscript() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _options$elements = options.elements,
elements = _options$elements === void 0 ? {} : _options$elements;
elements = _options$elements === void 0 ? {} : _options$elements;
var elementCreators = normalizeElements(elements);
var creators = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CREATORS), elementCreators), options.creators);
var jsx = createFactory(creators);

@@ -731,4 +662,2 @@ return jsx;

*/
var createFactory = function createFactory(creators) {

@@ -739,13 +668,9 @@ var jsx = function jsx(tagName, attributes) {

}
var creator = creators[tagName];
if (!creator) {
throw new Error("No hyperscript creator found for tag: <".concat(tagName, ">"));
}
if (attributes == null) {
attributes = {};
}
if (!isPlainObject.isPlainObject(attributes)) {

@@ -755,3 +680,2 @@ children = [attributes].concat(children);

}
children = children.filter(function (child) {

@@ -763,3 +687,2 @@ return Boolean(child);

};
return jsx;

@@ -770,14 +693,9 @@ };

*/
var normalizeElements = function normalizeElements(elements) {
var creators = {};
var _loop = function _loop(tagName) {
var _loop = function _loop() {
var props = elements[tagName];
if (_typeof(props) !== 'object') {
throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(tagName, "> tag you passed: ").concat(props));
}
creators[tagName] = function (tagName, attributes, children) {

@@ -787,7 +705,5 @@ return createElement('element', _objectSpread(_objectSpread({}, props), attributes), children);

};
for (var tagName in elements) {
_loop(tagName);
_loop();
}
return creators;

@@ -799,3 +715,2 @@ };

*/
var jsx = createHyperscript();

@@ -802,0 +717,0 @@

@@ -5,3 +5,3 @@ (function (global, factory) {

(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SlateHyperscript = {}, global.Slate));
}(this, (function (exports, slate) { 'use strict';
})(this, (function (exports, slate) { 'use strict';

@@ -17,30 +17,48 @@ function unwrapExports (x) {

var _typeof_1 = createCommonjsModule(function (module) {
function _typeof(obj) {
function _typeof(o) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
var _typeof = unwrapExports(_typeof_1);
module.exports["default"] = module.exports, module.exports.__esModule = true;
var toPrimitive = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _toPrimitive(input, hint) {
if (_typeof(input) !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (_typeof(res) !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
return _typeof(obj);
unwrapExports(toPrimitive);
var toPropertyKey = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _toPropertyKey(arg) {
var key = toPrimitive(arg, "string");
return _typeof(key) === "symbol" ? key : String(key);
}
module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _typeof = unwrapExports(_typeof_1);
unwrapExports(toPropertyKey);
var defineProperty = createCommonjsModule(function (module) {
function _defineProperty(obj, key, value) {
key = toPropertyKey(key);
if (key in obj) {

@@ -56,8 +74,5 @@ Object.defineProperty(obj, key, {

}
return obj;
}
module.exports = _defineProperty;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -104,5 +119,3 @@

}
module.exports = _arrayWithHoles;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -113,34 +126,30 @@

var iterableToArrayLimit = createCommonjsModule(function (module) {
function _iterableToArrayLimit(arr, i) {
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
if (_i == null) return;
var _arr = [];
var _n = true;
var _d = false;
var _s, _e;
try {
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
function _iterableToArrayLimit(r, l) {
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t) {
var e,
n,
i,
u,
a = [],
f = !0,
o = !1;
try {
if (!_n && _i["return"] != null) _i["return"]();
if (i = (t = t.call(r)).next, 0 === l) {
if (Object(t) !== t) return;
f = !1;
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
} catch (r) {
o = !0, n = r;
} finally {
if (_d) throw _e;
try {
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
} finally {
if (o) throw n;
}
}
return a;
}
return _arr;
}
module.exports = _iterableToArrayLimit;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -153,12 +162,6 @@

if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
module.exports = _arrayLikeToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -177,5 +180,3 @@

}
module.exports = _unsupportedIterableToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -189,5 +190,3 @@

}
module.exports = _nonIterableRest;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -201,5 +200,3 @@

}
module.exports = _slicedToArray;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -209,15 +206,23 @@

var assertThisInitialized = createCommonjsModule(function (module) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _assertThisInitialized = unwrapExports(assertThisInitialized);
var setPrototypeOf = createCommonjsModule(function (module) {
function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _setPrototypeOf(o, p);
}
module.exports = _setPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -232,3 +237,2 @@

}
subClass.prototype = Object.create(superClass && superClass.prototype, {

@@ -241,7 +245,8 @@ constructor: {

});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) setPrototypeOf(subClass, superClass);
}
module.exports = _inherits;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -251,22 +256,5 @@

var assertThisInitialized = createCommonjsModule(function (module) {
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
module.exports = _assertThisInitialized;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
unwrapExports(assertThisInitialized);
var possibleConstructorReturn = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _possibleConstructorReturn(self, call) {

@@ -278,8 +266,5 @@ if (call && (_typeof(call) === "object" || typeof call === "function")) {

}
return assertThisInitialized(self);
}
module.exports = _possibleConstructorReturn;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -291,11 +276,8 @@

function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
return _getPrototypeOf(o);
}
module.exports = _getPrototypeOf;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -305,2 +287,25 @@

var createClass = createCommonjsModule(function (module) {
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
});
var _createClass = unwrapExports(createClass);
var classCallCheck = createCommonjsModule(function (module) {

@@ -312,5 +317,3 @@ function _classCallCheck(instance, Constructor) {

}
module.exports = _classCallCheck;
module.exports["default"] = module.exports, module.exports.__esModule = true;
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
});

@@ -321,5 +324,3 @@

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
/**

@@ -332,3 +333,2 @@ * A weak map to hold anchor tokens.

*/
var FOCUS = new WeakMap();

@@ -338,25 +338,20 @@ /**

*/
var Token = function Token() {
var Token = /*#__PURE__*/_createClass(function Token() {
_classCallCheck(this, Token);
};
});
/**
* Anchor tokens represent the selection's anchor point.
*/
var AnchorToken = /*#__PURE__*/function (_Token) {
_inherits(AnchorToken, _Token);
var _super = _createSuper(AnchorToken);
function AnchorToken() {
var _this;
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, AnchorToken);
_this = _super.call(this);
_defineProperty(_assertThisInitialized(_this), "offset", void 0);
_defineProperty(_assertThisInitialized(_this), "path", void 0);
var offset = props.offset,
path = props.path;
path = props.path;
_this.offset = offset;

@@ -366,4 +361,3 @@ _this.path = path;

}
return AnchorToken;
return _createClass(AnchorToken);
}(Token);

@@ -373,18 +367,14 @@ /**

*/
var FocusToken = /*#__PURE__*/function (_Token2) {
_inherits(FocusToken, _Token2);
var _super2 = _createSuper(FocusToken);
function FocusToken() {
var _this2;
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, FocusToken);
_this2 = _super2.call(this);
_defineProperty(_assertThisInitialized(_this2), "offset", void 0);
_defineProperty(_assertThisInitialized(_this2), "path", void 0);
var offset = props.offset,
path = props.path;
path = props.path;
_this2.offset = offset;

@@ -394,4 +384,3 @@ _this2.path = path;

}
return FocusToken;
return _createClass(FocusToken);
}(Token);

@@ -401,3 +390,2 @@ /**

*/
var addAnchorToken = function addAnchorToken(text, token) {

@@ -410,3 +398,2 @@ var offset = text.text.length;

*/
var getAnchorOffset = function getAnchorOffset(text) {

@@ -418,3 +405,2 @@ return ANCHOR.get(text);

*/
var addFocusToken = function addFocusToken(text, token) {

@@ -427,3 +413,2 @@ var offset = text.text.length;

*/
var getFocusOffset = function getFocusOffset(text) {

@@ -433,11 +418,7 @@ return FOCUS.get(text);

function ownKeys$1(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$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/**

@@ -447,8 +428,5 @@ * Resolve the descedants of a node by normalizing the children that can be

*/
var STRINGS = new WeakSet();
var resolveDescendants = function resolveDescendants(children) {
var nodes = [];
var addChild = function addChild(child) {

@@ -458,5 +436,3 @@ if (child == null) {

}
var prev = nodes[nodes.length - 1];
if (typeof child === 'string') {

@@ -469,6 +445,4 @@ var text = {

}
if (slate.Text.isText(child)) {
var c = child; // HACK: fix typescript complaining
if (slate.Text.isText(prev) && STRINGS.has(prev) && STRINGS.has(c) && slate.Text.equals(prev, c, {

@@ -485,3 +459,2 @@ loose: true

var n = nodes[nodes.length - 1];
if (!slate.Text.isText(n)) {

@@ -491,3 +464,2 @@ addChild('');

}
if (child instanceof AnchorToken) {

@@ -502,6 +474,4 @@ addAnchorToken(n, child);

};
var _iterator = _createForOfIteratorHelper(children.flat(Infinity)),
_step;
_step;
try {

@@ -517,3 +487,2 @@ for (_iterator.s(); !(_step = _iterator.n()).done;) {

}
return nodes;

@@ -524,4 +493,2 @@ };

*/
function createAnchor(tagName, attributes, children) {

@@ -533,3 +500,2 @@ return new AnchorToken(attributes);

*/
function createCursor(tagName, attributes, children) {

@@ -541,3 +507,2 @@ return [new AnchorToken(attributes), new FocusToken(attributes)];

*/
function createElement(tagName, attributes, children) {

@@ -551,3 +516,2 @@ return _objectSpread$1(_objectSpread$1({}, attributes), {}, {

*/
function createFocus(tagName, attributes, children) {

@@ -559,3 +523,2 @@ return new FocusToken(attributes);

*/
function createFragment(tagName, attributes, children) {

@@ -567,3 +530,2 @@ return resolveDescendants(children);

*/
function createSelection(tagName, attributes, children) {

@@ -576,11 +538,8 @@ var anchor = children.find(function (c) {

});
if (!anchor || anchor.offset == null || anchor.path == null) {
throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");
}
if (!focus || focus.offset == null || focus.path == null) {
throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");
}
return _objectSpread$1({

@@ -600,13 +559,9 @@ anchor: {

*/
function createText(tagName, attributes, children) {
var nodes = resolveDescendants(children);
if (nodes.length > 1) {
throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");
}
var _nodes = _slicedToArray(nodes, 1),
node = _nodes[0];
node = _nodes[0];
if (node == null) {

@@ -617,9 +572,7 @@ node = {

}
if (!slate.Text.isText(node)) {
throw new Error("\n The <text> hyperscript tag can only contain text content as children.");
} // COMPAT: If they used the <text> tag we want to guarantee that it won't be
}
// COMPAT: If they used the <text> tag we want to guarantee that it won't be
// merge with other string children.
STRINGS["delete"](node);

@@ -632,3 +585,2 @@ Object.assign(node, attributes);

*/
var createEditor = function createEditor(makeEditor) {

@@ -638,10 +590,7 @@ return function (tagName, attributes, children) {

var selectionChild;
var _iterator2 = _createForOfIteratorHelper(children),
_step2;
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var child = _step2.value;
if (slate.Range.isRange(child)) {

@@ -658,3 +607,2 @@ selectionChild = child;

}
var descendants = resolveDescendants(otherChildren);

@@ -664,21 +612,17 @@ var selection = {};

Object.assign(editor, attributes);
editor.children = descendants; // Search the document's texts to see if any of them have tokens associated
editor.children = descendants;
// Search the document's texts to see if any of them have tokens associated
// that need incorporated into the selection.
var _iterator3 = _createForOfIteratorHelper(slate.Node.texts(editor)),
_step3;
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var _step3$value = _slicedToArray(_step3.value, 2),
node = _step3$value[0],
path = _step3$value[1];
node = _step3$value[0],
path = _step3$value[1];
var anchor = getAnchorOffset(node);
var focus = getFocusOffset(node);
if (anchor != null) {
var _anchor = _slicedToArray(anchor, 1),
offset = _anchor[0];
offset = _anchor[0];
selection.anchor = {

@@ -689,7 +633,5 @@ path: path,

}
if (focus != null) {
var _focus = _slicedToArray(focus, 1),
_offset = _focus[0];
_offset = _focus[0];
selection.focus = {

@@ -706,11 +648,8 @@ path: path,

}
if (selection.anchor && !selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");
}
if (!selection.anchor && selection.focus) {
throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");
}
if (selectionChild != null) {

@@ -721,3 +660,2 @@ editor.selection = selectionChild;

}
return editor;

@@ -727,9 +665,7 @@ };

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(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
/**
* The default creators for Slate objects.
*/
var DEFAULT_CREATORS = {

@@ -748,11 +684,8 @@ anchor: createAnchor,

*/
var createHyperscript = function createHyperscript() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _options$elements = options.elements,
elements = _options$elements === void 0 ? {} : _options$elements;
elements = _options$elements === void 0 ? {} : _options$elements;
var elementCreators = normalizeElements(elements);
var creators = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_CREATORS), elementCreators), options.creators);
var jsx = createFactory(creators);

@@ -764,4 +697,2 @@ return jsx;

*/
var createFactory = function createFactory(creators) {

@@ -772,13 +703,9 @@ var jsx = function jsx(tagName, attributes) {

}
var creator = creators[tagName];
if (!creator) {
throw new Error("No hyperscript creator found for tag: <".concat(tagName, ">"));
}
if (attributes == null) {
attributes = {};
}
if (!isPlainObject(attributes)) {

@@ -788,3 +715,2 @@ children = [attributes].concat(children);

}
children = children.filter(function (child) {

@@ -796,3 +722,2 @@ return Boolean(child);

};
return jsx;

@@ -803,14 +728,9 @@ };

*/
var normalizeElements = function normalizeElements(elements) {
var creators = {};
var _loop = function _loop(tagName) {
var _loop = function _loop() {
var props = elements[tagName];
if (_typeof(props) !== 'object') {
throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(tagName, "> tag you passed: ").concat(props));
}
creators[tagName] = function (tagName, attributes, children) {

@@ -820,7 +740,5 @@ return createElement('element', _objectSpread(_objectSpread({}, props), attributes), children);

};
for (var tagName in elements) {
_loop(tagName);
_loop();
}
return creators;

@@ -832,3 +750,2 @@ };

*/
var jsx = createHyperscript();

@@ -841,4 +758,2 @@

Object.defineProperty(exports, '__esModule', { value: true });
})));
}));

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("slate")):"function"==typeof define&&define.amd?define(["exports","slate"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SlateHyperscript={},t.Slate)}(this,(function(t,e){"use strict";function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(t.exports=e=function(t){return typeof t},t.exports.default=t.exports,t.exports.__esModule=!0):(t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.default=t.exports,t.exports.__esModule=!0),e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0})),u=r(o),i=r(n((function(t){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.default=t.exports,t.exports.__esModule=!0})));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("slate")):"function"==typeof define&&define.amd?define(["exports","slate"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).SlateHyperscript={},t.Slate)}(this,(function(t,e){"use strict";function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var o=n((function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),i=r(o),u=n((function(t){var e=o.default;t.exports=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports}));r(u);var f=n((function(t){var e=o.default;t.exports=function(t){var r=u(t,"string");return"symbol"===e(r)?r:String(r)},t.exports.__esModule=!0,t.exports.default=t.exports}));r(f);var a=r(n((function(t){t.exports=function(t,e,r){return(e=f(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports})));
/*!

@@ -8,2 +8,2 @@ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>

*/
function s(t){return"[object Object]"===Object.prototype.toString.call(t)}function f(t){var e,r;return!1!==s(t)&&(void 0===(e=t.constructor)||!1!==s(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var a=n((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0}));r(a);var c=n((function(t){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,u=[],i=!0,s=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(u.push(n.value),!e||u.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(s)throw o}}return u}},t.exports.default=t.exports,t.exports.__esModule=!0}));r(c);var l=n((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.default=t.exports,t.exports.__esModule=!0}));r(l);var p=n((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0}));r(p);var d=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0}));r(d);var h=r(n((function(t){t.exports=function(t,e){return a(t)||c(t,e)||p(t,e)||d()},t.exports.default=t.exports,t.exports.__esModule=!0}))),y=n((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.default=t.exports,t.exports.__esModule=!0,e(r,n)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0}));r(y);var x=r(n((function(t){t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0}))),v=n((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.default=t.exports,t.exports.__esModule=!0}));r(v);var b=r(n((function(t){var e=o.default;t.exports=function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return v(t)},t.exports.default=t.exports,t.exports.__esModule=!0}))),g=r(n((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,e(r)}t.exports=e,t.exports.default=t.exports,t.exports.__esModule=!0}))),w=r(n((function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0})));function O(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=g(t);if(e){var o=g(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return b(this,r)}}var m=new WeakMap,j=new WeakMap,_=function t(){w(this,t)},P=function(t){x(r,t);var e=O(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w(this,r),t=e.call(this);var o=n.offset,u=n.path;return t.offset=o,t.path=u,t}return r}(_),S=function(t){x(r,t);var e=O(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};w(this,r),t=e.call(this);var o=n.offset,u=n.path;return t.offset=o,t.path=u,t}return r}(_),M=function(t){return j.get(t)};function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function A(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,i=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){s=!0,u=t},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw u}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var D=new WeakSet,I=function(t){var r,n=[],o=function t(r){if(null!=r){var o=n[n.length-1];if("string"==typeof r){var u={text:r};D.add(u),r=u}if(e.Text.isText(r)){var i=r;e.Text.isText(o)&&D.has(o)&&D.has(i)&&e.Text.equals(o,i,{loose:!0})?o.text+=i.text:n.push(i)}else if(e.Element.isElement(r))n.push(r);else{if(!(r instanceof _))throw new Error("Unexpected hyperscript child object: ".concat(r));var s=n[n.length-1];e.Text.isText(s)||(t(""),s=n[n.length-1]),r instanceof P?function(t,e){var r=t.text.length;m.set(t,[r,e])}(s,r):r instanceof S&&function(t,e){var r=t.text.length;j.set(t,[r,e])}(s,r)}}},u=A(t.flat(1/0));try{for(u.s();!(r=u.n()).done;){o(r.value)}}catch(t){u.e(t)}finally{u.f()}return n};function k(t,e,r){return T(T({},e),{},{children:I(r)})}function B(t,r,n){var o=I(n);if(o.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");var u=h(o,1)[0];if(null==u&&(u={text:""}),!e.Text.isText(u))throw new Error("\n The <text> hyperscript tag can only contain text content as children.");return D.delete(u),Object.assign(u,r),u}var C=function(t){return function(r,n,o){var u,i,s=[],f=A(o);try{for(f.s();!(i=f.n()).done;){var a=i.value;e.Range.isRange(a)?u=a:s.push(a)}}catch(t){f.e(t)}finally{f.f()}var c=I(s),l={},p=t();Object.assign(p,n),p.children=c;var d,y,x=A(e.Node.texts(p));try{for(x.s();!(d=x.n()).done;){var v=h(d.value,2),b=v[0],g=v[1],w=(y=b,m.get(y)),O=M(b);if(null!=w){var j=h(w,1)[0];l.anchor={path:g,offset:j}}if(null!=O){var _=h(O,1)[0];l.focus={path:g,offset:_}}}}catch(t){x.e(t)}finally{x.f()}if(l.anchor&&!l.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");if(!l.anchor&&l.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");return null!=u?p.selection=u:e.Range.isRange(l)&&(p.selection=l),p}};function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var q={anchor:function(t,e,r){return new P(e)},cursor:function(t,e,r){return[new P(e),new S(e)]},editor:C(e.createEditor),element:k,focus:function(t,e,r){return new S(e)},fragment:function(t,e,r){return I(r)},selection:function(t,e,r){var n=r.find((function(t){return t instanceof P})),o=r.find((function(t){return t instanceof S}));if(!n||null==n.offset||null==n.path)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");if(!o||null==o.offset||null==o.path)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");return T({anchor:{offset:n.offset,path:n.path},focus:{offset:o.offset,path:o.path}},e)},text:B},F=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.elements,r=void 0===e?{}:e,n=N(r),o=W(W(W({},q),n),t.creators),u=H(o);return u},H=function(t){return function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),u=2;u<n;u++)o[u-2]=arguments[u];var i=t[e];if(!i)throw new Error("No hyperscript creator found for tag: <".concat(e,">"));null==r&&(r={}),f(r)||(o=[r].concat(o),r={});var s=i(e,r,o=o.filter((function(t){return Boolean(t)})).flat());return s}},N=function(t){var e={},r=function(r){var n=t[r];if("object"!==u(n))throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(r,"> tag you passed: ").concat(n));e[r]=function(t,e,r){return k(0,W(W({},n),e),r)}};for(var n in t)r(n);return e},$=F();t.createEditor=C,t.createHyperscript=F,t.createText=B,t.jsx=$,Object.defineProperty(t,"__esModule",{value:!0})}));
function s(t){return"[object Object]"===Object.prototype.toString.call(t)}function c(t){var e,r;return!1!==s(t)&&(void 0===(e=t.constructor)||!1!==s(r=e.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf"))}var l=n((function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports}));r(l);var p=n((function(t){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,u,f=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=i.call(r)).done)&&(f.push(n.value),f.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{if(!a&&null!=r.return&&(u=r.return(),Object(u)!==u))return}finally{if(s)throw o}}return f}},t.exports.__esModule=!0,t.exports.default=t.exports}));r(p);var d=n((function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports}));r(d);var h=n((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}));r(h);var y=n((function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}));r(y);var x=r(n((function(t){t.exports=function(t,e){return l(t)||p(t,e)||h(t,e)||y()},t.exports.__esModule=!0,t.exports.default=t.exports}))),b=n((function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports})),v=r(b),g=n((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}));r(g);var w=r(n((function(t){t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports}))),O=n((function(t){var e=o.default;t.exports=function(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return b(t)},t.exports.__esModule=!0,t.exports.default=t.exports})),m=r(O),j=n((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})),_=r(j),P=r(n((function(t){function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports}))),S=r(n((function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports})));function M(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=_(t);if(e){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return m(this,r)}}var E=new WeakMap,T=new WeakMap,A=P((function t(){S(this,t)})),R=function(t){w(r,t);var e=M(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};S(this,r),t=e.call(this),a(v(t),"offset",void 0),a(v(t),"path",void 0);var o=n.offset,i=n.path;return t.offset=o,t.path=i,t}return P(r)}(A),D=function(t){w(r,t);var e=M(r);function r(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};S(this,r),t=e.call(this),a(v(t),"offset",void 0),a(v(t),"path",void 0);var o=n.offset,i=n.path;return t.offset=o,t.path=i,t}return P(r)}(A),k=function(t){return T.get(t)};function I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?I(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return N(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,f=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){f=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(f)throw i}}}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var U=new WeakSet,W=function(t){var r,n=[],o=function t(r){if(null!=r){var o=n[n.length-1];if("string"==typeof r){var i={text:r};U.add(i),r=i}if(e.Text.isText(r)){var u=r;e.Text.isText(o)&&U.has(o)&&U.has(u)&&e.Text.equals(o,u,{loose:!0})?o.text+=u.text:n.push(u)}else if(e.Element.isElement(r))n.push(r);else{if(!(r instanceof A))throw new Error("Unexpected hyperscript child object: ".concat(r));var f=n[n.length-1];e.Text.isText(f)||(t(""),f=n[n.length-1]),r instanceof R?function(t,e){var r=t.text.length;E.set(t,[r,e])}(f,r):r instanceof D&&function(t,e){var r=t.text.length;T.set(t,[r,e])}(f,r)}}},i=C(t.flat(1/0));try{for(i.s();!(r=i.n()).done;){o(r.value)}}catch(t){i.e(t)}finally{i.f()}return n};function q(t,e,r){return B(B({},e),{},{children:W(r)})}function F(t,r,n){var o=W(n);if(o.length>1)throw new Error("The <text> hyperscript tag must only contain a single node's worth of children.");var i=x(o,1)[0];if(null==i&&(i={text:""}),!e.Text.isText(i))throw new Error("\n The <text> hyperscript tag can only contain text content as children.");return U.delete(i),Object.assign(i,r),i}var H=function(t){return function(r,n,o){var i,u,f=[],a=C(o);try{for(a.s();!(u=a.n()).done;){var s=u.value;e.Range.isRange(s)?i=s:f.push(s)}}catch(t){a.e(t)}finally{a.f()}var c=W(f),l={},p=t();Object.assign(p,n),p.children=c;var d,h,y=C(e.Node.texts(p));try{for(y.s();!(d=y.n()).done;){var b=x(d.value,2),v=b[0],g=b[1],w=(h=v,E.get(h)),O=k(v);if(null!=w){var m=x(w,1)[0];l.anchor={path:g,offset:m}}if(null!=O){var j=x(O,1)[0];l.focus={path:g,offset:j}}}}catch(t){y.e(t)}finally{y.f()}if(l.anchor&&!l.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<anchor />`. For collapsed selections, use `<cursor />` instead.");if(!l.anchor&&l.focus)throw new Error("Slate hyperscript ranges must have both `<anchor />` and `<focus />` defined if one is defined, but you only defined `<focus />`. For collapsed selections, use `<cursor />` instead.");return null!=i?p.selection=i:e.Range.isRange(l)&&(p.selection=l),p}};function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var G={anchor:function(t,e,r){return new R(e)},cursor:function(t,e,r){return[new R(e),new D(e)]},editor:H(e.createEditor),element:q,focus:function(t,e,r){return new D(e)},fragment:function(t,e,r){return W(r)},selection:function(t,e,r){var n=r.find((function(t){return t instanceof R})),o=r.find((function(t){return t instanceof D}));if(!n||null==n.offset||null==n.path)throw new Error("The <selection> hyperscript tag must have an <anchor> tag as a child with `path` and `offset` attributes defined.");if(!o||null==o.offset||null==o.path)throw new Error("The <selection> hyperscript tag must have a <focus> tag as a child with `path` and `offset` attributes defined.");return B({anchor:{offset:n.offset,path:n.path},focus:{offset:o.offset,path:o.path}},e)},text:F},J=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.elements,r=void 0===e?{}:e,n=L(r),o=z(z(z({},G),n),t.creators),i=K(o);return i},K=function(t){return function(e,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;i<n;i++)o[i-2]=arguments[i];var u=t[e];if(!u)throw new Error("No hyperscript creator found for tag: <".concat(e,">"));null==r&&(r={}),c(r)||(o=[r].concat(o),r={});var f=u(e,r,o=o.filter((function(t){return Boolean(t)})).flat());return f}},L=function(t){var e={},r=function(){var r=t[n];if("object"!==i(r))throw new Error("Properties specified for a hyperscript shorthand should be an object, but for the custom element <".concat(n,"> tag you passed: ").concat(r));e[n]=function(t,e,n){return q(0,z(z({},r),e),n)}};for(var n in t)r();return e},Q=J();t.createEditor=H,t.createHyperscript=J,t.createText=F,t.jsx=Q}));

@@ -0,0 +0,0 @@ import { Path, Text } from 'slate';

{
"name": "slate-hyperscript",
"description": "A hyperscript helper for creating Slate documents.",
"version": "0.82.0-2022622233410",
"version": "0.100.0-20231020154238",
"license": "MIT",

@@ -20,8 +20,8 @@ "repository": "git://github.com/ianstormtaylor/slate.git",

"devDependencies": {
"@babel/runtime": "^7.7.4",
"slate": "^0.82.0-2022622233410",
"source-map-loader": "^4.0.0"
"@babel/runtime": "^7.23.2",
"slate": "0.100.0-20231020154238",
"source-map-loader": "^4.0.1"
},
"peerDependencies": {
"slate": ">=0.82.0-2022622233410"
"slate": "0.100.0-20231020154238"
},

@@ -28,0 +28,0 @@ "umdGlobals": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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